diff --git a/clash-bin/tests/data/config/Country-asn.mmdb b/clash-bin/tests/data/config/Country-asn.mmdb deleted file mode 100644 index 76d185fc6..000000000 Binary files a/clash-bin/tests/data/config/Country-asn.mmdb and /dev/null differ diff --git a/clash-bin/tests/data/config/GeoLite2-ASN.mmdb b/clash-bin/tests/data/config/GeoLite2-ASN.mmdb deleted file mode 100644 index 6a9257260..000000000 Binary files a/clash-bin/tests/data/config/GeoLite2-ASN.mmdb and /dev/null differ diff --git a/clash-bin/tests/data/config/anytls.json b/clash-bin/tests/data/config/anytls.json deleted file mode 100644 index eef9e3d0a..000000000 --- a/clash-bin/tests/data/config/anytls.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "log": { - "level": "info" - }, - "inbounds": [ - { - "type": "anytls", - "tag": "anytls-in", - "listen": "0.0.0.0", - "listen_port": 10002, - "users": [ - { - "name": "user", - "password": "example" - } - ], - "padding_scheme": ["stop=0"], - "tls": { - "enabled": true, - "certificate_path": "/etc/ssl/v2ray/fullchain.pem", - "key_path": "/etc/ssl/v2ray/privkey.pem" - } - } - ], - "outbounds": [ - { - "type": "direct", - "tag": "direct" - } - ] -} diff --git a/clash-bin/tests/data/config/dns.crt b/clash-bin/tests/data/config/certs/dns.crt similarity index 100% rename from clash-bin/tests/data/config/dns.crt rename to clash-bin/tests/data/config/certs/dns.crt diff --git a/clash-bin/tests/data/config/dns.key b/clash-bin/tests/data/config/certs/dns.key similarity index 100% rename from clash-bin/tests/data/config/dns.key rename to clash-bin/tests/data/config/certs/dns.key diff --git a/clash-bin/tests/data/config/example.org-key.pem b/clash-bin/tests/data/config/certs/example.org-key.pem similarity index 100% rename from clash-bin/tests/data/config/example.org-key.pem rename to clash-bin/tests/data/config/certs/example.org-key.pem diff --git a/clash-bin/tests/data/config/example.org.pem b/clash-bin/tests/data/config/certs/example.org.pem similarity index 100% rename from clash-bin/tests/data/config/example.org.pem rename to clash-bin/tests/data/config/certs/example.org.pem diff --git a/clash-bin/tests/data/config/config.test.yaml b/clash-bin/tests/data/config/config.test.yaml deleted file mode 100644 index d1a4e1312..000000000 --- a/clash-bin/tests/data/config/config.test.yaml +++ /dev/null @@ -1,140 +0,0 @@ -proxy-providers: - Tag: - type: file - path: ./wg.yaml - interval: 7200 - health-check: - enable: true - url: http://www.gstatic.com/generate_204 - interval: 300 -mixed-port: 7890 -allow-lan: false -mode: rule -log-level: debug -ipv6: false -external-controller: 0.0.0.0:9091 -dns: - enable: true - listen: 0.0.0.0:53 - ipv6: false - default-nameserver: - - 223.5.5.5 - - 114.114.114.114 - nameserver: - - 223.5.5.5 - - 114.114.114.114 - - 119.29.29.29 - - 180.76.76.76 - enhanced-mode: fake-ip - -tun: - enable: false - device-id: "dev://utun1989" - - -proxy-groups: - - name: PROXY - type: select - proxies: - - Tag - - DIRECT - - name: Tag - type: select - use: - - Tag - -rule-providers: - reject: - type: http - behavior: domain - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt" - path: ./ruleset/reject.yaml - interval: 36000 - - icloud: - type: http - behavior: domain - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt" - path: ./ruleset/icloud.yaml - interval: 36000 - - apple: - type: http - behavior: domain - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt" - path: ./ruleset/apple.yaml - interval: 36000 - - google: - type: http - behavior: domain - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt" - path: ./ruleset/google.yaml - interval: 36000 - - proxy: - type: http - behavior: domain - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt" - path: ./ruleset/proxy.yaml - interval: 36000 - - direct: - type: http - behavior: domain - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt" - path: ./ruleset/direct.yaml - interval: 36000 - - private: - type: http - behavior: domain - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt" - path: ./ruleset/private.yaml - interval: 36000 - - telegramcidr: - type: http - behavior: ipcidr - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt" - path: ./ruleset/telegramcidr.yaml - interval: 36000 - - cncidr: - type: http - behavior: ipcidr - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt" - path: ./ruleset/cncidr.yaml - interval: 36000 - - lancidr: - type: http - behavior: ipcidr - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt" - path: ./ruleset/lancidr.yaml - interval: 36000 - - applications: - type: http - behavior: classical - url: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt" - path: ./ruleset/applications.yaml - interval: 36000 - -rules: - - RULE-SET,applications,DIRECT - - DOMAIN,clash.razord.top,DIRECT - - DOMAIN,yacd.haishan.me,DIRECT - - RULE-SET,private,DIRECT - - RULE-SET,reject,REJECT - - DOMAIN,www.icloud.com,PROXY - - DOMAIN-SUFFIX,icloud-content.com,PROXY - - RULE-SET,icloud,DIRECT - - RULE-SET,apple,PROXY - - RULE-SET,google,PROXY - - RULE-SET,proxy,PROXY - - RULE-SET,direct,DIRECT - - RULE-SET,lancidr,DIRECT - - RULE-SET,cncidr,DIRECT - - RULE-SET,telegramcidr,PROXY - - MATCH,PROXY diff --git a/clash-bin/tests/data/config/dns.yaml b/clash-bin/tests/data/config/dns.yaml deleted file mode 100644 index 0805dc0ac..000000000 --- a/clash-bin/tests/data/config/dns.yaml +++ /dev/null @@ -1,22 +0,0 @@ -mixed-port: 7890 -mode: rule -log-level: trace - -tun: - enable: true - route-all: true - device-id: dev://utun1989 - dns-hijack: true - -dns: - enable: true - enhanced-mode: fake-ip - listen: - udp: 127.0.0.1:53 - fake-ip-range: 198.18.0.1/16 - nameserver: - - 223.5.5.5 - - 180.184.1.1 - -rules: - - MATCH,DIRECT diff --git a/clash-bin/tests/data/config/empty.yaml b/clash-bin/tests/data/config/empty.yaml index 85341669b..6f0eaba95 100644 --- a/clash-bin/tests/data/config/empty.yaml +++ b/clash-bin/tests/data/config/empty.yaml @@ -1,4 +1,6 @@ ---- +# Purpose: Minimal base config used by docker integration test helpers. +# Referenced by: clash-lib/src/proxy/utils/test_utils/docker_utils/config_helper.rs + port: 8888 socks-port: 8889 mixed-port: 8899 @@ -6,39 +8,21 @@ mixed-port: 8899 dns: enable: true listen: 127.0.0.1:53533 - # ipv6: false # when the false, response to AAAA questions will be empty - - # These nameservers are used to resolve the DNS nameserver hostnames below. - # Specify IP addresses only default-nameserver: - 114.114.114.114 - 8.8.8.8 - enhanced-mode: fake-ip # or fake-ip - fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR - # use-hosts: true # lookup hosts and return IP record - - # Hostnames in this list will not be resolved with fake IPs - # i.e. questions to these domain names will always be answered with their - # real IP addresses - # fake-ip-filter: - # - '*.lan' - # - localhost.ptlogin2.qq.com - - # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. - # All DNS questions are sent directly to the nameserver, without proxies - # involved. Clash answers the DNS question with the first result gathered. + enhanced-mode: fake-ip + fake-ip-range: 198.18.0.1/16 nameserver: - - 114.114.114.114 # default value - - 8.8.8.8 # default value - - tls://dns.google:853 # DNS over TLS - - https://1.1.1.1/dns-query # DNS over HTTPS + - 114.114.114.114 + - 8.8.8.8 + - tls://dns.google:853 + - https://1.1.1.1/dns-query allow-lan: true mode: rule log-level: debug external-controller: 127.0.0.1:6170 -experimental: - ignore-resolve-fail: true rules: - MATCH, DIRECT diff --git a/clash-bin/tests/data/config/full.yaml b/clash-bin/tests/data/config/full.yaml new file mode 100644 index 000000000..d6f79837a --- /dev/null +++ b/clash-bin/tests/data/config/full.yaml @@ -0,0 +1,800 @@ +# clash-rs full reference configuration +# ====================================== +# This file documents ALL supported configuration options with inline comments. +# It is NOT a working configuration — many values are examples/placeholders. +# See the other config files in this directory for real working examples. +# +# clash-rs repository: https://github.com/watfaq/clash-rs + +# ── Inbound Ports ───────────────────────────────────────────────────────────── +# Simple port bindings for the most common inbound types. +# Use the `listeners:` section below for advanced control (auth, per-listener TLS, etc.) + +port: 7890 # HTTP proxy port (0 or omit to disable) +socks-port: 7891 # SOCKS5 proxy port +mixed-port: 7892 # Combined HTTP + SOCKS5 port + +# redir-port: 7893 # Linux transparent proxy — redirect mode (requires root) +# tproxy-port: 7894 # Linux transparent proxy — tproxy mode (requires root) + +# HTTP and SOCKS5 inbound authentication (applies to port/socks-port/mixed-port) +# authentication: +# - "user1:pass1" +# - "user2:pass2" + +# ── Network Binding ─────────────────────────────────────────────────────────── +allow-lan: false # Accept connections from other LAN hosts + +# Bind address for inbound listeners (applies to all simple ports above): +# "*" or "0.0.0.0" — all IPv4 interfaces +# "::" — all IPv6 interfaces +# "127.0.0.1" — loopback only (default) +# Setting a non-loopback address automatically enables allow-lan. +bind-address: "127.0.0.1" + +# ── Run Mode ────────────────────────────────────────────────────────────────── +# rule — route traffic based on rules (recommended) +# global — forward all traffic through the first proxy in proxy-groups +# direct — bypass all proxies +mode: rule + +# ── Logging ─────────────────────────────────────────────────────────────────── +# trace | debug | info | warn | error | off +log-level: info + +# ── IPv6 ────────────────────────────────────────────────────────────────────── +ipv6: false # When false, AAAA DNS queries return empty answers + +# ── External Controller (REST API) ──────────────────────────────────────────── +external-controller: 127.0.0.1:9090 + +# Unix socket (on Unix) or named pipe (on Windows) for the REST API +# external-controller-unix: /tmp/clash-rs.sock + +# Web dashboard directory (served at http:///ui) +external-ui: public + +# Auto-download URL for the dashboard bundle (zip or tgz). +# Append #force=true to re-download even if the directory exists. +# Append #_clash_outbound= to route the download through a proxy. +# external-ui-url: "https://github.com/example/dashboard/releases/latest/download/dashboard.zip#force=true" + +# API authentication secret (strongly recommended when not on 127.0.0.1) +# secret: "change-me" + +# CORS allowed origins for the REST API +# cors-allow-origins: +# - "https://my-dashboard.example.com" + +# ── Outbound Interface ──────────────────────────────────────────────────────── +# Bind outbound connections to a specific network interface (not yet implemented) +# interface: en0 + +# fwmark for outbound packets on Linux — use in iptables to avoid routing loops +# routing-mark: 6666 + +# ── GeoIP / GeoSite Databases ───────────────────────────────────────────────── +mmdb: Country.mmdb # Path to MaxMind GeoLite2 Country DB (relative to CWD) +# mmdb-download-url: "https://github.com/Loyalsoldier/geoip/releases/download/.../Country.mmdb" + +asn-mmdb: Country-asn.mmdb # ASN database (optional) +# asn-mmdb-download-url: "https://github.com/Loyalsoldier/geoip/releases/download/.../Country-asn.mmdb" + +geosite: geosite.dat # GeoSite database for GEOSITE rules (optional) +# geosite-download-url: "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/.../geosite.dat" + +# ── Profile ─────────────────────────────────────────────────────────────────── +profile: + store-selected: true # Persist `select` group choices to cache.db + store-fake-ip: false # Persist fake-IP mappings to cache.db + store-smart-stats: true # Persist `smart` group statistics to cache.db + +# ── Static Hosts ────────────────────────────────────────────────────────────── +# Override DNS for specific hostnames (like /etc/hosts). +# Wildcards: *.example.com, .example.com (matches subdomains), +.foo.com (foo.com + *.foo.com) +hosts: + # "*.example.internal": 192.168.1.100 + # "+.local": 127.0.0.1 + +# ── Experimental ────────────────────────────────────────────────────────────── +experimental: + tcp-buffer-size: 65536 # Buffer size for bidirectional TCP copy (bytes) + +# ── DNS ─────────────────────────────────────────────────────────────────────── +dns: + enable: true + + ipv6: false # When false, AAAA queries return empty results + + # DNS listen address — simple UDP-only form: + # listen: 127.0.0.1:53 + # Multi-protocol form (each key is optional): + listen: + udp: 127.0.0.1:53 + tcp: 127.0.0.1:53 + dot: + addr: 127.0.0.1:853 + ca-cert: dns.crt # TLS certificate file (path relative to CWD) + ca-key: dns.key # TLS private key file + # Note: DoT does not support a virtual hostname — use addr for the listen address + doh: + addr: 127.0.0.1:443 + ca-cert: dns.crt + ca-key: dns.key + hostname: dns.clash # Virtual hostname for DoH (HTTP Host header) + doh3: # DNS-over-HTTP/3 (QUIC) + addr: 127.0.0.1:443 + ca-cert: dns.crt + ca-key: dns.key + hostname: dns.clash + + # DNS resolution mode: + # normal — resolve real IPs and return them (default) + # fake-ip — return fake IPs from the pool; real resolution happens at connect time + # redir-host — return a loopback IP; deprecated, prefer fake-ip + enhanced-mode: fake-ip + + # CIDR for the fake-IP pool (must not overlap with real routes) + fake-ip-range: 198.18.0.1/16 + + # Domains that bypass fake-IP — always resolved to their real IPs + fake-ip-filter: + - "*.lan" + - "localhost.ptlogin2.qq.com" + + # Whether to look up the `hosts` table during resolution + use-hosts: true + + # Bootstrap nameservers — used ONLY to resolve DoH/DoT server hostnames. + # Must be plain IP addresses (no hostnames). + default-nameserver: + - 114.114.114.114 + - 8.8.8.8 + + # Primary nameservers for all DNS queries. + # Supported URI schemes: plain IP, tls://, https://, dhcp:// + # + # URL fragment parameters (appended after #, combined with &): + # interface= bind this query to a specific network interface + # proxy= route this nameserver's queries through a named outbound + # proxy (any proxy type: ss, vmess, trojan, socks5, …) + # shorthand: a bare fragment with no = is treated as proxy= + # + # Examples: + # tls://1.1.1.1:853#en0 ← bind to interface en0 + # https://8.8.8.8/dns-query#proxy=MyProxy ← DNS-over-HTTPS via proxy "MyProxy" + # tls://1.1.1.1:853#auto ← proxy named "auto" + # 8.8.8.8#interface=eth0&proxy=MyProxy ← both options combined + nameserver: + - 114.114.114.114 + - 8.8.8.8 + - tls://1.1.1.1:853 # DNS-over-TLS (direct) + - https://1.1.1.1/dns-query # DNS-over-HTTPS (direct) + - https://8.8.8.8/dns-query#proxy=MyProxy # DNS-over-HTTPS routed through a proxy + # - dhcp://en0 # Use DHCP-assigned DNS for interface en0 + + # Fallback nameservers — queried concurrently with primary nameservers. + # Answers from fallback are used when the resolved IP's GEOIP is not in the + # allowed set (see fallback-filter below). Useful for anti-DNS-spoofing. + # Same fragment parameters (proxy=, interface=) apply here. + fallback: + - tls://8.8.8.8:853 + - https://8.8.4.4/dns-query + + # Controls when the fallback answer is preferred over the primary answer + fallback-filter: + geoip: true # Prefer fallback when IP's country != geoip-code + geoip-code: CN + ipcidr: # Prefer fallback if primary result is in these ranges + - 240.0.0.0/4 # (commonly used for bogus responses by Chinese ISPs) + domain: # Always use fallback for these domains + - "+.google.com" + - "+.facebook.com" + + # Route specific domain lookups to specific nameservers. + # Same fragment parameters (proxy=, interface=) apply to values here too. + nameserver-policy: + "+.internal.corp.com": "10.0.0.1" + "www.baidu.com": "114.114.114.114" + + # Nameservers used only for resolving proxy server hostnames (must be IPs). + # These also support the proxy= fragment to route through an outbound. + proxy-server-nameserver: + - 8.8.8.8 + - tls://1.1.1.1:853 + + # EDNS Client Subnet — sent along with upstream queries for geo-aware responses + edns-client-subnet: + ipv4: 1.2.3.0/24 + ipv6: 2001:db8::/56 + +# ── TUN Device ──────────────────────────────────────────────────────────────── +tun: + enable: false + + # Device identifier: + # "utun1989" — macOS (utun prefix required by the OS) + # "dev://tun0" — Linux explicit device + # "fd://3" — use an existing open file descriptor + device-id: "dev://utun1989" + + gateway: "198.18.0.1/24" # TUN IPv4 address and prefix + gateway-v6: "fd00:fac::1/64" # TUN IPv6 address (enables IPv6 in TUN) + + route-all: true # Install a default route through the TUN + + # Additional static routes through the TUN (used when route-all is false) + routes: + - 1.1.1.1/32 + - 8.8.8.8/32 + + # mtu: 1500 # MTU for the TUN interface + + so-mark: 0 # fwmark for TUN-originated packets (Linux only) + route-table: 2468 # Policy routing table (Linux only) + + # Intercept DNS queries and redirect them to the Clash DNS server. + # true = hijack all DNS, false = no hijack + # List form = hijack only specific addresses: + dns-hijack: true + # dns-hijack: + # - 1.1.1.1:53 + # - 8.8.8.8:53 + +# ── Inbound Listeners (Advanced) ────────────────────────────────────────────── +# Fine-grained control over inbound endpoints. These supplement or replace the +# simple port settings (port:, socks-port:, etc.) above. +listeners: + - name: http-in # HTTP proxy + type: http + listen: 127.0.0.1 + port: 7890 + # allow-lan: false # Accept connections beyond loopback (overrides global allow-lan) + # fw-mark: 0 # fwmark for accepted packets on Linux (CAP_NET_ADMIN) + + - name: socks-in # SOCKS5 proxy + type: socks + listen: 127.0.0.1 + port: 7891 + udp: true + + - name: mixed-in # HTTP + SOCKS5 combined + type: mixed + listen: 127.0.0.1 + port: 7892 + udp: true + + # Linux tproxy (requires CAP_NET_ADMIN): + # - name: tproxy-in + # type: tproxy + # listen: 0.0.0.0 + # port: 7893 + # udp: true + + # Linux redir (requires CAP_NET_ADMIN): + # - name: redir-in + # type: redir + # listen: 0.0.0.0 + # port: 7894 + + - name: tunnel-in # Forward all traffic to a fixed target + type: tunnel + listen: 127.0.0.1 + port: 7900 + network: [tcp, udp] + target: "192.168.1.1:80" + + # Shadowsocks inbound (requires shadowsocks feature): + - name: ss-in + type: shadowsocks + listen: 0.0.0.0 + port: 8388 + cipher: 2022-blake3-aes-256-gcm + password: "base64-encoded-32-byte-key-here=" + udp: true + # Multi-user EIH (SS2022 only) — name is stored as inboundUser in metadata: + # users: + # - name: alice + # password: "alice-base64-32-byte-key=" + # - name: bob + # password: "bob-base64-32-byte-key=" + +# Inbound providers — load listener lists from files or HTTP endpoints. +# The referenced YAML must have a top-level `listeners:` key. +# inbound-providers: +# my-listeners: +# type: file +# path: ./listeners.yaml +# interval: 3600 +# remote-listeners: +# type: http +# url: "https://example.com/listeners.yaml" +# interval: 86400 +# path: ./providers/listeners.yaml + +# ── Proxies ─────────────────────────────────────────────────────────────────── +proxies: + + # ── Shadowsocks ───────────────────────────────────────────────────────────── + # Supported ciphers: + # Legacy : aes-128-gcm, aes-256-gcm, chacha20-ietf-poly1305 + # SS2022 : 2022-blake3-aes-128-gcm, 2022-blake3-aes-256-gcm + - name: ss-legacy + type: ss + server: 1.2.3.4 + port: 8388 + cipher: aes-256-gcm + password: "mypassword" + udp: true + # connect-via: another-proxy # chain through another proxy (alias: dialer-proxy) + # Simple-obfs plugin: + # plugin: obfs + # plugin-opts: + # mode: http # http | tls + # host: example.com + + - name: ss-2022 + type: ss + server: 1.2.3.4 + port: 8390 + cipher: 2022-blake3-aes-256-gcm + # Single-user: base64-encoded 32-byte key + password: "base64-encoded-32-byte-server-key=" + # Multi-user (server-key:user-key): + # password: "server-key=:user-key=" + udp: true + + # ── SOCKS5 ────────────────────────────────────────────────────────────────── + - name: socks5-plain + type: socks5 + server: 1.2.3.4 + port: 1080 + udp: true + + - name: socks5-auth + type: socks5 + server: 1.2.3.4 + port: 1080 + username: user + password: pass + tls: true # TLS-wrapped SOCKS5 + sni: example.com + skip-cert-verify: false + udp: true + + # ── VMess ──────────────────────────────────────────────────────────────────── + - name: vmess-tcp + type: vmess + server: 1.2.3.4 + port: 443 + uuid: b831381d-6324-4d53-ad4f-8cda48b30811 + alterId: 0 # 0 = AEAD (recommended); >0 = legacy MD5 auth + cipher: auto # auto | aes-128-gcm | chacha20-poly1305 | none + udp: true + tls: true + skip-cert-verify: false + server-name: example.com # SNI (alias: servername) + + - name: vmess-ws + type: vmess + server: 1.2.3.4 + port: 443 + uuid: b831381d-6324-4d53-ad4f-8cda48b30811 + alterId: 0 + cipher: auto + network: ws + ws-opts: + path: /ws + headers: + Host: example.com + max-early-data: 2048 # 0-RTT early data size in bytes + early-data-header-name: Sec-WebSocket-Protocol + + - name: vmess-h2 + type: vmess + server: 1.2.3.4 + port: 8443 + uuid: b831381d-6324-4d53-ad4f-8cda48b30811 + alterId: 0 + cipher: auto + tls: true + network: h2 + h2-opts: + path: /h2 + host: + - example.com + + - name: vmess-grpc + type: vmess + server: 1.2.3.4 + port: 443 + uuid: b831381d-6324-4d53-ad4f-8cda48b30811 + alterId: 0 + cipher: auto + tls: true + network: grpc + grpc-opts: + grpc-service-name: GunService + + # ── VLESS ──────────────────────────────────────────────────────────────────── + - name: vless-ws-tls + type: vless + server: 1.2.3.4 + port: 443 + uuid: b831381d-6324-4d53-ad4f-8cda48b30811 + tls: true + server-name: example.com # SNI (alias: servername) + network: ws + ws-opts: + path: /ws + headers: + Host: example.com + skip-cert-verify: false + udp: true + + - name: vless-grpc + type: vless + server: 1.2.3.4 + port: 443 + uuid: b831381d-6324-4d53-ad4f-8cda48b30811 + tls: true + server-name: example.com + network: grpc + grpc-opts: + grpc-service-name: GunService + udp: true + + - name: vless-reality + type: vless + server: 1.2.3.4 + port: 443 + uuid: b831381d-6324-4d53-ad4f-8cda48b30811 + tls: true + server-name: www.icloud.com # SNI must match the REALITY target domain + network: tcp + flow: xtls-rprx-vision # XTLS Vision flow control (required for REALITY) + client-fingerprint: chrome # TLS fingerprint: chrome | firefox | safari | ios | android | edge | 360 | qq | random + reality-opts: + public-key: "server-reality-public-key" + short-id: "0123456789abcdef" + udp: true + + # ── Trojan ─────────────────────────────────────────────────────────────────── + - name: trojan-tcp + type: trojan + server: 1.2.3.4 + port: 443 + password: "trojan-password" + sni: example.com + skip-cert-verify: false + alpn: + - h2 + - http/1.1 + udp: true + + - name: trojan-grpc + type: trojan + server: 1.2.3.4 + port: 443 + password: "trojan-password" + sni: example.com + alpn: + - h2 + network: grpc + grpc-opts: + grpc-service-name: GunService + + - name: trojan-ws + type: trojan + server: 1.2.3.4 + port: 443 + password: "trojan-password" + sni: example.com + network: ws + ws-opts: + path: /ws + + # ── AnyTLS ─────────────────────────────────────────────────────────────────── + - name: anytls-example + type: anytls + server: 1.2.3.4 + port: 443 + password: "anytls-password" + sni: example.com + skip-cert-verify: false + alpn: + - h2 + - http/1.1 + udp: true + # client-fingerprint: chrome # parsed but not yet applied at runtime + # idle-session-check-interval: 30 + # idle-session-timeout: 30 + # min-idle-session: 0 + + # ── WireGuard ───────────────────────────────────────────────────────────────── + - name: wg-example + type: wireguard + server: wg.example.com + port: 51820 + private-key: "your-base64-private-key=" + public-key: "server-base64-public-key=" + # preshared-key: "base64-psk=" # optional pre-shared key for extra security + ip: 10.0.0.2/32 + ipv6: "fd86:ea04:1115::2/128" # optional IPv6 address inside the tunnel + allowed-ips: + - 0.0.0.0/0 + - ::/0 + mtu: 1420 + # reserved-bits: [0, 0, 0] # Cloudflare WARP reserved bytes + remote-dns-resolve: true # resolve DNS inside the WireGuard tunnel + dns: + - 1.1.1.1 + - 8.8.8.8 + udp: true + + # ── TUIC v5 ─────────────────────────────────────────────────────────────────── + - name: tuic-example + type: tuic + server: 1.2.3.4 + port: 443 + uuid: "550e8400-e29b-41d4-a716-446655440000" + password: "tuic-password" + alpn: + - h3 + sni: example.com + skip-cert-verify: false + # ip: 1.2.3.4 # override DNS resolution of server field + udp-relay-mode: native # native | quic + congestion-controller: bbr # bbr | cubic | new_reno + reduce-rtt: false # 0-RTT handshake + heartbeat-interval: 10000 # ms + request-timeout: 8000 # ms + max-udp-relay-packet-size: 1500 # bytes + fast-open: false + max-open-stream: 100 + disable-sni: false + send-window: 16777216 # bytes + receive-window: 8388608 # bytes + gc-interval: 3000 # ms; garbage collect expired sessions + gc-lifetime: 15000 # ms; lifetime of a session before GC + + # ── Hysteria2 ───────────────────────────────────────────────────────────────── + - name: hy2-example + type: hysteria2 + server: 1.2.3.4 + port: 443 + password: "hy2-password" + sni: example.com + skip-cert-verify: false + alpn: + - h3 + # Port hopping — improves reliability over port-blocking networks: + # ports: "10000-10010" + # Obfuscation (currently only salamander is supported): + obfs: salamander + obfs-password: "obfs-secret" + # Bandwidth hints for Brutal congestion control (Mbps): + # up: 50 + # down: 100 + # QUIC tuning: + # cwnd: 4 # congestion window + # udp-mtu: 1400 + # disable-mtu-discovery: false + # Custom CA for self-signed certs: + # ca: /path/to/ca.crt + # ca-str: "-----BEGIN CERTIFICATE-----\n..." + # fingerprint: "sha256//..." + + # ── SSH ─────────────────────────────────────────────────────────────────────── + # Requires the `ssh` feature flag. + - name: ssh-example + type: ssh + server: 1.2.3.4 + port: 22 + username: myuser + # One of: password auth or key auth + password: "ssh-password" + # private-key: "-----BEGIN OPENSSH PRIVATE KEY-----\n...\n-----END OPENSSH PRIVATE KEY-----" + # private-key-passphrase: "key-passphrase" + # Known-host fingerprints for server verification (recommended): + # host-key: + # - "ssh-ed25519 AAAA..." + # host-key-algorithms: + # - ssh-ed25519 + # - rsa-sha2-256 + # TOTP second factor (via otpauth:// URI or explicit parameters): + # totp-opt: + # otp-auth: "otpauth://totp/example?secret=BASE32SECRET&algorithm=SHA1&digits=6&period=30" + + # ── ShadowQUIC ──────────────────────────────────────────────────────────────── + # Requires the `shadowquic` feature flag. + - name: shadowquic-example + type: shadowquic + server: 1.2.3.4 + port: 443 + username: "myusername" + password: "mypassword" + server-name: example.com # must match server's JLS upstream domain + alpn: + - h3 + congestion-control: bbr # bbr | new-reno | cubic + zero-rtt: true + over-stream: false # true = use QUIC streams for UDP (like TUIC native) + initial-mtu: 1300 # bytes; recommended 1400 for high-loss networks + min-mtu: 1290 + keep-alive-interval: 10000 # ms; 0 = disable keep-alive + gso: true # Generalized Segmentation Offload + mtu-discovery: true # probe optimal MTU automatically + + # ── Tailscale ───────────────────────────────────────────────────────────────── + # Requires the `tailscale` feature flag. + - name: tailscale-example + type: tailscale + # state-dir: /var/lib/clash-rs/tailscale # Tailscale state directory + auth-key: "tskey-auth-..." # Tailscale auth key (from https://login.tailscale.com/admin/settings/keys) + hostname: clash-proxy # Node hostname in the Tailscale network + # control-url: "https://login.tailscale.com" + # client-name: "my-clash" + ephemeral: false # Remove node from Tailscale when clash exits + + # ── Tor ─────────────────────────────────────────────────────────────────────── + # Requires the `onion` feature flag. No configuration needed — uses embedded Tor. + - name: tor + type: tor + +# ── Proxy Groups ────────────────────────────────────────────────────────────── +proxy-groups: + + # select — manual selection via API or dashboard + - name: "Manual" + type: select + proxies: + - ss-legacy + - vmess-tcp + - trojan-tcp + - DIRECT + - REJECT + # use: [provider-name] # include proxies from a proxy-provider + udp: true + icon: "https://example.com/icon.png" + + # url-test — automatically pick the lowest-latency proxy + - name: "Auto" + type: url-test + proxies: + - ss-legacy + - vmess-tcp + # use: [provider-name] + url: "http://www.gstatic.com/generate_204" + interval: 300 # seconds between health checks + lazy: true # skip checks until traffic arrives + tolerance: 50 # switch only if new best beats current by >50ms + icon: "https://example.com/icon.png" + + # fallback — use first available proxy in priority order + - name: "Fallback" + type: fallback + proxies: + - ss-legacy + - vmess-tcp + - DIRECT + url: "http://www.gstatic.com/generate_204" + interval: 300 + lazy: false + + # load-balance — distribute connections across proxies + - name: "LoadBalance" + type: load-balance + proxies: + - ss-legacy + - vmess-tcp + url: "http://www.gstatic.com/generate_204" + interval: 300 + # strategy: consistent-hashing | round-robin | sticky-session + strategy: round-robin + + # relay — chain proxies sequentially: traffic flows A -> B -> C -> destination + - name: "Relay" + type: relay + proxies: + - ss-legacy + - trojan-tcp + + # smart — adaptive selection using latency, success rate, and optional bandwidth + - name: "Smart" + type: smart + proxies: + - ss-legacy + - vmess-tcp + - DIRECT + url: "http://www.gstatic.com/generate_204" + lazy: true + max-retries: 3 # max connection retries before marking failed + site-stickiness: 0.8 # 0.0-1.0; higher = same proxy per site more often + bandwidth-weight: 0.0 # >0 to factor in bandwidth in proxy selection + +# ── Proxy Providers ─────────────────────────────────────────────────────────── +# Load proxy lists from files or remote URLs. +# The file/response must be a YAML document with a top-level `proxies:` list. +proxy-providers: + local-proxies: + type: file + path: ./proxies.yaml + interval: 3600 # seconds between file re-reads (0 = no re-read) + health-check: + enable: true + url: "http://www.gstatic.com/generate_204" + interval: 300 + lazy: true + + remote-proxies: + type: http + url: "https://example.com/subscription" + interval: 86400 # seconds between downloads + path: ./providers/remote.yaml # local cache path + health-check: + enable: true + url: "http://www.gstatic.com/generate_204" + interval: 300 + +# ── Rule Providers ──────────────────────────────────────────────────────────── +# Load rule sets from files or remote URLs. +# behavior: domain | ipcidr | classical +rule-providers: + local-domain-rules: + type: file + path: ./rule-set.yaml + interval: 86400 + behavior: domain + format: yaml # yaml (default) | text | mrs + + remote-rules: + type: http + url: "https://example.com/rules.yaml" + path: ./ruleset/remote-rules.yaml + interval: 86400 + behavior: classical + # format: yaml # yaml (default) | text | mrs + +# ── Rules ───────────────────────────────────────────────────────────────────── +# Evaluated top-to-bottom; first match wins. +# Format: RULE-TYPE,payload,proxy[,no-resolve] +# `no-resolve` skips DNS resolution for IP-based rules — use for LAN/private ranges. +rules: + # ── Domain rules ──────────────────────────────────────────────────────────── + - DOMAIN,example.com,Manual # exact domain match + - DOMAIN-SUFFIX,example.com,Manual # domain + all subdomains + - DOMAIN-KEYWORD,google,Auto # substring match in any domain label + - DOMAIN-REGEX,^www\.google\.com$,Auto # full regex match + + # ── IP-based rules ────────────────────────────────────────────────────────── + - IP-CIDR,1.1.1.1/32,DIRECT # IPv4 CIDR + - IP-CIDR6,2606:4700:4700::1111/128,DIRECT # IPv6 CIDR (alias for IP-CIDR, same behavior) + - IP-CIDR,192.168.0.0/16,DIRECT,no-resolve # skip DNS for private ranges + - SRC-IP-CIDR,192.168.1.0/24,DIRECT # match on source IP + + # ── GeoIP / GeoSite rules ─────────────────────────────────────────────────── + - GEOIP,CN,DIRECT # IP geolocated to China + - GEOIP,CN,DIRECT,no-resolve # same, skip DNS + - GEOSITE,cn,DIRECT # domain in GeoSite CN category + + # ── Port rules ─────────────────────────────────────────────────────────────── + - DST-PORT,53,Manual # destination port (range: 1000-2000) + - SRC-PORT,7777,DIRECT # source port + + # ── Network / process rules ────────────────────────────────────────────────── + - NETWORK,UDP,Manual # TCP or UDP + - PROCESS-NAME,curl,DIRECT # process name (requires TUN on most OSes) + - PROCESS-PATH,/usr/bin/curl,DIRECT # full process path + + # ── Rule-set rules ─────────────────────────────────────────────────────────── + - RULE-SET,local-domain-rules,DIRECT # apply a rule-provider + + # ── Composite (logical) rules ──────────────────────────────────────────────── + - AND,((DOMAIN,baidu.com),(NETWORK,UDP)),DIRECT + - OR,((NETWORK,UDP),(DOMAIN,example.com)),Manual + - NOT,((DOMAIN,baidu.com)),Manual + - AND,((DOMAIN,example.com),(OR,((SRC-IP-CIDR,192.168.0.0/16),(SRC-PORT,7777)))),DIRECT + + # ── Catch-all (must be last) ───────────────────────────────────────────────── + - MATCH,Manual diff --git a/clash-bin/tests/data/config/hysteria.json b/clash-bin/tests/data/config/hysteria.json deleted file mode 100644 index b2e36c30b..000000000 --- a/clash-bin/tests/data/config/hysteria.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "listen": ":10002", - "tls":{ - "cert": "/home/ubuntu/my.crt", - "key": "/home/ubuntu/my.key" - }, - "obfs": { - "type": "salamander", - "salamander": { - "password": "beauty will save the world" - } - }, - "up_mbps": 100, - "down_mbps": 100, - "auth": { - "type": "password", - "password": "passwd" - } -} diff --git a/clash-bin/tests/data/config/hysteria2.yaml b/clash-bin/tests/data/config/hysteria2.yaml deleted file mode 100644 index aff9a6755..000000000 --- a/clash-bin/tests/data/config/hysteria2.yaml +++ /dev/null @@ -1,57 +0,0 @@ ---- -port: 8891 -socks-port: 8889 -mixed-port: 8888 - - -dns: - enable: true - listen: 127.0.0.1:53533 - # ipv6: false # when the false, response to AAAA questions will be empty - - # These nameservers are used to resolve the DNS nameserver hostnames below. - # Specify IP addresses only - default-nameserver: - - 114.114.114.114 - - 8.8.8.8 - enhanced-mode: fake-ip # or fake-ip - fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR - # use-hosts: true # lookup hosts and return IP record - - # Hostnames in this list will not be resolved with fake IPs - # i.e. questions to these domain names will always be answered with their - # real IP addresses - # fake-ip-filter: - # - '*.lan' - # - localhost.ptlogin2.qq.com - - # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. - # All DNS questions are sent directly to the nameserver, without proxies - # involved. Clash answers the DNS question with the first result gathered. - nameserver: - - 114.114.114.114 # default value - - 8.8.8.8 # default value - # - tls://dns.google:853 # DNS over TLS - # - https://1.1.1.1/dns-query # DNS over HTTPS - # - dhcp://en0 # dns from dhcp - -allow-lan: true -mode: rule -log-level: debug -external-controller: 127.0.0.1:6170 -experimental: - ignore-resolve-fail: true - -proxies: - - name: "local" - type: hysteria2 - server: 127.0.0.1 - port: 10086 - password: passwd - sni: example.com - skip-cert-verify: true - obfs: salamander - obfs-password: "passwd" - -rules: - - MATCH, local diff --git a/clash-bin/tests/data/config/listeners/tunnel.yaml b/clash-bin/tests/data/config/listeners/tunnel.yaml deleted file mode 100644 index 9c04a64de..000000000 --- a/clash-bin/tests/data/config/listeners/tunnel.yaml +++ /dev/null @@ -1,10 +0,0 @@ -port: 8080 -socks-port: 8081 -log-level: trace -listeners: -- name: tunnel-in - type: tunnel - port: 15201 - listen: 127.0.0.1 - network: [tcp, udp] - target: 127.0.0.1:5201 diff --git a/clash-bin/tests/data/config/public/CNAME b/clash-bin/tests/data/config/public/CNAME deleted file mode 100644 index 356aa6f5e..000000000 --- a/clash-bin/tests/data/config/public/CNAME +++ /dev/null @@ -1 +0,0 @@ -yacd.haishan.me diff --git a/clash-bin/tests/data/config/public/_headers b/clash-bin/tests/data/config/public/_headers deleted file mode 100644 index 877d928f2..000000000 --- a/clash-bin/tests/data/config/public/_headers +++ /dev/null @@ -1,12 +0,0 @@ -# for netlify hosting -# https://docs.netlify.com/routing/headers/#syntax-for-the-headers-file - -/* - X-Frame-Options: DENY - X-XSS-Protection: 1; mode=block - X-Content-Type-Options: nosniff - Referrer-Policy: same-origin -/*.css - Cache-Control: public, max-age=31536000, immutable -/*.js - Cache-Control: public, max-age=31536000, immutable diff --git a/clash-bin/tests/data/config/public/apple-touch-icon-precomposed.png b/clash-bin/tests/data/config/public/apple-touch-icon-precomposed.png deleted file mode 100644 index e83c40f5f..000000000 Binary files a/clash-bin/tests/data/config/public/apple-touch-icon-precomposed.png and /dev/null differ diff --git a/clash-bin/tests/data/config/public/assets/Config.39d8d2ef.css b/clash-bin/tests/data/config/public/assets/Config.39d8d2ef.css deleted file mode 100644 index 270732bca..000000000 --- a/clash-bin/tests/data/config/public/assets/Config.39d8d2ef.css +++ /dev/null @@ -1 +0,0 @@ -._root_v2s4h_1,._section_v2s4h_2{display:grid;grid-template-columns:repeat(auto-fill,minmax(345px,1fr));max-width:900px;gap:5px}@media screen and (min-width: 30em){._root_v2s4h_1,._section_v2s4h_2{gap:15px}}._root_v2s4h_1,._section_v2s4h_2{padding:6px 15px 10px}@media screen and (min-width: 30em){._root_v2s4h_1,._section_v2s4h_2{padding:10px 40px 15px}}._wrapSwitch_v2s4h_26{height:40px;display:flex;align-items:center}._sep_v2s4h_32{max-width:900px;padding:0 15px}@media screen and (min-width: 30em){._sep_v2s4h_32{padding:0 40px}}._sep_v2s4h_32>div{border-top:1px dashed #373737}._label_v2s4h_45{padding:11px 0}._fieldset_1ghjp_1{margin:0;padding:0;border:0;display:flex;flex-wrap:wrap}._input_1ghjp_9+._cnt_1ghjp_9{border:1px solid transparent;border-radius:8px;cursor:pointer;margin-right:5px;margin-bottom:5px}._input_1ghjp_9:focus+._cnt_1ghjp_9{border-color:#387cec}._input_1ghjp_9:checked+._cnt_1ghjp_9{border-color:#387cec} diff --git a/clash-bin/tests/data/config/public/assets/Config.c09e8dbe.js b/clash-bin/tests/data/config/public/assets/Config.c09e8dbe.js deleted file mode 100644 index 87874653a..000000000 --- a/clash-bin/tests/data/config/public/assets/Config.c09e8dbe.js +++ /dev/null @@ -1 +0,0 @@ -import{r as U,b as c,j as t,k as y,s as j,i as S,c as V,l as W,n as L,o as P,q as H,e as T,t as G,h as $,v as q,w as F,x as b,y as J,u as K,C as Q,z as X,B as Y,A as Z,D as ee}from"./index.171f553a.js";import{r as te}from"./logs.43986220.js";import{S as w}from"./Select.6c389032.js";function ne(e,s){if(e==null)return{};var r=ae(e,s),l,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&(!Object.prototype.propertyIsEnumerable.call(e,l)||(r[l]=e[l]))}return r}function ae(e,s){if(e==null)return{};var r={},l=Object.keys(e),a,o;for(o=0;o=0)&&(r[a]=e[a]);return r}var _=U.exports.forwardRef(function(e,s){var r=e.color,l=r===void 0?"currentColor":r,a=e.size,o=a===void 0?24:a,u=ne(e,["color","size"]);return c("svg",{ref:s,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...u,children:[t("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),t("polyline",{points:"16 17 21 12 16 7"}),t("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})});_.propTypes={color:y.exports.string,size:y.exports.oneOfType([y.exports.string,y.exports.number])};_.displayName="LogOut";const oe=_,{useState:se,useRef:le,useEffect:re,useCallback:ce}=S;function ie(e){return t("input",{className:j.input,...e})}function de({value:e,...s}){const[r,l]=se(e),a=le(e);re(()=>{a.current!==e&&l(e),a.current=e},[e]);const o=ce(u=>l(u.target.value),[l]);return t("input",{className:j.input,value:r,onChange:o,...s})}const ue="_root_v2s4h_1",pe="_section_v2s4h_2",he="_wrapSwitch_v2s4h_26",ge="_sep_v2s4h_32",fe="_label_v2s4h_45",d={root:ue,section:pe,wrapSwitch:he,sep:ge,label:fe},ve="_fieldset_1ghjp_1",me="_input_1ghjp_9",ye="_cnt_1ghjp_9",k={fieldset:ve,input:me,cnt:ye};function Ce({OptionComponent:e,optionPropsList:s,selectedIndex:r,onChange:l}){const a=V("visually-hidden",k.input),o=u=>{l(u.target.value)};return t("fieldset",{className:k.fieldset,children:s.map((u,h)=>c("label",{children:[t("input",{type:"radio",checked:r===h,name:"selection",value:h,"aria-labelledby":"traffic chart type "+h,onChange:o,className:a}),t("div",{className:k.cnt,children:t(e,{...u})})]},h))})}const{useMemo:be}=S,we={plugins:{legend:{display:!1}},scales:{x:{display:!1,type:"category"},y:{display:!1,type:"linear"}}},M=[23e3,35e3,46e3,33e3,9e4,68e3,23e3,45e3],ke=[184e3,183e3,196e3,182e3,19e4,186e3,182e3,189e3],Se=M;function _e({id:e}){const s=W.read(),r=be(()=>({labels:Se,datasets:[{...L,...P[e].up,data:M},{...L,...P[e].down,data:ke}]}),[e]),l="chart-"+e;return H(s.Chart,l,r,null,we),t("div",{style:{width:100,padding:5},children:t("canvas",{id:l})})}const{useEffect:R,useState:xe,useCallback:g,useRef:Oe,useMemo:Ie}=S,Ne=[{id:0},{id:1},{id:2},{id:3}],Le=[["debug","Debug"],["info","Info"],["warning","Warning"],["error","Error"],["silent","Silent"]],Pe=[{key:"port",label:"HTTP Proxy Port"},{key:"socks-port",label:"SOCKS5 Proxy Port"},{key:"mixed-port",label:"Mixed Port"},{key:"redir-port",label:"Redir Port"}],je=[["zh","\u4E2D\u6587"],["en","English"]],Te=[["Global","Global"],["Rule","Rule"],["Direct","Direct"]],$e=e=>({configs:G(e),apiConfig:$(e)}),Me=e=>({selectedChartStyleIndex:Z(e),latencyTestUrl:ee(e),apiConfig:$(e)}),Re=T(Me)(Ae),Ue=T($e)(ze);function ze({dispatch:e,configs:s,apiConfig:r}){return R(()=>{e(q(r))},[e,r]),t(Re,{configs:s})}function Ae({dispatch:e,configs:s,selectedChartStyleIndex:r,latencyTestUrl:l,apiConfig:a}){const[o,u]=xe(s),h=Oe(s);R(()=>{h.current!==s&&u(s),h.current=s},[s]);const z=g(()=>{e(F("apiConfig"))},[e]),f=g((n,i)=>{u({...o,[n]:i})},[o]),A=g(n=>{const i="allow-lan",p=n;f(i,p),e(b(a,{"allow-lan":p}))},[a,e,f]),v=g(({name:n,value:i})=>{switch(n){case"mode":case"log-level":f(n,i),e(b(a,{[n]:i})),n==="log-level"&&te({...a,logLevel:i});break;case"redir-port":case"socks-port":case"mixed-port":case"port":if(i!==""){const p=parseInt(i,10);if(p<0||p>65535)return}f(n,i);break;default:return}},[a,e,f]),E=g(n=>v(n.target),[v]),{selectChartStyleIndex:B,updateAppConfig:x}=J(),O=g(n=>{const i=n.target,{name:p,value:N}=i;switch(p){case"port":case"socks-port":case"mixed-port":case"redir-port":{const C=parseInt(N,10);if(C<0||C>65535)return;e(b(a,{[p]:C}));break}case"latencyTestUrl":{x(p,N);break}default:throw new Error(`unknown input name ${p}`)}},[a,e,x]),D=Ie(()=>{const n=o.mode;return typeof n=="string"&&n[0].toUpperCase()+n.slice(1)},[o.mode]),{t:m,i18n:I}=K();return c("div",{children:[t(Q,{title:m("Config")}),c("div",{className:d.root,children:[Pe.map(n=>o[n.key]!==void 0?c("div",{children:[t("div",{className:d.label,children:n.label}),t(ie,{name:n.key,value:o[n.key],onChange:E,onBlur:O})]},n.key):null),c("div",{children:[t("div",{className:d.label,children:"Mode"}),t(w,{options:Te,selected:D,onChange:n=>v({name:"mode",value:n.target.value})})]}),c("div",{children:[t("div",{className:d.label,children:"Log Level"}),t(w,{options:Le,selected:o["log-level"],onChange:n=>v({name:"log-level",value:n.target.value})})]}),c("div",{children:[t("div",{className:d.label,children:"Allow LAN"}),t("div",{className:d.wrapSwitch,children:t(X,{name:"allow-lan",checked:o["allow-lan"],onChange:A})})]})]}),t("div",{className:d.sep,children:t("div",{})}),c("div",{className:d.section,children:[c("div",{children:[t("div",{className:d.label,children:m("latency_test_url")}),t(de,{name:"latencyTestUrl",type:"text",value:l,onBlur:O})]}),c("div",{children:[t("div",{className:d.label,children:m("lang")}),t("div",{children:t(w,{options:je,selected:I.language,onChange:n=>I.changeLanguage(n.target.value)})})]}),c("div",{children:[t("div",{className:d.label,children:m("chart_style")}),t(Ce,{OptionComponent:_e,optionPropsList:Ne,selectedIndex:r,onChange:B})]}),c("div",{children:[t("div",{className:d.label,children:"Action"}),t(Y,{start:t(oe,{size:16}),label:"Switch backend",onClick:z})]})]})]})}export{Ue as default}; diff --git a/clash-bin/tests/data/config/public/assets/Connections.e48eac36.js b/clash-bin/tests/data/config/public/assets/Connections.e48eac36.js deleted file mode 100644 index 4d9866fdb..000000000 --- a/clash-bin/tests/data/config/public/assets/Connections.e48eac36.js +++ /dev/null @@ -1 +0,0 @@ -import{r as se,R as be,c as Ae,a as ro,M as Cn,j as q,b as ye,p as pn,m as gn,d as oo,B as vn,e as io,f as ao,g as uo,u as so,C as lo,F as co,I as fo,h as po,S as go}from"./index.171f553a.js";import{u as vo}from"./useRemainingViewPortHeight.7395542b.js";import{C as mo}from"./chevron-down.dd238e96.js";import{f as ho}from"./index.92e2d967.js";import{F as yo,p as wo,A as bo}from"./Fab.ef67ff10.js";import{P as Ro,a as Co}from"./play.7b1a5f99.js";function yt(b){return function(v){return!!v.type&&v.type.tabsRole===b}}var tt=yt("Tab"),wt=yt("TabList"),bt=yt("TabPanel");function So(b){return tt(b)||wt(b)||bt(b)}function vt(b,v){return se.exports.Children.map(b,function(f){return f===null?null:So(f)?v(f):f.props&&f.props.children&&typeof f.props.children=="object"?se.exports.cloneElement(f,Object.assign({},f.props,{children:vt(f.props.children,v)})):f})}function Sn(b,v){return se.exports.Children.forEach(b,function(f){f!==null&&(tt(f)||bt(f)?v(f):f.props&&f.props.children&&typeof f.props.children=="object"&&(wt(f)&&v(f),Sn(f.props.children,v)))})}function Pn(b){var v=0;return Sn(b,function(f){tt(f)&&v++}),v}var Po=["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName","environment","disableUpDownKeys"];function xo(b,v){if(b==null)return{};var f={},g=Object.keys(b),O,_;for(_=0;_=0)&&(f[O]=b[O]);return f}function xn(b){return b&&"getAttribute"in b}function mn(b){return xn(b)&&b.getAttribute("data-rttab")}function ke(b){return xn(b)&&b.getAttribute("aria-disabled")==="true"}var et;function Bo(b){var v=b||(typeof window<"u"?window:void 0);try{et=!!(typeof v<"u"&&v.document&&v.document.activeElement)}catch{et=!1}}var Eo={className:"react-tabs",focus:!1},Rt=function(v){var f=se.exports.useRef([]),g=se.exports.useRef([]),O=se.exports.useRef();function _(m,G){if(!(m<0||m>=X())){var M=v.onSelect,K=v.selectedIndex;M(m,K,G)}}function c(m){for(var G=X(),M=m+1;Mm;)if(!ke(ee(G)))return G;return m}function de(){for(var m=X(),G=0;G=0)&&(f[O]=b[O]);return f}var Go={className:"react-tabs__tab-list"},rt=function(v){var f=v.children,g=v.className,O=Ao(v,ko);return be.createElement("ul",Object.assign({},O,{className:Ae(g),role:"tablist"}),f)};rt.tabsRole="TabList";rt.propTypes={};rt.defaultProps=Go;var Ho=["children","className","disabled","disabledClassName","focus","id","selected","selectedClassName","tabIndex","tabRef"];function No(b,v){if(b==null)return{};var f={},g=Object.keys(b),O,_;for(_=0;_=0)&&(f[O]=b[O]);return f}var gt="react-tabs__tab",Oo={className:gt,disabledClassName:gt+"--disabled",focus:!1,id:null,selected:!1,selectedClassName:gt+"--selected"},De=function(v){var f,g=se.exports.useRef(),O=v.children,_=v.className,c=v.disabled,U=v.disabledClassName,de=v.focus,u=v.id,X=v.selected,ee=v.selectedClassName,le=v.tabIndex,fe=v.tabRef,D=No(v,Ho);return se.exports.useEffect(function(){X&&de&&g.current.focus()},[X,de]),be.createElement("li",Object.assign({},D,{className:Ae(_,(f={},f[ee]=X,f[U]=c,f)),ref:function(ce){g.current=ce,fe&&fe(ce)},role:"tab",id:"tab"+u,"aria-selected":X?"true":"false","aria-disabled":c?"true":"false","aria-controls":"panel"+u,tabIndex:le||(X?"0":null),"data-rttab":!0}),O)};De.propTypes={};De.tabsRole="Tab";De.defaultProps=Oo;var Wo=["children","className","forceRender","id","selected","selectedClassName"];function _o(b,v){if(b==null)return{};var f={},g=Object.keys(b),O,_;for(_=0;_=0)&&(f[O]=b[O]);return f}var hn="react-tabs__tab-panel",zo={className:hn,forceRender:!1,selectedClassName:hn+"--selected"},Ve=function(v){var f,g=v.children,O=v.className,_=v.forceRender,c=v.id,U=v.selected,de=v.selectedClassName,u=_o(v,Wo);return be.createElement("div",Object.assign({},u,{className:Ae(O,(f={},f[de]=U,f)),role:"tabpanel",id:"panel"+c,"aria-labelledby":"tab"+c}),_||U?g:null)};Ve.tabsRole="TabPanel";Ve.propTypes={};Ve.defaultProps=zo;const Mo="_placeHolder_12xws_1",jo="_connQty_12xws_10",Lo="_inputWrapper_12xws_22",Do="_input_12xws_22",Le={placeHolder:Mo,connQty:jo,inputWrapper:Lo,input:Do};var mt={exports:{}},ht={exports:{}};(function(b,v){(function(f,g){g(v,se.exports)})(ro,function(f,g){function O(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(d){return void n(d)}s.done?t(l):Promise.resolve(l).then(r,i)}function _(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){O(o,r,i,a,s,"next",l)}function s(l){O(o,r,i,a,s,"throw",l)}a(void 0)})}}function c(){return(c=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function de(e){var t=function(n,r){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var o=i.call(n,r||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return typeof t=="symbol"?t:String(t)}g=g&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g;var u={init:"init"},X=function(e){var t=e.value;return t===void 0?"":t},ee=function(){return g.createElement(g.Fragment,null,"\xA0")},le={Cell:X,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function fe(){for(var e=arguments.length,t=new Array(e),n=0;n(o=typeof o=="number"?o:1/0)){var a=i;i=o,o=a}return e.filter(function(s){return t.some(function(l){var d=s.values[l];return d>=i&&d<=o})})};Ot.autoRemove=function(e){return!e||typeof e[0]!="number"&&typeof e[1]!="number"};var We=Object.freeze({__proto__:null,text:Et,exactText:It,exactTextCase:Tt,includes:Ft,includesAll:kt,includesSome:At,includesValue:Gt,exact:Ht,equals:Nt,between:Ot});u.resetFilters="resetFilters",u.setFilter="setFilter",u.setAllFilters="setAllFilters";var Wt=function(e){e.stateReducers.push(Jn),e.useInstance.push(Yn)};function Jn(e,t,n,r){if(t.type===u.init)return c({filters:[]},e);if(t.type===u.resetFilters)return c({},e,{filters:r.initialState.filters||[]});if(t.type===u.setFilter){var i=t.columnId,o=t.filterValue,a=r.allColumns,s=r.filterTypes,l=a.find(function(S){return S.id===i});if(!l)throw new Error("React-Table: Could not find a column with id: "+i);var d=Se(l.filter,s||{},We),R=e.filters.find(function(S){return S.id===i}),h=ie(o,R&&R.value);return Ie(d.autoRemove,h,l)?c({},e,{filters:e.filters.filter(function(S){return S.id!==i})}):c({},e,R?{filters:e.filters.map(function(S){return S.id===i?{id:i,value:h}:S})}:{filters:[].concat(e.filters,[{id:i,value:h}])})}if(t.type===u.setAllFilters){var y=t.filters,p=r.allColumns,w=r.filterTypes;return c({},e,{filters:ie(y,e.filters).filter(function(S){var P=p.find(function(E){return E.id===S.id});return!Ie(Se(P.filter,w||{},We).autoRemove,S.value,P)})})}}function Yn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.filterTypes,s=e.manualFilters,l=e.defaultCanFilter,d=l!==void 0&&l,R=e.disableFilters,h=e.state.filters,y=e.dispatch,p=e.autoResetFilters,w=p===void 0||p,S=g.useCallback(function(x,A){y({type:u.setFilter,columnId:x,filterValue:A})},[y]),P=g.useCallback(function(x){y({type:u.setAllFilters,filters:x})},[y]);o.forEach(function(x){var A=x.id,z=x.accessor,T=x.defaultCanFilter,k=x.disableFilters;x.canFilter=z?ne(k!==!0&&void 0,R!==!0&&void 0,!0):ne(T,d,!1),x.setFilter=function(H){return S(x.id,H)};var $=h.find(function(H){return H.id===A});x.filterValue=$&&$.value});var E=g.useMemo(function(){if(s||!h.length)return[n,r,i];var x=[],A={};return[function z(T,k){k===void 0&&(k=0);var $=T;return($=h.reduce(function(H,V){var L=V.id,Q=V.value,I=o.find(function(te){return te.id===L});if(!I)return H;k===0&&(I.preFilteredRows=H);var j=Se(I.filter,a||{},We);return j?(I.filteredRows=j(H,[L],Q),I.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+I.id+"."),H)},T)).forEach(function(H){x.push(H),A[H.id]=H,H.subRows&&(H.subRows=H.subRows&&H.subRows.length>0?z(H.subRows,k+1):H.subRows)}),$}(n),x,A]},[s,h,n,r,i,o,a]),W=E[0],B=E[1],C=E[2];g.useMemo(function(){o.filter(function(x){return!h.find(function(A){return A.id===x.id})}).forEach(function(x){x.preFilteredRows=W,x.filteredRows=W})},[W,h,o]);var N=m(w);M(function(){N()&&y({type:u.resetFilters})},[y,s?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:r,preFilteredRowsById:i,filteredRows:W,filteredFlatRows:B,filteredRowsById:C,rows:W,flatRows:B,rowsById:C,setFilter:S,setAllFilters:P})}Wt.pluginName="useFilters",u.resetGlobalFilter="resetGlobalFilter",u.setGlobalFilter="setGlobalFilter";var _t=function(e){e.stateReducers.push(Zn),e.useInstance.push(er)};function Zn(e,t,n,r){if(t.type===u.resetGlobalFilter)return c({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===u.setGlobalFilter){var i=t.filterValue,o=r.userFilterTypes,a=Se(r.globalFilter,o||{},We),s=ie(i,e.globalFilter);return Ie(a.autoRemove,s)?(e.globalFilter,U(e,["globalFilter"])):c({},e,{globalFilter:s})}}function er(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.filterTypes,s=e.globalFilter,l=e.manualGlobalFilter,d=e.state.globalFilter,R=e.dispatch,h=e.autoResetGlobalFilter,y=h===void 0||h,p=e.disableGlobalFilter,w=g.useCallback(function(C){R({type:u.setGlobalFilter,filterValue:C})},[R]),S=g.useMemo(function(){if(l||d===void 0)return[n,r,i];var C=[],N={},x=Se(s,a||{},We);if(!x)return console.warn("Could not find a valid 'globalFilter' option."),n;o.forEach(function(z){var T=z.disableGlobalFilter;z.canFilter=ne(T!==!0&&void 0,p!==!0&&void 0,!0)});var A=o.filter(function(z){return z.canFilter===!0});return[function z(T){return(T=x(T,A.map(function(k){return k.id}),d)).forEach(function(k){C.push(k),N[k.id]=k,k.subRows=k.subRows&&k.subRows.length?z(k.subRows):k.subRows}),T}(n),C,N]},[l,d,s,a,o,n,r,i,p]),P=S[0],E=S[1],W=S[2],B=m(y);M(function(){B()&&R({type:u.resetGlobalFilter})},[R,l?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:i,globalFilteredRows:P,globalFilteredFlatRows:E,globalFilteredRowsById:W,rows:P,flatRows:E,rowsById:W,setGlobalFilter:w,disableGlobalFilter:p})}function zt(e,t){return t.reduce(function(n,r){return n+(typeof r=="number"?r:0)},0)}_t.pluginName="useGlobalFilter";var Mt=Object.freeze({__proto__:null,sum:zt,min:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.min(t,n))}),t},max:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.max(t,n))}),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach(function(r){typeof r=="number"&&(t=Math.min(t,r),n=Math.max(n,r))}),t+".."+n},average:function(e){return zt(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort(function(r,i){return r-i});return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),tr=[],nr={};u.resetGroupBy="resetGroupBy",u.setGroupBy="setGroupBy",u.toggleGroupBy="toggleGroupBy";var jt=function(e){e.getGroupByToggleProps=[rr],e.stateReducers.push(or),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.groupBy])}),e.visibleColumns.push(ir),e.useInstance.push(ur),e.prepareRow.push(sr)};jt.pluginName="useGroupBy";var rr=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(r){r.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function or(e,t,n,r){if(t.type===u.init)return c({groupBy:[]},e);if(t.type===u.resetGroupBy)return c({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===u.setGroupBy)return c({},e,{groupBy:t.value});if(t.type===u.toggleGroupBy){var i=t.columnId,o=t.value,a=o!==void 0?o:!e.groupBy.includes(i);return c({},e,a?{groupBy:[].concat(e.groupBy,[i])}:{groupBy:e.groupBy.filter(function(s){return s!==i})})}}function ir(e,t){var n=t.instance.state.groupBy,r=n.map(function(o){return e.find(function(a){return a.id===o})}).filter(Boolean),i=e.filter(function(o){return!n.includes(o.id)});return(e=[].concat(r,i)).forEach(function(o){o.isGrouped=n.includes(o.id),o.groupedIndex=n.indexOf(o.id)}),e}var ar={};function ur(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.flatHeaders,s=e.groupByFn,l=s===void 0?Lt:s,d=e.manualGroupBy,R=e.aggregations,h=R===void 0?ar:R,y=e.plugins,p=e.state.groupBy,w=e.dispatch,S=e.autoResetGroupBy,P=S===void 0||S,E=e.disableGroupBy,W=e.defaultCanGroupBy,B=e.getHooks;Z(y,["useColumnOrder","useFilters"],"useGroupBy");var C=m(e);o.forEach(function(I){var j=I.accessor,te=I.defaultGroupBy,pe=I.disableGroupBy;I.canGroupBy=j?ne(I.canGroupBy,pe!==!0&&void 0,E!==!0&&void 0,!0):ne(I.canGroupBy,te,W,!1),I.canGroupBy&&(I.toggleGroupBy=function(){return e.toggleGroupBy(I.id)}),I.Aggregated=I.Aggregated||I.Cell});var N=g.useCallback(function(I,j){w({type:u.toggleGroupBy,columnId:I,value:j})},[w]),x=g.useCallback(function(I){w({type:u.setGroupBy,value:I})},[w]);a.forEach(function(I){I.getGroupByToggleProps=D(B().getGroupByToggleProps,{instance:C(),header:I})});var A=g.useMemo(function(){if(d||!p.length)return[n,r,i,tr,nr,r,i];var I=p.filter(function(ue){return o.find(function(Pe){return Pe.id===ue})}),j=[],te={},pe=[],F={},Y=[],re={},ge=function ue(Pe,Re,un){if(Re===void 0&&(Re=0),Re===I.length)return Pe.map(function(Ue){return c({},Ue,{depth:Re})});var dt=I[Re],Qr=l(Pe,dt);return Object.entries(Qr).map(function(Ue,Jr){var sn=Ue[0],qe=Ue[1],Xe=dt+":"+sn,ln=ue(qe,Re+1,Xe=un?un+">"+Xe:Xe),cn=Re?Ee(qe,"leafRows"):qe,Yr=function(he,ft,eo){var Qe={};return o.forEach(function(oe){if(I.includes(oe.id))Qe[oe.id]=ft[0]?ft[0].values[oe.id]:null;else{var dn=typeof oe.aggregate=="function"?oe.aggregate:h[oe.aggregate]||Mt[oe.aggregate];if(dn){var to=ft.map(function(Je){return Je.values[oe.id]}),no=he.map(function(Je){var pt=Je.values[oe.id];if(!eo&&oe.aggregateValue){var fn=typeof oe.aggregateValue=="function"?oe.aggregateValue:h[oe.aggregateValue]||Mt[oe.aggregateValue];if(!fn)throw console.info({column:oe}),new Error("React Table: Invalid column.aggregateValue option for column listed above");pt=fn(pt,Je,oe)}return pt});Qe[oe.id]=dn(no,to)}else{if(oe.aggregate)throw console.info({column:oe}),new Error("React Table: Invalid column.aggregate option for column listed above");Qe[oe.id]=null}}}),Qe}(cn,qe,Re),Zr={id:Xe,isGrouped:!0,groupByID:dt,groupByVal:sn,values:Yr,subRows:ln,leafRows:cn,depth:Re,index:Jr};return ln.forEach(function(he){j.push(he),te[he.id]=he,he.isGrouped?(pe.push(he),F[he.id]=he):(Y.push(he),re[he.id]=he)}),Zr})}(n);return ge.forEach(function(ue){j.push(ue),te[ue.id]=ue,ue.isGrouped?(pe.push(ue),F[ue.id]=ue):(Y.push(ue),re[ue.id]=ue)}),[ge,j,te,pe,F,Y,re]},[d,p,n,r,i,o,h,l]),z=A[0],T=A[1],k=A[2],$=A[3],H=A[4],V=A[5],L=A[6],Q=m(P);M(function(){Q()&&w({type:u.resetGroupBy})},[w,d?null:t]),Object.assign(e,{preGroupedRows:n,preGroupedFlatRow:r,preGroupedRowsById:i,groupedRows:z,groupedFlatRows:T,groupedRowsById:k,onlyGroupedFlatRows:$,onlyGroupedRowsById:H,nonGroupedFlatRows:V,nonGroupedRowsById:L,rows:z,flatRows:T,rowsById:k,toggleGroupBy:N,setGroupBy:x})}function sr(e){e.allCells.forEach(function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&((n=e.subRows)==null?void 0:n.length)})}function Lt(e,t){return e.reduce(function(n,r,i){var o=""+r.values[t];return n[o]=Array.isArray(n[o])?n[o]:[],n[o].push(r),n},{})}var Dt=/([0-9]+)/gm;function it(e,t){return e===t?0:e>t?1:-1}function _e(e,t,n){return[e.values[n],t.values[n]]}function Vt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}var lr=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=_e(e,t,n),i=r[0],o=r[1];for(i=Vt(i),o=Vt(o),i=i.split(Dt).filter(Boolean),o=o.split(Dt).filter(Boolean);i.length&&o.length;){var a=i.shift(),s=o.shift(),l=parseInt(a,10),d=parseInt(s,10),R=[l,d].sort();if(isNaN(R[0])){if(a>s)return 1;if(s>a)return-1}else{if(isNaN(R[1]))return isNaN(l)?-1:1;if(l>d)return 1;if(d>l)return-1}}return i.length-o.length},datetime:function(e,t,n){var r=_e(e,t,n),i=r[0],o=r[1];return it(i=i.getTime(),o=o.getTime())},basic:function(e,t,n){var r=_e(e,t,n);return it(r[0],r[1])},string:function(e,t,n){var r=_e(e,t,n),i=r[0],o=r[1];for(i=i.split("").filter(Boolean),o=o.split("").filter(Boolean);i.length&&o.length;){var a=i.shift(),s=o.shift(),l=a.toLowerCase(),d=s.toLowerCase();if(l>d)return 1;if(d>l)return-1;if(a>s)return 1;if(s>a)return-1}return i.length-o.length},number:function(e,t,n){var r=_e(e,t,n),i=r[0],o=r[1],a=/[^0-9.]/gi;return it(i=Number(String(i).replace(a,"")),o=Number(String(o).replace(a,"")))}});u.resetSortBy="resetSortBy",u.setSortBy="setSortBy",u.toggleSortBy="toggleSortBy",u.clearSortBy="clearSortBy",le.sortType="alphanumeric",le.sortDescFirst=!1;var $t=function(e){e.getSortByToggleProps=[cr],e.stateReducers.push(dr),e.useInstance.push(fr)};$t.pluginName="useSortBy";var cr=function(e,t){var n=t.instance,r=t.column,i=n.isMultiSortEvent,o=i===void 0?function(a){return a.shiftKey}:i;return[e,{onClick:r.canSort?function(a){a.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&o(a))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function dr(e,t,n,r){if(t.type===u.init)return c({sortBy:[]},e);if(t.type===u.resetSortBy)return c({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===u.clearSortBy)return c({},e,{sortBy:e.sortBy.filter(function(C){return C.id!==t.columnId})});if(t.type===u.setSortBy)return c({},e,{sortBy:t.sortBy});if(t.type===u.toggleSortBy){var i,o=t.columnId,a=t.desc,s=t.multi,l=r.allColumns,d=r.disableMultiSort,R=r.disableSortRemove,h=r.disableMultiRemove,y=r.maxMultiSortColCount,p=y===void 0?Number.MAX_SAFE_INTEGER:y,w=e.sortBy,S=l.find(function(C){return C.id===o}).sortDescFirst,P=w.find(function(C){return C.id===o}),E=w.findIndex(function(C){return C.id===o}),W=a!=null,B=[];return(i=!d&&s?P?"toggle":"add":E!==w.length-1||w.length!==1?"replace":P?"toggle":"replace")!="toggle"||R||W||s&&h||!(P&&P.desc&&!S||!P.desc&&S)||(i="remove"),i==="replace"?B=[{id:o,desc:W?a:S}]:i==="add"?(B=[].concat(w,[{id:o,desc:W?a:S}])).splice(0,B.length-p):i==="toggle"?B=w.map(function(C){return C.id===o?c({},C,{desc:W?a:!P.desc}):C}):i==="remove"&&(B=w.filter(function(C){return C.id!==o})),c({},e,{sortBy:B})}}function fr(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.allColumns,o=e.orderByFn,a=o===void 0?Kt:o,s=e.sortTypes,l=e.manualSortBy,d=e.defaultCanSort,R=e.disableSortBy,h=e.flatHeaders,y=e.state.sortBy,p=e.dispatch,w=e.plugins,S=e.getHooks,P=e.autoResetSortBy,E=P===void 0||P;Z(w,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var W=g.useCallback(function(T){p({type:u.setSortBy,sortBy:T})},[p]),B=g.useCallback(function(T,k,$){p({type:u.toggleSortBy,columnId:T,desc:k,multi:$})},[p]),C=m(e);h.forEach(function(T){var k=T.accessor,$=T.canSort,H=T.disableSortBy,V=T.id,L=k?ne(H!==!0&&void 0,R!==!0&&void 0,!0):ne(d,$,!1);T.canSort=L,T.canSort&&(T.toggleSortBy=function(I,j){return B(T.id,I,j)},T.clearSortBy=function(){p({type:u.clearSortBy,columnId:T.id})}),T.getSortByToggleProps=D(S().getSortByToggleProps,{instance:C(),column:T});var Q=y.find(function(I){return I.id===V});T.isSorted=!!Q,T.sortedIndex=y.findIndex(function(I){return I.id===V}),T.isSortedDesc=T.isSorted?Q.desc:void 0});var N=g.useMemo(function(){if(l||!y.length)return[n,r];var T=[],k=y.filter(function($){return i.find(function(H){return H.id===$.id})});return[function $(H){var V=a(H,k.map(function(L){var Q=i.find(function(te){return te.id===L.id});if(!Q)throw new Error("React-Table: Could not find a column with id: "+L.id+" while sorting");var I=Q.sortType,j=Ge(I)||(s||{})[I]||lr[I];if(!j)throw new Error("React-Table: Could not find a valid sortType of '"+I+"' for column '"+L.id+"'.");return function(te,pe){return j(te,pe,L.id,L.desc)}}),k.map(function(L){var Q=i.find(function(I){return I.id===L.id});return Q&&Q.sortInverted?L.desc:!L.desc}));return V.forEach(function(L){T.push(L),L.subRows&&L.subRows.length!==0&&(L.subRows=$(L.subRows))}),V}(n),T]},[l,y,n,r,i,a,s]),x=N[0],A=N[1],z=m(E);M(function(){z()&&p({type:u.resetSortBy})},[l?null:t]),Object.assign(e,{preSortedRows:n,preSortedFlatRows:r,sortedRows:x,sortedFlatRows:A,rows:x,flatRows:A,setSortBy:W,toggleSortBy:B})}function Kt(e,t,n){return[].concat(e).sort(function(r,i){for(var o=0;oe.pageIndex?s=i===-1?o.length>=e.pageSize:a-1),s?c({},e,{pageIndex:a}):e}if(t.type===u.setPageSize){var l=t.pageSize,d=e.pageSize*e.pageIndex;return c({},e,{pageIndex:Math.floor(d/l),pageSize:l})}}function gr(e){var t=e.rows,n=e.autoResetPage,r=n===void 0||n,i=e.manualExpandedKey,o=i===void 0?"expanded":i,a=e.plugins,s=e.pageCount,l=e.paginateExpandedRows,d=l===void 0||l,R=e.expandSubRows,h=R===void 0||R,y=e.state,p=y.pageSize,w=y.pageIndex,S=y.expanded,P=y.globalFilter,E=y.filters,W=y.groupBy,B=y.sortBy,C=e.dispatch,N=e.data,x=e.manualPagination;Z(a,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var A=m(r);M(function(){A()&&C({type:u.resetPage})},[C,x?null:N,P,E,W,B]);var z=x?s:Math.ceil(t.length/p),T=g.useMemo(function(){return z>0?[].concat(new Array(z)).fill(null).map(function(j,te){return te}):[]},[z]),k=g.useMemo(function(){var j;if(x)j=t;else{var te=p*w,pe=te+p;j=t.slice(te,pe)}return d?j:Ne(j,{manualExpandedKey:o,expanded:S,expandSubRows:h})},[h,S,o,x,w,p,d,t]),$=w>0,H=z===-1?k.length>=p:w-1&&o.push(i.splice(l,1)[0])};i.length&&r.length;)a();return[].concat(o,i)}function Wr(e){var t=e.dispatch;e.setColumnOrder=g.useCallback(function(n){return t({type:u.setColumnOrder,columnOrder:n})},[t])}en.pluginName="useColumnOrder",le.canResize=!0,u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize";var tn=function(e){e.getResizerProps=[_r],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(zr),e.useInstance.push(jr),e.useInstanceBeforeDimensions.push(Mr)},_r=function(e,t){var n=t.instance,r=t.header,i=n.dispatch,o=function(a,s){var l=!1;if(a.type==="touchstart"){if(a.touches&&a.touches.length>1)return;l=!0}var d,R,h=function(B){var C=[];return function N(x){x.columns&&x.columns.length&&x.columns.map(N),C.push(x)}(B),C}(s).map(function(B){return[B.id,B.totalWidth]}),y=l?Math.round(a.touches[0].clientX):a.clientX,p=function(){window.cancelAnimationFrame(d),d=null,i({type:u.columnDoneResizing})},w=function(){window.cancelAnimationFrame(d),d=null,i({type:u.columnResizing,clientX:R})},S=function(B){R=B,d||(d=window.requestAnimationFrame(w))},P={mouse:{moveEvent:"mousemove",moveHandler:function(B){return S(B.clientX)},upEvent:"mouseup",upHandler:function(B){document.removeEventListener("mousemove",P.mouse.moveHandler),document.removeEventListener("mouseup",P.mouse.upHandler),p()}},touch:{moveEvent:"touchmove",moveHandler:function(B){return B.cancelable&&(B.preventDefault(),B.stopPropagation()),S(B.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(B){document.removeEventListener(P.touch.moveEvent,P.touch.moveHandler),document.removeEventListener(P.touch.upEvent,P.touch.moveHandler),p()}}},E=l?P.touch:P.mouse,W=!!function(){if(typeof Fe=="boolean")return Fe;var B=!1;try{var C={get passive(){return B=!0,!1}};window.addEventListener("test",null,C),window.removeEventListener("test",null,C)}catch{B=!1}return Fe=B}()&&{passive:!1};document.addEventListener(E.moveEvent,E.moveHandler,W),document.addEventListener(E.upEvent,E.upHandler,W),i({type:u.columnStartResizing,columnId:s.id,columnWidth:s.totalWidth,headerIdWidths:h,clientX:y})};return[e,{onMouseDown:function(a){return a.persist()||o(a,r)},onTouchStart:function(a){return a.persist()||o(a,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function zr(e,t){if(t.type===u.init)return c({columnResizing:{columnWidths:{}}},e);if(t.type===u.resetResize)return c({},e,{columnResizing:{columnWidths:{}}});if(t.type===u.columnStartResizing){var n=t.clientX,r=t.columnId,i=t.columnWidth,o=t.headerIdWidths;return c({},e,{columnResizing:c({},e.columnResizing,{startX:n,headerIdWidths:o,columnWidth:i,isResizingColumn:r})})}if(t.type===u.columnResizing){var a=t.clientX,s=e.columnResizing,l=s.startX,d=s.columnWidth,R=s.headerIdWidths,h=(a-l)/d,y={};return(R===void 0?[]:R).forEach(function(p){var w=p[0],S=p[1];y[w]=Math.max(S+S*h,0)}),c({},e,{columnResizing:c({},e.columnResizing,{columnWidths:c({},e.columnResizing.columnWidths,{},y)})})}return t.type===u.columnDoneResizing?c({},e,{columnResizing:c({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}tn.pluginName="useResizeColumns";var Mr=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,i=e.state.columnResizing,o=m(e);t.forEach(function(a){var s=ne(a.disableResizing!==!0&&void 0,n!==!0&&void 0,!0);a.canResize=s,a.width=i.columnWidths[a.id]||a.originalWidth||a.width,a.isResizing=i.isResizingColumn===a.id,s&&(a.getResizerProps=D(r().getResizerProps,{instance:o(),header:a}))})};function jr(e){var t=e.plugins,n=e.dispatch,r=e.autoResetResize,i=r===void 0||r,o=e.columns;Z(t,["useAbsoluteLayout"],"useResizeColumns");var a=m(i);M(function(){a()&&n({type:u.resetResize})},[o]);var s=g.useCallback(function(){return n({type:u.resetResize})},[n]);Object.assign(e,{resetResizing:s})}var at={position:"absolute",top:0},nn=function(e){e.getTableBodyProps.push(Ke),e.getRowProps.push(Ke),e.getHeaderGroupProps.push(Ke),e.getFooterGroupProps.push(Ke),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:c({},at,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:c({},at,{left:r.column.totalLeft+"px",width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:c({},at,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]})};nn.pluginName="useAbsoluteLayout";var Ke=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},ut={display:"inline-block",boxSizing:"border-box"},st=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},rn=function(e){e.getRowProps.push(st),e.getHeaderGroupProps.push(st),e.getFooterGroupProps.push(st),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:c({},ut,{width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:c({},ut,{width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:c({},ut,{width:r.totalWidth+"px"})}]})};function on(e){e.getTableProps.push(Lr),e.getRowProps.push(lt),e.getHeaderGroupProps.push(lt),e.getFooterGroupProps.push(lt),e.getHeaderProps.push(Dr),e.getCellProps.push(Vr),e.getFooterProps.push($r)}rn.pluginName="useBlockLayout",on.pluginName="useFlexLayout";var Lr=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},lt=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Dr=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Vr=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},$r=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function an(e){e.stateReducers.push(Xr),e.getTableProps.push(Kr),e.getHeaderProps.push(Ur),e.getRowProps.push(qr)}u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize",an.pluginName="useGridLayout";var Kr=function(e,t){var n=t.instance;return[e,{style:{display:"grid",gridTemplateColumns:n.visibleColumns.map(function(r){var i;return n.state.gridLayout.columnWidths[r.id]?n.state.gridLayout.columnWidths[r.id]+"px":(i=n.state.columnResizing)!=null&&i.isResizingColumn?n.state.gridLayout.startWidths[r.id]+"px":typeof r.width=="number"?r.width+"px":r.width}).join(" ")}}]},Ur=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},qr=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function Xr(e,t,n,r){if(t.type===u.init)return c({gridLayout:{columnWidths:{}}},e);if(t.type===u.resetResize)return c({},e,{gridLayout:{columnWidths:{}}});if(t.type===u.columnStartResizing){var i=t.columnId,o=t.headerIdWidths,a=ct(i);if(a!==void 0){var s=r.visibleColumns.reduce(function(C,N){var x;return c({},C,((x={})[N.id]=ct(N.id),x))},{}),l=r.visibleColumns.reduce(function(C,N){var x;return c({},C,((x={})[N.id]=N.minWidth,x))},{}),d=r.visibleColumns.reduce(function(C,N){var x;return c({},C,((x={})[N.id]=N.maxWidth,x))},{}),R=o.map(function(C){var N=C[0];return[N,ct(N)]});return c({},e,{gridLayout:c({},e.gridLayout,{startWidths:s,minWidths:l,maxWidths:d,headerIdGridWidths:R,columnWidth:a})})}return e}if(t.type===u.columnResizing){var h=t.clientX,y=e.columnResizing.startX,p=e.gridLayout,w=p.columnWidth,S=p.minWidths,P=p.maxWidths,E=p.headerIdGridWidths,W=(h-y)/w,B={};return(E===void 0?[]:E).forEach(function(C){var N=C[0],x=C[1];B[N]=Math.min(Math.max(S[N],x+x*W),P[N])}),c({},e,{gridLayout:c({},e.gridLayout,{columnWidths:c({},e.gridLayout.columnWidths,{},B)})})}return t.type===u.columnDoneResizing?c({},e,{gridLayout:c({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function ct(e){var t,n=(t=document.getElementById("header-cell-"+e))==null?void 0:t.offsetWidth;if(n!==void 0)return n}f._UNSTABLE_usePivotColumns=qt,f.actions=u,f.defaultColumn=le,f.defaultGroupByFn=Lt,f.defaultOrderByFn=Kt,f.defaultRenderer=X,f.emptyRenderer=ee,f.ensurePluginOrder=Z,f.flexRender=ae,f.functionalUpdate=ie,f.loopHooks=ce,f.makePropGetter=D,f.makeRenderer=K,f.reduceHooks=J,f.safeUseLayoutEffect=G,f.useAbsoluteLayout=nn,f.useAsyncDebounce=function(e,t){t===void 0&&(t=0);var n=g.useRef({}),r=m(e),i=m(t);return g.useCallback(function(){var o=_(regeneratorRuntime.mark(function a(){var s,l,d,R=arguments;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:for(s=R.length,l=new Array(s),d=0;d1?t-1:0),r=1;rb.accessor!=="process");function Zo(b){switch(b.column.id){case"start":return ho(b.value,0);case"download":case"upload":return pn(b.value);case"downloadSpeedCurr":case"uploadSpeedCurr":return pn(b.value)+"/s";default:return b.value}}const ei={id:"id",desc:!0},ti={sortBy:[ei],hiddenColumns:["id"]};function ni({data:b}){const v=be.useContext(Cn),{getTableProps:f,headerGroups:g,rows:O,prepareRow:_}=mt.exports.useTable({columns:v.hasProcessPath?Jo:Yo,data:b,initialState:ti,autoResetSortBy:!1},mt.exports.useSortBy);return q("div",{...f(),style:{"--col-count":v.hasProcessPath?"12":"11"},children:g.map(c=>ye("div",{...c.getHeaderGroupProps(),className:xe.tr,children:[c.headers.map(U=>ye("div",{...U.getHeaderProps(U.getSortByToggleProps()),className:xe.th,children:[q("span",{children:U.render("Header")}),q("span",{className:xe.sortIconContainer,children:U.isSorted?q("span",{className:U.isSortedDesc?"":xe.rotate180,children:q(mo,{size:16})}):null})]})),O.map((U,de)=>(_(U),U.cells.map((u,X)=>q("div",{...u.getCellProps(),className:Ae(xe.td,de%2===0?xe.odd:!1,v.hasProcessPath?X>=2&&X<=5?xe.du:!1:X>=1&&X<=4?xe.du:!1),children:Zo(u)}))))]}))})}const ri="_overlay_148w6_1",oi="_cnt_148w6_5",ii="_afterOpen_148w6_15",ai="_btngrp_148w6_20",Ye={overlay:ri,cnt:oi,afterOpen:ii,btngrp:ai},{useRef:ui,useCallback:si,useMemo:li}=be;function ci({isOpen:b,onRequestClose:v,primaryButtonOnTap:f}){const g=ui(null),O=si(()=>{g.current.focus()},[]),_=li(()=>({base:Ae(gn.content,Ye.cnt),afterOpen:Ye.afterOpen,beforeClose:""}),[]);return ye(oo,{isOpen:b,onRequestClose:v,onAfterOpen:O,className:_,overlayClassName:Ae(gn.overlay,Ye.overlay),children:[q("p",{children:"Are you sure you want to close all connections?"}),ye("div",{className:Ye.btngrp,children:[q(vn,{onClick:f,ref:g,children:"I'm sure"}),q("div",{style:{width:20}}),q(vn,{onClick:v,children:"No"})]})]})}const{useEffect:di,useState:Me,useRef:fi,useCallback:je}=be,yn=30;function pi(b){const v={};for(let f=0;f[f.host,f.sourceIP,f.sourcePort,f.destinationIP,f.chains,f.rule,f.type,f.network,f.processPath].some(g=>vi(g,v))):b}function mi(b,v,f,g){const{id:O,metadata:_,upload:c,download:U,start:de,chains:u,rule:X,rulePayload:ee}=b,{host:le,destinationPort:fe,destinationIP:D,network:J,type:ce,sourceIP:Z,sourcePort:ie}=_,m=_.processPath;g.hasProcessPath===!1&&typeof m<"u"&&(g.hasProcessPath=!0);let G=le;G===""&&(G=D);const M=v[O];return{id:O,upload:c,download:U,start:f-new Date(de).valueOf(),chains:u.reverse().join(" / "),rule:ee?`${X}(${ee})`:X,..._,host:`${G}:${fe}`,type:`${ce}(${J})`,source:`${Z}:${ie}`,downloadSpeedCurr:U-(M?M.download:0),uploadSpeedCurr:c-(M?M.upload:0),process:gi(m)}}function bn(b){return b.length>0?q(ni,{data:b}):q("div",{className:Le.placeHolder,children:q(go,{width:200,height:200,c1:"var(--color-text)"})})}function Rn({qty:b}){return b<100?""+b:"99+"}function hi({apiConfig:b}){const[v,f]=vo(),[g,O]=Me([]),[_,c]=Me([]),[U,de]=Me(""),u=wn(g,U),X=wn(_,U),[ee,le]=Me(!1),fe=je(()=>le(!0),[]),D=je(()=>le(!1),[]),[J,ce]=Me(!1),Z=je(()=>{ce(ae=>!ae)},[]),ie=je(()=>{ao(b),D()},[b,D]),m=fi(g),G=be.useContext(Cn),M=je(({connections:ae})=>{const ve=pi(m.current),Be=Date.now(),me=ae.map(we=>mi(we,ve,Be,G)),Ce=[];for(const we of m.current)me.findIndex(ne=>ne.id===we.id)<0&&Ce.push(we);c(we=>[...Ce,...we].slice(0,101)),me&&(me.length!==0||m.current.length!==0)&&!J?(m.current=me,O(me)):m.current=me},[O,J]);di(()=>uo(b,M),[b,M]);const{t:K}=so();return ye("div",{children:[q(lo,{title:K("Connections")}),ye(nt,{children:[ye("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between"},children:[ye(rt,{children:[ye(De,{children:[q("span",{children:K("Active")}),q("span",{className:Le.connQty,children:Rn({qty:u.length})})]}),ye(De,{children:[q("span",{children:K("Closed")}),q("span",{className:Le.connQty,children:Rn({qty:X.length})})]})]}),q("div",{className:Le.inputWrapper,children:q("input",{type:"text",name:"filter",autoComplete:"off",className:Le.input,placeholder:"Filter",onChange:ae=>de(ae.target.value)})})]}),q("div",{ref:v,style:{padding:30,paddingBottom:yn,paddingTop:0},children:ye("div",{style:{height:f-yn,overflow:"auto"},children:[ye(Ve,{children:[q(co,{children:bn(u)}),q(yo,{icon:J?q(Ro,{size:16}):q(Co,{size:16}),mainButtonStyles:J?{background:"#e74c3c"}:{},style:wo,text:K(J?"Resume Refresh":"Pause Refresh"),onClick:Z,children:q(bo,{text:"Close All Connections",onClick:fe,children:q(fo,{size:10})})})]}),q(Ve,{children:bn(X)})]})}),q(ci,{isOpen:ee,primaryButtonOnTap:ie,onRequestClose:D})]})]})}const yi=b=>({apiConfig:po(b)}),xi=io(yi)(hi);export{xi as default}; diff --git a/clash-bin/tests/data/config/public/assets/Connections.fb8ea59b.css b/clash-bin/tests/data/config/public/assets/Connections.fb8ea59b.css deleted file mode 100644 index 5d18a47f2..000000000 --- a/clash-bin/tests/data/config/public/assets/Connections.fb8ea59b.css +++ /dev/null @@ -1 +0,0 @@ -.react-tabs{-webkit-tap-highlight-color:transparent}.react-tabs__tab-list{margin:0 0 10px;padding:0 30px}.react-tabs__tab{display:inline-flex;align-items:center;border:1px solid transparent;border-radius:5px;bottom:-1px;position:relative;list-style:none;padding:6px 10px;cursor:pointer;font-size:1.2em;opacity:.5}.react-tabs__tab--selected{opacity:1}.react-tabs__tab--disabled{color:GrayText;cursor:default}.react-tabs__tab:focus{border-color:#0188fe;outline:none}.react-tabs__tab:focus:after{content:"";position:absolute}.react-tabs__tab-panel{display:none}.react-tabs__tab-panel--selected{display:block}._placeHolder_12xws_1{height:100%;display:flex;align-items:center;justify-content:center;color:var(--color-background);opacity:.1}._connQty_12xws_10{font-family:var(--font-normal);font-size:.75em;margin-left:3px;padding:2px 7px;display:inline-flex;justify-content:center;align-items:center;background-color:var(--bg-near-transparent);border-radius:30px}._inputWrapper_12xws_22{margin:0 30px;width:100%;max-width:350px;justify-self:flex-end}._input_12xws_22{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:18px;border:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:36px;outline:none;padding:0 15px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._tr_daq0k_1{display:grid;grid-template-columns:repeat(var(--col-count, 11),minmax(-webkit-max-content,auto));grid-template-columns:repeat(var(--col-count, 11),minmax(max-content,auto))}._th_daq0k_6{padding:8px 10px;height:50px;background:var(--color-background);position:-webkit-sticky;position:sticky;top:0;font-size:.8em;text-align:center;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:space-between}._th_daq0k_6:hover{color:var(--color-text-highlight)}._td_daq0k_23{padding:8px 13px;font-size:.9em;font-family:var(--font-normal)}._td_daq0k_23._odd_daq0k_29{background:var(--color-row-odd)}._du_daq0k_34{text-align:right}._sortIconContainer_daq0k_38{display:inline-flex;margin-left:10px;width:16px;height:16px}._rotate180_daq0k_45{-webkit-transform:rotate(180deg);transform:rotate(180deg)}._overlay_148w6_1{background-color:#0009}._cnt_148w6_5{background-color:var(--bg-modal);color:var(--color-text);max-width:300px;line-height:1.4;-webkit-transform:translate(-50%,-50%) scale(1.2);transform:translate(-50%,-50%) scale(1.2);opacity:.6;transition:all .3s ease}._afterOpen_148w6_15{opacity:1;-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1)}._btngrp_148w6_20{display:flex;align-items:center;justify-content:center;margin-top:30px} diff --git a/clash-bin/tests/data/config/public/assets/Fab.a0a7e573.css b/clash-bin/tests/data/config/public/assets/Fab.a0a7e573.css deleted file mode 100644 index 673a61d5e..000000000 --- a/clash-bin/tests/data/config/public/assets/Fab.a0a7e573.css +++ /dev/null @@ -1 +0,0 @@ -.rtf{box-sizing:border-box;margin:25px;position:fixed;white-space:nowrap;z-index:9998;padding-left:0;list-style:none}.rtf.open .rtf--mb{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.rtf.open .rtf--mb>ul{list-style:none;margin:0;padding:0}.rtf.open .rtf--ab__c:hover>span{transition:ease-in-out opacity .2s;opacity:.9}.rtf.open .rtf--ab__c>span.always-show{transition:ease-in-out opacity .2s;opacity:.9}.rtf.open .rtf--ab__c:nth-child(1){-webkit-transform:translateY(-60px) scale(1);transform:translateY(-60px) scale(1);transition-delay:.03s}.rtf.open .rtf--ab__c:nth-child(1).top{-webkit-transform:translateY(60px) scale(1);transform:translateY(60px) scale(1)}.rtf.open .rtf--ab__c:nth-child(2){-webkit-transform:translateY(-120px) scale(1);transform:translateY(-120px) scale(1);transition-delay:.09s}.rtf.open .rtf--ab__c:nth-child(2).top{-webkit-transform:translateY(120px) scale(1);transform:translateY(120px) scale(1)}.rtf.open .rtf--ab__c:nth-child(3){-webkit-transform:translateY(-180px) scale(1);transform:translateY(-180px) scale(1);transition-delay:.12s}.rtf.open .rtf--ab__c:nth-child(3).top{-webkit-transform:translateY(180px) scale(1);transform:translateY(180px) scale(1)}.rtf.open .rtf--ab__c:nth-child(4){-webkit-transform:translateY(-240px) scale(1);transform:translateY(-240px) scale(1);transition-delay:.15s}.rtf.open .rtf--ab__c:nth-child(4).top{-webkit-transform:translateY(240px) scale(1);transform:translateY(240px) scale(1)}.rtf.open .rtf--ab__c:nth-child(5){-webkit-transform:translateY(-300px) scale(1);transform:translateY(-300px) scale(1);transition-delay:.18s}.rtf.open .rtf--ab__c:nth-child(5).top{-webkit-transform:translateY(300px) scale(1);transform:translateY(300px) scale(1)}.rtf.open .rtf--ab__c:nth-child(6){-webkit-transform:translateY(-360px) scale(1);transform:translateY(-360px) scale(1);transition-delay:.21s}.rtf.open .rtf--ab__c:nth-child(6).top{-webkit-transform:translateY(360px) scale(1);transform:translateY(360px) scale(1)}.rtf--mb__c{padding:25px;margin:-25px}.rtf--mb__c *:last-child{margin-bottom:0}.rtf--mb__c:hover>span{transition:ease-in-out opacity .2s;opacity:.9}.rtf--mb__c>span.always-show{transition:ease-in-out opacity .2s;opacity:.9}.rtf--mb__c>span{opacity:0;transition:ease-in-out opacity .2s;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);margin-right:6px;margin-left:4px;background:rgba(0,0,0,.75);padding:2px 4px;border-radius:2px;color:#fff;font-size:13px;box-shadow:0 0 4px #00000024,0 4px 8px #00000047}.rtf--mb__c>span.right{right:100%}.rtf--mb{width:48px;height:48px;background:var(--btn-bg);z-index:9999;display:inline-flex;justify-content:center;align-items:center;position:relative;border:none;border-radius:50%;box-shadow:0 0 4px #00000024,0 4px 8px #00000047;cursor:pointer;outline:none;padding:0;-webkit-user-drag:none;font-weight:700;color:#f1f1f1;font-size:18px}.rtf--mb>*{transition:ease-in-out transform .2s}.rtf--ab__c{display:block;position:absolute;top:0;right:1px;padding:10px 0;margin:-10px 0;transition:ease-in-out transform .2s}.rtf--ab__c>span{opacity:0;transition:ease-in-out opacity .2s;position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);margin-right:6px;background:rgba(0,0,0,.75);padding:2px 4px;border-radius:2px;color:#fff;font-size:13px;box-shadow:0 0 4px #00000024,0 4px 8px #00000047}.rtf--ab__c>span.right{right:100%}.rtf--ab__c:nth-child(1){-webkit-transform:translateY(-60px) scale(0);transform:translateY(-60px) scale(0);transition-delay:.21s}.rtf--ab__c:nth-child(1).top{-webkit-transform:translateY(60px) scale(0);transform:translateY(60px) scale(0)}.rtf--ab__c:nth-child(2){-webkit-transform:translateY(-120px) scale(0);transform:translateY(-120px) scale(0);transition-delay:.18s}.rtf--ab__c:nth-child(2).top{-webkit-transform:translateY(120px) scale(0);transform:translateY(120px) scale(0)}.rtf--ab__c:nth-child(3){-webkit-transform:translateY(-180px) scale(0);transform:translateY(-180px) scale(0);transition-delay:.15s}.rtf--ab__c:nth-child(3).top{-webkit-transform:translateY(180px) scale(0);transform:translateY(180px) scale(0)}.rtf--ab__c:nth-child(4){-webkit-transform:translateY(-240px) scale(0);transform:translateY(-240px) scale(0);transition-delay:.12s}.rtf--ab__c:nth-child(4).top{-webkit-transform:translateY(240px) scale(0);transform:translateY(240px) scale(0)}.rtf--ab__c:nth-child(5){-webkit-transform:translateY(-300px) scale(0);transform:translateY(-300px) scale(0);transition-delay:.09s}.rtf--ab__c:nth-child(5).top{-webkit-transform:translateY(300px) scale(0);transform:translateY(300px) scale(0)}.rtf--ab__c:nth-child(6){-webkit-transform:translateY(-360px) scale(0);transform:translateY(-360px) scale(0);transition-delay:.03s}.rtf--ab__c:nth-child(6).top{-webkit-transform:translateY(360px) scale(0);transform:translateY(360px) scale(0)}.rtf--ab{height:40px;width:40px;margin-right:4px;background-color:#aaa;display:inline-flex;justify-content:center;align-items:center;position:relative;border:none;border-radius:50%;box-shadow:0 0 4px #00000024,0 4px 8px #00000047;cursor:pointer;outline:none;padding:0;-webkit-user-drag:none;font-weight:700;color:#f1f1f1;font-size:16px;z-index:10000}.rtf--ab:hover{background:#387cec;border:1px solid #387cec;color:#fff}.rtf--ab:focus{border-color:var(--color-focus-blue)}._spining_4i8sg_1{position:relative;border-radius:50%;background:linear-gradient(60deg,#e66465,#9198e5);width:48px;height:48px;display:flex;justify-content:center;align-items:center}._spining_4i8sg_1:before{content:"";position:absolute;top:0;bottom:0;left:0;right:0;border:2px solid transparent;border-top-color:currentColor;border-radius:50%;-webkit-animation:_spining_keyframes_4i8sg_1 1s linear infinite;animation:_spining_keyframes_4i8sg_1 1s linear infinite}@-webkit-keyframes _spining_keyframes_4i8sg_1{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes _spining_keyframes_4i8sg_1{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}} diff --git a/clash-bin/tests/data/config/public/assets/Fab.ef67ff10.js b/clash-bin/tests/data/config/public/assets/Fab.ef67ff10.js deleted file mode 100644 index 33d116e54..000000000 --- a/clash-bin/tests/data/config/public/assets/Fab.ef67ff10.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e,b,i as y,r as l}from"./index.171f553a.js";const F="_spining_4i8sg_1",M="_spining_keyframes_4i8sg_1",j={spining:F,spining_keyframes:M},{useState:v}=y;function B({children:s}){return e("span",{className:j.spining,children:s})}const H={right:10,bottom:10},L=({children:s,...n})=>e("button",{type:"button",...n,className:"rtf--ab",children:s}),E=({children:s,...n})=>e("button",{type:"button",className:"rtf--mb",...n,children:s}),O={bottom:24,right:24},R=({event:s="hover",style:n=O,alwaysShowTitle:o=!1,children:f,icon:g,mainButtonStyles:h,onClick:p,text:d,..._})=>{const[a,r]=v(!1),c=o||!a,u=()=>r(!0),m=()=>r(!1),x=()=>s==="hover"&&u(),k=()=>s==="hover"&&m(),N=t=>p?p(t):(t.persist(),s==="click"?a?m():u():null),$=(t,i)=>{t.persist(),r(!1),setTimeout(()=>{i(t)},1)},C=()=>l.exports.Children.map(f,(t,i)=>l.exports.isValidElement(t)?b("li",{className:`rtf--ab__c ${"top"in n?"top":""}`,children:[l.exports.cloneElement(t,{"data-testid":`action-button-${i}`,"aria-label":t.props.text||`Menu button ${i+1}`,"aria-hidden":c,tabIndex:a?0:-1,...t.props,onClick:I=>{t.props.onClick&&$(I,t.props.onClick)}}),t.props.text&&e("span",{className:`${"right"in n?"right":""} ${o?"always-show":""}`,"aria-hidden":c,children:t.props.text})]}):null);return e("ul",{onMouseEnter:x,onMouseLeave:k,className:`rtf ${a?"open":"closed"}`,"data-testid":"fab",style:n,..._,children:b("li",{className:"rtf--mb__c",children:[e(E,{onClick:N,style:h,"data-testid":"main-button",role:"button","aria-label":"Floating menu",tabIndex:0,children:g}),d&&e("span",{className:`${"right"in n?"right":""} ${o?"always-show":""}`,"aria-hidden":c,children:d}),e("ul",{children:C()})]})})};export{L as A,R as F,B as I,H as p}; diff --git a/clash-bin/tests/data/config/public/assets/Logs.4b8e75d1.css b/clash-bin/tests/data/config/public/assets/Logs.4b8e75d1.css deleted file mode 100644 index 821aba4b1..000000000 --- a/clash-bin/tests/data/config/public/assets/Logs.4b8e75d1.css +++ /dev/null @@ -1 +0,0 @@ -._RuleSearch_1oz2t_1{padding:0 40px 5px}._RuleSearchContainer_1oz2t_5{position:relative;height:40px}._inputWrapper_1oz2t_10{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:0;width:100%}._input_1oz2t_10{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:20px;border:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 15px 0 35px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._iconWrapper_1oz2t_35{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:10px;display:flex;justify-content:center;align-items:center}._logMeta_7a1x3_1{display:flex;align-items:center;flex-wrap:wrap;font-size:.9em}._logType_7a1x3_8{color:#eee;flex-shrink:0;text-align:center;width:66px;border-radius:100px;padding:3px 5px;margin:0 8px}._logTime_7a1x3_18{flex-shrink:0;color:#999;font-size:14px}._logText_7a1x3_24{flex-shrink:0;display:flex;font-family:Roboto Mono,Menlo,monospace;align-items:center;padding:8px 0;width:100%;white-space:pre;overflow:auto}._logsWrapper_7a1x3_37{margin:0;padding:0;color:var(--color-text)}._logsWrapper_7a1x3_37 .log{padding:10px 40px;background:var(--color-background)}._logsWrapper_7a1x3_37 .log.even{background:var(--color-background)}._logPlaceholder_7a1x3_51{display:flex;flex-direction:column;align-items:center;justify-content:center;color:#2d2d30}._logPlaceholder_7a1x3_51 div:nth-child(2){color:var(--color-text-secondary);font-size:1.4em;opacity:.6}._logPlaceholderIcon_7a1x3_64{opacity:.3}._search_7a1x3_68{max-width:1000px} diff --git a/clash-bin/tests/data/config/public/assets/Logs.ac990610.js b/clash-bin/tests/data/config/public/assets/Logs.ac990610.js deleted file mode 100644 index 1515a9959..000000000 --- a/clash-bin/tests/data/config/public/assets/Logs.ac990610.js +++ /dev/null @@ -1 +0,0 @@ -import{r as m,b as l,j as t,k as u,e as y,J as T,K as b,y as P,L,u as R,C as N,S as z,N as C,O as W,h as w,P as k,i as j,c as I}from"./index.171f553a.js";import{a as O,F}from"./index.esm.e4dd1508.js";import{r as M,s as $,f as A}from"./logs.43986220.js";import{d as B}from"./debounce.c2d20996.js";import{u as D}from"./useRemainingViewPortHeight.7395542b.js";import{F as E,p as H}from"./Fab.ef67ff10.js";import{P as K,a as q}from"./play.7b1a5f99.js";function J(e,n){if(e==null)return{};var r=V(e,n),a,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,a)||(r[a]=e[a]))}return r}function V(e,n){if(e==null)return{};var r={},a=Object.keys(e),o,s;for(s=0;s=0)&&(r[o]=e[o]);return r}var f=m.exports.forwardRef(function(e,n){var r=e.color,a=r===void 0?"currentColor":r,o=e.size,s=o===void 0?24:o,p=J(e,["color","size"]);return l("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...p,children:[t("circle",{cx:"11",cy:"11",r:"8"}),t("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})});f.propTypes={color:u.exports.string,size:u.exports.oneOfType([u.exports.string,u.exports.number])};f.displayName="Search";const Y=f,G="_RuleSearch_1oz2t_1",Q="_RuleSearchContainer_1oz2t_5",U="_inputWrapper_1oz2t_10",X="_input_1oz2t_10",Z="_iconWrapper_1oz2t_35",h={RuleSearch:G,RuleSearchContainer:Q,inputWrapper:U,input:X,iconWrapper:Z};function ee({dispatch:e,searchText:n,updateSearchText:r}){const[a,o]=m.exports.useState(n),s=m.exports.useCallback(i=>{e(r(i))},[e,r]),p=m.exports.useMemo(()=>B(s,300),[s]),g=i=>{o(i.target.value),p(i.target.value)};return t("div",{className:h.RuleSearch,children:l("div",{className:h.RuleSearchContainer,children:[t("div",{className:h.inputWrapper,children:t("input",{type:"text",value:a,onChange:g,className:h.input})}),t("div",{className:h.iconWrapper,children:t(Y,{size:20})})]})})}const te=e=>({searchText:T(e),updateSearchText:b}),oe=y(te)(ee),re="_logMeta_7a1x3_1",ae="_logType_7a1x3_8",ne="_logTime_7a1x3_18",se="_logText_7a1x3_24",ce="_logsWrapper_7a1x3_37",ie="_logPlaceholder_7a1x3_51",le="_logPlaceholderIcon_7a1x3_64",pe="_search_7a1x3_68",c={logMeta:re,logType:ae,logTime:ne,logText:se,logsWrapper:ce,logPlaceholder:ie,logPlaceholderIcon:le,search:pe},{useCallback:v,memo:he,useEffect:ge}=j,_=30,de={debug:"#28792c",info:"var(--bg-log-info-tag)",warning:"#b99105",error:"#c11c1c"};function ue({time:e,even:n,payload:r,type:a}){const o=I({even:n},"log");return t("div",{className:o,children:l("div",{className:c.logMeta,children:[t("div",{className:c.logTime,children:e}),t("div",{className:c.logType,style:{backgroundColor:de[a]},children:a}),t("div",{className:c.logText,children:r})]})})}function me(e,n){return n[e].id}const _e=he(({index:e,style:n,data:r})=>{const a=r[e];return t("div",{style:n,children:t(ue,{...a})})},O);function fe({dispatch:e,logLevel:n,apiConfig:r,logs:a,logStreamingPaused:o}){const s=P(),p=v(()=>{o?M({...r,logLevel:n}):$(),s.app.updateAppConfig("logStreamingPaused",!o)},[r,n,o,s.app]),g=v(S=>e(L(S)),[e]);ge(()=>{A({...r,logLevel:n},g)},[r,n,g]);const[i,x]=D(),{t:d}=R();return l("div",{children:[t(N,{title:d("Logs")}),t("div",{className:c.search,children:t(oe,{})}),t("div",{ref:i,style:{paddingBottom:_},children:a.length===0?l("div",{className:c.logPlaceholder,style:{height:x-_},children:[t("div",{className:c.logPlaceholderIcon,children:t(z,{width:200,height:200})}),t("div",{children:d("no_logs")})]}):l("div",{className:c.logsWrapper,children:[t(F,{height:x-_,width:"100%",itemCount:a.length,itemSize:80,itemData:a,itemKey:me,children:_e}),t(E,{icon:o?t(K,{size:16}):t(q,{size:16}),mainButtonStyles:o?{background:"#e74c3c"}:{},style:H,text:d(o?"Resume Refresh":"Pause Refresh"),onClick:p})]})})]})}const xe=e=>({logs:C(e),logLevel:W(e),apiConfig:w(e),logStreamingPaused:k(e)}),Re=y(xe)(fe);export{Re as default}; diff --git a/clash-bin/tests/data/config/public/assets/Proxies.16b46af4.js b/clash-bin/tests/data/config/public/assets/Proxies.16b46af4.js deleted file mode 100644 index ffd8dc4cf..000000000 --- a/clash-bin/tests/data/config/public/assets/Proxies.16b46af4.js +++ /dev/null @@ -1 +0,0 @@ -import{r as g,j as r,k as $,c as w,T as _e,b as i,B as b,i as f,U as xe,V as ve,W as ee,X as te,e as C,Y as ge,F as T,Z as be,$ as ne,a0 as M,y as D,a1 as we,a2 as re,a3 as O,a4 as oe,a5 as H,a6 as U,a7 as Ce,a8 as ke,u as q,a9 as Pe,aa as Se,ab as Ne,h as se,C as ae,z as V,ac as $e,m as W,d as Ae,ad as Le,ae as Oe,af as Te,ag as De}from"./index.171f553a.js";import{C as Be}from"./chevron-down.dd238e96.js";import{F as Ie,p as Fe,A as je,I as Re}from"./Fab.ef67ff10.js";import{R as ze,a as Me,T as He}from"./TextFitler.61537a57.js";import{f as Ue}from"./index.92e2d967.js";import{S as qe}from"./Select.6c389032.js";import"./debounce.c2d20996.js";function Ee(e,t){if(e==null)return{};var n=Ke(e,t),o,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&(!Object.prototype.propertyIsEnumerable.call(e,o)||(n[o]=e[o]))}return n}function Ke(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,a;for(a=0;a=0)&&(n[s]=e[s]);return n}var E=g.exports.forwardRef(function(e,t){var n=e.color,o=n===void 0?"currentColor":n,s=e.size,a=s===void 0?24:s,l=Ee(e,["color","size"]);return r("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...l,children:r("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})})});E.propTypes={color:$.exports.string,size:$.exports.oneOfType([$.exports.string,$.exports.number])};E.displayName="Zap";const Z=E;function le(e){const t=e.size||24,n=w({[_e.animate]:e.animate});return r("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})})}const Ve="_FlexCenter_1380a_1",We={FlexCenter:Ve};function Ze({children:e}){return r("div",{className:We.FlexCenter,children:e})}const{useRef:G,useEffect:Ge}=f;function Ye({onClickPrimaryButton:e,onClickSecondaryButton:t}){const n=G(null),o=G(null);return Ge(()=>{n.current.focus()},[]),i("div",{onKeyDown:a=>{a.keyCode===39?o.current.focus():a.keyCode===37&&n.current.focus()},children:[r("h2",{children:"Close Connections?"}),r("p",{children:'Click "Yes" to close those connections that are still using the old selected proxy in this group'}),r("div",{style:{height:30}}),i(Ze,{children:[r(b,{onClick:e,ref:n,children:"Yes"}),r("div",{style:{width:20}}),r(b,{onClick:t,ref:o,children:"No"})]})]})}const Xe="_header_1y9js_1",Je="_arrow_1y9js_8",Qe="_isOpen_1y9js_13",et="_btn_1y9js_20",tt="_qty_1y9js_25",k={header:Xe,arrow:Je,isOpen:Qe,btn:et,qty:tt};function ce({name:e,type:t,toggle:n,isOpen:o,qty:s}){const a=g.exports.useCallback(l=>{l.preventDefault(),(l.key==="Enter"||l.key===" ")&&n()},[n]);return i("div",{className:k.header,onClick:n,style:{cursor:"pointer"},tabIndex:0,onKeyDown:a,role:"button",children:[r("div",{children:r(xe,{name:e,type:t})}),typeof s=="number"?r("span",{className:k.qty,children:s}):null,r(b,{kind:"minimal",onClick:n,className:k.btn,title:"Toggle collapsible section",children:r("span",{className:w(k.arrow,{[k.isOpen]:o}),children:r(Be,{size:20})})})]})}const{useMemo:nt}=f;function rt(e,t){return e.filter(n=>{const o=t[n];return o===void 0?!0:o.number!==0})}const A=(e,t)=>{if(e&&typeof e.number=="number"&&e.number>0)return e.number;const n=t&&t.type;return n&&te.indexOf(n)>-1?-1:999999},ot={Natural:e=>e,LatencyAsc:(e,t,n)=>e.sort((o,s)=>{const a=A(t[o],n&&n[o]),l=A(t[s],n&&n[s]);return a-l}),LatencyDesc:(e,t,n)=>e.sort((o,s)=>{const a=A(t[o],n&&n[o]);return A(t[s],n&&n[s])-a}),NameAsc:e=>e.sort(),NameDesc:e=>e.sort((t,n)=>t>n?-1:to.trim()).filter(o=>!!o);return n.length===0?e:e.filter(o=>{let s=0;for(;s-1)return!0}return!1})}function at(e,t,n,o,s,a){let l=[...e];return n&&(l=rt(e,t)),typeof o=="string"&&o!==""&&(l=st(l,o)),ot[s](l,t,a)}function ie(e,t,n,o,s){const[a]=ve(ee);return nt(()=>at(e,t,n,a,o,s),[e,t,n,a,o,s])}const lt="_header_5pmv2_1",ct="_groupHead_5pmv2_5",it="_action_5pmv2_11",F={header:lt,groupHead:ct,action:it},ut="_proxy_8ev0l_1",dt="_now_8ev0l_25",pt="_error_8ev0l_29",ht="_selectable_8ev0l_32",yt="_proxyType_8ev0l_40",ft="_row_8ev0l_51",mt="_proxyName_8ev0l_57",_t="_proxySmall_8ev0l_66",m={proxy:ut,now:dt,error:pt,selectable:ht,proxyType:yt,row:ft,proxyName:mt,proxySmall:_t},xt="_proxyLatency_hz69v_1",vt={proxyLatency:xt};function gt({number:e,color:t}){return r("span",{className:vt.proxyLatency,style:{color:t},children:typeof e=="number"&&e!==0?e+" ms":" "})}const{useMemo:N}=f,P={good:"#67c23a",normal:"#d4b75c",bad:"#e67f3c",na:"#909399"};function ue({number:e}={}){return e===0?P.na:e<200?P.good:e<400?P.normal:typeof e=="number"?P.bad:P.na}function bt(e,t){return te.indexOf(t)>-1?{border:"1px dotted #777"}:{background:ue(e)}}function wt({now:e,name:t,proxy:n,latency:o,isSelectable:s,onClick:a}){const l=N(()=>bt(o,n.type),[o,n]),c=N(()=>{let d=t;return o&&typeof o.number=="number"&&(d+=" "+o.number+" ms"),d},[t,o]),u=g.exports.useCallback(()=>{s&&a&&a(t)},[t,a,s]),p=N(()=>w(m.proxySmall,{[m.now]:e,[m.selectable]:s}),[s,e]),h=g.exports.useCallback(d=>{d.key==="Enter"&&u()},[u]);return r("div",{title:c,className:p,style:l,onClick:u,onKeyDown:h,role:s?"menuitem":""})}function Ct(e){return e==="Shadowsocks"?"SS":e}const kt=e=>({left:e.left+window.scrollX-5,top:e.top+window.scrollY-38});function Pt({children:e,label:t,"aria-label":n}){const[o,s]=ge();return i(T,{children:[g.exports.cloneElement(e,o),r(be,{...s,label:t,"aria-label":n,position:kt})]})}function St({now:e,name:t,proxy:n,latency:o,isSelectable:s,onClick:a}){const l=N(()=>ue(o),[o]),c=g.exports.useCallback(()=>{s&&a&&a(t)},[t,a,s]),u=g.exports.useCallback(h=>{h.key==="Enter"&&c()},[c]),p=N(()=>w(m.proxy,{[m.now]:e,[m.selectable]:s}),[s,e]);return i("div",{tabIndex:0,className:p,onClick:c,onKeyDown:u,role:s?"menuitem":"",children:[r("div",{className:m.proxyName,children:r(Pt,{label:t,"aria-label":"proxy name: "+t,children:r("span",{children:t})})}),i("div",{className:m.row,children:[r("span",{className:m.proxyType,style:{opacity:e?.6:.2},children:Ct(n.type)}),r(gt,{number:o==null?void 0:o.number,color:l})]})]})}const de=(e,{name:t})=>{const n=ne(e),o=M(e);return{proxy:n[t]||{name:t,type:"Unknown",history:[]},latency:o[t]}},Nt=C(de)(St),$t=C(de)(wt),At="_list_1oy7w_1",Lt="_listSummaryView_1oy7w_8",pe={list:At,listSummaryView:Lt};function he({all:e,now:t,isSelectable:n,itemOnTapCallback:o}){const s=e;return r("div",{className:pe.list,children:s.map(a=>r(Nt,{onClick:o,isSelectable:n,name:a,now:a===t},a))})}function ye({all:e,now:t,isSelectable:n,itemOnTapCallback:o}){return r("div",{className:pe.listSummaryView,children:e.map(s=>r($t,{onClick:o,isSelectable:n,name:s,now:s===t},s))})}const{createElement:Ot,useCallback:j,useMemo:Tt}=f;function Dt({name:e,all:t,delay:n,hideUnavailableProxies:o,proxySortBy:s,proxies:a,type:l,now:c,isOpen:u,apiConfig:p,dispatch:h}){const d=ie(t,n,o,s,a),x=Tt(()=>l==="Selector",[l]),{app:{updateCollapsibleIsOpen:v},proxies:{requestDelayForProxies:y}}=D(),B=j(()=>{v("proxyGroup",e,!u)},[u,v,e]),I=j(K=>{!x||h(we(p,e,K))},[p,h,e,x]),_=re(!1),me=j(async()=>{if(!_.value){_.set(!0);try{await y(p,d)}catch{}_.set(!1)}},[d,p,y,_]);return i("div",{className:F.group,children:[i("div",{className:F.groupHead,children:[r(ce,{name:e,type:l,toggle:B,qty:d.length,isOpen:u}),r("div",{className:F.action,children:r(O,{label:"Test latency",children:r(b,{kind:"circular",onClick:me,children:r(le,{animate:_.value,size:16})})})})]}),Ot(u?he:ye,{all:d,now:c,isSelectable:x,itemOnTapCallback:I})]})}const Bt=C((e,{name:t,delay:n})=>{const o=ne(e),s=oe(e),a=H(e),l=U(e),c=o[t],{all:u,type:p,now:h}=c;return{all:u,delay:n,hideUnavailableProxies:l,proxySortBy:a,proxies:o,type:p,now:h,isOpen:s[`proxyGroup:${t}`]}})(Dt),{useCallback:fe,useState:It}=f;function Ft({dispatch:e,apiConfig:t,name:n}){return fe(()=>e(Ce(t,n)),[t,e,n])}function jt({dispatch:e,apiConfig:t,names:n}){const[o,s]=It(!1);return[fe(async()=>{if(!o){s(!0);try{await e(ke(t,n))}catch{}s(!1)}},[t,e,n,o]),o]}const{useState:Rt,useCallback:zt}=f;function Mt({isLoading:e}){return e?r(Re,{children:r(Z,{width:16,height:16})}):r(Z,{width:16,height:16})}function Ht({dispatch:e,apiConfig:t}){const[n,o]=Rt(!1);return[zt(()=>{n||(o(!0),e(Pe(t)).then(()=>o(!1),()=>o(!1)))},[t,e,n]),n]}function Ut({dispatch:e,apiConfig:t,proxyProviders:n}){const{t:o}=q(),[s,a]=Ht({dispatch:e,apiConfig:t}),[l,c]=jt({apiConfig:t,dispatch:e,names:n.map(u=>u.name)});return r(Ie,{icon:r(Mt,{isLoading:a}),onClick:s,text:o("Test Latency"),style:Fe,children:n.length>0?r(je,{text:o("update_all_proxy_provider"),onClick:l,children:r(ze,{isRotating:c})}):null})}const qt="_updatedAt_1rx92_1",Et="_main_1rx92_8",Kt="_head_1rx92_17",Vt="_action_1rx92_23",Wt="_refresh_1rx92_31",S={updatedAt:qt,main:Et,head:Kt,action:Vt,refresh:Wt},{useCallback:Y}=f;function Zt({name:e,proxies:t,delay:n,hideUnavailableProxies:o,proxySortBy:s,vehicleType:a,updatedAt:l,isOpen:c,dispatch:u,apiConfig:p}){const h=ie(t,n,o,s),d=re(!1),x=Ft({dispatch:u,apiConfig:p,name:e}),v=Y(()=>{if(d.value)return;d.set(!0);const _=()=>d.set(!1);u(Se(p,e)).then(_,_)},[p,u,e,d]),{app:{updateCollapsibleIsOpen:y}}=D(),B=Y(()=>{y("proxyProvider",e,!c)},[c,y,e]),I=Ue(new Date(l),new Date);return i("div",{className:S.main,children:[i("div",{className:S.head,children:[r(ce,{name:e,toggle:B,type:a,isOpen:c,qty:h.length}),i("div",{className:S.action,children:[r(O,{label:"Update",children:r(b,{kind:"circular",onClick:x,children:r(Xt,{})})}),r(O,{label:"Health Check",children:r(b,{kind:"circular",onClick:v,children:r(le,{animate:d.value,size:16})})})]})]}),r("div",{className:S.updatedAt,children:i("small",{children:["Updated ",I," ago"]})}),c?r(he,{all:h}):r(ye,{all:h})]})}const Gt={rest:{scale:1},pressed:{scale:.95}},Yt={rest:{rotate:0},hover:{rotate:360,transition:{duration:.3}}};function Xt(){const t=Ne.read().motion;return r(t.div,{className:S.refresh,variants:Gt,initial:"rest",whileHover:"hover",whileTap:"pressed",children:r(t.div,{className:"flexCenter",variants:Yt,children:r(Me,{size:16})})})}const Jt=(e,{proxies:t,name:n})=>{const o=U(e),s=M(e),a=oe(e),l=se(e),c=H(e);return{apiConfig:l,proxies:t,delay:s,hideUnavailableProxies:o,proxySortBy:c,isOpen:a[`proxyProvider:${n}`]}},Qt=C(Jt)(Zt);function en({items:e}){return e.length===0?null:i(T,{children:[r(ae,{title:"Proxy Provider"}),r("div",{children:e.map(t=>r(Qt,{name:t.name,proxies:t.proxies,type:t.type,vehicleType:t.vehicleType,updatedAt:t.updatedAt},t.name))})]})}const tn="_labeledInput_cmki0_1",R={labeledInput:tn},nn=[["Natural","order_natural"],["LatencyAsc","order_latency_asc"],["LatencyDesc","order_latency_desc"],["NameAsc","order_name_asc"],["NameDesc","order_name_desc"]],{useCallback:X}=f;function rn({appConfig:e}){const{app:{updateAppConfig:t}}=D(),n=X(a=>{t("proxySortBy",a.target.value)},[t]),o=X(a=>{t("hideUnavailableProxies",a)},[t]),{t:s}=q();return i(T,{children:[i("div",{className:R.labeledInput,children:[r("span",{children:s("sort_in_grp")}),r("div",{children:r(qe,{options:nn.map(a=>[a[0],s(a[1])]),selected:e.proxySortBy,onChange:n})})]}),r("hr",{}),i("div",{className:R.labeledInput,children:[r("span",{children:s("hide_unavail_proxies")}),r("div",{children:r(V,{name:"hideUnavailableProxies",checked:e.hideUnavailableProxies,onChange:o})})]}),i("div",{className:R.labeledInput,children:[r("span",{children:s("auto_close_conns")}),r("div",{children:r(V,{name:"autoCloseOldConns",checked:e.autoCloseOldConns,onChange:a=>t("autoCloseOldConns",a)})})]})]})}const on=e=>{const t=H(e),n=U(e),o=$e(e);return{appConfig:{proxySortBy:t,hideUnavailableProxies:n,autoCloseOldConns:o}}},sn=C(on)(rn),an="_overlay_uuk3b_1",ln="_cnt_uuk3b_5",cn="_afterOpen_uuk3b_16",z={overlay:an,cnt:ln,afterOpen:cn},{useMemo:un}=f;function J({isOpen:e,onRequestClose:t,children:n}){const o=un(()=>({base:w(W.content,z.cnt),afterOpen:z.afterOpen,beforeClose:""}),[]);return r(Ae,{isOpen:e,onRequestClose:t,className:o,overlayClassName:w(W.overlay,z.overlay),children:n})}function dn({color:e="currentColor",size:t=24}){return i("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M2 6h9M18.5 6H22"}),r("circle",{cx:"16",cy:"6",r:"2"}),r("path",{d:"M22 18h-9M6 18H2"}),r("circle",{r:"2",transform:"matrix(-1 0 0 1 8 18)"})]})}const pn="_topBar_jgy4z_1",hn="_topBarRight_jgy4z_13",yn="_textFilterContainer_jgy4z_22",fn="_group_jgy4z_29",L={topBar:pn,topBarRight:hn,textFilterContainer:yn,group:fn},{useState:mn,useEffect:_n,useCallback:Q,useRef:xn}=f;function vn({dispatch:e,groupNames:t,delay:n,proxyProviders:o,apiConfig:s,showModalClosePrevConns:a}){const l=xn({}),c=Q(()=>{l.current.startAt=Date.now(),e(Le(s)).then(()=>{l.current.completeAt=Date.now()})},[s,e]);_n(()=>{c();const y=()=>{l.current.startAt&&Date.now()-l.current.startAt>3e4&&c()};return window.addEventListener("focus",y,!1),()=>window.removeEventListener("focus",y,!1)},[c]);const[u,p]=mn(!1),h=Q(()=>{p(!1)},[]),{proxies:{closeModalClosePrevConns:d,closePrevConnsAndTheModal:x}}=D(),{t:v}=q();return i(T,{children:[r(J,{isOpen:u,onRequestClose:h,children:r(sn,{})}),i("div",{className:L.topBar,children:[r(ae,{title:v("Proxies")}),i("div",{className:L.topBarRight,children:[r("div",{className:L.textFilterContainer,children:r(He,{textAtom:ee})}),r(O,{label:v("settings"),children:r(b,{kind:"minimal",onClick:()=>p(!0),children:r(dn,{size:16})})})]})]}),r("div",{children:t.map(y=>r("div",{className:L.group,children:r(Bt,{name:y,delay:n,apiConfig:s,dispatch:e})},y))}),r(en,{items:o}),r("div",{style:{height:60}}),r(Ut,{dispatch:e,apiConfig:s,proxyProviders:o}),r(J,{isOpen:a,onRequestClose:d,children:r(Ye,{onClickPrimaryButton:()=>x(s),onClickSecondaryButton:d})})]})}const gn=e=>({apiConfig:se(e),groupNames:Oe(e),proxyProviders:Te(e),delay:M(e),showModalClosePrevConns:De(e)}),$n=C(gn)(vn);export{$n as default}; diff --git a/clash-bin/tests/data/config/public/assets/Proxies.3fa3509d.css b/clash-bin/tests/data/config/public/assets/Proxies.3fa3509d.css deleted file mode 100644 index 228a9cd50..000000000 --- a/clash-bin/tests/data/config/public/assets/Proxies.3fa3509d.css +++ /dev/null @@ -1 +0,0 @@ -._FlexCenter_1380a_1{display:flex;justify-content:center;align-items:center}._header_1y9js_1{display:flex;align-items:center}._header_1y9js_1:focus{outline:none}._header_1y9js_1 ._arrow_1y9js_8{display:inline-flex;-webkit-transform:rotate(0deg);transform:rotate(0);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}._header_1y9js_1 ._arrow_1y9js_8._isOpen_1y9js_13{-webkit-transform:rotate(180deg);transform:rotate(180deg)}._header_1y9js_1 ._arrow_1y9js_8:focus{outline:var(--color-focus-blue) solid 1px}._btn_1y9js_20{margin-left:5px}._qty_1y9js_25{font-family:var(--font-normal);font-size:.75em;margin-left:3px;padding:2px 7px;display:inline-flex;justify-content:center;align-items:center;background-color:var(--bg-near-transparent);border-radius:30px}._header_5pmv2_1{margin-bottom:12px}._groupHead_5pmv2_5{display:flex;flex-wrap:wrap;align-items:center}._action_5pmv2_11{margin:0 5px}._proxy_8ev0l_1{margin:3px;padding:5px;position:relative;border-radius:8px;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;outline:none;border:1px solid transparent;max-width:200px;background-color:var(--color-bg-proxy)}._proxy_8ev0l_1:focus{border:1px solid var(--color-focus-blue)}@media screen and (min-width: 30em){._proxy_8ev0l_1{min-width:200px;border-radius:10px;padding:10px}}._proxy_8ev0l_1._now_8ev0l_25{background-color:var(--color-focus-blue);color:#ddd}._proxy_8ev0l_1._error_8ev0l_29{opacity:.5}._proxy_8ev0l_1._selectable_8ev0l_32{transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;cursor:pointer}._proxy_8ev0l_1._selectable_8ev0l_32:hover{border-color:hsl(0deg,0%,var(--card-hover-border-lightness))}._proxyType_8ev0l_40{font-family:var(--font-mono);font-size:.6em;margin-right:3px}@media screen and (min-width: 30em){._proxyType_8ev0l_40{font-size:.85em}}._row_8ev0l_51{display:flex;align-items:center;justify-content:space-between}._proxyName_8ev0l_57{width:100%;margin-bottom:5px;font-size:.85em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._proxySmall_8ev0l_66{--size: 13px;width:var(--size);height:var(--size);border-radius:50%;position:relative}._proxySmall_8ev0l_66._now_8ev0l_25{--size: 15px}._proxySmall_8ev0l_66._now_8ev0l_25:before{--size-dot: 7px;content:"";position:absolute;width:var(--size-dot);height:var(--size-dot);background-color:#fff;border:1px solid var(--color-proxy-dot-selected-ind-bo);border-radius:4px;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}._proxySmall_8ev0l_66._selectable_8ev0l_32{transition:-webkit-transform .1s ease-in-out;transition:transform .1s ease-in-out;transition:transform .1s ease-in-out,-webkit-transform .1s ease-in-out;cursor:pointer}._proxySmall_8ev0l_66._selectable_8ev0l_32:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}._proxyLatency_hz69v_1{border-radius:20px;color:#eee;font-size:.6em}@media screen and (min-width: 30em){._proxyLatency_hz69v_1{font-size:.85em}}._list_1oy7w_1{display:flex;flex-wrap:wrap;margin:8px 0 8px -3px}._listSummaryView_1oy7w_8{margin:14px 0;display:grid;grid-template-columns:repeat(auto-fill,13px);grid-gap:10px;place-items:center;max-width:900px}._updatedAt_1rx92_1{margin-bottom:12px}._updatedAt_1rx92_1 small{color:#777}._main_1rx92_8{padding:10px 15px}@media screen and (min-width: 30em){._main_1rx92_8{padding:10px 40px}}._head_1rx92_17{display:flex;align-items:center;flex-wrap:wrap}._action_1rx92_23{margin:0 5px;display:grid;grid-template-columns:auto auto;gap:10px;place-items:center}._refresh_1rx92_31{display:flex;justify-content:center;align-items:center;cursor:pointer}._labeledInput_cmki0_1{max-width:85vw;width:400px;display:flex;justify-content:space-between;align-items:center;font-size:13px;padding:13px 0}hr{height:1px;background-color:var(--color-separator);border:none;outline:none;margin:1rem 0px}._overlay_uuk3b_1{background-color:#0009}._cnt_uuk3b_5{position:absolute;background-color:var(--bg-modal);color:var(--color-text);line-height:1.4;opacity:.6;transition:all .3s ease;-webkit-transform:translate(-50%,-50%) scale(1.2);transform:translate(-50%,-50%) scale(1.2);box-shadow:#0000001f 0 4px 4px,#0000003d 0 16px 32px}._afterOpen_uuk3b_16{opacity:1;-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1)}._topBar_jgy4z_1{position:-webkit-sticky;position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;z-index:1;background-color:var(--color-background2);-webkit-backdrop-filter:blur(36px);backdrop-filter:blur(36px)}._topBarRight_jgy4z_13{display:flex;align-items:center;flex-wrap:wrap;flex:1;justify-content:flex-end;margin-right:20px}._textFilterContainer_jgy4z_22{max-width:350px;min-width:150px;flex:1;margin-right:8px}._group_jgy4z_29{padding:10px 15px}@media screen and (min-width: 30em){._group_jgy4z_29{padding:10px 40px}} diff --git a/clash-bin/tests/data/config/public/assets/Rules.70e6962f.js b/clash-bin/tests/data/config/public/assets/Rules.70e6962f.js deleted file mode 100644 index bb46c0a63..000000000 --- a/clash-bin/tests/data/config/public/assets/Rules.70e6962f.js +++ /dev/null @@ -1 +0,0 @@ -import{ah as S,ai as E,aj as k,ak as b,al as B,am as R,r as m,an as T,ao as O,G as y,ap as q,aq as _,V as A,b as d,j as a,U as F,B as U,u as x,e as j,h as L,C as z,i as D}from"./index.171f553a.js";import{a as Q,V}from"./index.esm.e4dd1508.js";import{R as P,T as W}from"./TextFitler.61537a57.js";import{f as H}from"./index.92e2d967.js";import{F as G,p as J}from"./Fab.ef67ff10.js";import{u as K}from"./useRemainingViewPortHeight.7395542b.js";import"./debounce.c2d20996.js";class X extends S{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.client.defaultMutationOptions(e),E(t,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this})}onUnsubscribe(){if(!this.listeners.length){var e;(e=this.currentMutation)==null||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();const t={listeners:!0};e.type==="success"?t.onSuccess=!0:e.type==="error"&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof e<"u"?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:k(),t={...e,isLoading:e.status==="loading",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){b.batch(()=>{if(this.mutateOptions){if(e.onSuccess){var t,r,n,i;(t=(r=this.mutateOptions).onSuccess)==null||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(n=(i=this.mutateOptions).onSettled)==null||n.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(e.onError){var o,u,l,c;(o=(u=this.mutateOptions).onError)==null||o.call(u,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(l=(c=this.mutateOptions).onSettled)==null||l.call(c,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}e.listeners&&this.listeners.forEach(p=>{p(this.currentResult)})})}}function w(s,e,t){const r=B(s,e,t),n=R({context:r.context}),[i]=m.exports.useState(()=>new X(n,r));m.exports.useEffect(()=>{i.setOptions(r)},[i,r]);const o=T(m.exports.useCallback(l=>i.subscribe(b.batchCalls(l)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),u=m.exports.useCallback((l,c)=>{i.mutate(l,c).catch(Y)},[i]);if(o.error&&O(i.options.useErrorBoundary,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}function Y(){}function Z(s){const e=s.providers,t=Object.keys(e),r={};for(let n=0;n=0,"there is no valid rules list in the rules API response"),s.rules.map((e,t)=>({...e,id:t}))}async function ne(s,e){let t={rules:[]};try{const{url:r,init:n}=y(e),i=await fetch(r+s,n);i.ok&&(t=await i.json())}catch(r){console.log("failed to fetch rules",r)}return re(t)}const I=q({key:"ruleFilterText",default:""});function ie(s,e){const t=R(),{mutate:r,isLoading:n}=w(C,{onSuccess:()=>{t.invalidateQueries(["/providers/rules"])}});return[o=>{o.preventDefault(),r({name:s,apiConfig:e})},n]}function oe(s){const e=R(),{data:t}=M(s),{mutate:r,isLoading:n}=w(ee,{onSuccess:()=>{e.invalidateQueries(["/providers/rules"])}});return[o=>{o.preventDefault(),r({names:t.names,apiConfig:s})},n]}function M(s){return _(["/providers/rules",s],()=>$("/providers/rules",s))}function ae(s){const{data:e,isFetching:t}=_(["/rules",s],()=>ne("/rules",s)),{data:r}=M(s),[n]=A(I);if(n==="")return{rules:e,provider:r,isFetching:t};{const i=n.toLowerCase();return{rules:e.filter(o=>o.payload.toLowerCase().indexOf(i)>=0),isFetching:t,provider:{byName:r.byName,names:r.names.filter(o=>o.toLowerCase().indexOf(i)>=0)}}}}const le="_RuleProviderItem_12aid_1",ue="_left_12aid_7",ce="_middle_12aid_14",de="_gray_12aid_21",he="_action_12aid_25",fe="_refreshBtn_12aid_32",h={RuleProviderItem:le,left:ue,middle:ce,gray:de,action:he,refreshBtn:fe};function me({idx:s,name:e,vehicleType:t,behavior:r,updatedAt:n,ruleCount:i,apiConfig:o}){const[u,l]=ie(e,o),c=H(new Date(n),new Date);return d("div",{className:h.RuleProviderItem,children:[a("span",{className:h.left,children:s}),d("div",{className:h.middle,children:[a(F,{name:e,type:`${t} / ${r}`}),a("div",{className:h.gray,children:i<2?`${i} rule`:`${i} rules`}),d("div",{className:h.action,children:[d(U,{onClick:u,disabled:l,className:h.refreshBtn,children:[a(P,{isRotating:l,size:13}),a("span",{className:"visually-hidden",children:"Refresh"})]}),d("small",{className:h.gray,children:["Updated ",c," ago"]})]})]})]})}function pe({apiConfig:s}){const[e,t]=oe(s),{t:r}=x();return a(G,{icon:a(P,{isRotating:t}),text:r("update_all_rule_provider"),style:J,onClick:e})}const ve="_rule_1ymqx_1",Re="_left_1ymqx_12",ye="_a_1ymqx_19",ge="_b_1ymqx_26",be="_type_1ymqx_37",f={rule:ve,left:Re,a:ye,b:ge,type:be},v={_default:"#59caf9",DIRECT:"#f5bc41",REJECT:"#cb3166"};function _e({proxy:s}){let e=v._default;return v[s]&&(e=v[s]),{color:e}}function xe({type:s,payload:e,proxy:t,id:r}){const n=_e({proxy:t});return d("div",{className:f.rule,children:[a("div",{className:f.left,children:r}),d("div",{children:[a("div",{className:f.b,children:e}),d("div",{className:f.a,children:[a("div",{className:f.type,children:s}),a("div",{style:n,children:t})]})]})]})}const Pe="_header_1j1w3_1",we="_RuleProviderItemWrapper_1j1w3_17",N={header:Pe,RuleProviderItemWrapper:we},{memo:Ce}=D,g=30;function Ie(s,{rules:e,provider:t}){const r=t.names.length;return s{const{rules:r,provider:n,apiConfig:i}=t,o=n.names.length;if(s({apiConfig:L(s)}),Ue=j(Se)(Ee);function Ee({apiConfig:s}){const[e,t]=K(),{rules:r,provider:n}=ae(s),i=Me({provider:n}),{t:o}=x();return d("div",{children:[d("div",{className:N.header,children:[a(z,{title:o("Rules")}),a(W,{placeholder:"Filter",textAtom:I})]}),a("div",{ref:e,style:{paddingBottom:g},children:a(V,{height:t-g,width:"100%",itemCount:r.length+n.names.length,itemSize:i,itemData:{rules:r,provider:n,apiConfig:s},itemKey:Ie,children:Ne})}),n&&n.names&&n.names.length>0?a(pe,{apiConfig:s}):null]})}export{Ue as default}; diff --git a/clash-bin/tests/data/config/public/assets/Rules.e03c54a8.css b/clash-bin/tests/data/config/public/assets/Rules.e03c54a8.css deleted file mode 100644 index a24b9edee..000000000 --- a/clash-bin/tests/data/config/public/assets/Rules.e03c54a8.css +++ /dev/null @@ -1 +0,0 @@ -._RuleProviderItem_12aid_1{display:grid;grid-template-columns:40px 1fr 46px;height:100%}._left_12aid_7{display:inline-flex;align-items:center;color:var(--color-text-secondary);opacity:.4}._middle_12aid_14{display:grid;gap:6px;grid-template-rows:1fr auto auto;align-items:center}._gray_12aid_21{color:#777}._action_12aid_25{display:grid;gap:4px;grid-template-columns:auto 1fr;align-items:center}._refreshBtn_12aid_32{padding:5px}._rule_1ymqx_1{display:flex;align-items:center;padding:6px 15px}@media screen and (min-width: 30em){._rule_1ymqx_1{padding:10px 40px}}._left_1ymqx_12{width:40px;padding-right:15px;color:var(--color-text-secondary);opacity:.4}._a_1ymqx_19{display:flex;align-items:center;font-size:12px;opacity:.8}._b_1ymqx_26{padding:10px 0;font-family:Roboto Mono,Menlo,monospace;font-size:16px}@media screen and (min-width: 30em){._b_1ymqx_26{font-size:19px}}._type_1ymqx_37{width:110px}._header_1j1w3_1{display:grid;grid-template-columns:1fr minmax(auto,330px);align-items:center;padding-right:15px}@media screen and (min-width: 30em){._header_1j1w3_1{padding-right:40px}}._RuleProviderItemWrapper_1j1w3_17{padding:6px 15px}@media screen and (min-width: 30em){._RuleProviderItemWrapper_1j1w3_17{padding:10px 40px}} diff --git a/clash-bin/tests/data/config/public/assets/Select.1e55eba1.css b/clash-bin/tests/data/config/public/assets/Select.1e55eba1.css deleted file mode 100644 index b3abe6ad9..000000000 --- a/clash-bin/tests/data/config/public/assets/Select.1e55eba1.css +++ /dev/null @@ -1 +0,0 @@ -._select_13zm8_1{height:40px;line-height:1.5;width:100%;padding-left:8px;-webkit-appearance:none;appearance:none;background-color:var(--color-input-bg);color:var(--color-text);padding-right:20px;border-radius:4px;border:1px solid var(--color-input-border);background-image:url(data:image/svg+xml,%0A%20%20%20%20%3Csvg%20width%3D%228%22%20height%3D%2224%22%20viewBox%3D%220%200%208%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%207L7%2011H1L4%207Z%22%20fill%3D%22%23999999%22%20%2F%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2017L1%2013L7%2013L4%2017Z%22%20fill%3D%22%23999999%22%20%2F%3E%0A%20%20%20%20%3C%2Fsvg%3E%0A%20%20);background-position:right 8px center;background-repeat:no-repeat}._select_13zm8_1:hover,._select_13zm8_1:focus{border-color:#343434;outline:none!important;color:var(--color-text-highlight);background-image:var(--select-bg-hover)}._select_13zm8_1:focus{box-shadow:#4299e199 0 0 0 3px}._select_13zm8_1 option{background-color:var(--color-background)} diff --git a/clash-bin/tests/data/config/public/assets/Select.6c389032.js b/clash-bin/tests/data/config/public/assets/Select.6c389032.js deleted file mode 100644 index 8cad17922..000000000 --- a/clash-bin/tests/data/config/public/assets/Select.6c389032.js +++ /dev/null @@ -1 +0,0 @@ -import{j as s}from"./index.171f553a.js";const o="_select_13zm8_1",r={select:o};function i({options:t,selected:c,onChange:l}){return s("select",{className:r.select,value:c,onChange:l,children:t.map(([e,n])=>s("option",{value:e,children:n},e))})}export{i as S}; diff --git a/clash-bin/tests/data/config/public/assets/TextFitler.61537a57.js b/clash-bin/tests/data/config/public/assets/TextFitler.61537a57.js deleted file mode 100644 index 9aeab7827..000000000 --- a/clash-bin/tests/data/config/public/assets/TextFitler.61537a57.js +++ /dev/null @@ -1 +0,0 @@ -import{r as u,b as g,j as i,k as c,c as f,V as x,i as d}from"./index.171f553a.js";import{d as h}from"./debounce.c2d20996.js";function v(t,n){if(t==null)return{};var o=_(t,n),r,e;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(e=0;e=0)&&(!Object.prototype.propertyIsEnumerable.call(t,r)||(o[r]=t[r]))}return o}function _(t,n){if(t==null)return{};var o={},r=Object.keys(t),e,s;for(s=0;s=0)&&(o[e]=t[e]);return o}var l=u.exports.forwardRef(function(t,n){var o=t.color,r=o===void 0?"currentColor":o,e=t.size,s=e===void 0?24:e,a=v(t,["color","size"]);return g("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[i("polyline",{points:"23 4 23 10 17 10"}),i("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})});l.propTypes={color:c.exports.string,size:c.exports.oneOfType([c.exports.string,c.exports.number])};l.displayName="RotateCw";const b=l,y="_rotate_1dspl_1",m="_isRotating_1dspl_5",R="_rotating_1dspl_1",p={rotate:y,isRotating:m,rotating:R};function P(t){const n=t.size||16,o=f(p.rotate,{[p.isRotating]:t.isRotating});return i("span",{className:o,children:i(b,{size:n})})}const{useCallback:w,useState:j,useMemo:k}=d;function O(t){const[,n]=x(t),[o,r]=j(""),e=k(()=>h(n,300),[n]);return[w(a=>{r(a.target.value),e(a.target.value)},[e]),o]}const T="_input_16a1f_1",C={input:T};function $(t){const[n,o]=O(t.textAtom);return i("input",{className:C.input,type:"text",value:o,onChange:n,placeholder:t.placeholder})}export{P as R,$ as T,b as a}; diff --git a/clash-bin/tests/data/config/public/assets/TextFitler.b21c0577.css b/clash-bin/tests/data/config/public/assets/TextFitler.b21c0577.css deleted file mode 100644 index bbdf0149c..000000000 --- a/clash-bin/tests/data/config/public/assets/TextFitler.b21c0577.css +++ /dev/null @@ -1 +0,0 @@ -._rotate_1dspl_1{display:inline-flex}._isRotating_1dspl_5{-webkit-animation:_rotating_1dspl_1 3s infinite linear;animation:_rotating_1dspl_1 3s infinite linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes _rotating_1dspl_1{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes _rotating_1dspl_1{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}._input_16a1f_1{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:20px;border:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;outline:none;padding:8px 15px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._input_16a1f_1:focus{border:1px solid var(--color-focus-blue)} diff --git a/clash-bin/tests/data/config/public/assets/chart-lib.a8ad03fd.js b/clash-bin/tests/data/config/public/assets/chart-lib.a8ad03fd.js deleted file mode 100644 index 8ed37cc9d..000000000 --- a/clash-bin/tests/data/config/public/assets/chart-lib.a8ad03fd.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Chart.js v3.9.1 - * https://www.chartjs.org - * (c) 2022 Chart.js Contributors - * Released under the MIT License - */const Gn=function(){let i=0;return function(){return i++}}();function E(i){return i===null||typeof i>"u"}function z(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function C(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}const W=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function J(i,t){return W(i)?i:t}function D(i,t){return typeof i>"u"?t:i}const Zn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,qs=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function I(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function R(i,t,e,s){let n,o,r;if(z(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;ni,x:i=>i.x,y:i=>i.y};function mt(i,t){return(Ii[t]||(Ii[t]=to(t)))(i)}function to(i){const t=eo(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function eo(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function pi(i){return i.charAt(0).toUpperCase()+i.slice(1)}const tt=i=>typeof i<"u",bt=i=>typeof i=="function",zi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function io(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const V=Math.PI,F=2*V,so=F+V,we=Number.POSITIVE_INFINITY,no=V/180,B=V/2,Nt=V/4,Bi=V*2/3,Q=Math.log10,ot=Math.sign;function Vi(i){const t=Math.round(i);i=qt(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Q(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function oo(i){const t=[],e=Math.sqrt(i);let s;for(s=1;sn-o).pop(),t}function Ft(i){return!isNaN(parseFloat(i))&&isFinite(i)}function qt(i,t,e){return Math.abs(i-t)=i}function Zs(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function bi(i,t,e){e=e||(r=>i[r]1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const St=(i,t,e,s)=>bi(i,e,s?n=>i[n][t]<=e:n=>i[n][t]bi(i,e,s=>i[s][t]>=e);function ho(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{const s="_onData"+pi(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function Wi(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Qs.forEach(o=>{delete i[o]}),delete i._chartjs)}function tn(i){const t=new Set;let e,s;for(e=0,s=i.length;e"u"?function(i){return i()}:window.requestAnimationFrame}();function sn(i,t,e){const s=e||(r=>Array.prototype.slice.call(r));let n=!1,o=[];return function(...r){o=s(r),n||(n=!0,en.call(window,()=>{n=!1,i.apply(t,o)}))}}function fo(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const nn=i=>i==="start"?"left":i==="end"?"right":"center",q=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,go=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function on(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(n=Y(Math.min(St(a,r.axis,c).lo,e?s:St(t,l,r.getPixelForValue(c)).lo),0,s-1)),u?o=Y(Math.max(St(a,r.axis,h,!0).hi+1,e?0:St(t,l,r.getPixelForValue(h),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function rn(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const le=i=>i===0||i===1,Hi=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*F/e)),ji=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*F/e)+1,Gt={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*B)+1,easeOutSine:i=>Math.sin(i*B),easeInOutSine:i=>-.5*(Math.cos(V*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>le(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>le(i)?i:Hi(i,.075,.3),easeOutElastic:i=>le(i)?i:ji(i,.075,.3),easeInOutElastic(i){return le(i)?i:i<.5?.5*Hi(i*2,.1125,.45):.5+.5*ji(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Gt.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Gt.easeInBounce(i*2)*.5:Gt.easeOutBounce(i*2-1)*.5+.5};/*! - * @kurkle/color v0.2.1 - * https://github.com/kurkle/color#readme - * (c) 2022 Jukka Kurkela - * Released under the MIT License - */function se(i){return i+.5|0}const ut=(i,t,e)=>Math.max(Math.min(i,e),t);function Xt(i){return ut(se(i*2.55),0,255)}function pt(i){return ut(se(i*255),0,255)}function ct(i){return ut(se(i/2.55)/100,0,1)}function $i(i){return ut(se(i*100),0,100)}const Z={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},oi=[..."0123456789ABCDEF"],po=i=>oi[i&15],mo=i=>oi[(i&240)>>4]+oi[i&15],ce=i=>(i&240)>>4===(i&15),bo=i=>ce(i.r)&&ce(i.g)&&ce(i.b)&&ce(i.a);function _o(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&Z[i[1]]*17,g:255&Z[i[2]]*17,b:255&Z[i[3]]*17,a:t===5?Z[i[4]]*17:255}:(t===7||t===9)&&(e={r:Z[i[1]]<<4|Z[i[2]],g:Z[i[3]]<<4|Z[i[4]],b:Z[i[5]]<<4|Z[i[6]],a:t===9?Z[i[7]]<<4|Z[i[8]]:255})),e}const xo=(i,t)=>i<255?t(i):"";function yo(i){var t=bo(i)?po:mo;return i?"#"+t(i.r)+t(i.g)+t(i.b)+xo(i.a,t):void 0}const vo=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function an(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Mo(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ko(i,t,e){const s=an(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function wo(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-r):h/(o+r),l=wo(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function xi(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(pt)}function yi(i,t,e){return xi(an,i,t,e)}function So(i,t,e){return xi(ko,i,t,e)}function Po(i,t,e){return xi(Mo,i,t,e)}function ln(i){return(i%360+360)%360}function Do(i){const t=vo.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Xt(+t[5]):pt(+t[5]));const n=ln(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=So(n,o,r):t[1]==="hsv"?s=Po(n,o,r):s=yi(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function Co(i,t){var e=_i(i);e[0]=ln(e[0]+t),e=yi(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Oo(i){if(!i)return;const t=_i(i),e=t[0],s=$i(t[1]),n=$i(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${ct(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Yi={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Xi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ao(){const i={},t=Object.keys(Xi),e=Object.keys(Yi);let s,n,o,r,a;for(s=0;s>16&255,o>>8&255,o&255]}return i}let he;function Lo(i){he||(he=Ao(),he.transparent=[0,0,0,0]);const t=he[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const To=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ro(i){const t=To.exec(i);let e=255,s,n,o;if(!!t){if(t[7]!==s){const r=+t[7];e=t[8]?Xt(r):ut(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Xt(s):ut(s,0,255)),n=255&(t[4]?Xt(n):ut(n,0,255)),o=255&(t[6]?Xt(o):ut(o,0,255)),{r:s,g:n,b:o,a:e}}}function Eo(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ct(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ye=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Tt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Fo(i,t,e){const s=Tt(ct(i.r)),n=Tt(ct(i.g)),o=Tt(ct(i.b));return{r:pt(Ye(s+e*(Tt(ct(t.r))-s))),g:pt(Ye(n+e*(Tt(ct(t.g))-n))),b:pt(Ye(o+e*(Tt(ct(t.b))-o))),a:i.a+e*(t.a-i.a)}}function de(i,t,e){if(i){let s=_i(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=yi(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function cn(i,t){return i&&Object.assign(t||{},i)}function Ui(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=pt(i[3]))):(t=cn(i,{r:0,g:0,b:0,a:1}),t.a=pt(t.a)),t}function Io(i){return i.charAt(0)==="r"?Ro(i):Do(i)}class Se{constructor(t){if(t instanceof Se)return t;const e=typeof t;let s;e==="object"?s=Ui(t):e==="string"&&(s=_o(t)||Lo(t)||Io(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=cn(this._rgb);return t&&(t.a=ct(t.a)),t}set rgb(t){this._rgb=Ui(t)}rgbString(){return this._valid?Eo(this._rgb):void 0}hexString(){return this._valid?yo(this._rgb):void 0}hslString(){return this._valid?Oo(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Fo(this._rgb,t._rgb,e)),this}clone(){return new Se(this.rgb)}alpha(t){return this._rgb.a=pt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=se(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return de(this._rgb,2,t),this}darken(t){return de(this._rgb,2,-t),this}saturate(t){return de(this._rgb,1,t),this}desaturate(t){return de(this._rgb,1,-t),this}rotate(t){return Co(this._rgb,t),this}}function hn(i){return new Se(i)}function dn(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ki(i){return dn(i)?i:hn(i)}function Xe(i){return dn(i)?i:hn(i).saturate(.5).darken(.1).hexString()}const Ct=Object.create(null),ri=Object.create(null);function Zt(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;se.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,s)=>Xe(s.backgroundColor),this.hoverBorderColor=(e,s)=>Xe(s.borderColor),this.hoverColor=(e,s)=>Xe(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Ue(this,t,e)}get(t){return Zt(this,t)}describe(t,e){return Ue(ri,t,e)}override(t,e){return Ue(Ct,t,e)}route(t,e,s,n){const o=Zt(this,t),r=Zt(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return C(l)?Object.assign({},c,l):D(l,c)},set(l){this[a]=l}}})}}var A=new zo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Bo(i){return!i||E(i.size)||E(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Pe(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Vo(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,d,u;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function te(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Ho(i,o),l=0;l+i||0;function vi(i,t){const e={},s=C(t),n=s?Object.keys(t):t,o=C(i)?s?r=>D(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=Uo(o(r));return e}function fn(i){return vi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Pt(i){return vi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function U(i){const t=fn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(i,t){i=i||{},t=t||A.font;let e=D(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=D(i.style,t.style);s&&!(""+s).match(Yo)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const n={family:D(i.family,t.family),lineHeight:Xo(D(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:D(i.weight,t.weight),string:""};return n.string=Bo(n),n}function ue(i,t,e,s){let n=!0,o,r,a;for(o=0,r=i.length;oe&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function _t(i,t){return Object.assign(Object.create(i),t)}function Mi(i,t=[""],e=i,s,n=()=>i[0]){tt(s)||(s=bn("_fallback",i));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:s,_getTarget:n,override:r=>Mi([r,...i],t,e,s)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete i[0][a],!0},get(r,a){return pn(r,a,()=>ir(a,t,i,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,a){return Zi(r).includes(a)},ownKeys(r){return Zi(r)},set(r,a,l){const c=r._storage||(r._storage=n());return r[a]=c[a]=l,delete r._keys,!0}})}function zt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:gn(i,s),setContext:o=>zt(i,o,e,s),override:o=>zt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return pn(o,r,()=>Go(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function gn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:bt(e)?e:()=>e,isIndexable:bt(s)?s:()=>s}}const qo=(i,t)=>i?i+pi(t):t,ki=(i,t)=>C(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function Go(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return bt(a)&&r.isScriptable(t)&&(a=Zo(t,a,i,e)),z(a)&&a.length&&(a=Jo(t,a,i,r.isIndexable)),ki(t,a)&&(a=zt(a,n,o&&o[t],r)),a}function Zo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),t=t(o,r||s),a.delete(i),ki(i,t)&&(t=wi(n._scopes,n,i,t)),t}function Jo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(tt(o.index)&&s(i))t=t[o.index%t.length];else if(C(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=wi(c,n,i,h);t.push(zt(d,o,r&&r[i],a))}}return t}function mn(i,t,e){return bt(i)?i(t,e):i}const Qo=(i,t)=>i===!0?t:typeof i=="string"?mt(t,i):void 0;function tr(i,t,e,s,n){for(const o of t){const r=Qo(e,o);if(r){i.add(r);const a=mn(r._fallback,e,n);if(tt(a)&&a!==e&&a!==s)return a}else if(r===!1&&tt(s)&&e!==s)return null}return!1}function wi(i,t,e,s){const n=t._rootScopes,o=mn(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Gi(a,r,e,o||e,s);return l===null||tt(o)&&o!==e&&(l=Gi(a,r,o,l,s),l===null)?!1:Mi(Array.from(a),[""],n,o,()=>er(t,e,s))}function Gi(i,t,e,s,n){for(;e;)e=tr(i,t,e,s,n);return e}function er(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return z(n)&&C(e)?e:n}function ir(i,t,e,s){let n;for(const o of t)if(n=bn(qo(o,i),e),tt(n))return ki(i,n)?wi(e,s,i,n):n}function bn(i,t){for(const e of t){if(!e)continue;const s=e[i];if(tt(s))return s}}function Zi(i){let t=i._keys;return t||(t=i._keys=sr(i._scopes)),t}function sr(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function _n(i,t,e,s){const{iScale:n}=i,{key:o="r"}=this._parsing,r=new Array(s);let a,l,c,h;for(a=0,l=s;ati==="x"?"y":"x";function or(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=ni(o,n),l=ni(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function rr(i,t,e){const s=i.length;let n,o,r,a,l,c=Bt(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")lr(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;owindow.getComputedStyle(i,null);function dr(i,t){return Ee(i).getPropertyValue(t)}const ur=["top","right","bottom","left"];function Dt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=ur[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const fr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function gr(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(fr(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function kt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Ee(e),o=n.boxSizing==="border-box",r=Dt(n,"padding"),a=Dt(n,"border","width"),{x:l,y:c,box:h}=gr(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/g*e.height/s)}}function pr(i,t,e){let s,n;if(t===void 0||e===void 0){const o=Si(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Ee(o),l=Dt(a,"border","width"),c=Dt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=De(a.maxWidth,o,"clientWidth"),n=De(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||we,maxHeight:n||we}}const Ke=i=>Math.round(i*10)/10;function mr(i,t,e,s){const n=Ee(i),o=Dt(n,"margin"),r=De(n.maxWidth,i,"clientWidth")||we,a=De(n.maxHeight,i,"clientHeight")||we,l=pr(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const d=Dt(n,"border","width"),u=Dt(n,"padding");c-=u.width+d.width,h-=u.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?Math.floor(c/s):h-o.height),c=Ke(Math.min(c,r,l.maxWidth)),h=Ke(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ke(c/2)),{width:c,height:h}}function Ji(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=n/s,i.width=o/s;const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const br=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function Qi(i,t){const e=dr(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function wt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function _r(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function xr(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=wt(i,n,e),a=wt(n,o,e),l=wt(o,t,e),c=wt(r,a,e),h=wt(a,l,e);return wt(c,h,e)}const ts=new Map;function yr(i,t){t=t||{};const e=i+JSON.stringify(t);let s=ts.get(e);return s||(s=new Intl.NumberFormat(i,t),ts.set(e,s)),s}function ne(i,t,e){return yr(t,e).format(i)}const vr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Mr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Et(i,t,e){return i?vr(t,e):Mr()}function vn(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Mn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function kn(i){return i==="angle"?{between:Qt,compare:ao,normalize:G}:{between:ht,compare:(t,e)=>t-e,normalize:t=>t}}function es({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function kr(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=kn(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(n,y,b)&&a(n,y)!==0,x=()=>a(o,b)===0||l(o,y,b),k=()=>p||v(),M=()=>!p||x();for(let S=h,w=h;S<=d;++S)_=t[S%r],!_.skip&&(b=c(_[s]),b!==y&&(p=l(b,n,o),m===null&&k()&&(m=a(b,n)===0?S:w),m!==null&&M()&&(g.push(es({start:m,end:S,loop:u,count:r,style:f})),m=null),w=S,y=b));return m!==null&&g.push(es({start:m,end:d,loop:u,count:r,style:f})),g}function Sn(i,t){const e=[],s=i.segments;for(let n=0;nn&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Sr(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function Pr(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=wr(e,n,o,s);if(s===!0)return is(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=en.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);!e||(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var at=new Or;const ns="transparent",Ar={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Ki(i||ns),n=s.valid&&Ki(t||ns);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Lr{constructor(t,e,s,n){const o=e[s];n=ue([t.to,n,o,t.from]);const r=ue([t.from,o,n]);this._active=!0,this._fn=t.fn||Ar[t.type||typeof r],this._easing=Gt[t.easing]||Gt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ue([t.to,e,n,t.from]),this._from=ue([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;ni!=="onProgress"&&i!=="onComplete"&&i!=="fn"});A.set("animations",{colors:{type:"color",properties:Rr},numbers:{type:"number",properties:Tr}});A.describe("animations",{_fallback:"animation"});A.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:i=>i|0}}}});class Pn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!C(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const n=t[s];if(!C(n))return;const o={};for(const r of Er)o[r]=n[r];(z(n.properties)&&n.properties||[s]).forEach(r=>{(r===s||!e.has(r))&&e.set(r,o)})})}_animateOptions(t,e){const s=e.options,n=Ir(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Fr(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new Lr(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return at.add(this._chart,s),!0}}function Fr(i,t){const e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function cs(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Nr(o,r,s),d=t.length;let u;for(let f=0;fe[s].axis===t).shift()}function jr(i,t){return _t(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function $r(i,t,e){return _t(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Wt(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(!!s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e]}}}const Ge=i=>i==="reset"||i==="none",hs=(i,t)=>t?i:Object.assign({},i),Yr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Dn(e,!0),values:null};class it{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=as(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Wt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=D(s.xAxisID,qe(t,"x")),r=e.yAxisID=D(s.yAxisID,qe(t,"y")),a=e.rAxisID=D(s.rAxisID,qe(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Wi(this._data,this),t._stacked&&Wt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(C(e))this._data=Vr(e);else if(s!==e){if(s){Wi(s,this);const n=this._cachedMeta;Wt(n),n._parsed=[]}e&&Object.isExtensible(e)&&uo(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=as(e.vScale,e),e.stack!==s.stack&&(n=!0,Wt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&cs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{z(n[t])?u=this.parseArrayData(s,n,t,e):C(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]p||d=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(s,n),p=c.resolveNamedOptions(u,f,g,d);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(hs(p,l))),p}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new Pn(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(!!t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ge(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){Ge(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Ge(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;an-o))}return i._cache.$bar}function Ur(i){const t=i.iScale,e=Xr(t,i.type);let s=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(tt(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(n=0,o=e.length;n0?n[i-1]:null,a=iMath.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function Cn(i,t,e,s){return z(i)?Gr(i,t,e,s):t[e.axis]=e.parse(i,s),t}function ds(i,t,e,s){const n=i.iScale,o=i.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,u;for(c=e,h=e+s;c=e?1:-1)}function Jr(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.basel.controller.options.grouped),o=s.options.stacked,r=[],a=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(E(h)||isNaN(h))return!0};for(const l of n)if(!(e!==void 0&&a(l))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:s,yScale:n}=e,o=this.getParsed(t),r=s.getLabelForValue(o.x),a=n.getLabelForValue(o.y),l=o._custom;return{label:e.label,value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=r.axis,d=a.axis;for(let u=e;uQt(y,a,l,!0)?1:Math.max(v,v*e,x,x*e),g=(y,v,x)=>Qt(y,a,l,!0)?-1:Math.min(v,v*e,x,x*e),p=f(0,c,d),m=f(B,h,u),b=g(V,c,d),_=g(V+B,h,u);s=(p-b)/2,n=(m-_)/2,o=-(p+b)/2,r=-(m+_)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}class oe extends it{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(C(s[t])){const{key:l="value"}=this._parsing;o=c=>+mt(s[c],l)}let r,a;for(r=t,a=t+e;r0&&!isNaN(t)?F*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=ne(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=s.data.datasets.length;ni!=="spacing",_indexable:i=>i!=="spacing"};oe.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{const r=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label;const e=": "+i.formattedValue;return z(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};class Fe extends it{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=on(e,n,r);this._drawStart=a,this._drawCount=l,rn(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=Ft(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none";let _=e>0&&this.getParsed(e-1);for(let y=e;y0&&Math.abs(x[u]-_[u])>m,p&&(k.parsed=x,k.raw=c.data[y]),d&&(k.options=h||this.resolveDataElementOptions(y,v.active?"active":n)),b||this.updateElement(v,y,k,n),_=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Fe.id="line";Fe.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Fe.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ci extends it{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=ne(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return _n.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(oe.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),r=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*V;let f=u,g;const p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?et(this.resolveDataElementOptions(t,e).angle||s):0}}Ci.id="polarArea";Ci.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ci.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{const r=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class On extends oe{}On.id="pie";On.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Oi extends it{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return _n.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta,s=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(s.points=n,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===n.length,options:r};this.updateElement(s,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){const o=this._cachedMeta.rScale,r=n==="reset";for(let a=e;a{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}rt.defaults={};rt.defaultRoutes=void 0;const An={values(i){return z(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=sa(i,e)}const r=Q(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ne(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=i/Math.pow(10,Math.floor(Q(i)));return s===1||s===2||s===5?An.numeric.call(this,i,t,e):""}};function sa(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Ie={formatters:An};A.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ie.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});A.route("scale.ticks","color","","color");A.route("scale.grid","color","","borderColor");A.route("scale.grid","borderColor","","borderColor");A.route("scale.title","color","","color");A.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"});A.describe("scales",{_fallback:"scale"});A.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function na(i,t){const e=i.options.ticks,s=e.maxTicksLimit||oa(i),n=e.major.enabled?aa(t):[],o=n.length,r=n[0],a=n[o-1],l=[];if(o>s)return la(t,l,n,o/s),l;const c=ra(n,t,s);if(o>0){let h,d;const u=o>1?Math.round((a-r)/(o-1)):null;for(ge(t,l,c,E(u)?0:r-u,r),h=0,d=o-1;hn)return l}return Math.max(n,1)}function aa(i){const t=[];let e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,gs=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function ps(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;or+a)))return l}function ua(i,t){R(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;os?s:e,s=n&&e>s?e:s,{min:J(e,J(s,e)),max:J(s,J(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ko(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Y(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-Ht(t.grid)-e.padding-ms(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=mi(Math.min(Math.asin(Y((h.highest.height+6)/a,-1,1)),Math.asin(Y(l/c,-1,1))-Math.asin(Y(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=ms(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ht(o)+l):(t.height=this.maxHeight,t.width=Ht(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,g=et(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=s.mirror?0:m*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:p*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,p)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){I(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:o[M]||0,height:r[M]||0});return{first:k(0),last:k(e-1),widest:k(v),highest:k(x),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return lo(this._alignToPixels?vt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/s:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r}=n,a=o.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),d=Ht(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(P){return vt(s,P,g)};let b,_,y,v,x,k,M,S,w,L,T,O;if(r==="top")b=m(this.bottom),k=this.bottom-d,S=b-p,L=m(t.top)+p,O=t.bottom;else if(r==="bottom")b=m(this.top),L=t.top,O=m(t.bottom)-p,k=b+p,S=this.top+d;else if(r==="left")b=m(this.right),x=this.right-d,M=b-p,w=m(t.left)+p,T=t.right;else if(r==="right")b=m(this.left),w=t.left,T=m(t.right)-p,x=b+p,M=this.left+d;else if(e==="x"){if(r==="center")b=m((t.top+t.bottom)/2+.5);else if(C(r)){const P=Object.keys(r)[0],j=r[P];b=m(this.chart.scales[P].getPixelForValue(j))}L=t.top,O=t.bottom,k=b+p,S=k+d}else if(e==="y"){if(r==="center")b=m((t.left+t.right)/2);else if(C(r)){const P=Object.keys(r)[0],j=r[P];b=m(this.chart.scales[P].getPixelForValue(j))}x=b-p,M=x-d,w=t.left,T=t.right}const H=D(n.ticks.maxTicksLimit,h),X=Math.max(1,Math.ceil(h/H));for(_=0;_o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(n)}}]:[{z:s,draw:n=>{this.drawBackground(),this.drawGrid(n),this.drawTitle()}},{z:s+1,draw:()=>{this.drawBorder()}},{z:e,draw:n=>{this.drawLabels(n)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");A.route(o,n,l,a)})}function xa(i){return"id"in i&&"defaults"in i}class ya{constructor(){this.controllers=new pe(it,"datasets",!0),this.elements=new pe(rt,"elements"),this.plugins=new pe(Object,"plugins"),this.scales=new pe(Ot,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):R(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=pi(t);I(s["before"+n],[],s),e[t](s),I(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let v=e;v0&&Math.abs(k[f]-y[f])>b,m&&(M.parsed=k,M.raw=c.data[v]),u&&(M.options=d||this.resolveDataElementOptions(v,x.active?"active":n)),_||this.updateElement(x,v,M,n),y=k}this.updateSharedOptions(d,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,r)/2}}Ai.id="scatter";Ai.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ai.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Mt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class li{constructor(t){this.options=t||{}}init(t){}formats(){return Mt()}parse(t,e){return Mt()}format(t,e){return Mt()}add(t,e,s){return Mt()}diff(t,e,s){return Mt()}startOf(t,e,s){return Mt()}endOf(t,e){return Mt()}}li.override=function(i){Object.assign(li.prototype,i)};var va={_date:li};function Ma(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?co:St;if(s){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function re(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var Pa={evaluateInteractionItems:re,modes:{index(i,t,e,s){const n=kt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Je(i,n,o,s,r):Qe(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=kt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Je(i,n,o,s,r):Qe(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function _s(i,t){return i.filter(e=>Ln.indexOf(e.pos)===-1&&e.box.axis===t)}function $t(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Da(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=$t(jt(t,"left"),!0),n=$t(jt(t,"right")),o=$t(jt(t,"top"),!0),r=$t(jt(t,"bottom")),a=_s(t,"x"),l=_s(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:jt(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function xs(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Tn(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function La(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!C(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Tn(r,o.getPadding());const a=Math.max(0,t.outerWidth-xs(r,i,"left","right")),l=Math.max(0,t.outerHeight-xs(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Ta(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Ra(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Ut(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Tn(u,U(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),g=Oa(l.concat(c),d);Ut(a.fullSize,f,d,g),Ut(l,f,d,g),Ut(c,f,d,g)&&Ut(l,f,d,g),Ta(f),ys(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,ys(a.rightAndBottom,f,d,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},R(a.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Rn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class Ea extends Rn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ye="$chartjs",Fa={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vs=i=>i===null||i==="";function Ia(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ye]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",vs(n)){const o=Qi(i,"width");o!==void 0&&(i.width=o)}if(vs(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Qi(i,"height");o!==void 0&&(i.height=o)}return i}const En=br?{passive:!0}:!1;function za(i,t,e){i.addEventListener(t,e,En)}function Ba(i,t,e){i.canvas.removeEventListener(t,e,En)}function Va(i,t){const e=Fa[i.type]||i.type,{x:s,y:n}=kt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Ce(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Na(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ce(a.addedNodes,s),r=r&&!Ce(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Wa(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ce(a.removedNodes,s),r=r&&!Ce(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const ie=new Map;let Ms=0;function Fn(){const i=window.devicePixelRatio;i!==Ms&&(Ms=i,ie.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Ha(i,t){ie.size||window.addEventListener("resize",Fn),ie.set(i,t)}function ja(i){ie.delete(i),ie.size||window.removeEventListener("resize",Fn)}function $a(i,t,e){const s=i.canvas,n=s&&Si(s);if(!n)return;const o=sn((a,l)=>{const c=n.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),Ha(i,o),r}function ti(i,t,e){e&&e.disconnect(),t==="resize"&&ja(i)}function Ya(i,t,e){const s=i.canvas,n=sn(o=>{i.ctx!==null&&e(Va(o,i))},i,o=>{const r=o[0];return[r,r.offsetX,r.offsetY]});return za(s,t,n),n}class Xa extends Rn{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Ia(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ye])return!1;const s=e[ye].initial;["height","width"].forEach(o=>{const r=s[o];E(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[ye],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Na,detach:Wa,resize:$a}[e]||Ya;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ti,detach:ti,resize:ti}[e]||Ba)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return mr(t,e,s,n)}isAttached(t){const e=Si(t);return!!(e&&e.isConnected)}}function Ua(i){return!yn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Ea:Xa}class Ka{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(I(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){E(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=D(s.options&&s.options.plugins,{}),o=qa(s);return n===!1&&!e?[]:Za(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function qa(i){const t={},e=[],s=Object.keys(nt.plugins.items);for(let o=0;o{const l=s[a];if(!C(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=hi(a,l),h=tl(c,n),d=e.scales||{};o[c]=o[c]||a,r[a]=Kt(Object.create(null),[{axis:c},l,d[c],d[h]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,c=a.indexAxis||ci(l,t),d=(Ct[l]||{}).scales||{};Object.keys(d).forEach(u=>{const f=Qa(u,c),g=a[f+"AxisID"]||o[f]||f;r[g]=r[g]||Object.create(null),Kt(r[g],[{axis:f},s[g],d[u]])})}),Object.keys(r).forEach(a=>{const l=r[a];Kt(l,[A.scales[l.type],A.scale])}),r}function In(i){const t=i.options||(i.options={});t.plugins=D(t.plugins,{}),t.scales=il(i,t)}function zn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function sl(i){return i=i||{},i.data=zn(i.data),In(i),i}const ks=new Map,Bn=new Set;function be(i,t){let e=ks.get(i);return e||(e=t(),ks.set(i,e),Bn.add(e)),e}const Yt=(i,t,e)=>{const s=mt(t,e);s!==void 0&&i.add(s)};class nl{constructor(t){this._config=sl(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=zn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),In(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return be(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return be(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return be(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return be(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Yt(l,t,d))),h.forEach(d=>Yt(l,n,d)),h.forEach(d=>Yt(l,Ct[o]||{},d)),h.forEach(d=>Yt(l,A,d)),h.forEach(d=>Yt(l,ri,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Bn.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ct[e]||{},A.datasets[e]||{},{type:e},A,ri]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=ws(this._resolverCache,t,n);let l=r;if(rl(r,e)){o.$shared=!1,s=bt(s)?s():s;const c=this.createResolver(t,s,a);l=zt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=ws(this._resolverCache,t,s);return C(e)?zt(o,e,void 0,n):o}}function ws(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Mi(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const ol=i=>C(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||bt(i[e]),!1);function rl(i,t){const{isScriptable:e,isIndexable:s}=gn(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(bt(a)||ol(a))||r&&z(a))return!0}return!1}var al="3.9.1";const ll=["top","bottom","left","right","chartArea"];function Ss(i,t){return i==="top"||i==="bottom"||ll.indexOf(i)===-1&&t==="x"}function Ps(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Ds(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),I(e&&e.onComplete,[i],t)}function cl(i){const t=i.chart,e=t.options.animation;I(e&&e.onProgress,[i],t)}function Vn(i){return yn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Oe={},Nn=i=>{const t=Vn(i);return Object.values(Oe).filter(e=>e.canvas===t).pop()};function hl(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function dl(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}class Li{constructor(t,e){const s=this.config=new nl(e),n=Vn(t),o=Nn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Ua(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Gn(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ka,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=fo(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Oe[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}at.listen(this,"complete",Ds),at.listen(this,"progress",cl),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return E(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ji(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return qi(this.canvas,this.ctx),this}stop(){return at.stop(this),this}resize(t,e){at.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ji(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};R(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=hi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),R(o,r=>{const a=r.options,l=a.id,c=hi(l,a),h=D(a.type,r.dtype);(a.position===void 0||Ss(a.position,c)!==Ss(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=nt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),R(n,(r,a)=>{r||delete s[a]}),R(s,r=>{ft.configure(this,r,r.options),ft.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ps("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){R(this.scales,t=>{ft.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!zi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;hl(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ft.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],R(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Te(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&Re(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return te(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Pa.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=_t(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);tt(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),at.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};R(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){R(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},R(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Me(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=io(t),c=dl(t,this._lastEvent,s,l);s&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const h=!Me(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}const Cs=()=>R(Li.instances,i=>i._plugins.invalidate()),dt=!0;Object.defineProperties(Li,{defaults:{enumerable:dt,value:A},instances:{enumerable:dt,value:Oe},overrides:{enumerable:dt,value:Ct},registry:{enumerable:dt,value:nt},version:{enumerable:dt,value:al},getChart:{enumerable:dt,value:Nn},register:{enumerable:dt,value:(...i)=>{nt.add(...i),Cs()}},unregister:{enumerable:dt,value:(...i)=>{nt.remove(...i),Cs()}}});function Wn(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+B,s-B),i.closePath(),i.clip()}function ul(i){return vi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function fl(i,t,e,s){const n=ul(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return Y(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:Y(n.innerStart,0,r),innerEnd:Y(n.innerEnd,0,r)}}function Rt(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function di(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),u=h>0?h+s+e+c:0;let f=0;const g=n-l;if(s){const P=h>0?h-s:0,j=d>0?d-s:0,N=(P+j)/2,yt=N!==0?g*N/(N+s):g;f=(g-yt)/2}const p=Math.max(.001,g*d-e/V)/d,m=(g-p)/2,b=l+m+f,_=n-m-f,{outerStart:y,outerEnd:v,innerStart:x,innerEnd:k}=fl(t,u,d,_-b),M=d-y,S=d-v,w=b+y/M,L=_-v/S,T=u+x,O=u+k,H=b+x/T,X=_-k/O;if(i.beginPath(),o){if(i.arc(r,a,d,w,L),v>0){const N=Rt(S,L,r,a);i.arc(N.x,N.y,v,L,_+B)}const P=Rt(O,_,r,a);if(i.lineTo(P.x,P.y),k>0){const N=Rt(O,X,r,a);i.arc(N.x,N.y,k,_+B,X+Math.PI)}if(i.arc(r,a,u,_-k/u,b+x/u,!0),x>0){const N=Rt(T,H,r,a);i.arc(N.x,N.y,x,H+Math.PI,b-B)}const j=Rt(M,b,r,a);if(i.lineTo(j.x,j.y),y>0){const N=Rt(M,w,r,a);i.arc(N.x,N.y,y,b-B,w)}}else{i.moveTo(r,a);const P=Math.cos(w)*d+r,j=Math.sin(w)*d+a;i.lineTo(P,j);const N=Math.cos(L)*d+r,yt=Math.sin(L)*d+a;i.lineTo(N,yt)}i.closePath()}function gl(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){di(i,t,e,s,r+F,n);for(let c=0;c=F||Qt(o,a,l),p=ht(r,c+u,h+u);return g&&p}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:s}=this,n=(e.offset||0)/2,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>F?Math.floor(s/F):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=V&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const l=gl(t,this,a,o,r);ml(t,this,a,o,l,r),t.restore()}}Ti.id="arc";Ti.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Ti.defaultRoutes={backgroundColor:"backgroundColor"};function Hn(i,t,e=t){i.lineCap=D(e.borderCapStyle,t.borderCapStyle),i.setLineDash(D(e.borderDash,t.borderDash)),i.lineDashOffset=D(e.borderDashOffset,t.borderDashOffset),i.lineJoin=D(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=D(e.borderWidth,t.borderWidth),i.strokeStyle=D(e.borderColor,t.borderColor)}function bl(i,t,e){i.lineTo(e.x,e.y)}function _l(i){return i.stepped?No:i.tension||i.cubicInterpolationMode==="monotone"?Wo:bl}function jn(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=na&&o>a;return{count:s,start:l,loop:t.loop,ilen:c(r+(c?a-v:v))%o,y=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(f=n[_(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[_(u)],f.skip)continue;const v=f.x,x=f.y,k=v|0;k===g?(xm&&(m=x),h=(d*h+v)/++d):(y(),i.lineTo(v,x),g=k,d=0,p=m=x),b=x}y()}function ui(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?yl:xl}function vl(i){return i.stepped?_r:i.tension||i.cubicInterpolationMode==="monotone"?xr:wt}function Ml(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Hn(i,t.options),i.stroke(n)}function kl(i,t,e,s){const{segments:n,options:o}=t,r=ui(t);for(const a of n)Hn(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const wl=typeof Path2D=="function";function Sl(i,t,e,s){wl&&!t.options.segment?Ml(i,t,e,s):kl(i,t,e,s)}class xt extends rt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;hr(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Pr(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Sn(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=vl(s);let c,h;for(c=0,h=r.length;ci!=="borderDash"&&i!=="fill"};function Os(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o){a=Ei(r,a,n);const l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Ei(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function As(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function Yn(i,t){let e=[],s=!1;return z(i)?(s=!0,e=i):e=Tl(i,t),e.length?new xt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Ls(i){return i&&i.fill!==!1}function Rl(i,t,e){let n=i[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!W(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function El(i,t,e){const s=Bl(i);if(C(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return W(n)&&Math.floor(n)===n?Fl(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Fl(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Il(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:C(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function zl(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:C(i)?s=i.value:s=t.getBaseValue(),s}function Bl(i){const t=i.options,e=t.fill;let s=D(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Vl(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=Nl(t,e);a.push(Yn({x:null,y:t.bottom},s));for(let l=0;l=0;--r){const a=n[r].$filler;!a||(a.line.updateControlPoints(o,a.axis),s&&a.fill&&si(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;Ls(o)&&si(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Ls(s)||e.drawTime!=="beforeDatasetDraw"||si(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Fs=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},Zl=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Is extends rt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=I(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=$(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Fs(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,o,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{const m=s+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const _=s+e/2+o.measureText(m.text).width;b>0&&f+n+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,p++,u=f=0),l[b]={left:g,top:f,col:p,width:_,height:n},u=Math.max(u,_),f+=n+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=Et(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=q(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=q(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=q(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=q(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Te(t,this),this._draw(),Re(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=A.color,l=Et(t.rtl,this.left,this.width),c=$(r.font),{color:h,padding:d}=r,u=c.size,f=u/2;let g;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=Fs(r,u),_=function(M,S,w){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const L=D(w.lineWidth,1);if(n.fillStyle=D(w.fillStyle,a),n.lineCap=D(w.lineCap,"butt"),n.lineDashOffset=D(w.lineDashOffset,0),n.lineJoin=D(w.lineJoin,"miter"),n.lineWidth=L,n.strokeStyle=D(w.strokeStyle,a),n.setLineDash(D(w.lineDash,[])),r.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:L},O=l.xPlus(M,p/2),H=S+f;un(n,T,O,H,r.pointStyleWidth&&p)}else{const T=S+Math.max((u-m)/2,0),O=l.leftForLtr(M,p),H=Pt(w.borderRadius);n.beginPath(),Object.values(H).some(X=>X!==0)?ee(n,{x:O,y:T,w:p,h:m,radius:H}):n.rect(O,T,p,m),n.fill(),L!==0&&n.stroke()}n.restore()},y=function(M,S,w){It(n,w.text,M,S+b/2,c,{strikethrough:w.hidden,textAlign:l.textAlign(w.textAlign)})},v=this.isHorizontal(),x=this._computeTitleHeight();v?g={x:q(o,this.left+d,this.right-s[0]),y:this.top+d+x,line:0}:g={x:this.left+d,y:q(o,this.top+x+d,this.bottom-e[0].height),line:0},vn(this.ctx,t.textDirection);const k=b+d;this.legendItems.forEach((M,S)=>{n.strokeStyle=M.fontColor||h,n.fillStyle=M.fontColor||h;const w=n.measureText(M.text).width,L=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),T=p+f+w;let O=g.x,H=g.y;l.setWidth(this.width),v?S>0&&O+T+d>this.right&&(H=g.y+=k,g.line++,O=g.x=q(o,this.left+d,this.right-s[g.line])):S>0&&H+k>this.bottom&&(O=g.x=O+e[g.line].width+d,g.line++,H=g.y=q(o,this.top+x+d,this.bottom-e[g.line].height));const X=l.x(O);_(X,H,M),O=go(L,O+p+f,v?O+T:this.right,t.rtl),y(l.x(O),H,M),v?g.x+=T+d:g.y+=k}),Mn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=$(e.font),n=U(e.padding);if(!e.display)return;const o=Et(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=q(t.align,d,this.right-u);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+q(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=q(a,d,d+u);r.textAlign=o.textAlign(nn(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,It(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=$(t.font),s=U(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(ht(t,this.left,this.right)&&ht(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;si.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o}}=i.legend.options;return i._getSortedDatasetMetas().map(r=>{const a=r.controller.getStyle(e?0:void 0),l=U(a.borderWidth);return{text:t[r.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!r.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:r.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};const ve={average(i){if(!i.length)return!1;let t,e,s=0,n=0,o=0;for(t=0,e=i.length;t-1?i.split(` -`):i}function tc(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function zs(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=$(t.bodyFont),c=$(t.titleFont),h=$(t.footerFont),d=o.length,u=n.length,f=s.length,g=U(t.padding);let p=g.height,m=0,b=s.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let _=0;const y=function(v){m=Math.max(m,e.measureText(v).width+_)};return e.save(),e.font=c.string,R(i.title,y),e.font=l.string,R(i.beforeBody.concat(i.afterBody),y),_=t.displayColors?r+2+t.boxPadding:0,R(s,v=>{R(v.before,y),R(v.lines,y),R(v.after,y)}),_=0,e.font=h.string,R(i.footer,y),e.restore(),m+=g.width,{width:m,height:p}}function ec(i,t){const{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function ic(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function sc(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),ic(c,i,t,e)&&(c="center"),c}function Bs(i,t,e){const s=e.yAlign||t.yAlign||ec(i,e);return{xAlign:e.xAlign||t.xAlign||sc(i,t,e,s),yAlign:s}}function nc(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function oc(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Vs(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Pt(r);let g=nc(t,a);const p=oc(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+n:a==="right"&&(g+=Math.max(d,f)+n),{x:Y(g,0,s.width-t.width),y:Y(p,0,s.height-t.height)}}function _e(i,t,e){const s=U(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Ns(i){return st([],lt(i))}function rc(i,t,e){return _t(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ws(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}class ac extends rt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Pn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=rc(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=s.beforeTitle.apply(this,[t]),o=s.title.apply(this,[t]),r=s.afterTitle.apply(this,[t]);let a=[];return a=st(a,lt(n)),a=st(a,lt(o)),a=st(a,lt(r)),a}getBeforeBody(t,e){return Ns(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:s}=e,n=[];return R(t,o=>{const r={before:[],lines:[],after:[]},a=Ws(s,o);st(r.before,lt(a.beforeLabel.call(this,o))),st(r.lines,a.label.call(this,o)),st(r.after,lt(a.afterLabel.call(this,o))),n.push(r)}),n}getAfterBody(t,e){return Ns(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:s}=e,n=s.beforeFooter.apply(this,[t]),o=s.footer.apply(this,[t]),r=s.afterFooter.apply(this,[t]);let a=[];return a=st(a,lt(n)),a=st(a,lt(o)),a=st(a,lt(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),R(a,h=>{const d=Ws(t.callbacks,h);n.push(d.labelColor.call(this,h)),o.push(d.labelPointStyle.call(this,h)),r.push(d.labelTextColor.call(this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=ve[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=zs(this,s),c=Object.assign({},a,l),h=Bs(this.chart,s,c),d=Vs(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Pt(a),{x:u,y:f}=t,{width:g,height:p}=e;let m,b,_,y,v,x;return o==="center"?(v=f+p/2,n==="left"?(m=u,b=m-r,y=v+r,x=v-r):(m=u+g,b=m+r,y=v-r,x=v+r),_=m):(n==="left"?b=u+Math.max(l,h)+r:n==="right"?b=u+g-Math.max(c,d)-r:b=this.caretX,o==="top"?(y=f,v=y-r,m=b-r,_=b+r):(y=f+p,v=y+r,m=b+r,_=b-r),x=y),{x1:m,x2:b,x3:_,y1:y,y2:v,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Et(s.rtl,this.x,this.width);for(t.x=_e(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=$(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ee(t,{x:m,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ee(t,{x:b,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=$(s.bodyFont);let u=d.lineHeight,f=0;const g=Et(s.rtl,this.x,this.width),p=function(S){e.fillText(S,g.x(t.x+f),t.y+u/2),t.y+=u+o},m=g.textAlign(r);let b,_,y,v,x,k,M;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=_e(this,m,s),e.fillStyle=s.bodyColor,R(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,k=n.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=ve[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=zs(this,t),l=Object.assign({},r,this._size),c=Bs(e,t,l),h=Vs(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=U(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),vn(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Mn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Me(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!Me(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=ve[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}ac.positioners=ve;const lc=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function cc(i,t,e,s){const n=i.indexOf(t);if(n===-1)return lc(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const hc=(i,t)=>i===null?null:Y(Math.round(i),0,t);class Ae extends Ot{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(E(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:cc(s,t,D(e,t),this._addedLabels),hc(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Ae.id="category";Ae.defaults={ticks:{callback:Ae.prototype.getLabelForValue}};function dc(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,g=h-1,{min:p,max:m}=t,b=!E(r),_=!E(a),y=!E(c),v=(m-p)/(d+1);let x=Vi((m-p)/g/f)*f,k,M,S,w;if(x<1e-14&&!b&&!_)return[{value:p},{value:m}];w=Math.ceil(m/x)-Math.floor(p/x),w>g&&(x=Vi(w*x/g/f)*f),E(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),n==="ticks"?(M=Math.floor(p/x)*x,S=Math.ceil(m/x)*x):(M=p,S=m),b&&_&&o&&ro((a-r)/o,x/1e3)?(w=Math.round(Math.min((a-r)/x,h)),x=(a-r)/w,M=r,S=a):y?(M=b?r:M,S=_?a:S,w=c-1,x=(S-M)/w):(w=(S-M)/x,qt(w,Math.round(w),x/1e3)?w=Math.round(w):w=Math.ceil(w));const L=Math.max(Ni(x),Ni(M));k=Math.pow(10,E(l)?L:l),M=Math.round(M*k)/k,S=Math.round(S*k)/k;let T=0;for(b&&(u&&M!==r?(e.push({value:r}),Mn=e?n:l,a=l=>o=s?o:l;if(t){const l=ot(n),c=ot(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=1;(o>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(o*.05)),a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=dc(n,o);return t.bounds==="ticks"&&Zs(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return ne(t,this.chart.options.locale,this.options.ticks.format)}}class Fi extends Le{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?t:0,this.max=W(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=et(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Fi.id="linear";Fi.defaults={ticks:{callback:Ie.formatters.numeric}};function js(i){return i/Math.pow(10,Math.floor(Q(i)))===1}function uc(i,t){const e=Math.floor(Q(t.max)),s=Math.ceil(t.max/Math.pow(10,e)),n=[];let o=J(i.min,Math.pow(10,Math.floor(Q(t.min)))),r=Math.floor(Q(o)),a=Math.floor(o/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do n.push({value:o,major:js(o)}),++a,a===10&&(a=1,++r,l=r>=0?1:l),o=Math.round(a*Math.pow(10,r)*l)/l;while(r0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?Math.max(0,t):null,this.max=W(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const o=l=>s=t?s:l,r=l=>n=e?n:l,a=(l,c)=>Math.pow(10,Math.floor(Q(l))+c);s===n&&(s<=0?(o(1),r(10)):(o(a(s,-1)),r(a(n,1)))),s<=0&&o(a(n,-1)),n<=0&&r(a(s,1)),this._zero&&this.min!==this._suggestedMin&&s===a(this.min,0)&&o(a(s,-1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=uc(e,this);return t.bounds==="ticks"&&Zs(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":ne(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Q(t),this._valueRange=Q(this.max)-Q(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Q(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}Un.id="logarithmic";Un.defaults={ticks:{callback:Ie.formatters.logarithmic,major:{enabled:!0}}};function gi(i){const t=i.ticks;if(t.display&&i.display){const e=U(t.backdropPadding);return D(t.font&&t.font.size,A.font.size)+e.height}return 0}function fc(i,t,e){return e=z(e)?e:[e],{w:Vo(i,t.string,e),h:e.length*t.lineHeight}}function $s(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:in?{start:t-e,end:t}:{start:t,end:t+e}}function gc(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?V/o:0;for(let l=0;lt.r&&(a=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),n.startt.b&&(l=(n.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function mc(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,r=gi(o)/2,a=i.drawingArea,l=o.pointLabels.centerPointLabels?V/n:0;for(let c=0;c270||e<90)&&(i-=t),i}function yc(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const o=s.setContext(i.getPointLabelContext(n)),r=$(o.font),{x:a,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=i._pointLabelItems[n],{backdropColor:g}=o;if(!E(g)){const p=Pt(o.borderRadius),m=U(o.backdropPadding);e.fillStyle=g;const b=h-m.left,_=d-m.top,y=u-h+m.width,v=f-d+m.height;Object.values(p).some(x=>x!==0)?(e.beginPath(),ee(e,{x:b,y:_,w:y,h:v,radius:p}),e.fill()):e.fillRect(b,_,y,v)}It(e,i._pointLabels[n],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Kn(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,F);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let r=1;r{const n=I(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?gc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){const e=F/(this._pointLabels.length||1),s=this.options.startAngle||0;return G(t*e+et(s))}getDistanceFromCenterForValue(t){if(E(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(E(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);const d=n.setContext(this.getContext(h-1));vc(this,d,a,o)}}),s.display){for(t.save(),r=o-1;r>=0;r--){const c=s.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=s.setContext(this.getContext(l)),h=$(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=U(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}It(t,a.label,0,-o,h,{color:c.color})}),t.restore()}drawTitle(){}}Be.id="radialLinear";Be.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ie.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};Be.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Be.descriptors={angleLines:{_fallback:"grid"}};const Ve={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},K=Object.keys(Ve);function kc(i,t){return i-t}function Ys(i,t){if(E(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),W(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Ft(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Xs(i,t,e,s){const n=K.length;for(let o=K.indexOf(i);o=K.indexOf(e);o--){const r=K[o];if(Ve[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return K[e?K.indexOf(e):0]}function Sc(i){for(let t=K.indexOf(i)+1,e=K.length;t=t?e[s]:e[n];i[o]=!0}}function Pc(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function Ks(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=Y(e,0,r),s=Y(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Xs(o.minUnit,e,s,this._getLabelCapacity(e)),a=D(o.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Ft(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;up-m).map(p=>+p)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=s[e],u=l&&h&&d&&d.major,f=this._adapter.format(t,n||(u?h:c)),g=o.ticks.callback;return g?I(g,[f,e,s],this):f}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=St(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=St(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class qn extends Ne{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=xe(e,this.min),this._tableRange=xe(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r=0)&&(!Object.prototype.propertyIsEnumerable.call(r,o)||(n[o]=r[o]))}return n}function v(r,i){if(r==null)return{};var n={},o=Object.keys(r),e,t;for(t=0;t=0)&&(n[e]=r[e]);return n}var p=f.exports.forwardRef(function(r,i){var n=r.color,o=n===void 0?"currentColor":n,e=r.size,t=e===void 0?24:e,a=c(r,["color","size"]);return l("svg",{ref:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:l("polyline",{points:"6 9 12 15 18 9"})})});p.propTypes={color:s.exports.string,size:s.exports.oneOfType([s.exports.string,s.exports.number])};p.displayName="ChevronDown";const u=p;export{u as C}; diff --git a/clash-bin/tests/data/config/public/assets/debounce.c2d20996.js b/clash-bin/tests/data/config/public/assets/debounce.c2d20996.js deleted file mode 100644 index 3f3779c44..000000000 --- a/clash-bin/tests/data/config/public/assets/debounce.c2d20996.js +++ /dev/null @@ -1 +0,0 @@ -function O(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var M=typeof global=="object"&&global&&global.Object===Object&&global;const R=M;var w=typeof self=="object"&&self&&self.Object===Object&&self,B=R||w||Function("return this")();const W=B;var F=function(){return W.Date.now()};const S=F;var G=/\s/;function U(e){for(var n=e.length;n--&&G.test(e.charAt(n)););return n}var _=/^\s+/;function D(e){return e&&e.slice(0,U(e)+1).replace(_,"")}var H=W.Symbol;const y=H;var L=Object.prototype,X=L.hasOwnProperty,q=L.toString,g=y?y.toStringTag:void 0;function z(e){var n=X.call(e,g),i=e[g];try{e[g]=void 0;var o=!0}catch{}var f=q.call(e);return o&&(n?e[g]=i:delete e[g]),f}var J=Object.prototype,K=J.toString;function Q(e){return K.call(e)}var V="[object Null]",Y="[object Undefined]",$=y?y.toStringTag:void 0;function Z(e){return e==null?e===void 0?Y:V:$&&$ in Object(e)?z(e):Q(e)}function ee(e){return e!=null&&typeof e=="object"}var ne="[object Symbol]";function te(e){return typeof e=="symbol"||ee(e)&&Z(e)==ne}var E=0/0,re=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,oe=/^0o[0-7]+$/i,ae=parseInt;function k(e){if(typeof e=="number")return e;if(te(e))return E;if(O(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=O(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=D(e);var i=ie.test(e);return i||oe.test(e)?ae(e.slice(2),i?2:8):re.test(e)?E:+e}var fe="Expected a function",ce=Math.max,ue=Math.min;function se(e,n,i){var o,f,s,u,r,c,d=0,v=!1,l=!1,T=!0;if(typeof e!="function")throw new TypeError(fe);n=k(n)||0,O(i)&&(v=!!i.leading,l="maxWait"in i,s=l?ce(k(i.maxWait)||0,n):s,T="trailing"in i?!!i.trailing:T);function j(t){var a=o,b=f;return o=f=void 0,d=t,u=e.apply(b,a),u}function N(t){return d=t,r=setTimeout(m,n),v?j(t):u}function P(t){var a=t-c,b=t-d,I=n-a;return l?ue(I,s-b):I}function h(t){var a=t-c,b=t-d;return c===void 0||a>=n||a<0||l&&b>=s}function m(){var t=S();if(h(t))return x(t);r=setTimeout(m,P(t))}function x(t){return r=void 0,T&&o?j(t):(o=f=void 0,u)}function A(){r!==void 0&&clearTimeout(r),d=0,o=c=f=r=void 0}function C(){return r===void 0?u:x(S())}function p(){var t=S(),a=h(t);if(o=arguments,f=this,c=t,a){if(r===void 0)return N(c);if(l)return clearTimeout(r),r=setTimeout(m,n),j(c)}return r===void 0&&(r=setTimeout(m,n)),u}return p.cancel=A,p.flush=C,p}export{se as d}; diff --git a/clash-bin/tests/data/config/public/assets/en.fb34eaf7.js b/clash-bin/tests/data/config/public/assets/en.fb34eaf7.js deleted file mode 100644 index 8953c84ec..000000000 --- a/clash-bin/tests/data/config/public/assets/en.fb34eaf7.js +++ /dev/null @@ -1 +0,0 @@ -const e={Overview:"Overview",Proxies:"Proxies",Rules:"Rules",Conns:"Conns",Config:"Config",Logs:"Logs",Upload:"Upload",Download:"Download","Upload Total":"Upload Total","Download Total":"Download Total","Active Connections":"Active Connections","Pause Refresh":"Pause Refresh","Resume Refresh":"Resume Refresh",Up:"Up",Down:"Down","Test Latency":"Test Latency",settings:"settings",sort_in_grp:"Sorting in group",hide_unavail_proxies:"Hide unavailable proxies",auto_close_conns:"Automatically close old connections",order_natural:"Original order in config file",order_latency_asc:"By latency from small to big",order_latency_desc:"By latency from big to small",order_name_asc:"By name alphabetically (A-Z)",order_name_desc:"By name alphabetically (Z-A)",Connections:"Connections",Active:"Active",Closed:"Closed",switch_theme:"Switch theme",theme:"theme",about:"about",no_logs:"No logs yet, hang tight...",chart_style:"Chart Style",latency_test_url:"Latency Test URL",lang:"Language",update_all_rule_provider:"Update all rule providers",update_all_proxy_provider:"Update all proxy providers"};export{e as data}; diff --git a/clash-bin/tests/data/config/public/assets/index.171f553a.js b/clash-bin/tests/data/config/public/assets/index.171f553a.js deleted file mode 100644 index 7adb277ba..000000000 --- a/clash-bin/tests/data/config/public/assets/index.171f553a.js +++ /dev/null @@ -1,130 +0,0 @@ -var O_=Object.defineProperty;var k_=(e,t,n)=>t in e?O_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var lh=(e,t,n)=>(k_(e,typeof t!="symbol"?t+"":t,n),n);function Ng(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();const T_="modulepreload",P_=function(e,t){return new URL(e,t).href},uh={},_n=function(t,n,r){if(!n||n.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(n.map(i=>{if(i=P_(i,r),i in uh)return;uh[i]=!0;const a=i.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let c=o.length-1;c>=0;c--){const f=o[c];if(f.href===i&&(!a||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${s}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":T_,a||(u.as="script",u.crossOrigin=""),u.href=i,document.head.appendChild(u),a)return new Promise((c,f)=>{u.addEventListener("load",c),u.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())};function Hn(e){return Hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hn(e)}function Mt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ch(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};Mt(this,e),this.init(t,n)}return $t(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||A_,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o1?r-1:0),i=1;i-1?s.replace(/###/g,"."):s}function o(){return!e||typeof e=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return o()?{}:{obj:e,k:r(i.shift())}}function vh(e,t,n){var r=id(e,t,Object),o=r.obj,i=r.k;o[i]=n}function M_(e,t,n,r){var o=id(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}function Rs(e,t){var n=id(e,t),r=n.obj,o=n.k;if(!!r)return r[o]}function mh(e,t,n){var r=Rs(e,n);return r!==void 0?r:Rs(t,n)}function Mg(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):Mg(e[r],t[r],n):e[r]=t[r]);return e}function Vr(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var $_={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function U_(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return $_[t]}):e}var wl=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,F_=[" ",",","?","!",";"];function j_(e,t,n){t=t||"",n=n||"";var r=F_.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}function gh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ka(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $g(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;ii+a;)a++,s=r.slice(i,i+a).join(n),l=o[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(i+a).join(n);return u?$g(l,u,n):void 0}o=o[r[i]]}return o}}var V_=function(e){yl(n,e);var t=B_(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Mt(this,n),o=t.call(this),wl&&rr.call(Kn(o)),o.data=r||{},o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return $t(n,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var i=this.options.ns.indexOf(o);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(o,i,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[o,i];a&&typeof a!="string"&&(c=c.concat(a)),a&&typeof a=="string"&&(c=c.concat(l?a.split(l):a)),o.indexOf(".")>-1&&(c=o.split("."));var f=Rs(this.data,c);return f||!u||typeof a!="string"?f:$g(this.data&&this.data[o]&&this.data[o][i],a,l)}},{key:"addResource",value:function(o,i,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[o,i];a&&(c=c.concat(u?a.split(u):a)),o.indexOf(".")>-1&&(c=o.split("."),s=i,i=c[1]),this.addNamespaces(i),vh(this.data,c,s),l.silent||this.emit("added",o,i,a,s)}},{key:"addResources",value:function(o,i,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(o,i,l,a[l],{silent:!0});s.silent||this.emit("added",o,i,a)}},{key:"addResourceBundle",value:function(o,i,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[o,i];o.indexOf(".")>-1&&(c=o.split("."),s=a,a=i,i=c[1]),this.addNamespaces(i);var f=Rs(this.data,c)||{};s?Mg(f,a,l):f=ka(ka({},f),a),vh(this.data,c,f),u.silent||this.emit("added",o,i,a)}},{key:"removeResourceBundle",value:function(o,i){this.hasResourceBundle(o,i)&&delete this.data[o][i],this.removeNamespaces(i),this.emit("removed",o,i)}},{key:"hasResourceBundle",value:function(o,i){return this.getResource(o,i)!==void 0}},{key:"getResourceBundle",value:function(o,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?ka(ka({},{}),this.getResource(o,i)):this.getResource(o,i)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var i=this.getDataByLanguage(o),a=i&&Object.keys(i)||[];return!!a.find(function(s){return i[s]&&Object.keys(i[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(rr),Ug={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,o,i))}),n}};function yh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xe(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var wh={},Sh=function(e){yl(n,e);var t=W_(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Mt(this,n),o=t.call(this),wl&&rr.call(Kn(o)),D_(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Kn(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=an.create("translator"),o}return $t(n,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var a=this.resolve(o,i);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(o,i){var a=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ns||this.options.defaultNS||[],u=a&&o.indexOf(a)>-1,c=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!j_(o,a,s);if(u&&!c){var f=o.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:o,namespaces:l};var d=o.split(a);(a!==s||a===s&&this.options.ns.indexOf(d[0])>-1)&&(l=d.shift()),o=d.join(s)}return typeof l=="string"&&(l=[l]),{key:o,namespaces:l}}},{key:"translate",value:function(o,i,a){var s=this;if(Hn(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var l=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=this.extractFromKey(o[o.length-1],i),f=c.key,d=c.namespaces,h=d[d.length-1],g=i.lng||this.language,y=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(y){var b=i.nsSeparator||this.options.nsSeparator;return l?(m.res="".concat(h).concat(b).concat(f),m):"".concat(h).concat(b).concat(f)}return l?(m.res=f,m):f}var m=this.resolve(o,i),p=m&&m.res,v=m&&m.usedKey||f,S=m&&m.exactUsedKey||f,k=Object.prototype.toString.apply(p),C=["[object Number]","[object Function]","[object RegExp]"],N=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,A=!this.i18nFormat||this.i18nFormat.handleAsObject,W=typeof p!="string"&&typeof p!="boolean"&&typeof p!="number";if(A&&p&&W&&C.indexOf(k)<0&&!(typeof N=="string"&&k==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,p,Xe(Xe({},i),{},{ns:d})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(m.res=F,m):F}if(u){var X=k==="[object Array]",ce=X?[]:{},ae=X?S:v;for(var _ in p)if(Object.prototype.hasOwnProperty.call(p,_)){var L="".concat(ae).concat(u).concat(_);ce[_]=this.translate(L,Xe(Xe({},i),{joinArrays:!1,ns:d})),ce[_]===L&&(ce[_]=p[_])}p=ce}}else if(A&&typeof N=="string"&&k==="[object Array]")p=p.join(N),p&&(p=this.extendTranslation(p,o,i,a));else{var j=!1,O=!1,P=i.count!==void 0&&typeof i.count!="string",I=n.hasDefaultValue(i),M=P?this.pluralResolver.getSuffix(g,i.count,i):"",z=i["defaultValue".concat(M)]||i.defaultValue;!this.isValidLookup(p)&&I&&(j=!0,p=z),this.isValidLookup(p)||(O=!0,p=f);var E=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=E&&O?void 0:p,$=I&&z!==p&&this.options.updateMissing;if(O||j||$){if(this.logger.log($?"updateKey":"missingKey",g,h,f,$?z:p),u){var J=this.resolve(f,Xe(Xe({},i),{},{keySeparator:!1}));J&&J.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var V=[],H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&H&&H[0])for(var ee=0;ee1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,c,f;return typeof o=="string"&&(o=[o]),o.forEach(function(d){if(!i.isValidLookup(s)){var h=i.extractFromKey(d,a),g=h.key;l=g;var y=h.namespaces;i.options.fallbackNS&&(y=y.concat(i.options.fallbackNS));var b=a.count!==void 0&&typeof a.count!="string",m=b&&!a.ordinal&&a.count===0&&i.pluralResolver.shouldUseIntlApi(),p=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",v=a.lngs?a.lngs:i.languageUtils.toResolveHierarchy(a.lng||i.language,a.fallbackLng);y.forEach(function(S){i.isValidLookup(s)||(f=S,!wh["".concat(v[0],"-").concat(S)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(f)&&(wh["".concat(v[0],"-").concat(S)]=!0,i.logger.warn('key "'.concat(l,'" for languages "').concat(v.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(function(k){if(!i.isValidLookup(s)){c=k;var C=[g];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(C,g,k,S,a);else{var N;b&&(N=i.pluralResolver.getSuffix(k,a.count,a));var A="".concat(i.options.pluralSeparator,"zero");if(b&&(C.push(g+N),m&&C.push(g+A)),p){var W="".concat(g).concat(i.options.contextSeparator).concat(a.context);C.push(W),b&&(C.push(W+N),m&&C.push(W+A))}}for(var F;F=C.pop();)i.isValidLookup(s)||(u=F,s=i.getResource(k,S,F,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:f}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,i,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,a,s):this.resourceStore.getResource(o,i,a,s)}}],[{key:"hasDefaultValue",value:function(o){var i="defaultValue";for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)&&i===a.substring(0,i.length)&&o[a]!==void 0)return!0;return!1}}]),n}(rr);function _u(e){return e.charAt(0).toUpperCase()+e.slice(1)}var K_=function(){function e(t){Mt(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=an.create("languageUtils")}return $t(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],o=n.split("-");return this.options.lowerCaseLng?o=o.map(function(i){return i.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=_u(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=_u(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=_u(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var o;return n.forEach(function(i){if(!o){var a=r.formatLanguageCode(i);(!r.options.supportedLngs||r.isSupportedCode(a))&&(o=a)}}),!o&&this.options.supportedLngs&&n.forEach(function(i){if(!o){var a=r.getLanguagePartFromCode(i);if(r.isSupportedCode(a))return o=a;o=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}},{key:"toResolveHierarchy",value:function(n,r){var o=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){!u||(o.isSupportedCode(u)?a.push(u):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),i.forEach(function(l){a.indexOf(l)<0&&s(o.formatLanguageCode(l))}),a}}]),e}(),q_=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Q_={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},G_=["v1","v2","v3"],_h={zero:0,one:1,two:2,few:3,many:4,other:5};function X_(){var e={};return q_.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Q_[t.fc]}})}),e}var Y_=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Mt(this,e),this.languageUtils=t,this.options=n,this.logger=an.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=X_()}return $t(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(a,s){return _h[a]-_h[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):i.numbers.map(function(a){return r.getSuffix(n,a,o)}):[]}},{key:"getSuffix",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(r)):this.getSuffixRetroCompatible(i,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var o=this,i=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[i];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return o.options.prepend&&a.toString()?o.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!G_.includes(this.options.compatibilityJSON)}}]),e}();function bh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};Mt(this,e),this.logger=an.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return $t(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:U_,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Vr(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Vr(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Vr(r.nestingPrefix):r.nestingPrefixEscaped||Vr("$t("),this.nestingSuffix=r.nestingSuffix?Vr(r.nestingSuffix):r.nestingSuffixEscaped||Vr(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(n,r,o,i){var a=this,s,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(b){return b.replace(/\$/g,"$$$$")}var d=function(m){if(m.indexOf(a.formatSeparator)<0){var p=mh(r,c,m);return a.alwaysFormat?a.format(p,void 0,o,Ft(Ft(Ft({},i),r),{},{interpolationkey:m})):p}var v=m.split(a.formatSeparator),S=v.shift().trim(),k=v.join(a.formatSeparator).trim();return a.format(mh(r,c,S),k,o,Ft(Ft(Ft({},i),r),{},{interpolationkey:S}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,g=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(m){return f(m)}},{regex:this.regexp,safeValue:function(m){return a.escapeValue?f(a.escape(m)):f(m)}}];return y.forEach(function(b){for(u=0;s=b.regex.exec(n);){var m=s[1].trim();if(l=d(m),l===void 0)if(typeof h=="function"){var p=h(n,s,i);l=typeof p=="string"?p:""}else if(i&&i.hasOwnProperty(m))l="";else if(g){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(m," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=hh(l));var v=b.safeValue(l);if(n=n.replace(s[0],v),g?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=s[0].length):b.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l=Ft({},i);l.applyPostProcessor=!1,delete l.defaultValue;function u(h,g){var y=this.nestingOptionsSeparator;if(h.indexOf(y)<0)return h;var b=h.split(new RegExp("".concat(y,"[ ]*{"))),m="{".concat(b[1]);h=b[0],m=this.interpolate(m,l);var p=m.match(/'/g),v=m.match(/"/g);(p&&p.length%2===0&&!v||v.length%2!==0)&&(m=m.replace(/'/g,'"'));try{l=JSON.parse(m),g&&(l=Ft(Ft({},g),l))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),S),"".concat(h).concat(y).concat(m)}return delete l.defaultValue,h}for(;a=this.nestingRegexp.exec(n);){var c=[],f=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var d=a[1].split(this.formatSeparator).map(function(h){return h.trim()});a[1]=d.shift(),c=d,f=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=hh(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),f&&(s=c.reduce(function(h,g){return o.format(h,g,i.lng,Ft(Ft({},i),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function Eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Tn(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);if(t==="currency"&&o.indexOf(":")<0)n.currency||(n.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)n.range||(n.range=o.trim());else{var i=o.split(";");i.forEach(function(a){if(!!a){var s=a.split(":"),l=N_(s),u=l[0],c=l.slice(1),f=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=f),f==="false"&&(n[u.trim()]=!1),f==="true"&&(n[u.trim()]=!0),isNaN(f)||(n[u.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}function Wr(e){var t={};return function(r,o,i){var a=o+JSON.stringify(i),s=t[a];return s||(s=e(o,i),t[a]=s),s(r)}}var eb=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mt(this,e),this.logger=an.create("formatter"),this.options=t,this.formats={number:Wr(function(n,r){var o=new Intl.NumberFormat(n,r);return function(i){return o.format(i)}}),currency:Wr(function(n,r){var o=new Intl.NumberFormat(n,Tn(Tn({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:Wr(function(n,r){var o=new Intl.DateTimeFormat(n,Tn({},r));return function(i){return o.format(i)}}),relativetime:Wr(function(n,r){var o=new Intl.RelativeTimeFormat(n,Tn({},r));return function(i){return o.format(i,r.range||"day")}}),list:Wr(function(n,r){var o=new Intl.ListFormat(n,Tn({},r));return function(i){return o.format(i)}})},this.init(t)}return $t(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=r.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Wr(r)}},{key:"format",value:function(n,r,o,i){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,c){var f=Z_(c),d=f.formatName,h=f.formatOptions;if(a.formats[d]){var g=u;try{var y=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},b=y.locale||y.lng||i.locale||i.lng||o;g=a.formats[d](u,b,Tn(Tn(Tn({},h),i),y))}catch(m){a.logger.warn(m)}return g}else a.logger.warn("there was no format function for ".concat(d));return u},n);return l}}]),e}();function xh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Rh(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rb(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var ob=function(e){yl(n,e);var t=tb(n);function n(r,o,i){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Mt(this,n),a=t.call(this),wl&&rr.call(Kn(a)),a.backend=r,a.store=o,a.services=i,a.languageUtils=i.languageUtils,a.options=s,a.logger=an.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(i,s.backend,s),a}return $t(n,[{key:"queueLoad",value:function(o,i,a,s){var l=this,u={},c={},f={},d={};return o.forEach(function(h){var g=!0;i.forEach(function(y){var b="".concat(h,"|").concat(y);!a.reload&&l.store.hasResourceBundle(h,y)?l.state[b]=2:l.state[b]<0||(l.state[b]===1?c[b]===void 0&&(c[b]=!0):(l.state[b]=1,g=!1,c[b]===void 0&&(c[b]=!0),u[b]===void 0&&(u[b]=!0),d[y]===void 0&&(d[y]=!0)))}),g||(f[h]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(d)}}},{key:"loaded",value:function(o,i,a){var s=o.split("|"),l=s[0],u=s[1];i&&this.emit("failedLoading",l,u,i),a&&this.store.addResourceBundle(l,u,a),this.state[o]=i?-1:2;var c={};this.queue.forEach(function(f){M_(f.loaded,[l],u),rb(f,o),i&&f.errors.push(i),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(d){c[d]||(c[d]={});var h=f.loaded[d];h.length&&h.forEach(function(g){c[d][g]===void 0&&(c[d][g]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(o,i,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!o.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:a,tried:l,wait:u,callback:c});return}return this.readingCalls++,this.backend[a](o,i,function(f,d){if(s.readingCalls--,s.waitingReads.length>0){var h=s.waitingReads.shift();s.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(f&&d&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(o,i,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){a.loadOne(c)})}},{key:"load",value:function(o,i,a){this.prepareLoading(o,i,{},a)}},{key:"reload",value:function(o,i,a){this.prepareLoading(o,i,{reload:!0},a)}},{key:"loadOne",value:function(o){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=o.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(c,f){c&&i.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&f&&i.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),f),i.loaded(o,c,f)})}},{key:"saveMissing",value:function(o,i,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}a==null||a===""||(this.backend&&this.backend.create&&this.backend.create(o,i,a,s,null,Rh(Rh({},u),{},{isUpdate:l})),!(!o||!o[0])&&this.store.addResource(o[0],i,a,s))}}]),n}(rr);function ib(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Hn(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Hn(t[2])==="object"||Hn(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(o){n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Ch(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Oh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function en(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ta(){}function lb(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var Cs=function(e){yl(n,e);var t=ab(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Mt(this,n),r=t.call(this),wl&&rr.call(Kn(r)),r.options=Ch(o),r.services={},r.logger=an,r.modules={external:[]},lb(Kn(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),ra(r,Kn(r));setTimeout(function(){r.init(o,i)},0)}return r}return $t(n,[{key:"init",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(a=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));var s=ib();this.options=en(en(en({},s),this.options),Ch(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=en(en({},s.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function l(m){return m?typeof m=="function"?new m:m:null}if(!this.options.isClone){this.modules.logger?an.init(l(this.modules.logger),this.options):an.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=eb);var c=new K_(this.options);this.store=new V_(this.options.resources,this.options);var f=this.services;f.logger=an,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new Y_(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new J_(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new ob(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(m){for(var p=arguments.length,v=new Array(p>1?p-1:0),S=1;S1?p-1:0),S=1;S0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(m){o[m]=function(){var p;return(p=o.store)[m].apply(p,arguments)}});var g=["addResource","addResources","addResourceBundle","removeResourceBundle"];g.forEach(function(m){o[m]=function(){var p;return(p=o.store)[m].apply(p,arguments),o}});var y=Ho(),b=function(){var p=function(S,k){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),y.resolve(k),a(S,k)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return p(null,o.t.bind(o));o.changeLanguage(o.options.lng,p)};return this.options.resources||!this.options.initImmediate?b():setTimeout(b,0),y}},{key:"loadResources",value:function(o){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ta,s=a,l=typeof o=="string"?o:this.language;if(typeof o=="function"&&(s=o),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],c=function(h){if(!!h){var g=i.services.languageUtils.toResolveHierarchy(h);g.forEach(function(y){u.indexOf(y)<0&&u.push(y)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(d){return c(d)})}this.options.preload&&this.options.preload.forEach(function(d){return c(d)}),this.services.backendConnector.load(u,this.options.ns,function(d){!d&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),s(d)})}else s(null)}},{key:"reloadResources",value:function(o,i,a){var s=Ho();return o||(o=this.languages),i||(i=this.options.ns),a||(a=Ta),this.services.backendConnector.reload(o,i,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&Ug.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var i=0;i-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(o,i){var a=this;this.isLanguageChangingTo=o;var s=Ho();this.emit("languageChanging",o);var l=function(d){a.language=d,a.languages=a.services.languageUtils.toResolveHierarchy(d),a.resolvedLanguage=void 0,a.setResolvedLanguage(d)},u=function(d,h){h?(l(h),a.translator.changeLanguage(h),a.isLanguageChangingTo=void 0,a.emit("languageChanged",h),a.logger.log("languageChanged",h)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),i&&i(d,function(){return a.t.apply(a,arguments)})},c=function(d){!o&&!d&&a.services.languageDetector&&(d=[]);var h=typeof d=="string"?d:a.services.languageUtils.getBestMatchFromCodes(d);h&&(a.language||l(h),a.translator.language||a.translator.changeLanguage(h),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage(h)),a.loadResources(h,function(g){u(g,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(o),s}},{key:"getFixedT",value:function(o,i,a){var s=this,l=function u(c,f){var d;if(Hn(f)!=="object"){for(var h=arguments.length,g=new Array(h>2?h-2:0),y=2;y1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var c=function(h,g){var y=i.services.backendConnector.state["".concat(h,"|").concat(g)];return y===-1||y===2};if(a.precheck){var f=a.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(s,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(s,o)&&(!l||c(u,o)))}},{key:"loadNamespaces",value:function(o,i){var a=this,s=Ho();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),i&&i(l)}),s):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var a=Ho();typeof o=="string"&&(o=[o]);var s=this.options.preload||[],l=o.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),i&&i(u)}),a):(i&&i(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return i.indexOf(this.services.languageUtils.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ta,s=en(en(en({},this.options),i),{isClone:!0}),l=new n(s);(i.debug!==void 0||i.prefix!==void 0)&&(l.logger=l.logger.clone(i));var u=["store","services","language"];return u.forEach(function(c){l[c]=o[c]}),l.services=en({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new Sh(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,d=new Array(f>1?f-1:0),h=1;h0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Cs(e,t)});var et=Cs.createInstance();et.createInstance=Cs.createInstance;et.createInstance;et.init;et.loadResources;et.reloadResources;et.use;et.changeLanguage;et.getFixedT;et.t;et.exists;et.setDefaultNamespace;et.hasLoadedNamespace;et.loadNamespaces;et.loadLanguages;var Fg=[],ub=Fg.forEach,cb=Fg.slice;function fb(e){return ub.call(cb.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var kh=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,db=function(t,n,r){var o=r||{};o.path=o.path||"/";var i=encodeURIComponent(n),a="".concat(t,"=").concat(i);if(o.maxAge>0){var s=o.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(o.domain){if(!kh.test(o.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(o.domain)}if(o.path){if(!kh.test(o.path))throw new TypeError("option path is invalid");a+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(a+="; HttpOnly"),o.secure&&(a+="; Secure"),o.sameSite){var l=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},Th={create:function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),o&&(i.domain=o),document.cookie=db(t,encodeURIComponent(n),i)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),i=o.split("&"),a=0;a0){var l=i[a].substring(0,s);l===t.lookupQuerystring&&(n=i[a].substring(s+1))}}}return n}},Ko=null,Ph=function(){if(Ko!==null)return Ko;try{Ko=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ko=!1}return Ko},vb={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Ph()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Ph()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},qo=null,Lh=function(){if(qo!==null)return qo;try{qo=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{qo=!1}return qo},mb={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&Lh()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&Lh()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},gb={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},yb={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},wb={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},Sb={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!r)return r[n]}};function _b(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var jg=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Mt(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return $t(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=fb(r,this.options||{},_b()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(pb),this.addDetector(hb),this.addDetector(vb),this.addDetector(mb),this.addDetector(gb),this.addDetector(yb),this.addDetector(wb),this.addDetector(Sb)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(i){if(r.detectors[i]){var a=r.detectors[i].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(o=o.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(i){o.detectors[i]&&o.detectors[i].cacheUserLanguage(n,o.options)}))}}]),e}();jg.type="languageDetector";function Ec(e){return Ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ec(e)}var Bg=[],bb=Bg.forEach,Eb=Bg.slice;function xc(e){return bb.call(Eb.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function zg(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Ec(XMLHttpRequest))==="object"}function xb(e){return!!e&&typeof e.then=="function"}function Rb(e){return xb(e)?e:Promise.resolve(e)}var is=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ad(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Cb(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}function Ob(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Os={exports:{}},Pa={exports:{}},Nh;function kb(){return Nh||(Nh=1,function(e,t){var n=typeof self<"u"?self:is,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(a){var s={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function l(_){return _&&DataView.prototype.isPrototypeOf(_)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(_){return _&&u.indexOf(Object.prototype.toString.call(_))>-1};function f(_){if(typeof _!="string"&&(_=String(_)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(_))throw new TypeError("Invalid character in header field name");return _.toLowerCase()}function d(_){return typeof _!="string"&&(_=String(_)),_}function h(_){var L={next:function(){var j=_.shift();return{done:j===void 0,value:j}}};return s.iterable&&(L[Symbol.iterator]=function(){return L}),L}function g(_){this.map={},_ instanceof g?_.forEach(function(L,j){this.append(j,L)},this):Array.isArray(_)?_.forEach(function(L){this.append(L[0],L[1])},this):_&&Object.getOwnPropertyNames(_).forEach(function(L){this.append(L,_[L])},this)}g.prototype.append=function(_,L){_=f(_),L=d(L);var j=this.map[_];this.map[_]=j?j+", "+L:L},g.prototype.delete=function(_){delete this.map[f(_)]},g.prototype.get=function(_){return _=f(_),this.has(_)?this.map[_]:null},g.prototype.has=function(_){return this.map.hasOwnProperty(f(_))},g.prototype.set=function(_,L){this.map[f(_)]=d(L)},g.prototype.forEach=function(_,L){for(var j in this.map)this.map.hasOwnProperty(j)&&_.call(L,this.map[j],j,this)},g.prototype.keys=function(){var _=[];return this.forEach(function(L,j){_.push(j)}),h(_)},g.prototype.values=function(){var _=[];return this.forEach(function(L){_.push(L)}),h(_)},g.prototype.entries=function(){var _=[];return this.forEach(function(L,j){_.push([j,L])}),h(_)},s.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function y(_){if(_.bodyUsed)return Promise.reject(new TypeError("Already read"));_.bodyUsed=!0}function b(_){return new Promise(function(L,j){_.onload=function(){L(_.result)},_.onerror=function(){j(_.error)}})}function m(_){var L=new FileReader,j=b(L);return L.readAsArrayBuffer(_),j}function p(_){var L=new FileReader,j=b(L);return L.readAsText(_),j}function v(_){for(var L=new Uint8Array(_),j=new Array(L.length),O=0;O-1?L:_}function A(_,L){L=L||{};var j=L.body;if(_ instanceof A){if(_.bodyUsed)throw new TypeError("Already read");this.url=_.url,this.credentials=_.credentials,L.headers||(this.headers=new g(_.headers)),this.method=_.method,this.mode=_.mode,this.signal=_.signal,!j&&_._bodyInit!=null&&(j=_._bodyInit,_.bodyUsed=!0)}else this.url=String(_);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new g(L.headers)),this.method=N(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&j)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(j)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})};function W(_){var L=new FormData;return _.trim().split("&").forEach(function(j){if(j){var O=j.split("="),P=O.shift().replace(/\+/g," "),I=O.join("=").replace(/\+/g," ");L.append(decodeURIComponent(P),decodeURIComponent(I))}}),L}function F(_){var L=new g,j=_.replace(/\r?\n[\t ]+/g," ");return j.split(/\r?\n/).forEach(function(O){var P=O.split(":"),I=P.shift().trim();if(I){var M=P.join(":").trim();L.append(I,M)}}),L}k.call(A.prototype);function X(_,L){L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in L?L.statusText:"OK",this.headers=new g(L.headers),this.url=L.url||"",this._initBody(_)}k.call(X.prototype),X.prototype.clone=function(){return new X(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},X.error=function(){var _=new X(null,{status:0,statusText:""});return _.type="error",_};var ce=[301,302,303,307,308];X.redirect=function(_,L){if(ce.indexOf(L)===-1)throw new RangeError("Invalid status code");return new X(null,{status:L,headers:{location:_}})},a.DOMException=i.DOMException;try{new a.DOMException}catch{a.DOMException=function(L,j){this.message=L,this.name=j;var O=Error(L);this.stack=O.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function ae(_,L){return new Promise(function(j,O){var P=new A(_,L);if(P.signal&&P.signal.aborted)return O(new a.DOMException("Aborted","AbortError"));var I=new XMLHttpRequest;function M(){I.abort()}I.onload=function(){var z={status:I.status,statusText:I.statusText,headers:F(I.getAllResponseHeaders()||"")};z.url="responseURL"in I?I.responseURL:z.headers.get("X-Request-URL");var E="response"in I?I.response:I.responseText;j(new X(E,z))},I.onerror=function(){O(new TypeError("Network request failed"))},I.ontimeout=function(){O(new TypeError("Network request failed"))},I.onabort=function(){O(new a.DOMException("Aborted","AbortError"))},I.open(P.method,P.url,!0),P.credentials==="include"?I.withCredentials=!0:P.credentials==="omit"&&(I.withCredentials=!1),"responseType"in I&&s.blob&&(I.responseType="blob"),P.headers.forEach(function(z,E){I.setRequestHeader(E,z)}),P.signal&&(P.signal.addEventListener("abort",M),I.onreadystatechange=function(){I.readyState===4&&P.signal.removeEventListener("abort",M)}),I.send(typeof P._bodyInit>"u"?null:P._bodyInit)})}return ae.polyfill=!0,i.fetch||(i.fetch=ae,i.Headers=g,i.Request=A,i.Response=X),a.Headers=g,a.Request=A,a.Response=X,a.fetch=ae,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;t=o.fetch,t.default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t}(Pa,Pa.exports)),Pa.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof is<"u"&&is.fetch?n=is.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof Ob<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||kb();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(Os,Os.exports);const Vg=Os.exports,Ah=Ng({__proto__:null,default:Vg},[Os.exports]);function ks(e){return ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ks(e)}var wn;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?wn=global.fetch:typeof window<"u"&&window.fetch?wn=window.fetch:wn=fetch);var ki;zg()&&(typeof global<"u"&&global.XMLHttpRequest?ki=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ki=window.XMLHttpRequest));var Ts;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Ts=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Ts=window.ActiveXObject));!wn&&Ah&&!ki&&!Ts&&(wn=Vg||Ah);typeof wn!="function"&&(wn=void 0);var Rc=function(t,n){if(n&&ks(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},Ih=function(t,n,r){wn(t,n).then(function(o){if(!o.ok)return r(o.statusText||"Error",{status:o.status});o.text().then(function(i){r(null,{status:o.status,data:i})}).catch(r)}).catch(r)},Dh=!1,Tb=function(t,n,r,o){t.queryStringParams&&(n=Rc(n,t.queryStringParams));var i=xc({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(i["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=xc({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:i},Dh?{}:a);try{Ih(n,s,o)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return o(l);try{Object.keys(a).forEach(function(u){delete s[u]}),Ih(n,s,o),Dh=!0}catch(u){o(u)}}},Pb=function(t,n,r,o){r&&ks(r)==="object"&&(r=Rc("",r).slice(1)),t.queryStringParams&&(n=Rc(n,t.queryStringParams));try{var i;ki?i=new ki:i=new Ts("MSXML2.XMLHTTP.3.0"),i.open(r?"POST":"GET",n,1),t.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!t.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(l){console&&console.log(l)}},Lb=function(t,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},wn&&n.indexOf("file:")!==0)return Tb(t,n,r,o);if(zg()||typeof ActiveXObject=="function")return Pb(t,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function Nb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mh(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Nb(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return Ab(e,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=xc(o,this.options||{},Db()),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,o)),l=Rb(l),l.then(function(u){if(!u)return a(null,{});var c=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(c,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,c;try{typeof l.data=="string"?u=a.options.parse(l.data,o,i):u=l.data}catch{c="failed parsing "+n+" to json"}if(c)return r(c,!1);r(null,u)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(!!this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,o,i),u=0,c=[],f=[];n.forEach(function(d){var h=s.options.addPath;typeof s.options.addPath=="function"&&(h=s.options.addPath(d,r));var g=s.services.interpolator.interpolate(h,{lng:d,ns:r});s.options.request(s.options,g,l,function(y,b){u+=1,c.push(y),f.push(b),u===n.length&&a&&a(c,f)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(f){var d=i.toResolveHierarchy(f);d.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(f){o.read(c,f,"read",null,null,function(d,h){d&&a.warn("loading namespace ".concat(f," for language ").concat(c," failed"),d),!d&&h&&a.log("loaded namespace ".concat(f," for language ").concat(c),h),o.loaded("".concat(c,"|").concat(f),d,h)})})})}}}]),e}();Wg.type="backend";var R={exports:{}},ue={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var oa=Symbol.for("react.element"),Mb=Symbol.for("react.portal"),$b=Symbol.for("react.fragment"),Ub=Symbol.for("react.strict_mode"),Fb=Symbol.for("react.profiler"),jb=Symbol.for("react.provider"),Bb=Symbol.for("react.context"),zb=Symbol.for("react.forward_ref"),Vb=Symbol.for("react.suspense"),Wb=Symbol.for("react.memo"),Hb=Symbol.for("react.lazy"),$h=Symbol.iterator;function Kb(e){return e===null||typeof e!="object"?null:(e=$h&&e[$h]||e["@@iterator"],typeof e=="function"?e:null)}var Hg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Kg=Object.assign,qg={};function Ao(e,t,n){this.props=e,this.context=t,this.refs=qg,this.updater=n||Hg}Ao.prototype.isReactComponent={};Ao.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ao.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qg(){}Qg.prototype=Ao.prototype;function sd(e,t,n){this.props=e,this.context=t,this.refs=qg,this.updater=n||Hg}var ld=sd.prototype=new Qg;ld.constructor=sd;Kg(ld,Ao.prototype);ld.isPureReactComponent=!0;var Uh=Array.isArray,Gg=Object.prototype.hasOwnProperty,ud={current:null},Xg={key:!0,ref:!0,__self:!0,__source:!0};function Yg(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)Gg.call(t,r)&&!Xg.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},Zb=function(t){return Jb[t]},eE=function(t){return t.replace(Yb,Zb)};function jh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Bh(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};Cc=Bh(Bh({},Cc),e)}function rE(){return Cc}var oE=function(){function e(){Mt(this,e),this.usedNamespaces={}}return $t(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(o){r.usedNamespaces[o]||(r.usedNamespaces[o]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function iE(e){Jg=e}function aE(){return Jg}var sE={type:"3rdParty",init:function(t){nE(t.options.react),iE(t)}};function lE(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],o=t.options?t.options.fallbackLng:!1,i=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var c=t.services.backendConnector.state["".concat(l,"|").concat(u)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!o||a(i,e)))}function cE(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Oc("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(i,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!a(i.isLanguageChangingTo,e))return!1}}):uE(e,t,n)}function fE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,a,s;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(l){i=!0,s=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw s}}return r}}function dE(e,t){return Ag(e)||fE(e,t)||Ig(e,t)||Dg()}function Wh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Eu(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=R.exports.useContext(tE)||{},o=r.i18n,i=r.defaultNS,a=n||o||aE();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new oE),!a){Oc("You will need to pass in an i18next instance by using initReactI18next");var s=function(W){return Array.isArray(W)?W[W.length-1]:W},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&Oc("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=Eu(Eu(Eu({},rE()),a.options.react),t),c=u.useSuspense,f=u.keyPrefix,d=e||i||a.options&&a.options.defaultNS;d=typeof d=="string"?[d]:d||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(d);var h=(a.isInitialized||a.initializedStoreOnce)&&d.every(function(A){return cE(A,a,u)});function g(){return a.getFixedT(null,u.nsMode==="fallback"?d:d[0],f)}var y=R.exports.useState(g),b=dE(y,2),m=b[0],p=b[1],v=d.join(),S=pE(v),k=R.exports.useRef(!0);R.exports.useEffect(function(){var A=u.bindI18n,W=u.bindI18nStore;k.current=!0,!h&&!c&&Vh(a,d,function(){k.current&&p(g)}),h&&S&&S!==v&&k.current&&p(g);function F(){k.current&&p(g)}return A&&a&&a.on(A,F),W&&a&&a.store.on(W,F),function(){k.current=!1,A&&a&&A.split(" ").forEach(function(X){return a.off(X,F)}),W&&a&&W.split(" ").forEach(function(X){return a.store.off(X,F)})}},[a,v]);var C=R.exports.useRef(!0);R.exports.useEffect(function(){k.current&&!C.current&&p(g),C.current=!1},[a,f]);var N=[m,a,h];if(N.t=m,N.i18n=a,N.ready=h,h||!h&&!c)return N;throw new Promise(function(A){Vh(a,d,function(){A()})})}const Hh={zh:_n(()=>import("./zh.9b79b7bf.js"),[],import.meta.url),en:_n(()=>import("./en.fb34eaf7.js"),[],import.meta.url)};et.use(Wg).use(sE).use(jg).init({debug:!1,backend:{loadPath:"/__{{lng}}/{{ns}}.json",request:function(e,t,n,r){let o;switch(t){case"/__zh/translation.json":case"/__zh-CN/translation.json":o=Hh.zh;break;case"/__en/translation.json":default:o=Hh.en;break}o&&o.then(i=>{r(null,{status:200,data:i.data})})}},supportedLngs:["en","zh"],fallbackLng:"en",interpolation:{escapeValue:!1}});const hE=""+new URL("inter-latin-400-normal.0364d368.woff2",import.meta.url).href,vE=""+new URL("inter-latin-800-normal.a51ac27d.woff2",import.meta.url).href,mE=""+new URL("roboto-mono-latin-400-normal.7295944e.woff2",import.meta.url).href;var aa={exports:{}},wt={},Zg={exports:{}},ey={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(P,I){var M=P.length;P.push(I);e:for(;0>>1,E=P[z];if(0>>1;zo(J,M))Vo(H,J)?(P[z]=H,P[V]=M,z=V):(P[z]=J,P[$]=M,z=$);else if(Vo(H,M))P[z]=H,P[V]=M,z=V;else break e}}return I}function o(P,I){var M=P.sortIndex-I.sortIndex;return M!==0?M:P.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,d=3,h=!1,g=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(P){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=P)r(u),I.sortIndex=I.expirationTime,t(l,I);else break;I=n(u)}}function S(P){if(y=!1,v(P),!g)if(n(l)!==null)g=!0,j(k);else{var I=n(u);I!==null&&O(S,I.startTime-P)}}function k(P,I){g=!1,y&&(y=!1,m(A),A=-1),h=!0;var M=d;try{for(v(I),f=n(l);f!==null&&(!(f.expirationTime>I)||P&&!X());){var z=f.callback;if(typeof z=="function"){f.callback=null,d=f.priorityLevel;var E=z(f.expirationTime<=I);I=e.unstable_now(),typeof E=="function"?f.callback=E:f===n(l)&&r(l),v(I)}else r(l);f=n(l)}if(f!==null)var D=!0;else{var $=n(u);$!==null&&O(S,$.startTime-I),D=!1}return D}finally{f=null,d=M,h=!1}}var C=!1,N=null,A=-1,W=5,F=-1;function X(){return!(e.unstable_now()-FP||125z?(P.sortIndex=M,t(u,P),n(l)===null&&P===n(u)&&(y?(m(A),A=-1):y=!0,O(S,M-z))):(P.sortIndex=E,t(l,P),g||h||(g=!0,j(k))),P},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(P){var I=d;return function(){var M=d;d=I;try{return P.apply(this,arguments)}finally{d=M}}}})(ey);(function(e){e.exports=ey})(Zg);/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ty=R.exports,mt=Zg.exports;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kc=Object.prototype.hasOwnProperty,gE=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Kh={},qh={};function yE(e){return kc.call(qh,e)?!0:kc.call(Kh,e)?!1:gE.test(e)?qh[e]=!0:(Kh[e]=!0,!1)}function wE(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function SE(e,t,n,r){if(t===null||typeof t>"u"||wE(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function nt(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var We={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){We[e]=new nt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];We[t]=new nt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){We[e]=new nt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){We[e]=new nt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){We[e]=new nt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){We[e]=new nt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){We[e]=new nt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){We[e]=new nt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){We[e]=new nt(e,5,!1,e.toLowerCase(),null,!1,!1)});var fd=/[\-:]([a-z])/g;function dd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fd,dd);We[t]=new nt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fd,dd);We[t]=new nt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fd,dd);We[t]=new nt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){We[e]=new nt(e,1,!1,e.toLowerCase(),null,!1,!1)});We.xlinkHref=new nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){We[e]=new nt(e,1,!1,e.toLowerCase(),null,!0,!0)});function pd(e,t,n,r){var o=We.hasOwnProperty(t)?We[t]:null;(o!==null?o.type!==0:r||!(2s||o[a]!==i[s]){var l=` -`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Ru=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?si(e):""}function _E(e){switch(e.tag){case 5:return si(e.type);case 16:return si("Lazy");case 13:return si("Suspense");case 19:return si("SuspenseList");case 0:case 2:case 15:return e=Cu(e.type,!1),e;case 11:return e=Cu(e.type.render,!1),e;case 1:return e=Cu(e.type,!0),e;default:return""}}function Nc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Gr:return"Fragment";case Qr:return"Portal";case Tc:return"Profiler";case hd:return"StrictMode";case Pc:return"Suspense";case Lc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oy:return(e.displayName||"Context")+".Consumer";case ry:return(e._context.displayName||"Context")+".Provider";case vd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case md:return t=e.displayName||null,t!==null?t:Nc(e.type)||"Memo";case An:t=e._payload,e=e._init;try{return Nc(e(t))}catch{}}return null}function bE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Nc(t);case 8:return t===hd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function or(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ay(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function EE(e){var t=ay(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Aa(e){e._valueTracker||(e._valueTracker=EE(e))}function sy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ay(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ps(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ac(e,t){var n=t.checked;return Pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function Gh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=or(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ly(e,t){t=t.checked,t!=null&&pd(e,"checked",t,!1)}function Ic(e,t){ly(e,t);var n=or(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Dc(e,t.type,or(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Dc(e,t,n){(t!=="number"||Ps(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var li=Array.isArray;function lo(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ia.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xE=["Webkit","ms","Moz","O"];Object.keys(hi).forEach(function(e){xE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),hi[t]=hi[e]})});function dy(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||hi.hasOwnProperty(e)&&hi[e]?(""+t).trim():t+"px"}function py(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=dy(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var RE=Pe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Uc(e,t){if(t){if(RE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function Fc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var jc=null;function gd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bc=null,uo=null,co=null;function Zh(e){if(e=ua(e)){if(typeof Bc!="function")throw Error(B(280));var t=e.stateNode;t&&(t=xl(t),Bc(e.stateNode,e.type,t))}}function hy(e){uo?co?co.push(e):co=[e]:uo=e}function vy(){if(uo){var e=uo,t=co;if(co=uo=null,Zh(e),t)for(e=0;e>>=0,e===0?32:31-(ME(e)/$E|0)|0}var Da=64,Ma=4194304;function ui(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Is(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=ui(s):(i&=a,i!==0&&(r=ui(i)))}else a=n&~o,a!==0?r=ui(a):i!==0&&(r=ui(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function sa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Qt(t),e[t]=n}function BE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=mi),lv=String.fromCharCode(32),uv=!1;function Dy(e,t){switch(e){case"keyup":return vx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function My(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xr=!1;function gx(e,t){switch(e){case"compositionend":return My(t);case"keypress":return t.which!==32?null:(uv=!0,lv);case"textInput":return e=t.data,e===lv&&uv?null:e;default:return null}}function yx(e,t){if(Xr)return e==="compositionend"||!Rd&&Dy(e,t)?(e=Ay(),us=bd=jn=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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=pv(n)}}function jy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function By(){for(var e=window,t=Ps();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ps(e.document)}return t}function Cd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Ox(e){var t=By(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&jy(n.ownerDocument.documentElement,n)){if(r!==null&&Cd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=hv(n,i);var a=hv(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Yr=null,qc=null,yi=null,Qc=!1;function vv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qc||Yr==null||Yr!==Ps(r)||(r=Yr,"selectionStart"in r&&Cd(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}),yi&&Mi(yi,r)||(yi=r,r=$s(qc,"onSelect"),0eo||(e.current=ef[eo],ef[eo]=null,eo--)}function _e(e,t){eo++,ef[eo]=e.current,e.current=t}var ir={},Ge=ur(ir),st=ur(!1),Cr=ir;function yo(e,t){var n=e.type.contextTypes;if(!n)return ir;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function lt(e){return e=e.childContextTypes,e!=null}function Fs(){Ee(st),Ee(Ge)}function bv(e,t,n){if(Ge.current!==ir)throw Error(B(168));_e(Ge,t),_e(st,n)}function Xy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(B(108,bE(e)||"Unknown",o));return Pe({},n,r)}function js(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ir,Cr=Ge.current,_e(Ge,e),_e(st,st.current),!0}function Ev(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Xy(e,t,Cr),r.__reactInternalMemoizedMergedChildContext=e,Ee(st),Ee(Ge),_e(Ge,e)):Ee(st),_e(st,n)}var mn=null,Rl=!1,ju=!1;function Yy(e){mn===null?mn=[e]:mn.push(e)}function Fx(e){Rl=!0,Yy(e)}function cr(){if(!ju&&mn!==null){ju=!0;var e=0,t=he;try{var n=mn;for(he=1;e>=a,o-=a,gn=1<<32-Qt(t)+o|n<A?(W=N,N=null):W=N.sibling;var F=d(m,N,v[A],S);if(F===null){N===null&&(N=W);break}e&&N&&F.alternate===null&&t(m,N),p=i(F,p,A),C===null?k=F:C.sibling=F,C=F,N=W}if(A===v.length)return n(m,N),Re&&hr(m,A),k;if(N===null){for(;AA?(W=N,N=null):W=N.sibling;var X=d(m,N,F.value,S);if(X===null){N===null&&(N=W);break}e&&N&&X.alternate===null&&t(m,N),p=i(X,p,A),C===null?k=X:C.sibling=X,C=X,N=W}if(F.done)return n(m,N),Re&&hr(m,A),k;if(N===null){for(;!F.done;A++,F=v.next())F=f(m,F.value,S),F!==null&&(p=i(F,p,A),C===null?k=F:C.sibling=F,C=F);return Re&&hr(m,A),k}for(N=r(m,N);!F.done;A++,F=v.next())F=h(N,m,A,F.value,S),F!==null&&(e&&F.alternate!==null&&N.delete(F.key===null?A:F.key),p=i(F,p,A),C===null?k=F:C.sibling=F,C=F);return e&&N.forEach(function(ce){return t(m,ce)}),Re&&hr(m,A),k}function b(m,p,v,S){if(typeof v=="object"&&v!==null&&v.type===Gr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Na:e:{for(var k=v.key,C=p;C!==null;){if(C.key===k){if(k=v.type,k===Gr){if(C.tag===7){n(m,C.sibling),p=o(C,v.props.children),p.return=m,m=p;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===An&&Pv(k)===C.type){n(m,C.sibling),p=o(C,v.props),p.ref=Zo(m,C,v),p.return=m,m=p;break e}n(m,C);break}else t(m,C);C=C.sibling}v.type===Gr?(p=xr(v.props.children,m.mode,S,v.key),p.return=m,m=p):(S=gs(v.type,v.key,v.props,null,m.mode,S),S.ref=Zo(m,p,v),S.return=m,m=S)}return a(m);case Qr:e:{for(C=v.key;p!==null;){if(p.key===C)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(m,p.sibling),p=o(p,v.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=Qu(v,m.mode,S),p.return=m,m=p}return a(m);case An:return C=v._init,b(m,p,C(v._payload),S)}if(li(v))return g(m,p,v,S);if(Qo(v))return y(m,p,v,S);Va(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,p!==null&&p.tag===6?(n(m,p.sibling),p=o(p,v),p.return=m,m=p):(n(m,p),p=qu(v,m.mode,S),p.return=m,m=p),a(m)):n(m,p)}return b}var So=i0(!0),a0=i0(!1),ca={},ln=ur(ca),ji=ur(ca),Bi=ur(ca);function _r(e){if(e===ca)throw Error(B(174));return e}function Dd(e,t){switch(_e(Bi,t),_e(ji,e),_e(ln,ca),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:$c(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=$c(t,e)}Ee(ln),_e(ln,t)}function _o(){Ee(ln),Ee(ji),Ee(Bi)}function s0(e){_r(Bi.current);var t=_r(ln.current),n=$c(t,e.type);t!==n&&(_e(ji,e),_e(ln,n))}function Md(e){ji.current===e&&(Ee(ln),Ee(ji))}var ke=ur(0);function Ks(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Bu=[];function $d(){for(var e=0;en?n:4,e(!0);var r=zu.transition;zu.transition={};try{e(!1),t()}finally{he=n,zu.transition=r}}function E0(){return Dt().memoizedState}function Vx(e,t,n){var r=Zn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},x0(e))R0(t,n);else if(n=t0(e,t,n,r),n!==null){var o=Je();Gt(n,e,r,o),C0(n,t,r)}}function Wx(e,t,n){var r=Zn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(x0(e))R0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Yt(s,a)){var l=t.interleaved;l===null?(o.next=o,Ad(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=t0(e,t,o,r),n!==null&&(o=Je(),Gt(n,e,r,o),C0(n,t,r))}}function x0(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function R0(e,t){wi=qs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function C0(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wd(e,n)}}var Qs={readContext:It,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},Hx={readContext:It,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:It,useEffect:Nv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ps(4194308,4,y0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return ps(4,2,e,t)},useMemo:function(e,t){var n=nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Vx.bind(null,Te,e),[r.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:Lv,useDebugValue:zd,useDeferredValue:function(e){return nn().memoizedState=e},useTransition:function(){var e=Lv(!1),t=e[0];return e=zx.bind(null,e[1]),nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Te,o=nn();if(Re){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),je===null)throw Error(B(349));(kr&30)!==0||c0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Nv(d0.bind(null,r,i,e),[e]),r.flags|=2048,Wi(9,f0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=nn(),t=je.identifierPrefix;if(Re){var n=yn,r=gn;n=(r&~(1<<32-Qt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=zi++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[on]=t,e[Fi]=r,D0(e,t,!1,!1),t.stateNode=e;e:{switch(a=Fc(n,r),n){case"dialog":be("cancel",e),be("close",e),o=r;break;case"iframe":case"object":case"embed":be("load",e),o=r;break;case"video":case"audio":for(o=0;oEo&&(t.flags|=128,r=!0,ei(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ks(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ei(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Re)return Ke(t),null}else 2*Ae()-i.renderingStartTime>Eo&&n!==1073741824&&(t.flags|=128,r=!0,ei(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ae(),t.sibling=null,n=ke.current,_e(ke,r?n&1|2:n&1),t):(Ke(t),null);case 22:case 23:return Qd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(pt&1073741824)!==0&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function Zx(e,t){switch(kd(t),t.tag){case 1:return lt(t.type)&&Fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _o(),Ee(st),Ee(Ge),$d(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Md(t),null;case 13:if(Ee(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));wo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(ke),null;case 4:return _o(),null;case 10:return Nd(t.type._context),null;case 22:case 23:return Qd(),null;case 24:return null;default:return null}}var Ha=!1,Qe=!1,eR=typeof WeakSet=="function"?WeakSet:Set,Q=null;function oo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Le(e,t,r)}else n.current=null}function pf(e,t,n){try{n()}catch(r){Le(e,t,r)}}var Bv=!1;function tR(e,t){if(Gc=Ds,e=By(),Cd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(s=a+o),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++u===o&&(s=a),d===i&&++c===r&&(l=a),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xc={focusedElem:e,selectionRange:n},Ds=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var g=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,b=g.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:zt(t.type,y),b);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(S){Le(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return g=Bv,Bv=!1,g}function Si(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&pf(t,n,i)}o=o.next}while(o!==r)}}function kl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function hf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function U0(e){var t=e.alternate;t!==null&&(e.alternate=null,U0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[on],delete t[Fi],delete t[Zc],delete t[$x],delete t[Ux])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function F0(e){return e.tag===5||e.tag===3||e.tag===4}function zv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||F0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Us));else if(r!==4&&(e=e.child,e!==null))for(vf(e,t,n),e=e.sibling;e!==null;)vf(e,t,n),e=e.sibling}function mf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(mf(e,t,n),e=e.sibling;e!==null;)mf(e,t,n),e=e.sibling}var ze=null,Ht=!1;function Pn(e,t,n){for(n=n.child;n!==null;)j0(e,t,n),n=n.sibling}function j0(e,t,n){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:Qe||oo(n,t);case 6:var r=ze,o=Ht;ze=null,Pn(e,t,n),ze=r,Ht=o,ze!==null&&(Ht?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(Ht?(e=ze,n=n.stateNode,e.nodeType===8?Fu(e.parentNode,n):e.nodeType===1&&Fu(e,n),Ii(e)):Fu(ze,n.stateNode));break;case 4:r=ze,o=Ht,ze=n.stateNode.containerInfo,Ht=!0,Pn(e,t,n),ze=r,Ht=o;break;case 0:case 11:case 14:case 15:if(!Qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&pf(n,t,a),o=o.next}while(o!==r)}Pn(e,t,n);break;case 1:if(!Qe&&(oo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Le(n,t,s)}Pn(e,t,n);break;case 21:Pn(e,t,n);break;case 22:n.mode&1?(Qe=(r=Qe)||n.memoizedState!==null,Pn(e,t,n),Qe=r):Pn(e,t,n);break;default:Pn(e,t,n)}}function Vv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new eR),t.forEach(function(r){var o=cR.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function jt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=Ae()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rR(r/1960))-r,10e?16:e,Bn===null)var r=!1;else{if(e=Bn,Bn=null,Ys=0,(fe&6)!==0)throw Error(B(331));var o=fe;for(fe|=4,Q=e.current;Q!==null;){var i=Q,a=i.child;if((Q.flags&16)!==0){var s=i.deletions;if(s!==null){for(var l=0;lAe()-Kd?Er(e,0):Hd|=n),ut(e,t)}function Q0(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ma,Ma<<=1,(Ma&130023424)===0&&(Ma=4194304)));var n=Je();e=xn(e,t),e!==null&&(sa(e,t,n),ut(e,n))}function uR(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Q0(e,n)}function cR(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),Q0(e,n)}var G0;G0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)at=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return at=!1,Yx(e,t,n);at=(e.flags&131072)!==0}else at=!1,Re&&(t.flags&1048576)!==0&&Jy(t,zs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;hs(e,t),e=t.pendingProps;var o=yo(t,Ge.current);po(t,n),o=Fd(null,t,r,e,o,n);var i=jd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(i=!0,js(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Id(t),o.updater=Cl,t.stateNode=o,o._reactInternals=t,af(t,r,e,n),t=uf(null,t,r,!0,i,n)):(t.tag=0,Re&&i&&Od(t),Ye(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(hs(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=dR(r),e=zt(r,e),o){case 0:t=lf(null,t,r,e,n);break e;case 1:t=Uv(null,t,r,e,n);break e;case 11:t=Mv(null,t,r,e,n);break e;case 14:t=$v(null,t,r,zt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zt(r,o),lf(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zt(r,o),Uv(e,t,r,o,n);case 3:e:{if(N0(t),e===null)throw Error(B(387));r=t.pendingProps,i=t.memoizedState,o=i.element,n0(e,t),Hs(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=bo(Error(B(423)),t),t=Fv(e,t,r,n,o);break e}else if(r!==o){o=bo(Error(B(424)),t),t=Fv(e,t,r,n,o);break e}else for(ht=Xn(t.stateNode.containerInfo.firstChild),vt=t,Re=!0,Kt=null,n=a0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wo(),r===o){t=Rn(e,t,n);break e}Ye(e,t,r,n)}t=t.child}return t;case 5:return s0(t),e===null&&nf(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Yc(r,o)?a=null:i!==null&&Yc(r,i)&&(t.flags|=32),L0(e,t),Ye(e,t,a,n),t.child;case 6:return e===null&&nf(t),null;case 13:return A0(e,t,n);case 4:return Dd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=So(t,null,r,n):Ye(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zt(r,o),Mv(e,t,r,o,n);case 7:return Ye(e,t,t.pendingProps,n),t.child;case 8:return Ye(e,t,t.pendingProps.children,n),t.child;case 12:return Ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,_e(Vs,r._currentValue),r._currentValue=a,i!==null)if(Yt(i.value,a)){if(i.children===o.children&&!st.current){t=Rn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Sn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),rf(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(B(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),rf(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Ye(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,po(t,n),o=It(o),r=r(o),t.flags|=1,Ye(e,t,r,n),t.child;case 14:return r=t.type,o=zt(r,t.pendingProps),o=zt(r.type,o),$v(e,t,r,o,n);case 15:return T0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zt(r,o),hs(e,t),t.tag=1,lt(r)?(e=!0,js(t)):e=!1,po(t,n),o0(t,r,o),af(t,r,o,n),uf(null,t,r,!0,e,n);case 19:return I0(e,t,n);case 22:return P0(e,t,n)}throw Error(B(156,t.tag))};function X0(e,t){return by(e,t)}function fR(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,n,r){return new fR(e,t,n,r)}function Xd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dR(e){if(typeof e=="function")return Xd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vd)return 11;if(e===md)return 14}return 2}function er(e,t){var n=e.alternate;return n===null?(n=Tt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function gs(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")Xd(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Gr:return xr(n.children,o,i,t);case hd:a=8,o|=8;break;case Tc:return e=Tt(12,n,t,o|2),e.elementType=Tc,e.lanes=i,e;case Pc:return e=Tt(13,n,t,o),e.elementType=Pc,e.lanes=i,e;case Lc:return e=Tt(19,n,t,o),e.elementType=Lc,e.lanes=i,e;case iy:return Pl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ry:a=10;break e;case oy:a=9;break e;case vd:a=11;break e;case md:a=14;break e;case An:a=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=Tt(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function xr(e,t,n,r){return e=Tt(7,e,r,t),e.lanes=n,e}function Pl(e,t,n,r){return e=Tt(22,e,r,t),e.elementType=iy,e.lanes=n,e.stateNode={isHidden:!1},e}function qu(e,t,n){return e=Tt(6,e,null,t),e.lanes=n,e}function Qu(e,t,n){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function pR(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ku(0),this.expirationTimes=ku(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ku(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Yd(e,t,n,r,o,i,a,s,l){return e=new pR(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Tt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Id(i),e}function hR(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=wt})(aa);const wR=ad(aa.exports);var e1,Yv=aa.exports;e1=Yv.createRoot,Yv.hydrateRoot;var _f={exports:{}},Lr={},ge={exports:{}},SR="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",_R=SR,bR=_R;function t1(){}function n1(){}n1.resetWarningCache=t1;var ER=function(){function e(r,o,i,a,s,l){if(l!==bR){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:n1,resetWarningCache:t1};return n.PropTypes=n,n};ge.exports=ER();var bf={exports:{}},Jt={},el={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;/*! - * Adapted from jQuery UI core - * - * http://jqueryui.com - * - * Copyright 2014 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/category/ui-core/ - */var n="none",r="contents",o=/input|select|textarea|button|object|iframe/;function i(f,d){return d.getPropertyValue("overflow")!=="visible"||f.scrollWidth<=0&&f.scrollHeight<=0}function a(f){var d=f.offsetWidth<=0&&f.offsetHeight<=0;if(d&&!f.innerHTML)return!0;try{var h=window.getComputedStyle(f),g=h.getPropertyValue("display");return d?g!==r&&i(f,h):g===n}catch{return console.warn("Failed to inspect element style"),!1}}function s(f){for(var d=f,h=f.getRootNode&&f.getRootNode();d&&d!==document.body;){if(h&&d===h&&(d=h.host.parentNode),a(d))return!1;d=d.parentNode}return!0}function l(f,d){var h=f.nodeName.toLowerCase(),g=o.test(h)&&!f.disabled||h==="a"&&f.href||d;return g&&s(f)}function u(f){var d=f.getAttribute("tabindex");d===null&&(d=void 0);var h=isNaN(d);return(h||d>=0)&&l(f,!h)}function c(f){var d=[].slice.call(f.querySelectorAll("*"),0).reduce(function(h,g){return h.concat(g.shadowRoot?c(g.shadowRoot):[g])},[]);return d.filter(u)}e.exports=t.default})(el,el.exports);Object.defineProperty(Jt,"__esModule",{value:!0});Jt.resetState=OR;Jt.log=kR;Jt.handleBlur=Ki;Jt.handleFocus=qi;Jt.markForFocusLater=TR;Jt.returnFocus=PR;Jt.popWithoutFocus=LR;Jt.setupScopedFocus=NR;Jt.teardownScopedFocus=AR;var xR=el.exports,RR=CR(xR);function CR(e){return e&&e.__esModule?e:{default:e}}var xo=[],ao=null,Ef=!1;function OR(){xo=[]}function kR(){}function Ki(){Ef=!0}function qi(){if(Ef){if(Ef=!1,!ao)return;setTimeout(function(){if(!ao.contains(document.activeElement)){var e=(0,RR.default)(ao)[0]||ao;e.focus()}},0)}}function TR(){xo.push(document.activeElement)}function PR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=null;try{xo.length!==0&&(t=xo.pop(),t.focus({preventScroll:e}));return}catch{console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}}function LR(){xo.length>0&&xo.pop()}function NR(e){ao=e,window.addEventListener?(window.addEventListener("blur",Ki,!1),document.addEventListener("focus",qi,!0)):(window.attachEvent("onBlur",Ki),document.attachEvent("onFocus",qi))}function AR(){ao=null,window.addEventListener?(window.removeEventListener("blur",Ki),document.removeEventListener("focus",qi)):(window.detachEvent("onBlur",Ki),document.detachEvent("onFocus",qi))}var xf={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=el.exports,r=o(n);function o(s){return s&&s.__esModule?s:{default:s}}function i(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return s.activeElement.shadowRoot?i(s.activeElement.shadowRoot):s.activeElement}function a(s,l){var u=(0,r.default)(s);if(!u.length){l.preventDefault();return}var c=void 0,f=l.shiftKey,d=u[0],h=u[u.length-1],g=i();if(s===g){if(!f)return;c=h}if(h===g&&!f&&(c=d),d===g&&f&&(c=h),c){l.preventDefault(),c.focus();return}var y=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),b=y!=null&&y[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(!!b){var m=u.indexOf(g);if(m>-1&&(m+=f?-1:1),c=u[m],typeof c>"u"){l.preventDefault(),c=f?h:d,c.focus();return}l.preventDefault(),c.focus()}}e.exports=t.default})(xf,xf.exports);var Zt={},IR=function(){},DR=IR,Xt={},r1={exports:{}};/*! - Copyright (c) 2015 Jed Watson. - Based on code that is Copyright 2013-2015, Facebook, Inc. - All rights reserved. -*/(function(e){(function(){var t=!!(typeof window<"u"&&window.document&&window.document.createElement),n={canUseDOM:t,canUseWorkers:typeof Worker<"u",canUseEventListeners:t&&!!(window.addEventListener||window.attachEvent),canUseViewport:t&&!!window.screen};e.exports?e.exports=n:window.ExecutionEnvironment=n})()})(r1);Object.defineProperty(Xt,"__esModule",{value:!0});Xt.canUseDOM=Xt.SafeNodeList=Xt.SafeHTMLCollection=void 0;var MR=r1.exports,$R=UR(MR);function UR(e){return e&&e.__esModule?e:{default:e}}var Dl=$R.default,FR=Dl.canUseDOM?window.HTMLElement:{};Xt.SafeHTMLCollection=Dl.canUseDOM?window.HTMLCollection:{};Xt.SafeNodeList=Dl.canUseDOM?window.NodeList:{};Xt.canUseDOM=Dl.canUseDOM;Xt.default=FR;Object.defineProperty(Zt,"__esModule",{value:!0});Zt.resetState=WR;Zt.log=HR;Zt.assertNodeList=o1;Zt.setElement=KR;Zt.validateElement=tp;Zt.hide=qR;Zt.show=QR;Zt.documentNotReadyOrSSRTesting=GR;var jR=DR,BR=VR(jR),zR=Xt;function VR(e){return e&&e.__esModule?e:{default:e}}var Ct=null;function WR(){Ct&&(Ct.removeAttribute?Ct.removeAttribute("aria-hidden"):Ct.length!=null?Ct.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(Ct).forEach(function(e){return e.removeAttribute("aria-hidden")})),Ct=null}function HR(){}function o1(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function KR(e){var t=e;if(typeof t=="string"&&zR.canUseDOM){var n=document.querySelectorAll(t);o1(n,t),t=n}return Ct=t||Ct,Ct}function tp(e){var t=e||Ct;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,BR.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}function qR(e){var t=!0,n=!1,r=void 0;try{for(var o=tp(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.setAttribute("aria-hidden","true")}}catch(s){n=!0,r=s}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}function QR(e){var t=!0,n=!1,r=void 0;try{for(var o=tp(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.removeAttribute("aria-hidden")}}catch(s){n=!0,r=s}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}function GR(){Ct=null}var Mo={};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.resetState=XR;Mo.log=YR;var Ei={},xi={};function Jv(e,t){e.classList.remove(t)}function XR(){var e=document.getElementsByTagName("html")[0];for(var t in Ei)Jv(e,Ei[t]);var n=document.body;for(var r in xi)Jv(n,xi[r]);Ei={},xi={}}function YR(){}var JR=function(t,n){return t[n]||(t[n]=0),t[n]+=1,n},ZR=function(t,n){return t[n]&&(t[n]-=1),n},eC=function(t,n,r){r.forEach(function(o){JR(n,o),t.add(o)})},tC=function(t,n,r){r.forEach(function(o){ZR(n,o),n[o]===0&&t.remove(o)})};Mo.add=function(t,n){return eC(t.classList,t.nodeName.toLowerCase()=="html"?Ei:xi,n.split(" "))};Mo.remove=function(t,n){return tC(t.classList,t.nodeName.toLowerCase()=="html"?Ei:xi,n.split(" "))};var $o={};Object.defineProperty($o,"__esModule",{value:!0});$o.log=rC;$o.resetState=oC;function nC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i1=function e(){var t=this;nC(this,e),this.register=function(n){t.openInstances.indexOf(n)===-1&&(t.openInstances.push(n),t.emit("register"))},this.deregister=function(n){var r=t.openInstances.indexOf(n);r!==-1&&(t.openInstances.splice(r,1),t.emit("deregister"))},this.subscribe=function(n){t.subscribers.push(n)},this.emit=function(n){t.subscribers.forEach(function(r){return r(n,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},tl=new i1;function rC(){console.log("portalOpenInstances ----------"),console.log(tl.openInstances.length),tl.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")}function oC(){tl=new i1}$o.default=tl;var np={};Object.defineProperty(np,"__esModule",{value:!0});np.resetState=lC;np.log=uC;var iC=$o,aC=sC(iC);function sC(e){return e&&e.__esModule?e:{default:e}}var qe=void 0,Vt=void 0,Rr=[];function lC(){for(var e=[qe,Vt],t=0;t0?(document.body.firstChild!==qe&&document.body.insertBefore(qe,document.body.firstChild),document.body.lastChild!==Vt&&document.body.appendChild(Vt)):(qe.parentElement&&qe.parentElement.removeChild(qe),Vt.parentElement&&Vt.parentElement.removeChild(Vt))}aC.default.subscribe(cC);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(_){for(var L=1;L0&&(ce-=1,ce===0&&h.show(I)),O.props.shouldFocusAfterRender&&(O.props.shouldReturnFocusAfterClose?(u.returnFocus(O.props.preventScroll),u.teardownScopedFocus()):u.popWithoutFocus()),O.props.onAfterClose&&O.props.onAfterClose(),v.default.deregister(O)},O.open=function(){O.beforeOpen(),O.state.afterOpen&&O.state.beforeClose?(clearTimeout(O.closeTimer),O.setState({beforeClose:!1})):(O.props.shouldFocusAfterRender&&(u.setupScopedFocus(O.node),u.markForFocusLater()),O.setState({isOpen:!0},function(){O.openAnimationFrame=requestAnimationFrame(function(){O.setState({afterOpen:!0}),O.props.isOpen&&O.props.onAfterOpen&&O.props.onAfterOpen({overlayEl:O.overlay,contentEl:O.content})})}))},O.close=function(){O.props.closeTimeoutMS>0?O.closeWithTimeout():O.closeWithoutTimeout()},O.focusContent=function(){return O.content&&!O.contentHasFocus()&&O.content.focus({preventScroll:!0})},O.closeWithTimeout=function(){var P=Date.now()+O.props.closeTimeoutMS;O.setState({beforeClose:!0,closesAt:P},function(){O.closeTimer=setTimeout(O.closeWithoutTimeout,O.state.closesAt-Date.now())})},O.closeWithoutTimeout=function(){O.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},O.afterClose)},O.handleKeyDown=function(P){F(P)&&(0,f.default)(O.content,P),O.props.shouldCloseOnEsc&&X(P)&&(P.stopPropagation(),O.requestClose(P))},O.handleOverlayOnClick=function(P){O.shouldClose===null&&(O.shouldClose=!0),O.shouldClose&&O.props.shouldCloseOnOverlayClick&&(O.ownerHandlesClose()?O.requestClose(P):O.focusContent()),O.shouldClose=null},O.handleContentOnMouseUp=function(){O.shouldClose=!1},O.handleOverlayOnMouseDown=function(P){!O.props.shouldCloseOnOverlayClick&&P.target==O.overlay&&P.preventDefault()},O.handleContentOnClick=function(){O.shouldClose=!1},O.handleContentOnMouseDown=function(){O.shouldClose=!1},O.requestClose=function(P){return O.ownerHandlesClose()&&O.props.onRequestClose(P)},O.ownerHandlesClose=function(){return O.props.onRequestClose},O.shouldBeClosed=function(){return!O.state.isOpen&&!O.state.beforeClose},O.contentHasFocus=function(){return document.activeElement===O.content||O.content.contains(document.activeElement)},O.buildClassName=function(P,I){var M=(typeof I>"u"?"undefined":r(I))==="object"?I:{base:W[P],afterOpen:W[P]+"--after-open",beforeClose:W[P]+"--before-close"},z=M.base;return O.state.afterOpen&&(z=z+" "+M.afterOpen),O.state.beforeClose&&(z=z+" "+M.beforeClose),typeof I=="string"&&I?z+" "+I:z},O.attributesFromObject=function(P,I){return Object.keys(I).reduce(function(M,z){return M[P+"-"+z]=I[z],M},{})},O.state={afterOpen:!1,beforeClose:!1},O.shouldClose=null,O.moveFromContentToOverlay=null,O}return o(L,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(O,P){this.props.isOpen&&!O.isOpen?this.open():!this.props.isOpen&&O.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!P.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var O=this.props,P=O.appElement,I=O.ariaHideApp,M=O.htmlOpenClassName,z=O.bodyOpenClassName,E=O.parentSelector,D=E&&E().ownerDocument||document;z&&y.add(D.body,z),M&&y.add(D.getElementsByTagName("html")[0],M),I&&(ce+=1,h.hide(P)),v.default.register(this)}},{key:"render",value:function(){var O=this.props,P=O.id,I=O.className,M=O.overlayClassName,z=O.defaultStyles,E=O.children,D=I?{}:z.content,$=M?{}:z.overlay;if(this.shouldBeClosed())return null;var J={ref:this.setOverlayRef,className:this.buildClassName("overlay",M),style:n({},$,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},V=n({id:P,ref:this.setContentRef,style:n({},D,this.props.style.content),className:this.buildClassName("content",I),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",n({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),H=this.props.contentElement(V,E);return this.props.overlayElement(J,H)}}]),L}(i.Component);ae.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},ae.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),parentSelector:s.default.func,bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(m.default),s.default.instanceOf(b.SafeHTMLCollection),s.default.instanceOf(b.SafeNodeList),s.default.arrayOf(s.default.instanceOf(m.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=ae,e.exports=t.default})(bf,bf.exports);function a1(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function s1(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r!=null?r:null}this.setState(t.bind(this))}function l1(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}a1.__suppressDeprecationWarning=!0;s1.__suppressDeprecationWarning=!0;l1.__suppressDeprecationWarning=!0;function fC(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,o=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),n!==null||r!==null||o!==null){var i=e.displayName||e.name,a=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. - -`+i+" uses "+a+" but also contains the following legacy lifecycles:"+(n!==null?` - `+n:"")+(r!==null?` - `+r:"")+(o!==null?` - `+o:"")+` - -The above lifecycles should be removed. Learn more about this warning here: -https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=a1,t.componentWillReceiveProps=s1),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=l1;var s=t.componentDidUpdate;t.componentDidUpdate=function(u,c,f){var d=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:f;s.call(this,u,c,d)}}return e}const dC=Object.freeze(Object.defineProperty({__proto__:null,polyfill:fC},Symbol.toStringTag,{value:"Module"})),pC=Cb(dC);Object.defineProperty(Lr,"__esModule",{value:!0});Lr.bodyOpenClassName=Lr.portalClassName=void 0;var em=Object.assign||function(e){for(var t=1;t{this.listeners=this.listeners.filter(n=>n!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const Qi=typeof window>"u";function Rt(){}function CC(e,t){return typeof e=="function"?e(t):e}function Rf(e){return typeof e=="number"&&e>=0&&e!==1/0}function f1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ys(e,t,n){return ha(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function SU(e,t,n){return ha(e)?typeof t=="function"?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function Dn(e,t,n){return ha(e)?[{...t,queryKey:e},n]:[e||{},t]}function am(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(ha(a)){if(r){if(t.queryHash!==rp(a,t.options))return!1}else if(!ol(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function sm(e,t){const{exact:n,fetching:r,predicate:o,mutationKey:i}=e;if(ha(i)){if(!t.options.mutationKey)return!1;if(n){if(br(t.options.mutationKey)!==br(i))return!1}else if(!ol(t.options.mutationKey,i))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||o&&!o(t))}function rp(e,t){return((t==null?void 0:t.queryKeyHashFn)||br)(e)}function br(e){return JSON.stringify(e,(t,n)=>Cf(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ol(e,t){return d1(e,t)}function d1(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!d1(e[n],t[n])):!1}function p1(e,t){if(e===t)return e;const n=um(e)&&um(t);if(n||Cf(e)&&Cf(t)){const r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),i=o.length,a=n?[]:{};let s=0;for(let l=0;l"u")return!0;const n=t.prototype;return!(!cm(n)||!n.hasOwnProperty("isPrototypeOf"))}function cm(e){return Object.prototype.toString.call(e)==="[object Object]"}function ha(e){return Array.isArray(e)}function h1(e){return new Promise(t=>{setTimeout(t,e)})}function fm(e){h1(0).then(e)}function OC(){if(typeof AbortController=="function")return new AbortController}function Of(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?p1(e,t):t}class kC extends pa{constructor(){super(),this.setup=t=>{if(!Qi&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const il=new kC;class TC extends pa{constructor(){super(),this.setup=t=>{if(!Qi&&window.addEventListener){const n=()=>t();return window.addEventListener("online",n,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const al=new TC;function PC(e){return Math.min(1e3*2**e,3e4)}function Ml(e){return(e!=null?e:"online")==="online"?al.isOnline():!0}class v1{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function ws(e){return e instanceof v1}function m1(e){let t=!1,n=0,r=!1,o,i,a;const s=new Promise((b,m)=>{i=b,a=m}),l=b=>{r||(h(new v1(b)),e.abort==null||e.abort())},u=()=>{t=!0},c=()=>{t=!1},f=()=>!il.isFocused()||e.networkMode!=="always"&&!al.isOnline(),d=b=>{r||(r=!0,e.onSuccess==null||e.onSuccess(b),o==null||o(),i(b))},h=b=>{r||(r=!0,e.onError==null||e.onError(b),o==null||o(),a(b))},g=()=>new Promise(b=>{o=m=>{if(r||!f())return b(m)},e.onPause==null||e.onPause()}).then(()=>{o=void 0,r||e.onContinue==null||e.onContinue()}),y=()=>{if(r)return;let b;try{b=e.fn()}catch(m){b=Promise.reject(m)}Promise.resolve(b).then(d).catch(m=>{var p,v;if(r)return;const S=(p=e.retry)!=null?p:3,k=(v=e.retryDelay)!=null?v:PC,C=typeof k=="function"?k(n,m):k,N=S===!0||typeof S=="number"&&n{if(f())return g()}).then(()=>{t?h(m):y()})})};return Ml(e.networkMode)?y():g().then(y),{promise:s,cancel:l,continue:()=>{o==null||o()},cancelRetry:u,continueRetry:c}}const op=console;function LC(){let e=[],t=0,n=c=>{c()},r=c=>{c()};const o=c=>{let f;t++;try{f=c()}finally{t--,t||s()}return f},i=c=>{t?e.push(c):fm(()=>{n(c)})},a=c=>(...f)=>{i(()=>{c(...f)})},s=()=>{const c=e;e=[],c.length&&fm(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:o,batchCalls:a,schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c}}}const Ie=LC();class g1{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rf(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t!=null?t:Qi?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class NC extends g1{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||op,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||AC(this.options),this.state=this.initialState}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=Of(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(Rt).catch(Rt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!f1(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.indexOf(t)!==-1&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,o;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var i;return(i=this.retryer)==null||i.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(g=>g.options.queryFn);h&&this.setOptions(h.options)}Array.isArray(this.options.queryKey);const a=OC(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(s);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(s)):Promise.reject("Missing queryFn"),c={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};if(l(c),(r=this.options.behavior)==null||r.onFetch(c),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((o=c.fetchOptions)==null?void 0:o.meta)){var f;this.dispatch({type:"fetch",meta:(f=c.fetchOptions)==null?void 0:f.meta})}const d=h=>{if(ws(h)&&h.silent||this.dispatch({type:"error",error:h}),!ws(h)){var g,y;(g=(y=this.cache.config).onError)==null||g.call(y,h,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=m1({fn:c.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:h=>{var g,y;if(typeof h>"u"){d(new Error("undefined"));return}this.setData(h),(g=(y=this.cache.config).onSuccess)==null||g.call(y,h,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(h,g)=>{this.dispatch({type:"failed",failureCount:h,error:g})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var o,i;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(o=t.meta)!=null?o:null,fetchStatus:Ml(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(i=t.dataUpdatedAt)!=null?i:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return ws(a)&&a.revert&&this.revertState?{...this.revertState}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ie.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function AC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class y1 extends pa{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var o;const i=n.queryKey,a=(o=n.queryHash)!=null?o:rp(i,n);let s=this.get(a);return s||(s=new NC({cache:this,logger:t.getLogger(),queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){Ie.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=Dn(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(o=>am(r,o))}findAll(t,n){const[r]=Dn(t,n);return Object.keys(r).length>0?this.queries.filter(o=>am(r,o)):this.queries}notify(t){Ie.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ie.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){Ie.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class IC extends g1{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||op,this.observers=[],this.state=t.state||DC(),this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()}async execute(){const t=()=>{var v;return this.retryer=m1({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(S,k)=>{this.dispatch({type:"failed",failureCount:S,error:k})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(v=this.options.retry)!=null?v:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,o,i,a,s,l;if(!n){var u,c,f,d;this.dispatch({type:"loading",variables:this.options.variables}),await((u=(c=this.mutationCache.config).onMutate)==null?void 0:u.call(c,this.state.variables,this));const S=await((f=(d=this.options).onMutate)==null?void 0:f.call(d,this.state.variables));S!==this.state.context&&this.dispatch({type:"loading",context:S,variables:this.state.variables})}const v=await t();return await((r=(o=this.mutationCache.config).onSuccess)==null?void 0:r.call(o,v,this.state.variables,this.state.context,this)),await((i=(a=this.options).onSuccess)==null?void 0:i.call(a,v,this.state.variables,this.state.context)),await((s=(l=this.options).onSettled)==null?void 0:s.call(l,v,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:v}),v}catch(v){try{var h,g,y,b,m,p;throw await((h=(g=this.mutationCache.config).onError)==null?void 0:h.call(g,v,this.state.variables,this.state.context,this)),await((y=(b=this.options).onError)==null?void 0:y.call(b,v,this.state.variables,this.state.context)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,void 0,v,this.state.variables,this.state.context)),v}finally{this.dispatch({type:"error",error:v})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Ml(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ie.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function DC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class MC extends pa{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const o=new IC({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(o),o}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){Ie.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>sm(t,n))}findAll(t){return this.mutations.filter(n=>sm(t,n))}notify(t){Ie.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.mutations.filter(n=>n.state.isPaused);return Ie.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Rt)),Promise.resolve()))}}function $C(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,o,i,a;const s=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,l=(r=e.fetchOptions)==null||(o=r.meta)==null?void 0:o.fetchMore,u=l==null?void 0:l.pageParam,c=(l==null?void 0:l.direction)==="forward",f=(l==null?void 0:l.direction)==="backward",d=((i=e.state.data)==null?void 0:i.pages)||[],h=((a=e.state.data)==null?void 0:a.pageParams)||[];let g=h,y=!1;const b=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>{var N;if((N=e.signal)!=null&&N.aborted)y=!0;else{var A;(A=e.signal)==null||A.addEventListener("abort",()=>{y=!0})}return e.signal}})},m=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),p=(C,N,A,W)=>(g=W?[N,...g]:[...g,N],W?[A,...C]:[...C,A]),v=(C,N,A,W)=>{if(y)return Promise.reject("Cancelled");if(typeof A>"u"&&!N&&C.length)return Promise.resolve(C);const F={queryKey:e.queryKey,pageParam:A,meta:e.options.meta};b(F);const X=m(F);return Promise.resolve(X).then(ae=>p(C,A,ae,W))};let S;if(!d.length)S=v([]);else if(c){const C=typeof u<"u",N=C?u:dm(e.options,d);S=v(d,C,N)}else if(f){const C=typeof u<"u",N=C?u:UC(e.options,d);S=v(d,C,N,!0)}else{g=[];const C=typeof e.options.getNextPageParam>"u";S=(s&&d[0]?s(d[0],0,d):!0)?v([],C,h[0]):Promise.resolve(p([],h[0],d[0]));for(let A=1;A{if(s&&d[A]?s(d[A],A,d):!0){const X=C?h[A]:dm(e.options,W);return v(W,C,X)}return Promise.resolve(p(W,h[A],d[A]))})}return S.then(C=>({pages:C,pageParams:g}))}}}}function dm(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function UC(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class FC{constructor(t={}){this.queryCache=t.queryCache||new y1,this.mutationCache=t.mutationCache||new MC,this.logger=t.logger||op,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}mount(){this.unsubscribeFocus=il.subscribe(()=>{il.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=al.subscribe(()=>{al.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})}unmount(){var t,n;(t=this.unsubscribeFocus)==null||t.call(this),(n=this.unsubscribeOnline)==null||n.call(this)}isFetching(t,n){const[r]=Dn(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.queryCache.find(t),i=o==null?void 0:o.state.data,a=CC(n,i);if(typeof a>"u")return;const s=ys(t),l=this.defaultQueryOptions(s);return this.queryCache.build(this,l).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Ie.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=Dn(t,n),o=this.queryCache;Ie.batch(()=>{o.findAll(r).forEach(i=>{o.remove(i)})})}resetQueries(t,n,r){const[o,i]=Dn(t,n,r),a=this.queryCache,s={type:"active",...o};return Ie.batch(()=>(a.findAll(o).forEach(l=>{l.reset()}),this.refetchQueries(s,i)))}cancelQueries(t,n,r){const[o,i={}]=Dn(t,n,r);typeof i.revert>"u"&&(i.revert=!0);const a=Ie.batch(()=>this.queryCache.findAll(o).map(s=>s.cancel(i)));return Promise.all(a).then(Rt).catch(Rt)}invalidateQueries(t,n,r){const[o,i]=Dn(t,n,r);return Ie.batch(()=>{var a,s;if(this.queryCache.findAll(o).forEach(u=>{u.invalidate()}),o.refetchType==="none")return Promise.resolve();const l={...o,type:(a=(s=o.refetchType)!=null?s:o.type)!=null?a:"active"};return this.refetchQueries(l,i)})}refetchQueries(t,n,r){const[o,i]=Dn(t,n,r),a=Ie.batch(()=>this.queryCache.findAll(o).filter(l=>!l.isDisabled()).map(l=>{var u;return l.fetch(void 0,{...i,cancelRefetch:(u=i==null?void 0:i.cancelRefetch)!=null?u:!0,meta:{refetchPage:o.refetchPage}})}));let s=Promise.all(a).then(Rt);return i!=null&&i.throwOnError||(s=s.catch(Rt)),s}fetchQuery(t,n,r){const o=ys(t,n,r),i=this.defaultQueryOptions(o);typeof i.retry>"u"&&(i.retry=!1);const a=this.queryCache.build(this,i);return a.isStaleByTime(i.staleTime)?a.fetch(i):Promise.resolve(a.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(Rt).catch(Rt)}fetchInfiniteQuery(t,n,r){const o=ys(t,n,r);return o.behavior=$C(),this.fetchQuery(o)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(Rt).catch(Rt)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(o=>br(t)===br(o.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>ol(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(o=>br(t)===br(o.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>ol(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=rp(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class jC extends pa{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),pm(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return kf(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kf(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,o=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),lm(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const i=this.hasListeners();i&&hm(this.currentQuery,o,this.options,r)&&this.executeFetch(),this.updateResult(n),i&&(this.currentQuery!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const a=this.computeRefetchInterval();i&&(this.currentQuery!==o||this.options.enabled!==r.enabled||a!==this.currentRefetchInterval)&&this.updateRefetchInterval(a)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t);return this.createResult(n,t)}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Rt)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Qi||this.currentResult.isStale||!Rf(this.options.staleTime))return;const n=f1(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(Qi||this.options.enabled===!1||!Rf(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||il.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,o=this.options,i=this.currentResult,a=this.currentResultState,s=this.currentResultOptions,l=t!==r,u=l?t.state:this.currentQueryInitialState,c=l?this.currentResult:this.previousQueryResult,{state:f}=t;let{dataUpdatedAt:d,error:h,errorUpdatedAt:g,fetchStatus:y,status:b}=f,m=!1,p=!1,v;if(n._optimisticResults){const A=this.hasListeners(),W=!A&&pm(t,n),F=A&&hm(t,r,n,o);(W||F)&&(y=Ml(t.options.networkMode)?"fetching":"paused",d||(b="loading")),n._optimisticResults==="isRestoring"&&(y="idle")}if(n.keepPreviousData&&!f.dataUpdatedAt&&c!=null&&c.isSuccess&&b!=="error")v=c.data,d=c.dataUpdatedAt,b=c.status,m=!0;else if(n.select&&typeof f.data<"u")if(i&&f.data===(a==null?void 0:a.data)&&n.select===this.selectFn)v=this.selectResult;else try{this.selectFn=n.select,v=n.select(f.data),v=Of(i==null?void 0:i.data,v,n),this.selectResult=v,this.selectError=null}catch(A){this.selectError=A}else v=f.data;if(typeof n.placeholderData<"u"&&typeof v>"u"&&b==="loading"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),this.selectError=null}catch(W){this.selectError=W}typeof A<"u"&&(b="success",v=Of(i==null?void 0:i.data,A,n),p=!0)}this.selectError&&(h=this.selectError,v=this.selectResult,g=Date.now(),b="error");const S=y==="fetching",k=b==="loading",C=b==="error";return{status:b,fetchStatus:y,isLoading:k,isSuccess:b==="success",isError:C,isInitialLoading:k&&S,data:v,dataUpdatedAt:d,error:h,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!k,isLoadingError:C&&f.dataUpdatedAt===0,isPaused:y==="paused",isPlaceholderData:p,isPreviousData:m,isRefetchError:C&&f.dataUpdatedAt!==0,isStale:ip(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,lm(r,n))return;this.currentResult=r;const o={cache:!0},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options;if(a==="all"||!a&&!this.trackedProps.size)return!0;const s=new Set(a!=null?a:this.trackedProps);return this.options.useErrorBoundary&&s.add("error"),Object.keys(this.currentResult).some(l=>{const u=l;return this.currentResult[u]!==n[u]&&s.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),this.notify({...o,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!ws(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){Ie.batch(()=>{if(t.onSuccess){var n,r,o,i;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(o=(i=this.options).onSettled)==null||o.call(i,this.currentResult.data,null)}else if(t.onError){var a,s,l,u;(a=(s=this.options).onError)==null||a.call(s,this.currentResult.error),(l=(u=this.options).onSettled)==null||l.call(u,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(c=>{c(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function BC(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function pm(e,t){return BC(e,t)||e.state.dataUpdatedAt>0&&kf(e,t,t.refetchOnMount)}function kf(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ip(e,t)}return!1}function hm(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&ip(e,n)}function ip(e,t){return e.isStaleByTime(t.staleTime)}var w1={exports:{}},S1={};/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ro=R.exports;function zC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var VC=typeof Object.is=="function"?Object.is:zC,WC=Ro.useState,HC=Ro.useEffect,KC=Ro.useLayoutEffect,qC=Ro.useDebugValue;function QC(e,t){var n=t(),r=WC({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return KC(function(){o.value=n,o.getSnapshot=t,Gu(o)&&i({inst:o})},[e,n,t]),HC(function(){return Gu(o)&&i({inst:o}),e(function(){Gu(o)&&i({inst:o})})},[e]),qC(n),n}function Gu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!VC(e,n)}catch{return!0}}function GC(e,t){return t()}var XC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?GC:QC;S1.useSyncExternalStore=Ro.useSyncExternalStore!==void 0?Ro.useSyncExternalStore:XC;(function(e){e.exports=S1})(w1);const YC=w1.exports.useSyncExternalStore;var $l={exports:{}},Ul={};/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var JC=R.exports,ZC=Symbol.for("react.element"),e2=Symbol.for("react.fragment"),t2=Object.prototype.hasOwnProperty,n2=JC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r2={key:!0,ref:!0,__self:!0,__source:!0};function _1(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)t2.call(t,r)&&!r2.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:ZC,type:e,key:i,ref:a,props:o,_owner:n2.current}}Ul.Fragment=e2;Ul.jsx=_1;Ul.jsxs=_1;(function(e){e.exports=Ul})($l);const Nt=$l.exports.Fragment,w=$l.exports.jsx,Z=$l.exports.jsxs,vm=R.exports.createContext(void 0),b1=R.exports.createContext(!1);function E1(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=vm),window.ReactQueryClientContext):vm)}const o2=({context:e}={})=>{const t=R.exports.useContext(E1(e,R.exports.useContext(b1)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},i2=({client:e,children:t,context:n,contextSharing:r=!1})=>{R.exports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const o=E1(n,r);return w(b1.Provider,{value:!n&&r,children:w(o.Provider,{value:e,children:t})})},x1=R.exports.createContext(!1),a2=()=>R.exports.useContext(x1);x1.Provider;function s2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const l2=R.exports.createContext(s2()),u2=()=>R.exports.useContext(l2);function c2(e,t){return typeof e=="function"?e(...t):!!e}const f2=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},d2=e=>{R.exports.useEffect(()=>{e.clearReset()},[e])},p2=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&c2(n,[e.error,r]);function h2(e,t){const n=o2({context:e.context}),r=a2(),o=u2(),i=n.defaultQueryOptions(e);i._optimisticResults=r?"isRestoring":"optimistic",i.onError&&(i.onError=Ie.batchCalls(i.onError)),i.onSuccess&&(i.onSuccess=Ie.batchCalls(i.onSuccess)),i.onSettled&&(i.onSettled=Ie.batchCalls(i.onSettled)),i.suspense&&typeof i.staleTime!="number"&&(i.staleTime=1e3),f2(i,o),d2(o);const[a]=R.exports.useState(()=>new t(n,i)),s=a.getOptimisticResult(i);if(YC(R.exports.useCallback(l=>r?()=>{}:a.subscribe(Ie.batchCalls(l)),[a,r]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),R.exports.useEffect(()=>{a.setOptions(i,{listeners:!1})},[i,a]),i.suspense&&s.isLoading&&s.isFetching&&!r)throw a.fetchOptimistic(i).then(({data:l})=>{i.onSuccess==null||i.onSuccess(l),i.onSettled==null||i.onSettled(l,null)}).catch(l=>{o.clearReset(),i.onError==null||i.onError(l),i.onSettled==null||i.onSettled(void 0,l)});if(p2({result:s,errorResetBoundary:o,useErrorBoundary:i.useErrorBoundary,query:a.getCurrentQuery()}))throw s.error;return i.notifyOnChangeProps?s:a.trackResult(s)}function v2(e,t,n){const r=ys(e,t,n);return h2(r,jC)}/** - * @remix-run/router v1.0.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Gi(){return Gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function w2(e){let t=typeof window<"u"&&typeof window.location<"u"&&window.location.origin!=="null"?window.location.origin:"unknown://unknown",n=typeof e=="string"?e:Xi(e);return new URL(n,t)}function S2(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s=Vn.Pop,l=null;function u(){s=Vn.Pop,l&&l({action:s,location:d.location})}function c(h,g){s=Vn.Push;let y=Tf(d.location,h,g);n&&n(y,h);let b=gm(y),m=d.createHref(y);try{a.pushState(b,"",m)}catch{o.location.assign(m)}i&&l&&l({action:s,location:d.location})}function f(h,g){s=Vn.Replace;let y=Tf(d.location,h,g);n&&n(y,h);let b=gm(y),m=d.createHref(y);a.replaceState(b,"",m),i&&l&&l({action:s,location:d.location})}let d={get action(){return s},get location(){return e(o,a)},listen(h){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(mm,u),l=h,()=>{o.removeEventListener(mm,u),l=null}},createHref(h){return t(o,h)},encodeLocation(h){let g=w2(Xi(h));return Gi({},h,{pathname:g.pathname,search:g.search,hash:g.hash})},push:c,replace:f,go(h){return a.go(h)}};return d}var ym;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ym||(ym={}));function _2(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?$r(t):t,o=C1(r.pathname||"/",n);if(o==null)return null;let i=R1(e);b2(i);let a=null;for(let s=0;a==null&&s{let a={relativePath:o.path||"",caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};a.relativePath.startsWith("/")&&(Ze(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let s=tr([r,a.relativePath]),l=n.concat(a);o.children&&o.children.length>0&&(Ze(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),R1(o.children,t,l,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:T2(s,o.index),routesMeta:l})}),t}function b2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:P2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const E2=/^:\w+$/,x2=3,R2=2,C2=1,O2=10,k2=-2,wm=e=>e==="*";function T2(e,t){let n=e.split("/"),r=n.length;return n.some(wm)&&(r+=k2),t&&(r+=R2),n.filter(o=>!wm(o)).reduce((o,i)=>o+(E2.test(i)?x2:i===""?C2:O2),r)}function P2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function L2(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{if(c==="*"){let d=s[f]||"";a=i.slice(0,i.length-d.length).replace(/(.)\/+$/,"$1")}return u[c]=D2(s[f]||"",c),u},{}),pathname:i,pathnameBase:a,pattern:e}}function A2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ap(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,(a,s)=>(r.push(s),"([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function I2(e){try{return decodeURI(e)}catch(t){return ap(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function D2(e,t){try{return decodeURIComponent(e)}catch(n){return ap(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function C1(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Ze(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ap(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function M2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?$r(e):e;return{pathname:n?n.startsWith("/")?n:$2(n,t):t,search:F2(r),hash:j2(o)}}function $2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Xu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function O1(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function k1(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=$r(e):(o=Gi({},e),Ze(!o.pathname||!o.pathname.includes("?"),Xu("?","pathname","search",o)),Ze(!o.pathname||!o.pathname.includes("#"),Xu("#","pathname","hash",o)),Ze(!o.search||!o.search.includes("#"),Xu("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(r||a==null)s=n;else{let f=t.length-1;if(a.startsWith("..")){let d=a.split("/");for(;d[0]==="..";)d.shift(),f-=1;o.pathname=d.join("/")}s=f>=0?t[f]:"/"}let l=M2(o,s),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const tr=e=>e.join("/").replace(/\/\/+/g,"/"),U2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),F2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,j2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class B2{constructor(t,n,r){this.status=t,this.statusText=n||"",this.data=r}}function z2(e){return e instanceof B2}const V2=new Set(["POST","PUT","PATCH","DELETE"]);[...V2];/** - * React Router v6.4.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Pf(){return Pf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.value=r,o.getSnapshot=t,Yu(o)&&i({inst:o})},[e,r,t]),q2(()=>(Yu(o)&&i({inst:o}),e(()=>{Yu(o)&&i({inst:o})})),[e]),G2(r),r}function Yu(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!H2(n,r)}catch{return!0}}function Y2(e,t,n){return t()}const J2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Z2=!J2,eO=Z2?Y2:X2;"useSyncExternalStore"in At&&(e=>e.useSyncExternalStore)(At);const tO=R.exports.createContext(null),T1=R.exports.createContext(null),sp=R.exports.createContext(null),Fl=R.exports.createContext(null),va=R.exports.createContext({outlet:null,matches:[]}),P1=R.exports.createContext(null);function nO(e,t){let{relative:n}=t===void 0?{}:t;ma()||Ze(!1);let{basename:r,navigator:o}=R.exports.useContext(sp),{hash:i,pathname:a,search:s}=L1(e,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:tr([r,a])),o.createHref({pathname:l,search:s,hash:i})}function ma(){return R.exports.useContext(Fl)!=null}function ga(){return ma()||Ze(!1),R.exports.useContext(Fl).location}function rO(){ma()||Ze(!1);let{basename:e,navigator:t}=R.exports.useContext(sp),{matches:n}=R.exports.useContext(va),{pathname:r}=ga(),o=JSON.stringify(O1(n).map(s=>s.pathnameBase)),i=R.exports.useRef(!1);return R.exports.useEffect(()=>{i.current=!0}),R.exports.useCallback(function(s,l){if(l===void 0&&(l={}),!i.current)return;if(typeof s=="number"){t.go(s);return}let u=k1(s,JSON.parse(o),r,l.relative==="path");e!=="/"&&(u.pathname=u.pathname==="/"?e:tr([e,u.pathname])),(l.replace?t.replace:t.push)(u,l.state,l)},[e,t,o,r])}function L1(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=R.exports.useContext(va),{pathname:o}=ga(),i=JSON.stringify(O1(r).map(a=>a.pathnameBase));return R.exports.useMemo(()=>k1(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function N1(e,t){ma()||Ze(!1);let n=R.exports.useContext(T1),{matches:r}=R.exports.useContext(va),o=r[r.length-1],i=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let s=ga(),l;if(t){var u;let g=typeof t=="string"?$r(t):t;a==="/"||((u=g.pathname)==null?void 0:u.startsWith(a))||Ze(!1),l=g}else l=s;let c=l.pathname||"/",f=a==="/"?c:c.slice(a.length)||"/",d=_2(e,{pathname:f}),h=sO(d&&d.map(g=>Object.assign({},g,{params:Object.assign({},i,g.params),pathname:tr([a,g.pathname]),pathnameBase:g.pathnameBase==="/"?a:tr([a,g.pathnameBase])})),r,n||void 0);return t&&h?w(Fl.Provider,{value:{location:Pf({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:Vn.Pop},children:h}):h}function oO(){let e=uO(),t=z2(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r};return Z(Nt,{children:[w("h2",{children:"Unhandled Thrown Error!"}),w("h3",{style:{fontStyle:"italic"},children:t}),n?w("pre",{style:o,children:n}):null,w("p",{children:"\u{1F4BF} Hey developer \u{1F44B}"}),Z("p",{children:["You can provide a way better UX than this when your app throws errors by providing your own\xA0",w("code",{style:i,children:"errorElement"})," props on\xA0",w("code",{style:i,children:""})]})]})}class iO extends R.exports.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?w(P1.Provider,{value:this.state.error,children:this.props.component}):this.props.children}}function aO(e){let{routeContext:t,match:n,children:r}=e,o=R.exports.useContext(tO);return o&&n.route.errorElement&&(o._deepestRenderedBoundaryId=n.route.id),w(va.Provider,{value:t,children:r})}function sO(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,o=n==null?void 0:n.errors;if(o!=null){let i=r.findIndex(a=>a.route.id&&(o==null?void 0:o[a.route.id]));i>=0||Ze(!1),r=r.slice(0,Math.min(r.length,i+1))}return r.reduceRight((i,a,s)=>{let l=a.route.id?o==null?void 0:o[a.route.id]:null,u=n?a.route.errorElement||w(oO,{}):null,c=()=>w(aO,{match:a,routeContext:{outlet:i,matches:t.concat(r.slice(0,s+1))},children:l?u:a.route.element!==void 0?a.route.element:i});return n&&(a.route.errorElement||s===0)?w(iO,{location:n.location,component:u,error:l,children:c()}):c()},null)}var Sm;(function(e){e.UseRevalidator="useRevalidator"})(Sm||(Sm={}));var Lf;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(Lf||(Lf={}));function lO(e){let t=R.exports.useContext(T1);return t||Ze(!1),t}function uO(){var e;let t=R.exports.useContext(P1),n=lO(Lf.UseRouteError),r=R.exports.useContext(va),o=r.matches[r.matches.length-1];return t||(r||Ze(!1),o.route.id||Ze(!1),(e=n.errors)==null?void 0:e[o.route.id])}function cO(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Vn.Pop,navigator:i,static:a=!1}=e;ma()&&Ze(!1);let s=t.replace(/^\/*/,"/"),l=R.exports.useMemo(()=>({basename:s,navigator:i,static:a}),[s,i,a]);typeof r=="string"&&(r=$r(r));let{pathname:u="/",search:c="",hash:f="",state:d=null,key:h="default"}=r,g=R.exports.useMemo(()=>{let y=C1(u,s);return y==null?null:{pathname:y,search:c,hash:f,state:d,key:h}},[s,u,c,f,d,h]);return g==null?null:w(sp.Provider,{value:l,children:w(Fl.Provider,{children:n,value:{location:g,navigationType:o}})})}var _m;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(_m||(_m={}));new Promise(()=>{});/** - * React Router DOM v6.4.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function fO(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function dO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pO(e,t){return e.button===0&&(!t||t==="_self")&&!dO(e)}const hO=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function vO(e){let{basename:t,children:n,window:r}=e,o=R.exports.useRef();o.current==null&&(o.current=m2({window:r,v5Compat:!0}));let i=o.current,[a,s]=R.exports.useState({action:i.action,location:i.location});return R.exports.useLayoutEffect(()=>i.listen(s),[i]),w(cO,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:i})}const A1=R.exports.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:l,to:u,preventScrollReset:c}=t,f=fO(t,hO),d=nO(u,{relative:o}),h=mO(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:o});function g(y){r&&r(y),y.defaultPrevented||h(y)}return w("a",{...f,href:d,onClick:i?r:g,ref:n,target:l})});var bm;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(bm||(bm={}));var Em;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Em||(Em={}));function mO(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a}=t===void 0?{}:t,s=rO(),l=ga(),u=L1(e,{relative:a});return R.exports.useCallback(c=>{if(pO(c,n)){c.preventDefault();let f=r!==void 0?r:Xi(l)===Xi(u);s(e,{replace:f,state:o,preventScrollReset:i,relative:a})}},[l,s,u,r,o,n,e,i,a])}function gO(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var yO=gO,se=yO;function wO(e){return!!e&&typeof e.then=="function"}var Ce=wO;function SO(e,t){if(e!=null)return e;throw se(t!=null?t:"Got unexpected null or undefined")}var Oe=SO;function ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class jl{getValue(){throw se("BaseLoadable")}toPromise(){throw se("BaseLoadable")}valueMaybe(){throw se("BaseLoadable")}valueOrThrow(){throw se(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw se("BaseLoadable")}promiseOrThrow(){throw se(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw se("BaseLoadable")}errorOrThrow(){throw se(`Loadable expected error, but in "${this.state}" state`)}is(t){return t.state===this.state&&t.contents===this.contents}map(t){throw se("BaseLoadable")}}class _O extends jl{constructor(t){super(),ie(this,"state","hasValue"),ie(this,"contents",void 0),this.contents=t}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(t){try{const n=t(this.contents);return Ce(n)?Nr(n):Co(n)?n:ya(n)}catch(n){return Ce(n)?Nr(n.next(()=>this.map(t))):Bl(n)}}}class bO extends jl{constructor(t){super(),ie(this,"state","hasError"),ie(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(t){return this}}class I1 extends jl{constructor(t){super(),ie(this,"state","loading"),ie(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(t){return Nr(this.contents.then(n=>{const r=t(n);if(Co(r)){const o=r;switch(o.state){case"hasValue":return o.contents;case"hasError":throw o.contents;case"loading":return o.contents}}return r}).catch(n=>{if(Ce(n))return n.then(()=>this.map(t).contents);throw n}))}}function ya(e){return Object.freeze(new _O(e))}function Bl(e){return Object.freeze(new bO(e))}function Nr(e){return Object.freeze(new I1(e))}function D1(){return Object.freeze(new I1(new Promise(()=>{})))}function EO(e){return e.every(t=>t.state==="hasValue")?ya(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?Bl(Oe(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):Nr(Promise.all(e.map(t=>t.contents)))}function M1(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(o=>e[o])).map(o=>Co(o)?o:Ce(o)?Nr(o):ya(o)),r=EO(n);return Array.isArray(e)?r:r.map(o=>Object.getOwnPropertyNames(e).reduce((i,a,s)=>({...i,[a]:o[s]}),{}))}function Co(e){return e instanceof jl}const xO={of:e=>Ce(e)?Nr(e):Co(e)?e:ya(e),error:e=>Bl(e),loading:()=>D1(),all:M1,isLoadable:Co};var Ur={loadableWithValue:ya,loadableWithError:Bl,loadableWithPromise:Nr,loadableLoading:D1,loadableAll:M1,isLoadable:Co,RecoilLoadable:xO},RO=Ur.loadableWithValue,CO=Ur.loadableWithError,OO=Ur.loadableWithPromise,kO=Ur.loadableLoading,TO=Ur.loadableAll,PO=Ur.isLoadable,LO=Ur.RecoilLoadable,wa=Object.freeze({__proto__:null,loadableWithValue:RO,loadableWithError:CO,loadableWithPromise:OO,loadableLoading:kO,loadableAll:TO,isLoadable:PO,RecoilLoadable:LO});const zl=new Map().set("recoil_hamt_2020",!0).set("recoil_sync_external_store",!0).set("recoil_suppress_rerender_in_callback",!0).set("recoil_memory_managament_2020",!0);function Vl(e){var t;return(t=zl.get(e))!==null&&t!==void 0?t:!1}Vl.setPass=e=>{zl.set(e,!0)};Vl.setFail=e=>{zl.set(e,!1)};Vl.clear=()=>{zl.clear()};var me=Vl;function NO(e,t,{error:n}={}){return null}var AO=NO,lp=AO,Ju,Zu,ec;const IO=(Ju=ye.createMutableSource)!==null&&Ju!==void 0?Ju:ye.unstable_createMutableSource,$1=(Zu=ye.useMutableSource)!==null&&Zu!==void 0?Zu:ye.unstable_useMutableSource,U1=(ec=ye.useSyncExternalStore)!==null&&ec!==void 0?ec:ye.unstable_useSyncExternalStore;function DO(){var e;const{ReactCurrentDispatcher:t,ReactCurrentOwner:n}=ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;return((e=t==null?void 0:t.current)!==null&&e!==void 0?e:n.currentDispatcher).useSyncExternalStore!=null}function MO(){return me("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:me("recoil_sync_external_store")&&U1!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:me("recoil_mutable_source")&&$1!=null&&typeof window<"u"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?me("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:me("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function $O(){return!1}var Sa={createMutableSource:IO,useMutableSource:$1,useSyncExternalStore:U1,currentRendererSupportsUseSyncExternalStore:DO,reactMode:MO,isFastRefreshEnabled:$O};const F1={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0};function UO(){var e,t,n;if(typeof process>"u"||((e=process)===null||e===void 0?void 0:e.env)==null)return;const r=(t=process.env.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED)===null||t===void 0||(n=t.toLowerCase())===null||n===void 0?void 0:n.trim();if(r==null||r==="")return;if(!["true","false"].includes(r))throw se(`process.env.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED value must be 'true', 'false', or empty: ${r}`);F1.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=r==="true"}UO();var j1=F1;class up{constructor(t){ie(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class B1 extends up{}class z1 extends up{}function FO(e){return e instanceof B1||e instanceof z1}var Wl={AbstractRecoilValue:up,RecoilState:B1,RecoilValueReadOnly:z1,isRecoilValue:FO},jO=Wl.AbstractRecoilValue,BO=Wl.RecoilState,zO=Wl.RecoilValueReadOnly,VO=Wl.isRecoilValue,Oo=Object.freeze({__proto__:null,AbstractRecoilValue:jO,RecoilState:BO,RecoilValueReadOnly:zO,isRecoilValue:VO});function WO(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var Hl=WO;class V1{}const HO=new V1,Ar=new Map,cp=new Map;function KO(e){return Hl(e,t=>Oe(cp.get(t)))}function qO(e){if(Ar.has(e)){const t=`Duplicate atom key "${e}". This is a FATAL ERROR in - production. But it is safe to ignore this warning if it occurred because of - hot module replacement.`;console.warn(t)}}function QO(e){j1.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&qO(e.key),Ar.set(e.key,e);const t=e.set==null?new Oo.RecoilValueReadOnly(e.key):new Oo.RecoilState(e.key);return cp.set(e.key,t),t}class W1 extends Error{}function GO(e){const t=Ar.get(e);if(t==null)throw new W1(`Missing definition for RecoilValue: "${e}""`);return t}function XO(e){return Ar.get(e)}const sl=new Map;function YO(e){var t;if(!me("recoil_memory_managament_2020"))return;const n=Ar.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;Ar.delete(e),(r=H1(e))===null||r===void 0||r(),sl.delete(e)}}function JO(e,t){!me("recoil_memory_managament_2020")||(t===void 0?sl.delete(e):sl.set(e,t))}function H1(e){return sl.get(e)}var ft={nodes:Ar,recoilValues:cp,registerNode:QO,getNode:GO,getNodeMaybe:XO,deleteNodeConfigIfPossible:YO,setConfigDeletionHandler:JO,getConfigDeletionHandler:H1,recoilValuesForKeys:KO,NodeMissingError:W1,DefaultValue:V1,DEFAULT_VALUE:HO};function ZO(e,t){t()}var ek={enqueueExecution:ZO};function tk(e,t){return t={exports:{}},e(t,t.exports),t.exports}var nk=tk(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(T){return typeof T}:function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},n={},r=5,o=Math.pow(2,r),i=o-1,a=o/2,s=o/4,l={},u=function(x){return function(){return x}},c=n.hash=function(T){var x=typeof T>"u"?"undefined":t(T);if(x==="number")return T;x!=="string"&&(T+="");for(var U=0,K=0,q=T.length;K>1&1431655765,x=(x&858993459)+(x>>2&858993459),x=x+(x>>4)&252645135,x+=x>>8,x+=x>>16,x&127},d=function(x,U){return U>>>x&i},h=function(x){return 1<=U;)q[re--]=q[re];return q[U]=K,q}for(var te=0,ne=0,le=new Array(G+1);te>>=1;return re[U]=K,X(x,ne+1,re)},_=function(x,U,K,q){for(var G=new Array(U-1),re=0,te=0,ne=0,le=q.length;ne1?W(x,this.hash,le):le[0]}var xe=q();return xe===l?this:(++te.value,L(x,K,this.hash,this,G,A(x,G,re,xe)))},M=function(x,U,K,q,G,re,te){var ne=this.mask,le=this.children,xe=d(K,G),ot=h(xe),Ue=g(ne,ot),xt=ne&ot,Ut=xt?le[Ue]:C,zr=Ut._modify(x,U,K+r,q,G,re,te);if(Ut===zr)return this;var Oa=O(x,this),Vo=ne,Wo=void 0;if(xt&&N(zr)){if(Vo&=~ot,!Vo)return C;if(le.length<=2&&ce(le[Ue^1]))return le[Ue^1];Wo=b(Oa,Ue,le)}else if(!xt&&!N(zr)){if(le.length>=a)return ae(x,xe,zr,ne,le);Vo|=ot,Wo=m(Oa,Ue,zr,le)}else Wo=y(Oa,Ue,zr,le);return Oa?(this.mask=Vo,this.children=Wo,this):F(x,Vo,Wo)},z=function(x,U,K,q,G,re,te){var ne=this.size,le=this.children,xe=d(K,G),ot=le[xe],Ue=(ot||C)._modify(x,U,K+r,q,G,re,te);if(ot===Ue)return this;var xt=O(x,this),Ut=void 0;if(N(ot)&&!N(Ue))++ne,Ut=y(xt,xe,Ue,le);else if(!N(ot)&&N(Ue)){if(--ne,ne<=s)return _(x,ne,xe,le);Ut=y(xt,xe,C,le)}else Ut=y(xt,xe,Ue,le);return xt?(this.size=ne,this.children=Ut,this):X(x,ne,Ut)};C._modify=function(T,x,U,K,q,G,re){var te=K();return te===l?C:(++re.value,A(T,q,G,te))};function E(T,x,U,K,q){this._editable=T,this._edit=x,this._config=U,this._root=K,this._size=q}E.prototype.setTree=function(T,x){return this._editable?(this._root=T,this._size=x,this):T===this._root?this:new E(this._editable,this._edit,this._config,T,x)};var D=n.tryGetHash=function(T,x,U,K){for(var q=K._root,G=0,re=K._config.keyEq;;)switch(q.type){case p:return re(U,q.key)?q.value:T;case v:{if(x===q.hash)for(var te=q.children,ne=0,le=te.length;ne{n.set(o,t(r,o))}),n}var ll=lk;function uk(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function ck(e){return{nodeDeps:ll(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:ll(e.nodeToNodeSubscriptions,t=>new Set(t))}}function tc(e,t,n,r){const{nodeDeps:o,nodeToNodeSubscriptions:i}=n,a=o.get(e);if(a&&r&&a!==r.nodeDeps.get(e))return;o.set(e,t);const s=a==null?t:Ri(t,a);for(const l of s)i.has(l)||i.set(l,new Set),Oe(i.get(l)).add(e);if(a){const l=Ri(a,t);for(const u of l){if(!i.has(u))return;const c=Oe(i.get(u));c.delete(e),c.size===0&&i.delete(u)}}}function fk(e,t,n,r){var o,i,a,s;const l=n.getState();r===l.currentTree.version||r===((o=l.nextTree)===null||o===void 0?void 0:o.version)||((i=l.previousTree)===null||i===void 0||i.version);const u=n.getGraph(r);if(tc(e,t,u),r===((a=l.previousTree)===null||a===void 0?void 0:a.version)){const f=n.getGraph(l.currentTree.version);tc(e,t,f,u)}if(r===((s=l.previousTree)===null||s===void 0?void 0:s.version)||r===l.currentTree.version){var c;const f=(c=l.nextTree)===null||c===void 0?void 0:c.version;if(f!==void 0){const d=n.getGraph(f);tc(e,t,d,u)}}}var _a={cloneGraph:ck,graph:uk,saveDepsToStore:fk};let dk=0;const pk=()=>dk++;let hk=0;const vk=()=>hk++;let mk=0;const gk=()=>mk++;var Kl={getNextTreeStateVersion:pk,getNextStoreID:vk,getNextComponentID:gk};const{persistentMap:xm}=ak,{graph:yk}=_a,{getNextTreeStateVersion:K1}=Kl;function q1(){const e=K1();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:xm(),nonvalidatedAtoms:xm()}}function wk(){const e=q1();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,yk()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var Q1={makeEmptyTreeState:q1,makeEmptyStoreState:wk,getNextTreeStateVersion:K1};class G1{}function Sk(){return new G1}var ql={RetentionZone:G1,retentionZone:Sk};function _k(e,t){const n=new Set(e);return n.add(t),n}function bk(e,t){const n=new Set(e);return n.delete(t),n}function Ek(e,t,n){const r=new Map(e);return r.set(t,n),r}function xk(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function Rk(e,t){const n=new Map(e);return n.delete(t),n}function Ck(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var X1={setByAddingToSet:_k,setByDeletingFromSet:bk,mapBySettingInMap:Ek,mapByUpdatingInMap:xk,mapByDeletingFromMap:Rk,mapByDeletingMultipleFromMap:Ck};function*Ok(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var pp=Ok;function kk(e,t){return new Proxy(e,{get:(r,o)=>(!(o in r)&&o in t&&(r[o]=t[o]()),r[o]),ownKeys:r=>Object.keys(r)})}var Y1=kk;const{getNode:ba,getNodeMaybe:Tk,recoilValuesForKeys:Rm}=ft,{RetentionZone:Cm}=ql,{setByAddingToSet:Pk}=X1,Lk=Object.freeze(new Set);class Nk extends Error{}function Ak(e,t,n){if(!me("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function o(i){let a=r.get(i);a||r.set(i,a=new Set),a.add(t)}if(n instanceof Cm)o(n);else if(Array.isArray(n))for(const i of n)o(i);return()=>{if(!me("recoil_memory_managament_2020"))return;const{retention:i}=e.getState();function a(s){const l=i.nodesRetainedByZone.get(s);l==null||l.delete(t),l&&l.size===0&&i.nodesRetainedByZone.delete(s)}if(n instanceof Cm)a(n);else if(Array.isArray(n))for(const s of n)a(s)}}function hp(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const i=ba(n),a=Ak(e,n,i.retainedBy),s=i.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{s(),a()})}function Ik(e,t,n){hp(e,e.getState().currentTree,t,n)}function Dk(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function Mk(e,t,n){return hp(e,t,n,"get"),ba(n).get(e,t)}function J1(e,t,n){return ba(n).peek(e,t)}function $k(e,t,n){var r;const o=Tk(t);return o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:Pk(e.dirtyAtoms,t)}}function Uk(e,t,n,r){const o=ba(n);if(o.set==null)throw new Nk(`Attempt to set read-only RecoilValue: ${n}`);const i=o.set;return hp(e,t,n,"set"),i(e,t,r)}function Fk(e,t,n){const r=e.getState(),o=e.getGraph(t.version),i=ba(n).nodeType;return Y1({type:i},{loadable:()=>J1(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>i==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var a;return Rm((a=o.nodeDeps.get(n))!==null&&a!==void 0?a:[])},subscribers:()=>{var a,s;return{nodes:Rm(pp(Z1(e,t,new Set([n])),l=>l!==n)),components:Hl((a=(s=r.nodeToComponentSubscriptions.get(n))===null||s===void 0?void 0:s.values())!==null&&a!==void 0?a:[],([l])=>({name:l}))}}})}function Z1(e,t,n){const r=new Set,o=Array.from(n),i=e.getGraph(t.version);for(let s=o.pop();s;s=o.pop()){var a;r.add(s);const l=(a=i.nodeToNodeSubscriptions.get(s))!==null&&a!==void 0?a:Lk;for(const u of l)r.has(u)||o.push(u)}return r}var fr={getNodeLoadable:Mk,peekNodeLoadable:J1,setNodeValue:Uk,initializeNode:Ik,cleanUpNode:Dk,setUnvalidatedAtomValue_DEPRECATED:$k,peekNodeInfo:Fk,getDownstreamNodes:Z1};let ew=null;function jk(e){ew=e}function Bk(){var e;(e=ew)===null||e===void 0||e()}var tw={setInvalidateMemoizedSnapshot:jk,invalidateMemoizedSnapshot:Bk};const{getDownstreamNodes:zk,getNodeLoadable:nw,setNodeValue:Vk}=fr,{getNextComponentID:Wk}=Kl,{getNode:Hk,getNodeMaybe:rw}=ft,{DefaultValue:vp}=ft,{reactMode:Kk}=Sa,{AbstractRecoilValue:qk,RecoilState:Qk,RecoilValueReadOnly:Gk,isRecoilValue:Xk}=Oo,{invalidateMemoizedSnapshot:Yk}=tw;function Jk(e,{key:t},n=e.getState().currentTree){var r,o;const i=e.getState();n.version===i.currentTree.version||n.version===((r=i.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(o=i.previousTree)===null||o===void 0||o.version);const a=nw(e,n,t);return a.state==="loading"&&a.contents.catch(()=>{}),a}function Zk(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof vp?n.delete(o):n.set(o,r)}),n}function eT(e,t,{key:n},r){if(typeof r=="function"){const o=nw(e,t,n);if(o.state==="loading"){const i=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw se(i)}else if(o.state==="hasError")throw o.contents;return r(o.contents)}else return r}function tT(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:i}=n,a=eT(e,t,o,i),s=Vk(e,t,o.key,a);for(const[l,u]of s.entries())Nf(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:i}=n;Nf(t,o,i)}else if(n.type==="markModified"){const{recoilValue:{key:o}}=n;t.dirtyAtoms.add(o)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:o},unvalidatedValue:i}=n,a=rw(o);a==null||(r=a.invalidate)===null||r===void 0||r.call(a,t),t.atomValues.delete(o),t.nonvalidatedAtoms.set(o,i),t.dirtyAtoms.add(o)}else lp(`Unknown action ${n.type}`)}function Nf(e,t,n){n.state==="hasValue"&&n.contents instanceof vp?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function ow(e,t){e.replaceState(n=>{const r=iw(n);for(const o of t)tT(e,r,o);return aw(e,r),Yk(),r})}function Ql(e,t){if(Ci.length){const n=Ci[Ci.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else ow(e,[t])}const Ci=[];function nT(){const e=new Map;return Ci.push(e),()=>{for(const[t,n]of e)ow(t,n);Ci.pop()}}function iw(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function aw(e,t){const n=zk(e,t,t.dirtyAtoms);for(const i of n){var r,o;(r=rw(i))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function sw(e,t,n){Ql(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function rT(e,t,n){if(n instanceof vp)return sw(e,t,n);Ql(e,{type:"setLoadable",recoilValue:t,loadable:n})}function oT(e,t){Ql(e,{type:"markModified",recoilValue:t})}function iT(e,t,n){Ql(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function aT(e,{key:t},n,r=null){const o=Wk(),i=e.getState();i.nodeToComponentSubscriptions.has(t)||i.nodeToComponentSubscriptions.set(t,new Map),Oe(i.nodeToComponentSubscriptions.get(t)).set(o,[r!=null?r:"",n]);const a=Kk();if(a.early&&(a.mode==="LEGACY"||a.mode==="MUTABLE_SOURCE")){const s=e.getState().nextTree;s&&s.dirtyAtoms.has(t)&&n(s)}return{release:()=>{const s=e.getState(),l=s.nodeToComponentSubscriptions.get(t);l===void 0||!l.has(o)||(l.delete(o),l.size===0&&s.nodeToComponentSubscriptions.delete(t))}}}function sT(e,t){var n;const{currentTree:r}=e.getState(),o=Hk(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var dn={RecoilValueReadOnly:Gk,AbstractRecoilValue:qk,RecoilState:Qk,getRecoilValueAsLoadable:Jk,setRecoilValue:sw,setRecoilValueLoadable:rT,markRecoilValueModified:oT,setUnvalidatedRecoilValue:iT,subscribeToRecoilValue:aT,isRecoilValue:Xk,applyAtomValueWrites:Zk,batchStart:nT,writeLoadableToTreeState:Nf,invalidateDownstreams:aw,copyTreeState:iw,refreshRecoilValue:sT};function lT(e,t,n){const r=e.entries();let o=r.next();for(;!o.done;){const i=o.value;if(t.call(n,i[1],i[0],e))return!0;o=r.next()}return!1}var uT=lT;const{cleanUpNode:cT}=fr,{deleteNodeConfigIfPossible:fT,getNode:lw}=ft,{RetentionZone:uw}=ql,dT=12e4,cw=new Set;function fw(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const o=new Set;for(const a of t)if(a instanceof uw)for(const s of mT(n,a))o.add(s);else o.add(a);const i=pT(e,o);for(const a of i)vT(e,r,a)}function pT(e,t){const n=e.getState(),r=n.currentTree,o=e.getGraph(r.version),i=new Set,a=new Set;return s(t),i;function s(l){const u=new Set,c=hT(e,r,l,i,a);for(const g of c){var f;if(lw(g).retainedBy==="recoilRoot"){a.add(g);continue}if(((f=n.retention.referenceCounts.get(g))!==null&&f!==void 0?f:0)>0){a.add(g);continue}if(dw(g).some(b=>n.retention.referenceCounts.get(b))){a.add(g);continue}const y=o.nodeToNodeSubscriptions.get(g);if(y&&uT(y,b=>a.has(b))){a.add(g);continue}i.add(g),u.add(g)}const d=new Set;for(const g of u)for(const y of(h=o.nodeDeps.get(g))!==null&&h!==void 0?h:cw){var h;i.has(y)||d.add(y)}d.size&&s(d)}}function hT(e,t,n,r,o){const i=e.getGraph(t.version),a=[],s=new Set;for(;n.size>0;)l(Oe(n.values().next().value));return a;function l(u){if(r.has(u)||o.has(u)){n.delete(u);return}if(s.has(u))return;const c=i.nodeToNodeSubscriptions.get(u);if(c)for(const f of c)l(f);s.add(u),n.delete(u),a.push(u)}}function vT(e,t,n){if(!me("recoil_memory_managament_2020"))return;cT(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const o=dw(n);for(const l of o){var i;(i=r.retention.nodesRetainedByZone.get(l))===null||i===void 0||i.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const a=r.graphsByVersion.get(t.version);if(a){const l=a.nodeDeps.get(n);if(l!==void 0){a.nodeDeps.delete(n);for(const u of l){var s;(s=a.nodeToNodeSubscriptions.get(u))===null||s===void 0||s.delete(n)}}a.nodeToNodeSubscriptions.delete(n)}fT(n)}function mT(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:cw}function dw(e){const t=lw(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof uw?[t]:t}function gT(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):fw(e,new Set([t]))}function yT(e,t,n){var r;if(!me("recoil_memory_managament_2020"))return;const o=e.getState().retention.referenceCounts,i=((r=o.get(t))!==null&&r!==void 0?r:0)+n;i===0?pw(e,t):o.set(t,i)}function pw(e,t){if(!me("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),gT(e,t)}function wT(e){if(!me("recoil_memory_managament_2020"))return;const t=e.getState();fw(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function ST(e){return e===void 0?"recoilRoot":e}var Fr={SUSPENSE_TIMEOUT_MS:dT,updateRetainCount:yT,updateRetainCountToZero:pw,releaseScheduledRetainablesNow:wT,retainedByOptionWithDefault:ST};const{unstable_batchedUpdates:_T}=wR;var bT={unstable_batchedUpdates:_T};const{unstable_batchedUpdates:ET}=bT;var xT={unstable_batchedUpdates:ET};const{batchStart:RT}=dn,{unstable_batchedUpdates:CT}=xT;let mp=CT;const OT=e=>{mp=e},kT=()=>mp,TT=e=>{mp(()=>{let t=()=>{};try{t=RT(),e()}finally{t()}})};var Gl={getBatcher:kT,setBatcher:OT,batchUpdates:TT};function*PT(e){for(const t of e)for(const n of t)yield n}var hw=PT;const vw=typeof Window>"u"||typeof window>"u",LT=e=>!vw&&(e===window||e instanceof Window),NT=typeof navigator<"u"&&navigator.product==="ReactNative";var gp={isSSR:vw,isReactNative:NT,isWindow:LT};function AT(e,t){let n;return(...o)=>{n||(n={});const i=t(...o);return Object.hasOwnProperty.call(n,i)||(n[i]=e(...o)),n[i]}}function IT(e,t){let n,r;return(...i)=>{const a=t(...i);return n===a||(n=a,r=e(...i)),r}}function DT(e,t){let n,r;return[(...a)=>{const s=t(...a);return n===s||(n=s,r=e(...a)),r},()=>{n=null}]}var MT={memoizeWithArgsHash:AT,memoizeOneWithArgsHash:IT,memoizeOneWithArgsHashAndInvalidation:DT};const{batchUpdates:Af}=Gl,{initializeNode:$T,peekNodeInfo:UT}=fr,{graph:FT}=_a,{getNextStoreID:jT}=Kl,{DEFAULT_VALUE:BT,recoilValues:Om,recoilValuesForKeys:km}=ft,{AbstractRecoilValue:zT,getRecoilValueAsLoadable:VT,setRecoilValue:Tm,setUnvalidatedRecoilValue:WT}=dn,{updateRetainCount:Ss}=Fr,{setInvalidateMemoizedSnapshot:HT}=tw,{getNextTreeStateVersion:KT,makeEmptyStoreState:qT}=Q1,{isSSR:QT}=gp,{memoizeOneWithArgsHashAndInvalidation:GT}=MT;class Xl{constructor(t,n){ie(this,"_store",void 0),ie(this,"_refCount",1),ie(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),VT(this._store,r))),ie(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),ie(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const a=this._store.getState().currentTree;return km(a.dirtyAtoms)}const o=this._store.getState().knownAtoms,i=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?Om.values():r.isInitialized===!0?km(hw([o,i])):pp(Om.values(),({key:a})=>!o.has(a)&&!i.has(a))}),ie(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),UT(this._store,this._store.getState().currentTree,r))),ie(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new If(this,Af);return r(o),o}),ie(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new If(this,Af);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:jT(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const o=t.graphsByVersion;if(o.has(r))return Oe(o.get(r));const i=FT();return o.set(r,i),i},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw se("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)$T(this._store,r,"get"),Ss(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){QT||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!me("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){me("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function mw(e,t,n=!1){const r=e.getState(),o=n?KT():t.version;return{currentTree:{version:n?o:t.version,stateID:n?o:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(o,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(Hl(r.nodeCleanupFunctions.entries(),([i])=>[i,()=>{}]))}}function XT(e){const t=new Xl(qT());return e!=null?t.map(e):t}const[Pm,gw]=GT((e,t)=>{var n;const r=e.getState(),o=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:Oe(r.previousTree);return new Xl(mw(e,o),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});HT(gw);function YT(e,t="latest"){const n=Pm(e,t);return n.isRetained()?n:(gw(),Pm(e,t))}class If extends Xl{constructor(t,n){super(mw(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),ie(this,"_batch",void 0),ie(this,"set",(r,o)=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{Ss(i,r.key,1),Tm(this.getStore_INTERNAL(),r,o)})}),ie(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{Ss(o,r.key,1),Tm(this.getStore_INTERNAL(),r,BT)})}),ie(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();Af(()=>{for(const[i,a]of r.entries())Ss(o,i,1),WT(o,new zT(i),a)})}),this._batch=n}}var Yl={Snapshot:Xl,MutableSnapshot:If,freshSnapshot:XT,cloneSnapshot:YT},JT=Yl.Snapshot,ZT=Yl.MutableSnapshot,eP=Yl.freshSnapshot,tP=Yl.cloneSnapshot,Jl=Object.freeze({__proto__:null,Snapshot:JT,MutableSnapshot:ZT,freshSnapshot:eP,cloneSnapshot:tP});function nP(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var rP=nP;const{useRef:oP}=ye;function iP(e){const t=oP(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var Lm=iP;const{getNextTreeStateVersion:aP,makeEmptyStoreState:yw}=Q1,{cleanUpNode:sP,getDownstreamNodes:lP,initializeNode:uP,setNodeValue:cP,setUnvalidatedAtomValue_DEPRECATED:fP}=fr,{graph:dP}=_a,{cloneGraph:pP}=_a,{getNextStoreID:ww}=Kl,{createMutableSource:nc,reactMode:Sw}=Sa,{applyAtomValueWrites:hP}=dn,{releaseScheduledRetainablesNow:_w}=Fr,{freshSnapshot:vP}=Jl,{useCallback:mP,useContext:bw,useEffect:Df,useMemo:gP,useRef:yP,useState:wP}=ye;function ni(){throw se("This component must be used inside a component.")}const Ew=Object.freeze({storeID:ww(),getState:ni,replaceState:ni,getGraph:ni,subscribeToTransactions:ni,addTransactionMetadata:ni});let Mf=!1;function Nm(e){if(Mf)throw se("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){me("recoil_memory_managament_2020")&&me("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&_w(e);const n=t.currentTree.version,r=aP();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,pP(Oe(t.graphsByVersion.get(n))))}}const xw=ye.createContext({current:Ew}),Zl=()=>bw(xw),Rw=ye.createContext(null);function SP(){return bw(Rw)}function yp(e,t,n){const r=lP(e,n,n.dirtyAtoms);for(const o of r){const i=t.nodeToComponentSubscriptions.get(o);if(i)for(const[a,[s,l]]of i)l(n)}}function Cw(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[o,i]of t.nodeTransactionSubscriptions)if(r.has(o))for(const[a,s]of i)s(e);for(const[o,i]of t.transactionSubscriptions)i(e);(!Sw().early||t.suspendedComponentResolvers.size>0)&&(yp(e,t,n),t.suspendedComponentResolvers.forEach(o=>o()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(o=>o(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function _P(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,Cw(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):lp("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,me("recoil_memory_managament_2020")&&n==null&&_w(e)}finally{t.commitDepth--}}function bP({setNotifyBatcherOfChange:e}){const t=Zl(),[,n]=wP([]);return e(()=>n({})),Df(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),Df(()=>{ek.enqueueExecution("Batcher",()=>{_P(t.current)})}),null}function EP(e,t){const n=yw();return t({set:(r,o)=>{const i=n.currentTree,a=cP(e,i,r.key,o),s=new Set(a.keys()),l=i.nonvalidatedAtoms.clone();for(const u of s)l.delete(u);n.currentTree={...i,dirtyAtoms:rP(i.dirtyAtoms,s),atomValues:hP(i.atomValues,a),nonvalidatedAtoms:l}},setUnvalidatedAtomValues:r=>{r.forEach((o,i)=>{n.currentTree=fP(n.currentTree,i,o)})}}),n}function xP(e){const t=vP(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let Am=0;function RP({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let o;const i=h=>{const g=o.current.graphsByVersion;if(g.has(h))return Oe(g.get(h));const y=dP();return g.set(h,y),y},a=(h,g)=>{if(g==null){const{transactionSubscriptions:y}=f.current.getState(),b=Am++;return y.set(b,h),{release:()=>{y.delete(b)}}}else{const{nodeTransactionSubscriptions:y}=f.current.getState();y.has(g)||y.set(g,new Map);const b=Am++;return Oe(y.get(g)).set(b,h),{release:()=>{const m=y.get(g);m&&(m.delete(b),m.size===0&&y.delete(g))}}}},s=h=>{Nm(f.current);for(const g of Object.keys(h))Oe(f.current.getState().nextTree).transactionMetadata[g]=h[g]},l=h=>{Nm(f.current);const g=Oe(o.current.nextTree);let y;try{Mf=!0,y=h(g)}finally{Mf=!1}y!==g&&(o.current.nextTree=y,Sw().early&&yp(f.current,o.current,y),Oe(u.current)())},u=yP(null),c=mP(h=>{u.current=h},[u]),f=Lm(()=>n!=null?n:{storeID:ww(),getState:()=>o.current,replaceState:l,getGraph:i,subscribeToTransactions:a,addTransactionMetadata:s});n!=null&&(f.current=n),o=Lm(()=>e!=null?EP(f.current,e):t!=null?xP(t):yw());const d=gP(()=>nc==null?void 0:nc(o,()=>o.current.currentTree.version),[o]);return Df(()=>{const h=f.current;for(const g of new Set(h.getState().knownAtoms))uP(h,g,"get");return()=>{for(const g of h.getState().knownAtoms)sP(h,g)}},[f]),w(xw.Provider,{value:f,children:Z(Rw.Provider,{value:d,children:[w(bP,{setNotifyBatcherOfChange:c}),r]})})}function CP(e){const{override:t,...n}=e,r=Zl();return t===!1&&r.current!==Ew?e.children:w(RP,{...n})}function OP(){return Zl().current.storeID}var On={RecoilRoot:CP,useStoreRef:Zl,useRecoilMutableSource:SP,useRecoilStoreID:OP,notifyComponents_FOR_TESTING:yp,sendEndOfBatchNotifications_FOR_TESTING:Cw};function kP(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var Ow=NP;const{useStoreRef:AP}=On,{SUSPENSE_TIMEOUT_MS:IP}=Fr,{updateRetainCount:ri}=Fr,{RetentionZone:DP}=ql,{useEffect:MP,useRef:$P}=ye,{isSSR:Im}=gp;function UP(e){if(!!me("recoil_memory_managament_2020"))return FP(e)}function FP(e){const n=(Array.isArray(e)?e:[e]).map(a=>a instanceof DP?a:a.key),r=AP();MP(()=>{if(!me("recoil_memory_managament_2020"))return;const a=r.current;if(o.current&&!Im)window.clearTimeout(o.current),o.current=null;else for(const s of n)ri(a,s,1);return()=>{for(const s of n)ri(a,s,-1)}},[r,...n]);const o=$P(),i=Ow(n);if(!Im&&(i===void 0||!TP(i,n))){const a=r.current;for(const s of n)ri(a,s,1);if(i)for(const s of i)ri(a,s,-1);o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;for(const s of n)ri(a,s,-1)},IP)}}var wp=UP;function jP(){return""}var Ea=jP;const{batchUpdates:BP}=Gl,{DEFAULT_VALUE:kw}=ft,{currentRendererSupportsUseSyncExternalStore:zP,reactMode:Uo,useMutableSource:VP,useSyncExternalStore:WP}=Sa,{useRecoilMutableSource:HP,useStoreRef:pn}=On,{AbstractRecoilValue:$f,getRecoilValueAsLoadable:xa,setRecoilValue:ul,setUnvalidatedRecoilValue:KP,subscribeToRecoilValue:ko}=dn,{useCallback:ct,useEffect:To,useMemo:Tw,useRef:Oi,useState:Sp}=ye,{setByAddingToSet:qP}=X1;function _p(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(o=>{n.current.getState().suspendedComponentResolvers.add(o)}):e.state==="hasError"?e.contents:se(`Invalid value of loadable atom "${t.key}"`)}function QP(){const e=Ea(),t=pn(),[,n]=Sp([]),r=Oi(new Set);r.current=new Set;const o=Oi(new Set),i=Oi(new Map),a=ct(l=>{const u=i.current.get(l);u&&(u.release(),i.current.delete(l))},[i]),s=ct((l,u)=>{i.current.has(u)&&n([])},[]);return To(()=>{const l=t.current;Ri(r.current,o.current).forEach(u=>{if(i.current.has(u))return;const c=ko(l,new $f(u),d=>s(d,u),e);i.current.set(u,c),l.getState().nextTree?l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s(l.getState(),u)}):s(l.getState(),u)}),Ri(o.current,r.current).forEach(u=>{a(u)}),o.current=r.current}),To(()=>{const l=i.current;return Ri(r.current,new Set(l.keys())).forEach(u=>{const c=ko(t.current,new $f(u),f=>s(f,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>a(c))},[e,t,a,s]),Tw(()=>{function l(g){return y=>{ul(t.current,g,y)}}function u(g){return()=>ul(t.current,g,kw)}function c(g){var y;r.current.has(g.key)||(r.current=qP(r.current,g.key));const b=t.current.getState();return xa(t.current,g,Uo().early&&(y=b.nextTree)!==null&&y!==void 0?y:b.currentTree)}function f(g){const y=c(g);return _p(y,g,t)}function d(g){return[f(g),l(g)]}function h(g){return[c(g),l(g)]}return{getRecoilValue:f,getRecoilValueLoadable:c,getRecoilState:d,getRecoilStateLoadable:h,getSetRecoilState:l,getResetRecoilState:u}},[r,t])}const GP={current:0};function XP(e){const t=pn(),n=Ea(),r=ct(()=>{var s;const l=t.current,u=l.getState(),c=Uo().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return{loadable:xa(l,e,c),key:e.key}},[t,e]),o=ct(s=>{let l;return()=>{var u,c;const f=s();return(u=l)!==null&&u!==void 0&&u.loadable.is(f.loadable)&&((c=l)===null||c===void 0?void 0:c.key)===f.key?l:(l=f,f)}},[]),i=Tw(()=>o(r),[r,o]),a=ct(s=>{const l=t.current;return ko(l,e,s,n).release},[t,e,n]);return WP(a,i,i).loadable}function YP(e){const t=pn(),n=ct(()=>{var u;const c=t.current,f=c.getState(),d=Uo().early&&(u=f.nextTree)!==null&&u!==void 0?u:f.currentTree;return xa(c,e,d)},[t,e]),r=ct(()=>n(),[n]),o=Ea(),i=ct((u,c)=>{const f=t.current;return ko(f,e,()=>{if(!me("recoil_suppress_rerender_in_callback"))return c();const h=n();l.current.is(h)||c(),l.current=h},o).release},[t,e,o,n]),a=HP();if(a==null)throw se("Recoil hooks must be used in components contained within a component.");const s=VP(a,r,i),l=Oi(s);return To(()=>{l.current=s}),s}function Uf(e){const t=pn(),n=Ea(),r=ct(()=>{var l;const u=t.current,c=u.getState(),f=Uo().early&&(l=c.nextTree)!==null&&l!==void 0?l:c.currentTree;return xa(u,e,f)},[t,e]),o=ct(()=>({loadable:r(),key:e.key}),[r,e.key]),i=ct(l=>{const u=o();return l.loadable.is(u.loadable)&&l.key===u.key?l:u},[o]);To(()=>{const l=ko(t.current,e,u=>{s(i)},n);return s(i),l.release},[n,e,t,i]);const[a,s]=Sp(o);return a.key!==e.key?o().loadable:a.loadable}function JP(e){const t=pn(),[,n]=Sp([]),r=Ea(),o=ct(()=>{var s;const l=t.current,u=l.getState(),c=Uo().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return xa(l,e,c)},[t,e]),i=o(),a=Oi(i);return To(()=>{a.current=i}),To(()=>{const s=t.current,l=s.getState(),u=ko(s,e,f=>{var d;if(!me("recoil_suppress_rerender_in_callback"))return n([]);const h=o();(d=a.current)!==null&&d!==void 0&&d.is(h)||n(h),a.current=h},r);if(l.nextTree)s.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a.current=null,n([])});else{var c;if(!me("recoil_suppress_rerender_in_callback"))return n([]);const f=o();(c=a.current)!==null&&c!==void 0&&c.is(f)||n(f),a.current=f}return u.release},[r,o,e,t]),i}function bp(e){return me("recoil_memory_managament_2020")&&wp(e),{TRANSITION_SUPPORT:Uf,SYNC_EXTERNAL_STORE:zP()?XP:Uf,MUTABLE_SOURCE:YP,LEGACY:JP}[Uo().mode](e)}function Pw(e){const t=pn(),n=bp(e);return _p(n,e,t)}function eu(e){const t=pn();return ct(n=>{ul(t.current,e,n)},[t,e])}function ZP(e){const t=pn();return ct(()=>{ul(t.current,e,kw)},[t,e])}function eL(e){return[Pw(e),eu(e)]}function tL(e){return[bp(e),eu(e)]}function nL(){const e=pn();return(t,n={})=>{BP(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>KP(e.current,new $f(o),r))})}}function Lw(e){return me("recoil_memory_managament_2020")&&wp(e),Uf(e)}function Nw(e){const t=pn(),n=Lw(e);return _p(n,e,t)}function rL(e){return[Nw(e),eu(e)]}var oL={recoilComponentGetRecoilValueCount_FOR_TESTING:GP,useRecoilInterface:QP,useRecoilState:eL,useRecoilStateLoadable:tL,useRecoilValue:Pw,useRecoilValueLoadable:bp,useResetRecoilState:ZP,useSetRecoilState:eu,useSetUnvalidatedAtomValues:nL,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:Lw,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:Nw,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:rL};function iL(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var aL=iL;function sL(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var lL=sL;function uL(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function $m(e){const t=e.atomValues.toMap(),n=ll(aL(t,(r,o)=>{const a=Aw(o).persistence_UNSTABLE;return a!=null&&a.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return cL(e.nonvalidatedAtoms.toMap(),n)}function yL(e){nu(tu(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=$m(r),i=$m(n),a=ll(pL,l=>{var u,c,f,d;return{persistence_UNSTABLE:{type:(u=(c=l.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(f=(d=l.persistence_UNSTABLE)===null||d===void 0?void 0:d.backButton)!==null&&f!==void 0?f:!1}}}),s=lL(r.dirtyAtoms,l=>o.has(l)||i.has(l));e({atomValues:o,previousAtomValues:i,atomInfo:a,modifiedAtoms:s,transactionMetadata:{...r.transactionMetadata}})},[e]))}function wL(e){nu(tu(t=>{const n=cl(t,"latest"),r=cl(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function SL(){const e=Ep(),[t,n]=gL(()=>cl(e.current)),r=Ow(t),o=Dm(),i=Dm();if(nu(tu(s=>n(cl(s)),[])),Iw(()=>{const s=t.retain();if(o.current&&!Mm){var l;window.clearTimeout(o.current),o.current=null,(l=i.current)===null||l===void 0||l.call(i),i.current=null}return()=>{window.setTimeout(s,10)}},[t]),r!==t&&!Mm){if(o.current){var a;window.clearTimeout(o.current),o.current=null,(a=i.current)===null||a===void 0||a.call(i),i.current=null}i.current=t.retain(),o.current=window.setTimeout(()=>{var s;o.current=null,(s=i.current)===null||s===void 0||s.call(i),i.current=null},mL)}return t}function Dw(e,t){var n;const r=e.getState(),o=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,i=t.getStore_INTERNAL().getState().currentTree;fL(()=>{const a=new Set;for(const u of[o.atomValues.keys(),i.atomValues.keys()])for(const c of u){var s,l;((s=o.atomValues.get(c))===null||s===void 0?void 0:s.contents)!==((l=i.atomValues.get(c))===null||l===void 0?void 0:l.contents)&&Aw(c).shouldRestoreFromSnapshots&&a.add(c)}a.forEach(u=>{vL(e,new hL(u),i.atomValues.has(u)?Oe(i.atomValues.get(u)):dL)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function _L(){const e=Ep();return tu(t=>Dw(e.current,t),[e])}var Mw={useRecoilSnapshot:SL,gotoSnapshot:Dw,useGotoRecoilSnapshot:_L,useRecoilTransactionObserver:wL,useTransactionObservation_DEPRECATED:yL,useTransactionSubscription_DEPRECATED:nu};const{peekNodeInfo:bL}=fr,{useStoreRef:EL}=On;function xL(){const e=EL();return({key:t})=>bL(e.current,e.current.getState().currentTree,t)}var RL=xL;const{reactMode:CL}=Sa,{RecoilRoot:OL,useStoreRef:kL}=On,{useMemo:TL}=ye;function PL(){CL().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=kL().current;return TL(()=>{function t({children:n}){return w(OL,{store_INTERNAL:e,children:n})}return t},[e])}var LL=PL;const{loadableWithValue:NL}=wa,{initializeNode:AL}=fr,{DEFAULT_VALUE:IL,getNode:DL}=ft,{copyTreeState:ML,getRecoilValueAsLoadable:$L,invalidateDownstreams:UL,writeLoadableToTreeState:FL}=dn;function Um(e){return DL(e.key).nodeType==="atom"}class jL{constructor(t,n){ie(this,"_store",void 0),ie(this,"_treeState",void 0),ie(this,"_changes",void 0),ie(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!Um(r))throw se("Reading selectors within atomicUpdate is not supported");const o=$L(this._store,r,this._treeState);if(o.state==="hasValue")return o.contents;throw o.state==="hasError"?o.contents:se(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),ie(this,"set",(r,o)=>{if(!Um(r))throw se("Setting selectors within atomicUpdate is not supported");if(typeof o=="function"){const i=this.get(r);this._changes.set(r.key,o(i))}else AL(this._store,r.key,"set"),this._changes.set(r.key,o)}),ie(this,"reset",r=>{this.set(r,IL)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=ML(this._treeState);for(const[n,r]of this._changes)FL(t,n,NL(r));return UL(this._store,t),t}}function BL(e){return t=>{e.replaceState(n=>{const r=new jL(e,n);return t(r),r.newTreeState_INTERNAL()})}}var zL={atomicUpdater:BL},VL=zL.atomicUpdater,$w=Object.freeze({__proto__:null,atomicUpdater:VL});function WL(e,t){if(!e)throw new Error(t)}var HL=WL,fi=HL;const{atomicUpdater:KL}=$w,{batchUpdates:qL}=Gl,{DEFAULT_VALUE:QL}=ft,{useStoreRef:GL}=On,{refreshRecoilValue:XL,setRecoilValue:Fm}=dn,{cloneSnapshot:YL}=Jl,{gotoSnapshot:JL}=Mw,{useCallback:ZL}=ye;class Uw{}const eN=new Uw;function Fw(e,t,n,r){let o=eN,i;if(qL(()=>{const s="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw se(s);const l=Y1({...r!=null?r:{},set:(c,f)=>Fm(e,c,f),reset:c=>Fm(e,c,QL),refresh:c=>XL(e,c),gotoSnapshot:c=>JL(e,c),transact_UNSTABLE:c=>KL(e)(c)},{snapshot:()=>{const c=YL(e);return i=c.retain(),c}}),u=t(l);if(typeof u!="function")throw se(s);o=u(...n)}),o instanceof Uw&&fi(!1),Ce(o))o.finally(()=>{var s;(s=i)===null||s===void 0||s()});else{var a;(a=i)===null||a===void 0||a()}return o}function tN(e,t){const n=GL();return ZL((...r)=>Fw(n.current,e,r),t!=null?[...t,n]:void 0)}var jw={recoilCallback:Fw,useRecoilCallback:tN};const{useStoreRef:nN}=On,{refreshRecoilValue:rN}=dn,{useCallback:oN}=ye;function iN(e){const t=nN();return oN(()=>{const n=t.current;rN(n,e)},[e,t])}var aN=iN;const{atomicUpdater:sN}=$w,{useStoreRef:lN}=On,{useMemo:uN}=ye;function cN(e,t){const n=lN();return uN(()=>(...r)=>{sN(n.current)(i=>{e(i)(...r)})},t!=null?[...t,n]:void 0)}var fN=cN;class dN{constructor(t){ie(this,"value",void 0),this.value=t}}var pN={WrappedValue:dN},hN=pN.WrappedValue,Bw=Object.freeze({__proto__:null,WrappedValue:hN});const{isFastRefreshEnabled:vN}=Sa;class jm extends Error{}class mN{constructor(t){var n,r,o;ie(this,"_name",void 0),ie(this,"_numLeafs",void 0),ie(this,"_root",void 0),ie(this,"_onHit",void 0),ie(this,"_onSet",void 0),ie(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(o=t==null?void 0:t.mapNodeValue)!==null&&o!==void 0?o:i=>i}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const o=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(o)}}set(t,n,r){const o=()=>{var i,a,s,l;let u,c;for(const[b,m]of t){var f,d,h;const p=this._root;if((p==null?void 0:p.type)==="leaf")throw this.invalidCacheError();const v=u;if(u=v?v.branches.get(c):p,u=(f=u)!==null&&f!==void 0?f:{type:"branch",nodeKey:b,parent:v,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==b)throw this.invalidCacheError();v==null||v.branches.set(c,u),r==null||(d=r.onNodeVisit)===null||d===void 0||d.call(r,u),c=this._mapNodeValue(m),this._root=(h=this._root)!==null&&h!==void 0?h:u}const g=u?(i=u)===null||i===void 0?void 0:i.branches.get(c):this._root;if(g!=null&&(g.type!=="leaf"||g.branchKey!==c))throw this.invalidCacheError();const y={type:"leaf",value:n,parent:u,branchKey:c};(a=u)===null||a===void 0||a.branches.set(c,y),this._root=(s=this._root)!==null&&s!==void 0?s:y,this._numLeafs++,this._onSet(y),r==null||(l=r.onNodeVisit)===null||l===void 0||l.call(r,y)};try{o()}catch(i){if(i instanceof jm)this.clear(),o();else throw i}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,o=t.branchKey;for(;r;){var i;if(r.branches.delete(o),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;o=(i=r)===null||i===void 0?void 0:i.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=vN()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw lp(t+(this._name!=null?` - ${this._name}`:"")),new jm}}var gN={TreeCache:mN},yN=gN.TreeCache,zw=Object.freeze({__proto__:null,TreeCache:yN});class wN{constructor(t){var n;ie(this,"_maxSize",void 0),ie(this,"_size",void 0),ie(this,"_head",void 0),ie(this,"_tail",void 0),ie(this,"_map",void 0),ie(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(!!r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const i=this.head(),a={key:t,right:i,left:null,value:n};i?i.left=a:this._tail=a,this._map.set(r,a),this._head=a,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=Oe(this._map.get(n)),o=r.right,i=r.left;o&&(o.left=r.left),i&&(i.right=r.right),r===this.head()&&(this._head=o),r===this.tail()&&(this._tail=i),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var SN={LRUCache:wN},_N=SN.LRUCache,Vw=Object.freeze({__proto__:null,LRUCache:_N});const{LRUCache:bN}=Vw,{TreeCache:EN}=zw;function xN({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new bN({maxSize:t}),o=new EN({name:e,mapNodeValue:n,onHit:i=>{r.set(i,!0)},onSet:i=>{const a=r.tail();r.set(i,!0),a&&o.size()>t&&o.delete(a.key)}});return o}var Bm=xN;function Bt(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw se("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(Ce(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((o,i)=>Bt(o,t,i.toString()))}]`;if(typeof e.toJSON=="function")return Bt(e.toJSON(n),t,n);if(e instanceof Map){const o={};for(const[i,a]of e)o[typeof i=="string"?i:Bt(i,t)]=a;return Bt(o,t,n)}return e instanceof Set?Bt(Array.from(e).sort((o,i)=>Bt(o,t).localeCompare(Bt(i,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?Bt(Array.from(e),t,n):`{${Object.keys(e).filter(o=>e[o]!==void 0).sort().map(o=>`${Bt(o,t)}:${Bt(e[o],t,o)}`).join(",")}}`}function RN(e,t={allowFunctions:!1}){return Bt(e,t)}var ru=RN;const{TreeCache:CN}=zw,Ga={equality:"reference",eviction:"keep-all",maxSize:1/0};function ON({equality:e=Ga.equality,eviction:t=Ga.eviction,maxSize:n=Ga.maxSize}=Ga,r){const o=kN(e);return TN(t,n,o,r)}function kN(e){switch(e){case"reference":return t=>t;case"value":return t=>ru(t)}throw se(`Unrecognized equality policy ${e}`)}function TN(e,t,n,r){switch(e){case"keep-all":return new CN({name:r,mapNodeValue:n});case"lru":return Bm({name:r,maxSize:Oe(t),mapNodeValue:n});case"most-recent":return Bm({name:r,maxSize:1,mapNodeValue:n})}throw se(`Unrecognized eviction policy ${e}`)}var PN=ON;function LN(e){return()=>null}var NN={startPerfBlock:LN};const{isLoadable:AN,loadableWithError:Xa,loadableWithPromise:IN,loadableWithValue:rc}=wa,{WrappedValue:Ww}=Bw,{getNodeLoadable:Ya,peekNodeLoadable:DN,setNodeValue:MN}=fr,{saveDepsToStore:$N}=_a,{DEFAULT_VALUE:UN,getConfigDeletionHandler:FN,getNode:jN,registerNode:zm}=ft,{isRecoilValue:BN}=Oo,{markRecoilValueModified:Vm}=dn,{retainedByOptionWithDefault:zN}=Fr,{recoilCallback:VN}=jw,{startPerfBlock:WN}=NN;class Hw{}const oi=new Hw,ii=[],Ja=new Map,HN=(()=>{let e=0;return()=>e++})();function Kw(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:o}=e,i=e.set!=null?e.set:void 0,a=new Set,s=PN(o!=null?o:{equality:"reference",eviction:"keep-all"},n),l=zN(e.retainedBy_UNSTABLE),u=new Map;let c=0;function f(){return!me("recoil_memory_managament_2020")||c>0}function d(E){return E.getState().knownSelectors.add(n),c++,()=>{c--}}function h(){return FN(n)!==void 0&&!f()}function g(E,D,$,J,V){j(D,J,V),y(E,$)}function y(E,D){_(E,D)&&ae(E),m(D,!0)}function b(E,D){_(E,D)&&(Oe(F(E)).stateVersions.clear(),m(D,!1))}function m(E,D){const $=Ja.get(E);if($!=null){for(const J of $)Vm(J,Oe(t));D&&Ja.delete(E)}}function p(E,D){let $=Ja.get(D);$==null&&Ja.set(D,$=new Set),$.add(E)}function v(E,D,$,J,V,H){return D.then(ee=>{if(!f())throw ae(E),oi;const Y=rc(ee);return g(E,$,V,Y,J),ee}).catch(ee=>{if(!f())throw ae(E),oi;if(Ce(ee))return S(E,ee,$,J,V,H);const Y=Xa(ee);throw g(E,$,V,Y,J),ee})}function S(E,D,$,J,V,H){return D.then(ee=>{if(!f())throw ae(E),oi;H.loadingDepKey!=null&&H.loadingDepPromise===D?$.atomValues.set(H.loadingDepKey,rc(ee)):E.getState().knownSelectors.forEach(de=>{$.atomValues.delete(de)});const Y=N(E,$);if(Y&&Y.state!=="loading"){if((_(E,V)||F(E)==null)&&y(E,V),Y.state==="hasValue")return Y.contents;throw Y.contents}if(!_(E,V)){const de=W(E,$);if(de!=null)return de.loadingLoadable.contents}const[pe,we]=C(E,$,V);if(pe.state!=="loading"&&g(E,$,V,pe,we),pe.state==="hasError")throw pe.contents;return pe.contents}).catch(ee=>{if(ee instanceof Hw)throw oi;if(!f())throw ae(E),oi;const Y=Xa(ee);throw g(E,$,V,Y,J),ee})}function k(E,D,$,J){var V,H,ee,Y;if(_(E,J)||D.version===((V=E.getState())===null||V===void 0||(H=V.currentTree)===null||H===void 0?void 0:H.version)||D.version===((ee=E.getState())===null||ee===void 0||(Y=ee.nextTree)===null||Y===void 0?void 0:Y.version)){var pe,we,de;$N(n,$,E,(pe=(we=E.getState())===null||we===void 0||(de=we.nextTree)===null||de===void 0?void 0:de.version)!==null&&pe!==void 0?pe:E.getState().currentTree.version)}for(const Se of $)a.add(Se)}function C(E,D,$){const J=WN(n);let V=!0,H=!0;const ee=()=>{J(),H=!1};let Y,pe=!1,we;const de={loadingDepKey:null,loadingDepPromise:null},Se=new Map;function rt({key:Et}){const dt=Ya(E,D,Et);switch(Se.set(Et,dt),V||(k(E,D,new Set(Se.keys()),$),b(E,$)),dt.state){case"hasValue":return dt.contents;case"hasError":throw dt.contents;case"loading":throw de.loadingDepKey=Et,de.loadingDepPromise=dt.contents,dt.contents}throw se("Invalid Loadable state")}const pr=Et=>(...dt)=>{if(H)throw se("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&fi(!1),VN(E,Et,dt,{node:t})};try{Y=r({get:rt,getCallback:pr}),Y=BN(Y)?rt(Y):Y,AN(Y)&&(Y.state==="hasError"&&(pe=!0),Y=Y.contents),Ce(Y)?Y=v(E,Y,D,Se,$,de).finally(ee):ee(),Y=Y instanceof Ww?Y.value:Y}catch(Et){Y=Et,Ce(Y)?Y=S(E,Y,D,Se,$,de).finally(ee):(pe=!0,ee())}return pe?we=Xa(Y):Ce(Y)?we=IN(Y):we=rc(Y),V=!1,ce(E,$,Se),k(E,D,new Set(Se.keys()),$),[we,Se]}function N(E,D){let $=D.atomValues.get(n);if($!=null)return $;const J=new Set;try{$=s.get(H=>(typeof H!="string"&&fi(!1),Ya(E,D,H).contents),{onNodeVisit:H=>{H.type==="branch"&&H.nodeKey!==n&&J.add(H.nodeKey)}})}catch(H){throw se(`Problem with cache lookup for selector "${n}": ${H.message}`)}if($){var V;D.atomValues.set(n,$),k(E,D,J,(V=F(E))===null||V===void 0?void 0:V.executionID)}return $}function A(E,D){const $=N(E,D);if($!=null)return ae(E),$;const J=W(E,D);if(J!=null){var V;return((V=J.loadingLoadable)===null||V===void 0?void 0:V.state)==="loading"&&p(E,J.executionID),J.loadingLoadable}const H=HN(),[ee,Y]=C(E,D,H);return ee.state==="loading"?(X(E,H,ee,Y,D),p(E,H)):(ae(E),j(D,ee,Y)),ee}function W(E,D){const $=hw([u.has(E)?[Oe(u.get(E))]:[],Hl(pp(u,([V])=>V!==E),([,V])=>V)]);function J(V){for(const[H,ee]of V)if(!Ya(E,D,H).is(ee))return!0;return!1}for(const V of $){if(V.stateVersions.get(D.version)||!J(V.depValuesDiscoveredSoFarDuringAsyncWork))return V.stateVersions.set(D.version,!0),V;V.stateVersions.set(D.version,!1)}}function F(E){return u.get(E)}function X(E,D,$,J,V){u.set(E,{depValuesDiscoveredSoFarDuringAsyncWork:J,executionID:D,loadingLoadable:$,stateVersions:new Map([[V.version,!0]])})}function ce(E,D,$){if(_(E,D)){const J=F(E);J!=null&&(J.depValuesDiscoveredSoFarDuringAsyncWork=$)}}function ae(E){u.delete(E)}function _(E,D){var $;return D===(($=F(E))===null||$===void 0?void 0:$.executionID)}function L(E){return Array.from(E.entries()).map(([D,$])=>[D,$.contents])}function j(E,D,$){E.atomValues.set(n,D);try{s.set(L($),D)}catch(J){throw se(`Problem with setting cache for selector "${n}": ${J.message}`)}}function O(E){if(ii.includes(n)){const D=`Recoil selector has circular dependencies: ${ii.slice(ii.indexOf(n)).join(" \u2192 ")}`;return Xa(se(D))}ii.push(n);try{return E()}finally{ii.pop()}}function P(E,D){const $=D.atomValues.get(n);return $!=null?$:s.get(J=>{var V;return typeof J!="string"&&fi(!1),(V=DN(E,D,J))===null||V===void 0?void 0:V.contents})}function I(E,D){return O(()=>A(E,D))}function M(E){E.atomValues.delete(n)}function z(E,D){t==null&&fi(!1);for(const J of a){var $;const V=jN(J);($=V.clearCache)===null||$===void 0||$.call(V,E,D)}a.clear(),M(D),s.clear(),Vm(E,t)}return i!=null?t=zm({key:n,nodeType:"selector",peek:P,get:I,set:(D,$,J)=>{let V=!1;const H=new Map;function ee({key:de}){if(V)throw se("Recoil: Async selector sets are not currently supported.");const Se=Ya(D,$,de);if(Se.state==="hasValue")return Se.contents;if(Se.state==="loading"){const rt=`Getting value of asynchronous atom or selector "${de}" in a pending state while setting selector "${n}" is not yet supported.`;throw se(rt)}else throw Se.contents}function Y(de,Se){if(V)throw se("Recoil: Async selector sets are not currently supported.");const rt=typeof Se=="function"?Se(ee(de)):Se;MN(D,$,de.key,rt).forEach((Et,dt)=>H.set(dt,Et))}function pe(de){Y(de,UN)}const we=i({set:Y,get:ee,reset:pe},J);if(we!==void 0)throw Ce(we)?se("Recoil: Async selector sets are not currently supported."):se("Recoil: selector set should be a void function.");return V=!0,H},init:d,invalidate:M,clearCache:z,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):t=zm({key:n,nodeType:"selector",peek:P,get:I,init:d,invalidate:M,clearCache:z,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}Kw.value=e=>new Ww(e);var Po=Kw;const{isLoadable:KN,loadableWithError:oc,loadableWithPromise:ic,loadableWithValue:Kr}=wa,{WrappedValue:qw}=Bw,{peekNodeInfo:qN}=fr,{DEFAULT_VALUE:yr,DefaultValue:Mn,getConfigDeletionHandler:Qw,registerNode:QN,setConfigDeletionHandler:GN}=ft,{isRecoilValue:XN}=Oo,{getRecoilValueAsLoadable:YN,markRecoilValueModified:JN,setRecoilValue:Wm,setRecoilValueLoadable:ZN}=dn,{retainedByOptionWithDefault:eA}=Fr,ai=e=>e instanceof qw?e.value:e;function tA(e){const{key:t,persistence_UNSTABLE:n}=e,r=eA(e.retainedBy_UNSTABLE);let o=0;function i(p){return ic(p.then(v=>(a=Kr(v),v)).catch(v=>{throw a=oc(v),v}))}let a=Ce(e.default)?i(e.default):KN(e.default)?e.default.state==="loading"?i(e.default.contents):e.default:Kr(ai(e.default));a.contents;let s;const l=new Map;function u(p){return p}function c(p,v){const S=v.then(k=>{var C,N;return((N=((C=p.getState().nextTree)!==null&&C!==void 0?C:p.getState().currentTree).atomValues.get(t))===null||N===void 0?void 0:N.contents)===S&&Wm(p,m,k),k}).catch(k=>{var C,N;throw((N=((C=p.getState().nextTree)!==null&&C!==void 0?C:p.getState().currentTree).atomValues.get(t))===null||N===void 0?void 0:N.contents)===S&&ZN(p,m,oc(k)),k});return S}function f(p,v,S){var k;o++;const C=()=>{var F;o--,(F=l.get(p))===null||F===void 0||F.forEach(X=>X()),l.delete(p)};if(p.getState().knownAtoms.add(t),a.state==="loading"){const F=()=>{var X;((X=p.getState().nextTree)!==null&&X!==void 0?X:p.getState().currentTree).atomValues.has(t)||JN(p,m)};a.contents.finally(F)}const N=(k=e.effects)!==null&&k!==void 0?k:e.effects_UNSTABLE;if(N!=null){let _=function(M){if(X&&M.key===t){const z=F;return z instanceof Mn?d(p,v):Ce(z)?ic(z.then(E=>E instanceof Mn?a.toPromise():E)):Kr(z)}return YN(p,M)},L=function(M){return _(M).toPromise()},j=function(M){var z;const E=qN(p,(z=p.getState().nextTree)!==null&&z!==void 0?z:p.getState().currentTree,M.key);return X&&M.key===t&&!(F instanceof Mn)?{...E,isSet:!0,loadable:_(M)}:E},F=yr,X=!0,ce=!1,ae=null;const O=M=>z=>{if(X){const E=_(m),D=E.state==="hasValue"?E.contents:yr;F=typeof z=="function"?z(D):z,Ce(F)&&(F=F.then($=>(ae={effect:M,value:$},$)))}else{if(Ce(z))throw se("Setting atoms to async values is not implemented.");typeof z!="function"&&(ae={effect:M,value:ai(z)}),Wm(p,m,typeof z=="function"?E=>{const D=ai(z(E));return ae={effect:M,value:D},D}:ai(z))}},P=M=>()=>O(M)(yr),I=M=>z=>{var E;const{release:D}=p.subscribeToTransactions($=>{var J;let{currentTree:V,previousTree:H}=$.getState();H||(H=V);const ee=(J=V.atomValues.get(t))!==null&&J!==void 0?J:a;if(ee.state==="hasValue"){var Y,pe,we,de;const Se=ee.contents,rt=(Y=H.atomValues.get(t))!==null&&Y!==void 0?Y:a,pr=rt.state==="hasValue"?rt.contents:yr;((pe=ae)===null||pe===void 0?void 0:pe.effect)!==M||((we=ae)===null||we===void 0?void 0:we.value)!==Se?z(Se,pr,!V.atomValues.has(t)):((de=ae)===null||de===void 0?void 0:de.effect)===M&&(ae=null)}},t);l.set(p,[...(E=l.get(p))!==null&&E!==void 0?E:[],D])};for(const M of N)try{const z=M({node:m,storeID:p.storeID,parentStoreID_UNSTABLE:p.parentStoreID,trigger:S,setSelf:O(M),resetSelf:P(M),onSet:I(M),getPromise:L,getLoadable:_,getInfo_UNSTABLE:j});if(z!=null){var A;l.set(p,[...(A=l.get(p))!==null&&A!==void 0?A:[],z])}}catch(z){F=z,ce=!0}if(X=!1,!(F instanceof Mn)){var W;const M=ce?oc(F):Ce(F)?ic(c(p,F)):Kr(ai(F));M.contents,v.atomValues.set(t,M),(W=p.getState().nextTree)===null||W===void 0||W.atomValues.set(t,M)}}return C}function d(p,v){var S,k;return(S=(k=v.atomValues.get(t))!==null&&k!==void 0?k:s)!==null&&S!==void 0?S:a}function h(p,v){if(v.atomValues.has(t))return Oe(v.atomValues.get(t));if(v.nonvalidatedAtoms.has(t)){if(s!=null)return s;if(n==null)return a;const S=v.nonvalidatedAtoms.get(t),k=n.validator(S,yr);return s=k instanceof Mn?a:Kr(k),s}else return a}function g(){s=void 0}function y(p,v,S){if(v.atomValues.has(t)){const k=Oe(v.atomValues.get(t));if(k.state==="hasValue"&&S===k.contents)return new Map}else if(!v.nonvalidatedAtoms.has(t)&&S instanceof Mn)return new Map;return s=void 0,new Map().set(t,Kr(S))}function b(){return Qw(t)!==void 0&&o<=0}const m=QN({key:t,nodeType:"atom",peek:d,get:h,set:y,init:f,invalidate:g,shouldDeleteConfigOnRelease:b,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return m}function xp(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return XN(n)?nA({...t,default:n}):tA({...t,default:n})}function nA(e){const t=xp({...e,default:yr,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof Mn?r:Oe(e.persistence_UNSTABLE).validator(r,yr)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=Po({key:`${e.key}__withFallback`,get:({get:r})=>{const o=r(t);return o instanceof Mn?e.default:o},set:({set:r},o)=>r(t,o),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return GN(n.key,Qw(e.key)),n}xp.value=e=>new qw(e);var Gw=xp;class rA{constructor(t){var n;ie(this,"_map",void 0),ie(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var oA={MapCache:rA},iA=oA.MapCache,aA=Object.freeze({__proto__:null,MapCache:iA});const{LRUCache:Hm}=Vw,{MapCache:sA}=aA,Za={equality:"reference",eviction:"none",maxSize:1/0};function lA({equality:e=Za.equality,eviction:t=Za.eviction,maxSize:n=Za.maxSize}=Za){const r=uA(e);return cA(t,n,r)}function uA(e){switch(e){case"reference":return t=>t;case"value":return t=>ru(t)}throw se(`Unrecognized equality policy ${e}`)}function cA(e,t,n){switch(e){case"keep-all":return new sA({mapKey:n});case"lru":return new Hm({mapKey:n,maxSize:Oe(t)});case"most-recent":return new Hm({mapKey:n,maxSize:1})}throw se(`Unrecognized eviction policy ${e}`)}var Xw=lA;const{setConfigDeletionHandler:fA}=ft;function dA(e){var t,n;const r=Xw({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i,a;const s=r.get(o);if(s!=null)return s;const{cachePolicyForParams_UNSTABLE:l,...u}=e,c="default"in e?e.default:new Promise(()=>{}),f=Gw({...u,key:`${e.key}__${(i=ru(o))!==null&&i!==void 0?i:"void"}`,default:typeof c=="function"?c(o):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(o):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(o):(a=e.effects)!==null&&a!==void 0?a:e.effects_UNSTABLE});return r.set(o,f),fA(f.key,()=>{r.delete(o)}),f}}var pA=dA;const{setConfigDeletionHandler:hA}=ft;let vA=0;function mA(e){var t,n;const r=Xw({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i;let a;try{a=r.get(o)}catch(d){throw se(`Problem with cache lookup for selector ${e.key}: ${d.message}`)}if(a!=null)return a;const s=`${e.key}__selectorFamily/${(i=ru(o,{allowFunctions:!0}))!==null&&i!==void 0?i:"void"}/${vA++}`,l=d=>e.get(o)(d),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE;let f;if(e.set!=null){const d=e.set;f=Po({key:s,get:l,set:(g,y)=>d(o)(g,y),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else f=Po({key:s,get:l,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(o,f),hA(f.key,()=>{r.delete(o)}),f}}var dr=mA;const gA=dr({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function yA(e){return gA(e)}var wA=yA;const SA=dr({key:"__error",get:e=>()=>{throw se(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function _A(e){return SA(e)}var bA=_A;function EA(e){return e}var xA=EA;const{loadableWithError:Yw,loadableWithPromise:Jw,loadableWithValue:Zw}=wa;function ou(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[o,i]of t.entries())try{n[o]=e(i)}catch(a){r[o]=a}return[n,r]}function RA(e){return e!=null&&!Ce(e)}function iu(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function Ff(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,o)=>({...n,[r]:t[o]}),{})}function vo(e,t,n){const r=n.map((o,i)=>o==null?Zw(t[i]):Ce(o)?Jw(o):Yw(o));return Ff(e,r)}function CA(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const OA=dr({key:"__waitForNone",get:e=>({get:t})=>{const n=iu(e),[r,o]=ou(t,n);return vo(e,r,o)},dangerouslyAllowMutability:!0}),kA=dr({key:"__waitForAny",get:e=>({get:t})=>{const n=iu(e),[r,o]=ou(t,n);return o.some(i=>!Ce(i))?vo(e,r,o):new Promise(i=>{for(const[a,s]of o.entries())Ce(s)&&s.then(l=>{r[a]=l,o[a]=void 0,i(vo(e,r,o))}).catch(l=>{o[a]=l,i(vo(e,r,o))})})},dangerouslyAllowMutability:!0}),TA=dr({key:"__waitForAll",get:e=>({get:t})=>{const n=iu(e),[r,o]=ou(t,n);if(o.every(a=>a==null))return Ff(e,r);const i=o.find(RA);if(i!=null)throw i;return Promise.all(o).then(a=>Ff(e,CA(r,a)))},dangerouslyAllowMutability:!0}),PA=dr({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=iu(e),[r,o]=ou(t,n);return o.every(i=>!Ce(i))?vo(e,r,o):Promise.all(o.map((i,a)=>Ce(i)?i.then(s=>{r[a]=s,o[a]=void 0}).catch(s=>{r[a]=void 0,o[a]=s}):null)).then(()=>vo(e,r,o))},dangerouslyAllowMutability:!0}),LA=dr({key:"__noWait",get:e=>({get:t})=>{try{return Po.value(Zw(t(e)))}catch(n){return Po.value(Ce(n)?Jw(n):Yw(n))}},dangerouslyAllowMutability:!0});var NA={waitForNone:OA,waitForAny:kA,waitForAll:TA,waitForAllSettled:PA,noWait:LA};const{RecoilLoadable:AA}=wa,{DefaultValue:IA}=ft,{RecoilRoot:DA,useRecoilStoreID:MA}=On,{isRecoilValue:$A}=Oo,{retentionZone:UA}=ql,{freshSnapshot:FA}=Jl,{useRecoilState:jA,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:BA,useRecoilStateLoadable:zA,useRecoilValue:VA,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:WA,useRecoilValueLoadable:HA,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:KA,useResetRecoilState:qA,useSetRecoilState:QA}=oL,{useGotoRecoilSnapshot:GA,useRecoilSnapshot:XA,useRecoilTransactionObserver:YA}=Mw,{useRecoilCallback:JA}=jw,{noWait:ZA,waitForAll:eI,waitForAllSettled:tI,waitForAny:nI,waitForNone:rI}=NA;var Rp={DefaultValue:IA,isRecoilValue:$A,RecoilLoadable:AA,RecoilEnv:j1,RecoilRoot:DA,useRecoilStoreID:MA,useRecoilBridgeAcrossReactRoots_UNSTABLE:LL,atom:Gw,selector:Po,atomFamily:pA,selectorFamily:dr,constSelector:wA,errorSelector:bA,readOnlySelector:xA,noWait:ZA,waitForNone:rI,waitForAny:nI,waitForAll:eI,waitForAllSettled:tI,useRecoilValue:VA,useRecoilValueLoadable:HA,useRecoilState:jA,useRecoilStateLoadable:zA,useSetRecoilState:QA,useResetRecoilState:qA,useGetRecoilValueInfo_UNSTABLE:RL,useRecoilRefresher_UNSTABLE:aN,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:KA,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:WA,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:BA,useRecoilCallback:JA,useRecoilTransaction_UNSTABLE:fN,useGotoRecoilSnapshot:GA,useRecoilSnapshot:XA,useRecoilTransactionObserver_UNSTABLE:YA,snapshot_UNSTABLE:FA,useRetain:wp,retentionZone:UA},oI=Rp.RecoilRoot,iI=Rp.atom,_U=Rp.useRecoilState;function aI(e,t){if(e==null)return{};var n=sI(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function sI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Cp=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=aI(e,["color","size"]);return w("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:w("polyline",{points:"20 6 9 17 4 12"})})});Cp.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])};Cp.displayName="Check";const lI=Cp;function uI(e,t){if(e==null)return{};var n=cI(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function cI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Op=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=uI(e,["color","size"]);return Z("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[w("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),w("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})});Op.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])};Op.displayName="EyeOff";const fI=Op;function dI(e,t){if(e==null)return{};var n=pI(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function pI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var kp=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=dI(e,["color","size"]);return Z("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[w("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),w("circle",{cx:"12",cy:"12",r:"3"})]})});kp.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])};kp.displayName="Eye";const hI=kp;function vI(e,t){if(e==null)return{};var n=mI(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function mI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Tp=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=vI(e,["color","size"]);return w("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:w("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"})})});Tp.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])};Tp.displayName="GitHub";const gI=Tp;function yI(e,t){if(e==null)return{};var n=wI(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function wI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Pp=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=yI(e,["color","size"]);return Z("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[w("circle",{cx:"12",cy:"12",r:"10"}),w("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),w("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})});Pp.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])};Pp.displayName="Info";const SI=Pp;function _I(e,t){if(e==null)return{};var n=bI(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function bI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Lp=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=_I(e,["color","size"]);return Z("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[w("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),w("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})});Lp.propTypes={color:ge.exports.string,size:ge.exports.oneOfType([ge.exports.string,ge.exports.number])};Lp.displayName="X";const EI=Lp;function xI(e,t){let n;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function eS(e){return e.replace(/\/$/,"")}function bU(e,t){let n=String(e);for(;n.length1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:Np(e)?2:Ap(e)?3:0}function jf(e,t){return Fo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function LI(e,t){return Fo(e)===2?e.get(t):e[t]}function oS(e,t,n){var r=Fo(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function NI(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Np(e){return MI&&e instanceof Map}function Ap(e){return $I&&e instanceof Set}function gr(e){return e.o||e.t}function Ip(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=FI(e);delete t[gt];for(var n=Up(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=AI),Object.freeze(e),t&&Yi(e,function(n,r){return Dp(r,!0)},!0)),e}function AI(){qt(2)}function Mp(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function un(e){var t=jI[e];return t||qt(18,e),t}function qm(){return Ji}function ac(e,t){t&&(un("Patches"),e.u=[],e.s=[],e.v=t)}function fl(e){Bf(e),e.p.forEach(II),e.p=null}function Bf(e){e===Ji&&(Ji=e.l)}function Qm(e){return Ji={p:[],l:Ji,h:e,m:!0,_:0}}function II(e){var t=e[gt];t.i===0||t.i===1?t.j():t.O=!0}function sc(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||un("ES5").S(t,e,r),r?(n[gt].P&&(fl(t),qt(4)),Ir(e)&&(e=dl(t,e),t.l||pl(t,e)),t.u&&un("Patches").M(n[gt].t,e,t.u,t.s)):e=dl(t,n,[]),fl(t),t.u&&t.v(t.u,t.s),e!==iS?e:void 0}function dl(e,t,n){if(Mp(t))return t;var r=t[gt];if(!r)return Yi(t,function(i,a){return Gm(e,r,t,i,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return pl(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=Ip(r.k):r.o;Yi(r.i===3?new Set(o):o,function(i,a){return Gm(e,r,o,i,a,n)}),pl(e,o,!1),n&&e.u&&un("Patches").R(r,n,e.u,e.s)}return r.o}function Gm(e,t,n,r,o,i){if(Lo(o)){var a=dl(e,o,i&&t&&t.i!==3&&!jf(t.D,r)?i.concat(r):void 0);if(oS(n,r,a),!Lo(a))return;e.m=!1}if(Ir(o)&&!Mp(o)){if(!e.h.F&&e._<1)return;dl(e,o),t&&t.A.l||pl(e,o)}}function pl(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&Dp(t,n)}function lc(e,t){var n=e[gt];return(n?gr(n):e)[t]}function Xm(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function zf(e){e.P||(e.P=!0,e.l&&zf(e.l))}function uc(e){e.o||(e.o=Ip(e.t))}function Vf(e,t,n){var r=Np(t)?un("MapSet").N(t,n):Ap(t)?un("MapSet").T(t,n):e.g?function(o,i){var a=Array.isArray(o),s={i:a?1:0,A:i?i.A:qm(),P:!1,I:!1,D:{},l:i,t:o,k:null,o:null,j:null,C:!1},l=s,u=Wf;a&&(l=[s],u=di);var c=Proxy.revocable(l,u),f=c.revoke,d=c.proxy;return s.k=d,s.j=f,d}(t,n):un("ES5").J(t,n);return(n?n.A:qm()).p.push(r),r}function DI(e){return Lo(e)||qt(22,e),function t(n){if(!Ir(n))return n;var r,o=n[gt],i=Fo(n);if(o){if(!o.P&&(o.i<4||!un("ES5").K(o)))return o.t;o.I=!0,r=Ym(n,i),o.I=!1}else r=Ym(n,i);return Yi(r,function(a,s){o&&LI(o.t,a)===s||oS(r,a,t(s))}),i===3?new Set(r):r}(e)}function Ym(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Ip(e)}var Jm,Ji,$p=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",MI=typeof Map<"u",$I=typeof Set<"u",Zm=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",iS=$p?Symbol.for("immer-nothing"):((Jm={})["immer-nothing"]=!0,Jm),eg=$p?Symbol.for("immer-draftable"):"__$immer_draftable",gt=$p?Symbol.for("immer-state"):"__$immer_state",UI=""+Object.prototype.constructor,Up=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,FI=Object.getOwnPropertyDescriptors||function(e){var t={};return Up(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},jI={},Wf={get:function(e,t){if(t===gt)return e;var n=gr(e);if(!jf(n,t))return function(o,i,a){var s,l=Xm(i,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!Ir(r)?r:r===lc(e.t,t)?(uc(e),e.o[t]=Vf(e.A.h,r,e)):r},has:function(e,t){return t in gr(e)},ownKeys:function(e){return Reflect.ownKeys(gr(e))},set:function(e,t,n){var r=Xm(gr(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=lc(gr(e),t),i=o==null?void 0:o[gt];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(NI(n,o)&&(n!==void 0||jf(e.t,t)))return!0;uc(e),zf(e)}return e.o[t]===n&&typeof n!="number"&&(n!==void 0||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return lc(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,uc(e),zf(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=gr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){qt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){qt(12)}},di={};Yi(Wf,function(e,t){di[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),di.deleteProperty=function(e,t){return di.set.call(this,e,t,void 0)},di.set=function(e,t,n){return Wf.set.call(this,e[0],t,n,e[0])};var BI=function(){function e(n){var r=this;this.g=Zm,this.F=!0,this.produce=function(o,i,a){if(typeof o=="function"&&typeof i!="function"){var s=i;i=o;var l=r;return function(y){var b=this;y===void 0&&(y=s);for(var m=arguments.length,p=Array(m>1?m-1:0),v=1;v1?c-1:0),d=1;d=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var a=un("Patches").$;return Lo(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),yt=new BI,zI=yt.produce;yt.produceWithPatches.bind(yt);var VI=yt.setAutoFreeze.bind(yt);yt.setUseProxies.bind(yt);yt.applyPatches.bind(yt);yt.createDraft.bind(yt);yt.finishDraft.bind(yt);VI(!1);const{createContext:Fp,memo:WI,useMemo:HI,useRef:KI,useEffect:qI,useCallback:tg,useContext:Hf,useState:QI}=ye,aS=Fp(null),sS=Fp(null),lS=Fp(null);function GI(){return Hf(lS)}function XI({initialState:e,actions:t={},children:n}){const r=KI(e),[o,i]=QI(e),a=tg(()=>r.current,[]);qI(()=>{},[a]);const s=tg((u,c)=>{if(typeof u=="function")return u(s,a);const f=zI(a(),c);f!==r.current&&(r.current=f,i(f))},[a]),l=HI(()=>uS(t,s),[t,s]);return w(aS.Provider,{value:o,children:w(sS.Provider,{value:s,children:w(lS.Provider,{value:l,children:n})})})}function kn(e){return t=>{const n=WI(t);function r(o){const i=Hf(aS),a=Hf(sS),s=e(i,o),l={dispatch:a,...o,...s};return w(n,{...l})}return r}}function YI(e,t){return function(...n){return t(e.apply(this,n))}}function uS(e,t){const n={};for(const r in e){const o=e[r];typeof o=="function"?n[r]=YI(o,t):typeof o=="object"&&(n[r]=uS(o,t))}return n}const cS="yacd.haishan.me";function JI(){try{const e=localStorage.getItem(cS);return e?JSON.parse(e):void 0}catch{return}}function jr(e){try{const t=JSON.stringify(e);localStorage.setItem(cS,t)}catch{}}const fS="/configs";async function dS(e){const{url:t,init:n}=_t(e);return await fetch(t+fS,n)}function ZI(e){return"socks-port"in e&&(e["socket-port"]=e["socks-port"]),e}async function eD(e,t){const{url:n,init:r}=_t(e),o=JSON.stringify(ZI(t));return await fetch(n+fS,{...r,body:o,method:"PATCH"})}const pS="/traffic",tD=new TextDecoder("utf-8"),es=150,Zi={labels:Array(es).fill(0),up:Array(es),down:Array(es),size:es,subscribers:[],appendData(e){this.up.shift(),this.down.shift(),this.labels.shift();const t=Date.now();this.up.push(e.up),this.down.push(e.down),this.labels.push(t),this.subscribers.forEach(n=>n(e))},subscribe(e){return this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}}};let so=!1,ts="";function Kf(e){Zi.appendData(JSON.parse(e))}function hS(e){return e.read().then(({done:t,value:n})=>{const r=tD.decode(n,{stream:!t});ts+=r;const o=ts.split(` -`),i=o[o.length-1];for(let a=0;a{if(r.ok){const o=r.body.getReader();hS(o)}else so=!1},r=>{console.log("fetch /traffic error",r),so=!1}),Zi}function ng(e){return t=>{t(`openModal:${e}`,n=>{n.modals[e]=!0})}}function rD(e){return t=>{t(`closeModal:${e}`,n=>{n.modals[e]=!1})}}const oD={apiConfig:!1},xU=e=>e.configs.configs,iD=e=>e.configs.haveFetchedConfig,RU=e=>e.configs.configs["log-level"];function vS(e){return async(t,n)=>{let r;try{r=await dS(e)}catch{t(ng("apiConfig"));return}if(!r.ok){console.log("Error fetch configs",r.statusText),t(ng("apiConfig"));return}const o=await r.json();t("store/configs#fetchConfigs",a=>{a.configs.configs=o}),iD(n())?jp(e):t(aD())}}function aD(){return e=>{e("store/configs#markHaveFetchedConfig",t=>{t.configs.haveFetchedConfig=!0})}}function CU(e,t){return async n=>{eD(e,t).then(r=>{r.ok===!1&&console.log("Error update configs",r.statusText)},r=>{throw console.log("Error update configs",r),r}).then(()=>{n(vS(e))}),n("storeConfigsOptimisticUpdateConfigs",r=>{r.configs.configs={...r.configs.configs,...t}})}}const sD={configs:{port:7890,"socks-port":7891,"redir-port":0,"allow-lan":!1,mode:"Rule","log-level":"uninit"},haveFetchedConfig:!1},jo=e=>{const t=e.app.selectedClashAPIConfigIndex;return e.app.clashAPIConfigs[t]},mS=e=>e.app.selectedClashAPIConfigIndex,Bp=e=>e.app.clashAPIConfigs,zp=e=>e.app.theme,lD=e=>e.app.selectedChartStyleIndex,gS=e=>e.app.latencyTestUrl,OU=e=>e.app.collapsibleIsOpen,kU=e=>e.app.proxySortBy,TU=e=>e.app.hideUnavailableProxies,uD=e=>e.app.autoCloseOldConns,PU=e=>e.app.logStreamingPaused,cD=xI(jr,600);function Vp(e,{baseURL:t,secret:n,metaLabel:r}){const o=Bp(e());for(let i=0;i{if(Vp(n,e))return;const o={...e,addedAt:Date.now()};t("addClashAPIConfig",i=>{i.app.clashAPIConfigs.push(o)}),jr(n().app)}}function dD(e){return async(t,n)=>{const r=Vp(n,e);t("removeClashAPIConfig",o=>{o.app.clashAPIConfigs.splice(r,1)}),jr(n().app)}}function pD(e){return async(t,n)=>{const r=Vp(n,e);mS(n())!==r&&t("selectClashAPIConfig",i=>{i.app.selectedClashAPIConfigIndex=r}),jr(n().app);try{window.location.reload()}catch{}}}const cc=document.querySelector("html");function fc(e,t){const n=document.createElement("meta");n.setAttribute("name","theme-color"),n.setAttribute("content",e),t&&n.setAttribute("media",t),document.head.appendChild(n)}function hD(e){const t=Array.from(document.querySelectorAll("meta[name=theme-color]"));let n;for(const r of t)r.getAttribute("media")?document.head.removeChild(r):n=r;if(e==="auto")if(fc("#eeeeee","(prefers-color-scheme: light)"),fc("#202020","(prefers-color-scheme: dark)"),n)document.head.removeChild(n);else return;else{const r=e==="light"?"#eeeeee":"#202020";n?n.setAttribute("content",r):fc(r)}}function yS(e="dark"){e==="auto"?cc.setAttribute("data-theme","auto"):e==="dark"?cc.setAttribute("data-theme","dark"):cc.setAttribute("data-theme","light"),hD(e)}function vD(e="auto"){return(t,n)=>{zp(n())!==e&&(yS(e),t("storeSwitchTheme",o=>{o.app.theme=e}),jr(n().app))}}function mD(e){return(t,n)=>{t("appSelectChartStyleIndex",r=>{r.app.selectedChartStyleIndex=Number(e)}),jr(n().app)}}function rg(e,t){return(n,r)=>{n("appUpdateAppConfig",o=>{o.app[e]=t}),jr(r().app)}}function gD(e,t,n){return(r,o)=>{r("updateCollapsibleIsOpen",i=>{i.app.collapsibleIsOpen[`${e}:${t}`]=n}),cD(o().app)}}var Pg,Lg;const yD={baseURL:(Lg=(Pg=document.getElementById("app"))==null?void 0:Pg.getAttribute("data-base-url"))!=null?Lg:"http://127.0.0.1:9090",secret:"",addedAt:0},wD={selectedClashAPIConfigIndex:0,clashAPIConfigs:[yD],latencyTestUrl:"http://www.gstatic.com/generate_204",selectedChartStyleIndex:0,theme:"dark",collapsibleIsOpen:{},proxySortBy:"Natural",hideUnavailableProxies:!1,autoCloseOldConns:!1,logStreamingPaused:!1};function SD(){const{search:e}=window.location,t={};if(typeof e!="string"||e==="")return t;const n=e.replace(/^\?/,"").split("&");for(let r=0;rOI("/version",e.apiConfig));return Z(Nt,{children:[w(rS,{title:"About"}),t&&t.version?w(og,{name:"Clash",version:t.version,link:"https://github.com/Dreamacro/clash"}):null,w(og,{name:"Yacd",version:"0.3.8",link:"https://github.com/haishanh/yacd"})]})}const CD=e=>({apiConfig:jo(e)}),OD=kn(CD)(RD),kD="_loading_74j3j_1",TD="_spinner_74j3j_9",PD="_rotate_74j3j_1",ig={loading:kD,spinner:TD,rotate:PD},wS=({height:e})=>{const t=e?{height:e}:{};return w("div",{className:ig.loading,style:t,children:w("div",{className:ig.spinner})})},LD=e=>({apiConfig:jo(e),apiConfigs:Bp(e)});function ND({apiConfig:e,apiConfigs:t}){return R.exports.useEffect(()=>{let n="yacd";if(t.length>1)try{n=`${e.metaLabel||new URL(e.baseURL).host} - yacd`}catch{}document.title=n}),w(Nt,{})}const AD=kn(LD)(ND),ID=new y1,DD=new FC({queryCache:ID,defaultOptions:{queries:{suspense:!0}}});var hl="NOT_FOUND";function MD(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:hl},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function $D(e,t){var n=[];function r(s){var l=n.findIndex(function(c){return t(s,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return hl}function o(s,l){r(s)===hl&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function i(){return n}function a(){n=[]}return{get:r,put:o,getEntries:i,clear:a}}var UD=function(t,n){return t===n};function FD(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,i=0;i1?t-1:0),r=1;re.logs.logs,_S=e=>e.logs.tail,WD=e=>e.logs.searchText,LU=VD(SS,_S,WD,(e,t,n)=>{const r=[];for(let o=t;o>=0;o--)r.push(e[o]);if(e.length===qf)for(let o=qf-1;o>t;o--)r.push(e[o]);return n===""?r:r.filter(o=>o.payload.toLowerCase().indexOf(n)>=0)});function NU(e){return t=>{t("logsUpdateSearchText",n=>{n.logs.searchText=e.toLowerCase()})}}function AU(e){return(t,n)=>{const r=n(),o=SS(r),i=_S(r),a=i>=qf-1?0:i+1;o[a]=e,t("logsAppendLog",s=>{s.logs.tail=a})}}const HD={searchText:"",logs:[],tail:-1},au="/connections",_s=[];function KD(e){let t;try{t=JSON.parse(e)}catch{console.log("JSON.parse error",JSON.parse(e))}_s.forEach(n=>n(t))}let pc;function qD(e,t){if(pc===1&&t)return ag(t);pc=1;const n=nS(e,au),r=new WebSocket(n);if(r.addEventListener("error",()=>pc=3),r.addEventListener("message",o=>KD(o.data)),t)return ag(t)}function ag(e){return _s.push(e),function(){const n=_s.indexOf(e);_s.splice(n,1)}}async function IU(e){const{url:t,init:n}=_t(e);return await fetch(t+au,{...n,method:"DELETE"})}async function QD(e){const{url:t,init:n}=_t(e);return await fetch(t+au,{...n})}async function GD(e,t){const{url:n,init:r}=_t(e),o=`${n}${au}/${t}`;return await fetch(o,{...r,method:"DELETE"})}const Wp="/proxies";async function XD(e){const{url:t,init:n}=_t(e);return await(await fetch(t+Wp,n)).json()}async function YD(e,t,n){const r={name:n},{url:o,init:i}=_t(e),a=encodeURIComponent(t),s=`${o}${Wp}/${a}`;return await fetch(s,{...i,method:"PUT",body:JSON.stringify(r)})}async function bS(e,t,n="http://www.gstatic.com/generate_204"){const{url:r,init:o}=_t(e),i=`timeout=5000&url=${encodeURIComponent(n)}`,a=`${r}${Wp}/${encodeURIComponent(t)}/delay?${i}`;return await fetch(a,o)}async function JD(e){const{url:t,init:n}=_t(e),r=await fetch(t+"/providers/proxies",n);return r.status===404?{providers:{}}:await r.json()}async function ES(e,t){const{url:n,init:r}=_t(e),o={...r,method:"PUT"};return await fetch(n+"/providers/proxies/"+encodeURIComponent(t),o)}async function ZD(e,t){const{url:n,init:r}=_t(e),o={...r,method:"GET"};return await fetch(n+"/providers/proxies/"+encodeURIComponent(t)+"/healthcheck",o)}const eM={proxies:{},delay:{},groupNames:[],showModalClosePrevConns:!1},xS=()=>null,tM=["Direct","Reject","Relay","Selector","Fallback","URLTest","LoadBalance","Unknown"],RS=e=>e.proxies.proxies,nM=e=>e.proxies.delay,DU=e=>e.proxies.groupNames,rM=e=>e.proxies.proxyProviders||[],oM=e=>e.proxies.dangleProxyNames,MU=e=>e.proxies.showModalClosePrevConns;function iM(e,t){const n={};for(const r of e){const i=(t(r)||{history:[]}).history,a=i[i.length-1];a&&typeof a.delay=="number"&&(n[r]={number:a.delay})}return n}function Bo(e){return async(t,n)=>{const[r,o]=await Promise.all([XD(e),JD(e)]),{proxyProviders:i,providerProxyRecord:a}=dM(o.providers),s={...a,...r.proxies},[l,u]=fM(s),c={...nM(n()),...iM(Object.keys(s),d=>s[d])},f=[];for(const d of u)a[d]||f.push(d);t("store/proxies#fetchProxies",d=>{d.proxies.proxies=s,d.proxies.groupNames=l,d.proxies.dangleProxyNames=f,d.proxies.delay=c,d.proxies.proxyProviders=i})}}function $U(e,t){return async n=>{try{await ES(e,t)}catch{}n(Bo(e))}}function UU(e,t){return async n=>{for(let r=0;r{await Hp(e,t),await n(Bo(e))}}async function aM(e,t,n){const r=await QD(e);r.ok||console.log("unable to fetch all connections",r.statusText);const i=(await r.json()).connections,a=[];for(const s of i)s.chains.indexOf(t)>-1&&s.chains.indexOf(n)<0&&a.push(s.id);await Promise.all(a.map(s=>GD(e,s).catch(xS)))}function sM(e,t,n){const r=[n,t];let o,i=n;for(;(o=e[i])&&o.now;)r.unshift(o.now),i=o.now;return r}async function lM(e,t,n,r,o){try{if((await YD(n,r,o)).ok===!1)throw new Error("failed to switch proxy: res.statusText")}catch(a){throw console.log(a,"failed to swith proxy"),a}if(e(Bo(n)),uD(t())){const a=RS(t());OS(n,a,{groupName:r,itemName:o})}}function CS(){return e=>{e("closeModalClosePrevConns",t=>{t.proxies.showModalClosePrevConns=!1})}}function OS(e,t,n){const r=sM(t,n.groupName,n.itemName);aM(e,n.groupName,r[0])}function uM(e){return async(t,n)=>{var a;const r=n(),o=(a=r.proxies.switchProxyCtx)==null?void 0:a.to;if(!o){t(CS());return}const i=r.proxies.proxies;OS(e,i,o),t("closePrevConnsAndTheModal",s=>{s.proxies.showModalClosePrevConns=!1,s.proxies.switchProxyCtx=void 0})}}function jU(e,t,n){return async(r,o)=>{lM(r,o,e,t,n).catch(xS),r("store/proxies#switchProxy",i=>{const a=i.proxies.proxies;a[t]&&a[t].now&&(a[t].now=n)})}}function cM(e,t){return async(n,r)=>{const o=RS(r()),i=gS(r()),a=new Map,s=new Map,l=t.map(u=>{const c=o[u];return c.__provider?c.__provider?s.get(c.__provider)?void 0:(s.set(c.__provider,!0),Hp(e,c.__provider)):void 0:a.get(u)?void 0:(a.set(u,!0),bS(e,u,i))});await Promise.all(l),await n(Bo(e))}}function BU(e){return async(t,n)=>{const r=oM(n()),o=gS(n());await Promise.all(r.map(a=>bS(e,a,o)));const i=rM(n());for(const a of i)await Hp(e,a.name);await t(Bo(e))}}function fM(e){let t=[],n;const r=[];for(const o in e){const i=e[o];i.all&&Array.isArray(i.all)?(t.push(o),o==="GLOBAL"&&(n=Array.from(i.all))):tM.indexOf(i.type)<0&&r.push(o)}return n&&(n.push("GLOBAL"),t=t.map(o=>[n.indexOf(o),o]).sort((o,i)=>o[0]-i[0]).map(o=>o[1])),[t,r]}function dM(e){const t=Object.keys(e),n=[],r={};for(let o=0;on(o=>!o),[]);return[t,r]}function VU(e){const[t,n]=TS(e);return{value:t,set:n}}const yM="_ul_1ore2_1",wM="_li_1ore2_10",SM="_right_1ore2_21",_M="_close_1ore2_32",bM="_eye_1ore2_39",EM="_url_1ore2_54",xM="_secret_1ore2_55",RM="_metaLabel_1ore2_56",CM="_btn_1ore2_62",rn={ul:yM,li:wM,right:SM,close:_M,eye:bM,url:EM,secret:xM,metaLabel:RM,btn:CM},OM=e=>({apiConfigs:Bp(e),selectedClashAPIConfigIndex:mS(e)}),kM=kn(OM)(TM);function TM({apiConfigs:e,selectedClashAPIConfigIndex:t}){const{app:{removeClashAPIConfig:n,selectClashAPIConfig:r}}=GI(),o=R.exports.useCallback(a=>{n(a)},[n]),i=R.exports.useCallback(a=>{r(a)},[r]);return w(Nt,{children:w("ul",{className:rn.ul,children:e.map((a,s)=>w("li",{className:ar(rn.li,{[rn.isSelected]:s===t}),children:w(PM,{disableRemove:s===t,conf:a,onRemove:o,onSelect:i})},a.baseURL+a.secret+a.metaLabel))})})}function PM({conf:e,disableRemove:t,onRemove:n,onSelect:r}){const[o,i]=gM(),a=o?fI:hI,s=R.exports.useCallback(l=>{l.stopPropagation()},[]);return Z(Nt,{children:[w(sg,{disabled:t,onClick:()=>n(e),className:rn.close,children:w(EI,{size:20})}),Z("div",{className:rn.right,children:[e.metaLabel?Z(Nt,{children:[w("span",{className:rn.metaLabel,tabIndex:0,role:"button",onClick:()=>r(e),onKeyUp:s,children:e.metaLabel}),w("span",{})]}):null,w("span",{className:rn.url,tabIndex:0,role:"button",onClick:()=>r(e),onKeyUp:s,children:e.baseURL}),w("span",{}),e.secret?Z(Nt,{children:[w("span",{className:rn.secret,children:o?e.secret:"***"}),w(sg,{onClick:i,className:rn.eye,children:w(a,{size:16})})]}):null]})]})}function sg({children:e,onClick:t,className:n,disabled:r}){return w("button",{disabled:r,className:ar(n,rn.btn),onClick:t,children:e})}const LM="_root_zwtea_1",NM="_header_zwtea_5",AM="_icon_zwtea_10",IM="_body_zwtea_20",DM="_hostnamePort_zwtea_24",MM="_error_zwtea_36",$M="_footer_zwtea_42",Ln={root:LM,header:NM,icon:AM,body:IM,hostnamePort:DM,error:MM,footer:$M},UM="_btn_lzu00_1",FM="_circular_lzu00_27",jM="_minimal_lzu00_30",BM="_btnStart_lzu00_48",zM="_loadingContainer_lzu00_55",pi={btn:UM,circular:FM,minimal:jM,btnStart:BM,loadingContainer:zM},VM="_sectionNameType_8lri2_1",WM="_loadingDot_8lri2_66",HM="_dot2_8lri2_1",KM="_dot1_8lri2_1",qM="_dot3_8lri2_1",PS={sectionNameType:VM,loadingDot:WM,dot2:HM,dot1:KM,dot3:qM};function WU({name:e,type:t}){return Z("h2",{className:PS.sectionNameType,children:[w("span",{children:e}),w("span",{children:t})]})}function QM(){return w("span",{className:PS.loadingDot})}const{forwardRef:GM,useCallback:XM}=At;function YM(e,t){const{onClick:n,disabled:r=!1,isLoading:o,kind:i="primary",className:a,children:s,label:l,text:u,start:c,...f}=e,d={children:s,label:l,text:u,start:c},h=XM(y=>{o||n&&n(y)},[o,n]),g=ar(pi.btn,{[pi.minimal]:i==="minimal",[pi.circular]:i==="circular"},a);return w("button",{className:g,ref:t,onClick:h,disabled:r,...f,children:o?Z(Nt,{children:[w("span",{style:{display:"inline-flex",opacity:0},children:w(lg,{...d})}),w("span",{className:pi.loadingContainer,children:w(QM,{})})]}):w(lg,{...d})})}function lg({children:e,label:t,text:n,start:r}){return Z(Nt,{children:[r?w("span",{className:pi.btnStart,children:typeof r=="function"?r():r}):null,e||t||n]})}const JM=GM(YM),ZM="_root_1or8t_1",e3="_floatAbove_1or8t_32",ug={root:ZM,floatAbove:e3},{useCallback:t3}=At;function hc({id:e,label:t,value:n,onChange:r,...o}){const i=t3(a=>r(a),[r]);return Z("div",{className:ug.root,children:[w("input",{id:e,value:n,onChange:i,...o}),w("label",{htmlFor:e,className:ug.floatAbove,children:t})]})}const n3="_path_r8pm3_1",r3="_dash_r8pm3_1",o3={path:n3,dash:r3};function Kp({width:e=320,height:t=320,animate:n=!1,c0:r="currentColor",stroke:o="#eee",eye:i="#eee",mouth:a="#eee"}){const s=ar({[o3.path]:n});return w("svg",{width:e,height:t,viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",children:Z("g",{fill:"none",fillRule:"evenodd",children:[w("path",{d:"M71.689 53.055c9.23-1.487 25.684 27.263 41.411 56.663 18.572-8.017 71.708-7.717 93.775 0 4.714-15.612 31.96-57.405 41.626-56.663 3.992.088 13.07 31.705 23.309 94.96 2.743 16.949 7.537 47.492 14.38 91.63-42.339 17.834-84.37 26.751-126.095 26.751-41.724 0-83.756-8.917-126.095-26.751C52.973 116.244 65.536 54.047 71.689 53.055z",stroke:o,strokeWidth:"4",strokeLinecap:"round",fill:r,className:s}),w("circle",{fill:i,cx:"216.5",cy:"181.5",r:"14.5"}),w("circle",{fill:i,cx:"104.5",cy:"181.5",r:"14.5"}),w("g",{stroke:a,strokeLinecap:"round",strokeWidth:"4",children:w("path",{d:"M175.568 218.694c-2.494 1.582-5.534 2.207-8.563 1.508-3.029-.7-5.487-2.594-7.035-5.11M143.981 218.694c2.494 1.582 5.534 2.207 8.563 1.508 3.03-.7 5.488-2.594 7.036-5.11"})})]})})}const{useState:rs,useRef:cg,useCallback:vc,useEffect:i3}=At,LS=0,a3=()=>{},s3=e=>({apiConfig:jo(e)});function l3({dispatch:e}){const[t,n]=rs(""),[r,o]=rs(""),[i,a]=rs(""),[s,l]=rs(""),u=cg(!1),c=cg(null),f=vc(y=>{u.current=!0,l("");const b=y.target,{name:m}=b,p=b.value;switch(m){case"baseURL":n(p);break;case"secret":o(p);break;case"metaLabel":a(p);break;default:throw new Error(`unknown input name ${m}`)}},[]),d=vc(()=>{u3({baseURL:t,secret:r}).then(y=>{y[0]!==LS?l(y[1]):e(fD({baseURL:t,secret:r,metaLabel:i}))})},[t,r,i,e]),h=vc(y=>{y.target instanceof Element&&(!y.target.tagName||y.target.tagName.toUpperCase()!=="INPUT")||y.key==="Enter"&&d()},[d]),g=async()=>{(await fetch("/")).json().then(b=>{b.hello==="clash"&&n(window.location.origin)},a3)};return i3(()=>{g()},[]),Z("div",{className:Ln.root,ref:c,onKeyDown:h,children:[w("div",{className:Ln.header,children:w("div",{className:Ln.icon,children:w(Kp,{width:160,height:160,stroke:"var(--stroke)"})})}),Z("div",{className:Ln.body,children:[Z("div",{className:Ln.hostnamePort,children:[w(hc,{id:"baseURL",name:"baseURL",label:"API Base URL",type:"text",placeholder:"http://127.0.0.1:9090",value:t,onChange:f}),w(hc,{id:"secret",name:"secret",label:"Secret(optional)",value:r,type:"text",onChange:f})]}),s?w("div",{className:Ln.error,children:s}):null,w("div",{className:Ln.label,children:w(hc,{id:"metaLabel",name:"metaLabel",label:"Label(optional)",type:"text",placeholder:"",value:i,onChange:f})})]}),w("div",{className:Ln.footer,children:w(JM,{label:"Add",onClick:d})}),w("div",{style:{height:20}}),w(kM,{})]})}const NS=kn(s3)(l3);async function u3(e){try{new URL(e.baseURL)}catch{if(e.baseURL){const n=e.baseURL.substring(0,7);if(n!=="http://"&&n!=="https:/")return[1,"Must starts with http:// or https://"]}return[1,"Invalid URL"]}try{const t=await dS(e);return t.status>399?[1,t.statusText]:[LS]}catch{return[1,"Failed to connect"]}}/** - * @reach/utils v0.18.0 - * - * Copyright (c) 2018-2022, React Training LLC - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function AS(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Ne(e,t){return n=>{if(e&&e(n),!n.defaultPrevented)return t(n)}}function fg(e){return typeof e=="boolean"}function vl(e){return!!(e&&{}.toString.call(e)=="[object Function]")}function c3(e){return typeof e=="string"}function f3(e,t){if(e!=null)if(vl(e))e(t);else try{e.current=t}catch{throw new Error(`Cannot assign value "${t}" to ref "${e}"`)}}function Br(...e){return R.exports.useCallback(t=>{for(let n of e)f3(n,t)},e)}function sr(e){return AS()?e?e.ownerDocument:document:null}function d3(e,t){let n=R.exports.createContext(t);function r(i){let{children:a,...s}=i,l=R.exports.useMemo(()=>s,Object.values(s));return w(n.Provider,{value:l,children:a})}function o(i){let a=R.exports.useContext(n);if(a)return a;if(t)return t;throw Error(`${i} must be rendered inside of a ${e} component.`)}return n.displayName=`${e}Context`,r.displayName=`${e}Provider`,[r,o]}function p3(e){var r,o;let t=sr(e),n=t.defaultView||window;return t?{width:(r=t.documentElement.clientWidth)!=null?r:n.innerWidth,height:(o=t.documentElement.clientHeight)!=null?o:n.innerHeight}:{width:0,height:0}}function bs(e){return"which"in e?e.which===3:"button"in e?e.button===2:!1}function No(...e){return e.filter(t=>t!=null).join("--")}function qp(){}function IS(){let[,e]=R.exports.useState(Object.create(null));return R.exports.useCallback(()=>{e(Object.create(null))},[])}var mo=AS()?R.exports.useLayoutEffect:R.exports.useEffect;function mc(e){const t=R.exports.useRef(null);return R.exports.useEffect(()=>{t.current=e},[e]),t.current}function h3(e,t){let[n,r]=R.exports.useState(t),o=R.exports.useCallback(i=>{e.current=i,r(i)},[]);return[n,o]}var v3=({children:e,type:t="reach-portal",containerRef:n})=>{let r=R.exports.useRef(null),o=R.exports.useRef(null),i=IS();return R.exports.useEffect(()=>{n!=null&&(typeof n!="object"||!("current"in n)?console.warn("@reach/portal: Invalid value passed to the `containerRef` of a `Portal`. The portal will be appended to the document body, but if you want to attach it to another DOM node you must pass a valid React ref object to `containerRef`."):n.current==null&&console.warn("@reach/portal: A ref was passed to the `containerRef` prop of a `Portal`, but no DOM node was attached to it. Be sure to pass the ref to a DOM component.\n\nIf you are forwarding the ref from another component, be sure to use the React.forwardRef API. See https://reactjs.org/docs/forwarding-refs.html."))},[n]),mo(()=>{if(!r.current)return;let a=r.current.ownerDocument,s=(n==null?void 0:n.current)||a.body;return o.current=a==null?void 0:a.createElement(t),s.appendChild(o.current),i(),()=>{o.current&&s&&s.removeChild(o.current)}},[t,i,n]),o.current?aa.exports.createPortal(e,o.current):w("span",{ref:r})},Qp=({unstable_skipInitialRender:e,...t})=>{let[n,r]=R.exports.useState(!1);return R.exports.useEffect(()=>{e&&r(!0)},[e]),e&&!n?null:w(v3,{...t})};Qp.displayName="Portal";var m3=["bottom","height","left","right","top","width"],g3=function(t,n){return t===void 0&&(t={}),n===void 0&&(n={}),m3.some(function(r){return t[r]!==n[r]})},Nn=new Map,DS,y3=function e(){var t=[];Nn.forEach(function(n,r){var o=r.getBoundingClientRect();g3(o,n.rect)&&(n.rect=o,t.push(n))}),t.forEach(function(n){n.callbacks.forEach(function(r){return r(n.rect)})}),DS=window.requestAnimationFrame(e)};function w3(e,t){return{observe:function(){var r=Nn.size===0;Nn.has(e)?Nn.get(e).callbacks.push(t):Nn.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),r&&y3()},unobserve:function(){var r=Nn.get(e);if(r){var o=r.callbacks.indexOf(t);o>=0&&r.callbacks.splice(o,1),r.callbacks.length||Nn.delete(e),Nn.size||cancelAnimationFrame(DS)}}}}function ml(e,t,n){var d;let r,o;fg(t)?r=t:(r=(d=t==null?void 0:t.observe)!=null?d:!0,o=t==null?void 0:t.onChange),vl(n)&&(o=n),R.exports.useEffect(()=>{fg(t)&&console.warn("Passing `observe` as the second argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `observe` property as the second argument (`useRect(ref, { observe })`).\nSee https://reach.tech/rect#userect-observe")},[t]),R.exports.useEffect(()=>{vl(n)&&console.warn("Passing `onChange` as the third argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `onChange` property as the second argument (`useRect(ref, { onChange })`).\nSee https://reach.tech/rect#userect-onchange")},[n]);let[i,a]=R.exports.useState(e.current),s=R.exports.useRef(!1),l=R.exports.useRef(!1),[u,c]=R.exports.useState(null),f=R.exports.useRef(o);return mo(()=>{f.current=o,e.current!==i&&a(e.current)}),mo(()=>{i&&!s.current&&(s.current=!0,c(i.getBoundingClientRect()))},[i]),mo(()=>{if(!r)return;let h=i;if(l.current||(l.current=!0,h=e.current),!h){console.warn("You need to place the ref");return}let g=w3(h,y=>{var b;(b=f.current)==null||b.call(f,y),c(y)});return g.observe(),()=>{g.unobserve()}},[r,i,e]),u}/*! -* tabbable 5.3.3 -* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE -*/var S3=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],Qf=S3.join(","),MS=typeof Element>"u",ea=MS?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gf=!MS&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},_3=function(t,n,r){var o=Array.prototype.slice.apply(t.querySelectorAll(Qf));return n&&ea.call(t,Qf)&&o.unshift(t),o=o.filter(r),o},b3=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(a.tagName==="SLOT"){var s=a.assignedElements(),l=s.length?s:a.children,u=e(l,!0,r);r.flatten?o.push.apply(o,u):o.push({scope:a,candidates:u})}else{var c=ea.call(a,Qf);c&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!r.shadowRootFilter||r.shadowRootFilter(a);if(f&&d){var h=e(f===!0?a.children:f.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scope:a,candidates:h})}else i.unshift.apply(i,a.children)}}return o},$S=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||t.isContentEditable)&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},E3=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},US=function(t){return t.tagName==="INPUT"},x3=function(t){return US(t)&&t.type==="hidden"},R3=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},C3=function(t,n){for(var r=0;rsummary:first-of-type"),a=i?t.parentElement:t;if(ea.call(a,"details:not([open]) *"))return!0;var s=Gf(t).host,l=(s==null?void 0:s.ownerDocument.contains(s))||t.ownerDocument.contains(t);if(!r||r==="full"){if(typeof o=="function"){for(var u=t;t;){var c=t.parentElement,f=Gf(t);if(c&&!c.shadowRoot&&o(c)===!0)return dg(t);t.assignedSlot?t=t.assignedSlot:!c&&f!==t.ownerDocument?t=f.host:t=c}t=u}if(l)return!t.getClientRects().length}else if(r==="non-zero-area")return dg(t);return!1},L3=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},I3=function e(t){var n=[],r=[];return t.forEach(function(o,i){var a=!!o.scope,s=a?o.scope:o,l=$S(s,a),u=a?e(o.candidates):s;l===0?a?n.push.apply(n,u):n.push(s):r.push({documentOrder:i,tabIndex:l,item:o,isScope:a,content:u})}),r.sort(E3).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},hn=function(t,n){n=n||{};var r;return n.getShadowRoot?r=b3([t],n.includeContainer,{filter:pg.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:A3}):r=_3(t,n.includeContainer,pg.bind(null,n)),I3(r)},Gp=R.exports.forwardRef(function({unstable_skipInitialPortalRender:t,...n},r){return w(Qp,{unstable_skipInitialRender:t,children:w(FS,{ref:r,...n})})});Gp.displayName="Popover";var FS=R.exports.forwardRef(function({as:t="div",targetRef:n,position:r=$3,unstable_observableRefs:o=[],...i},a){const s=R.exports.useRef(null),l=ml(s,{observe:!i.hidden}),u=ml(n,{observe:!0}),c=Br(s,a);return F3(n,s),w(t,{"data-reach-popover":"",ref:c,...i,style:{position:"absolute",...D3(r,u,l,...o),...i.style}})});FS.displayName="PopoverImpl";function D3(e,t,n,...r){return n?e(t,n,...r.map(o=>o.current)):{visibility:"hidden"}}function M3(e,t,n){return{top:n?`${e.top-t.height+window.pageYOffset}px`:`${e.top+e.height+window.pageYOffset}px`}}var $3=(e,t)=>{if(!e||!t)return{};const{directionRight:n,directionUp:r}=U3(e,t);return{left:n?`${e.right-t.width+window.pageXOffset}px`:`${e.left+window.pageXOffset}px`,...M3(e,t,r)}};function U3(e,t,n=0,r=0){const o={top:e.top-t.height<0,right:window.innerWidth(n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}),[]);function o(){const p=hn(n),v=p&&e.current?p.indexOf(e.current):-1,S=p&&p[v+1];return t.current&&t.current.contains(S||null)?!1:S}function i(){return e.current?e.current===n.activeElement:!1}function a(p){const v=t.current&&hn(t.current);v&&v[0]&&(p.preventDefault(),v[0].focus())}function s(){if(t.current?t.current.contains(n.activeElement||null):!1){const v=t.current&&hn(t.current);return Boolean(v&&v[v.length-1]===n.activeElement)}return!1}function l(p){const v=o();v&&(p.preventDefault(),v.focus())}function u(p){if(!p.shiftKey)return;const v=o();return p.target===v}function c(p){const v=t.current&&hn(t.current),S=v&&v[v.length-1];S&&(p.preventDefault(),S.focus())}function f(p){const v=t.current&&hn(t.current);return v?v.length===0?!1:p.target===v[0]:!1}function d(p){var v;p.preventDefault(),(v=e.current)==null||v.focus()}function h(p){const v=t.current?hn(n).filter(S=>!t.current.contains(S)):null;return v?p.target===v[v.length-1]:!1}function g(p){return p.target===hn(n)[0]}let y=[];function b(){const p=t.current&&hn(t.current);p&&(p.forEach(v=>{y.push([v,v.tabIndex]),v.tabIndex=-1}),n.addEventListener("focusin",m))}function m(){n.removeEventListener("focusin",m),y.forEach(([p,v])=>{p.tabIndex=v})}}var gc=!1,j3=0;function hg(){return++j3}var vg=At["useId".toString()];function jS(e){var o;if(vg!==void 0){let i=vg();return e!=null?e:i}let t=e!=null?e:gc?hg():null,[n,r]=R.exports.useState(t);return mo(()=>{n===null&&r(hg())},[]),R.exports.useEffect(()=>{gc===!1&&(gc=!0)},[]),(o=e!=null?e:n)!=null?o:void 0}function B3(e,t={}){const n=[];let r=R.exports.createContext({descendants:n,registerDescendant:()=>qp,...t});return r.displayName=e,r}function z3(e,t,n){let r=IS(),{registerDescendant:o,descendants:i}=R.exports.useContext(t),a=n!=null?n:i.findIndex(s=>s.element===e.element);return mo(()=>(e.element||r(),o({...e,index:a})),[e,r,a,o,...Object.values(e)]),a}function V3(){return R.exports.useState([])}function W3(e){return R.exports.useContext(e).descendants}function H3({context:e,children:t,items:n,set:r}){let o=R.exports.useCallback(({element:i,index:a,...s})=>i?(r(l=>{if(a!=null&&a!==-1)return mg(l,{element:i,index:a,...s},a);if(l.length===0)return[{...s,element:i,index:0}];if(l.find(f=>f.element===i))return console.warn(`[reach-ui]: \`useDescendant\` was called with an element that was already registered. - -If you are using the \`@reach/descendants\` package directly, make sure to only register descendants once. Registering a descendant more than once will lead to bugs in your app. - -If you are using another \`reach-ui\` package, this is probably our bug! - -To report a bug, open a new issue: - - https://github.com/reach/reach-ui/issues/new?assignees=&labels=&template=Bug_report.md - -IMPORTANT: this check will only run in the development build, so if you see this warning please be aware that your app may crash when deployed.`),Q3(l);let u=q3(l,i),c;return u===-1?c=[...l,{...s,element:i,index:l.length}]:c=mg(l,{...s,element:i,index:u},u),c}),()=>{!i||r(l=>l.filter(u=>i!==u.element))}):qp,[]);return w(e.Provider,{value:R.exports.useMemo(()=>({descendants:n,registerDescendant:o}),[n,o]),children:t})}function K3(e,t){let{descendants:n}=R.exports.useContext(e),{callback:r,currentIndex:o,filter:i,key:a="index",orientation:s="vertical",rotate:l=!0,rtl:u=!1}=t;return function(f){if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(f.key))return;let d=o!=null?o:-1,h=i?n.filter(i):n;if(!h.length)return;let g=h.findIndex(v=>v.index===o);function y(){return d===p().index?l?m():h[g]:h[(g+1)%h.length]}function b(){return d===m().index?l?p():h[g]:h[(g-1+h.length)%h.length]}function m(){return h[0]}function p(){return h[h.length-1]}switch(f.key){case"ArrowDown":if(s==="vertical"||s==="both"){f.preventDefault();let N=y();r(a==="option"?N:N[a])}break;case"ArrowUp":if(s==="vertical"||s==="both"){f.preventDefault();let N=b();r(a==="option"?N:N[a])}break;case"ArrowLeft":if(s==="horizontal"||s==="both"){f.preventDefault();let N=(u?y:b)();r(a==="option"?N:N[a])}break;case"ArrowRight":if(s==="horizontal"||s==="both"){f.preventDefault();let N=(u?b:y)();r(a==="option"?N:N[a])}break;case"PageUp":f.preventDefault();let v=(f.ctrlKey?b:m)();r(a==="option"?v:v[a]);break;case"Home":f.preventDefault();let S=m();r(a==="option"?S:S[a]);break;case"PageDown":f.preventDefault();let k=(f.ctrlKey?y:p)();r(a==="option"?k:k[a]);break;case"End":f.preventDefault();let C=p();r(a==="option"?C:C[a]);break}}}function BS(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function q3(e,t){if(!t||!e.length)return-1;let n=e.length;for(;n--;){let r=e[n].element;if(!!r&&BS(r,t))return n+1}return-1}function mg(e,t,n){return n==null||!(n in e)?[...e,t]:[...e.slice(0,n),t,...e.slice(n)]}function Q3(e){return e.sort((t,n)=>!t.element||!n.element?0:BS(t.element,n.element)?-1:1).map((t,n)=>({...t,index:n}))}var zS="CLEAR_SELECTION_INDEX",Xp="CLICK_MENU_ITEM",ta="CLOSE_MENU",G3="OPEN_MENU_AT_FIRST_ITEM",Xf="OPEN_MENU_AT_INDEX",VS="OPEN_MENU_CLEARED",Yf="SEARCH_FOR_ITEM",Wn="SELECT_ITEM_AT_INDEX",Jf="SET_BUTTON_ID",su=B3("DropdownDescendantContext"),[X3,Ra]=d3("Dropdown"),Y3={triggerId:null,isExpanded:!1,typeaheadQuery:"",selectionIndex:-1},WS=({id:e,children:t})=>{let n=R.exports.useRef(null),r=R.exports.useRef(null),o=R.exports.useRef(null),[i,a]=V3(),s=jS(e),l=e||No("menu",s),u=No("menu-button",l),[c,f]=R.exports.useReducer(o4,{...Y3,triggerId:u}),d=R.exports.useRef(!1),h=R.exports.useRef([]),g=R.exports.useRef(!1),y=R.exports.useRef({x:0,y:0});return R.exports.useEffect(()=>{c.isExpanded?(window.__REACH_DISABLE_TOOLTIPS=!0,window.requestAnimationFrame(()=>{gl(r.current)})):window.__REACH_DISABLE_TOOLTIPS=!1},[c.isExpanded]),w(H3,{context:su,items:i,set:a,children:w(X3,{dispatch:f,dropdownId:l,dropdownRef:r,mouseDownStartPosRef:y,popoverRef:o,readyToSelect:g,selectCallbacks:h,state:c,triggerClickedRef:d,triggerRef:n,children:vl(t)?t({isExpanded:c.isExpanded,isOpen:c.isExpanded}):t})})};WS.displayName="DropdownProvider";function HS({onKeyDown:e,onMouseDown:t,id:n,ref:r,...o}){let{dispatch:i,dropdownId:a,mouseDownStartPosRef:s,triggerClickedRef:l,triggerRef:u,state:{triggerId:c,isExpanded:f}}=Ra("useDropdownTrigger"),d=Br(u,r),h=XS(),g=R.exports.useMemo(()=>h.findIndex(m=>!m.disabled),[h]);R.exports.useEffect(()=>{n!=null&&n!==c&&i({type:Jf,payload:n})},[c,i,n]),R.exports.useEffect(()=>{n==null&&i({type:Jf,payload:No("menu-button",a)})},[a,i,n]);function y(m){switch(m.key){case"ArrowDown":case"ArrowUp":m.preventDefault(),i({type:Xf,payload:{index:g}});break;case"Enter":case" ":i({type:Xf,payload:{index:g}});break}}function b(m){bs(m.nativeEvent)||(s.current={x:m.clientX,y:m.clientY},f||(l.current=!0),i(f?{type:ta}:{type:VS}))}return{data:{isExpanded:f,controls:a},props:{...o,ref:d,id:c||void 0,onKeyDown:Ne(e,y),onMouseDown:Ne(t,b),type:"button"}}}var J3=R.exports.forwardRef(({as:e="button",...t},n)=>{let{props:r}=HS({...t,ref:n});return w(e,{"data-reach-dropdown-trigger":"",...r})});J3.displayName="DropdownTrigger";function KS({index:e,isLink:t=!1,onClick:n,onDragStart:r,onMouseDown:o,onMouseEnter:i,onMouseLeave:a,onMouseMove:s,onMouseUp:l,onSelect:u,disabled:c,onFocus:f,valueText:d,ref:h,...g}){let{dispatch:y,dropdownRef:b,mouseDownStartPosRef:m,readyToSelect:p,selectCallbacks:v,triggerRef:S,state:{selectionIndex:k,isExpanded:C}}=Ra("useDropdownItem"),N=R.exports.useRef(null),[A,W]=R.exports.useState(d||""),F=R.exports.useCallback(H=>{!d&&(H==null?void 0:H.textContent)&&W(H.textContent)},[d]),X=R.exports.useRef(!1),[ce,ae]=h3(N,null),_=R.exports.useMemo(()=>({element:ce,key:A,disabled:c,isLink:t}),[c,ce,t,A]),L=z3(_,su,e),j=L===k&&!c,O=Br(h,ae,F);v.current[L]=u;function P(){gl(S.current),u&&u(),y({type:Xp})}function I(H){bs(H.nativeEvent)||t&&(c?H.preventDefault():P())}function M(H){t&&H.preventDefault()}function z(H){bs(H.nativeEvent)||(t?X.current=!0:H.preventDefault())}function E(H){let ee=sr(b.current);!j&&L!=null&&!c&&((b==null?void 0:b.current)&&b.current!==ee.activeElement&&N.current!==ee.activeElement&&b.current.focus(),y({type:Wn,payload:{index:L}}))}function D(H){y({type:zS})}function $(H){if(!p.current){let ee=8,Y=Math.abs(H.clientX-m.current.x),pe=Math.abs(H.clientY-m.current.y);(Y>ee||pe>ee)&&(p.current=!0)}!j&&L!=null&&!c&&y({type:Wn,payload:{index:L,dropdownRef:b}})}function J(){p.current=!0,!j&&L!=null&&!c&&y({type:Wn,payload:{index:L}})}function V(H){if(!bs(H.nativeEvent)){if(!p.current){p.current=!0;return}t?X.current?X.current=!1:N.current&&N.current.click():c||P()}}return R.exports.useEffect(()=>{if(C){let H=window.setTimeout(()=>{p.current=!0},400);return()=>{window.clearTimeout(H)}}else p.current=!1},[C,p]),R.exports.useEffect(()=>{let H=sr(N.current);return H.addEventListener("mouseup",ee),()=>{H.removeEventListener("mouseup",ee)};function ee(){X.current=!1}},[]),{data:{disabled:c},props:{id:GS(L),tabIndex:-1,...g,ref:O,"data-disabled":c?"":void 0,"data-selected":j?"":void 0,"data-valuetext":A,onClick:Ne(n,I),onDragStart:Ne(r,M),onMouseDown:Ne(o,z),onMouseEnter:Ne(i,E),onMouseLeave:Ne(a,D),onMouseMove:Ne(s,$),onFocus:Ne(f,J),onMouseUp:Ne(l,V)}}}var Z3=R.exports.forwardRef(({as:e="div",...t},n)=>{let{props:r}=KS({...t,ref:n});return w(e,{"data-reach-dropdown-item":"",...r})});Z3.displayName="DropdownItem";function qS({id:e,onKeyDown:t,ref:n,...r}){let{dispatch:o,triggerRef:i,dropdownRef:a,selectCallbacks:s,dropdownId:l,state:{isExpanded:u,triggerId:c,selectionIndex:f,typeaheadQuery:d}}=Ra("useDropdownItems"),h=XS(),g=Br(a,n);R.exports.useEffect(()=>{let v=n4(h,d);d&&v!=null&&o({type:Wn,payload:{index:v,dropdownRef:a}});let S=window.setTimeout(()=>d&&o({type:Yf,payload:""}),1e3);return()=>window.clearTimeout(S)},[o,h,d,a]);let y=mc(h.length),b=mc(h[f]),m=mc(f);R.exports.useEffect(()=>{f>h.length-1?o({type:Wn,payload:{index:h.length-1,dropdownRef:a}}):y!==h.length&&f>-1&&b&&m===f&&h[f]!==b&&o({type:Wn,payload:{index:h.findIndex(v=>v.key===(b==null?void 0:b.key)),dropdownRef:a}})},[a,o,h,y,b,m,f]);let p=Ne(function(S){let{key:k}=S;if(!!u)switch(k){case"Enter":case" ":let C=h.find(N=>N.index===f);C&&!C.disabled&&(S.preventDefault(),C.isLink&&C.element?C.element.click():(gl(i.current),s.current[C.index]&&s.current[C.index](),o({type:Xp})));break;case"Escape":gl(i.current),o({type:ta});break;case"Tab":S.preventDefault();break;default:if(c3(k)&&k.length===1){let N=d+k.toLowerCase();o({type:Yf,payload:N})}break}},K3(su,{currentIndex:f,orientation:"vertical",rotate:!1,filter:v=>!v.disabled,callback:v=>{o({type:Wn,payload:{index:v,dropdownRef:a}})},key:"index"}));return{data:{activeDescendant:GS(f)||void 0,triggerId:c},props:{tabIndex:-1,...r,ref:g,id:l,onKeyDown:Ne(t,p)}}}var e4=R.exports.forwardRef(({as:e="div",...t},n)=>{let{props:r}=qS({...t,ref:n});return w(e,{"data-reach-dropdown-items":"",...r})});e4.displayName="DropdownItems";function QS({onBlur:e,portal:t=!0,position:n,ref:r,...o}){let{triggerRef:i,triggerClickedRef:a,dispatch:s,dropdownRef:l,popoverRef:u,state:{isExpanded:c}}=Ra("useDropdownPopover"),f=Br(u,r);return R.exports.useEffect(()=>{if(!c)return;let d=sr(u.current);function h(g){a.current?a.current=!1:r4(u.current,g.target)||s({type:ta})}return d.addEventListener("mousedown",h),()=>{d.removeEventListener("mousedown",h)}},[a,i,s,l,u,c]),{data:{portal:t,position:n,targetRef:i,isExpanded:c},props:{ref:f,hidden:!c,onBlur:Ne(e,d=>{d.currentTarget.contains(d.relatedTarget)||s({type:ta})}),...o}}}var t4=R.exports.forwardRef(({as:e="div",...t},n)=>{let{data:{portal:r,targetRef:o,position:i},props:a}=QS({...t,ref:n}),s={"data-reach-dropdown-popover":""};return r?w(Gp,{...a,...s,as:e,targetRef:o,position:i,unstable_skipInitialPortalRender:!0}):w(e,{...a,...s})});t4.displayName="DropdownPopover";function n4(e,t=""){if(!t)return null;let n=e.find(r=>{var o,i,a;return r.disabled?!1:(a=(i=(o=r.element)==null?void 0:o.dataset)==null?void 0:i.valuetext)==null?void 0:a.toLowerCase().startsWith(t)});return n?e.indexOf(n):null}function GS(e){let{dropdownId:t}=Ra("useItemId");return e!=null&&e>-1?No(`option-${e}`,t):void 0}function gl(e){e&&e.focus()}function r4(e,t){return!!(e&&e.contains(t))}function o4(e,t={}){switch(t.type){case Xp:return{...e,isExpanded:!1,selectionIndex:-1};case ta:return{...e,isExpanded:!1,selectionIndex:-1};case G3:return{...e,isExpanded:!0,selectionIndex:0};case Xf:return{...e,isExpanded:!0,selectionIndex:t.payload.index};case VS:return{...e,isExpanded:!0,selectionIndex:-1};case Wn:{let{dropdownRef:n={current:null}}=t.payload;if(t.payload.index>=0&&t.payload.index!==e.selectionIndex){if(n.current){let r=sr(n.current);n.current!==(r==null?void 0:r.activeElement)&&n.current.focus()}return{...e,selectionIndex:t.payload.max!=null?Math.min(Math.max(t.payload.index,0),t.payload.max):Math.max(t.payload.index,0)}}return e}case zS:return{...e,selectionIndex:-1};case Jf:return{...e,triggerId:t.payload};case Yf:return typeof t.payload<"u"?{...e,typeaheadQuery:t.payload}:e;default:return e}}function XS(){return W3(su)}var YS={exports:{}},ve={};/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Be=typeof Symbol=="function"&&Symbol.for,Yp=Be?Symbol.for("react.element"):60103,Jp=Be?Symbol.for("react.portal"):60106,lu=Be?Symbol.for("react.fragment"):60107,uu=Be?Symbol.for("react.strict_mode"):60108,cu=Be?Symbol.for("react.profiler"):60114,fu=Be?Symbol.for("react.provider"):60109,du=Be?Symbol.for("react.context"):60110,Zp=Be?Symbol.for("react.async_mode"):60111,pu=Be?Symbol.for("react.concurrent_mode"):60111,hu=Be?Symbol.for("react.forward_ref"):60112,vu=Be?Symbol.for("react.suspense"):60113,i4=Be?Symbol.for("react.suspense_list"):60120,mu=Be?Symbol.for("react.memo"):60115,gu=Be?Symbol.for("react.lazy"):60116,a4=Be?Symbol.for("react.block"):60121,s4=Be?Symbol.for("react.fundamental"):60117,l4=Be?Symbol.for("react.responder"):60118,u4=Be?Symbol.for("react.scope"):60119;function bt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Yp:switch(e=e.type,e){case Zp:case pu:case lu:case cu:case uu:case vu:return e;default:switch(e=e&&e.$$typeof,e){case du:case hu:case gu:case mu:case fu:return e;default:return t}}case Jp:return t}}}function JS(e){return bt(e)===pu}ve.AsyncMode=Zp;ve.ConcurrentMode=pu;ve.ContextConsumer=du;ve.ContextProvider=fu;ve.Element=Yp;ve.ForwardRef=hu;ve.Fragment=lu;ve.Lazy=gu;ve.Memo=mu;ve.Portal=Jp;ve.Profiler=cu;ve.StrictMode=uu;ve.Suspense=vu;ve.isAsyncMode=function(e){return JS(e)||bt(e)===Zp};ve.isConcurrentMode=JS;ve.isContextConsumer=function(e){return bt(e)===du};ve.isContextProvider=function(e){return bt(e)===fu};ve.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yp};ve.isForwardRef=function(e){return bt(e)===hu};ve.isFragment=function(e){return bt(e)===lu};ve.isLazy=function(e){return bt(e)===gu};ve.isMemo=function(e){return bt(e)===mu};ve.isPortal=function(e){return bt(e)===Jp};ve.isProfiler=function(e){return bt(e)===cu};ve.isStrictMode=function(e){return bt(e)===uu};ve.isSuspense=function(e){return bt(e)===vu};ve.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===lu||e===pu||e===cu||e===uu||e===vu||e===i4||typeof e=="object"&&e!==null&&(e.$$typeof===gu||e.$$typeof===mu||e.$$typeof===fu||e.$$typeof===du||e.$$typeof===hu||e.$$typeof===s4||e.$$typeof===l4||e.$$typeof===u4||e.$$typeof===a4)};ve.typeOf=bt;(function(e){e.exports=ve})(YS);var ZS=R.exports.forwardRef(({as:e=R.exports.Fragment,id:t,children:n,...r},o)=>{let a=R.exports.useMemo(()=>{try{return YS.exports.isFragment(w(e,{}))}catch{return!1}},[e])?{}:{ref:o,id:t,"data-reach-menu":"",...r};return w(e,{...a,children:w(WS,{id:t,children:n})})});ZS.displayName="Menu";var e_=R.exports.forwardRef(({as:e="button",...t},n)=>{let{data:{isExpanded:r,controls:o},props:i}=HS({...t,ref:n});return w(e,{"aria-expanded":r?!0:void 0,"aria-haspopup":!0,"aria-controls":o,...i,"data-reach-menu-button":""})});e_.displayName="MenuButton";var eh=R.exports.forwardRef(({as:e="div",...t},n)=>{let{data:{disabled:r},props:o}=KS({...t,ref:n});return w(e,{role:"menuitem",...o,"aria-disabled":r||void 0,"data-reach-menu-item":""})});eh.displayName="MenuItemImpl";var t_=R.exports.forwardRef(({as:e="div",...t},n)=>w(eh,{...t,ref:n,as:e}));t_.displayName="MenuItem";var n_=R.exports.forwardRef(({as:e="div",...t},n)=>{let{data:{activeDescendant:r,triggerId:o},props:i}=qS({...t,ref:n});return w(e,{"aria-activedescendant":r,"aria-labelledby":o||void 0,role:"menu",...i,"data-reach-menu-items":""})});n_.displayName="MenuItems";var c4=R.exports.forwardRef(({as:e="a",component:t,onSelect:n,...r},o)=>(R.exports.useEffect(()=>{t&&console.warn("[@reach/menu-button]: Please use the `as` prop instead of `component`")},[t]),w(eh,{...r,ref:o,"data-reach-menu-link":"",as:e,isLink:!0,onSelect:n||qp})));c4.displayName="MenuLink";var r_=R.exports.forwardRef(({portal:e=!0,...t},n)=>w(o_,{portal:e,children:w(n_,{...t,ref:n,"data-reach-menu-list":""})}));r_.displayName="MenuList";var o_=R.exports.forwardRef(({as:e="div",...t},n)=>{let{data:{portal:r,targetRef:o,position:i},props:a}=QS({...t,ref:n}),s={"data-reach-menu-popover":""};return r?w(Gp,{...a,...s,as:e,targetRef:o,position:i,unstable_skipInitialPortalRender:!0}):w(e,{...a,...s})});o_.displayName="MenuPopover";var i_=R.exports.forwardRef(function({as:t="span",style:n={},...r},o){return w(t,{ref:o,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal",...n},...r})});i_.displayName="VisuallyHidden";var f4=100,d4=500,Zf={initial:"IDLE",states:{IDLE:{enter:yc,on:{MOUSE_ENTER:"FOCUSED",FOCUS:"VISIBLE"}},FOCUSED:{enter:v4,leave:m4,on:{MOUSE_MOVE:"FOCUSED",MOUSE_LEAVE:"IDLE",MOUSE_DOWN:"DISMISSED",BLUR:"IDLE",REST:"VISIBLE"}},VISIBLE:{on:{FOCUS:"FOCUSED",MOUSE_ENTER:"FOCUSED",MOUSE_LEAVE:"LEAVING_VISIBLE",BLUR:"LEAVING_VISIBLE",MOUSE_DOWN:"DISMISSED",SELECT_WITH_KEYBOARD:"DISMISSED",GLOBAL_MOUSE_MOVE:"LEAVING_VISIBLE"}},LEAVING_VISIBLE:{enter:g4,leave:()=>{y4(),yc()},on:{MOUSE_ENTER:"VISIBLE",FOCUS:"VISIBLE",TIME_COMPLETE:"IDLE"}},DISMISSED:{leave:()=>{yc()},on:{MOUSE_LEAVE:"IDLE",BLUR:"IDLE"}}}},Pt={value:Zf.initial,context:{id:null}},Es=[];function p4(e){return Es.push(e),()=>{Es.splice(Es.indexOf(e),1)}}function h4(){Es.forEach(e=>e(Pt))}var ed;function v4(){window.clearTimeout(ed),ed=window.setTimeout(()=>{Wt({type:"REST"})},f4)}function m4(){window.clearTimeout(ed)}var td;function g4(){window.clearTimeout(td),td=window.setTimeout(()=>Wt({type:"TIME_COMPLETE"}),d4)}function y4(){window.clearTimeout(td)}function yc(){Pt.context.id=null}function w4({id:e,onPointerEnter:t,onPointerMove:n,onPointerLeave:r,onPointerDown:o,onMouseEnter:i,onMouseMove:a,onMouseLeave:s,onMouseDown:l,onFocus:u,onBlur:c,onKeyDown:f,disabled:d,ref:h,DEBUG_STYLE:g}={}){let y=String(jS(e)),[b,m]=R.exports.useState(g?!0:gg(y,!0)),p=R.exports.useRef(null),v=Br(h,p),S=ml(p,{observe:b});R.exports.useEffect(()=>p4(()=>{m(gg(y))}),[y]),R.exports.useEffect(()=>{let j=sr(p.current);function O(P){(P.key==="Escape"||P.key==="Esc")&&Pt.value==="VISIBLE"&&Wt({type:"SELECT_WITH_KEYBOARD"})}return j.addEventListener("keydown",O),()=>j.removeEventListener("keydown",O)},[]),E4({disabled:d,isVisible:b,ref:p});function k(j,O){return typeof window<"u"&&"PointerEvent"in window?j:Ne(j,O)}function C(j){return function(P){P.pointerType==="mouse"&&j(P)}}function N(){Wt({type:"MOUSE_ENTER",id:y})}function A(){Wt({type:"MOUSE_MOVE",id:y})}function W(){Wt({type:"MOUSE_LEAVE"})}function F(){Pt.context.id===y&&Wt({type:"MOUSE_DOWN"})}function X(){window.__REACH_DISABLE_TOOLTIPS||Wt({type:"FOCUS",id:y})}function ce(){Pt.context.id===y&&Wt({type:"BLUR"})}function ae(j){(j.key==="Enter"||j.key===" ")&&Wt({type:"SELECT_WITH_KEYBOARD"})}return[{"aria-describedby":b?No("tooltip",y):void 0,"data-state":b?"tooltip-visible":"tooltip-hidden","data-reach-tooltip-trigger":"",ref:v,onPointerEnter:Ne(t,C(N)),onPointerMove:Ne(n,C(A)),onPointerLeave:Ne(r,C(W)),onPointerDown:Ne(o,C(F)),onMouseEnter:k(i,N),onMouseMove:k(a,A),onMouseLeave:k(s,W),onMouseDown:k(l,F),onFocus:Ne(u,X),onBlur:Ne(c,ce),onKeyDown:Ne(f,ae)},{id:y,triggerRect:S,isVisible:b},b]}var th=R.exports.forwardRef(function({children:e,label:t,ariaLabel:n,id:r,DEBUG_STYLE:o,...i},a){let s=R.exports.Children.only(e);R.exports.useEffect(()=>{n&&console.warn("The `ariaLabel prop is deprecated and will be removed from @reach/tooltip in a future version of Reach UI. Please use `aria-label` instead.")},[n]);let[l,u]=w4({id:r,onPointerEnter:s.props.onPointerEnter,onPointerMove:s.props.onPointerMove,onPointerLeave:s.props.onPointerLeave,onPointerDown:s.props.onPointerDown,onMouseEnter:s.props.onMouseEnter,onMouseMove:s.props.onMouseMove,onMouseLeave:s.props.onMouseLeave,onMouseDown:s.props.onMouseDown,onFocus:s.props.onFocus,onBlur:s.props.onBlur,onKeyDown:s.props.onKeyDown,disabled:s.props.disabled,ref:s.ref,DEBUG_STYLE:o});return Z(Nt,{children:[R.exports.cloneElement(s,l),w(a_,{ref:a,label:t,"aria-label":n,...u,...i})]})});th.displayName="Tooltip";var a_=R.exports.forwardRef(function({label:t,ariaLabel:n,isVisible:r,id:o,...i},a){return r?w(Qp,{children:w(s_,{ref:a,label:t,"aria-label":n,isVisible:r,...i,id:No("tooltip",String(o))})}):null});a_.displayName="TooltipPopup";var s_=R.exports.forwardRef(function({ariaLabel:t,"aria-label":n,as:r="div",id:o,isVisible:i,label:a,position:s=b4,style:l,triggerRect:u,...c},f){let d=(n||t)!=null,h=R.exports.useRef(null),g=Br(f,h),y=ml(h,{observe:i});return Z(Nt,{children:[w(r,{role:d?void 0:"tooltip",...c,ref:g,"data-reach-tooltip":"",id:d?void 0:o,style:{...l,...S4(s,u,y)},children:a}),d&&w(i_,{role:"tooltip",id:o,children:n||t})]})});s_.displayName="TooltipContent";function S4(e,t,n){return n?e(t,n):{visibility:"hidden"}}var _4=8,b4=(e,t,n=_4)=>{let{width:r,height:o}=p3();if(!e||!t)return{};let i={top:e.top-t.height<0,right:r{if(!(typeof window<"u"&&"PointerEvent"in window)||!e||!t)return;let r=sr(n.current);function o(i){!t||i.target instanceof Element&&i.target.closest("[data-reach-tooltip-trigger][data-state='tooltip-visible']")||Wt({type:"GLOBAL_MOUSE_MOVE"})}return r.addEventListener("mousemove",o),()=>{r.removeEventListener("mousemove",o)}},[e,t,n])}function Wt(e){let{value:t,context:n,changed:r}=x4(Pt,e);r&&(Pt={value:t,context:n},h4())}function x4(e,t){let n=Zf.states[e.value],r=n&&n.on&&n.on[t.type];if(!r)return{...e,changed:!1};n&&n.leave&&n.leave(e.context,t);const{type:o,...i}=t;let a={...Pt.context,...i},s=typeof r=="string"?r:r.target,l=Zf.states[s];return l&&l.enter&&l.enter(e.context,t),{value:s,context:a,changed:!0}}function gg(e,t){return Pt.context.id===e&&(t?Pt.value==="VISIBLE":Pt.value==="VISIBLE"||Pt.value==="LEAVING_VISIBLE")}function R4(e){let t={};const n={},r={};function o(l="default"){return n[l]=e(l).then(u=>{delete n[l],t[l]=u}).catch(u=>{r[l]=u}),n[l]}function i(l="default"){t[l]!==void 0||n[l]||o(l)}function a(l="default"){if(t[l]!==void 0)return t[l];throw r[l]?r[l]:n[l]?n[l]:o(l)}function s(l){l?delete t[l]:t={}}return{preload:i,read:a,clear:s}}const nh=R4(()=>_n(()=>import("./index.8bb012c6.js"),[],import.meta.url)),C4="_checkWrapper_1nrct_45",O4="_active_1nrct_51",yg={checkWrapper:C4,active:O4};function k4({theme:e,dispatch:t}){const{t:n}=ia(),r=R.exports.useMemo(()=>{switch(e){case"dark":return w(wg,{});case"auto":return w(P4,{});case"light":return w(T4,{});default:return console.assert(!1,"Unknown theme"),w(wg,{})}},[e]),o=R.exports.useCallback(i=>t(vD(i)),[t]);return Z(ZS,{children:[w(th,{label:n("switch_theme"),"aria-label":"switch theme",children:w(e_,{children:r})}),Z(r_,{children:[w(wc,{value:"auto",label:"Auto",active:e==="auto",onSelect:o}),w(wc,{value:"dark",label:"Dark",active:e==="dark",onSelect:o}),w(wc,{value:"light",label:"Light",active:e==="light",onSelect:o})]})]})}function wc(e){const t=ar(yg.checkWrapper,{[yg.active]:e.active});return Z(t_,{onSelect:()=>e.onSelect(e.value),children:[w("span",{className:t,children:w(lI,{size:14})}),w("span",{children:e.label})]})}function wg(){const t=nh.read().motion;return w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:w(t.path,{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",initial:{rotate:-30},animate:{rotate:0},transition:{duration:.7}})})}function T4(){const t=nh.read().motion;return Z("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w("circle",{cx:"12",cy:"12",r:"5"}),Z(t.g,{initial:{scale:.7},animate:{scale:1},transition:{duration:.5},children:[w("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),w("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),w("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),w("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),w("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),w("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),w("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),w("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})]})}function P4(){const t=nh.read().motion;return Z("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w("circle",{cx:"12",cy:"12",r:"11"}),w("clipPath",{id:"cut-off-bottom",children:w(t.rect,{x:"12",y:"0",width:"12",height:"24",initial:{rotate:-30},animate:{rotate:0},transition:{duration:.7}})}),w("circle",{cx:"12",cy:"12",r:"6",clipPath:"url(#cut-off-bottom)",fill:"currentColor"})]})}const L4=e=>({theme:zp(e)}),l_=kn(L4)(k4),nd=0;class N4 extends Error{constructor(t,n){super(t),this.message=t,this.code=n}}const rd={[nd]:{message:"Browser not supported!",detail:'This browser does not support "fetch", please choose another one.'},default:{message:"Oops, something went wrong!"}};function A4(e){const{code:t}=e;return typeof t=="number"?rd[t]:rd.default}const I4="_content_b98hm_1",D4="_container_b98hm_16",M4="_overlay_b98hm_22",$4="_fixed_b98hm_26",os={content:I4,container:D4,overlay:M4,fixed:$4},U4="_overlay_1i06e_1",F4="_content_1i06e_10",Sg={overlay:U4,content:F4};function j4({isOpen:e,onRequestClose:t,className:n,overlayClassName:r,children:o,...i}){const a=ar(n,Sg.content),s=ar(r,Sg.overlay);return w(c1,{isOpen:e,onRequestClose:t,className:a,overlayClassName:s,...i,children:o})}const B4=R.exports.memo(j4),{useCallback:z4,useEffect:V4}=At;function W4({dispatch:e,apiConfig:t,modals:n}){if(!window.fetch){const{detail:o}=rd[nd];throw new N4(o,nd)}const r=z4(()=>{e(rD("apiConfig"))},[e]);return V4(()=>{e(vS(t))},[e,t]),Z(B4,{isOpen:n.apiConfig,className:os.content,overlayClassName:os.overlay,shouldCloseOnOverlayClick:!1,shouldCloseOnEsc:!1,onRequestClose:r,children:[w("div",{className:os.container,children:w(NS,{})}),w("div",{className:os.fixed,children:w(l_,{})})]})}const H4=e=>({modals:e.modals,apiConfig:jo(e)}),K4=kn(H4)(W4),q4={hasProcessPath:!1},Q4=R.exports.createContext(q4),G4="_root_4m2cd_1",X4="_yacd_4m2cd_14",Y4="_link_4m2cd_23",Sc={root:G4,yacd:X4,link:Y4};function J4({width:e=24,height:t=24}={}){return w("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:w("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"})})}const Z4="https://github.com/haishanh/yacd/issues";function e$({message:e,detail:t}){return Z("div",{className:Sc.root,children:[w("div",{className:Sc.yacd,children:w(Kp,{width:150,height:150})}),e?w("h1",{children:e}):null,t?w("p",{children:t}):null,w("p",{children:Z("a",{className:Sc.link,href:Z4,children:[w(J4,{width:16,height:16}),"haishanh/yacd"]})})]})}class t$ extends R.exports.Component{constructor(){super(...arguments);lh(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}render(){if(this.state.error){const{message:n,detail:r}=A4(this.state.error);return w(e$,{message:n,detail:r})}else return this.props.children}}const n$="_root_jynjv_1",r$="_chart_jynjv_10",_g={root:n$,chart:r$};var rh=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var a=i[o];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n};function bg(e,t,n,r=0,o=!1){for(const a of t)if(rh(n,a.args)){if(o)return;if(a.error)throw a.error;if(a.response)return a.response;throw a.promise}const i={args:n,promise:e(...n).then(a=>i.response=a!=null?a:!0).catch(a=>i.error=a!=null?a:"unknown error").then(()=>{r>0&&setTimeout(()=>{const a=t.indexOf(i);a!==-1&&t.splice(a,1)},r)})};if(t.push(i),!o)throw i.promise}function o$(e,...t){if(t===void 0||t.length===0)e.splice(0,e.length);else{const n=e.find(r=>rh(t,r.args));if(n){const r=e.indexOf(n);r!==-1&&e.splice(r,1)}}}function i$(e,t=0){const n=[];return{read:(...r)=>bg(e,n,r,t),preload:(...r)=>void bg(e,n,r,t,!0),clear:(...r)=>o$(n,...r),peek:(...r)=>{var o;return(o=n.find(i=>rh(r,i.args)))==null?void 0:o.response}}}const Eg=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];function na(e){if(e<1e3)return e+" B";const t=Math.min(Math.floor(Math.log10(e)/3),Eg.length-1);e=Number((e/Math.pow(1e3,t)).toPrecision(3));const n=Eg[t];return e+" "+n}const a$=i$(()=>_n(()=>import("./chart-lib.a8ad03fd.js"),[],import.meta.url)),xg={borderWidth:1,pointRadius:0,tension:.2,fill:!0},s$={responsive:!0,maintainAspectRatio:!0,plugins:{legend:{labels:{boxWidth:20}}},scales:{x:{display:!1,type:"category"},y:{type:"linear",display:!0,grid:{display:!0,color:"#555",drawTicks:!1,borderDash:[3,6],drawBorder:!1},ticks:{callback(e){return na(e)+"/s "}}}}},Rg=[{down:{backgroundColor:"rgba(176, 209, 132, 0.8)",borderColor:"rgb(176, 209, 132)"},up:{backgroundColor:"rgba(181, 220, 231, 0.8)",borderColor:"rgb(181, 220, 231)"}},{up:{backgroundColor:"rgb(98, 190, 100)",borderColor:"rgb(78,146,79)"},down:{backgroundColor:"rgb(160, 230, 66)",borderColor:"rgb(110, 156, 44)"}},{up:{backgroundColor:"rgba(94, 175, 223, 0.3)",borderColor:"rgb(94, 175, 223)"},down:{backgroundColor:"rgba(139, 227, 195, 0.3)",borderColor:"rgb(139, 227, 195)"}},{up:{backgroundColor:"rgba(242, 174, 62, 0.3)",borderColor:"rgb(242, 174, 62)"},down:{backgroundColor:"rgba(69, 154, 248, 0.3)",borderColor:"rgb(69, 154, 248)"}}],{useEffect:l$}=ye;function u$(e,t,n,r,o={}){l$(()=>{const i=document.getElementById(t).getContext("2d"),a={...s$,...o},s=new e(i,{type:"line",data:n,options:a}),l=r&&r.subscribe(()=>s.update());return()=>{l&&l(),s.destroy()}},[e,t,n,r,o])}const{useMemo:c$}=At,f$={position:"relative",maxWidth:1e3},d$=e=>({apiConfig:jo(e),selectedChartStyleIndex:lD(e)}),p$=kn(d$)(h$);function h$({apiConfig:e,selectedChartStyleIndex:t}){const n=a$.read(),r=jp(e),{t:o}=ia(),i=c$(()=>({labels:r.labels,datasets:[{...xg,...Rg[t].up,label:o("Up"),data:r.up},{...xg,...Rg[t].down,label:o("Down"),data:r.down}]}),[r,t,o]);return u$(n.Chart,"trafficChart",i,r),w("div",{style:f$,children:w("canvas",{id:"trafficChart"})})}const v$="_TrafficNow_hzna1_1",m$="_sec_hzna1_10",qr={TrafficNow:v$,sec:m$},{useState:u_,useEffect:c_,useCallback:g$}=At,y$=e=>({apiConfig:jo(e)}),w$=kn(y$)(S$);function S$({apiConfig:e}){const{t}=ia(),{upStr:n,downStr:r}=_$(e),{upTotal:o,dlTotal:i,connNumber:a}=b$(e);return Z("div",{className:qr.TrafficNow,children:[Z("div",{className:qr.sec,children:[w("div",{children:t("Upload")}),w("div",{children:n})]}),Z("div",{className:qr.sec,children:[w("div",{children:t("Download")}),w("div",{children:r})]}),Z("div",{className:qr.sec,children:[w("div",{children:t("Upload Total")}),w("div",{children:o})]}),Z("div",{className:qr.sec,children:[w("div",{children:t("Download Total")}),w("div",{children:i})]}),Z("div",{className:qr.sec,children:[w("div",{children:t("Active Connections")}),w("div",{children:a})]})]})}function _$(e){const[t,n]=u_({upStr:"0 B/s",downStr:"0 B/s"});return c_(()=>jp(e).subscribe(r=>n({upStr:na(r.up)+"/s",downStr:na(r.down)+"/s"})),[e]),t}function b$(e){const[t,n]=u_({upTotal:"0 B",dlTotal:"0 B",connNumber:0}),r=g$(({downloadTotal:o,uploadTotal:i,connections:a})=>{n({upTotal:na(i),dlTotal:na(o),connNumber:a.length})},[n]);return c_(()=>qD(e,r),[e,r]),t}function E$(){const{t:e}=ia();return Z("div",{children:[w(rS,{title:e("Overview")}),Z("div",{className:_g.root,children:[w("div",{children:w(w$,{})}),w("div",{className:_g.chart,children:w(R.exports.Suspense,{fallback:w(wS,{height:"200px"}),children:w(p$,{})})})]})]})}const x$="_lo_pmly2_1",R$={lo:x$};function C$(){return w("div",{className:R$.lo,children:w(Kp,{width:280,height:280,animate:!0,c0:"transparent",c1:"#646464"})})}const O$="_app_1s3k7_1",k$="_content_1s3k7_18",f_={app:O$,content:k$};var d_={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Cg=ye.createContext&&ye.createContext(d_),nr=globalThis&&globalThis.__assign||function(){return nr=Object.assign||function(e){for(var t,n=1,r=arguments.length;nw(K$,{to:n,isActive:t.pathname===n,iconId:r,labelText:e(o)},n))}),Z("div",{className:Fn.footer,children:[w(l_,{}),w(th,{label:e("about"),children:w(A1,{to:"/about",className:Fn.iconWrapper,children:w(SI,{size:20})})})]})]})}const G$="_input_mh4af_1",HU={input:G$},X$="_animate_1w0e8_1",KU={animate:X$,"zap-pulse":"_zap-pulse_1w0e8_1"};function od(){return od=Object.assign?Object.assign.bind():function(e){for(var t=1;t=l)&&this.A(n),this.W&&this.setState({N:!1,j:!1}),this.l=Date.now()},t.prototype.p=function(n){n.preventDefault(),typeof n.button=="number"&&n.button!==0||(this.I(n.clientX),window.addEventListener("mousemove",this.v),window.addEventListener("mouseup",this.g))},t.prototype.v=function(n){n.preventDefault(),this.L(n.clientX)},t.prototype.g=function(n){this.U(n),window.removeEventListener("mousemove",this.v),window.removeEventListener("mouseup",this.g)},t.prototype.k=function(n){this.X=null,this.I(n.touches[0].clientX)},t.prototype.m=function(n){this.L(n.touches[0].clientX)},t.prototype.M=function(n){n.preventDefault(),this.U(n)},t.prototype.$=function(n){Date.now()-this.l>50&&(this.A(n),Date.now()-this.u>50&&this.W&&this.setState({j:!1}))},t.prototype.C=function(){this.u=Date.now()},t.prototype.D=function(){this.setState({j:!0})},t.prototype.O=function(){this.setState({j:!1})},t.prototype.S=function(n){this.H=n},t.prototype.T=function(n){n.preventDefault(),this.H.focus(),this.A(n),this.W&&this.setState({j:!1})},t.prototype.A=function(n){var r=this.props;(0,r.onChange)(!r.checked,n,r.id)},t.prototype.render=function(){var n=this.props,r=n.checked,o=n.disabled,i=n.className,a=n.offColor,s=n.onColor,l=n.offHandleColor,u=n.onHandleColor,c=n.checkedIcon,f=n.uncheckedIcon,d=n.checkedHandleIcon,h=n.uncheckedHandleIcon,g=n.boxShadow,y=n.activeBoxShadow,b=n.height,m=n.width,p=n.borderRadius,v=function(L,j){var O={};for(var P in L)Object.prototype.hasOwnProperty.call(L,P)&&j.indexOf(P)===-1&&(O[P]=L[P]);return O}(n,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),S=this.state,k=S.h,C=S.N,N=S.j,A={position:"relative",display:"inline-block",textAlign:"left",opacity:o?.5:1,direction:"ltr",borderRadius:b/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},W={height:b,width:m,margin:Math.max(0,(this.t-b)/2),position:"relative",background:kg(k,this.i,this.o,a,s),borderRadius:typeof p=="number"?p:b/2,cursor:o?"default":"pointer",WebkitTransition:C?null:"background 0.25s",MozTransition:C?null:"background 0.25s",transition:C?null:"background 0.25s"},F={height:b,width:Math.min(1.5*b,m-(this.t+b)/2+1),position:"relative",opacity:(k-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:C?null:"opacity 0.25s",MozTransition:C?null:"opacity 0.25s",transition:C?null:"opacity 0.25s"},X={height:b,width:Math.min(1.5*b,m-(this.t+b)/2+1),position:"absolute",opacity:1-(k-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:C?null:"opacity 0.25s",MozTransition:C?null:"opacity 0.25s",transition:C?null:"opacity 0.25s"},ce={height:this.t,width:this.t,background:kg(k,this.i,this.o,l,u),display:"inline-block",cursor:o?"default":"pointer",borderRadius:typeof p=="number"?p-1:"50%",position:"absolute",transform:"translateX("+k+"px)",top:Math.max(0,(b-this.t)/2),outline:0,boxShadow:N?y:g,border:0,WebkitTransition:C?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:C?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:C?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},ae={height:this.t,width:this.t,opacity:Math.max(2*(1-(k-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:C?null:"opacity 0.25s",MozTransition:C?null:"opacity 0.25s",transition:C?null:"opacity 0.25s"},_={height:this.t,width:this.t,opacity:Math.max(2*((k-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:C?null:"opacity 0.25s",MozTransition:C?null:"opacity 0.25s",transition:C?null:"opacity 0.25s"};return Z("div",{className:i,style:A,children:[Z("div",{className:"react-switch-bg",style:W,onClick:o?null:this.T,onMouseDown:function(L){return L.preventDefault()},children:[c&&w("div",{style:F,children:c}),f&&w("div",{style:X,children:f})]}),Z("div",{className:"react-switch-handle",style:ce,onClick:function(L){return L.preventDefault()},onMouseDown:o?null:this.p,onTouchStart:o?null:this.k,onTouchMove:o?null:this.m,onTouchEnd:o?null:this.M,onTouchCancel:o?null:this.O,children:[h&&w("div",{style:ae,children:h}),d&&w("div",{style:_,children:d})]}),w("input",{...od({},{type:"checkbox",role:"switch","aria-checked":r,checked:r,disabled:o,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},v,{ref:this.S,onFocus:this.D,onBlur:this.O,onKeyUp:this.C,onChange:this.$})})]})},t}(R.exports.Component);xs.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:Y$,checkedIcon:J$,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56};const Z$=xs.default?xs.default:xs;function eU({checked:e=!1,onChange:t,theme:n,name:r}){return w(Z$,{onChange:t,checked:e,uncheckedIcon:!1,checkedIcon:!1,offColor:n==="dark"?"#393939":"#e9e9e9",onColor:"#047aff",offHandleColor:"#fff",onHandleColor:"#fff",handleDiameter:24,height:28,width:44,className:"rs",name:r})}const qU=kn(e=>({theme:zp(e)}))(eU),tU="_ToggleSwitch_10mtp_1",nU="_slider_10mtp_28",Tg={ToggleSwitch:tU,slider:nU};function rU({options:e,value:t,name:n,onChange:r}){const o=R.exports.useMemo(()=>e.map(s=>s.value).indexOf(t),[e,t]),i=R.exports.useCallback(s=>{const l=Math.floor(100/e.length);if(s===e.length-1)return 100-e.length*l+l;if(s>-1)return l},[e]),a=R.exports.useMemo(()=>({width:i(o)+"%",left:o*i(0)+"%"}),[o,i]);return Z("div",{className:Tg.ToggleSwitch,children:[w("div",{className:Tg.slider,style:a}),e.map((s,l)=>{const u=`${n}-${s.label}`;return Z("label",{htmlFor:u,className:l===0?"":"border-left",style:{width:i(l)+"%"},children:[w("input",{id:u,name:n,type:"radio",value:s.value,checked:t===s.value,onChange:r}),w("div",{children:s.label})]},u)})]})}ye.memo(rU);const{lazy:Ca,Suspense:h_}=At,oU=Ca(()=>_n(()=>import("./Connections.e48eac36.js"),["./Connections.e48eac36.js","./useRemainingViewPortHeight.7395542b.js","./chevron-down.dd238e96.js","./index.92e2d967.js","./Fab.ef67ff10.js","./Fab.a0a7e573.css","./play.7b1a5f99.js","./Connections.fb8ea59b.css"],import.meta.url)),iU=Ca(()=>_n(()=>import("./Config.c09e8dbe.js"),["./Config.c09e8dbe.js","./logs.43986220.js","./Select.6c389032.js","./Select.1e55eba1.css","./Config.39d8d2ef.css"],import.meta.url)),aU=Ca(()=>_n(()=>import("./Logs.ac990610.js"),["./Logs.ac990610.js","./index.esm.e4dd1508.js","./logs.43986220.js","./debounce.c2d20996.js","./useRemainingViewPortHeight.7395542b.js","./Fab.ef67ff10.js","./Fab.a0a7e573.css","./play.7b1a5f99.js","./Logs.4b8e75d1.css"],import.meta.url)),sU=Ca(()=>_n(()=>import("./Proxies.16b46af4.js"),["./Proxies.16b46af4.js","./chevron-down.dd238e96.js","./Fab.ef67ff10.js","./Fab.a0a7e573.css","./TextFitler.61537a57.js","./debounce.c2d20996.js","./TextFitler.b21c0577.css","./index.92e2d967.js","./Select.6c389032.js","./Select.1e55eba1.css","./Proxies.3fa3509d.css"],import.meta.url)),lU=Ca(()=>_n(()=>import("./Rules.70e6962f.js"),["./Rules.70e6962f.js","./index.esm.e4dd1508.js","./TextFitler.61537a57.js","./debounce.c2d20996.js","./TextFitler.b21c0577.css","./index.92e2d967.js","./Fab.ef67ff10.js","./Fab.a0a7e573.css","./useRemainingViewPortHeight.7395542b.js","./Rules.e03c54a8.css"],import.meta.url)),uU=[{path:"/",element:w(E$,{})},{path:"/connections",element:w(Q4.Provider,{value:{hasProcessPath:!1},children:w(oU,{})})},{path:"/configs",element:w(iU,{})},{path:"/logs",element:w(aU,{})},{path:"/proxies",element:w(sU,{})},{path:"/rules",element:w(lU,{})},{path:"/about",element:w(OD,{})},!1].filter(Boolean);function cU(){return N1(uU)}function fU(){return Z(Nt,{children:[w(K4,{}),w(Q$,{}),w("div",{className:f_.content,children:w(h_,{fallback:w(C$,{}),children:w(cU,{})})})]})}function dU(){return N1([{path:"/backend",element:w(NS,{})},{path:"*",element:w(fU,{})}])}const pU=()=>w(t$,{children:w(oI,{children:w(XI,{initialState:hM,actions:vM,children:w(i2,{client:DD,children:w(vO,{children:Z("div",{className:f_.app,children:[w(AD,{}),w(h_,{fallback:w(wS,{}),children:w(dU,{})})]})})})})})}),hU=Boolean(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function vU(e){if("serviceWorker"in navigator){if(new URL("./",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{const n=".//sw.js";hU?(mU(n,e),navigator.serviceWorker.ready.then(()=>{console.log("This web app is being served cache-first by a service worker")})):v_(n,e)})}}function v_(e,t){navigator.serviceWorker.register(e).then(n=>{n.onupdatefound=()=>{const r=n.installing;r!=null&&(r.onstatechange=()=>{r.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content is available and will be used when all tabs for this page are closed. See https://cra.link/PWA."),t&&t.onUpdate&&t.onUpdate(n)):(console.log("Content is cached for offline use."),t&&t.onSuccess&&t.onSuccess(n)))})}}).catch(n=>{console.error("Error during service worker registration:",n)})}function mU(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(n=>{const r=n.headers.get("content-type");n.status===404||r!=null&&r.indexOf("javascript")===-1?navigator.serviceWorker.ready.then(o=>{o.unregister().then(()=>{window.location.reload()})}):v_(e,t)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}yU();const m_=document.getElementById("app"),gU=e1(m_);function _c(e){const t=document.createElement("link");t.href=e,t.rel="preload",t.as="font",t.crossOrigin="",document.head.appendChild(t)}function yU(){_c(hE),_c(vE),_c(mE)}c1.setAppElement(m_);gU.render(w(R.exports.StrictMode,{children:w(pU,{})}));vU();console.log("Checkout the repo: https://github.com/haishanh/yacd");console.log("Version:","0.3.8");export{RS as $,lD as A,JM as B,rS as C,gS as D,EU as E,Nt as F,_t as G,bU as H,EI as I,WD as J,NU as K,AU as L,Q4 as M,LU as N,RU as O,PU as P,Kn as Q,ye as R,Kp as S,KU as T,WU as U,_U as V,zU as W,tM as X,w4 as Y,a_ as Z,bc as _,is as a,nM as a0,jU as a1,VU as a2,th as a3,OU as a4,kU as a5,TU as a6,$U as a7,UU as a8,BU as a9,FU as aa,nh as ab,uD as ac,Bo as ad,DU as ae,rM as af,MU as ag,pa as ah,lm as ai,DC as aj,Ie as ak,SU as al,o2 as am,YC as an,c2 as ao,iI as ap,v2 as aq,Z as b,ar as c,c1 as d,kn as e,IU as f,qD as g,jo as h,At as i,w as j,ge as k,a$ as l,Sg as m,xg as n,Rg as o,na as p,u$ as q,R as r,HU as s,xU as t,ia as u,vS as v,ng as w,CU as x,GI as y,qU as z}; diff --git a/clash-bin/tests/data/config/public/assets/index.8bb012c6.js b/clash-bin/tests/data/config/public/assets/index.8bb012c6.js deleted file mode 100644 index 37fb4124a..000000000 --- a/clash-bin/tests/data/config/public/assets/index.8bb012c6.js +++ /dev/null @@ -1,9 +0,0 @@ -import{r as p,R as xo,b as ci,j as F,F as ns}from"./index.171f553a.js";const tt=p.exports.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),we=p.exports.createContext({});function bo(){return p.exports.useContext(we).visualElement}const At=p.exports.createContext(null),vt=typeof document<"u",mt=vt?p.exports.useLayoutEffect:p.exports.useEffect,gn=p.exports.createContext({strict:!1});function li(t,e,n,s){const o=bo(),i=p.exports.useContext(gn),r=p.exports.useContext(At),a=p.exports.useContext(tt).reducedMotion,c=p.exports.useRef(void 0);s=s||i.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:o,props:n,presenceId:r?r.id:void 0,blockInitialAnimation:r?r.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;return mt(()=>{l&&l.syncRender()}),p.exports.useEffect(()=>{l&&l.animationState&&l.animationState.animateChanges()}),mt(()=>()=>l&&l.notifyUnmount(),[]),l}function wt(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ui(t,e,n){return p.exports.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):wt(n)&&(n.current=s))},[e])}function Nt(t){return typeof t=="string"||Array.isArray(t)}function Te(t){return typeof t=="object"&&typeof t.start=="function"}const fi=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Pe(t){return Te(t.animate)||fi.some(e=>Nt(t[e]))}function So(t){return Boolean(Pe(t)||t.variants)}function di(t,e){if(Pe(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Nt(n)?n:void 0,animate:Nt(s)?s:void 0}}return t.inherit!==!1?e:{}}function hi(t){const{initial:e,animate:n}=di(t,p.exports.useContext(we));return p.exports.useMemo(()=>({initial:e,animate:n}),[ss(e),ss(n)])}function ss(t){return Array.isArray(t)?t.join(" "):t}const Q=t=>({isEnabled:e=>t.some(n=>!!e[n])}),zt={measureLayout:Q(["layout","layoutId","drag"]),animation:Q(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:Q(["exit"]),drag:Q(["drag","dragControls"]),focus:Q(["whileFocus"]),hover:Q(["whileHover","onHoverStart","onHoverEnd"]),tap:Q(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Q(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:Q(["whileInView","onViewportEnter","onViewportLeave"])};function Ye(t){for(const e in t)e==="projectionNodeConstructor"?zt.projectionNodeConstructor=t[e]:zt[e].Component=t[e]}function _(t){const e=p.exports.useRef(null);return e.current===null&&(e.current=t()),e.current}const Dt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let pi=1;function mi(){return _(()=>{if(Dt.hasEverUpdated)return pi++})}const $t=p.exports.createContext({});class gi extends xo.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:n}=this.props;return e&&e.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const Vo=p.exports.createContext({}),yn=Symbol.for("motionComponentSymbol");function wo({preloadedFeatures:t,createVisualElement:e,projectionNodeConstructor:n,useRender:s,useVisualState:o,Component:i}){t&&Ye(t);function r(c,l){const u={...p.exports.useContext(tt),...c,layoutId:yi(c)},{isStatic:f}=u;let d=null;const h=hi(c),m=f?void 0:mi(),x=o(c,f);if(!f&&vt){h.visualElement=li(i,x,u,e);const S=p.exports.useContext(gn).strict,V=p.exports.useContext(Vo);h.visualElement&&(d=h.visualElement.loadFeatures(u,S,t,m,n||zt.projectionNodeConstructor,V))}return ci(gi,{visualElement:h.visualElement,props:u,children:[d,F(we.Provider,{value:h,children:s(i,c,m,ui(x,h.visualElement,l),x,f,h.visualElement)})]})}const a=p.exports.forwardRef(r);return a[yn]=i,a}function yi({layoutId:t}){const e=p.exports.useContext($t).id;return e&&t!==void 0?e+"-"+t:t}function To(t){function e(s,o={}){return wo(t(s,o))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(s,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const vi=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function vn(t){return typeof t!="string"||t.includes("-")?!1:!!(vi.indexOf(t)>-1||/[A-Z]/.test(t))}const le={};function xi(t){Object.assign(le,t)}const ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],gt=new Set(ue);function Po(t,{layout:e,layoutId:n}){return gt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!le[t]||t==="opacity")}const U=t=>!!(t!=null&&t.getVelocity),bi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Si=(t,e)=>ue.indexOf(t)-ue.indexOf(e);function Vi({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:s=!0},o,i){let r="";e.sort(Si);for(const a of e)r+=`${bi[a]||a}(${t[a]}) `;return n&&!t.z&&(r+="translateZ(0)"),r=r.trim(),i?r=i(t,o?"":r):s&&o&&(r="none"),r}function xn(t){return t.startsWith("--")}const wi=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Co=(t,e)=>n=>Math.max(Math.min(n,e),t),It=t=>t%1?Number(t.toFixed(5)):t,Ht=/(-)?([\d]*\.?[\d])+/g,Ke=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Ti=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Xt(t){return typeof t=="string"}const xt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ft=Object.assign(Object.assign({},xt),{transform:Co(0,1)}),Jt=Object.assign(Object.assign({},xt),{default:1}),qt=t=>({test:e=>Xt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ot=qt("deg"),X=qt("%"),T=qt("px"),Pi=qt("vh"),Ci=qt("vw"),os=Object.assign(Object.assign({},X),{parse:t=>X.parse(t)/100,transform:t=>X.transform(t*100)}),bn=(t,e)=>n=>Boolean(Xt(n)&&Ti.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Ao=(t,e,n)=>s=>{if(!Xt(s))return s;const[o,i,r,a]=s.match(Ht);return{[t]:parseFloat(o),[e]:parseFloat(i),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},ht={test:bn("hsl","hue"),parse:Ao("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+X.transform(It(e))+", "+X.transform(It(n))+", "+It(Ft.transform(s))+")"},Ai=Co(0,255),Fe=Object.assign(Object.assign({},xt),{transform:t=>Math.round(Ai(t))}),at={test:bn("rgb","red"),parse:Ao("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Fe.transform(t)+", "+Fe.transform(e)+", "+Fe.transform(n)+", "+It(Ft.transform(s))+")"};function Ri(t){let e="",n="",s="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),s=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),s=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,s+=s,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:o?parseInt(o,16)/255:1}}const Xe={test:bn("#"),parse:Ri,transform:at.transform},B={test:t=>at.test(t)||Xe.test(t)||ht.test(t),parse:t=>at.test(t)?at.parse(t):ht.test(t)?ht.parse(t):Xe.parse(t),transform:t=>Xt(t)?t:t.hasOwnProperty("red")?at.transform(t):ht.transform(t)},Ro="${c}",Mo="${n}";function Mi(t){var e,n,s,o;return isNaN(t)&&Xt(t)&&((n=(e=t.match(Ht))===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)+((o=(s=t.match(Ke))===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0)>0}function Lo(t){typeof t=="number"&&(t=`${t}`);const e=[];let n=0;const s=t.match(Ke);s&&(n=s.length,t=t.replace(Ke,Ro),e.push(...s.map(B.parse)));const o=t.match(Ht);return o&&(t=t.replace(Ht,Mo),e.push(...o.map(xt.parse))),{values:e,numColors:n,tokenised:t}}function Eo(t){return Lo(t).values}function Oo(t){const{values:e,numColors:n,tokenised:s}=Lo(t),o=e.length;return i=>{let r=s;for(let a=0;atypeof t=="number"?0:t;function Ei(t){const e=Eo(t);return Oo(t)(e.map(Li))}const et={test:Mi,parse:Eo,createTransformer:Oo,getAnimatableNone:Ei},Oi=new Set(["brightness","contrast","saturate","opacity"]);function Di(t){let[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ht)||[];if(!s)return t;const o=n.replace(s,"");let i=Oi.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+o+")"}const Ii=/([a-z-]*)\(.*?\)/g,qe=Object.assign(Object.assign({},et),{getAnimatableNone:t=>{const e=t.match(Ii);return e?e.map(Di).join(" "):t}}),rs={...xt,transform:Math.round},Do={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,size:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:Jt,scaleX:Jt,scaleY:Jt,scaleZ:Jt,skew:ot,skewX:ot,skewY:ot,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:Ft,originX:os,originY:os,originZ:T,zIndex:rs,fillOpacity:Ft,strokeOpacity:Ft,numOctaves:rs};function Sn(t,e,n,s){const{style:o,vars:i,transform:r,transformKeys:a,transformOrigin:c}=t;a.length=0;let l=!1,u=!1,f=!0;for(const d in e){const h=e[d];if(xn(d)){i[d]=h;continue}const m=Do[d],x=wi(h,m);if(gt.has(d)){if(l=!0,r[d]=x,a.push(d),!f)continue;h!==(m.default||0)&&(f=!1)}else d.startsWith("origin")?(u=!0,c[d]=x):o[d]=x}if(e.transform||(l||s?o.transform=Vi(t,n,f,s):o.transform&&(o.transform="none")),u){const{originX:d="50%",originY:h="50%",originZ:m=0}=c;o.transformOrigin=`${d} ${h} ${m}`}}const Vn=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Io(t,e,n){for(const s in e)!U(e[s])&&!Po(s,n)&&(t[s]=e[s])}function Fi({transformTemplate:t},e,n){return p.exports.useMemo(()=>{const s=Vn();return Sn(s,e,{enableHardwareAcceleration:!n},t),Object.assign({},s.vars,s.style)},[e])}function ki(t,e,n){const s=t.style||{},o={};return Io(o,s,t),Object.assign(o,Fi(t,e,n)),t.transformValues?t.transformValues(o):o}function ji(t,e,n){const s={},o=ki(t,e,n);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),s.style=o,s}const _i=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],Bi=["whileTap","onTap","onTapStart","onTapCancel"],Ui=["onPan","onPanStart","onPanSessionStart","onPanEnd"],Ni=["whileInView","onViewportEnter","onViewportLeave","viewport"],zi=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...Ni,...Bi,..._i,...Ui]);function fe(t){return zi.has(t)}let Fo=t=>!fe(t);function ko(t){!t||(Fo=e=>e.startsWith("on")?!fe(e):t(e))}try{ko(require("@emotion/is-prop-valid").default)}catch{}function $i(t,e,n){const s={};for(const o in t)(Fo(o)||n===!0&&fe(o)||!e&&!fe(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]);return s}function is(t,e,n){return typeof t=="string"?t:T.transform(e+n*t)}function Hi(t,e,n){const s=is(e,t.x,t.width),o=is(n,t.y,t.height);return`${s} ${o}`}const Wi={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gi={offset:"strokeDashoffset",array:"strokeDasharray"};function Yi(t,e,n=1,s=0,o=!0){t.pathLength=1;const i=o?Wi:Gi;t[i.offset]=T.transform(-s);const r=T.transform(e),a=T.transform(n);t[i.array]=`${r} ${a}`}function wn(t,{attrX:e,attrY:n,originX:s,originY:o,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...c},l,u){Sn(t,c,l,u),t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:h}=t;f.transform&&(h&&(d.transform=f.transform),delete f.transform),h&&(s!==void 0||o!==void 0||d.transform)&&(d.transformOrigin=Hi(h,s!==void 0?s:.5,o!==void 0?o:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),i!==void 0&&Yi(f,i,r,a,!1)}const jo=()=>({...Vn(),attrs:{}});function Ki(t,e){const n=p.exports.useMemo(()=>{const s=jo();return wn(s,e,{enableHardwareAcceleration:!1},t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Io(s,t.style,t),n.style={...s,...n.style}}return n}function Xi(t=!1){return(n,s,o,i,{latestValues:r},a)=>{const l=(vn(n)?Ki:ji)(s,r,a),f={...$i(s,typeof n=="string",t),...l,ref:i};return o&&(f["data-projection-id"]=o),p.exports.createElement(n,f)}}const de=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function _o(t,{style:e,vars:n},s,o){Object.assign(t.style,e,o&&o.getProjectionStyles(s));for(const i in n)t.style.setProperty(i,n[i])}const Bo=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function Uo(t,e,n,s){_o(t,e,void 0,s);for(const o in e.attrs)t.setAttribute(Bo.has(o)?o:de(o),e.attrs[o])}function Tn(t){const{style:e}=t,n={};for(const s in e)(U(e[s])||Po(s,t))&&(n[s]=e[s]);return n}function No(t){const e=Tn(t);for(const n in t)if(U(t[n])){const s=n==="x"||n==="y"?"attr"+n.toUpperCase():n;e[s]=t[n]}return e}function Pn(t,e,n,s={},o={}){return typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,o)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,o)),e}const Wt=t=>Array.isArray(t),qi=t=>Boolean(t&&typeof t=="object"&&t.mix&&t.toValue),zo=t=>Wt(t)?t[t.length-1]||0:t;function oe(t){const e=U(t)?t.get():t;return qi(e)?e.toValue():e}function Zi({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,o,i){const r={latestValues:Ji(s,o,i,t),renderState:e()};return n&&(r.mount=a=>n(s,a,r)),r}const Cn=t=>(e,n)=>{const s=p.exports.useContext(we),o=p.exports.useContext(At),i=()=>Zi(t,e,s,o);return n?i():_(i)};function Ji(t,e,n,s){const o={},i=s(t);for(const d in i)o[d]=oe(i[d]);let{initial:r,animate:a}=t;const c=Pe(t),l=So(t);e&&l&&!c&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const f=u?a:r;return f&&typeof f!="boolean"&&!Te(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const m=Pn(t,h);if(!m)return;const{transitionEnd:x,transition:S,...V}=m;for(const b in V){let g=V[b];if(Array.isArray(g)){const v=u?g.length-1:0;g=g[v]}g!==null&&(o[b]=g)}for(const b in x)o[b]=x[b]}),o}const Qi={useVisualState:Cn({scrapeMotionValuesFromProps:No,createRenderState:jo,onMount:(t,e,{renderState:n,latestValues:s})=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}wn(n,s,{enableHardwareAcceleration:!1},t.transformTemplate),Uo(e,n)}})},ta={useVisualState:Cn({scrapeMotionValuesFromProps:Tn,createRenderState:Vn})};function An(t,{forwardMotionProps:e=!1},n,s,o){return{...vn(t)?Qi:ta,preloadedFeatures:n,useRender:Xi(e),createVisualElement:s,projectionNodeConstructor:o,Component:t}}var M;(function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"})(M||(M={}));function Ce(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Ze(t,e,n,s){p.exports.useEffect(()=>{const o=t.current;if(n&&o)return Ce(o,e,n,s)},[t,e,n,s])}function ea({whileFocus:t,visualElement:e}){const{animationState:n}=e,s=()=>{n&&n.setActive(M.Focus,!0)},o=()=>{n&&n.setActive(M.Focus,!1)};Ze(e,"focus",t?s:void 0),Ze(e,"blur",t?o:void 0)}function $o(t){return typeof PointerEvent<"u"&&t instanceof PointerEvent?t.pointerType==="mouse":t instanceof MouseEvent}function Ho(t){return!!t.touches}function na(t){return e=>{const n=e instanceof MouseEvent;(!n||n&&e.button===0)&&t(e)}}const sa={pageX:0,pageY:0};function oa(t,e="page"){const s=t.touches[0]||t.changedTouches[0]||sa;return{x:s[e+"X"],y:s[e+"Y"]}}function ra(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function Rn(t,e="page"){return{point:Ho(t)?oa(t,e):ra(t,e)}}const Wo=(t,e=!1)=>{const n=s=>t(s,Rn(s));return e?na(n):n},ia=()=>vt&&window.onpointerdown===null,aa=()=>vt&&window.ontouchstart===null,ca=()=>vt&&window.onmousedown===null,la={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ua={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Go(t){return ia()?t:aa()?ua[t]:ca()?la[t]:t}function Pt(t,e,n,s){return Ce(t,Go(e),Wo(n,e==="pointerdown"),s)}function he(t,e,n,s){return Ze(t,Go(e),n&&Wo(n,e==="pointerdown"),s)}function Yo(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const as=Yo("dragHorizontal"),cs=Yo("dragVertical");function Ko(t){let e=!1;if(t==="y")e=cs();else if(t==="x")e=as();else{const n=as(),s=cs();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function Xo(){const t=Ko(!0);return t?(t(),!1):!0}function ls(t,e,n){return(s,o)=>{!$o(s)||Xo()||(t.animationState&&t.animationState.setActive(M.Hover,e),n&&n(s,o))}}function fa({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:s}){he(s,"pointerenter",t||n?ls(s,!0,t):void 0,{passive:!t}),he(s,"pointerleave",e||n?ls(s,!1,e):void 0,{passive:!e})}const qo=(t,e)=>e?t===e?!0:qo(t,e.parentElement):!1;function Mn(t){return p.exports.useEffect(()=>()=>t(),[])}function Zo(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);oMath.min(Math.max(n,t),e),ke=.001,ha=.01,us=10,pa=.05,ma=1;function ga({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let o,i;da(t<=us*1e3);let r=1-e;r=me(pa,ma,r),t=me(ha,us,t/1e3),r<1?(o=l=>{const u=l*r,f=u*t,d=u-n,h=Je(l,r),m=Math.exp(-f);return ke-d/h*m},i=l=>{const f=l*r*t,d=f*n+n,h=Math.pow(r,2)*Math.pow(l,2)*t,m=Math.exp(-f),x=Je(Math.pow(l,2),r);return(-o(l)+ke>0?-1:1)*((d-h)*m)/x}):(o=l=>{const u=Math.exp(-l*t),f=(l-n)*t+1;return-ke+u*f},i=l=>{const u=Math.exp(-l*t),f=(n-l)*(t*t);return u*f});const a=5/t,c=va(o,i,a);if(t=t*1e3,isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:r*2*Math.sqrt(s*l),duration:t}}}const ya=12;function va(t,e,n){let s=n;for(let o=1;ot[n]!==void 0)}function Sa(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!fs(t,ba)&&fs(t,xa)){const n=ga(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Ln(t){var{from:e=0,to:n=1,restSpeed:s=2,restDelta:o}=t,i=Zo(t,["from","to","restSpeed","restDelta"]);const r={done:!1,value:e};let{stiffness:a,damping:c,mass:l,velocity:u,duration:f,isResolvedFromDuration:d}=Sa(i),h=ds,m=ds;function x(){const S=u?-(u/1e3):0,V=n-e,b=c/(2*Math.sqrt(a*l)),g=Math.sqrt(a/l)/1e3;if(o===void 0&&(o=Math.min(Math.abs(n-e)/100,.4)),b<1){const v=Je(g,b);h=w=>{const A=Math.exp(-b*g*w);return n-A*((S+b*g*V)/v*Math.sin(v*w)+V*Math.cos(v*w))},m=w=>{const A=Math.exp(-b*g*w);return b*g*A*(Math.sin(v*w)*(S+b*g*V)/v+V*Math.cos(v*w))-A*(Math.cos(v*w)*(S+b*g*V)-v*V*Math.sin(v*w))}}else if(b===1)h=v=>n-Math.exp(-g*v)*(V+(S+g*V)*v);else{const v=g*Math.sqrt(b*b-1);h=w=>{const A=Math.exp(-b*g*w),E=Math.min(v*w,300);return n-A*((S+b*g*V)*Math.sinh(E)+v*V*Math.cosh(E))/v}}}return x(),{next:S=>{const V=h(S);if(d)r.done=S>=f;else{const b=m(S)*1e3,g=Math.abs(b)<=s,v=Math.abs(n-V)<=o;r.done=g&&v}return r.value=r.done?n:V,r},flipTarget:()=>{u=-u,[e,n]=[n,e],x()}}}Ln.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const ds=t=>0,Gt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},L=(t,e,n)=>-n*t+n*e+t;function je(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function hs({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let o=0,i=0,r=0;if(!e)o=i=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;o=je(c,a,t+1/3),i=je(c,a,t),r=je(c,a,t-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(r*255),alpha:s}}const Va=(t,e,n)=>{const s=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-s)+s))},wa=[Xe,at,ht],ps=t=>wa.find(e=>e.test(t)),Jo=(t,e)=>{let n=ps(t),s=ps(e),o=n.parse(t),i=s.parse(e);n===ht&&(o=hs(o),n=at),s===ht&&(i=hs(i),s=at);const r=Object.assign({},o);return a=>{for(const c in r)c!=="alpha"&&(r[c]=Va(o[c],i[c],a));return r.alpha=L(o.alpha,i.alpha,a),n.transform(r)}},Qe=t=>typeof t=="number",Ta=(t,e)=>n=>e(t(n)),Ae=(...t)=>t.reduce(Ta);function Qo(t,e){return Qe(t)?n=>L(t,e,n):B.test(t)?Jo(t,e):er(t,e)}const tr=(t,e)=>{const n=[...t],s=n.length,o=t.map((i,r)=>Qo(i,e[r]));return i=>{for(let r=0;r{const n=Object.assign(Object.assign({},t),e),s={};for(const o in n)t[o]!==void 0&&e[o]!==void 0&&(s[o]=Qo(t[o],e[o]));return o=>{for(const i in s)n[i]=s[i](o);return n}};function ms(t){const e=et.parse(t),n=e.length;let s=0,o=0,i=0;for(let r=0;r{const n=et.createTransformer(e),s=ms(t),o=ms(e);return s.numHSL===o.numHSL&&s.numRGB===o.numRGB&&s.numNumbers>=o.numNumbers?Ae(tr(s.parsed,o.parsed),n):r=>`${r>0?e:t}`},Ca=(t,e)=>n=>L(t,e,n);function Aa(t){if(typeof t=="number")return Ca;if(typeof t=="string")return B.test(t)?Jo:er;if(Array.isArray(t))return tr;if(typeof t=="object")return Pa}function Ra(t,e,n){const s=[],o=n||Aa(t[0]),i=t.length-1;for(let r=0;rn(Gt(t,e,s))}function La(t,e){const n=t.length,s=n-1;return o=>{let i=0,r=!1;if(o<=t[0]?r=!0:o>=t[s]&&(i=s-1,r=!0),!r){let c=1;for(;co||c===s);c++);i=c-1}const a=Gt(t[i],t[i+1],o);return e[i](a)}}function En(t,e,{clamp:n=!0,ease:s,mixer:o}={}){const i=t.length;pe(i===e.length),pe(!s||!Array.isArray(s)||s.length===i-1),t[0]>t[i-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const r=Ra(e,s,o),a=i===2?Ma(t,r):La(t,r);return n?c=>a(me(t[0],t[i-1],c)):a}const Re=t=>e=>1-t(1-e),On=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ea=t=>e=>Math.pow(e,t),nr=t=>e=>e*e*((t+1)*e-t),Oa=t=>{const e=nr(t);return n=>(n*=2)<1?.5*e(n):.5*(2-Math.pow(2,-10*(n-1)))},sr=1.525,Da=4/11,Ia=8/11,Fa=9/10,Dn=t=>t,In=Ea(2),ka=Re(In),or=On(In),rr=t=>1-Math.sin(Math.acos(t)),Fn=Re(rr),ja=On(Fn),kn=nr(sr),_a=Re(kn),Ba=On(kn),Ua=Oa(sr),Na=4356/361,za=35442/1805,$a=16061/1805,ge=t=>{if(t===1||t===0)return t;const e=t*t;return tt<.5?.5*(1-ge(1-t*2)):.5*ge(t*2-1)+.5;function Ga(t,e){return t.map(()=>e||or).splice(0,t.length-1)}function Ya(t){const e=t.length;return t.map((n,s)=>s!==0?s/(e-1):0)}function Ka(t,e){return t.map(n=>n*e)}function re({from:t=0,to:e=1,ease:n,offset:s,duration:o=300}){const i={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=Ka(s&&s.length===r.length?s:Ya(r),o);function c(){return En(a,r,{ease:Array.isArray(n)?n:Ga(r,n)})}let l=c();return{next:u=>(i.value=l(u),i.done=u>=o,i),flipTarget:()=>{r.reverse(),l=c()}}}function Xa({velocity:t=0,from:e=0,power:n=.8,timeConstant:s=350,restDelta:o=.5,modifyTarget:i}){const r={done:!1,value:e};let a=n*t;const c=e+a,l=i===void 0?c:i(c);return l!==c&&(a=l-e),{next:u=>{const f=-a*Math.exp(-u/s);return r.done=!(f>o||f<-o),r.value=r.done?l:l+f,r},flipTarget:()=>{}}}const gs={keyframes:re,spring:Ln,decay:Xa};function qa(t){if(Array.isArray(t.to))return re;if(gs[t.type])return gs[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?re:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ln:re}const ir=1/60*1e3,Za=typeof performance<"u"?()=>performance.now():()=>Date.now(),ar=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Za()),ir);function Ja(t){let e=[],n=[],s=0,o=!1,i=!1;const r=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const f=u&&o,d=f?e:n;return l&&r.add(c),d.indexOf(c)===-1&&(d.push(c),f&&o&&(s=e.length)),c},cancel:c=>{const l=n.indexOf(c);l!==-1&&n.splice(l,1),r.delete(c)},process:c=>{if(o){i=!0;return}if(o=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let l=0;l(t[e]=Ja(()=>Yt=!0),t),{}),j=Zt.reduce((t,e)=>{const n=Me[e];return t[e]=(s,o=!1,i=!1)=>(Yt||ec(),n.schedule(s,o,i)),t},{}),q=Zt.reduce((t,e)=>(t[e]=Me[e].cancel,t),{}),_e=Zt.reduce((t,e)=>(t[e]=()=>Me[e].process(Ct),t),{}),tc=t=>Me[t].process(Ct),cr=t=>{Yt=!1,Ct.delta=tn?ir:Math.max(Math.min(t-Ct.timestamp,Qa),1),Ct.timestamp=t,en=!0,Zt.forEach(tc),en=!1,Yt&&(tn=!1,ar(cr))},ec=()=>{Yt=!0,tn=!0,en||ar(cr)},ye=()=>Ct;function lr(t,e,n=0){return t-e-n}function nc(t,e,n=0,s=!0){return s?lr(e+-t,e,n):e-(t-e)+n}function sc(t,e,n,s){return s?t>=e+n:t<=-n}const oc=t=>{const e=({delta:n})=>t(n);return{start:()=>j.update(e,!0),stop:()=>q.update(e)}};function jn(t){var e,n,{from:s,autoplay:o=!0,driver:i=oc,elapsed:r=0,repeat:a=0,repeatType:c="loop",repeatDelay:l=0,onPlay:u,onStop:f,onComplete:d,onRepeat:h,onUpdate:m}=t,x=Zo(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:S}=x,V,b=0,g=x.duration,v,w=!1,A=!0,E;const k=qa(x);!((n=(e=k).needsInterpolation)===null||n===void 0)&&n.call(e,s,S)&&(E=En([0,100],[s,S],{clamp:!1}),s=0,S=100);const I=k(Object.assign(Object.assign({},x),{from:s,to:S}));function $(){b++,c==="reverse"?(A=b%2===0,r=nc(r,g,l,A)):(r=lr(r,g,l),c==="mirror"&&I.flipTarget()),w=!1,h&&h()}function Z(){V.stop(),d&&d()}function H(nt){if(A||(nt=-nt),r+=nt,!w){const J=I.next(Math.max(0,r));v=J.value,E&&(v=E(v)),w=A?J.done:r<=0}m==null||m(v),w&&(b===0&&(g!=null||(g=r)),b{f==null||f(),V.stop()}}}function ur(t,e){return e?t*(1e3/e):0}function rc({from:t=0,velocity:e=0,min:n,max:s,power:o=.8,timeConstant:i=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:f,onComplete:d,onStop:h}){let m;function x(g){return n!==void 0&&gs}function S(g){return n===void 0?s:s===void 0||Math.abs(n-g){var w;f==null||f(v),(w=g.onUpdate)===null||w===void 0||w.call(g,v)},onComplete:d,onStop:h}))}function b(g){V(Object.assign({type:"spring",stiffness:r,damping:a,restDelta:c},g))}if(x(t))b({from:t,velocity:e,to:S(t)});else{let g=o*e+t;typeof l<"u"&&(g=l(g));const v=S(g),w=v===n?-1:1;let A,E;const k=I=>{A=E,E=I,e=ur(I-A,ye().delta),(w===1&&I>v||w===-1&&Im==null?void 0:m.stop()}}const nn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),ys=t=>nn(t)&&t.hasOwnProperty("z"),Qt=(t,e)=>Math.abs(t-e);function _n(t,e){if(Qe(t)&&Qe(e))return Qt(t,e);if(nn(t)&&nn(e)){const n=Qt(t.x,e.x),s=Qt(t.y,e.y),o=ys(t)&&ys(e)?Qt(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(s,2)+Math.pow(o,2))}}const ic=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},fr=(t,e)=>1-3*e+3*t,dr=(t,e)=>3*e-6*t,hr=t=>3*t,ve=(t,e,n)=>((fr(e,n)*t+dr(e,n))*t+hr(e))*t,pr=(t,e,n)=>3*fr(e,n)*t*t+2*dr(e,n)*t+hr(e),ac=1e-7,cc=10;function lc(t,e,n,s,o){let i,r,a=0;do r=e+(n-e)/2,i=ve(r,s,o)-t,i>0?n=r:e=r;while(Math.abs(i)>ac&&++a=fc?dc(r,f,t,n):d===0?f:lc(r,a,a+te,t,n)}return r=>r===0||r===1?r:ve(i(r),e,s)}function pc({onTap:t,onTapStart:e,onTapCancel:n,whileTap:s,visualElement:o}){const i=t||e||n||s,r=p.exports.useRef(!1),a=p.exports.useRef(null),c={passive:!(e||t||n||h)};function l(){a.current&&a.current(),a.current=null}function u(){return l(),r.current=!1,o.animationState&&o.animationState.setActive(M.Tap,!1),!Xo()}function f(m,x){!u()||(qo(o.getInstance(),m.target)?t&&t(m,x):n&&n(m,x))}function d(m,x){!u()||n&&n(m,x)}function h(m,x){l(),!r.current&&(r.current=!0,a.current=Ae(Pt(window,"pointerup",f,c),Pt(window,"pointercancel",d,c)),o.animationState&&o.animationState.setActive(M.Tap,!0),e&&e(m,x))}he(o,"pointerdown",i?h:void 0,c),Mn(l)}const mc="production",Bn=typeof process>"u"||process.env===void 0?mc:"production",vs=new Set;function Le(t,e,n){t||vs.has(e)||(console.warn(e),n&&console.warn(n),vs.add(e))}const sn=new WeakMap,Be=new WeakMap,gc=t=>{const e=sn.get(t.target);e&&e(t)},yc=t=>{t.forEach(gc)};function vc({root:t,...e}){const n=t||document;Be.has(n)||Be.set(n,{});const s=Be.get(n),o=JSON.stringify(e);return s[o]||(s[o]=new IntersectionObserver(yc,{root:t,...e})),s[o]}function xc(t,e,n){const s=vc(e);return sn.set(t,n),s.observe(t),()=>{sn.delete(t),s.unobserve(t)}}function bc({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:s,viewport:o={}}){const i=p.exports.useRef({hasEnteredView:!1,isInView:!1});let r=Boolean(e||n||s);o.once&&i.current.hasEnteredView&&(r=!1),(typeof IntersectionObserver>"u"?wc:Vc)(r,i.current,t,o)}const Sc={some:0,all:1};function Vc(t,e,n,{root:s,margin:o,amount:i="some",once:r}){p.exports.useEffect(()=>{if(!t)return;const a={root:s==null?void 0:s.current,rootMargin:o,threshold:typeof i=="number"?i:Sc[i]},c=l=>{const{isIntersecting:u}=l;if(e.isInView===u||(e.isInView=u,r&&!u&&e.hasEnteredView))return;u&&(e.hasEnteredView=!0),n.animationState&&n.animationState.setActive(M.InView,u);const f=n.getProps(),d=u?f.onViewportEnter:f.onViewportLeave;d&&d(l)};return xc(n.getInstance(),a,c)},[t,s,o,i])}function wc(t,e,n,{fallback:s=!0}){p.exports.useEffect(()=>{!t||!s||(Bn!=="production"&&Le(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:o}=n.getProps();o&&o(null),n.animationState&&n.animationState.setActive(M.InView,!0)}))},[t])}const ct=t=>e=>(t(e),null),mr={inView:ct(bc),tap:ct(pc),focus:ct(ea),hover:ct(fa)};function gr(){const t=p.exports.useContext(At);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,o=p.exports.useId();return p.exports.useEffect(()=>s(o),[]),!e&&n?[!1,()=>n&&n(o)]:[!0]}function If(){return Tc(p.exports.useContext(At))}function Tc(t){return t===null?!0:t.isPresent}function yr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;st*1e3,Pc={linear:Dn,easeIn:In,easeInOut:or,easeOut:ka,circIn:rr,circInOut:ja,circOut:Fn,backIn:kn,backInOut:Ba,backOut:_a,anticipate:Ua,bounceIn:Ha,bounceInOut:Wa,bounceOut:ge},xs=t=>{if(Array.isArray(t)){pe(t.length===4);const[e,n,s,o]=t;return hc(e,n,s,o)}else if(typeof t=="string")return Pc[t];return t},Cc=t=>Array.isArray(t)&&typeof t[0]!="number",bs=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&et.test(e)&&!e.startsWith("url(")),ut=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),ee=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Ue=()=>({type:"keyframes",ease:"linear",duration:.3}),Ac=t=>({type:"keyframes",duration:.8,values:t}),Ss={x:ut,y:ut,z:ut,rotate:ut,rotateX:ut,rotateY:ut,rotateZ:ut,scaleX:ee,scaleY:ee,scale:ee,opacity:Ue,backgroundColor:Ue,color:Ue,default:ee},Rc=(t,e)=>{let n;return Wt(e)?n=Ac:n=Ss[t]||Ss.default,{to:e,...n(e)}},Mc={...Do,color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:qe,WebkitFilter:qe},Un=t=>Mc[t];function Nn(t,e){var n;let s=Un(t);return s!==qe&&(s=et),(n=s.getAnimatableNone)===null||n===void 0?void 0:n.call(s,e)}const on={current:!1};function vr(t,e){const n=performance.now(),s=({timestamp:o})=>{const i=o-n;i>=e&&(q.read(s),t(i-e))};return j.read(s,!0),()=>q.read(s)}function Lc({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:o,repeat:i,repeatType:r,repeatDelay:a,from:c,...l}){return!!Object.keys(l).length}function Ec({ease:t,times:e,yoyo:n,flip:s,loop:o,...i}){const r={...i};return e&&(r.offset=e),i.duration&&(r.duration=xe(i.duration)),i.repeatDelay&&(r.repeatDelay=xe(i.repeatDelay)),t&&(r.ease=Cc(t)?t.map(xs):xs(t)),i.type==="tween"&&(r.type="keyframes"),(n||o||s)&&(n?r.repeatType="reverse":o?r.repeatType="loop":s&&(r.repeatType="mirror"),r.repeat=o||n||s||i.repeat),i.type!=="spring"&&(r.type="keyframes"),r}function Oc(t,e){var n,s;return(s=(n=(zn(t,e)||{}).delay)!==null&&n!==void 0?n:t.delay)!==null&&s!==void 0?s:0}function Dc(t){return Array.isArray(t.to)&&t.to[0]===null&&(t.to=[...t.to],t.to[0]=t.from),t}function Ic(t,e,n){return Array.isArray(e.to)&&t.duration===void 0&&(t.duration=.8),Dc(e),Lc(t)||(t={...t,...Rc(n,e.to)}),{...e,...Ec(t)}}function Fc(t,e,n,s,o){const i=zn(s,t)||{};let r=i.from!==void 0?i.from:e.get();const a=bs(t,n);r==="none"&&a&&typeof n=="string"?r=Nn(t,n):Vs(r)&&typeof n=="string"?r=ws(n):!Array.isArray(n)&&Vs(n)&&typeof r=="string"&&(n=ws(r));const c=bs(t,r);function l(){const f={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:d=>e.set(d)};return i.type==="inertia"||i.type==="decay"?rc({...f,...i}):jn({...Ic(i,f,t),onUpdate:d=>{f.onUpdate(d),i.onUpdate&&i.onUpdate(d)},onComplete:()=>{f.onComplete(),i.onComplete&&i.onComplete()}})}function u(){const f=zo(n);return e.set(f),o(),i.onUpdate&&i.onUpdate(f),i.onComplete&&i.onComplete(),{stop:()=>{}}}return!c||!a||i.type===!1?u:l}function Vs(t){return t===0||typeof t=="string"&&parseFloat(t)===0&&t.indexOf(" ")===-1}function ws(t){return typeof t=="number"?0:Nn("",t)}function zn(t,e){return t[e]||t.default||t}function $n(t,e,n,s={}){return on.current&&(s={type:!1}),e.start(o=>{let i;const r=Fc(t,e,n,s,o),a=Oc(s,t),c=()=>i=r();let l;return a?l=vr(c,xe(a)):c(),()=>{l&&l(),i&&i.stop()}})}const kc=t=>/^\-?\d*\.?\d+$/.test(t),jc=t=>/^0[^.\s]+$/.test(t);function Ee(t,e){t.indexOf(e)===-1&&t.push(e)}function Kt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function _c([...t],e,n){const s=e<0?t.length+e:e;if(s>=0&&sKt(this.subscriptions,e)}notify(e,n,s){const o=this.subscriptions.length;if(!!o)if(o===1)this.subscriptions[0](e,n,s);else for(let i=0;i!isNaN(parseFloat(t));class xr{constructor(e){this.version="7.6.4",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new kt,this.velocityUpdateSubscribers=new kt,this.renderSubscribers=new kt,this.canTrackVelocity=!1,this.updateAndNotify=(n,s=!0)=>{this.prev=this.current,this.current=n;const{delta:o,timestamp:i}=ye();this.lastUpdated!==i&&(this.timeDelta=o,this.lastUpdated=i,j.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),s&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>j.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=Bc(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(e){return e(this.get()),this.renderSubscribers.add(e)}attach(e){this.passiveEffect=e}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ur(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=e(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function G(t){return new xr(t)}const br=t=>e=>e.test(t),Uc={test:t=>t==="auto",parse:t=>t},Sr=[xt,T,X,ot,Ci,Pi,Uc],Lt=t=>Sr.find(br(t)),Nc=[...Sr,B,et],zc=t=>Nc.find(br(t));function $c(t){const e={};return t.forEachValue((n,s)=>e[s]=n.get()),e}function Hc(t){const e={};return t.forEachValue((n,s)=>e[s]=n.getVelocity()),e}function Oe(t,e,n){const s=t.getProps();return Pn(s,e,n!==void 0?n:s.custom,$c(t),Hc(t))}function Wc(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,G(n))}function Hn(t,e){const n=Oe(t,e);let{transitionEnd:s={},transition:o={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...s};for(const r in i){const a=zo(i[r]);Wc(t,r,a)}}function rn(t,e){[...e].reverse().forEach(s=>{var o;const i=t.getVariant(s);i&&Hn(t,i),(o=t.variantChildren)===null||o===void 0||o.forEach(r=>{rn(r,e)})})}function Gc(t,e){if(Array.isArray(e))return rn(t,e);if(typeof e=="string")return rn(t,[e]);Hn(t,e)}function Vr(t,e,n){var s,o;const i=Object.keys(e).filter(a=>!t.hasValue(a)),r=i.length;if(!!r)for(let a=0;aan(t,i,n));s=Promise.all(o)}else if(typeof e=="string")s=an(t,e,n);else{const o=typeof e=="function"?Oe(t,e,n.custom):e;s=Tr(t,o,n)}return s.then(()=>t.notifyAnimationComplete(e))}function an(t,e,n={}){var s;const o=Oe(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const r=o?()=>Tr(t,o,n):()=>Promise.resolve(),a=!((s=t.variantChildren)===null||s===void 0)&&s.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:d}=i;return Kc(t,e,u+l,f,d,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[l,u]=c==="beforeChildren"?[r,a]:[a,r];return l().then(u)}else return Promise.all([r(),a(n.delay)])}function Tr(t,e,{delay:n=0,transitionOverride:s,type:o}={}){var i;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...c}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");s&&(r=s);const u=[],f=o&&((i=t.animationState)===null||i===void 0?void 0:i.getState()[o]);for(const d in c){const h=t.getValue(d),m=c[d];if(!h||m===void 0||f&&Zc(f,d))continue;let x={delay:n,...r};t.shouldReduceMotion&>.has(d)&&(x={...x,type:!1,delay:0});let S=$n(d,h,m,x);be(l)&&(l.add(d),S=S.then(()=>l.remove(d))),u.push(S)}return Promise.all(u).then(()=>{a&&Hn(t,a)})}function Kc(t,e,n=0,s=0,o=1,i){const r=[],a=(t.variantChildren.size-1)*s,c=o===1?(l=0)=>l*s:(l=0)=>a-l*s;return Array.from(t.variantChildren).sort(qc).forEach((l,u)=>{r.push(an(l,e,{...i,delay:n+c(u)}).then(()=>l.notifyAnimationComplete(e)))}),Promise.all(r)}function Xc(t){t.forEachValue(e=>e.stop())}function qc(t,e){return t.sortNodePosition(e)}function Zc({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}const Gn=[M.Animate,M.InView,M.Focus,M.Hover,M.Tap,M.Drag,M.Exit],Jc=[...Gn].reverse(),Qc=Gn.length;function tl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Wn(t,n,s)))}function el(t){let e=tl(t);const n=sl();let s=!0;const o=(c,l)=>{const u=Oe(t,l);if(u){const{transition:f,transitionEnd:d,...h}=u;c={...c,...h,...d}}return c};function i(c){e=c(t)}function r(c,l){var u;const f=t.getProps(),d=t.getVariantContext(!0)||{},h=[],m=new Set;let x={},S=1/0;for(let b=0;bS&&A;const Z=Array.isArray(w)?w:[w];let H=Z.reduce(o,{});E===!1&&(H={});const{prevResolvedValues:lt={}}=v,nt={...lt,...H},J=O=>{$=!0,m.delete(O),v.needsAnimating[O]=!0};for(const O in nt){const st=H[O],bt=lt[O];x.hasOwnProperty(O)||(st!==bt?Wt(st)&&Wt(bt)?!yr(st,bt)||I?J(O):v.protectedKeys[O]=!0:st!==void 0?J(O):m.add(O):st!==void 0&&m.has(O)?J(O):v.protectedKeys[O]=!0)}v.prevProp=w,v.prevResolvedValues=H,v.isActive&&(x={...x,...H}),s&&t.blockInitialAnimation&&($=!1),$&&!k&&h.push(...Z.map(O=>({animation:O,options:{type:g,...c}})))}if(m.size){const b={};m.forEach(g=>{const v=t.getBaseTarget(g);v!==void 0&&(b[g]=v)}),h.push({animation:b})}let V=Boolean(h.length);return s&&f.initial===!1&&!t.manuallyAnimateOnMount&&(V=!1),s=!1,V?e(h):Promise.resolve()}function a(c,l,u){var f;if(n[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,l)}),n[c].isActive=l;const d=r(u,c);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:r,setActive:a,setAnimateFunction:i,getState:()=>n}}function nl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!yr(e,t):!1}function ft(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sl(){return{[M.Animate]:ft(!0),[M.InView]:ft(),[M.Hover]:ft(),[M.Tap]:ft(),[M.Drag]:ft(),[M.Focus]:ft(),[M.Exit]:ft()}}const Pr={animation:ct(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=el(t)),Te(e)&&p.exports.useEffect(()=>e.subscribe(t),[e])}),exit:ct(t=>{const{custom:e,visualElement:n}=t,[s,o]=gr(),i=p.exports.useContext(At);p.exports.useEffect(()=>{n.isPresent=s;const r=n.animationState&&n.animationState.setActive(M.Exit,!s,{custom:i&&i.custom||e});r&&!s&&r.then(o)},[s])})};class Cr{constructor(e,n,{transformPagePoint:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=ze(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,f=_n(l.offset,{x:0,y:0})>=3;if(!u&&!f)return;const{point:d}=l,{timestamp:h}=ye();this.history.push({...d,timestamp:h});const{onStart:m,onMove:x}=this.handlers;u||(m&&m(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{if(this.lastMoveEvent=l,this.lastMoveEventInfo=Ne(u,this.transformPagePoint),$o(l)&&l.buttons===0){this.handlePointerUp(l,u);return}j.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{this.end();const{onEnd:f,onSessionEnd:d}=this.handlers,h=ze(Ne(u,this.transformPagePoint),this.history);this.startEvent&&f&&f(l,h),d&&d(l,h)},Ho(e)&&e.touches.length>1)return;this.handlers=n,this.transformPagePoint=s;const o=Rn(e),i=Ne(o,this.transformPagePoint),{point:r}=i,{timestamp:a}=ye();this.history=[{...r,timestamp:a}];const{onSessionStart:c}=n;c&&c(e,ze(i,this.history)),this.removeListeners=Ae(Pt(window,"pointermove",this.handlePointerMove),Pt(window,"pointerup",this.handlePointerUp),Pt(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),q.update(this.updatePoint)}}function Ne(t,e){return e?{point:e(t.point)}:t}function Ts(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ze({point:t},e){return{point:t,delta:Ts(t,Ar(e)),offset:Ts(t,ol(e)),velocity:rl(e,.1)}}function ol(t){return t[0]}function Ar(t){return t[t.length-1]}function rl(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const o=Ar(t);for(;n>=0&&(s=t[n],!(o.timestamp-s.timestamp>xe(e)));)n--;if(!s)return{x:0,y:0};const i=(o.timestamp-s.timestamp)/1e3;if(i===0)return{x:0,y:0};const r={x:(o.x-s.x)/i,y:(o.y-s.y)/i};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function N(t){return t.max-t.min}function Ps(t,e=0,n=.01){return _n(t,e)n&&(t=s?L(n,t,s.max):Math.min(t,n)),t}function Ms(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function cl(t,{top:e,left:n,bottom:s,right:o}){return{x:Ms(t.x,n,o),y:Ms(t.y,e,s)}}function Ls(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.mins?n=Gt(e.min,e.max-s,t.min):s>o&&(n=Gt(t.min,t.max-o,e.min)),me(0,1,n)}function fl(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const cn=.35;function dl(t=cn){return t===!1?t=0:t===!0&&(t=cn),{x:Es(t,"left","right"),y:Es(t,"top","bottom")}}function Es(t,e,n){return{min:Os(t,e),max:Os(t,n)}}function Os(t,e){var n;return typeof t=="number"?t:(n=t[e])!==null&&n!==void 0?n:0}const Ds=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bt=()=>({x:Ds(),y:Ds()}),Is=()=>({min:0,max:0}),D=()=>({x:Is(),y:Is()});function K(t){return[t("x"),t("y")]}function Rr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function hl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function pl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function $e(t){return t===void 0||t===1}function ln({scale:t,scaleX:e,scaleY:n}){return!$e(t)||!$e(e)||!$e(n)}function dt(t){return ln(t)||Mr(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Mr(t){return Fs(t.x)||Fs(t.y)}function Fs(t){return t&&t!=="0%"}function Se(t,e,n){const s=t-n,o=e*s;return n+o}function ks(t,e,n,s,o){return o!==void 0&&(t=Se(t,o,s)),Se(t,n,s)+e}function un(t,e=0,n=1,s,o){t.min=ks(t.min,e,n,s,o),t.max=ks(t.max,e,n,s,o)}function Lr(t,{x:e,y:n}){un(t.x,e.translate,e.scale,e.originPoint),un(t.y,n.translate,n.scale,n.originPoint)}function ml(t,e,n,s=!1){var o,i;const r=n.length;if(!r)return;e.x=e.y=1;let a,c;for(let l=0;l{this.stopAnimation(),n&&this.snapToCursor(Rn(a,"page").point)},o=(a,c)=>{var l;const{drag:u,dragPropagation:f,onDragStart:d}=this.getProps();u&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Ko(u),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),K(h=>{var m,x;let S=this.getAxisMotionValue(h).get()||0;if(X.test(S)){const V=(x=(m=this.visualElement.projection)===null||m===void 0?void 0:m.layout)===null||x===void 0?void 0:x.actual[h];V&&(S=N(V)*(parseFloat(S)/100))}this.originPoint[h]=S}),d==null||d(a,c),(l=this.visualElement.animationState)===null||l===void 0||l.setActive(M.Drag,!0))},i=(a,c)=>{const{dragPropagation:l,dragDirectionLock:u,onDirectionLock:f,onDrag:d}=this.getProps();if(!l&&!this.openGlobalLock)return;const{offset:h}=c;if(u&&this.currentDirection===null){this.currentDirection=Sl(h),this.currentDirection!==null&&(f==null||f(this.currentDirection));return}this.updateAxis("x",c.point,h),this.updateAxis("y",c.point,h),this.visualElement.syncRender(),d==null||d(a,c)},r=(a,c)=>this.stop(a,c);this.panSession=new Cr(e,{onSessionStart:s,onStart:o,onMove:i,onSessionEnd:r},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i==null||i(e,n)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(M.Drag,!1)}updateAxis(e,n,s){const{drag:o}=this.getProps();if(!s||!ne(e,o,this.currentDirection))return;const i=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=al(r,this.constraints[e],this.elastic[e])),i.set(r)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),{layout:s}=this.visualElement.projection||{},o=this.constraints;e&&wt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=cl(s.actual,e):this.constraints=!1,this.elastic=dl(n),o!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&K(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=fl(s.actual[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!wt(e))return!1;const s=e.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=vl(s,o.root,this.visualElement.getTransformPagePoint());let r=ll(o.layout.actual,i);if(n){const a=n(hl(r));this.hasMutatedConstraints=!!a,a&&(r=Rr(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=K(u=>{var f;if(!ne(u,n,this.currentDirection))return;let d=(f=c==null?void 0:c[u])!==null&&f!==void 0?f:{};r&&(d={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,x={type:"inertia",velocity:s?e[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,x)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return $n(e,s,0,n)}stopAnimation(){K(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){var n,s;const o="_drag"+e.toUpperCase(),i=this.visualElement.getProps()[o];return i||this.visualElement.getValue(e,(s=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[e])!==null&&s!==void 0?s:0)}snapToCursor(e){K(n=>{const{drag:s}=this.getProps();if(!ne(n,s,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:r,max:a}=o.layout.actual[n];i.set(e[n]-L(r,a,.5))}})}scalePositionWithinConstraints(){var e;const{drag:n,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!wt(s)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};K(a=>{const c=this.getAxisMotionValue(a);if(c){const l=c.get();i[a]=ul({min:l,max:l},this.constraints[a])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=r?r({},""):"none",(e=o.root)===null||e===void 0||e.updateScroll(),o.updateLayout(),this.resolveConstraints(),K(a=>{if(!ne(a,n,null))return;const c=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];c.set(L(l,u,i[a]))})}addListeners(){var e;xl.set(this.visualElement,this);const n=this.visualElement.getInstance(),s=Pt(n,"pointerdown",l=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(l)}),o=()=>{const{dragConstraints:l}=this.getProps();wt(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",o);i&&!i.layout&&((e=i.root)===null||e===void 0||e.updateScroll(),i.updateLayout()),o();const a=Ce(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(K(f=>{const d=this.getAxisMotionValue(f);!d||(this.originPoint[f]+=l[f].translate,d.set(d.get()+l[f].translate))}),this.visualElement.syncRender())});return()=>{a(),s(),r(),c==null||c()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=cn,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:a}}}function ne(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Sl(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}function Vl(t){const{dragControls:e,visualElement:n}=t,s=_(()=>new bl(n));p.exports.useEffect(()=>e&&e.subscribe(s),[s,e]),p.exports.useEffect(()=>s.addListeners(),[s])}function wl({onPan:t,onPanStart:e,onPanEnd:n,onPanSessionStart:s,visualElement:o}){const i=t||e||n||s,r=p.exports.useRef(null),{transformPagePoint:a}=p.exports.useContext(tt),c={onSessionStart:s,onStart:e,onMove:t,onEnd:(u,f)=>{r.current=null,n&&n(u,f)}};p.exports.useEffect(()=>{r.current!==null&&r.current.updateHandlers(c)});function l(u){r.current=new Cr(u,c,{transformPagePoint:a})}he(o,"pointerdown",i&&l),Mn(()=>r.current&&r.current.end())}const Or={pan:ct(wl),drag:ct(Vl)},Ve={current:null},Yn={current:!1};function Dr(){if(Yn.current=!0,!!vt)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ve.current=t.matches;t.addListener(e),e()}else Ve.current=!1}const se=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function Tl(){const t=se.map(()=>new kt),e={},n={clearAllListeners:()=>t.forEach(s=>s.clear()),updatePropListeners:s=>{se.forEach(o=>{var i;const r="on"+o,a=s[r];(i=e[o])===null||i===void 0||i.call(e),a&&(e[o]=n[r](a))})}};return t.forEach((s,o)=>{n["on"+se[o]]=i=>s.add(i),n["notify"+se[o]]=(...i)=>s.notify(...i)}),n}function Pl(t,e,n){const{willChange:s}=e;for(const o in e){const i=e[o],r=n[o];if(U(i))t.addValue(o,i),be(s)&&s.add(o);else if(U(r))t.addValue(o,G(i)),be(s)&&s.remove(o);else if(r!==i)if(t.hasValue(o)){const a=t.getValue(o);!a.hasAnimated&&a.set(i)}else{const a=t.getStaticValue(o);t.addValue(o,G(a!==void 0?a:i))}}for(const o in n)e[o]===void 0&&t.removeValue(o);return e}const Ir=Object.keys(zt),Cl=Ir.length,Kn=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:s,measureViewportBox:o,render:i,readValueFromInstance:r,removeValueFromRenderState:a,sortNodePosition:c,scrapeMotionValuesFromProps:l})=>({parent:u,props:f,presenceId:d,blockInitialAnimation:h,visualState:m,reducedMotionConfig:x},S={})=>{let V=!1;const{latestValues:b,renderState:g}=m;let v;const w=Tl(),A=new Map,E=new Map;let k={};const I={...b},$=f.initial?{...b}:{};let Z;function H(){!v||!V||(lt(),i(v,g,f.style,C.projection))}function lt(){e(C,g,b,S,f)}function nt(){w.notifyUpdate(b)}function J(y,P){const R=P.onChange(z=>{b[y]=z,f.onUpdate&&j.update(nt,!1,!0)}),Y=P.onRenderRequest(C.scheduleRender);E.set(y,()=>{R(),Y()})}const{willChange:O,...st}=l(f);for(const y in st){const P=st[y];b[y]!==void 0&&U(P)&&(P.set(b[y],!1),be(O)&&O.add(y))}if(f.values)for(const y in f.values){const P=f.values[y];b[y]!==void 0&&U(P)&&P.set(b[y])}const bt=Pe(f),De=So(f),C={treeType:t,current:null,depth:u?u.depth+1:0,parent:u,children:new Set,presenceId:d,shouldReduceMotion:null,variantChildren:De?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(u==null?void 0:u.isMounted()),blockInitialAnimation:h,isMounted:()=>Boolean(v),mount(y){V=!0,v=C.current=y,C.projection&&C.projection.mount(y),De&&u&&!bt&&(Z=u==null?void 0:u.addVariantChild(C)),A.forEach((P,R)=>J(R,P)),Yn.current||Dr(),C.shouldReduceMotion=x==="never"?!1:x==="always"?!0:Ve.current,u==null||u.children.add(C),C.setProps(f)},unmount(){var y;(y=C.projection)===null||y===void 0||y.unmount(),q.update(nt),q.render(H),E.forEach(P=>P()),Z==null||Z(),u==null||u.children.delete(C),w.clearAllListeners(),v=void 0,V=!1},loadFeatures(y,P,R,Y,z,ii){const es=[];for(let Rt=0;RtC.scheduleRender(),animationType:typeof St=="string"?St:"both",initialPromotionConfig:ii,layoutScroll:ai})}return es},addVariantChild(y){var P;const R=C.getClosestVariantNode();if(R)return(P=R.variantChildren)===null||P===void 0||P.add(y),()=>R.variantChildren.delete(y)},sortNodePosition(y){return!c||t!==y.treeType?0:c(C.getInstance(),y.getInstance())},getClosestVariantNode:()=>De?C:u==null?void 0:u.getClosestVariantNode(),getLayoutId:()=>f.layoutId,getInstance:()=>v,getStaticValue:y=>b[y],setStaticValue:(y,P)=>b[y]=P,getLatestValues:()=>b,setVisibility(y){C.isVisible!==y&&(C.isVisible=y,C.scheduleRender())},makeTargetAnimatable(y,P=!0){return s(C,y,f,P)},measureViewportBox(){return o(v,f)},addValue(y,P){C.hasValue(y)&&C.removeValue(y),A.set(y,P),b[y]=P.get(),J(y,P)},removeValue(y){var P;A.delete(y),(P=E.get(y))===null||P===void 0||P(),E.delete(y),delete b[y],a(y,g)},hasValue:y=>A.has(y),getValue(y,P){if(f.values&&f.values[y])return f.values[y];let R=A.get(y);return R===void 0&&P!==void 0&&(R=G(P),C.addValue(y,R)),R},forEachValue:y=>A.forEach(y),readValue:y=>b[y]!==void 0?b[y]:r(v,y,S),setBaseTarget(y,P){I[y]=P},getBaseTarget(y){var P;const{initial:R}=f,Y=typeof R=="string"||typeof R=="object"?(P=Pn(f,R))===null||P===void 0?void 0:P[y]:void 0;if(R&&Y!==void 0)return Y;if(n){const z=n(f,y);if(z!==void 0&&!U(z))return z}return $[y]!==void 0&&Y===void 0?void 0:I[y]},...w,build(){return lt(),g},scheduleRender(){j.render(H,!1,!0)},syncRender:H,setProps(y){(y.transformTemplate||f.transformTemplate)&&C.scheduleRender(),f=y,w.updatePropListeners(y),k=Pl(C,l(f),k)},getProps:()=>f,getVariant:y=>{var P;return(P=f.variants)===null||P===void 0?void 0:P[y]},getDefaultTransition:()=>f.transition,getTransformPagePoint:()=>f.transformPagePoint,getVariantContext(y=!1){if(y)return u==null?void 0:u.getVariantContext();if(!bt){const R=(u==null?void 0:u.getVariantContext())||{};return f.initial!==void 0&&(R.initial=f.initial),R}const P={};for(let R=0;R{const i=o.get();if(!fn(i))return;const r=dn(i,s);r&&o.set(r)});for(const o in e){const i=e[o];if(!fn(i))continue;const r=dn(i,s);!r||(e[o]=r,n&&n[o]===void 0&&(n[o]=i))}return{target:e,transitionEnd:n}}const Ll=new Set(["width","height","top","left","right","bottom","x","y"]),jr=t=>Ll.has(t),El=t=>Object.keys(t).some(jr),_r=(t,e)=>{t.set(e,!1),t.set(e)},_s=t=>t===xt||t===T;var Bs;(function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"})(Bs||(Bs={}));const Us=(t,e)=>parseFloat(t.split(", ")[e]),Ns=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const o=s.match(/^matrix3d\((.+)\)$/);if(o)return Us(o[1],e);{const i=s.match(/^matrix\((.+)\)$/);return i?Us(i[1],t):0}},Ol=new Set(["x","y","z"]),Dl=ue.filter(t=>!Ol.has(t));function Il(t){const e=[];return Dl.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}const zs={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Ns(4,13),y:Ns(5,14)},Fl=(t,e,n)=>{const s=e.measureViewportBox(),o=e.getInstance(),i=getComputedStyle(o),{display:r}=i,a={};r==="none"&&e.setStaticValue("display",t.display||"block"),n.forEach(l=>{a[l]=zs[l](s,i)}),e.syncRender();const c=e.measureViewportBox();return n.forEach(l=>{const u=e.getValue(l);_r(u,a[l]),t[l]=zs[l](c,i)}),t},kl=(t,e,n={},s={})=>{e={...e},s={...s};const o=Object.keys(e).filter(jr);let i=[],r=!1;const a=[];if(o.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=n[c],f=Lt(u);const d=e[c];let h;if(Wt(d)){const m=d.length,x=d[0]===null?1:0;u=d[x],f=Lt(u);for(let S=x;S=0?window.pageYOffset:null,l=Fl(e,t,a);return i.length&&i.forEach(([u,f])=>{t.getValue(u).set(f)}),t.syncRender(),vt&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:s}}else return{target:e,transitionEnd:s}};function jl(t,e,n,s){return El(e)?kl(t,e,n,s):{target:e,transitionEnd:s}}const _l=(t,e,n,s)=>{const o=Ml(t,e,s);return e=o.target,s=o.transitionEnd,jl(t,e,n,s)};function Bl(t){return window.getComputedStyle(t)}const Br={treeType:"dom",readValueFromInstance(t,e){if(gt.has(e)){const n=Un(e);return n&&n.default||0}else{const n=Bl(t),s=(xn(e)?n.getPropertyValue(e):n[e])||0;return typeof s=="string"?s.trim():s}},sortNodePosition(t,e){return t.compareDocumentPosition(e)&2?1:-1},getBaseTarget(t,e){var n;return(n=t.style)===null||n===void 0?void 0:n[e]},measureViewportBox(t,{transformPagePoint:e}){return Er(t,e)},resetTransform(t,e,n){const{transformTemplate:s}=n;e.style.transform=s?s({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...s},{transformValues:o},i=!0){let r=wr(s,e||{},t);if(o&&(n&&(n=o(n)),s&&(s=o(s)),r&&(r=o(r))),i){Vr(t,s,r);const a=_l(t,s,r,n);n=a.transitionEnd,s=a.target}return{transition:e,transitionEnd:n,...s}},scrapeMotionValuesFromProps:Tn,build(t,e,n,s,o){t.isVisible!==void 0&&(e.style.visibility=t.isVisible?"visible":"hidden"),Sn(e,n,s,o.transformTemplate)},render:_o},Ul=Kn(Br),Nl=Kn({...Br,getBaseTarget(t,e){return t[e]},readValueFromInstance(t,e){var n;return gt.has(e)?((n=Un(e))===null||n===void 0?void 0:n.default)||0:(e=Bo.has(e)?e:de(e),t.getAttribute(e))},scrapeMotionValuesFromProps:No,build(t,e,n,s,o){wn(e,n,s,o.transformTemplate)},render:Uo}),Xn=(t,e)=>vn(t)?Nl(e,{enableHardwareAcceleration:!1}):Ul(e,{enableHardwareAcceleration:!0});function $s(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Et={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=$s(t,e.target.x),s=$s(t,e.target.y);return`${n}% ${s}%`}},Hs="_$css",zl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,o=t.includes("var("),i=[];o&&(t=t.replace(kr,h=>(i.push(h),Hs)));const r=et.parse(t);if(r.length>5)return s;const a=et.createTransformer(t),c=typeof r[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;r[0+c]/=l,r[1+c]/=u;const f=L(l,u,.5);typeof r[2+c]=="number"&&(r[2+c]/=f),typeof r[3+c]=="number"&&(r[3+c]/=f);let d=a(r);if(o){let h=0;d=d.replace(Hs,()=>{const m=i[h];return h++,m})}return d}};class $l extends xo.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:o}=this.props,{projection:i}=e;xi(Wl),i&&(n.group&&n.group.add(i),s&&s.register&&o&&s.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Dt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:o,isPresent:i}=this.props,r=s.projection;return r&&(r.isPresent=i,o||e.layoutDependency!==n||n===void 0?r.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?r.promote():r.relegate()||j.postRender(()=>{var a;!((a=r.getStack())===null||a===void 0)&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:o}=e;o&&(o.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(o),s!=null&&s.deregister&&s.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e==null||e()}render(){return null}}function Hl(t){const[e,n]=gr(),s=p.exports.useContext($t);return F($l,{...t,layoutGroup:s,switchLayoutGroup:p.exports.useContext(Vo),isPresent:e,safeToRemove:n})}const Wl={borderRadius:{...Et,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Et,borderTopRightRadius:Et,borderBottomLeftRadius:Et,borderBottomRightRadius:Et,boxShadow:zl},Ur={measureLayout:Hl};function Gl(t,e,n={}){const s=U(t)?t:G(t);return $n("",s,e,n),{stop:()=>s.stop(),isAnimating:()=>s.isAnimating()}}const Nr=["TopLeft","TopRight","BottomLeft","BottomRight"],Yl=Nr.length,Ws=t=>typeof t=="string"?parseFloat(t):t,Gs=t=>typeof t=="number"||T.test(t);function Kl(t,e,n,s,o,i){var r,a,c,l;o?(t.opacity=L(0,(r=n.opacity)!==null&&r!==void 0?r:1,Xl(s)),t.opacityExit=L((a=e.opacity)!==null&&a!==void 0?a:1,0,ql(s))):i&&(t.opacity=L((c=e.opacity)!==null&&c!==void 0?c:1,(l=n.opacity)!==null&&l!==void 0?l:1,s));for(let u=0;use?1:n(Gt(t,e,s))}function Ks(t,e){t.min=e.min,t.max=e.max}function W(t,e){Ks(t.x,e.x),Ks(t.y,e.y)}function Xs(t,e,n,s,o){return t-=e,t=Se(t,1/n,s),o!==void 0&&(t=Se(t,1/o,s)),t}function Zl(t,e=0,n=1,s=.5,o,i=t,r=t){if(X.test(e)&&(e=parseFloat(e),e=L(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=L(i.min,i.max,s);t===i&&(a-=e),t.min=Xs(t.min,e,n,a,o),t.max=Xs(t.max,e,n,a,o)}function qs(t,e,[n,s,o],i,r){Zl(t,e[n],e[s],e[o],e.scale,i,r)}const Jl=["x","scaleX","originX"],Ql=["y","scaleY","originY"];function Zs(t,e,n,s){qs(t.x,e,Jl,n==null?void 0:n.x,s==null?void 0:s.x),qs(t.y,e,Ql,n==null?void 0:n.y,s==null?void 0:s.y)}function Js(t){return t.translate===0&&t.scale===1}function $r(t){return Js(t.x)&&Js(t.y)}function Hr(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Qs(t){return N(t.x)/N(t.y)}function tu(t,e,n=.1){return _n(t,e)<=n}class eu{constructor(){this.members=[]}add(e){Ee(this.members,e),e.scheduleRender()}remove(e){if(Kt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(o=>e===o);if(n===0)return!1;let s;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){s=i;break}}return s?(this.promote(s),!0):!1}promote(e,n){var s;const o=this.lead;if(e!==o&&(this.prevLead=o,this.lead=e,e.show(),o)){o.instance&&o.scheduleRender(),e.scheduleRender(),e.resumeFrom=o,n&&(e.resumeFrom.preserveOpacity=!0),o.snapshot&&(e.snapshot=o.snapshot,e.snapshot.latestValues=o.animationValues||o.latestValues,e.snapshot.isShared=!0),!((s=e.root)===null||s===void 0)&&s.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,o,i,r;(s=(n=e.options).onExitComplete)===null||s===void 0||s.call(n),(r=(o=e.resumingFrom)===null||o===void 0?void 0:(i=o.options).onExitComplete)===null||r===void 0||r.call(i)})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const nu="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function to(t,e,n){const s=t.x.translate/e.x,o=t.y.translate/e.y;let i=`translate3d(${s}px, ${o}px, 0) `;if(i+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:c,rotateX:l,rotateY:u}=n;c&&(i+=`rotate(${c}deg) `),l&&(i+=`rotateX(${l}deg) `),u&&(i+=`rotateY(${u}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return i+=`scale(${r}, ${a})`,i===nu?"none":i}const su=(t,e)=>t.depth-e.depth;class ou{constructor(){this.children=[],this.isDirty=!1}add(e){Ee(this.children,e),this.isDirty=!0}remove(e){Kt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(su),this.isDirty=!1,this.children.forEach(e)}}const eo=["","X","Y","Z"],no=1e3;function Wr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(r,a={},c=e==null?void 0:e()){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(lu),this.nodes.forEach(uu)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=r,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,r&&this.root.registerPotentialNode(r,this);for(let l=0;lthis.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=vr(h,250),Dt.hasAnimatedSinceResize&&(Dt.hasAnimatedSinceResize=!1,this.nodes.forEach(oo))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&f&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:x})=>{var S,V,b,g,v;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=(V=(S=this.options.transition)!==null&&S!==void 0?S:f.getDefaultTransition())!==null&&V!==void 0?V:mu,{onLayoutAnimationStart:A,onLayoutAnimationComplete:E}=f.getProps(),k=!this.targetLayout||!Hr(this.targetLayout,x)||m,I=!h&&m;if(((b=this.resumeFrom)===null||b===void 0?void 0:b.instance)||I||h&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,I);const $={...zn(w,"layout"),onPlay:A,onComplete:E};f.shouldReduceMotion&&($.delay=0,$.type=!1),this.startAnimation($)}else!h&&this.animationProgress===0&&oo(this),this.isLead()&&((v=(g=this.options).onExitComplete)===null||v===void 0||v.call(g));this.targetLayout=x})}unmount(){var r,a;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(r=this.getStack())===null||r===void 0||r.remove(this),(a=this.parent)===null||a===void 0||a.children.delete(this),this.instance=void 0,q.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var r;return this.isAnimationBlocked||((r=this.parent)===null||r===void 0?void 0:r.isTreeAnimationBlocked())||!1}startUpdate(){var r;this.isUpdateBlocked()||(this.isUpdating=!0,(r=this.nodes)===null||r===void 0||r.forEach(fu))}willUpdate(r=!0){var a,c,l;if(this.root.isUpdateBlocked()){(c=(a=this.options).onExitComplete)===null||c===void 0||c.call(a);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const r=this.measure(),a=this.removeTransform(this.removeElementScroll(r));co(a),this.snapshot={measured:r,layout:a,latestValues:{}}}updateLayout(){var r;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var b;const g=V/1e3;ro(d.x,r.x,g),ro(d.y,r.y,g),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&((b=this.relativeParent)===null||b===void 0?void 0:b.layout)&&(_t(h,this.layout.actual,this.relativeParent.layout.actual),hu(this.relativeTarget,this.relativeTargetOrigin,h,g)),m&&(this.animationValues=f,Kl(f,u,this.latestValues,g,S,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},this.mixTargetDelta(0)}startAnimation(r){var a,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)===null||a===void 0||a.stop(),this.resumingFrom&&((c=this.resumingFrom.currentAnimation)===null||c===void 0||c.stop()),this.pendingAnimation&&(q.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=j.update(()=>{Dt.hasAnimatedSinceResize=!0,this.currentAnimation=Gl(0,no,{...r,onUpdate:l=>{var u;this.mixTargetDelta(l),(u=r.onUpdate)===null||u===void 0||u.call(r,l)},onComplete:()=>{var l;(l=r.onComplete)===null||l===void 0||l.call(r),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var r;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(r=this.getStack())===null||r===void 0||r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var r;this.currentAnimation&&((r=this.mixTargetDelta)===null||r===void 0||r.call(this,no),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=r;if(!(!a||!c||!l)){if(this!==r&&this.layout&&l&&Gr(this.options.animationType,this.layout.actual,l.actual)){c=this.target||D();const f=N(this.layout.actual.x);c.x.min=r.target.x.min,c.x.max=c.x.min+f;const d=N(this.layout.actual.y);c.y.min=r.target.y.min,c.y.max=c.y.min+d}W(a,c),Tt(a,u),jt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){var c,l,u;this.sharedNodes.has(r)||this.sharedNodes.set(r,new eu),this.sharedNodes.get(r).add(a),a.promote({transition:(c=a.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(u=(l=a.options.initialPromotionConfig)===null||l===void 0?void 0:l.shouldPreserveFollowOpacity)===null||u===void 0?void 0:u.call(l,a)})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var r;const{layoutId:a}=this.options;return a?((r=this.getStack())===null||r===void 0?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:a}=this.options;return a?(r=this.getStack())===null||r===void 0?void 0:r.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const c={};for(let l=0;l{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(so),this.root.sharedNodes.clear()}}}function ru(t){t.updateLayout()}function iu(t){var e,n,s;const o=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{actual:i,measured:r}=t.layout,{animationType:a}=t.options;a==="size"?K(d=>{const h=o.isShared?o.measured[d]:o.layout[d],m=N(h);h.min=i[d].min,h.max=h.min+m}):Gr(a,o.layout,i)&&K(d=>{const h=o.isShared?o.measured[d]:o.layout[d],m=N(i[d]);h.max=h.min+m});const c=Bt();jt(c,i,o.layout);const l=Bt();o.isShared?jt(l,t.applyTransform(r,!0),o.measured):jt(l,i,o.layout);const u=!$r(c);let f=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:d,layout:h}=t.relativeParent;if(d&&h){const m=D();_t(m,o.layout,d.layout);const x=D();_t(x,i,h.actual),Hr(m,x)||(f=!0)}}t.notifyListeners("didUpdate",{layout:i,snapshot:o,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeTargetChanged:f})}else t.isLead()&&((s=(n=t.options).onExitComplete)===null||s===void 0||s.call(n));t.options.transition=void 0}function au(t){t.clearSnapshot()}function so(t){t.clearMeasurements()}function cu(t){const{visualElement:e}=t.options;e!=null&&e.getProps().onBeforeLayoutMeasure&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function oo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function lu(t){t.resolveTargetDelta()}function uu(t){t.calcProjection()}function fu(t){t.resetRotation()}function du(t){t.removeLeadSnapshot()}function ro(t,e,n){t.translate=L(e.translate,0,n),t.scale=L(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function io(t,e,n,s){t.min=L(e.min,n.min,s),t.max=L(e.max,n.max,s)}function hu(t,e,n,s){io(t.x,e.x,n.x,s),io(t.y,e.y,n.y,s)}function pu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const mu={duration:.45,ease:[.4,0,.1,1]};function gu(t,e){let n=t.root;for(let i=t.path.length-1;i>=0;i--)if(Boolean(t.path[i].instance)){n=t.path[i];break}const o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function ao(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function co(t){ao(t.x),ao(t.y)}function Gr(t,e,n){return t==="position"||t==="preserve-aspect"&&!tu(Qs(e),Qs(n),.2)}const yu=Wr({attachResizeListener:(t,e)=>Ce(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pt={current:void 0},qn=Wr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pt.current){const t=new yu(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),pt.current=t}return pt.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>Boolean(window.getComputedStyle(t).position==="fixed")}),Yr={...Pr,...mr,...Or,...Ur},Kr=To((t,e)=>An(t,e,Yr,Xn,qn));function kf(t){return wo(An(t,{forwardMotionProps:!1},Yr,Xn,qn))}const jf=To(An);function Xr(){const t=p.exports.useRef(!1);return mt(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Zn(){const t=Xr(),[e,n]=p.exports.useState(0),s=p.exports.useCallback(()=>{t.current&&n(e+1)},[e]);return[p.exports.useCallback(()=>j.postRender(s),[s]),e]}class vu extends p.exports.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function xu({children:t,isPresent:e}){const n=p.exports.useId(),s=p.exports.useRef(null),o=p.exports.useRef({width:0,height:0,top:0,left:0});return p.exports.useInsertionEffect(()=>{const{width:i,height:r,top:a,left:c}=o.current;if(e||!s.current||!i||!r)return;s.current.dataset.motionPopId=n;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` - [data-motion-pop-id="${n}"] { - position: absolute !important; - width: ${i}px !important; - height: ${r}px !important; - top: ${a}px !important; - left: ${c}px !important; - } - `),()=>{document.head.removeChild(l)}},[e]),F(vu,{isPresent:e,childRef:s,sizeRef:o,children:p.exports.cloneElement(t,{ref:s})})}const He=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:o,presenceAffectsLayout:i,mode:r})=>{const a=_(bu),c=p.exports.useId(),l=p.exports.useMemo(()=>({id:c,initial:e,isPresent:n,custom:o,onExitComplete:u=>{a.set(u,!0);for(const f of a.values())if(!f)return;s&&s()},register:u=>(a.set(u,!1),()=>a.delete(u))}),i?void 0:[n]);return p.exports.useMemo(()=>{a.forEach((u,f)=>a.set(f,!1))},[n]),p.exports.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),r==="popLayout"&&(t=F(xu,{isPresent:n,children:t})),F(At.Provider,{value:l,children:t})};function bu(){return new Map}const Vt=t=>t.key||"";function Su(t,e){t.forEach(n=>{const s=Vt(n);e.set(s,n)})}function Vu(t){const e=[];return p.exports.Children.forEach(t,n=>{p.exports.isValidElement(n)&&e.push(n)}),e}const _f=({children:t,custom:e,initial:n=!0,onExitComplete:s,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:r="sync"})=>{o&&(r="wait",Le(!1,"Replace exitBeforeEnter with mode='wait'"));let[a]=Zn();const c=p.exports.useContext($t).forceRender;c&&(a=c);const l=Xr(),u=Vu(t);let f=u;const d=new Set,h=p.exports.useRef(f),m=p.exports.useRef(new Map).current,x=p.exports.useRef(!0);if(mt(()=>{x.current=!1,Su(u,m),h.current=f}),Mn(()=>{x.current=!0,m.clear(),d.clear()}),x.current)return F(ns,{children:f.map(g=>F(He,{isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:i,mode:r,children:g},Vt(g)))});f=[...f];const S=h.current.map(Vt),V=u.map(Vt),b=S.length;for(let g=0;g{if(V.indexOf(g)!==-1)return;const v=m.get(g);if(!v)return;const w=S.indexOf(g),A=()=>{m.delete(g),d.delete(g);const E=h.current.findIndex(k=>k.key===g);if(h.current.splice(E,1),!d.size){if(h.current=u,l.current===!1)return;a(),s&&s()}};f.splice(w,0,F(He,{isPresent:!1,onExitComplete:A,custom:e,presenceAffectsLayout:i,mode:r,children:v},Vt(v)))}),f=f.map(g=>{const v=g.key;return d.has(v)?g:F(He,{isPresent:!0,presenceAffectsLayout:i,mode:r,children:g},Vt(g))}),Bn!=="production"&&r==="wait"&&f.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),F(ns,{children:d.size?f:f.map(g=>p.exports.cloneElement(g))})},wu=p.exports.createContext(null),Tu=t=>!t.isLayoutDirty&&t.willUpdate(!1);function lo(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Tu);return{add:s=>{t.add(s),e.set(s,s.addEventListener("willUpdate",n))},remove:s=>{var o;t.delete(s),(o=e.get(s))===null||o===void 0||o(),e.delete(s),n()},dirty:n}}const qr=t=>t===!0,Pu=t=>qr(t===!0)||t==="id",Cu=({children:t,id:e,inheritId:n,inherit:s=!0})=>{n!==void 0&&(s=n);const o=p.exports.useContext($t),i=p.exports.useContext(wu),[r,a]=Zn(),c=p.exports.useRef(null),l=o.id||i;c.current===null&&(Pu(s)&&l&&(e=e?l+"-"+e:l),c.current={id:e,group:qr(s)&&o.group||lo()});const u=p.exports.useMemo(()=>({...c.current,forceRender:r}),[a]);return F($t.Provider,{value:u,children:t})};let Au=0;const Bf=({children:t})=>(p.exports.useEffect(()=>{},[]),F(Cu,{id:_(()=>`asl-${Au++}`),children:t}));function Uf({children:t,isValidProp:e,...n}){e&&ko(e),n={...p.exports.useContext(tt),...n},n.isStatic=_(()=>n.isStatic);const s=p.exports.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return F(tt.Provider,{value:s,children:t})}function Nf({children:t,features:e,strict:n=!1}){const[,s]=p.exports.useState(!We(e)),o=p.exports.useRef(void 0);if(!We(e)){const{renderer:i,...r}=e;o.current=i,Ye(r)}return p.exports.useEffect(()=>{We(e)&&e().then(({renderer:i,...r})=>{Ye(r),o.current=i,s(!0)})},[]),F(gn.Provider,{value:{renderer:o.current,strict:n},children:t})}function We(t){return typeof t=="function"}const Zr=p.exports.createContext(null);function Ru(t,e,n,s){if(!s)return t;const o=t.findIndex(u=>u.value===e);if(o===-1)return t;const i=s>0?1:-1,r=t[o+i];if(!r)return t;const a=t[o],c=r.layout,l=L(c.min,c.max,.5);return i===1&&a.layout.max+n>l||i===-1&&a.layout.min+nKr(e)),c=[],l=p.exports.useRef(!1),u={axis:n,registerItem:(f,d)=>{d&&c.findIndex(h=>f===h.value)===-1&&(c.push({value:f,layout:d[n]}),c.sort(Ou))},updateOrder:(f,d,h)=>{if(l.current)return;const m=Ru(c,f,d,h);c!==m&&(l.current=!0,s(m.map(Eu).filter(x=>o.indexOf(x)!==-1)))}};return p.exports.useEffect(()=>{l.current=!1}),F(a,{...i,ref:r,children:F(Zr.Provider,{value:u,children:t})})}const Lu=p.exports.forwardRef(Mu);function Eu(t){return t.value}function Ou(t,e){return t.layout.min-e.layout.min}function yt(t){const e=_(()=>G(t)),{isStatic:n}=p.exports.useContext(tt);if(n){const[,s]=p.exports.useState(t);p.exports.useEffect(()=>e.onChange(s),[])}return e}const Du=t=>typeof t=="object"&&t.mix,Iu=t=>Du(t)?t.mix:void 0;function Fu(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],o=t[1+n],i=t[2+n],r=t[3+n],a=En(o,i,{mixer:Iu(i[0]),...r});return e?a(s):a}function ku(t,e){mt(()=>{if(U(t))return t.onChange(e)},[e])}function ju(t,e,n){mt(()=>{const s=t.map(o=>o.onChange(e));return()=>{s.forEach(o=>o()),n()}})}function Jr(t,e){const n=yt(e()),s=()=>n.set(e());return s(),ju(t,()=>j.update(s,!1,!0),()=>q.update(s)),n}function hn(t,e,n,s){const o=typeof e=="function"?e:Fu(e,n,s);return Array.isArray(t)?uo(t,o):uo([t],([i])=>o(i))}function uo(t,e){const n=_(()=>[]);return Jr(t,()=>{n.length=0;const s=t.length;for(let o=0;oKr(s)),l=p.exports.useContext(Zr),u={x:fo(e.x),y:fo(e.y)},f=hn([u.x,u.y],([S,V])=>S||V?1:"unset"),d=p.exports.useRef(null),{axis:h,registerItem:m,updateOrder:x}=l;return p.exports.useEffect(()=>{m(n,d.current)},[l]),F(c,{drag:h,...r,dragSnapToOrigin:!0,style:{...e,x:u.x,y:u.y,zIndex:f},layout:i,onDrag:(S,V)=>{const{velocity:b}=V;b[h]&&x(n,u[h].get(),b[h]),o&&o(S,V)},onLayoutMeasure:S=>{d.current=S},ref:a,children:t})}const Bu=p.exports.forwardRef(_u),zf={Group:Lu,Item:Bu},Uu={renderer:Xn,...Pr,...mr},$f={...Uu,...Or,...Ur,projectionNodeConstructor:qn};function Hf(t,...e){const n=t.length;function s(){let o="";for(let i=0;io.attach((i,r)=>n?r(i):(s.current&&s.current.stop(),s.current=jn({from:o.get(),to:i,velocity:o.getVelocity(),...e,onUpdate:r}),o.get())),[JSON.stringify(e)]),ku(t,i=>o.set(parseFloat(i))),o}function Gf(t){const e=yt(t.getVelocity());return p.exports.useEffect(()=>t.velocityUpdateSubscribers.add(n=>{e.set(n)}),[t]),e}const Nu=(t,e,n)=>Math.min(Math.max(n,t),e),Jn=t=>typeof t=="number",zu=t=>Array.isArray(t)&&!Jn(t[0]),$u=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t};function Hu(t,e){return zu(t)?t[$u(0,t.length,e)]:t}const Qr=(t,e,n)=>-n*t+n*e+t,ti=t=>t,Qn=(t,e,n)=>e-t===0?1:(n-t)/(e-t);function ei(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const o=Qn(0,e,s);t.push(Qr(n,1,o))}}function ni(t){const e=[0];return ei(e,t-1),e}function Wu(t,e=ni(t.length),n=ti){const s=t.length,o=s-e.length;return o>0&&ei(e,o),i=>{let r=0;for(;rtypeof t=="function",si=t=>typeof t=="string";function Gu(t,e){return e?t*(1e3/e):0}function oi(t,e){var n;return typeof t=="string"?e?((n=e[t])!==null&&n!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}function Yu(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o"u")return()=>{};const i=oi(t),r=new WeakMap,a=l=>{l.forEach(u=>{const f=r.get(u.target);if(u.isIntersecting!==Boolean(f))if(u.isIntersecting){const d=e(u);ts(d)?r.set(u.target,d):c.unobserve(u.target)}else f&&(f(u),r.delete(u.target))})},c=new IntersectionObserver(a,{root:n,rootMargin:s,threshold:typeof o=="number"?o:Ku[o]});return i.forEach(l=>c.observe(l)),()=>c.disconnect()}const ae=new WeakMap;let rt;function qu(t,e){if(e){const{inlineSize:n,blockSize:s}=e[0];return{width:n,height:s}}else return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}function Zu({target:t,contentRect:e,borderBoxSize:n}){var s;(s=ae.get(t))===null||s===void 0||s.forEach(o=>{o({target:t,contentSize:e,get size(){return qu(t,n)}})})}function Ju(t){t.forEach(Zu)}function Qu(){typeof ResizeObserver>"u"||(rt=new ResizeObserver(Ju))}function tf(t,e){rt||Qu();const n=oi(t);return n.forEach(s=>{let o=ae.get(s);o||(o=new Set,ae.set(s,o)),o.add(e),rt==null||rt.observe(s)}),()=>{n.forEach(s=>{const o=ae.get(s);o==null||o.delete(e),o!=null&&o.size||rt==null||rt.unobserve(s)})}}const ce=new Set;let Ut;function ef(){Ut=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ce.forEach(n=>n(e))},window.addEventListener("resize",Ut)}function nf(t){return ce.add(t),Ut||ef(),()=>{ce.delete(t),!ce.size&&Ut&&(Ut=void 0)}}function sf(t,e){return ts(t)?nf(t):tf(t,e)}const of=50,ho=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),rf=()=>({time:0,x:ho(),y:ho()}),af={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function po(t,e,n,s){const o=n[e],{length:i,position:r}=af[e],a=o.current,c=n.time;o.current=t["scroll"+r],o.scrollLength=t["scroll"+i]-t["client"+i],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=Qn(0,o.scrollLength,o.current);const l=s-c;o.velocity=l>of?0:Gu(o.current-a,l)}function cf(t,e,n){po(t,"x",e,n),po(t,"y",e,n),e.time=n}function lf(t,e){let n={x:0,y:0},s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if(s instanceof SVGGraphicsElement&&"getBBox"in s){const{top:o,left:i}=s.getBBox();for(n.x+=i,n.y+=o;s&&s.tagName!=="svg";)s=s.parentNode}return n}const uf={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},pn={start:0,center:.5,end:1};function mo(t,e,n=0){let s=0;if(pn[t]!==void 0&&(t=pn[t]),si(t)){const o=parseFloat(t);t.endsWith("px")?s=o:t.endsWith("%")?t=o/100:t.endsWith("vw")?s=o/100*document.documentElement.clientWidth:t.endsWith("vh")?s=o/100*document.documentElement.clientHeight:t=o}return Jn(t)&&(s=e*t),n+s}const ff=[0,0];function df(t,e,n,s){let o=Array.isArray(t)?t:ff,i=0,r=0;return Jn(t)?o=[t,t]:si(t)&&(t=t.trim(),t.includes(" ")?o=t.split(" "):o=[t,pn[t]?t:"0"]),i=mo(o[0],n,s),r=mo(o[1],e),i-r}const hf={x:0,y:0};function pf(t,e,n){let{offset:s=uf.All}=n;const{target:o=t,axis:i="y"}=n,r=i==="y"?"height":"width",a=o!==t?lf(o,t):hf,c=o===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:o.clientWidth,height:o.clientHeight},l={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let u=!e[i].interpolate;const f=s.length;for(let d=0;dmf(t,s.target,n),update:i=>{cf(t,n,i),(s.offset||s.target)&&pf(t,n,s)},notify:ts(e)?()=>e(n):yf(e,n[o])}}function yf(t,e){return t.pause(),t.forEachNative((n,{easing:s})=>{var o,i;if(n.updateDuration)s||(n.easing=ti),n.updateDuration(1);else{const r={duration:1e3};s||(r.easing="linear"),(i=(o=n.effect)===null||o===void 0?void 0:o.updateTiming)===null||i===void 0||i.call(o,r)}}),()=>{t.currentTime=e.progress}}const Ot=new WeakMap,go=new WeakMap,Ge=new WeakMap,yo=t=>t===document.documentElement?window:t;function vf(t,e={}){var{container:n=document.documentElement}=e,s=Yu(e,["container"]);let o=Ge.get(n);o||(o=new Set,Ge.set(n,o));const i=rf(),r=gf(n,t,i,s);if(o.add(r),!Ot.has(n)){const l=()=>{const f=performance.now();for(const d of o)d.measure();for(const d of o)d.update(f);for(const d of o)d.notify()};Ot.set(n,l);const u=yo(n);window.addEventListener("resize",l,{passive:!0}),n!==document.documentElement&&go.set(n,sf(n,l)),u.addEventListener("scroll",l,{passive:!0})}const a=Ot.get(n),c=requestAnimationFrame(a);return()=>{var l;typeof t!="function"&&t.stop(),cancelAnimationFrame(c);const u=Ge.get(n);if(!u||(u.delete(r),u.size))return;const f=Ot.get(n);Ot.delete(n),f&&(yo(n).removeEventListener("scroll",f),(l=go.get(n))===null||l===void 0||l(),window.removeEventListener("resize",f))}}const xf=()=>({scrollX:G(0),scrollY:G(0),scrollXProgress:G(0),scrollYProgress:G(0)});function ri({container:t,target:e,layoutEffect:n=!0,...s}={}){const o=_(xf);return(n?mt:p.exports.useEffect)(()=>vf(({x:r,y:a})=>{o.scrollX.set(r.current),o.scrollXProgress.set(r.progress),o.scrollY.set(a.current),o.scrollYProgress.set(a.progress)},{...s,container:(t==null?void 0:t.current)||void 0,target:(e==null?void 0:e.current)||void 0}),[]),o}function Yf(t){return Le(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),ri({container:t})}function Kf(){return Le(!1,"useViewportScroll is deprecated. Convert to useScroll()."),ri()}function bf(t){const e=p.exports.useRef(0),{isStatic:n}=p.exports.useContext(tt);p.exports.useEffect(()=>{if(n)return;const s=({timestamp:o,delta:i})=>{e.current||(e.current=o),t(o-e.current,i)};return j.update(s,!0),()=>q.update(s)},[t])}function Xf(){const t=yt(0);return bf(e=>t.set(e)),t}class Sf extends xr{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(e){let n;gt.has(e)?(this.transforms.add(e),n="transform"):!e.startsWith("origin")&&!xn(e)&&e!=="willChange"&&(n=de(e)),n&&(Ee(this.members,n),this.update())}remove(e){gt.has(e)?(this.transforms.delete(e),this.transforms.size||Kt(this.members,"transform")):Kt(this.members,de(e)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function qf(){return _(()=>new Sf("auto"))}function Vf(){!Yn.current&&Dr();const[t]=p.exports.useState(Ve.current);return t}function Zf(){const t=Vf(),{reducedMotion:e}=p.exports.useContext(tt);return e==="never"?!1:e==="always"?!0:t}function wf(){let t=!1;const e=[],n=new Set,s={subscribe(o){return n.add(o),()=>void n.delete(o)},start(o,i){if(t){const r=[];return n.forEach(a=>{r.push(Wn(a,o,{transitionOverride:i}))}),Promise.all(r)}else return new Promise(r=>{e.push({animation:[o,i],resolve:r})})},set(o){return n.forEach(i=>{Gc(i,o)})},stop(){n.forEach(o=>{Xc(o)})},mount(){return t=!0,e.forEach(({animation:o,resolve:i})=>{s.start(...o).then(i)}),()=>{t=!1,s.stop()}}};return s}function Tf(){const t=_(wf);return p.exports.useEffect(t.mount,[]),t}const Jf=Tf;function Qf(...t){const e=p.exports.useRef(0),[n,s]=p.exports.useState(t[e.current]),o=p.exports.useCallback(i=>{e.current=typeof i!="number"?ic(0,t.length,e.current+1):i,s(t[e.current])},[t.length,...t]);return[n,o]}function td(t,{root:e,margin:n,amount:s,once:o=!1}={}){const[i,r]=p.exports.useState(!1);return p.exports.useEffect(()=>{if(!t.current||o&&i)return;const a=()=>(r(!0),o?void 0:()=>r(!1)),c={root:e&&e.current||void 0,margin:n,amount:s==="some"?"any":s};return Xu(t.current,a,c)},[e,t,n,o]),i}class Pf{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,n){this.componentControls.forEach(s=>{s.start(e.nativeEvent||e,n)})}}const Cf=()=>new Pf;function ed(){return _(Cf)}function Af(t){return t!==null&&typeof t=="object"&&yn in t}function nd(t){if(Af(t))return t[yn]}function Rf(){return Mf}function Mf(t){!pt.current||(pt.current.isUpdating=!1,pt.current.blockUpdate(),t&&t())}function sd(){const[t,e]=Zn(),n=Rf();return p.exports.useEffect(()=>{j.postRender(()=>j.postRender(()=>on.current=!1))},[e]),s=>{n(()=>{on.current=!0,t(),s()})}}function od(){return p.exports.useCallback(()=>{const e=pt.current;!e||e.resetTree()},[])}const mn=()=>({}),Lf=Kn({build(){},measureViewportBox:D,resetTransform(){},restoreTransform(){},removeValueFromRenderState(){},render(){},scrapeMotionValuesFromProps:mn,readValueFromInstance(t,e,n){return n.initialState[e]||0},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...s}){const o=wr(s,e||{},t);return Vr(t,s,o),{transition:e,transitionEnd:n,...s}}}),Ef=Cn({scrapeMotionValuesFromProps:mn,createRenderState:mn});function rd(t){const[e,n]=p.exports.useState(t),s=Ef({},!1),o=_(()=>Lf({props:{},visualState:s},{initialState:t}));p.exports.useEffect(()=>(o.mount({}),o.unmount),[o]),p.exports.useEffect(()=>{o.setProps({onUpdate:r=>{n({...r})}})},[n,o]);const i=_(()=>r=>Wn(o,r));return[e,i]}const Of=1e5,vo=t=>t>.001?1/t:Of;function id(t){let e=yt(1),n=yt(1);const s=bo();t?(e=t.scaleX||e,n=t.scaleY||n):s&&(e=s.getValue("scaleX",1),n=s.getValue("scaleY",1));const o=hn(e,vo),i=hn(n,vo);return{scaleX:o,scaleY:i}}export{_f as AnimatePresence,Bf as AnimateSharedLayout,M as AnimationType,wu as DeprecatedLayoutGroupContext,Pf as DragControls,ou as FlatTree,Cu as LayoutGroup,$t as LayoutGroupContext,Nf as LazyMotion,Uf as MotionConfig,tt as MotionConfigContext,we as MotionContext,xr as MotionValue,At as PresenceContext,zf as Reorder,Vo as SwitchLayoutGroupContext,Pt as addPointerEvent,xi as addScaleCorrector,Gl as animate,Wn as animateVisualElement,wf as animationControls,Pr as animations,Vi as buildTransform,N as calcLength,Vr as checkTargetForNewValues,D as createBox,kf as createDomMotionComponent,wo as createMotionComponent,vr as delay,Uu as domAnimation,$f as domMax,$i as filterProps,vt as isBrowser,Xo as isDragActive,Af as isMotionComponent,U as isMotionValue,fe as isValidMotionProp,jf as m,Cn as makeUseVisualState,Kr as motion,G as motionValue,oe as resolveMotionValue,Fu as transform,nd as unwrapMotionComponent,Jf as useAnimation,Tf as useAnimationControls,bf as useAnimationFrame,Qf as useCycle,rd as useDeprecatedAnimatedState,id as useDeprecatedInvertedScale,Ze as useDomEvent,ed as useDragControls,Yf as useElementScroll,Zn as useForceUpdate,td as useInView,Rf as useInstantLayoutTransition,sd as useInstantTransition,If as useIsPresent,mt as useIsomorphicLayoutEffect,Hf as useMotionTemplate,yt as useMotionValue,gr as usePresence,Vf as useReducedMotion,Zf as useReducedMotionConfig,od as useResetProjection,ri as useScroll,Wf as useSpring,Xf as useTime,hn as useTransform,Mn as useUnmountEffect,Gf as useVelocity,Kf as useViewportScroll,bo as useVisualElementContext,qf as useWillChange,Kn as visualElement,Wo as wrapHandler}; diff --git a/clash-bin/tests/data/config/public/assets/index.92e2d967.js b/clash-bin/tests/data/config/public/assets/index.92e2d967.js deleted file mode 100644 index 8c5dbd621..000000000 --- a/clash-bin/tests/data/config/public/assets/index.92e2d967.js +++ /dev/null @@ -1 +0,0 @@ -function c(e,a){if(a.length1?"s":"")+" required, but only "+a.length+" present")}function y(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(t){return typeof t}:y=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(e)}function s(e){c(1,arguments);var a=Object.prototype.toString.call(e);return e instanceof Date||y(e)==="object"&&a==="[object Date]"?new Date(e.getTime()):typeof e=="number"||a==="[object Number]"?new Date(e):((typeof e=="string"||a==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}var C={};function A(){return C}function S(e){var a=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return a.setUTCFullYear(e.getFullYear()),e.getTime()-a.getTime()}function M(e,a){c(2,arguments);var t=s(e),n=s(a),i=t.getTime()-n.getTime();return i<0?-1:i>0?1:i}function _(e,a){c(2,arguments);var t=s(e),n=s(a),i=t.getFullYear()-n.getFullYear(),o=t.getMonth()-n.getMonth();return i*12+o}function X(e,a){return c(2,arguments),s(e).getTime()-s(a).getTime()}var T={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(a){return a<0?Math.ceil(a):Math.floor(a)}},I="trunc";function R(e){return e?T[e]:T[I]}function E(e){c(1,arguments);var a=s(e);return a.setHours(23,59,59,999),a}function Y(e){c(1,arguments);var a=s(e),t=a.getMonth();return a.setFullYear(a.getFullYear(),t+1,0),a.setHours(23,59,59,999),a}function j(e){c(1,arguments);var a=s(e);return E(a).getTime()===Y(a).getTime()}function z(e,a){c(2,arguments);var t=s(e),n=s(a),i=M(t,n),o=Math.abs(_(t,n)),r;if(o<1)r=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-i*o);var l=M(t,n)===-i;j(s(e))&&o===1&&M(e,n)===1&&(l=!1),r=i*(o-Number(l))}return r===0?0:r}function L(e,a,t){c(2,arguments);var n=X(e,a)/1e3;return R(t==null?void 0:t.roundingMethod)(n)}var V={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},q=function(a,t,n){var i,o=V[a];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};const H=q;function p(e){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=a.width?String(a.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var J={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},U={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q={date:p({formats:J,defaultWidth:"full"}),time:p({formats:U,defaultWidth:"full"}),dateTime:p({formats:$,defaultWidth:"full"})};const B=Q;var G={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},K=function(a,t,n,i){return G[a]};const Z=K;function g(e){return function(a,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,r=t!=null&&t.width?String(t.width):o;i=e.formattingValues[r]||e.formattingValues[o]}else{var l=e.defaultWidth,u=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[u]||e.values[l]}var f=e.argumentCallback?e.argumentCallback(a):a;return i[f]}}var ee={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},te={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ae={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ne={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},re={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ie={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oe=function(a,t){var n=Number(a),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ue={ordinalNumber:oe,era:g({values:ee,defaultWidth:"wide"}),quarter:g({values:te,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:g({values:ae,defaultWidth:"wide"}),day:g({values:ne,defaultWidth:"wide"}),dayPeriod:g({values:re,defaultWidth:"wide",formattingValues:ie,defaultFormattingWidth:"wide"})};const se=ue;function b(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=a.match(i);if(!o)return null;var r=o[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?de(l,function(m){return m.test(r)}):le(l,function(m){return m.test(r)}),f;f=e.valueCallback?e.valueCallback(u):u,f=t.valueCallback?t.valueCallback(f):f;var h=a.slice(r.length);return{value:f,rest:h}}}function le(e,a){for(var t in e)if(e.hasOwnProperty(t)&&a(e[t]))return t}function de(e,a){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},n=a.match(e.matchPattern);if(!n)return null;var i=n[0],o=a.match(e.parsePattern);if(!o)return null;var r=e.valueCallback?e.valueCallback(o[0]):o[0];r=t.valueCallback?t.valueCallback(r):r;var l=a.slice(i.length);return{value:r,rest:l}}}var me=/^(\d+)(th|st|nd|rd)?/i,ce=/\d+/i,he={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ve={any:[/^b/i,/^(a|c)/i]},ge={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},be={any:[/1/i,/2/i,/3/i,/4/i]},ye={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Me={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},we={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},pe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},De={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Pe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Se={ordinalNumber:fe({matchPattern:me,parsePattern:ce,valueCallback:function(a){return parseInt(a,10)}}),era:b({matchPatterns:he,defaultMatchWidth:"wide",parsePatterns:ve,defaultParseWidth:"any"}),quarter:b({matchPatterns:ge,defaultMatchWidth:"wide",parsePatterns:be,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:b({matchPatterns:ye,defaultMatchWidth:"wide",parsePatterns:Me,defaultParseWidth:"any"}),day:b({matchPatterns:we,defaultMatchWidth:"wide",parsePatterns:pe,defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:De,defaultMatchWidth:"any",parsePatterns:Pe,defaultParseWidth:"any"})};const Te=Se;var We={code:"en-US",formatDistance:H,formatLong:B,formatRelative:Z,localize:se,match:Te,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Ne=We;function N(e,a){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t]);return e}function ke(e){return N({},e)}var W=1440,Oe=2520,D=43200,Fe=86400;function xe(e,a,t){var n,i;c(2,arguments);var o=A(),r=(n=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:o.locale)!==null&&n!==void 0?n:Ne;if(!r.formatDistance)throw new RangeError("locale must contain formatDistance property");var l=M(e,a);if(isNaN(l))throw new RangeError("Invalid time value");var u=N(ke(t),{addSuffix:Boolean(t==null?void 0:t.addSuffix),comparison:l}),f,h;l>0?(f=s(a),h=s(e)):(f=s(e),h=s(a));var m=L(h,f),k=(S(h)-S(f))/1e3,d=Math.round((m-k)/60),v;if(d<2)return t!=null&&t.includeSeconds?m<5?r.formatDistance("lessThanXSeconds",5,u):m<10?r.formatDistance("lessThanXSeconds",10,u):m<20?r.formatDistance("lessThanXSeconds",20,u):m<40?r.formatDistance("halfAMinute",0,u):m<60?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",1,u):d===0?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",d,u);if(d<45)return r.formatDistance("xMinutes",d,u);if(d<90)return r.formatDistance("aboutXHours",1,u);if(d=0)&&(r[a]=n[a]);return r}function L(){return L=Object.assign?Object.assign.bind():function(n){for(var t=1;t=t?n.call(null):a.id=requestAnimationFrame(i)}var a={id:requestAnimationFrame(i)};return a}var P=-1;function K(n){if(n===void 0&&(n=!1),P===-1||n){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),P=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return P}var _=null;function V(n){if(n===void 0&&(n=!1),_===null||n){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),a=i.style;return a.width="100px",a.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?_="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?_="negative":_="positive-ascending"),document.body.removeChild(t),_}return _}var ft=150,dt=function(t,r){return t};function Q(n){var t,r=n.getItemOffset,i=n.getEstimatedTotalSize,a=n.getItemSize,l=n.getOffsetForIndexAndAlignment,c=n.getStartIndexForOffset,f=n.getStopIndexForStartIndex,p=n.initInstanceProps,z=n.shouldResetStyleCacheOnItemSizeChange,g=n.validateProps;return t=function(x){ot(M,x);function M(v){var e;return e=x.call(this,v)||this,e._instanceProps=p(e.props,$(e)),e._outerRef=void 0,e._resetIsScrollingTimeoutId=null,e.state={instance:$(e),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof e.props.initialScrollOffset=="number"?e.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},e._callOnItemsRendered=void 0,e._callOnItemsRendered=N(function(o,s,u,m){return e.props.onItemsRendered({overscanStartIndex:o,overscanStopIndex:s,visibleStartIndex:u,visibleStopIndex:m})}),e._callOnScroll=void 0,e._callOnScroll=N(function(o,s,u){return e.props.onScroll({scrollDirection:o,scrollOffset:s,scrollUpdateWasRequested:u})}),e._getItemStyle=void 0,e._getItemStyle=function(o){var s=e.props,u=s.direction,m=s.itemSize,S=s.layout,d=e._getItemStyleCache(z&&m,z&&S,z&&u),h;if(d.hasOwnProperty(o))h=d[o];else{var y=r(e.props,o,e._instanceProps),O=a(e.props,o,e._instanceProps),T=u==="horizontal"||S==="horizontal",b=u==="rtl",R=T?y:0;d[o]=h={position:"absolute",left:b?void 0:R,right:b?R:void 0,top:T?0:y,height:T?"100%":O,width:T?O:"100%"}}return h},e._getItemStyleCache=void 0,e._getItemStyleCache=N(function(o,s,u){return{}}),e._onScrollHorizontal=function(o){var s=o.currentTarget,u=s.clientWidth,m=s.scrollLeft,S=s.scrollWidth;e.setState(function(d){if(d.scrollOffset===m)return null;var h=e.props.direction,y=m;if(h==="rtl")switch(V()){case"negative":y=-m;break;case"positive-descending":y=S-u-m;break}return y=Math.max(0,Math.min(y,S-u)),{isScrolling:!0,scrollDirection:d.scrollOffseth.clientWidth?K():0:d=h.scrollHeight>h.clientHeight?K():0}this.scrollTo(l(this.props,e,o,S,this._instanceProps,d))},I.componentDidMount=function(){var e=this.props,o=e.direction,s=e.initialScrollOffset,u=e.layout;if(typeof s=="number"&&this._outerRef!=null){var m=this._outerRef;o==="horizontal"||u==="horizontal"?m.scrollLeft=s:m.scrollTop=s}this._callPropsCallbacks()},I.componentDidUpdate=function(){var e=this.props,o=e.direction,s=e.layout,u=this.state,m=u.scrollOffset,S=u.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var d=this._outerRef;if(o==="horizontal"||s==="horizontal")if(o==="rtl")switch(V()){case"negative":d.scrollLeft=-m;break;case"positive-ascending":d.scrollLeft=m;break;default:var h=d.clientWidth,y=d.scrollWidth;d.scrollLeft=y-h-m;break}else d.scrollLeft=m;else d.scrollTop=m}this._callPropsCallbacks()},I.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&j(this._resetIsScrollingTimeoutId)},I.render=function(){var e=this.props,o=e.children,s=e.className,u=e.direction,m=e.height,S=e.innerRef,d=e.innerElementType,h=e.innerTagName,y=e.itemCount,O=e.itemData,T=e.itemKey,b=T===void 0?dt:T,R=e.layout,J=e.outerElementType,X=e.outerTagName,Y=e.style,tt=e.useIsScrolling,et=e.width,W=this.state.isScrolling,F=u==="horizontal"||R==="horizontal",rt=F?this._onScrollHorizontal:this._onScrollVertical,A=this._getRangeToRender(),it=A[0],nt=A[1],D=[];if(y>0)for(var w=it;w<=nt;w++)D.push(E.exports.createElement(o,{data:O,key:b(w,O),index:w,isScrolling:tt?W:void 0,style:this._getItemStyle(w)}));var k=i(this.props,this._instanceProps);return E.exports.createElement(J||X||"div",{className:s,onScroll:rt,ref:this._outerRefSetter,style:L({position:"relative",height:m,width:et,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:u},Y)},E.exports.createElement(d||h||"div",{children:D,ref:S,style:{height:F?"100%":k,pointerEvents:W?"none":void 0,width:F?k:"100%"}}))},I._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var e=this.props.itemCount;if(e>0){var o=this._getRangeToRender(),s=o[0],u=o[1],m=o[2],S=o[3];this._callOnItemsRendered(s,u,m,S)}}if(typeof this.props.onScroll=="function"){var d=this.state,h=d.scrollDirection,y=d.scrollOffset,O=d.scrollUpdateWasRequested;this._callOnScroll(h,y,O)}},I._getRangeToRender=function(){var e=this.props,o=e.itemCount,s=e.overscanCount,u=this.state,m=u.isScrolling,S=u.scrollDirection,d=u.scrollOffset;if(o===0)return[0,0,0,0];var h=c(this.props,d,this._instanceProps),y=f(this.props,h,d,this._instanceProps),O=!m||S==="backward"?Math.max(1,s):1,T=!m||S==="forward"?Math.max(1,s):1;return[Math.max(0,h-O),Math.max(0,Math.min(o-1,y+T)),h,y]},M}(E.exports.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var mt=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},ht=50,C=function(t,r,i){var a=t,l=a.itemSize,c=i.itemMetadataMap,f=i.lastMeasuredIndex;if(r>f){var p=0;if(f>=0){var z=c[f];p=z.offset+z.size}for(var g=f+1;g<=r;g++){var x=l(g);c[g]={offset:p,size:x},p+=x}i.lastMeasuredIndex=r}return c[r]},vt=function(t,r,i){var a=r.itemMetadataMap,l=r.lastMeasuredIndex,c=l>0?a[l].offset:0;return c>=i?Z(t,r,l,0,i):pt(t,r,Math.max(0,l),i)},Z=function(t,r,i,a,l){for(;a<=i;){var c=a+Math.floor((i-a)/2),f=C(t,c,r).offset;if(f===l)return c;fl&&(i=c-1)}return a>0?a-1:0},pt=function(t,r,i,a){for(var l=t.itemCount,c=1;i=i&&(c=i-1),c>=0){var p=a[c];f=p.offset+p.size}var z=i-c-1,g=z*l;return f+g},yt=Q({getItemOffset:function(t,r,i){return C(t,r,i).offset},getItemSize:function(t,r,i){return i.itemMetadataMap[r].size},getEstimatedTotalSize:B,getOffsetForIndexAndAlignment:function(t,r,i,a,l,c){var f=t.direction,p=t.height,z=t.layout,g=t.width,x=f==="horizontal"||z==="horizontal",M=x?g:p,I=C(t,r,l),v=B(t,l),e=Math.max(0,Math.min(v-M,I.offset)),o=Math.max(0,I.offset-M+I.size+c);switch(i==="smart"&&(a>=o-M&&a<=e+M?i="auto":i="center"),i){case"start":return e;case"end":return o;case"center":return Math.round(o+(e-o)/2);case"auto":default:return a>=o&&a<=e?a:a=s-v&&a<=o+v?i="auto":i="center"),i){case"start":return o;case"end":return s;case"center":{var u=Math.round(s+(o-s)/2);return ue+Math.floor(v/2)?e:u}case"auto":default:return a>=s&&a<=o?a:aMath.floor((1+Math.random())*65536).toString(16);let h=!1,i=!1,f="",s,g;function m(e,n){let t;try{t=JSON.parse(e)}catch{console.log("JSON.parse error",JSON.parse(e))}const r=new Date,l=$(r);t.time=l,t.id=+r-0+M(),t.even=h=!h,n(t)}function $(e){const n=e.getFullYear()%100,t=u(e.getMonth()+1,2),r=u(e.getDate(),2),l=u(e.getHours(),2),o=u(e.getMinutes(),2),c=u(e.getSeconds(),2);return`${n}-${t}-${r} ${l}:${o}:${c}`}function p(e,n){return e.read().then(({done:t,value:r})=>{const l=L.decode(r,{stream:!t});f+=l;const o=f.split(` -`),c=o[o.length-1];for(let d=0;de[t]).join("|")}let b,a;function k(e,n){if(e.logLevel==="uninit"||i||s&&s.readyState===1)return;g=n;const t=w(e,v);s=new WebSocket(t),s.addEventListener("error",()=>{y(e,n)}),s.addEventListener("message",function(r){m(r.data,n)})}function H(){s.close(),a&&a.abort()}function O(e){!g||!s||(s.close(),i=!1,k(e,g))}function y(e,n){if(a&&S(e)!==b)a.abort();else if(i)return;i=!0,b=S(e),a=new AbortController;const t=a.signal,{url:r,init:l}=D(e);fetch(r+v+"?level="+e.logLevel,{...l,signal:t}).then(o=>{const c=o.body.getReader();p(c,n)},o=>{i=!1,!t.aborted&&console.log("GET /logs error:",o.message)})}export{k as f,O as r,H as s}; diff --git a/clash-bin/tests/data/config/public/assets/play.7b1a5f99.js b/clash-bin/tests/data/config/public/assets/play.7b1a5f99.js deleted file mode 100644 index 515506a86..000000000 --- a/clash-bin/tests/data/config/public/assets/play.7b1a5f99.js +++ /dev/null @@ -1 +0,0 @@ -import{r as c,b as u,j as p,k as s}from"./index.171f553a.js";function y(e,n){if(e==null)return{};var i=g(e,n),t,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,t)||(i[t]=e[t]))}return i}function g(e,n){if(e==null)return{};var i={},t=Object.keys(e),r,o;for(o=0;o=0)&&(i[r]=e[r]);return i}var l=c.exports.forwardRef(function(e,n){var i=e.color,t=i===void 0?"currentColor":i,r=e.size,o=r===void 0?24:r,a=y(e,["color","size"]);return u("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[p("rect",{x:"6",y:"4",width:"4",height:"16"}),p("rect",{x:"14",y:"4",width:"4",height:"16"})]})});l.propTypes={color:s.exports.string,size:s.exports.oneOfType([s.exports.string,s.exports.number])};l.displayName="Pause";const d=l;function h(e,n){if(e==null)return{};var i=v(e,n),t,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,t)||(i[t]=e[t]))}return i}function v(e,n){if(e==null)return{};var i={},t=Object.keys(e),r,o;for(o=0;o=0)&&(i[r]=e[r]);return i}var f=c.exports.forwardRef(function(e,n){var i=e.color,t=i===void 0?"currentColor":i,r=e.size,o=r===void 0?24:r,a=h(e,["color","size"]);return p("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:p("polygon",{points:"5 3 19 12 5 21 5 3"})})});f.propTypes={color:s.exports.string,size:s.exports.oneOfType([s.exports.string,s.exports.number])};f.displayName="Play";const w=f;export{w as P,d as a}; diff --git a/clash-bin/tests/data/config/public/assets/roboto-mono-latin-400-normal.7295944e.woff2 b/clash-bin/tests/data/config/public/assets/roboto-mono-latin-400-normal.7295944e.woff2 deleted file mode 100644 index f8894bab5..000000000 Binary files a/clash-bin/tests/data/config/public/assets/roboto-mono-latin-400-normal.7295944e.woff2 and /dev/null differ diff --git a/clash-bin/tests/data/config/public/assets/roboto-mono-latin-400-normal.dffdffa7.woff b/clash-bin/tests/data/config/public/assets/roboto-mono-latin-400-normal.dffdffa7.woff deleted file mode 100644 index be3eb4c4c..000000000 Binary files a/clash-bin/tests/data/config/public/assets/roboto-mono-latin-400-normal.dffdffa7.woff and /dev/null differ diff --git a/clash-bin/tests/data/config/public/assets/useRemainingViewPortHeight.7395542b.js b/clash-bin/tests/data/config/public/assets/useRemainingViewPortHeight.7395542b.js deleted file mode 100644 index 1565ba0b3..000000000 --- a/clash-bin/tests/data/config/public/assets/useRemainingViewPortHeight.7395542b.js +++ /dev/null @@ -1 +0,0 @@ -import{i as r}from"./index.171f553a.js";const{useState:s,useRef:u,useCallback:a,useLayoutEffect:c}=r;function d(){const t=u(null),[n,i]=s(200),e=a(()=>{const{top:o}=t.current.getBoundingClientRect();i(window.innerHeight-o)},[]);return c(()=>(e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}),[e]),[t,n]}export{d as u}; diff --git a/clash-bin/tests/data/config/public/assets/zh.9b79b7bf.js b/clash-bin/tests/data/config/public/assets/zh.9b79b7bf.js deleted file mode 100644 index b240eda6b..000000000 --- a/clash-bin/tests/data/config/public/assets/zh.9b79b7bf.js +++ /dev/null @@ -1 +0,0 @@ -const u={Overview:"\u6982\u89C8",Proxies:"\u4EE3\u7406",Rules:"\u89C4\u5219",Conns:"\u8FDE\u63A5",Config:"\u914D\u7F6E",Logs:"\u65E5\u5FD7",Upload:"\u4E0A\u4F20",Download:"\u4E0B\u8F7D","Upload Total":"\u4E0A\u4F20\u603B\u91CF","Download Total":"\u4E0B\u8F7D\u603B\u91CF","Active Connections":"\u6D3B\u52A8\u8FDE\u63A5","Pause Refresh":"\u6682\u505C\u5237\u65B0","Resume Refresh":"\u7EE7\u7EED\u5237\u65B0",Up:"\u4E0A\u4F20",Down:"\u4E0B\u8F7D","Test Latency":"\u5EF6\u8FDF\u6D4B\u901F",settings:"\u8BBE\u7F6E",sort_in_grp:"\u4EE3\u7406\u7EC4\u6761\u76EE\u6392\u5E8F",hide_unavail_proxies:"\u9690\u85CF\u4E0D\u53EF\u7528\u4EE3\u7406",auto_close_conns:"\u5207\u6362\u4EE3\u7406\u65F6\u81EA\u52A8\u65AD\u5F00\u65E7\u8FDE\u63A5",order_natural:"\u539F config \u6587\u4EF6\u4E2D\u7684\u6392\u5E8F",order_latency_asc:"\u6309\u5EF6\u8FDF\u4ECE\u5C0F\u5230\u5927",order_latency_desc:"\u6309\u5EF6\u8FDF\u4ECE\u5927\u5230\u5C0F",order_name_asc:"\u6309\u540D\u79F0\u5B57\u6BCD\u6392\u5E8F (A-Z)",order_name_desc:"\u6309\u540D\u79F0\u5B57\u6BCD\u6392\u5E8F (Z-A)",Connections:"\u8FDE\u63A5",Active:"\u6D3B\u52A8",Closed:"\u5DF2\u65AD\u5F00",switch_theme:"\u5207\u6362\u4E3B\u9898",theme:"\u4E3B\u9898",about:"\u5173\u4E8E",no_logs:"\u6682\u65E0\u65E5\u5FD7...",chart_style:"\u6D41\u91CF\u56FE\u6837\u5F0F",latency_test_url:"\u5EF6\u8FDF\u6D4B\u901F URL",lang:"\u8BED\u8A00",update_all_rule_provider:"\u66F4\u65B0\u6240\u6709 rule provider",update_all_proxy_provider:"\u66F4\u65B0\u6240\u6709 proxy providers"};export{u as data}; diff --git a/clash-bin/tests/data/config/public/index.html b/clash-bin/tests/data/config/public/index.html deleted file mode 100644 index e006fa105..000000000 --- a/clash-bin/tests/data/config/public/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - yacd - - - - -
- - - diff --git a/clash-bin/tests/data/config/public/manifest.webmanifest b/clash-bin/tests/data/config/public/manifest.webmanifest deleted file mode 100644 index 0fda37af7..000000000 --- a/clash-bin/tests/data/config/public/manifest.webmanifest +++ /dev/null @@ -1 +0,0 @@ -{"name":"yacd","short_name":"yacd","start_url":"./","display":"standalone","background_color":"#ffffff","lang":"en","scope":"./"} diff --git a/clash-bin/tests/data/config/public/registerSW.js b/clash-bin/tests/data/config/public/registerSW.js deleted file mode 100644 index b470f977c..000000000 --- a/clash-bin/tests/data/config/public/registerSW.js +++ /dev/null @@ -1 +0,0 @@ -if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('./sw.js', { scope: './' })})} diff --git a/clash-bin/tests/data/config/public/sw.js b/clash-bin/tests/data/config/public/sw.js deleted file mode 100644 index ef10e4b26..000000000 --- a/clash-bin/tests/data/config/public/sw.js +++ /dev/null @@ -1,2 +0,0 @@ -try{self["workbox:core:6.5.3"]&&_()}catch{}const G=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},Q=G;class l extends Error{constructor(e,t){const n=Q(e,t);super(n),this.name=e,this.details=t}}const j=new Set;function z(s){j.add(s)}const d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},E=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),J=s=>{for(const e of Object.keys(d))s(e)},x={updateDetails:s=>{J(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||E(d.googleAnalytics),getPrecacheName:s=>s||E(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||E(d.runtime),getSuffix:()=>d.suffix};function A(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function X(s,e,t,n){const a=A(e.url,t);if(e.url===a)return s.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,r);for(const c of i){const o=A(c.url,t);if(a===o)return s.match(c,n)}}let m;function Y(){if(m===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),m=!0}catch{m=!1}m=!1}return m}function q(s){s.then(()=>{})}class Z{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function ee(){for(const s of j)await s()}const te=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function se(s){return new Promise(e=>setTimeout(e,s))}function v(s,e){const t=e();return s.waitUntil(t),t}async function ne(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const n=s.clone(),a={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},r=e?e(a):a,i=Y()?n.body:await n.blob();return new Response(i,r)}function ae(){self.addEventListener("activate",()=>self.clients.claim())}const re=(s,e)=>e.some(t=>s instanceof t);let O,S;function ie(){return O||(O=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ce(){return S||(S=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const F=new WeakMap,P=new WeakMap,H=new WeakMap,D=new WeakMap,I=new WeakMap;function oe(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&F.set(t,s)}).catch(()=>{}),I.set(e,s),e}function he(s){if(P.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});P.set(s,e)}let k={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return P.get(s);if(e==="objectStoreNames")return s.objectStoreNames||H.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function le(s){k=s(k)}function ue(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(L(this),e,...t);return H.set(n,e.sort?e.sort():[e]),f(n)}:ce().includes(s)?function(...e){return s.apply(L(this),e),f(F.get(this))}:function(...e){return f(s.apply(L(this),e))}}function de(s){return typeof s=="function"?ue(s):(s instanceof IDBTransaction&&he(s),re(s,ie())?new Proxy(s,k):s)}function f(s){if(s instanceof IDBRequest)return oe(s);if(D.has(s))return D.get(s);const e=de(s);return e!==s&&(D.set(s,e),I.set(e,s)),e}const L=s=>I.get(s);function fe(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction))}),t&&i.addEventListener("blocked",()=>t()),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",()=>a())}).catch(()=>{}),c}function pe(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",()=>e()),f(t).then(()=>{})}const ge=["get","getKey","getAll","getAllKeys","count"],me=["put","add","delete","clear"],U=new Map;function W(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(U.get(e))return U.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=me.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||ge.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let h=o.store;return n&&(h=h.index(c.shift())),(await Promise.all([h[t](...c),a&&o.done]))[0]};return U.set(e,r),r}le(s=>({...s,get:(e,t,n)=>W(e,t)||s.get(e,t,n),has:(e,t)=>!!W(e,t)||s.has(e,t)}));try{self["workbox:expiration:6.5.3"]&&_()}catch{}const ye="workbox-expiration",y="cache-entries",B=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class we{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(y,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&pe(this._cacheName)}async setTimestamp(e,t){e=B(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(y,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(y,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(y).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(y,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+B(e)}async getDb(){return this._db||(this._db=await fe(ye,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class _e{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new we(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,q(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);q(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&z(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===x.getRuntimeName())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new _e(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}try{self["workbox:precaching:6.5.3"]&&_()}catch{}const be="__WB_REVISION__";function Ce(s){if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const r=new URL(s,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=s;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const n=new URL(t,location.href),a=new URL(t,location.href);return n.searchParams.set(be,e),{cacheKey:n.href,url:a.href}}class xe{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const a=t.originalRequest.url;n?this.notUpdatedURLs.push(a):this.updatedURLs.push(a)}return n}}}class Ee{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const a=(n==null?void 0:n.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return a?new Request(a,{headers:t.headers}):t},this._precacheController=e}}try{self["workbox:strategies:6.5.3"]&&_()}catch{}function b(s){return typeof s=="string"?new Request(s):s}class De{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new Z,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=b(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))i=await c({event:t,request:r,response:i});return i}catch(i){throw a&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:a.clone(),request:r.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=b(e);let n;const{cacheName:a,matchOptions:r}=this._strategy,i=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},r),{cacheName:a});n=await caches.match(i,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await o({cacheName:a,matchOptions:r,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=b(e);await se(0);const a=await this.getCacheKey(n,"write");if(!t)throw new l("cache-put-with-no-response",{url:te(a.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:i,matchOptions:c}=this._strategy,o=await self.caches.open(i),h=this.hasCallback("cacheDidUpdate"),g=h?await X(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,h?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await ee(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:g,newResponse:r.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let a=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))a=b(await r({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[n]=a}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class V{constructor(e={}){this.cacheName=x.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,r=new De(this,{event:t,request:n,params:a}),i=this._getResponse(r,n,t),c=this._awaitComplete(i,r,n,t);return[i,c]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(a=await i({error:r,event:n,request:t}),a)break}if(!a)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))a=await r({event:n,request:t,response:a});return a}async _awaitComplete(e,t,n,a){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:n,response:r}),await t.doneWaiting()}catch(c){c instanceof Error&&(i=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:n,response:r,error:i}),t.destroy(),i)throw i}}class p extends V{constructor(e={}){e.cacheName=x.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(p.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const a=t.params||{};if(this._fallbackToNetwork){const r=a.integrity,i=e.integrity,c=!i||i===r;n=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?i||r:void 0})),r&&c&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new l("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,a]of this.plugins.entries())a!==p.copyRedirectedCacheableResponsesPlugin&&(a===p.defaultPrecacheCacheabilityPlugin&&(e=n),a.cacheWillUpdate&&t++);t===0?this.plugins.push(p.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}p.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};p.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await ne(s):s}};class Le{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new p({cacheName:x.getPrecacheName(e),plugins:[...t,new Ee({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:a,url:r}=Ce(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==a)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:a});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(a)&&this._cacheKeysToIntegrities.get(a)!==n.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(a,n.integrity)}if(this._urlsToCacheKeys.set(r,a),this._urlsToCacheModes.set(r,i),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return v(e,async()=>{const t=new xe;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return v(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let T;const M=()=>(T||(T=new Le),T);try{self["workbox:routing:6.5.3"]&&_()}catch{}const $="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class R{constructor(e,t,n=$){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class Ue extends R{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(!!i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class Te{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const g=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||g)&&(h=h.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:r})}catch(K){K instanceof Error&&(u=K)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=$){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const Pe=()=>(w||(w=new Te,w.addFetchListener(),w.addCacheListener()),w);function N(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new R(i,e,t)}else if(s instanceof RegExp)n=new Ue(s,e,t);else if(typeof s=="function")n=new R(s,e,t);else if(s instanceof R)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return Pe().registerRoute(n),n}function ke(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=ke(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class Me extends R{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of Ie(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function Ne(s){const e=M(),t=new Me(e,s);N(t)}function Ke(s){return M().createHandlerBoundToURL(s)}function Ae(s){M().precache(s)}function ve(s,e){Ae(s),Ne(e)}const Oe={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Se extends V{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Oe)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let a=await t.cacheMatch(e),r;if(!a)try{a=await n}catch(i){i instanceof Error&&(r=i)}if(!a)throw new l("no-response",{url:e.url,error:r});return a}}ae();ve([{"revision":null,"url":"assets/chart-lib.a8ad03fd.js"},{"revision":null,"url":"assets/chevron-down.dd238e96.js"},{"revision":null,"url":"assets/Config.39d8d2ef.css"},{"revision":null,"url":"assets/Config.c09e8dbe.js"},{"revision":null,"url":"assets/Connections.e48eac36.js"},{"revision":null,"url":"assets/Connections.fb8ea59b.css"},{"revision":null,"url":"assets/debounce.c2d20996.js"},{"revision":null,"url":"assets/en.fb34eaf7.js"},{"revision":null,"url":"assets/Fab.a0a7e573.css"},{"revision":null,"url":"assets/Fab.ef67ff10.js"},{"revision":null,"url":"assets/index.171f553a.js"},{"revision":null,"url":"assets/index.8bb012c6.js"},{"revision":null,"url":"assets/index.92e2d967.js"},{"revision":null,"url":"assets/index.b38debfc.css"},{"revision":null,"url":"assets/index.esm.e4dd1508.js"},{"revision":null,"url":"assets/logs.43986220.js"},{"revision":null,"url":"assets/Logs.4b8e75d1.css"},{"revision":null,"url":"assets/Logs.ac990610.js"},{"revision":null,"url":"assets/play.7b1a5f99.js"},{"revision":null,"url":"assets/Proxies.16b46af4.js"},{"revision":null,"url":"assets/Proxies.3fa3509d.css"},{"revision":null,"url":"assets/Rules.70e6962f.js"},{"revision":null,"url":"assets/Rules.e03c54a8.css"},{"revision":null,"url":"assets/Select.1e55eba1.css"},{"revision":null,"url":"assets/Select.6c389032.js"},{"revision":null,"url":"assets/TextFitler.61537a57.js"},{"revision":null,"url":"assets/TextFitler.b21c0577.css"},{"revision":null,"url":"assets/useRemainingViewPortHeight.7395542b.js"},{"revision":null,"url":"assets/zh.9b79b7bf.js"},{"revision":"551c420974ec38cb2da6f60d1fa1bb6e","url":"index.html"},{"revision":"402b66900e731ca748771b6fc5e7a068","url":"registerSW.js"},{"revision":"c0f9cb6aaf647e778bdc01c59944755b","url":"manifest.webmanifest"}]);const We=new RegExp("/[^/?]+\\.[^/]+$");N(({request:s,url:e})=>!(s.mode!=="navigate"||e.pathname.startsWith("/_")||e.pathname.match(We)),Ke("index.html"));N(({url:s})=>s.origin===self.location.origin&&s.pathname.endsWith(".png"),new Se({cacheName:"images",plugins:[new Re({maxEntries:50})]}));self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()}); diff --git a/clash-bin/tests/data/config/public/yacd-128.png b/clash-bin/tests/data/config/public/yacd-128.png deleted file mode 100644 index 4609a149d..000000000 Binary files a/clash-bin/tests/data/config/public/yacd-128.png and /dev/null differ diff --git a/clash-bin/tests/data/config/public/yacd-64.png b/clash-bin/tests/data/config/public/yacd-64.png deleted file mode 100644 index bbbcf6513..000000000 Binary files a/clash-bin/tests/data/config/public/yacd-64.png and /dev/null differ diff --git a/clash-bin/tests/data/config/public/yacd.ico b/clash-bin/tests/data/config/public/yacd.ico deleted file mode 100644 index ec4e47082..000000000 Binary files a/clash-bin/tests/data/config/public/yacd.ico and /dev/null differ diff --git a/clash-bin/tests/data/config/rule-set-classical.yaml b/clash-bin/tests/data/config/rule-set-classical.yaml deleted file mode 100644 index e2c32c052..000000000 --- a/clash-bin/tests/data/config/rule-set-classical.yaml +++ /dev/null @@ -1,2 +0,0 @@ -payload: - - DOMAIN-REGEX,^www.twitter.com$ diff --git a/clash-bin/tests/data/config/rule-set.yaml b/clash-bin/tests/data/config/rule-set.yaml deleted file mode 100644 index e263a9056..000000000 --- a/clash-bin/tests/data/config/rule-set.yaml +++ /dev/null @@ -1,2 +0,0 @@ -payload: - - 'httpbin.yba.dev' diff --git a/clash-bin/tests/data/config/rules.yaml b/clash-bin/tests/data/config/rules.yaml deleted file mode 100644 index aedd78128..000000000 --- a/clash-bin/tests/data/config/rules.yaml +++ /dev/null @@ -1,354 +0,0 @@ ---- -port: 8888 -socks-port: "8889" -mixed-port: 8899 -# tproxy-port: 8900 - -tun: - enable: false - device-id: "dev://utun1989" - route-all: false - gateway: "198.19.0.1/32" - so-mark: 3389 - dns-hijack: true - # dns-hijack: - # - 1.1.1.1:53 - routes: - - 1.1.1.1/32 - -ipv6: true - -mmdb: Country.mmdb -mmdb-download-url: "https://github.com/Loyalsoldier/geoip/releases/download/202601290026/Country.mmdb#_clash_outbound=direct&force=true" -asn-mmdb: Country-asn.mmdb -asn-mmdb-download-url: "https://github.com/Loyalsoldier/geoip/releases/download/202601290026/Country-asn.mmdb#_clash_outbound=non-exist&force=true" -geosite: geosite.dat -geosite-download-url: "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/download/202406182210/geosite.dat#force=true" - -dns: - enable: true - ipv6: true - listen: - udp: 127.0.0.1:53553 - tcp: 127.0.0.1:53553 - dot: - addr: 127.0.0.1:53554 - ca-cert: dns.crt - ca-key: dns.key - doh: - addr: 127.0.0.1:53555 - ca-cert: dns.crt - ca-key: dns.key - hostname: dns.example.com - doh3: - addr: 127.0.0.1:53555 - ca-cert: dns.crt - ca-key: dns.key - hostname: dns.example.com - - # ipv6: false # when the false, response to AAAA questions will be empty - - # These nameservers are used to resolve the DNS nameserver hostnames below. - # Specify IP addresses only - default-nameserver: - - 114.114.114.114 - - 8.8.8.8 - enhanced-mode: normal - fake-ip-range: 198.18.0.2/16 # Fake IP addresses pool CIDR - # use-hosts: true # lookup hosts and return IP record - - # Hostnames in this list will not be resolved with fake IPs - # i.e. questions to these domain names will always be answered with their - # real IP addresses - # fake-ip-filter: - # - '*.lan' - # - localhost.ptlogin2.qq.com - - # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. - # All DNS questions are sent directly to the nameserver, without proxies - # involved. Clash answers the DNS question with the first result gathered. - nameserver: - # - 114.114.114.114 # default value - # - 1.1.1.1#auto # default value - - tls://1.1.1.1:853#auto # DNS over TLS -# - dhcp://en0 # dns from dhcp - -allow-lan: true -mode: rule -log-level: info -external-controller: :9090 -external-ui: "public" -secret: "clash-rs" -experimental: - ignore-resolve-fail: true - -profile: - store-selected: true - store-fake-ip: false - store-smart-stats: true - -proxy-groups: - - name: "relay" - type: relay - proxies: - - "plain-vmess" - - "ws-vmess" - - "ss-simple" - - "trojan" - - "auto" - - "fallback-auto" - - "load-balance" - - "smart" - - "select" - - "wg" - - DIRECT - - - name: "udp-relay" - type: relay - proxies: - # - "plain-vmess" - - "ws-vmess" - # - "h2-vmess" - # - "tls-vmess" - # - "grpc-vmess" - - "ss-simple" - # - "trojan" - # - "auto" - # - "fallback-auto" - # - "load-balance" - # - "smart" - # - "select" - # - "wg" - # - DIRECT - - - name: "relay-one" - type: relay - use: - - "file-provider" - - - name: "auto" - type: url-test - use: - - "file-provider-uot" - proxies: - - DIRECT - url: "http://www.gstatic.com/generate_204" - interval: 300 - - - name: "fallback-auto" - type: fallback - use: - - "file-provider-uot" - proxies: - - DIRECT - url: "http://www.gstatic.com/generate_204" - interval: 300 - - - name: "load-balance" - type: load-balance - use: - - "file-provider-uot" - proxies: - - DIRECT - strategy: round-robin - url: "http://www.gstatic.com/generate_204" - interval: 300 - - - name: "smart" - type: smart - use: - - "file-provider-uot" - proxies: - - DIRECT - url: "http://www.gstatic.com/generate_204" - interval: 300 - - - name: select - type: select - use: - - "file-provider-uot" - - - name: test 🌏 - type: select - use: - - "file-provider" - proxies: - - DIRECT - -proxies: - - name: plain-vmess - type: vmess - server: 10.0.0.13 - port: 16823 - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - alterId: 0 - cipher: auto - udp: true - skip-cert-verify: true - connect-via: auto - - - name: ws-vmess - type: vmess - server: 10.0.0.13 - port: 16824 - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - alterId: 0 - cipher: auto - udp: true - skip-cert-verify: true - network: ws - ws-opts: - path: /api/v3/download.getFile - headers: - Host: www.amazon.com - - - name: tls-vmess - type: vmess - server: 10.0.0.13 - port: 8443 - uuid: 23ad6b10-8d1a-40f7-8ad0-e3e35cd38297 - alterId: 0 - cipher: auto - udp: true - skip-cert-verify: true - tls: true - - - name: h2-vmess - type: vmess - server: 10.0.0.13 - port: 8444 - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - alterId: 0 - cipher: auto - udp: true - skip-cert-verify: true - tls: true - network: h2 - h2-opts: - path: /ray - - - name: grpc-vmess - type: vmess - server: 10.0.0.13 - port: 19443 - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - alterId: 0 - cipher: auto - udp: true - skip-cert-verify: true - tls: true - network: grpc - grpc-opts: - grpc-service-name: abc - - - name: "ss-simple" - type: ss - server: 127.0.0.1 - port: 8901 - cipher: 2022-blake3-aes-256-gcm - password: "3SYJ/f8nmVuzKvKglykRQDSgg10e/ADilkdRWrrY9HU=" - udp: true - - - name: "trojan" - type: trojan - server: 10.0.0.13 - port: 9443 - password: password1 - udp: true - # sni: example.com # aka server name - alpn: - - h2 - - http/1.1 - skip-cert-verify: true - - - name: "trojan-grpc" - type: trojan - server: 10.0.0.13 - port: 19443 - password: password1 - udp: true - # sni: example.com # aka server name - alpn: - - h2 - skip-cert-verify: true - network: grpc - grpc-opts: - grpc-service-name: def - - - name: "wg" - type: wireguard - server: engage.cloudflareclient.com - port: 2408 - private-key: uIwDn4c7656E/1pHkJu23ZOe/4SuCnL+vL+jE2s4MHE= - ip: 172.16.0.2/32 - ipv6: 2606:4700:110:8e5e:fa1:3f30:c077:e17c/128 - public-key: bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo= - allowed-ips: ["0.0.0.0/0", "::/0"] - remote-dns-resolve: true - dns: - - 1.1.1.1 - udp: true - - - name: "vless-ws-tls" - type: vless - server: 127.0.0.1 - port: 8443 - tls: true - network: ws - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - ws-opts: - path: /websocket - -proxy-providers: - file-provider: - type: file - path: ./ss.yaml - interval: 300 - health-check: - enable: true - url: http://www.gstatic.com/generate_204 - interval: 300 - - file-provider-uot: - type: file - path: ./uot.yaml - interval: 300 - health-check: - enable: true - url: http://www.gstatic.com/generate_204 - interval: 300 - -rule-providers: - file-provider: - type: file - path: ./rule-set.yaml - interval: 300 - behavior: domain - file-provider2: - type: file - path: ./rule-set-classical.yaml - interval: 300 - behavior: classical - -rules: - - IP-CIDR,1.1.1.1/32,ss-simple - - IP-CIDR,8.8.8.8/32,ss-simple - - DOMAIN-KEYWORD,google,vless-ws-tls - - DOMAIN-REGEX,^www.google.com$,DIRECT - - DOMAIN,google.com,ss-simple - - DOMAIN-KEYWORD,httpbin,trojan-grpc - - DOMAIN,ipinfo.io,DIRECT - - RULE-SET,file-provider2,DIRECT - - GEOIP,CN,relay - - DOMAIN-SUFFIX,facebook.com,REJECT - - DOMAIN,google.com,select - - SRC-IP-CIDR,192.168.1.1/24,DIRECT - - GEOIP,CN,DIRECT - - IP-CIDR,10.0.0.11/32,DIRECT - - DST-PORT,53,ws-vmess - - SRC-PORT,7777,DIRECT - - AND,((DOMAIN,baidu.com),(NETWORK,UDP)),DIRECT - - OR,((NETWORK,UDP),(DOMAIN,baidu.com)),REJECT - - NOT,((DOMAIN,baidu.com)),trojan-grpc - - AND,((DOMAIN,example.com),(OR,((SRC-IP-CIDR,192.168.1.1/24),(SRC-IP-CIDR,10.0.0.100/32)))),DIRECT - - MATCH, DIRECT diff --git a/clash-bin/tests/data/config/server.yaml b/clash-bin/tests/data/config/server.yaml deleted file mode 100644 index 2bdedef20..000000000 --- a/clash-bin/tests/data/config/server.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -listeners: - - name: "ss" - type: shadowsocks - listen: 0.0.0.0 - port: 8901 - cipher: 2022-blake3-aes-256-gcm - password: "3SYJ/f8nmVuzKvKglykRQDSgg10e/ADilkdRWrrY9HU=" - udp: true - - -allow-lan: true -mode: rule -log-level: trace - -proxies: - - name: "ss-simple" - type: ss - server: 127.0.0.1 - port: 8901 - cipher: 2022-blake3-aes-256-gcm - password: "3SYJ/f8nmVuzKvKglykRQDSgg10e/ADilkdRWrrY9HU=" - udp: true - -rules: - - MATCH, DIRECT diff --git a/clash-bin/tests/data/config/shadowquic.yaml b/clash-bin/tests/data/config/shadowquic.yaml deleted file mode 100644 index 5a701d0ee..000000000 --- a/clash-bin/tests/data/config/shadowquic.yaml +++ /dev/null @@ -1,14 +0,0 @@ -inbound: - type: shadowquic - bind-addr: 0.0.0.0:10002 - users: - - password: "12345678" - username: "87654321" - jls-upstream: - addr: "echo.free.beeceptor.com:443" # domain + port, domain must be the same as client - alpn: ["h3"] - congestion-control: bbr - zero-rtt: true -outbound: - type: direct -log-level: "trace" diff --git a/clash-bin/tests/data/config/simple.yaml b/clash-bin/tests/data/config/simple.yaml deleted file mode 100644 index 2c4402d39..000000000 --- a/clash-bin/tests/data/config/simple.yaml +++ /dev/null @@ -1,4 +0,0 @@ -mixed-port: 8899 -external-controller: 127.0.0.1:9090 -mode: global -bind-address: "0.0.0.0" diff --git a/clash-bin/tests/data/config/socks5-auth.json b/clash-bin/tests/data/config/socks5-auth.json deleted file mode 100644 index 1f8177d31..000000000 --- a/clash-bin/tests/data/config/socks5-auth.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "log": { - "loglevel": "debug" - }, - "inbounds": [ - { - "port": 10002, - "listen": "0.0.0.0", - "protocol": "socks", - "settings": { - "auth": "password", - "accounts": [ - { - "user": "user", - "pass": "password" - } - ], - "udp": true, - "ip": "0.0.0.0" - } - } - ], - "outbounds": [ - { - "protocol": "freedom" - } - ] -} diff --git a/clash-bin/tests/data/config/socks5-noauth.json b/clash-bin/tests/data/config/socks5-noauth.json deleted file mode 100644 index ebec78d36..000000000 --- a/clash-bin/tests/data/config/socks5-noauth.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "log": { - "loglevel": "debug" - }, - "inbounds": [ - { - "port": 10002, - "listen": "0.0.0.0", - "protocol": "socks", - "settings": { - "auth": "noauth", - "udp": true, - "ip": "0.0.0.0" - } - } - ], - "outbounds": [ - { - "protocol": "freedom" - } - ] -} diff --git a/clash-bin/tests/data/config/socks5.yaml b/clash-bin/tests/data/config/socks5.yaml deleted file mode 100644 index 20443558b..000000000 --- a/clash-bin/tests/data/config/socks5.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -port: 8888 -socks-port: 8889 -mixed-port: 8899 - -mode: rule -log-level: debug -external-controller: 127.0.0.1:6170 - - -proxies: - - name: "socks5-noauth" - type: socks5 - server: 10.0.0.13 - port: 10800 - udp: true - - - name: "socks5-auth" - type: socks5 - server: 10.0.0.13 - port: 10801 - username: user - password: password - udp: true - - - name: "socks5-tls" - type: socks5 - server: 10.0.0.13 - port: 10802 - username: user - password: password - tls: true - udp: true - skip-cert-verify: true -rules: -# - MATCH, socks5-noauth -# - MATCH, socks5-auth - - MATCH, socks5-tls -... diff --git a/clash-bin/tests/data/config/ss.json b/clash-bin/tests/data/config/ss.json deleted file mode 100644 index af5d43cfb..000000000 --- a/clash-bin/tests/data/config/ss.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "server":"0.0.0.0", - "server_port": 10004, - "password":"FzcLbKs2dY9mhL", - "timeout":300, - "method":"aes-256-gcm", - "nameserver":"1.1.1.1", - "mode":"tcp_and_udp", - "plugin":"v2ray-plugin", - "plugin_opts":"server;tls;host=example.org" -} diff --git a/clash-bin/tests/data/config/ss.yaml b/clash-bin/tests/data/config/ss.yaml deleted file mode 100644 index be4ed6992..000000000 --- a/clash-bin/tests/data/config/ss.yaml +++ /dev/null @@ -1,77 +0,0 @@ ---- -port: 8888 -socks-port: 8889 -mixed-port: 8899 - -dns: - enable: true - listen: 127.0.0.1:53533 - # ipv6: false # when the false, response to AAAA questions will be empty - - # These nameservers are used to resolve the DNS nameserver hostnames below. - # Specify IP addresses only - default-nameserver: - - 114.114.114.114 - - 8.8.8.8 - enhanced-mode: fake-ip # or fake-ip - fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR - # use-hosts: true # lookup hosts and return IP record - - # Hostnames in this list will not be resolved with fake IPs - # i.e. questions to these domain names will always be answered with their - # real IP addresses - # fake-ip-filter: - # - '*.lan' - # - localhost.ptlogin2.qq.com - - # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. - # All DNS questions are sent directly to the nameserver, without proxies - # involved. Clash answers the DNS question with the first result gathered. - nameserver: - - 114.114.114.114 # default value - - 8.8.8.8 # default value - - tls://dns.google:853 # DNS over TLS - - https://1.1.1.1/dns-query # DNS over HTTPS - -allow-lan: true -mode: rule -log-level: debug -external-controller: 127.0.0.1:6170 -experimental: - ignore-resolve-fail: true - -proxies: - - name: "ss-01" - type: ss - server: 10.0.0.13 - port: 8388 - cipher: aes-256-gcm - password: "password" - udp: true - connect-via: ss-02 - # dialer-proxy: ss-02 - - - name: "ss-02" - type: ss - server: 10.0.0.13 - port: 8388 - cipher: aes-256-gcm - password: "password" - udp: true - - - name: ss-2022 - type: ss - server: 127.0.0.1 - port: 8390 - cipher: 2022-blake3-aes-256-gcm - password: 3SYJ/f8nmVuzKvKglykRQDSgg10e/ADilkdRWrrY9HU=:4w0GKJ9U3Ox7CIXGU4A3LDQAqP6qrp/tUi/ilpOR9p4= - -proxy-groups: - - name: "udp-relay" - type: relay - proxies: - - ss-01 - - ss-02 - - ss-2022 -rules: - - MATCH, ss-2022 diff --git a/clash-bin/tests/data/config/tor.yaml b/clash-bin/tests/data/config/tor.yaml deleted file mode 100644 index dc3a27587..000000000 --- a/clash-bin/tests/data/config/tor.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -port: 8888 -socks-port: 8889 -mixed-port: 8899 - -mode: rule -log-level: debug -external-controller: 127.0.0.1:6170 - - -proxies: - - name: "tor" - type: tor - - name: "ss-02" - type: ss - server: 10.0.0.13 - port: 8388 - cipher: aes-256-gcm - password: "password" - udp: true - -rules: - - MATCH, tor -... diff --git a/clash-bin/tests/data/config/tproxy.yaml b/clash-bin/tests/data/config/tproxy.yaml deleted file mode 100644 index 4f6ce9253..000000000 --- a/clash-bin/tests/data/config/tproxy.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -tproxy-port: 8900 - -mode: rule -log-level: debug - -rules: - - MATCH, DIRECT -... diff --git a/clash-bin/tests/data/config/trojan-grpc.json b/clash-bin/tests/data/config/trojan-grpc.json deleted file mode 100644 index 03bf8af61..000000000 --- a/clash-bin/tests/data/config/trojan-grpc.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "inbounds": [ - { - "port": 10002, - "listen": "0.0.0.0", - "protocol": "trojan", - "settings": { - "clients": [ - { - "password": "example", - "email": "grpc@example.com" - } - ] - }, - "streamSettings": { - "network": "grpc", - "security": "tls", - "tlsSettings": { - "certificates": [ - { - "certificateFile": "/etc/ssl/v2ray/fullchain.pem", - "keyFile": "/etc/ssl/v2ray/privkey.pem" - } - ] - }, - "grpcSettings": { - "serviceName": "example" - } - } - } - ], - "outbounds": [ - { - "protocol": "freedom" - } - ], - "log": { - "loglevel": "debug" - } -} diff --git a/clash-bin/tests/data/config/trojan-ws.json b/clash-bin/tests/data/config/trojan-ws.json deleted file mode 100644 index 53eaab1d4..000000000 --- a/clash-bin/tests/data/config/trojan-ws.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "run_type": "server", - "local_addr": "0.0.0.0", - "local_port": 10002, - "disable_http_check": true, - "password": [ - "example" - ], - "websocket": { - "enabled": true, - "path": "/", - "host": "example.org" - }, - "ssl": { - "verify": true, - "cert": "/fullchain.pem", - "key": "/privkey.pem", - "sni": "example.org" - } -} diff --git a/clash-bin/tests/data/config/tuic.toml b/clash-bin/tests/data/config/tuic.toml deleted file mode 100644 index ddf8410bd..000000000 --- a/clash-bin/tests/data/config/tuic.toml +++ /dev/null @@ -1,23 +0,0 @@ -server = "0.0.0.0:10002" - -data_dir = "" - -zero_rtt_handshake = false -dual_stack = false - -acl = ''' -direct 0.0.0.0/0 -direct ::/0 -''' - -[users] -00000000-0000-0000-0000-000000000001 = "passwd" - -[tls] -certificate = "/opt/tuic/fullchain.pem" -private_key = "/opt/tuic/privkey.pem" -alpn = ["h3"] - -[outbound.default] -type = "direct" -ip_mode = "auto" diff --git a/clash-bin/tests/data/config/tun.yaml b/clash-bin/tests/data/config/tun.yaml deleted file mode 100644 index dec6dd395..000000000 --- a/clash-bin/tests/data/config/tun.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -port: 8888 - -log-level: trace - -ipv6: true - -dns: - enable: true - ipv6: true - listen: - udp: 127.0.0.1:53553 - tcp: 127.0.0.1:53553 - dot: - addr: 127.0.0.1:53554 - ca-cert: dns.crt - ca-key: dns.key - doh: - addr: 127.0.0.1:53555 - ca-cert: dns.crt - ca-key: dns.key - hostname: dns.example.com - doh3: - addr: 127.0.0.1:53555 - ca-cert: dns.crt - ca-key: dns.key - hostname: dns.example.com - - # These nameservers are used to resolve the DNS nameserver hostnames below. - # Specify IP addresses only - default-nameserver: - - 114.114.114.114 - - 8.8.8.8 - enhanced-mode: normal - fake-ip-range: 198.18.0.2/16 # Fake IP addresses pool CIDR - - # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. - # All DNS questions are sent directly to the nameserver, without proxies - # involved. Clash answers the DNS question with the first result gathered. - nameserver: - # - 114.114.114.114 # default value - # - 1.1.1.1#auto # default value - - tls://1.1.1.1:853#auto # DNS over TLS -# - dhcp://en0 # dns from dhcp -tun: - enable: true - device-id: "dev://utun1989" - route-all: true - gateway: "198.19.0.1/24" - gateway-v6: "fd00:fac::1/64" - so-mark: 3389 - dns-hijack: true - # dns-hijack: - # - 1.1.1.1:53 - routes: - - 1.1.1.1/32 - - 2001:4860:4860::8888/128 - - 2404:6800:4006:810::200e/128 - -rules: - - MATCH, DIRECT diff --git a/clash-bin/tests/data/config/uot.yaml b/clash-bin/tests/data/config/uot.yaml deleted file mode 100644 index 6ef430319..000000000 --- a/clash-bin/tests/data/config/uot.yaml +++ /dev/null @@ -1,37 +0,0 @@ -proxies: - - name: plain-vmess - type: vmess - server: 10.0.0.13 - port: 16823 - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - alterId: 0 - cipher: auto - udp: true - skip-cert-verify: true - - - name: ws-vmess - type: vmess - server: 10.0.0.13 - port: 16824 - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - alterId: 0 - cipher: auto - udp: true - skip-cert-verify: true - network: ws - ws-opts: - path: /api/v3/download.getFile - headers: - Host: www.amazon.com - - - name: "trojan" - type: trojan - server: 10.0.0.13 - port: 9443 - password: password1 - udp: true - # sni: example.com # aka server name - alpn: - - h2 - - http/1.1 - skip-cert-verify: true diff --git a/clash-bin/tests/data/config/vless-tcp-reality.yaml b/clash-bin/tests/data/config/vless-tcp-reality.yaml deleted file mode 100644 index 711673540..000000000 --- a/clash-bin/tests/data/config/vless-tcp-reality.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -port: 8888 -socks-port: 8889 -mixed-port: 8899 - -dns: - enable: true - listen: 127.0.0.1:53533 - default-nameserver: - - 114.114.114.114 - - 8.8.8.8 - enhanced-mode: fake-ip - fake-ip-range: 198.18.0.1/16 - nameserver: - - 114.114.114.114 - - 8.8.8.8 - -allow-lan: true -mode: rule -log-level: debug -external-controller: 127.0.0.1:6170 -experimental: - ignore-resolve-fail: true - -proxies: - - name: "vless-tcp-reality" - type: vless - server: example.com - port: 443 - uuid: 5415d8e0-df92-3655-afa4-b79de66413f5 - network: tcp - flow: xtls-rprx-vision - tls: true - servername: www.icloud.com - client-fingerprint: chrome - reality-opts: - public-key: zsfkzg3Jjsl2YcQCho_J-pFcHuCL7OGv3mtkDyIx3iw - short-id: 9c1adf35ef1c6b - udp: true - - - name: "vless-tcp-plain" - type: vless - server: 127.0.0.1 - port: 8443 - tls: true - servername: example.com - network: tcp - skip-cert-verify: true - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - udp: true - -proxy-groups: - - name: "tcp-group" - type: select - proxies: - - vless-tcp-reality - - vless-tcp-plain - -rules: - - MATCH, tcp-group diff --git a/clash-bin/tests/data/config/vless-ws-tls.json b/clash-bin/tests/data/config/vless-ws-tls.json deleted file mode 100644 index 5012e7bf4..000000000 --- a/clash-bin/tests/data/config/vless-ws-tls.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "log": { - "loglevel": "debug" - }, - "inbounds": [ - { - "port": 8443, - "protocol": "vless", - "settings": { - "clients": [ - { - "id": "b831381d-6324-4d53-ad4f-8cda48b30811", - "level": 0, - "email": "love@v2fly.org" - } - ], - "decryption": "none", - "fallbacks": [ - { - "dest": 80 - }, - { - "path": "/websocket", - "dest": 1234, - "xver": 1 - } - ] - }, - "streamSettings": { - "network": "tcp", - "security": "tls", - "tlsSettings": { - "alpn": [ - "http/1.1" - ], - "certificates": [ - { - "certificateFile": "/etc/ssl/v2ray/fullchain.pem", - "keyFile": "/etc/ssl/v2ray/privkey.pem" - } - ] - } - } - }, - { - "port": 1234, - "listen": "127.0.0.1", - "protocol": "vless", - "settings": { - "clients": [ - { - "id": "b831381d-6324-4d53-ad4f-8cda48b30811", - "level": 0, - "email": "love@v2fly.org" - } - ], - "decryption": "none" - }, - "streamSettings": { - "network": "ws", - "security": "none", - "wsSettings": { - "acceptProxyProtocol": true, // 提醒:若你用 Nginx/Caddy 等反代 WS,需要删掉这行 - "path": "/websocket" // 必须换成自定义的 PATH,需要和上面的一致 - } - } - } - ], - "outbounds": [ - { - "protocol": "freedom" - } - ] -} diff --git a/clash-bin/tests/data/config/vless.yaml b/clash-bin/tests/data/config/vless.yaml deleted file mode 100644 index 8dc0f51be..000000000 --- a/clash-bin/tests/data/config/vless.yaml +++ /dev/null @@ -1,65 +0,0 @@ ---- -port: 8888 -socks-port: 8889 -mixed-port: 8899 - -dns: - enable: true - listen: 127.0.0.1:53533 - # ipv6: false # when the false, response to AAAA questions will be empty - - # These nameservers are used to resolve the DNS nameserver hostnames below. - # Specify IP addresses only - default-nameserver: - - 114.114.114.114 - - 8.8.8.8 - enhanced-mode: fake-ip # or fake-ip - fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR - # use-hosts: true # lookup hosts and return IP record - - # Hostnames in this list will not be resolved with fake IPs - # i.e. questions to these domain names will always be answered with their - # real IP addresses - # fake-ip-filter: - # - '*.lan' - # - localhost.ptlogin2.qq.com - - # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. - # All DNS questions are sent directly to the nameserver, without proxies - # involved. Clash answers the DNS question with the first result gathered. - nameserver: - - 114.114.114.114 # default value - - 8.8.8.8 # default value - - tls://dns.google:853 # DNS over TLS - - https://1.1.1.1/dns-query # DNS over HTTPS - -allow-lan: true -mode: rule -log-level: debug -external-controller: 127.0.0.1:6170 -experimental: - ignore-resolve-fail: true - -proxies: - - name: "vless-ws-tls" - type: vless - server: 127.0.0.1 - port: 8443 - tls: true - servername: example.com - network: ws - skip-cert-verify: true - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - ws-opts: - path: /websocket - headers: - Host: example.com - udp: true - -proxy-groups: - - name: "udp-relay" - type: relay - proxies: - - vless-ws-tls -rules: - - MATCH, vless-ws-tls diff --git a/clash-bin/tests/data/config/vmess-grpc.json b/clash-bin/tests/data/config/vmess-grpc.json deleted file mode 100644 index f44303832..000000000 --- a/clash-bin/tests/data/config/vmess-grpc.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "inbounds": [ - { - "port": 10002, - "listen": "0.0.0.0", - "protocol": "vmess", - "settings": { - "clients": [ - { - "id": "b831381d-6324-4d53-ad4f-8cda48b30811" - } - ] - }, - "streamSettings": { - "network": "grpc", - "security": "tls", - "tlsSettings": { - "certificates": [ - { - "certificateFile": "/etc/ssl/v2ray/fullchain.pem", - "keyFile": "/etc/ssl/v2ray/privkey.pem" - } - ] - }, - "grpcSettings": { - "serviceName": "example!" - } - } - } - ], - "outbounds": [ - { - "protocol": "freedom" - } - ], - "log": { - "loglevel": "debug" - } -} diff --git a/clash-bin/tests/data/config/vmess-http2.json b/clash-bin/tests/data/config/vmess-http2.json deleted file mode 100644 index e2d997776..000000000 --- a/clash-bin/tests/data/config/vmess-http2.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "inbounds": [ - { - "port": 10002, - "listen": "0.0.0.0", - "protocol": "vmess", - "settings": { - "clients": [ - { - "id": "b831381d-6324-4d53-ad4f-8cda48b30811" - } - ] - }, - "streamSettings": { - "network": "http", - "security": "tls", - "tlsSettings": { - "certificates": [ - { - "certificateFile": "/etc/ssl/v2ray/fullchain.pem", - "keyFile": "/etc/ssl/v2ray/privkey.pem" - } - ] - }, - "httpSettings": { - "host": [ - "example.org" - ], - "path": "/test" - } - } - } - ], - "outbounds": [ - { - "protocol": "freedom" - } - ], - "log": { - "loglevel": "debug" - } -} diff --git a/clash-bin/tests/data/config/vmess-ws.json b/clash-bin/tests/data/config/vmess-ws.json deleted file mode 100644 index f88fd31c0..000000000 --- a/clash-bin/tests/data/config/vmess-ws.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "inbounds": [ - { - "port": 10002, - "listen": "0.0.0.0", - "protocol": "vmess", - "settings": { - "clients": [ - { - "id": "b831381d-6324-4d53-ad4f-8cda48b30811" - } - ] - }, - "streamSettings": { - "network": "ws", - "security": "tls", - "tlsSettings": { - "certificates": [ - { - "certificateFile": "/etc/ssl/v2ray/fullchain.pem", - "keyFile": "/etc/ssl/v2ray/privkey.pem" - } - ] - } - } - } - ], - "outbounds": [ - { - "protocol": "freedom" - } - ] -} diff --git a/clash-bin/tests/data/config/wg.yaml b/clash-bin/tests/data/config/wg.yaml deleted file mode 100644 index 46c489ccd..000000000 --- a/clash-bin/tests/data/config/wg.yaml +++ /dev/null @@ -1,71 +0,0 @@ ---- -port: 8888 -socks-port: 8889 -mixed-port: 8899 - - -dns: - enable: true - listen: 127.0.0.1:53533 - # ipv6: false # when the false, response to AAAA questions will be empty - - # These nameservers are used to resolve the DNS nameserver hostnames below. - # Specify IP addresses only - default-nameserver: - - 114.114.114.114 - - 8.8.8.8 - enhanced-mode: fake-ip # or fake-ip - fake-ip-range: 198.18.0.1/16 # Fake IP addresses pool CIDR - # use-hosts: true # lookup hosts and return IP record - - # Hostnames in this list will not be resolved with fake IPs - # i.e. questions to these domain names will always be answered with their - # real IP addresses - # fake-ip-filter: - # - '*.lan' - # - localhost.ptlogin2.qq.com - - # Supports UDP, TCP, DoT, DoH. You can specify the port to connect to. - # All DNS questions are sent directly to the nameserver, without proxies - # involved. Clash answers the DNS question with the first result gathered. - nameserver: - - 114.114.114.114 # default value - - 8.8.8.8 # default value - - tls://dns.google:853 # DNS over TLS - - https://1.1.1.1/dns-query # DNS over HTTPS - -allow-lan: true -mode: rule -log-level: debug -external-controller: 127.0.0.1:6170 -experimental: - ignore-resolve-fail: true - -proxies: - - name: "wg" - type: wireguard - server: engage.cloudflareclient.com - port: 2408 - private-key: 0LQye/+HjLvgnXLs5ETQcHe5AcR7G4Bv78xu6Qja230= - ip: 172.16.0.2/32 - ipv6: 2606:4700:110:82f3:873f:ed26:e24d:c2cb/128 - public-key: bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo= - allowed-ips: ['0.0.0.0/0', '::/0'] - remote-dns-resolve: true - dns: - - 1.1.1.1 - udp: true - connect-via: plain-vmess - - name: plain-vmess - type: vmess - server: 10.0.0.13 - port: 16823 - uuid: b831381d-6324-4d53-ad4f-8cda48b30811 - alterId: 0 - cipher: auto - udp: true - skip-cert-verify: true - -rules: - - MATCH, wg -... diff --git a/clash-bin/tests/data/config/wg_config/.donoteditthisfile b/clash-bin/tests/data/config/wg/.donoteditthisfile similarity index 100% rename from clash-bin/tests/data/config/wg_config/.donoteditthisfile rename to clash-bin/tests/data/config/wg/.donoteditthisfile diff --git a/clash-bin/tests/data/config/wg_config/coredns/Corefile b/clash-bin/tests/data/config/wg/coredns/Corefile similarity index 100% rename from clash-bin/tests/data/config/wg_config/coredns/Corefile rename to clash-bin/tests/data/config/wg/coredns/Corefile diff --git a/clash-bin/tests/data/config/wg_config/peer1/peer1.conf b/clash-bin/tests/data/config/wg/peer1/peer1.conf similarity index 100% rename from clash-bin/tests/data/config/wg_config/peer1/peer1.conf rename to clash-bin/tests/data/config/wg/peer1/peer1.conf diff --git a/clash-bin/tests/data/config/wg_config/peer1/peer1.png b/clash-bin/tests/data/config/wg/peer1/peer1.png similarity index 100% rename from clash-bin/tests/data/config/wg_config/peer1/peer1.png rename to clash-bin/tests/data/config/wg/peer1/peer1.png diff --git a/clash-bin/tests/data/config/wg_config/peer1/presharedkey-peer1 b/clash-bin/tests/data/config/wg/peer1/presharedkey-peer1 similarity index 100% rename from clash-bin/tests/data/config/wg_config/peer1/presharedkey-peer1 rename to clash-bin/tests/data/config/wg/peer1/presharedkey-peer1 diff --git a/clash-bin/tests/data/config/wg_config/peer1/privatekey-peer1 b/clash-bin/tests/data/config/wg/peer1/privatekey-peer1 similarity index 100% rename from clash-bin/tests/data/config/wg_config/peer1/privatekey-peer1 rename to clash-bin/tests/data/config/wg/peer1/privatekey-peer1 diff --git a/clash-bin/tests/data/config/wg_config/peer1/publickey-peer1 b/clash-bin/tests/data/config/wg/peer1/publickey-peer1 similarity index 100% rename from clash-bin/tests/data/config/wg_config/peer1/publickey-peer1 rename to clash-bin/tests/data/config/wg/peer1/publickey-peer1 diff --git a/clash-bin/tests/data/config/wg_config/server/privatekey-server b/clash-bin/tests/data/config/wg/server/privatekey-server similarity index 100% rename from clash-bin/tests/data/config/wg_config/server/privatekey-server rename to clash-bin/tests/data/config/wg/server/privatekey-server diff --git a/clash-bin/tests/data/config/wg_config/server/publickey-server b/clash-bin/tests/data/config/wg/server/publickey-server similarity index 100% rename from clash-bin/tests/data/config/wg_config/server/publickey-server rename to clash-bin/tests/data/config/wg/server/publickey-server diff --git a/clash-bin/tests/data/config/wg_config/templates/peer.conf b/clash-bin/tests/data/config/wg/templates/peer.conf similarity index 100% rename from clash-bin/tests/data/config/wg_config/templates/peer.conf rename to clash-bin/tests/data/config/wg/templates/peer.conf diff --git a/clash-bin/tests/data/config/wg_config/templates/server.conf b/clash-bin/tests/data/config/wg/templates/server.conf similarity index 100% rename from clash-bin/tests/data/config/wg_config/templates/server.conf rename to clash-bin/tests/data/config/wg/templates/server.conf diff --git a/clash-bin/tests/data/config/wg_config/wg_confs/wg0.conf b/clash-bin/tests/data/config/wg/wg_confs/wg0.conf similarity index 100% rename from clash-bin/tests/data/config/wg_config/wg_confs/wg0.conf rename to clash-bin/tests/data/config/wg/wg_confs/wg0.conf diff --git a/clash-lib/src/proxy/anytls/mod.rs b/clash-lib/src/proxy/anytls/mod.rs index 350370a59..727db7ff1 100644 --- a/clash-lib/src/proxy/anytls/mod.rs +++ b/clash-lib/src/proxy/anytls/mod.rs @@ -483,6 +483,9 @@ mod tests { session::{Session, SocksAddr}, }; + #[cfg(docker_test)] + use std::io::Write; + #[cfg(docker_test)] use crate::{ proxy::{ @@ -500,6 +503,39 @@ mod tests { tests::initialize, }; + #[cfg(docker_test)] + const ANYTLS_SERVER_CONFIG: &str = r#"{ + "log": { + "level": "info" + }, + "inbounds": [ + { + "type": "anytls", + "tag": "anytls-in", + "listen": "0.0.0.0", + "listen_port": 10002, + "users": [ + { + "name": "user", + "password": "example" + } + ], + "padding_scheme": ["stop=0"], + "tls": { + "enabled": true, + "certificate_path": "/etc/ssl/v2ray/fullchain.pem", + "key_path": "/etc/ssl/v2ray/privkey.pem" + } + } + ], + "outbounds": [ + { + "type": "direct", + "tag": "direct" + } + ] +}"#; + fn make_handler(udp: bool, with_tls: bool) -> Handler { use crate::proxy::transport::TlsClient; Handler::new(HandlerOptions { @@ -802,21 +838,25 @@ mod tests { #[cfg(docker_test)] async fn get_runner(host_port: u16) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let conf = test_config_dir.join("anytls.json"); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); - DockerTestRunnerBuilder::new() + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(ANYTLS_SERVER_CONFIG.as_bytes())?; + + let result = DockerTestRunnerBuilder::new() .image(IMAGE_SINGBOX) .cmd(&["run", "-c", "/etc/sing-box/config.json"]) .mounts(&[ - (conf.to_str().unwrap(), "/etc/sing-box/config.json"), + (tmp.path().to_str().unwrap(), "/etc/sing-box/config.json"), (cert.to_str().unwrap(), "/etc/ssl/v2ray/fullchain.pem"), (key.to_str().unwrap(), "/etc/ssl/v2ray/privkey.pem"), ]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } #[cfg(docker_test)] diff --git a/clash-lib/src/proxy/hysteria2/mod.rs b/clash-lib/src/proxy/hysteria2/mod.rs index a0aad7cee..6c6e84b09 100644 --- a/clash-lib/src/proxy/hysteria2/mod.rs +++ b/clash-lib/src/proxy/hysteria2/mod.rs @@ -693,7 +693,10 @@ impl AsyncWrite for HystStream { #[cfg(all(test, docker_test))] mod tests { - use std::net::{IpAddr, Ipv4Addr}; + use std::{ + io::Write, + net::{IpAddr, Ipv4Addr}, + }; use super::super::utils::test_utils::{ consts::*, docker_runner::DockerTestRunner, @@ -713,25 +716,49 @@ mod tests { use super::*; + const HYSTERIA_SERVER_CONFIG: &str = r#"{ + "listen": ":10002", + "tls":{ + "cert": "/home/ubuntu/my.crt", + "key": "/home/ubuntu/my.key" + }, + "obfs": { + "type": "salamander", + "salamander": { + "password": "beauty will save the world" + } + }, + "up_mbps": 100, + "down_mbps": 100, + "auth": { + "type": "password", + "password": "passwd" + } +}"#; + async fn get_hysteria_runner( host_port: u16, ) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let conf = test_config_dir.join("hysteria.json"); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); + + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(HYSTERIA_SERVER_CONFIG.as_bytes())?; - DockerTestRunnerBuilder::new() + let result = DockerTestRunnerBuilder::new() .image(IMAGE_HYSTERIA) .mounts(&[ - (conf.to_str().unwrap(), "/config.json"), + (tmp.path().to_str().unwrap(), "/config.json"), (cert.to_str().unwrap(), "/home/ubuntu/my.crt"), (key.to_str().unwrap(), "/home/ubuntu/my.key"), ]) .cmd(&["server"]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } #[tokio::test] diff --git a/clash-lib/src/proxy/shadowquic/mod.rs b/clash-lib/src/proxy/shadowquic/mod.rs index 1b62def08..3c5d6c4a6 100644 --- a/clash-lib/src/proxy/shadowquic/mod.rs +++ b/clash-lib/src/proxy/shadowquic/mod.rs @@ -266,6 +266,8 @@ fn to_clash_socks_addr(x: SQAddr) -> SocksAddr { #[cfg(all(test, docker_test))] mod tests { + use std::{io::Write, sync::Arc}; + use super::super::utils::test_utils::{ consts::*, docker_runner::DockerTestRunner, }; @@ -274,28 +276,45 @@ mod tests { GLOBAL_DIRECT_CONNECTOR, test_utils::{ Suite, - config_helper::test_config_base_dir, docker_runner::{DockerTestRunnerBuilder, alloc_docker_port}, run_test_suites_and_cleanup, }, }, tests::initialize, }; - use std::sync::Arc; use super::*; + + const SHADOWQUIC_SERVER_CONFIG: &str = r#"inbound: + type: shadowquic + bind-addr: 0.0.0.0:10002 + users: + - password: "12345678" + username: "87654321" + jls-upstream: + addr: "echo.free.beeceptor.com:443" + alpn: ["h3"] + congestion-control: bbr + zero-rtt: true +outbound: + type: direct +log-level: "trace" +"#; + async fn get_shadowquic_runner( host_port: u16, ) -> anyhow::Result { - let test_config_dir = test_config_base_dir(); - let conf = test_config_dir.join("shadowquic.yaml"); + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(SHADOWQUIC_SERVER_CONFIG.as_bytes())?; - DockerTestRunnerBuilder::new() + let result = DockerTestRunnerBuilder::new() .image(IMAGE_SHADOWQUIC) - .mounts(&[(conf.to_str().unwrap(), "/etc/shadowquic/config.yaml")]) + .mounts(&[(tmp.path().to_str().unwrap(), "/etc/shadowquic/config.yaml")]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } fn gen_options( diff --git a/clash-lib/src/proxy/shadowsocks/outbound/mod.rs b/clash-lib/src/proxy/shadowsocks/outbound/mod.rs index 0347b0858..8783951a0 100644 --- a/clash-lib/src/proxy/shadowsocks/outbound/mod.rs +++ b/clash-lib/src/proxy/shadowsocks/outbound/mod.rs @@ -302,8 +302,8 @@ mod tests { port: u16, ) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); let host = format!("0.0.0.0:{}", port); DockerTestRunnerBuilder::new() .image(IMAGE_SS_RUST) @@ -593,8 +593,8 @@ mod e2e { ) -> anyhow::Result { use crate::proxy::utils::test_utils::config_helper::test_config_base_dir; let test_config_dir = test_config_base_dir(); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); let host = format!("0.0.0.0:{}", port); DockerTestRunnerBuilder::new() .image(IMAGE_SS_RUST) diff --git a/clash-lib/src/proxy/socks/outbound/mod.rs b/clash-lib/src/proxy/socks/outbound/mod.rs index a620a68b6..3f426f3a7 100644 --- a/clash-lib/src/proxy/socks/outbound/mod.rs +++ b/clash-lib/src/proxy/socks/outbound/mod.rs @@ -285,7 +285,7 @@ impl PlainProxyAPIResponse for Handler { #[cfg(all(test, docker_test))] mod tests { - use std::sync::Arc; + use std::{io::Write, sync::Arc}; use crate::{ proxy::{ @@ -305,28 +305,82 @@ mod tests { tests::initialize, }; - use super::super::super::utils::test_utils::docker_utils::config_helper::test_config_base_dir; - const USER: &str = "user"; const PASSWORD: &str = "password"; + const SOCKS5_NOAUTH_SERVER_CONFIG: &str = r#"{ + "log": { + "loglevel": "debug" + }, + "inbounds": [ + { + "port": 10002, + "listen": "0.0.0.0", + "protocol": "socks", + "settings": { + "auth": "noauth", + "udp": true, + "ip": "0.0.0.0" + } + } + ], + "outbounds": [ + { + "protocol": "freedom" + } + ] +}"#; + + const SOCKS5_AUTH_SERVER_CONFIG: &str = r#"{ + "log": { + "loglevel": "debug" + }, + "inbounds": [ + { + "port": 10002, + "listen": "0.0.0.0", + "protocol": "socks", + "settings": { + "auth": "password", + "accounts": [ + { + "user": "user", + "pass": "password" + } + ], + "udp": true, + "ip": "0.0.0.0" + } + } + ], + "outbounds": [ + { + "protocol": "freedom" + } + ] +}"#; + async fn get_socks5_runner( auth: bool, host_port: u16, ) -> anyhow::Result { - let test_config_dir = test_config_base_dir(); - let conf = if auth { - test_config_dir.join("socks5-auth.json") + let config = if auth { + SOCKS5_AUTH_SERVER_CONFIG } else { - test_config_dir.join("socks5-noauth.json") + SOCKS5_NOAUTH_SERVER_CONFIG }; - DockerTestRunnerBuilder::new() + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(config.as_bytes())?; + + let result = DockerTestRunnerBuilder::new() .image(IMAGE_SOCKS5) - .mounts(&[(conf.to_str().unwrap(), "/etc/v2ray/config.json")]) + .mounts(&[(tmp.path().to_str().unwrap(), "/etc/v2ray/config.json")]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } fn server_addr(runner: &DockerTestRunner) -> String { diff --git a/clash-lib/src/proxy/trojan/mod.rs b/clash-lib/src/proxy/trojan/mod.rs index 9adacca4d..e496721b7 100644 --- a/clash-lib/src/proxy/trojan/mod.rs +++ b/clash-lib/src/proxy/trojan/mod.rs @@ -241,7 +241,7 @@ impl PlainProxyAPIResponse for Handler { #[cfg(all(test, docker_test))] mod tests { - use std::collections::HashMap; + use std::{collections::HashMap, io::Write}; use super::*; use crate::{ @@ -260,22 +260,88 @@ mod tests { tests::initialize, }; + const TROJAN_WS_SERVER_CONFIG: &str = r#"{ + "run_type": "server", + "local_addr": "0.0.0.0", + "local_port": 10002, + "disable_http_check": true, + "password": [ + "example" + ], + "websocket": { + "enabled": true, + "path": "/", + "host": "example.org" + }, + "ssl": { + "verify": true, + "cert": "/fullchain.pem", + "key": "/privkey.pem", + "sni": "example.org" + } +}"#; + + const TROJAN_GRPC_SERVER_CONFIG: &str = r#"{ + "inbounds": [ + { + "port": 10002, + "listen": "0.0.0.0", + "protocol": "trojan", + "settings": { + "clients": [ + { + "password": "example", + "email": "grpc@example.com" + } + ] + }, + "streamSettings": { + "network": "grpc", + "security": "tls", + "tlsSettings": { + "certificates": [ + { + "certificateFile": "/etc/ssl/v2ray/fullchain.pem", + "keyFile": "/etc/ssl/v2ray/privkey.pem" + } + ] + }, + "grpcSettings": { + "serviceName": "example" + } + } + } + ], + "outbounds": [ + { + "protocol": "freedom" + } + ], + "log": { + "loglevel": "debug" + } +}"#; + async fn get_ws_runner(host_port: u16) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let trojan_conf = test_config_dir.join("trojan-ws.json"); - let trojan_cert = test_config_dir.join("example.org.pem"); - let trojan_key = test_config_dir.join("example.org-key.pem"); + let trojan_cert = test_config_dir.join("certs/example.org.pem"); + let trojan_key = test_config_dir.join("certs/example.org-key.pem"); + + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(TROJAN_WS_SERVER_CONFIG.as_bytes())?; - DockerTestRunnerBuilder::new() + let result = DockerTestRunnerBuilder::new() .image(IMAGE_TROJAN_GO) .mounts(&[ - (trojan_conf.to_str().unwrap(), "/etc/trojan-go/config.json"), + (tmp.path().to_str().unwrap(), "/etc/trojan-go/config.json"), (trojan_cert.to_str().unwrap(), "/fullchain.pem"), (trojan_key.to_str().unwrap(), "/privkey.pem"), ]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } #[tokio::test] @@ -319,20 +385,24 @@ mod tests { async fn get_grpc_runner(host_port: u16) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let conf = test_config_dir.join("trojan-grpc.json"); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); + + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(TROJAN_GRPC_SERVER_CONFIG.as_bytes())?; - DockerTestRunnerBuilder::new() + let result = DockerTestRunnerBuilder::new() .image(IMAGE_XRAY) .mounts(&[ - (conf.to_str().unwrap(), "/etc/xray/config.json"), + (tmp.path().to_str().unwrap(), "/etc/xray/config.json"), (cert.to_str().unwrap(), "/etc/ssl/v2ray/fullchain.pem"), (key.to_str().unwrap(), "/etc/ssl/v2ray/privkey.pem"), ]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } #[tokio::test] diff --git a/clash-lib/src/proxy/tuic/mod.rs b/clash-lib/src/proxy/tuic/mod.rs index 4b3261603..17b9cbb37 100644 --- a/clash-lib/src/proxy/tuic/mod.rs +++ b/clash-lib/src/proxy/tuic/mod.rs @@ -411,6 +411,7 @@ impl TuicDatagramOutbound { #[cfg(all(test, docker_test))] mod tests { + use std::io::Write; use super::super::utils::test_utils::{ consts::*, docker_runner::DockerTestRunner, @@ -429,23 +430,53 @@ mod tests { }; use super::*; + + const TUIC_SERVER_CONFIG: &str = r#"server = "0.0.0.0:10002" + +data_dir = "" + +zero_rtt_handshake = false +dual_stack = false + +acl = ''' +direct 0.0.0.0/0 +direct ::/0 +''' + +[users] +00000000-0000-0000-0000-000000000001 = "passwd" + +[tls] +certificate = "/opt/tuic/fullchain.pem" +private_key = "/opt/tuic/privkey.pem" +alpn = ["h3"] + +[outbound.default] +type = "direct" +ip_mode = "auto" +"#; + async fn get_tuic_runner(host_port: u16) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let conf = test_config_dir.join("tuic.toml"); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); - DockerTestRunnerBuilder::new() + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(TUIC_SERVER_CONFIG.as_bytes())?; + + let result = DockerTestRunnerBuilder::new() .image(IMAGE_TUIC) .mounts(&[ - (conf.to_str().unwrap(), "/etc/tuic/config.json"), + (tmp.path().to_str().unwrap(), "/etc/tuic/config.json"), (cert.to_str().unwrap(), "/opt/tuic/fullchain.pem"), (key.to_str().unwrap(), "/opt/tuic/privkey.pem"), ]) .env(&["TUIC_FORCE_TOML=1"]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } fn gen_options( diff --git a/clash-lib/src/proxy/vless/mod.rs b/clash-lib/src/proxy/vless/mod.rs index 0dd1ed667..94969a868 100644 --- a/clash-lib/src/proxy/vless/mod.rs +++ b/clash-lib/src/proxy/vless/mod.rs @@ -234,7 +234,7 @@ impl PlainProxyAPIResponse for Handler { #[cfg(all(test, docker_test))] mod tests { - use std::collections::HashMap; + use std::{collections::HashMap, io::Write}; use super::*; use crate::{ @@ -255,6 +255,81 @@ mod tests { tests::initialize, }; + const VLESS_WS_TLS_SERVER_CONFIG: &str = r#"{ + "log": { + "loglevel": "debug" + }, + "inbounds": [ + { + "port": 8443, + "protocol": "vless", + "settings": { + "clients": [ + { + "id": "b831381d-6324-4d53-ad4f-8cda48b30811", + "level": 0, + "email": "love@v2fly.org" + } + ], + "decryption": "none", + "fallbacks": [ + { + "dest": 80 + }, + { + "path": "/websocket", + "dest": 1234, + "xver": 1 + } + ] + }, + "streamSettings": { + "network": "tcp", + "security": "tls", + "tlsSettings": { + "alpn": [ + "http/1.1" + ], + "certificates": [ + { + "certificateFile": "/etc/ssl/v2ray/fullchain.pem", + "keyFile": "/etc/ssl/v2ray/privkey.pem" + } + ] + } + } + }, + { + "port": 1234, + "listen": "127.0.0.1", + "protocol": "vless", + "settings": { + "clients": [ + { + "id": "b831381d-6324-4d53-ad4f-8cda48b30811", + "level": 0, + "email": "love@v2fly.org" + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "ws", + "security": "none", + "wsSettings": { + "acceptProxyProtocol": true, + "path": "/websocket" + } + } + } + ], + "outbounds": [ + { + "protocol": "freedom" + } + ] +}"#; + fn tls_client(alpn: Option>) -> Option> { Some(Box::new(TlsClient::new( true, @@ -266,20 +341,24 @@ mod tests { async fn get_ws_runner(host_port: u16) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let conf = test_config_dir.join("vless-ws-tls.json"); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); + + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(VLESS_WS_TLS_SERVER_CONFIG.as_bytes())?; - DockerTestRunnerBuilder::new() + let result = DockerTestRunnerBuilder::new() .image(IMAGE_VLESS) .host_port(host_port, 8443) .mounts(&[ - (conf.to_str().unwrap(), "/etc/v2ray/config.json"), + (tmp.path().to_str().unwrap(), "/etc/v2ray/config.json"), (cert.to_str().unwrap(), "/etc/ssl/v2ray/fullchain.pem"), (key.to_str().unwrap(), "/etc/ssl/v2ray/privkey.pem"), ]) .build() - .await + .await; + drop(tmp); + result } #[tokio::test] diff --git a/clash-lib/src/proxy/vmess/mod.rs b/clash-lib/src/proxy/vmess/mod.rs index eb2d928d3..24bf3004b 100644 --- a/clash-lib/src/proxy/vmess/mod.rs +++ b/clash-lib/src/proxy/vmess/mod.rs @@ -234,7 +234,7 @@ impl PlainProxyAPIResponse for Handler { #[cfg(all(test, docker_test))] mod tests { - use std::collections::HashMap; + use std::{collections::HashMap, io::Write}; use super::*; use crate::{ @@ -253,6 +253,123 @@ mod tests { tests::initialize, }; + const VMESS_WS_SERVER_CONFIG: &str = r#"{ + "inbounds": [ + { + "port": 10002, + "listen": "0.0.0.0", + "protocol": "vmess", + "settings": { + "clients": [ + { + "id": "b831381d-6324-4d53-ad4f-8cda48b30811" + } + ] + }, + "streamSettings": { + "network": "ws", + "security": "tls", + "tlsSettings": { + "certificates": [ + { + "certificateFile": "/etc/ssl/v2ray/fullchain.pem", + "keyFile": "/etc/ssl/v2ray/privkey.pem" + } + ] + } + } + } + ], + "outbounds": [ + { + "protocol": "freedom" + } + ] +}"#; + + const VMESS_GRPC_SERVER_CONFIG: &str = r#"{ + "inbounds": [ + { + "port": 10002, + "listen": "0.0.0.0", + "protocol": "vmess", + "settings": { + "clients": [ + { + "id": "b831381d-6324-4d53-ad4f-8cda48b30811" + } + ] + }, + "streamSettings": { + "network": "grpc", + "security": "tls", + "tlsSettings": { + "certificates": [ + { + "certificateFile": "/etc/ssl/v2ray/fullchain.pem", + "keyFile": "/etc/ssl/v2ray/privkey.pem" + } + ] + }, + "grpcSettings": { + "serviceName": "example!" + } + } + } + ], + "outbounds": [ + { + "protocol": "freedom" + } + ], + "log": { + "loglevel": "debug" + } +}"#; + + const VMESS_HTTP2_SERVER_CONFIG: &str = r#"{ + "inbounds": [ + { + "port": 10002, + "listen": "0.0.0.0", + "protocol": "vmess", + "settings": { + "clients": [ + { + "id": "b831381d-6324-4d53-ad4f-8cda48b30811" + } + ] + }, + "streamSettings": { + "network": "http", + "security": "tls", + "tlsSettings": { + "certificates": [ + { + "certificateFile": "/etc/ssl/v2ray/fullchain.pem", + "keyFile": "/etc/ssl/v2ray/privkey.pem" + } + ] + }, + "httpSettings": { + "host": [ + "example.org" + ], + "path": "/test" + } + } + } + ], + "outbounds": [ + { + "protocol": "freedom" + } + ], + "log": { + "loglevel": "debug" + } +}"#; + fn tls_client(alpn: Option>) -> Option> { Some(Box::new(TlsClient::new( true, @@ -264,20 +381,24 @@ mod tests { async fn get_ws_runner(host_port: u16) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let conf = test_config_dir.join("vmess-ws.json"); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); + + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(VMESS_WS_SERVER_CONFIG.as_bytes())?; - DockerTestRunnerBuilder::new() + let result = DockerTestRunnerBuilder::new() .image(IMAGE_VMESS) .mounts(&[ - (conf.to_str().unwrap(), "/etc/v2ray/config.json"), + (tmp.path().to_str().unwrap(), "/etc/v2ray/config.json"), (cert.to_str().unwrap(), "/etc/ssl/v2ray/fullchain.pem"), (key.to_str().unwrap(), "/etc/ssl/v2ray/privkey.pem"), ]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } #[tokio::test] @@ -319,20 +440,24 @@ mod tests { async fn get_grpc_runner(host_port: u16) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let conf = test_config_dir.join("vmess-grpc.json"); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); + + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(VMESS_GRPC_SERVER_CONFIG.as_bytes())?; - DockerTestRunnerBuilder::new() + let result = DockerTestRunnerBuilder::new() .image(IMAGE_VMESS) .mounts(&[ - (conf.to_str().unwrap(), "/etc/v2ray/config.json"), + (tmp.path().to_str().unwrap(), "/etc/v2ray/config.json"), (cert.to_str().unwrap(), "/etc/ssl/v2ray/fullchain.pem"), (key.to_str().unwrap(), "/etc/ssl/v2ray/privkey.pem"), ]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } #[tokio::test] @@ -362,20 +487,24 @@ mod tests { async fn get_h2_runner(host_port: u16) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let conf = test_config_dir.join("vmess-http2.json"); - let cert = test_config_dir.join("example.org.pem"); - let key = test_config_dir.join("example.org-key.pem"); + let cert = test_config_dir.join("certs/example.org.pem"); + let key = test_config_dir.join("certs/example.org-key.pem"); - DockerTestRunnerBuilder::new() + let mut tmp = tempfile::NamedTempFile::new()?; + tmp.write_all(VMESS_HTTP2_SERVER_CONFIG.as_bytes())?; + + let result = DockerTestRunnerBuilder::new() .image(IMAGE_VMESS) .mounts(&[ - (conf.to_str().unwrap(), "/etc/v2ray/config.json"), + (tmp.path().to_str().unwrap(), "/etc/v2ray/config.json"), (cert.to_str().unwrap(), "/etc/ssl/v2ray/fullchain.pem"), (key.to_str().unwrap(), "/etc/ssl/v2ray/privkey.pem"), ]) .host_port(host_port, 10002) .build() - .await + .await; + drop(tmp); + result } #[tokio::test] diff --git a/clash-lib/src/proxy/wg/mod.rs b/clash-lib/src/proxy/wg/mod.rs index 536340602..115a2e576 100644 --- a/clash-lib/src/proxy/wg/mod.rs +++ b/clash-lib/src/proxy/wg/mod.rs @@ -351,8 +351,8 @@ mod tests { // the sysctl of `net.ipv4.conf.all.src_valid_mark` will fail async fn get_runner(host_port: u16) -> anyhow::Result { let test_config_dir = test_config_base_dir(); - let wg_config = test_config_dir.join("wg_config"); - // the following configs is in accordance with the config in `wg_config` + let wg_config = test_config_dir.join("wg"); + // the following configs is in accordance with the config in `wg` // dir DockerTestRunnerBuilder::new() .image(IMAGE_WG) diff --git a/clash-lib/tests/data/config/client/rules.yaml b/clash-lib/tests/data/config/client/rules.yaml index b6ee480d2..2f089f93b 100644 --- a/clash-lib/tests/data/config/client/rules.yaml +++ b/clash-lib/tests/data/config/client/rules.yaml @@ -14,17 +14,17 @@ dns: tcp: 127.0.0.1:53553 dot: addr: 127.0.0.1:53554 - ca-cert: ../../../../../clash-bin/tests/data/config/dns.crt - ca-key: ../../../../../clash-bin/tests/data/config/dns.key + ca-cert: ../../../../../clash-bin/tests/data/config/certs/dns.crt + ca-key: ../../../../../clash-bin/tests/data/config/certs/dns.key doh: addr: 127.0.0.1:53555 - ca-cert: ../../../../../clash-bin/tests/data/config/dns.crt - ca-key: ../../../../../clash-bin/tests/data/config/dns.key + ca-cert: ../../../../../clash-bin/tests/data/config/certs/dns.crt + ca-key: ../../../../../clash-bin/tests/data/config/certs/dns.key hostname: dns.example.com doh3: addr: 127.0.0.1:53555 - ca-cert: ../../../../../clash-bin/tests/data/config/dns.crt - ca-key: ../../../../../clash-bin/tests/data/config/dns.key + ca-cert: ../../../../../clash-bin/tests/data/config/certs/dns.crt + ca-key: ../../../../../clash-bin/tests/data/config/certs/dns.key hostname: dns.example.com # ipv6: false # when the false, response to AAAA questions will be empty