From e1ff8a83557126f036378ab7c585b66f27689584 Mon Sep 17 00:00:00 2001 From: Joas A Santos <34966120+CyberSecurityUP@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:52:07 -0300 Subject: [PATCH] Add files via upload --- docker/Dockerfile.kali | 123 + docker/Dockerfile.sandbox | 98 + docker/Dockerfile.tools | 2 + docker/docker-compose.kali.yml | 38 + docker/docker-compose.sandbox.yml | 51 + frontend/dist/assets/index-CjxVs3nK.css | 1 + frontend/dist/assets/index-DScaoRL2.js | 641 ++++ frontend/dist/assets/index-DScaoRL2.js.map | 1 + frontend/dist/favicon.svg | 5 + frontend/dist/index.html | 14 + frontend/package-lock.json | 3467 +++++++++++++++++++ frontend/src/App.tsx | 10 + frontend/src/components/layout/Sidebar.tsx | 12 +- frontend/src/pages/AgentStatusPage.tsx | 171 +- frontend/src/pages/AutoPentestPage.tsx | 929 +++++ frontend/src/pages/HomePage.tsx | 18 +- frontend/src/pages/SandboxDashboardPage.tsx | 474 +++ frontend/src/pages/ScanDetailsPage.tsx | 603 +++- frontend/src/pages/SchedulerPage.tsx | 734 ++++ frontend/src/pages/SettingsPage.tsx | 119 +- frontend/src/pages/TerminalAgentPage.tsx | 1071 ++++++ frontend/src/pages/VulnLabPage.tsx | 995 ++++++ frontend/src/services/api.ts | 249 +- frontend/src/types/index.ts | 179 +- 24 files changed, 9927 insertions(+), 78 deletions(-) create mode 100644 docker/Dockerfile.kali create mode 100644 docker/Dockerfile.sandbox create mode 100644 docker/docker-compose.kali.yml create mode 100644 docker/docker-compose.sandbox.yml create mode 100644 frontend/dist/assets/index-CjxVs3nK.css create mode 100644 frontend/dist/assets/index-DScaoRL2.js create mode 100644 frontend/dist/assets/index-DScaoRL2.js.map create mode 100644 frontend/dist/favicon.svg create mode 100644 frontend/dist/index.html create mode 100644 frontend/package-lock.json create mode 100644 frontend/src/pages/AutoPentestPage.tsx create mode 100644 frontend/src/pages/SandboxDashboardPage.tsx create mode 100644 frontend/src/pages/SchedulerPage.tsx create mode 100644 frontend/src/pages/TerminalAgentPage.tsx create mode 100644 frontend/src/pages/VulnLabPage.tsx diff --git a/docker/Dockerfile.kali b/docker/Dockerfile.kali new file mode 100644 index 0000000..014290c --- /dev/null +++ b/docker/Dockerfile.kali @@ -0,0 +1,123 @@ +# NeuroSploit v3 - Kali Linux Security Sandbox +# Per-scan container with essential tools pre-installed + on-demand install support. +# +# Build: +# docker build -f docker/Dockerfile.kali -t neurosploit-kali:latest docker/ +# +# Rebuild (no cache): +# docker build --no-cache -f docker/Dockerfile.kali -t neurosploit-kali:latest docker/ +# +# Or via compose: +# docker compose -f docker/docker-compose.kali.yml build +# +# Design: +# - Pre-compile Go tools (nuclei, naabu, httpx, subfinder, katana, dnsx, ffuf, +# gobuster, dalfox, waybackurls, uncover) to avoid 60s+ go install per scan +# - Pre-install common apt tools (nikto, sqlmap, masscan, whatweb) for instant use +# - Include Go, Python, pip, git so on-demand tools can be compiled/installed +# - Full Kali apt repos available for on-demand apt-get install of any security tool + +# ---- Stage 1: Pre-compile Go security tools ---- +FROM golang:1.24-bookworm AS go-builder + +RUN apt-get update && apt-get install -y --no-install-recommends \ + git build-essential libpcap-dev \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /build + +# Pre-compile ProjectDiscovery suite + common Go tools +# Split into separate RUN layers for better Docker cache (if one fails, others cached) +RUN go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest +RUN go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest +RUN go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest +RUN go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest +RUN go install -v github.com/projectdiscovery/katana/cmd/katana@latest +RUN go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest +RUN go install -v github.com/projectdiscovery/uncover/cmd/uncover@latest +RUN go install -v github.com/ffuf/ffuf/v2@latest +RUN go install -v github.com/OJ/gobuster/v3@v3.7.0 +RUN go install -v github.com/hahwul/dalfox/v2@latest +RUN go install -v github.com/tomnomnom/waybackurls@latest + +# ---- Stage 2: Kali Linux runtime ---- +FROM kalilinux/kali-rolling + +LABEL maintainer="NeuroSploit Team" +LABEL description="NeuroSploit Kali Sandbox - Per-scan isolated tool execution" +LABEL neurosploit.version="3.0" +LABEL neurosploit.type="kali-sandbox" + +ENV DEBIAN_FRONTEND=noninteractive + +# Layer 1: Core system + build tools (rarely changes, cached) +RUN apt-get update && apt-get install -y --no-install-recommends \ + bash \ + curl \ + wget \ + git \ + jq \ + ca-certificates \ + openssl \ + dnsutils \ + whois \ + netcat-openbsd \ + libpcap-dev \ + python3 \ + python3-pip \ + golang-go \ + build-essential \ + && rm -rf /var/lib/apt/lists/* + +# Layer 2: Pre-install common security tools from Kali repos (saves ~30s on-demand each) +RUN apt-get update && apt-get install -y --no-install-recommends \ + nmap \ + nikto \ + sqlmap \ + masscan \ + whatweb \ + && rm -rf /var/lib/apt/lists/* + +# Copy ALL pre-compiled Go binaries from builder +COPY --from=go-builder /go/bin/nuclei /usr/local/bin/ +COPY --from=go-builder /go/bin/naabu /usr/local/bin/ +COPY --from=go-builder /go/bin/httpx /usr/local/bin/ +COPY --from=go-builder /go/bin/subfinder /usr/local/bin/ +COPY --from=go-builder /go/bin/katana /usr/local/bin/ +COPY --from=go-builder /go/bin/dnsx /usr/local/bin/ +COPY --from=go-builder /go/bin/uncover /usr/local/bin/ +COPY --from=go-builder /go/bin/ffuf /usr/local/bin/ +COPY --from=go-builder /go/bin/gobuster /usr/local/bin/ +COPY --from=go-builder /go/bin/dalfox /usr/local/bin/ +COPY --from=go-builder /go/bin/waybackurls /usr/local/bin/ + +# Go environment for on-demand tool compilation +ENV GOPATH=/root/go +ENV PATH="${PATH}:/root/go/bin" + +# Create directories +RUN mkdir -p /opt/wordlists /opt/output /opt/templates /opt/nuclei-templates + +# Download commonly used wordlists (|| true so build doesn't fail on network issues) +RUN wget -q https://raw.githubusercontent.com/danielmiessler/SecLists/master/Discovery/Web-Content/common.txt \ + -O /opt/wordlists/common.txt 2>/dev/null || true && \ + wget -q https://raw.githubusercontent.com/danielmiessler/SecLists/master/Discovery/Web-Content/directory-list-2.3-medium.txt \ + -O /opt/wordlists/directory-list-medium.txt 2>/dev/null || true && \ + wget -q https://raw.githubusercontent.com/danielmiessler/SecLists/master/Discovery/DNS/subdomains-top1million-5000.txt \ + -O /opt/wordlists/subdomains-5000.txt 2>/dev/null || true && \ + wget -q https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000.txt \ + -O /opt/wordlists/passwords-top1000.txt 2>/dev/null || true + +# Update Nuclei templates +RUN nuclei -update-templates -silent 2>/dev/null || true + +# Health check script +RUN printf '#!/bin/bash\nnuclei -version > /dev/null 2>&1 && naabu -version > /dev/null 2>&1 && echo "OK"\n' \ + > /opt/healthcheck.sh && chmod +x /opt/healthcheck.sh + +HEALTHCHECK --interval=60s --timeout=10s --retries=3 \ + CMD /opt/healthcheck.sh + +WORKDIR /opt/output + +ENTRYPOINT ["/bin/bash", "-c"] diff --git a/docker/Dockerfile.sandbox b/docker/Dockerfile.sandbox new file mode 100644 index 0000000..fcd90b4 --- /dev/null +++ b/docker/Dockerfile.sandbox @@ -0,0 +1,98 @@ +# NeuroSploit v3 - Security Sandbox Container +# Kali-based container with real penetration testing tools +# Provides Nuclei, Naabu, and other ProjectDiscovery tools via isolated execution + +FROM golang:1.24-bookworm AS go-builder + +RUN apt-get update && apt-get install -y --no-install-recommends git build-essential && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /build + +# Install ProjectDiscovery suite + other Go security tools +RUN go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest && \ + go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest && \ + go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest && \ + go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest && \ + go install -v github.com/projectdiscovery/katana/cmd/katana@latest && \ + go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest && \ + go install -v github.com/projectdiscovery/uncover/cmd/uncover@latest && \ + go install -v github.com/ffuf/ffuf/v2@latest && \ + go install -v github.com/OJ/gobuster/v3@v3.7.0 && \ + go install -v github.com/hahwul/dalfox/v2@latest && \ + go install -v github.com/tomnomnom/waybackurls@latest + +# Final runtime image - Debian-based for compatibility +FROM debian:bookworm-slim + +LABEL maintainer="NeuroSploit Team" +LABEL description="NeuroSploit Security Sandbox - Isolated tool execution environment" + +# Install runtime dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + bash \ + curl \ + wget \ + nmap \ + python3 \ + python3-pip \ + git \ + jq \ + dnsutils \ + openssl \ + libpcap-dev \ + ca-certificates \ + whois \ + netcat-openbsd \ + nikto \ + masscan \ + && rm -rf /var/lib/apt/lists/* + +# Install Python security tools +RUN pip3 install --no-cache-dir --break-system-packages \ + sqlmap \ + wfuzz \ + dirsearch \ + arjun \ + wafw00f \ + 2>/dev/null || pip3 install --no-cache-dir --break-system-packages sqlmap + +# Copy Go binaries from builder +COPY --from=go-builder /go/bin/nuclei /usr/local/bin/ +COPY --from=go-builder /go/bin/naabu /usr/local/bin/ +COPY --from=go-builder /go/bin/httpx /usr/local/bin/ +COPY --from=go-builder /go/bin/subfinder /usr/local/bin/ +COPY --from=go-builder /go/bin/katana /usr/local/bin/ +COPY --from=go-builder /go/bin/dnsx /usr/local/bin/ +COPY --from=go-builder /go/bin/uncover /usr/local/bin/ +COPY --from=go-builder /go/bin/ffuf /usr/local/bin/ +COPY --from=go-builder /go/bin/gobuster /usr/local/bin/ +COPY --from=go-builder /go/bin/dalfox /usr/local/bin/ +COPY --from=go-builder /go/bin/waybackurls /usr/local/bin/ + +# Create directories +RUN mkdir -p /opt/wordlists /opt/output /opt/templates /opt/nuclei-templates + +# Download wordlists +RUN wget -q https://raw.githubusercontent.com/danielmiessler/SecLists/master/Discovery/Web-Content/common.txt \ + -O /opt/wordlists/common.txt && \ + wget -q https://raw.githubusercontent.com/danielmiessler/SecLists/master/Discovery/Web-Content/directory-list-2.3-medium.txt \ + -O /opt/wordlists/directory-list-medium.txt && \ + wget -q https://raw.githubusercontent.com/danielmiessler/SecLists/master/Discovery/DNS/subdomains-top1million-5000.txt \ + -O /opt/wordlists/subdomains-5000.txt && \ + wget -q https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000.txt \ + -O /opt/wordlists/passwords-top1000.txt + +# Update Nuclei templates (8000+ vulnerability checks) +RUN nuclei -update-templates -silent 2>/dev/null || true + +# Health check script +RUN echo '#!/bin/bash\nnuclei -version > /dev/null 2>&1 && naabu -version > /dev/null 2>&1 && echo "OK"' > /opt/healthcheck.sh && \ + chmod +x /opt/healthcheck.sh + +HEALTHCHECK --interval=30s --timeout=10s --retries=3 \ + CMD /opt/healthcheck.sh + +WORKDIR /opt/output + +ENTRYPOINT ["/bin/bash", "-c"] diff --git a/docker/Dockerfile.tools b/docker/Dockerfile.tools index 7108622..b9c3769 100644 --- a/docker/Dockerfile.tools +++ b/docker/Dockerfile.tools @@ -12,8 +12,10 @@ RUN go install -v github.com/ffuf/ffuf/v2@latest && \ go install -v github.com/OJ/gobuster/v3@latest && \ go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest && \ go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest && \ + go install -v github.com/projectdiscovery/naabu/v2/cmd/naabu@latest && \ go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest && \ go install -v github.com/projectdiscovery/katana/cmd/katana@latest && \ + go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest && \ go install -v github.com/hahwul/dalfox/v2@latest && \ go install -v github.com/tomnomnom/waybackurls@latest diff --git a/docker/docker-compose.kali.yml b/docker/docker-compose.kali.yml new file mode 100644 index 0000000..594bcbb --- /dev/null +++ b/docker/docker-compose.kali.yml @@ -0,0 +1,38 @@ +# NeuroSploit v3 - Kali Sandbox Build & Management +# +# Build image: +# docker compose -f docker/docker-compose.kali.yml build +# +# Build (no cache): +# docker compose -f docker/docker-compose.kali.yml build --no-cache +# +# Test container manually: +# docker compose -f docker/docker-compose.kali.yml run --rm kali-sandbox "nuclei -version" +# +# Note: In production, containers are managed by ContainerPool (core/container_pool.py). +# This compose file is for building the image and manual testing only. + +services: + kali-sandbox: + build: + context: . + dockerfile: Dockerfile.kali + image: neurosploit-kali:latest + deploy: + resources: + limits: + memory: 2G + cpus: '2.0' + reservations: + memory: 512M + cpus: '0.5' + security_opt: + - no-new-privileges:true + cap_drop: + - ALL + cap_add: + - NET_RAW + - NET_ADMIN + labels: + neurosploit.type: "kali-sandbox" + neurosploit.version: "3.0" diff --git a/docker/docker-compose.sandbox.yml b/docker/docker-compose.sandbox.yml new file mode 100644 index 0000000..ac0db4c --- /dev/null +++ b/docker/docker-compose.sandbox.yml @@ -0,0 +1,51 @@ +# NeuroSploit v3 - Security Sandbox +# Isolated container for running real penetration testing tools +# +# Usage: +# docker compose -f docker-compose.sandbox.yml up -d +# docker compose -f docker-compose.sandbox.yml exec sandbox nuclei -u https://target.com +# docker compose -f docker-compose.sandbox.yml down + +services: + sandbox: + build: + context: . + dockerfile: Dockerfile.sandbox + image: neurosploit-sandbox:latest + container_name: neurosploit-sandbox + command: ["sleep infinity"] + restart: unless-stopped + networks: + - sandbox-net + volumes: + - sandbox-output:/opt/output + - sandbox-templates:/opt/nuclei-templates + deploy: + resources: + limits: + memory: 2G + cpus: '2.0' + reservations: + memory: 512M + cpus: '0.5' + security_opt: + - no-new-privileges:true + cap_drop: + - ALL + cap_add: + - NET_RAW # Required for naabu/nmap raw sockets + - NET_ADMIN # Required for packet capture + healthcheck: + test: ["CMD", "/opt/healthcheck.sh"] + interval: 30s + timeout: 10s + retries: 3 + +networks: + sandbox-net: + driver: bridge + internal: false + +volumes: + sandbox-output: + sandbox-templates: diff --git a/frontend/dist/assets/index-CjxVs3nK.css b/frontend/dist/assets/index-CjxVs3nK.css new file mode 100644 index 0000000..87f9e31 --- /dev/null +++ b/frontend/dist/assets/index-CjxVs3nK.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-top-8{top:-2rem}.bottom-2{bottom:.5rem}.bottom-4{bottom:1rem}.left-0{left:0}.left-1\/2{left:50%}.left-3{left:.75rem}.left-\[7px\]{left:7px}.right-0{right:0}.right-1\/2{right:50%}.top-1{top:.25rem}.top-1\/2{top:50%}.top-10{top:2.5rem}.top-2{top:.5rem}.top-4{top:1rem}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-span-2{grid-column:span 2 / span 2}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.-ml-1{margin-left:-.25rem}.-mt-0\.5{margin-top:-.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-14{margin-left:3.5rem}.ml-2{margin-left:.5rem}.ml-7{margin-left:1.75rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-\[-20px\]{margin-top:-20px}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-4{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[15px\]{height:15px}.h-\[calc\(100vh-200px\)\]{height:calc(100vh - 200px)}.h-\[calc\(100vh-220px\)\]{height:calc(100vh - 220px)}.h-\[calc\(100vh-80px\)\]{height:calc(100vh - 80px)}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-60{max-height:15rem}.max-h-72{max-height:18rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[400px\]{max-height:400px}.max-h-\[500px\]{max-height:500px}.max-h-\[600px\]{max-height:600px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100vh-320px\)\]{max-height:calc(100vh - 320px)}.min-h-screen{min-height:100vh}.w-0\.5{width:.125rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[15px\]{width:15px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-\[140px\]{max-width:140px}.max-w-\[70\%\]{max-width:70%}.max-w-\[80\%\]{max-width:80%}.max-w-\[85\%\]{max-width:85%}.max-w-\[90\%\]{max-width:90%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0\.5{--tw-translate-x: .125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-dark-700>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(26 26 46 / var(--tw-divide-opacity, 1))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/40{border-color:#3b82f666}.border-dark-500{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.border-dark-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-dark-700{--tw-border-opacity: 1;border-color:rgb(26 26 46 / var(--tw-border-opacity, 1))}.border-dark-700\/50{border-color:#1a1a2e80}.border-dark-800{--tw-border-opacity: 1;border-color:rgb(22 33 62 / var(--tw-border-opacity, 1))}.border-dark-900\/50{border-color:#0f346080}.border-emerald-500\/30{border-color:#10b9814d}.border-gray-500\/30{border-color:#6b72804d}.border-gray-500\/40{border-color:#6b728066}.border-green-500\/20{border-color:#22c55e33}.border-green-500\/30{border-color:#22c55e4d}.border-green-500\/40{border-color:#22c55e66}.border-green-500\/50{border-color:#22c55e80}.border-orange-500\/20{border-color:#f9731633}.border-orange-500\/30{border-color:#f973164d}.border-orange-500\/40{border-color:#f9731666}.border-primary-500{--tw-border-opacity: 1;border-color:rgb(233 69 96 / var(--tw-border-opacity, 1))}.border-primary-500\/30{border-color:#e945604d}.border-primary-500\/50{border-color:#e9456080}.border-purple-500{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.border-purple-500\/20{border-color:#a855f733}.border-purple-500\/30{border-color:#a855f74d}.border-purple-500\/40{border-color:#a855f766}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-red-500\/40{border-color:#ef444466}.border-red-500\/50{border-color:#ef444480}.border-transparent{border-color:transparent}.border-yellow-500\/20{border-color:#eab30833}.border-yellow-500\/30{border-color:#eab3084d}.border-yellow-500\/40{border-color:#eab30866}.border-yellow-500\/50{border-color:#eab30880}.border-t-transparent{border-top-color:transparent}.bg-amber-500\/20{background-color:#f59e0b33}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-dark-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-dark-600{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.bg-dark-700{--tw-bg-opacity: 1;background-color:rgb(26 26 46 / var(--tw-bg-opacity, 1))}.bg-dark-700\/30{background-color:#1a1a2e4d}.bg-dark-700\/50{background-color:#1a1a2e80}.bg-dark-800{--tw-bg-opacity: 1;background-color:rgb(22 33 62 / var(--tw-bg-opacity, 1))}.bg-dark-800\/50{background-color:#16213e80}.bg-dark-800\/80{background-color:#16213ecc}.bg-dark-900{--tw-bg-opacity: 1;background-color:rgb(15 52 96 / var(--tw-bg-opacity, 1))}.bg-dark-900\/30{background-color:#0f34604d}.bg-dark-900\/50{background-color:#0f346080}.bg-dark-900\/80{background-color:#0f3460cc}.bg-dark-950{--tw-bg-opacity: 1;background-color:rgb(10 10 21 / var(--tw-bg-opacity, 1))}.bg-dark-950\/90{background-color:#0a0a15e6}.bg-emerald-500\/10{background-color:#10b9811a}.bg-emerald-500\/15{background-color:#10b98126}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-500\/20{background-color:#6b728033}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/15{background-color:#22c55e26}.bg-green-500\/20{background-color:#22c55e33}.bg-green-500\/5{background-color:#22c55e0d}.bg-green-500\/50{background-color:#22c55e80}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-500\/10{background-color:#f973161a}.bg-orange-500\/20{background-color:#f9731633}.bg-orange-500\/30{background-color:#f973164d}.bg-primary-500{--tw-bg-opacity: 1;background-color:rgb(233 69 96 / var(--tw-bg-opacity, 1))}.bg-primary-500\/10{background-color:#e945601a}.bg-primary-500\/20{background-color:#e9456033}.bg-primary-500\/5{background-color:#e945600d}.bg-purple-400{--tw-bg-opacity: 1;background-color:rgb(192 132 252 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-500\/20{background-color:#a855f733}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/15{background-color:#ef444426}.bg-red-500\/20{background-color:#ef444433}.bg-red-500\/60{background-color:#ef444499}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-600\/10{background-color:#dc26261a}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/15{background-color:#eab30826}.bg-yellow-500\/20{background-color:#eab30833}.bg-yellow-500\/30{background-color:#eab3084d}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-primary-500\/20{--tw-gradient-from: rgb(233 69 96 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(233 69 96 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary-600{--tw-gradient-from: #dc2626 var(--tw-gradient-from-position);--tw-gradient-to: rgb(220 38 38 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-green-500\/20{--tw-gradient-to: rgb(34 197 94 / .2) var(--tw-gradient-to-position)}.to-primary-500{--tw-gradient-to: #e94560 var(--tw-gradient-to-position)}.to-purple-500\/20{--tw-gradient-to: rgb(168 85 247 / .2) var(--tw-gradient-to-position)}.\!p-3{padding:.75rem!important}.\!p-4{padding:1rem!important}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-12{padding:3rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-6{padding-bottom:1.5rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pr-1{padding-right:.25rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wider{letter-spacing:.05em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-dark-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-dark-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-dark-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-dark-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-dark-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-dark-700{--tw-text-opacity: 1;color:rgb(26 26 46 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-400\/70{color:#4ade80b3}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-500\/60{color:#22c55e99}.text-orange-300{--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.text-orange-300\/80{color:#fdba74cc}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-400\/60{color:#fb923c99}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-primary-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-primary-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-primary-500{--tw-text-opacity: 1;color:rgb(233 69 96 / var(--tw-text-opacity, 1))}.text-purple-200{--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-300\/80{color:#fca5a5cc}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-300\/80{color:#fde047cc}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.placeholder-dark-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-dark-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(148 163 184 / var(--tw-placeholder-opacity, 1))}.placeholder-dark-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.placeholder-dark-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(100 116 139 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary-500\/10{--tw-shadow-color: rgb(233 69 96 / .1);--tw-shadow: var(--tw-shadow-colored)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary-500\/30{--tw-ring-color: rgb(233 69 96 / .3)}.ring-yellow-500\/30{--tw-ring-color: rgb(234 179 8 / .3)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}:root{--bg-primary: #1a1a2e;--bg-secondary: #16213e;--bg-card: #0f3460;--text-primary: #eee;--text-secondary: #aaa;--accent: #e94560;--border: #333}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,sans-serif;background-color:var(--bg-primary);color:var(--text-primary);min-height:100vh}*{box-sizing:border-box}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--bg-card);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--accent)}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.animate-fadeIn{animation:fadeIn .3s ease-out}.animate-pulse{animation:pulse 2s infinite}.last\:flex-none:last-child{flex:none}.last\:border-b-0:last-child{border-bottom-width:0px}.focus-within\:border-green-500\/50:focus-within{border-color:#22c55e80}.focus-within\:ring-1:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:ring-green-500\/30:focus-within{--tw-ring-color: rgb(34 197 94 / .3)}.hover\:border-blue-500\/60:hover{border-color:#3b82f699}.hover\:border-dark-500:hover{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.hover\:border-dark-600:hover{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.hover\:border-dark-700:hover{--tw-border-opacity: 1;border-color:rgb(26 26 46 / var(--tw-border-opacity, 1))}.hover\:border-green-500\/40:hover{border-color:#22c55e66}.hover\:border-green-500\/60:hover{border-color:#22c55e99}.hover\:border-orange-500\/60:hover{border-color:#f9731699}.hover\:border-primary-500:hover{--tw-border-opacity: 1;border-color:rgb(233 69 96 / var(--tw-border-opacity, 1))}.hover\:border-purple-500\/50:hover{border-color:#a855f780}.hover\:border-red-500\/60:hover{border-color:#ef444499}.hover\:bg-dark-500:hover{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-700:hover{--tw-bg-opacity: 1;background-color:rgb(26 26 46 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-700\/50:hover{background-color:#1a1a2e80}.hover\:bg-dark-800:hover{--tw-bg-opacity: 1;background-color:rgb(22 33 62 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-800\/30:hover{background-color:#16213e4d}.hover\:bg-dark-800\/50:hover{background-color:#16213e80}.hover\:bg-dark-900:hover{--tw-bg-opacity: 1;background-color:rgb(15 52 96 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-900\/50:hover{background-color:#0f346080}.hover\:bg-green-500\/10:hover{background-color:#22c55e1a}.hover\:bg-green-500\/30:hover{background-color:#22c55e4d}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-primary-500\/20:hover{background-color:#e9456033}.hover\:bg-primary-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-red-500\/30:hover{background-color:#ef44444d}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:text-dark-200:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-dark-300:hover{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.hover\:text-orange-400:hover{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.hover\:text-primary-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-primary-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-purple-300:hover{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-primary-500\/30:hover{--tw-ring-color: rgb(233 69 96 / .3)}.focus\:border-green-500:focus{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.focus\:border-primary-500:focus{--tw-border-opacity: 1;border-color:rgb(233 69 96 / var(--tw-border-opacity, 1))}.focus\:border-purple-500:focus{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-dark-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(100 116 139 / var(--tw-ring-opacity, 1))}.focus\:ring-green-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(34 197 94 / var(--tw-ring-opacity, 1))}.focus\:ring-primary-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(233 69 96 / var(--tw-ring-opacity, 1))}.focus\:ring-purple-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(168 85 247 / var(--tw-ring-opacity, 1))}.focus\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus\:ring-offset-dark-700:focus{--tw-ring-offset-color: #1a1a2e}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-dark-600:disabled{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.disabled\:text-dark-400:disabled{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:hidden{display:none}.group:hover .group-hover\:text-primary-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width: 640px){.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:col-span-1{grid-column:span 1 / span 1}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/frontend/dist/assets/index-DScaoRL2.js b/frontend/dist/assets/index-DScaoRL2.js new file mode 100644 index 0000000..c265df7 --- /dev/null +++ b/frontend/dist/assets/index-DScaoRL2.js @@ -0,0 +1,641 @@ +var H0=Object.defineProperty;var W0=(e,t,n)=>t in e?H0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Hn=(e,t,n)=>W0(e,typeof t!="symbol"?t+"":t,n);function q0(e,t){for(var n=0;nr[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const i of l.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Iu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mu={exports:{}},pl={},Du={exports:{}},fe={};/** + * @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 Br=Symbol.for("react.element"),K0=Symbol.for("react.portal"),Q0=Symbol.for("react.fragment"),J0=Symbol.for("react.strict_mode"),G0=Symbol.for("react.profiler"),X0=Symbol.for("react.provider"),Y0=Symbol.for("react.context"),Z0=Symbol.for("react.forward_ref"),ef=Symbol.for("react.suspense"),tf=Symbol.for("react.memo"),nf=Symbol.for("react.lazy"),Pc=Symbol.iterator;function sf(e){return e===null||typeof e!="object"?null:(e=Pc&&e[Pc]||e["@@iterator"],typeof e=="function"?e:null)}var zu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fu=Object.assign,Uu={};function Bs(e,t,n){this.props=e,this.context=t,this.refs=Uu,this.updater=n||zu}Bs.prototype.isReactComponent={};Bs.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")};Bs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Bu(){}Bu.prototype=Bs.prototype;function So(e,t,n){this.props=e,this.context=t,this.refs=Uu,this.updater=n||zu}var _o=So.prototype=new Bu;_o.constructor=So;Fu(_o,Bs.prototype);_o.isPureReactComponent=!0;var Lc=Array.isArray,Vu=Object.prototype.hasOwnProperty,Co={current:null},Hu={key:!0,ref:!0,__self:!0,__source:!0};function Wu(e,t,n){var r,a={},l=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(l=""+t.key),t)Vu.call(t,r)&&!Hu.hasOwnProperty(r)&&(a[r]=t[r]);var o=arguments.length-2;if(o===1)a.children=n;else if(1>>1,G=z[V];if(0>>1;Va(ke,se))Pa(X,ke)?(z[V]=X,z[P]=se,V=P):(z[V]=ke,z[he]=se,V=he);else if(Pa(X,se))z[V]=X,z[P]=se,V=P;else break e}}return Y}function a(z,Y){var se=z.sortIndex-Y.sortIndex;return se!==0?se:z.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],d=[],m=1,f=null,p=3,N=!1,v=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,u=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(z){for(var Y=n(d);Y!==null;){if(Y.callback===null)r(d);else if(Y.startTime<=z)r(d),Y.sortIndex=Y.expirationTime,t(c,Y);else break;Y=n(d)}}function _(z){if(w=!1,g(z),!v)if(n(c)!==null)v=!0,ce(L);else{var Y=n(d);Y!==null&&xe(_,Y.startTime-z)}}function L(z,Y){v=!1,w&&(w=!1,y(E),E=-1),N=!0;var se=p;try{for(g(Y),f=n(c);f!==null&&(!(f.expirationTime>Y)||z&&!A());){var V=f.callback;if(typeof V=="function"){f.callback=null,p=f.priorityLevel;var G=V(f.expirationTime<=Y);Y=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),g(Y)}else r(c);f=n(c)}if(f!==null)var ge=!0;else{var he=n(d);he!==null&&xe(_,he.startTime-Y),ge=!1}return ge}finally{f=null,p=se,N=!1}}var D=!1,R=null,E=-1,U=5,q=-1;function A(){return!(e.unstable_now()-qz||125V?(z.sortIndex=se,t(d,z),n(c)===null&&z===n(d)&&(w?(y(E),E=-1):w=!0,xe(_,se-V))):(z.sortIndex=G,t(c,z),v||N||(v=!0,ce(L))),z},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(z){var Y=p;return function(){var se=p;p=Y;try{return z.apply(this,arguments)}finally{p=se}}}})(Gu);Ju.exports=Gu;var hf=Ju.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var gf=x,vt=hf;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"),ki=Object.prototype.hasOwnProperty,yf=/^[: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]*$/,$c={},Oc={};function vf(e){return ki.call(Oc,e)?!0:ki.call($c,e)?!1:yf.test(e)?Oc[e]=!0:($c[e]=!0,!1)}function wf(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 jf(e,t,n,r){if(t===null||typeof t>"u"||wf(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 lt(e,t,n,r,a,l,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=i}var Qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qe[e]=new lt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qe[t]=new lt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qe[e]=new lt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qe[e]=new lt(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){Qe[e]=new lt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qe[e]=new lt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qe[e]=new lt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qe[e]=new lt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qe[e]=new lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var To=/[\-:]([a-z])/g;function Po(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(To,Po);Qe[t]=new lt(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(To,Po);Qe[t]=new lt(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(To,Po);Qe[t]=new lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qe[e]=new lt(e,1,!1,e.toLowerCase(),null,!1,!1)});Qe.xlinkHref=new lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qe[e]=new lt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lo(e,t,n,r){var a=Qe.hasOwnProperty(t)?Qe[t]:null;(a!==null?a.type!==0:r||!(2o||a[i]!==l[o]){var c=` +`+a[i].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=i&&0<=o);break}}}finally{Dl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ar(e):""}function kf(e){switch(e.tag){case 5:return ar(e.type);case 16:return ar("Lazy");case 13:return ar("Suspense");case 19:return ar("SuspenseList");case 0:case 2:case 15:return e=zl(e.type,!1),e;case 11:return e=zl(e.type.render,!1),e;case 1:return e=zl(e.type,!0),e;default:return""}}function _i(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 hs:return"Fragment";case xs:return"Portal";case bi:return"Profiler";case Ao:return"StrictMode";case Ni:return"Suspense";case Si:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Zu:return(e.displayName||"Context")+".Consumer";case Yu:return(e._context.displayName||"Context")+".Provider";case $o:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oo:return t=e.displayName||null,t!==null?t:_i(e.type)||"Memo";case gn:t=e._payload,e=e._init;try{return _i(e(t))}catch{}}return null}function bf(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 _i(t);case 8:return t===Ao?"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 $n(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Nf(e){var t=tp(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 a=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(i){r=""+i,l.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ra(e){e._valueTracker||(e._valueTracker=Nf(e))}function np(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ia(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 Ci(e,t){var n=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Mc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$n(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 sp(e,t){t=t.checked,t!=null&&Lo(e,"checked",t,!1)}function Ei(e,t){sp(e,t);var n=$n(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")?Ri(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ri(e,t.type,$n(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Dc(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 Ri(e,t,n){(t!=="number"||Ia(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var lr=Array.isArray;function Cs(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=aa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dr={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},Sf=["Webkit","ms","Moz","O"];Object.keys(dr).forEach(function(e){Sf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),dr[t]=dr[e]})});function ip(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||dr.hasOwnProperty(e)&&dr[e]?(""+t).trim():t+"px"}function op(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=ip(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var _f=Ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Li(e,t){if(t){if(_f[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 Ai(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 $i=null;function Io(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Oi=null,Es=null,Rs=null;function Uc(e){if(e=Wr(e)){if(typeof Oi!="function")throw Error(B(280));var t=e.stateNode;t&&(t=gl(t),Oi(e.stateNode,e.type,t))}}function cp(e){Es?Rs?Rs.push(e):Rs=[e]:Es=e}function dp(){if(Es){var e=Es,t=Rs;if(Rs=Es=null,Uc(e),t)for(e=0;e>>=0,e===0?32:31-(Mf(e)/Df|0)|0}var la=64,ia=4194304;function ir(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 Fa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,l=e.pingedLanes,i=n&268435455;if(i!==0){var o=i&~a;o!==0?r=ir(o):(l&=i,l!==0&&(r=ir(l)))}else i=n&~a,i!==0?r=ir(i):l!==0&&(r=ir(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,l=t&-t,a>=l||a===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Vr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function Bf(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=pr),Gc=" ",Xc=!1;function Tp(e,t){switch(e){case"keyup":return hx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gs=!1;function yx(e,t){switch(e){case"compositionend":return Pp(t);case"keypress":return t.which!==32?null:(Xc=!0,Gc);case"textInput":return e=t.data,e===Gc&&Xc?null:e;default:return null}}function vx(e,t){if(gs)return e==="compositionend"||!Ho&&Tp(e,t)?(e=Ep(),Na=Uo=jn=null,gs=!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=td(n)}}function Op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Op(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ip(){for(var e=window,t=Ia();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ia(e.document)}return t}function Wo(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 Ex(e){var t=Ip(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Op(n.ownerDocument.documentElement,n)){if(r!==null&&Wo(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 a=n.textContent.length,l=Math.min(r.start,a);r=r.end===void 0?l:Math.min(r.end,a),!e.extend&&l>r&&(a=r,r=l,l=a),a=nd(n,l);var i=nd(n,r);a&&i&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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,ys=null,Ui=null,fr=null,Bi=!1;function sd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bi||ys==null||ys!==Ia(r)||(r=ys,"selectionStart"in r&&Wo(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}),fr&&Cr(fr,r)||(fr=r,r=Va(Ui,"onSelect"),0js||(e.current=Qi[js],Qi[js]=null,js--)}function Ne(e,t){js++,Qi[js]=e.current,e.current=t}var On={},et=zn(On),ct=zn(!1),ss=On;function $s(e,t){var n=e.type.contextTypes;if(!n)return On;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},l;for(l in n)a[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function dt(e){return e=e.childContextTypes,e!=null}function Wa(){Ce(ct),Ce(et)}function dd(e,t,n){if(et.current!==On)throw Error(B(168));Ne(et,t),Ne(ct,n)}function Wp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(B(108,bf(e)||"Unknown",a));return Ae({},n,r)}function qa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||On,ss=et.current,Ne(et,e),Ne(ct,ct.current),!0}function ud(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Wp(e,t,ss),r.__reactInternalMemoizedMergedChildContext=e,Ce(ct),Ce(et),Ne(et,e)):Ce(ct),Ne(ct,n)}var tn=null,yl=!1,Zl=!1;function qp(e){tn===null?tn=[e]:tn.push(e)}function Fx(e){yl=!0,qp(e)}function Fn(){if(!Zl&&tn!==null){Zl=!0;var e=0,t=be;try{var n=tn;for(be=1;e>=i,a-=i,sn=1<<32-Dt(t)+a|n<E?(U=R,R=null):U=R.sibling;var q=p(y,R,g[E],_);if(q===null){R===null&&(R=U);break}e&&R&&q.alternate===null&&t(y,R),u=l(q,u,E),D===null?L=q:D.sibling=q,D=q,R=U}if(E===g.length)return n(y,R),Re&&Wn(y,E),L;if(R===null){for(;EE?(U=R,R=null):U=R.sibling;var A=p(y,R,q.value,_);if(A===null){R===null&&(R=U);break}e&&R&&A.alternate===null&&t(y,R),u=l(A,u,E),D===null?L=A:D.sibling=A,D=A,R=U}if(q.done)return n(y,R),Re&&Wn(y,E),L;if(R===null){for(;!q.done;E++,q=g.next())q=f(y,q.value,_),q!==null&&(u=l(q,u,E),D===null?L=q:D.sibling=q,D=q);return Re&&Wn(y,E),L}for(R=r(y,R);!q.done;E++,q=g.next())q=N(R,y,E,q.value,_),q!==null&&(e&&q.alternate!==null&&R.delete(q.key===null?E:q.key),u=l(q,u,E),D===null?L=q:D.sibling=q,D=q);return e&&R.forEach(function(te){return t(y,te)}),Re&&Wn(y,E),L}function k(y,u,g,_){if(typeof g=="object"&&g!==null&&g.type===hs&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case sa:e:{for(var L=g.key,D=u;D!==null;){if(D.key===L){if(L=g.type,L===hs){if(D.tag===7){n(y,D.sibling),u=a(D,g.props.children),u.return=y,y=u;break e}}else if(D.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===gn&&fd(L)===D.type){n(y,D.sibling),u=a(D,g.props),u.ref=Zs(y,D,g),u.return=y,y=u;break e}n(y,D);break}else t(y,D);D=D.sibling}g.type===hs?(u=Yn(g.props.children,y.mode,_,g.key),u.return=y,y=u):(_=La(g.type,g.key,g.props,null,y.mode,_),_.ref=Zs(y,u,g),_.return=y,y=_)}return i(y);case xs:e:{for(D=g.key;u!==null;){if(u.key===D)if(u.tag===4&&u.stateNode.containerInfo===g.containerInfo&&u.stateNode.implementation===g.implementation){n(y,u.sibling),u=a(u,g.children||[]),u.return=y,y=u;break e}else{n(y,u);break}else t(y,u);u=u.sibling}u=ii(g,y.mode,_),u.return=y,y=u}return i(y);case gn:return D=g._init,k(y,u,D(g._payload),_)}if(lr(g))return v(y,u,g,_);if(Qs(g))return w(y,u,g,_);fa(y,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,u!==null&&u.tag===6?(n(y,u.sibling),u=a(u,g),u.return=y,y=u):(n(y,u),u=li(g,y.mode,_),u.return=y,y=u),i(y)):n(y,u)}return k}var Is=Gp(!0),Xp=Gp(!1),Ja=zn(null),Ga=null,Ns=null,Jo=null;function Go(){Jo=Ns=Ga=null}function Xo(e){var t=Ja.current;Ce(Ja),e._currentValue=t}function Xi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ps(e,t){Ga=e,Jo=Ns=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ot=!0),e.firstContext=null)}function Rt(e){var t=e._currentValue;if(Jo!==e)if(e={context:e,memoizedValue:t,next:null},Ns===null){if(Ga===null)throw Error(B(308));Ns=e,Ga.dependencies={lanes:0,firstContext:e}}else Ns=Ns.next=e;return t}var Qn=null;function Yo(e){Qn===null?Qn=[e]:Qn.push(e)}function Yp(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,Yo(t)):(n.next=a.next,a.next=n),t.interleaved=n,dn(e,r)}function dn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var yn=!1;function Zo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function an(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function En(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,je&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,dn(e,n)}return a=r.interleaved,a===null?(t.next=t,Yo(r)):(t.next=a.next,a.next=t),r.interleaved=t,dn(e,n)}function _a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Do(e,n)}}function xd(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?a=l=i:l=l.next=i,n=n.next}while(n!==null);l===null?a=l=t:l=l.next=t}else a=l=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xa(e,t,n,r){var a=e.updateQueue;yn=!1;var l=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,d=c.next;c.next=null,i===null?l=d:i.next=d,i=c;var m=e.alternate;m!==null&&(m=m.updateQueue,o=m.lastBaseUpdate,o!==i&&(o===null?m.firstBaseUpdate=d:o.next=d,m.lastBaseUpdate=c))}if(l!==null){var f=a.baseState;i=0,m=d=c=null,o=l;do{var p=o.lane,N=o.eventTime;if((r&p)===p){m!==null&&(m=m.next={eventTime:N,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var v=e,w=o;switch(p=t,N=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){f=v.call(N,f,p);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,p=typeof v=="function"?v.call(N,f,p):v,p==null)break e;f=Ae({},f,p);break e;case 2:yn=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[o]:p.push(o))}else N={eventTime:N,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},m===null?(d=m=N,c=f):m=m.next=N,i|=p;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;p=o,o=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(m===null&&(c=f),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=m,t=a.shared.interleaved,t!==null){a=t;do i|=a.lane,a=a.next;while(a!==t)}else l===null&&(a.shared.lanes=0);ls|=i,e.lanes=i,e.memoizedState=f}}function hd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ti.transition;ti.transition={};try{e(!1),t()}finally{be=n,ti.transition=r}}function hm(){return Tt().memoizedState}function Hx(e,t,n){var r=Tn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gm(e))ym(t,n);else if(n=Yp(e,t,n,r),n!==null){var a=rt();zt(n,e,r,a),vm(n,t,r)}}function Wx(e,t,n){var r=Tn(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gm(e))ym(t,a);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var i=t.lastRenderedState,o=l(i,n);if(a.hasEagerState=!0,a.eagerState=o,Ft(o,i)){var c=t.interleaved;c===null?(a.next=a,Yo(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=Yp(e,t,a,r),n!==null&&(a=rt(),zt(n,e,r,a),vm(n,t,r))}}function gm(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function ym(e,t){xr=Za=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Do(e,n)}}var el={readContext:Rt,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},qx={readContext:Rt,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:yd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ea(4194308,4,um.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ea(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ea(4,2,e,t)},useMemo:function(e,t){var n=Vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vt();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=Hx.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:gd,useDebugValue:ic,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=gd(!1),t=e[0];return e=Vx.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Le,a=Vt();if(Re){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Ve===null)throw Error(B(349));as&30||sm(r,t,n)}a.memoizedState=n;var l={value:n,getSnapshot:t};return a.queue=l,yd(am.bind(null,r,l,e),[e]),r.flags|=2048,Or(9,rm.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Vt(),t=Ve.identifierPrefix;if(Re){var n=rn,r=sn;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ar++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ht]=t,e[Tr]=r,Rm(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ai(n,r),n){case"dialog":_e("cancel",e),_e("close",e),a=r;break;case"iframe":case"object":case"embed":_e("load",e),a=r;break;case"video":case"audio":for(a=0;azs&&(t.flags|=128,r=!0,er(l,!1),t.lanes=4194304)}else{if(!r)if(e=Ya(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),er(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!Re)return Ge(t),null}else 2*Ie()-l.renderingStartTime>zs&&n!==1073741824&&(t.flags|=128,r=!0,er(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(n=l.last,n!==null?n.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ie(),t.sibling=null,n=Pe.current,Ne(Pe,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return mc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?xt&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function eh(e,t){switch(Ko(t),t.tag){case 1:return dt(t.type)&&Wa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ms(),Ce(ct),Ce(et),nc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tc(t),null;case 13:if(Ce(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Os()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(Pe),null;case 4:return Ms(),null;case 10:return Xo(t.type._context),null;case 22:case 23:return mc(),null;case 24:return null;default:return null}}var ha=!1,Xe=!1,th=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Ss(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$e(e,t,r)}else n.current=null}function lo(e,t,n){try{n()}catch(r){$e(e,t,r)}}var Rd=!1;function nh(e,t){if(Vi=Ua,e=Ip(),Wo(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 a=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var i=0,o=-1,c=-1,d=0,m=0,f=e,p=null;t:for(;;){for(var N;f!==n||a!==0&&f.nodeType!==3||(o=i+a),f!==l||r!==0&&f.nodeType!==3||(c=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(N=f.firstChild)!==null;)p=f,f=N;for(;;){if(f===e)break t;if(p===n&&++d===a&&(o=i),p===l&&++m===r&&(c=i),(N=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=N}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Hi={focusedElem:e,selectionRange:n},Ua=!1,ee=t;ee!==null;)if(t=ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ee=e;else for(;ee!==null;){t=ee;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,k=v.memoizedState,y=t.stateNode,u=y.getSnapshotBeforeUpdate(t.elementType===t.type?w:$t(t.type,w),k);y.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(_){$e(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,ee=e;break}ee=t.return}return v=Rd,Rd=!1,v}function hr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var l=a.destroy;a.destroy=void 0,l!==void 0&&lo(t,n,l)}a=a.next}while(a!==r)}}function jl(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 io(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 Lm(e){var t=e.alternate;t!==null&&(e.alternate=null,Lm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ht],delete t[Tr],delete t[Ki],delete t[Dx],delete t[zx])),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 Am(e){return e.tag===5||e.tag===3||e.tag===4}function Td(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Am(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 oo(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=Ha));else if(r!==4&&(e=e.child,e!==null))for(oo(e,t,n),e=e.sibling;e!==null;)oo(e,t,n),e=e.sibling}function co(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(co(e,t,n),e=e.sibling;e!==null;)co(e,t,n),e=e.sibling}var He=null,Ot=!1;function xn(e,t,n){for(n=n.child;n!==null;)$m(e,t,n),n=n.sibling}function $m(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(ml,n)}catch{}switch(n.tag){case 5:Xe||Ss(n,t);case 6:var r=He,a=Ot;He=null,xn(e,t,n),He=r,Ot=a,He!==null&&(Ot?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(Ot?(e=He,n=n.stateNode,e.nodeType===8?Yl(e.parentNode,n):e.nodeType===1&&Yl(e,n),Sr(e)):Yl(He,n.stateNode));break;case 4:r=He,a=Ot,He=n.stateNode.containerInfo,Ot=!0,xn(e,t,n),He=r,Ot=a;break;case 0:case 11:case 14:case 15:if(!Xe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var l=a,i=l.destroy;l=l.tag,i!==void 0&&(l&2||l&4)&&lo(n,t,i),a=a.next}while(a!==r)}xn(e,t,n);break;case 1:if(!Xe&&(Ss(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){$e(n,t,o)}xn(e,t,n);break;case 21:xn(e,t,n);break;case 22:n.mode&1?(Xe=(r=Xe)||n.memoizedState!==null,xn(e,t,n),Xe=r):xn(e,t,n);break;default:xn(e,t,n)}}function Pd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new th),t.forEach(function(r){var a=uh.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Lt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ra&&(a=i),r&=~l}if(r=a,r=Ie()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rh(r/1960))-r,10e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,sl=0,je&6)throw Error(B(331));var a=je;for(je|=4,ee=e.current;ee!==null;){var l=ee,i=l.child;if(ee.flags&16){var o=l.deletions;if(o!==null){for(var c=0;cIe()-uc?Xn(e,0):dc|=n),ut(e,t)}function Bm(e,t){t===0&&(e.mode&1?(t=ia,ia<<=1,!(ia&130023424)&&(ia=4194304)):t=1);var n=rt();e=dn(e,t),e!==null&&(Vr(e,t,n),ut(e,n))}function dh(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bm(e,n)}function uh(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),Bm(e,n)}var Vm;Vm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)ot=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ot=!1,Yx(e,t,n);ot=!!(e.flags&131072)}else ot=!1,Re&&t.flags&1048576&&Kp(t,Qa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ra(e,t),e=t.pendingProps;var a=$s(t,et.current);Ps(t,n),a=rc(null,t,r,e,a,n);var l=ac();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dt(r)?(l=!0,qa(t)):l=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Zo(t),a.updater=wl,t.stateNode=a,a._reactInternals=t,Zi(t,r,e,n),t=no(null,t,r,!0,l,n)):(t.tag=0,Re&&l&&qo(t),nt(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ra(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=mh(r),e=$t(r,e),a){case 0:t=to(null,t,r,e,n);break e;case 1:t=_d(null,t,r,e,n);break e;case 11:t=Nd(null,t,r,e,n);break e;case 14:t=Sd(null,t,r,$t(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:$t(r,a),to(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:$t(r,a),_d(e,t,r,a,n);case 3:e:{if(_m(t),e===null)throw Error(B(387));r=t.pendingProps,l=t.memoizedState,a=l.element,Zp(e,t),Xa(t,r,null,n);var i=t.memoizedState;if(r=i.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){a=Ds(Error(B(423)),t),t=Cd(e,t,r,n,a);break e}else if(r!==a){a=Ds(Error(B(424)),t),t=Cd(e,t,r,n,a);break e}else for(ht=Cn(t.stateNode.containerInfo.firstChild),gt=t,Re=!0,It=null,n=Xp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Os(),r===a){t=un(e,t,n);break e}nt(e,t,r,n)}t=t.child}return t;case 5:return em(t),e===null&&Gi(t),r=t.type,a=t.pendingProps,l=e!==null?e.memoizedProps:null,i=a.children,Wi(r,a)?i=null:l!==null&&Wi(r,l)&&(t.flags|=32),Sm(e,t),nt(e,t,i,n),t.child;case 6:return e===null&&Gi(t),null;case 13:return Cm(e,t,n);case 4:return ec(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Is(t,null,r,n):nt(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:$t(r,a),Nd(e,t,r,a,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,l=t.memoizedProps,i=a.value,Ne(Ja,r._currentValue),r._currentValue=i,l!==null)if(Ft(l.value,i)){if(l.children===a.children&&!ct.current){t=un(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){i=l.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(l.tag===1){c=an(-1,n&-n),c.tag=2;var d=l.updateQueue;if(d!==null){d=d.shared;var m=d.pending;m===null?c.next=c:(c.next=m.next,m.next=c),d.pending=c}}l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Xi(l.return,n,t),o.lanes|=n;break}c=c.next}}else if(l.tag===10)i=l.type===t.type?null:l.child;else if(l.tag===18){if(i=l.return,i===null)throw Error(B(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Xi(i,n,t),i=l.sibling}else i=l.child;if(i!==null)i.return=l;else for(i=l;i!==null;){if(i===t){i=null;break}if(l=i.sibling,l!==null){l.return=i.return,i=l;break}i=i.return}l=i}nt(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Ps(t,n),a=Rt(a),r=r(a),t.flags|=1,nt(e,t,r,n),t.child;case 14:return r=t.type,a=$t(r,t.pendingProps),a=$t(r.type,a),Sd(e,t,r,a,n);case 15:return bm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:$t(r,a),Ra(e,t),t.tag=1,dt(r)?(e=!0,qa(t)):e=!1,Ps(t,n),wm(t,r,a),Zi(t,r,a,n),no(null,t,r,!0,e,n);case 19:return Em(e,t,n);case 22:return Nm(e,t,n)}throw Error(B(156,t.tag))};function Hm(e,t){return gp(e,t)}function ph(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 _t(e,t,n,r){return new ph(e,t,n,r)}function xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mh(e){if(typeof e=="function")return xc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$o)return 11;if(e===Oo)return 14}return 2}function Pn(e,t){var n=e.alternate;return n===null?(n=_t(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 La(e,t,n,r,a,l){var i=2;if(r=e,typeof e=="function")xc(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case hs:return Yn(n.children,a,l,t);case Ao:i=8,a|=8;break;case bi:return e=_t(12,n,t,a|2),e.elementType=bi,e.lanes=l,e;case Ni:return e=_t(13,n,t,a),e.elementType=Ni,e.lanes=l,e;case Si:return e=_t(19,n,t,a),e.elementType=Si,e.lanes=l,e;case ep:return bl(n,a,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yu:i=10;break e;case Zu:i=9;break e;case $o:i=11;break e;case Oo:i=14;break e;case gn:i=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=_t(i,n,t,a),t.elementType=e,t.type=r,t.lanes=l,t}function Yn(e,t,n,r){return e=_t(7,e,r,t),e.lanes=n,e}function bl(e,t,n,r){return e=_t(22,e,r,t),e.elementType=ep,e.lanes=n,e.stateNode={isHidden:!1},e}function li(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function ii(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fh(e,t,n,r,a){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=Ul(0),this.expirationTimes=Ul(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ul(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function hc(e,t,n,r,a,l,i,o,c){return e=new fh(e,t,n,o,c),t===1?(t=1,l===!0&&(t|=8)):t=0,l=_t(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zo(l),e}function xh(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qm)}catch(e){console.error(e)}}Qm(),Qu.exports=wt;var wh=Qu.exports,zd=wh;ji.createRoot=zd.createRoot,ji.hydrateRoot=zd.hydrateRoot;/** + * @remix-run/router v1.23.2 + * + * 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 Mr(){return Mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function wc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kh(){return Math.random().toString(36).substr(2,8)}function Ud(e,t){return{usr:e.state,key:e.key,idx:t}}function xo(e,t,n,r){return n===void 0&&(n=null),Mr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ws(t):t,{state:n,key:t&&t.key||r||kh()})}function ll(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ws(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function bh(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:l=!1}=r,i=a.history,o=bn.Pop,c=null,d=m();d==null&&(d=0,i.replaceState(Mr({},i.state,{idx:d}),""));function m(){return(i.state||{idx:null}).idx}function f(){o=bn.Pop;let k=m(),y=k==null?null:k-d;d=k,c&&c({action:o,location:w.location,delta:y})}function p(k,y){o=bn.Push;let u=xo(w.location,k,y);d=m()+1;let g=Ud(u,d),_=w.createHref(u);try{i.pushState(g,"",_)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;a.location.assign(_)}l&&c&&c({action:o,location:w.location,delta:1})}function N(k,y){o=bn.Replace;let u=xo(w.location,k,y);d=m();let g=Ud(u,d),_=w.createHref(u);i.replaceState(g,"",_),l&&c&&c({action:o,location:w.location,delta:0})}function v(k){let y=a.location.origin!=="null"?a.location.origin:a.location.href,u=typeof k=="string"?k:ll(k);return u=u.replace(/ $/,"%20"),ze(y,"No window.location.(origin|href) available to create URL for href: "+u),new URL(u,y)}let w={get action(){return o},get location(){return e(a,i)},listen(k){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Fd,f),c=k,()=>{a.removeEventListener(Fd,f),c=null}},createHref(k){return t(a,k)},createURL:v,encodeLocation(k){let y=v(k);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:N,go(k){return i.go(k)}};return w}var Bd;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Bd||(Bd={}));function Nh(e,t,n){return n===void 0&&(n="/"),Sh(e,t,n)}function Sh(e,t,n,r){let a=typeof t=="string"?Ws(t):t,l=jc(a.pathname||"/",n);if(l==null)return null;let i=Jm(e);_h(i);let o=null;for(let c=0;o==null&&c{let c={relativePath:o===void 0?l.path||"":o,caseSensitive:l.caseSensitive===!0,childrenIndex:i,route:l};c.relativePath.startsWith("/")&&(ze(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Ln([r,c.relativePath]),m=n.concat(c);l.children&&l.children.length>0&&(ze(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Jm(l.children,t,m,d)),!(l.path==null&&!l.index)&&t.push({path:d,score:Ah(d,l.index),routesMeta:m})};return e.forEach((l,i)=>{var o;if(l.path===""||!((o=l.path)!=null&&o.includes("?")))a(l,i);else for(let c of Gm(l.path))a(l,i,c)}),t}function Gm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return a?[l,""]:[l];let i=Gm(r.join("/")),o=[];return o.push(...i.map(c=>c===""?l:[l,c].join("/"))),a&&o.push(...i),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function _h(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$h(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Ch=/^:[\w-]+$/,Eh=3,Rh=2,Th=1,Ph=10,Lh=-2,Vd=e=>e==="*";function Ah(e,t){let n=e.split("/"),r=n.length;return n.some(Vd)&&(r+=Lh),t&&(r+=Rh),n.filter(a=>!Vd(a)).reduce((a,l)=>a+(Ch.test(l)?Eh:l===""?Th:Ph),r)}function $h(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function Oh(e,t,n){let{routesMeta:r}=e,a={},l="/",i=[];for(let o=0;o{let{paramName:p,isOptional:N}=m;if(p==="*"){let w=o[f]||"";i=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const v=o[f];return N&&!v?d[p]=void 0:d[p]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:l,pathnameBase:i,pattern:e}}function Mh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),wc(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Dh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wc(!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 jc(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)||"/"}const zh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fh=e=>zh.test(e);function Uh(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Ws(e):e,l;if(n)if(Fh(n))l=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),wc(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?l=Hd(n.substring(1),"/"):l=Hd(n,t)}else l=t;return{pathname:l,search:Hh(r),hash:Wh(a)}}function Hd(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function oi(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 Bh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Xm(e,t){let n=Bh(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ym(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Ws(e):(a=Mr({},e),ze(!a.pathname||!a.pathname.includes("?"),oi("?","pathname","search",a)),ze(!a.pathname||!a.pathname.includes("#"),oi("#","pathname","hash",a)),ze(!a.search||!a.search.includes("#"),oi("#","search","hash",a)));let l=e===""||a.pathname==="",i=l?"/":a.pathname,o;if(i==null)o=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),f-=1;a.pathname=p.join("/")}o=f>=0?t[f]:"/"}let c=Uh(a,o),d=i&&i!=="/"&&i.endsWith("/"),m=(l||i===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||m)&&(c.pathname+="/"),c}const Ln=e=>e.join("/").replace(/\/\/+/g,"/"),Vh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Hh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Wh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function qh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Zm=["post","put","patch","delete"];new Set(Zm);const Kh=["get",...Zm];new Set(Kh);/** + * React Router v6.30.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 Dr(){return Dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.current=!0}),x.useCallback(function(d,m){if(m===void 0&&(m={}),!o.current)return;if(typeof d=="number"){r.go(d);return}let f=Ym(d,JSON.parse(i),l,m.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ln([t,f.pathname])),(m.replace?r.replace:r.push)(f,m.state,m)},[t,r,i,l,e])}function bc(){let{matches:e}=x.useContext(Un),t=e[e.length-1];return t?t.params:{}}function n0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(ps),{matches:a}=x.useContext(Un),{pathname:l}=qs(),i=JSON.stringify(Xm(a,r.v7_relativeSplatPath));return x.useMemo(()=>Ym(e,JSON.parse(i),l,n==="path"),[e,i,l,n])}function Xh(e,t){return Yh(e,t)}function Yh(e,t,n,r){Kr()||ze(!1);let{navigator:a}=x.useContext(ps),{matches:l}=x.useContext(Un),i=l[l.length-1],o=i?i.params:{};i&&i.pathname;let c=i?i.pathnameBase:"/";i&&i.route;let d=qs(),m;if(t){var f;let k=typeof t=="string"?Ws(t):t;c==="/"||(f=k.pathname)!=null&&f.startsWith(c)||ze(!1),m=k}else m=d;let p=m.pathname||"/",N=p;if(c!=="/"){let k=c.replace(/^\//,"").split("/");N="/"+p.replace(/^\//,"").split("/").slice(k.length).join("/")}let v=Nh(e,{pathname:N}),w=sg(v&&v.map(k=>Object.assign({},k,{params:Object.assign({},o,k.params),pathname:Ln([c,a.encodeLocation?a.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?c:Ln([c,a.encodeLocation?a.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),l,n,r);return t&&w?x.createElement(El.Provider,{value:{location:Dr({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:bn.Pop}},w):w}function Zh(){let e=ig(),t=qh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:a},n):null,null)}const eg=x.createElement(Zh,null);class tg extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(Un.Provider,{value:this.props.routeContext},x.createElement(e0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ng(e){let{routeContext:t,match:n,children:r}=e,a=x.useContext(kc);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Un.Provider,{value:t},r)}function sg(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=(a=n)==null?void 0:a.errors;if(o!=null){let m=i.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);m>=0||ze(!1),i=i.slice(0,Math.min(i.length,m+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let m=0;m=0?i=i.slice(0,d+1):i=[i[0]];break}}}return i.reduceRight((m,f,p)=>{let N,v=!1,w=null,k=null;n&&(N=o&&f.route.id?o[f.route.id]:void 0,w=f.route.errorElement||eg,c&&(d<0&&p===0?(cg("route-fallback"),v=!0,k=null):d===p&&(v=!0,k=f.route.hydrateFallbackElement||null)));let y=t.concat(i.slice(0,p+1)),u=()=>{let g;return N?g=w:v?g=k:f.route.Component?g=x.createElement(f.route.Component,null):f.route.element?g=f.route.element:g=m,x.createElement(ng,{match:f,routeContext:{outlet:m,matches:y,isDataRoute:n!=null},children:g})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?x.createElement(tg,{location:n.location,revalidation:n.revalidation,component:w,error:N,children:u(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):u()},null)}var s0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(s0||{}),r0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(r0||{});function rg(e){let t=x.useContext(kc);return t||ze(!1),t}function ag(e){let t=x.useContext(Qh);return t||ze(!1),t}function lg(e){let t=x.useContext(Un);return t||ze(!1),t}function a0(e){let t=lg(),n=t.matches[t.matches.length-1];return n.route.id||ze(!1),n.route.id}function ig(){var e;let t=x.useContext(e0),n=ag(),r=a0();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function og(){let{router:e}=rg(s0.UseNavigateStable),t=a0(r0.UseNavigateStable),n=x.useRef(!1);return t0(()=>{n.current=!0}),x.useCallback(function(a,l){l===void 0&&(l={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Dr({fromRouteId:t},l)))},[e,t])}const Wd={};function cg(e,t,n){Wd[e]||(Wd[e]=!0)}function dg(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function tt(e){ze(!1)}function ug(e){let{basename:t="/",children:n=null,location:r,navigationType:a=bn.Pop,navigator:l,static:i=!1,future:o}=e;Kr()&&ze(!1);let c=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:c,navigator:l,static:i,future:Dr({v7_relativeSplatPath:!1},o)}),[c,o,l,i]);typeof r=="string"&&(r=Ws(r));let{pathname:m="/",search:f="",hash:p="",state:N=null,key:v="default"}=r,w=x.useMemo(()=>{let k=jc(m,c);return k==null?null:{location:{pathname:k,search:f,hash:p,state:N,key:v},navigationType:a}},[c,m,f,p,N,v,a]);return w==null?null:x.createElement(ps.Provider,{value:d},x.createElement(El.Provider,{children:n,value:w}))}function pg(e){let{children:t,location:n}=e;return Xh(ho(t),n)}new Promise(()=>{});function ho(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,a)=>{if(!x.isValidElement(r))return;let l=[...t,a];if(r.type===x.Fragment){n.push.apply(n,ho(r.props.children,l));return}r.type!==tt&&ze(!1),!r.props.index||!r.props.children||ze(!1);let i={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=ho(r.props.children,l)),n.push(i)}),n}/** + * React Router DOM v6.30.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 go(){return go=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function fg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xg(e,t){return e.button===0&&(!t||t==="_self")&&!fg(e)}const hg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],gg="6";try{window.__reactRouterVersion=gg}catch{}const yg="startTransition",qd=cf[yg];function vg(e){let{basename:t,children:n,future:r,window:a}=e,l=x.useRef();l.current==null&&(l.current=jh({window:a,v5Compat:!0}));let i=l.current,[o,c]=x.useState({action:i.action,location:i.location}),{v7_startTransition:d}=r||{},m=x.useCallback(f=>{d&&qd?qd(()=>c(f)):c(f)},[c,d]);return x.useLayoutEffect(()=>i.listen(m),[i,m]),x.useEffect(()=>dg(r),[r]),x.createElement(ug,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:i,future:r})}const wg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nn=x.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:l,replace:i,state:o,target:c,to:d,preventScrollReset:m,viewTransition:f}=t,p=mg(t,hg),{basename:N}=x.useContext(ps),v,w=!1;if(typeof d=="string"&&jg.test(d)&&(v=d,wg))try{let g=new URL(window.location.href),_=d.startsWith("//")?new URL(g.protocol+d):new URL(d),L=jc(_.pathname,N);_.origin===g.origin&&L!=null?d=L+_.search+_.hash:w=!0}catch{}let k=Jh(d,{relative:a}),y=kg(d,{replace:i,state:o,target:c,preventScrollReset:m,relative:a,viewTransition:f});function u(g){r&&r(g),g.defaultPrevented||y(g)}return x.createElement("a",go({},p,{href:v||k,onClick:w||l?r:u,ref:n,target:c}))});var Kd;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Kd||(Kd={}));var Qd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qd||(Qd={}));function kg(e,t){let{target:n,replace:r,state:a,preventScrollReset:l,relative:i,viewTransition:o}=t===void 0?{}:t,c=Bn(),d=qs(),m=n0(e,{relative:i});return x.useCallback(f=>{if(xg(f,n)){f.preventDefault();let p=r!==void 0?r:ll(d)===ll(m);c(e,{replace:p,state:a,preventScrollReset:l,relative:i,viewTransition:o})}},[d,c,m,r,a,n,e,l,i,o])}/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var bg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ng=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Z=(e,t)=>{const n=x.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:o="",children:c,...d},m)=>x.createElement("svg",{ref:m,...bg,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:["lucide",`lucide-${Ng(e)}`,o].join(" "),...d},[...t.map(([f,p])=>x.createElement(f,p)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l0=Z("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jd=Z("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oe=Z("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sg=Z("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _g=Z("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gd=Z("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cg=Z("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nc=Z("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const In=Z("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xd=Z("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mt=Z("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Eg=Z("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yo=Z("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mn=Z("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wt=Z("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yd=Z("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pt=Z("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zr=Z("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zn=Z("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rg=Z("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xt=Z("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i0=Z("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o0=Z("Container",[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cr=Z("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const il=Z("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const os=Z("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const An=Z("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ol=Z("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yt=Z("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vo=Z("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pn=Z("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tg=Z("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pg=Z("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lg=Z("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ag=Z("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $g=Z("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Og=Z("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qt=Z("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c0=Z("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d0=Z("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ig=Z("MinusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mg=Z("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cl=Z("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yt=Z("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gt=Z("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ln=Z("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wo=Z("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dg=Z("Router",[["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6.01 18H6",key:"19vcac"}],["path",{d:"M10.01 18H10",key:"uamcmx"}],["path",{d:"M15 10v4",key:"qjz1xs"}],["path",{d:"M17.84 7.17a4 4 0 0 0-5.66 0",key:"1rif40"}],["path",{d:"M20.66 4.34a8 8 0 0 0-11.31 0",key:"6a5xfq"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u0=Z("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zd=Z("ScrollText",[["path",{d:"M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4",key:"13a6an"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M15 12h-5",key:"r7krc0"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qr=Z("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dl=Z("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zg=Z("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const p0=Z("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fg=Z("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ke=Z("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const m0=Z("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ug=Z("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eu=Z("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const es=Z("StopCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bg=Z("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kt=Z("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ye=Z("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vg=Z("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pt=Z("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tu=Z("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hg=Z("Wifi",[["path",{d:"M5 13a10 10 0 0 1 14 0",key:"6v8j51"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vr=Z("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ct=Z("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sc=Z("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.303.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rl=Z("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),Wg=[{path:"/",icon:Lg,label:"Dashboard"},{path:"/auto",icon:wo,label:"Auto Pentest"},{path:"/vuln-lab",icon:vo,label:"Vuln Lab"},{path:"/terminal",icon:Ye,label:"Terminal Agent"},{path:"/sandboxes",icon:o0,label:"Sandboxes"},{path:"/scan/new",icon:In,label:"AI Agent"},{path:"/realtime",icon:Rl,label:"Real-time Task"},{path:"/tasks",icon:Nc,label:"Task Library"},{path:"/scheduler",icon:Xt,label:"Scheduler"},{path:"/reports",icon:yt,label:"Reports"},{path:"/settings",icon:p0,label:"Settings"}];function qg(){const e=qs();return s.jsxs("aside",{className:"w-64 bg-dark-800 border-r border-dark-900/50 flex flex-col",children:[s.jsx("div",{className:"p-6 border-b border-dark-900/50",children:s.jsxs(nn,{to:"/",className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 bg-primary-500 rounded-lg flex items-center justify-center",children:s.jsx(Ke,{className:"w-6 h-6 text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-lg font-bold text-white",children:"NeuroSploit"}),s.jsx("p",{className:"text-xs text-dark-400",children:"v3.0 AI Pentest"})]})]})}),s.jsx("nav",{className:"flex-1 p-4",children:s.jsx("ul",{className:"space-y-2",children:Wg.map(t=>{const n=e.pathname===t.path,r=t.icon;return s.jsx("li",{children:s.jsxs(nn,{to:t.path,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${n?"bg-primary-500/20 text-primary-500":"text-dark-300 hover:bg-dark-900/50 hover:text-white"}`,children:[s.jsx(r,{className:"w-5 h-5"}),s.jsx("span",{children:t.label})]})},t.path)})})}),s.jsx("div",{className:"p-4 border-t border-dark-900/50",children:s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(l0,{className:"w-4 h-4 text-green-500"}),s.jsx("span",{className:"text-dark-400",children:"System Online"})]})})]})}const Kg={"/":"Dashboard","/scan/new":"New Security Scan","/reports":"Reports","/settings":"Settings"};function Qg(){const e=qs(),t=Kg[e.pathname]||"NeuroSploit";return s.jsxs("header",{className:"h-16 bg-dark-800 border-b border-dark-900/50 flex items-center justify-between px-6",children:[s.jsx("h1",{className:"text-xl font-semibold text-white",children:t}),s.jsx("div",{className:"flex items-center gap-4",children:s.jsx("span",{className:"text-sm text-dark-400",children:new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})})]})}function Jg({children:e}){return s.jsxs("div",{className:"flex min-h-screen bg-dark-700",children:[s.jsx(qg,{}),s.jsxs("div",{className:"flex-1 flex flex-col",children:[s.jsx(Qg,{}),s.jsx("main",{className:"flex-1 p-6 overflow-auto",children:e})]})]})}function f0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;tt=>{const n=Yg.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ut=e=>(e=e.toLowerCase(),t=>Pl(t)===e),Ll=e=>t=>typeof t===e,{isArray:Ks}=Array,Fs=Ll("undefined");function Gr(e){return e!==null&&!Fs(e)&&e.constructor!==null&&!Fs(e.constructor)&&mt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const g0=Ut("ArrayBuffer");function Zg(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&g0(e.buffer),t}const ey=Ll("string"),mt=Ll("function"),y0=Ll("number"),Xr=e=>e!==null&&typeof e=="object",ty=e=>e===!0||e===!1,Aa=e=>{if(Pl(e)!=="object")return!1;const t=_c(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(h0 in e)&&!(Tl in e)},ny=e=>{if(!Xr(e)||Gr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},sy=Ut("Date"),ry=Ut("File"),ay=Ut("Blob"),ly=Ut("FileList"),iy=e=>Xr(e)&&mt(e.pipe),oy=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||mt(e.append)&&((t=Pl(e))==="formdata"||t==="object"&&mt(e.toString)&&e.toString()==="[object FormData]"))},cy=Ut("URLSearchParams"),[dy,uy,py,my]=["ReadableStream","Request","Response","Headers"].map(Ut),fy=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Yr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Ks(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Gn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,w0=e=>!Fs(e)&&e!==Gn;function jo(){const{caseless:e,skipUndefined:t}=w0(this)&&this||{},n={},r=(a,l)=>{if(l==="__proto__"||l==="constructor"||l==="prototype")return;const i=e&&v0(n,l)||l;Aa(n[i])&&Aa(a)?n[i]=jo(n[i],a):Aa(a)?n[i]=jo({},a):Ks(a)?n[i]=a.slice():(!t||!Fs(a))&&(n[i]=a)};for(let a=0,l=arguments.length;a(Yr(t,(a,l)=>{n&&mt(a)?Object.defineProperty(e,l,{value:x0(a,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,l,{value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),hy=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gy=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},yy=(e,t,n,r)=>{let a,l,i;const o={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),l=a.length;l-- >0;)i=a[l],(!r||r(i,e,t))&&!o[i]&&(t[i]=e[i],o[i]=!0);e=n!==!1&&_c(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},vy=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},wy=e=>{if(!e)return null;if(Ks(e))return e;let t=e.length;if(!y0(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},jy=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&_c(Uint8Array)),ky=(e,t)=>{const r=(e&&e[Tl]).call(e);let a;for(;(a=r.next())&&!a.done;){const l=a.value;t.call(e,l[0],l[1])}},by=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Ny=Ut("HTMLFormElement"),Sy=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),nu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_y=Ut("RegExp"),j0=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Yr(n,(a,l)=>{let i;(i=t(a,l,e))!==!1&&(r[l]=i||a)}),Object.defineProperties(e,r)},Cy=e=>{j0(e,(t,n)=>{if(mt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(mt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ey=(e,t)=>{const n={},r=a=>{a.forEach(l=>{n[l]=!0})};return Ks(e)?r(e):r(String(e).split(t)),n},Ry=()=>{},Ty=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Py(e){return!!(e&&mt(e.append)&&e[h0]==="FormData"&&e[Tl])}const Ly=e=>{const t=new Array(10),n=(r,a)=>{if(Xr(r)){if(t.indexOf(r)>=0)return;if(Gr(r))return r;if(!("toJSON"in r)){t[a]=r;const l=Ks(r)?[]:{};return Yr(r,(i,o)=>{const c=n(i,a+1);!Fs(c)&&(l[o]=c)}),t[a]=void 0,l}}return r};return n(e,0)},Ay=Ut("AsyncFunction"),$y=e=>e&&(Xr(e)||mt(e))&&mt(e.then)&&mt(e.catch),k0=((e,t)=>e?setImmediate:t?((n,r)=>(Gn.addEventListener("message",({source:a,data:l})=>{a===Gn&&l===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Gn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",mt(Gn.postMessage)),Oy=typeof queueMicrotask<"u"?queueMicrotask.bind(Gn):typeof process<"u"&&process.nextTick||k0,Iy=e=>e!=null&&mt(e[Tl]),T={isArray:Ks,isArrayBuffer:g0,isBuffer:Gr,isFormData:oy,isArrayBufferView:Zg,isString:ey,isNumber:y0,isBoolean:ty,isObject:Xr,isPlainObject:Aa,isEmptyObject:ny,isReadableStream:dy,isRequest:uy,isResponse:py,isHeaders:my,isUndefined:Fs,isDate:sy,isFile:ry,isBlob:ay,isRegExp:_y,isFunction:mt,isStream:iy,isURLSearchParams:cy,isTypedArray:jy,isFileList:ly,forEach:Yr,merge:jo,extend:xy,trim:fy,stripBOM:hy,inherits:gy,toFlatObject:yy,kindOf:Pl,kindOfTest:Ut,endsWith:vy,toArray:wy,forEachEntry:ky,matchAll:by,isHTMLForm:Ny,hasOwnProperty:nu,hasOwnProp:nu,reduceDescriptors:j0,freezeMethods:Cy,toObjectSet:Ey,toCamelCase:Sy,noop:Ry,toFiniteNumber:Ty,findKey:v0,global:Gn,isContextDefined:w0,isSpecCompliantForm:Py,toJSONObject:Ly,isAsyncFn:Ay,isThenable:$y,setImmediate:k0,asap:Oy,isIterable:Iy};let ue=class b0 extends Error{static from(t,n,r,a,l,i){const o=new b0(t.message,n||t.code,r,a,l);return o.cause=t,o.name=t.name,i&&Object.assign(o,i),o}constructor(t,n,r,a,l){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),a&&(this.request=a),l&&(this.response=l,this.status=l.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.status}}};ue.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ue.ERR_BAD_OPTION="ERR_BAD_OPTION";ue.ECONNABORTED="ECONNABORTED";ue.ETIMEDOUT="ETIMEDOUT";ue.ERR_NETWORK="ERR_NETWORK";ue.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ue.ERR_DEPRECATED="ERR_DEPRECATED";ue.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ue.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ue.ERR_CANCELED="ERR_CANCELED";ue.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ue.ERR_INVALID_URL="ERR_INVALID_URL";const My=null;function ko(e){return T.isPlainObject(e)||T.isArray(e)}function N0(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function su(e,t,n){return e?e.concat(t).map(function(a,l){return a=N0(a),!n&&l?"["+a+"]":a}).join(n?".":""):t}function Dy(e){return T.isArray(e)&&!e.some(ko)}const zy=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Al(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,k){return!T.isUndefined(k[w])});const r=n.metaTokens,a=n.visitor||m,l=n.dots,i=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(a))throw new TypeError("visitor must be a function");function d(v){if(v===null)return"";if(T.isDate(v))return v.toISOString();if(T.isBoolean(v))return v.toString();if(!c&&T.isBlob(v))throw new ue("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(v)||T.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function m(v,w,k){let y=v;if(v&&!k&&typeof v=="object"){if(T.endsWith(w,"{}"))w=r?w:w.slice(0,-2),v=JSON.stringify(v);else if(T.isArray(v)&&Dy(v)||(T.isFileList(v)||T.endsWith(w,"[]"))&&(y=T.toArray(v)))return w=N0(w),y.forEach(function(g,_){!(T.isUndefined(g)||g===null)&&t.append(i===!0?su([w],_,l):i===null?w:w+"[]",d(g))}),!1}return ko(v)?!0:(t.append(su(k,w,l),d(v)),!1)}const f=[],p=Object.assign(zy,{defaultVisitor:m,convertValue:d,isVisitable:ko});function N(v,w){if(!T.isUndefined(v)){if(f.indexOf(v)!==-1)throw Error("Circular reference detected in "+w.join("."));f.push(v),T.forEach(v,function(y,u){(!(T.isUndefined(y)||y===null)&&a.call(t,y,T.isString(u)?u.trim():u,w,p))===!0&&N(y,w?w.concat(u):[u])}),f.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return N(e),t}function ru(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Cc(e,t){this._pairs=[],e&&Al(e,this,t)}const S0=Cc.prototype;S0.append=function(t,n){this._pairs.push([t,n])};S0.toString=function(t){const n=t?function(r){return t.call(this,r,ru)}:ru;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function Fy(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _0(e,t,n){if(!t)return e;const r=n&&n.encode||Fy,a=T.isFunction(n)?{serialize:n}:n,l=a&&a.serialize;let i;if(l?i=l(t,a):i=T.isURLSearchParams(t)?t.toString():new Cc(t,a).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class au{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ec={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Uy=typeof URLSearchParams<"u"?URLSearchParams:Cc,By=typeof FormData<"u"?FormData:null,Vy=typeof Blob<"u"?Blob:null,Hy={isBrowser:!0,classes:{URLSearchParams:Uy,FormData:By,Blob:Vy},protocols:["http","https","file","blob","url","data"]},Rc=typeof window<"u"&&typeof document<"u",bo=typeof navigator=="object"&&navigator||void 0,Wy=Rc&&(!bo||["ReactNative","NativeScript","NS"].indexOf(bo.product)<0),qy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ky=Rc&&window.location.href||"http://localhost",Qy=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rc,hasStandardBrowserEnv:Wy,hasStandardBrowserWebWorkerEnv:qy,navigator:bo,origin:Ky},Symbol.toStringTag,{value:"Module"})),Ze={...Qy,...Hy};function Jy(e,t){return Al(e,new Ze.classes.URLSearchParams,{visitor:function(n,r,a,l){return Ze.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function Gy(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Xy(e){const t={},n=Object.keys(e);let r;const a=n.length;let l;for(r=0;r=n.length;return i=!i&&T.isArray(a)?a.length:i,c?(T.hasOwnProp(a,i)?a[i]=[a[i],r]:a[i]=r,!o):((!a[i]||!T.isObject(a[i]))&&(a[i]=[]),t(n,r,a[i],l)&&T.isArray(a[i])&&(a[i]=Xy(a[i])),!o)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,a)=>{t(Gy(r),a,n,0)}),n}return null}function Yy(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Zr={transitional:Ec,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,l=T.isObject(t);if(l&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return a?JSON.stringify(C0(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(l){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Jy(t,this.formSerializer).toString();if((o=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Al(o?{"files[]":t}:t,c&&new c,this.formSerializer)}}return l||a?(n.setContentType("application/json",!1),Yy(t)):t}],transformResponse:[function(t){const n=this.transitional||Zr.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(r&&!this.responseType||a)){const i=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(o){if(i)throw o.name==="SyntaxError"?ue.from(o,ue.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ze.classes.FormData,Blob:Ze.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{Zr.headers[e]={}});const Zy=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ev=e=>{const t={};let n,r,a;return e&&e.split(` +`).forEach(function(i){a=i.indexOf(":"),n=i.substring(0,a).trim().toLowerCase(),r=i.substring(a+1).trim(),!(!n||t[n]&&Zy[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},lu=Symbol("internals");function nr(e){return e&&String(e).trim().toLowerCase()}function $a(e){return e===!1||e==null?e:T.isArray(e)?e.map($a):String(e)}function tv(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const nv=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ci(e,t,n,r,a){if(T.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function sv(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function rv(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,l,i){return this[r].call(this,t,a,l,i)},configurable:!0})})}let ft=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function l(o,c,d){const m=nr(c);if(!m)throw new Error("header name must be a non-empty string");const f=T.findKey(a,m);(!f||a[f]===void 0||d===!0||d===void 0&&a[f]!==!1)&&(a[f||c]=$a(o))}const i=(o,c)=>T.forEach(o,(d,m)=>l(d,m,c));if(T.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(T.isString(t)&&(t=t.trim())&&!nv(t))i(ev(t),n);else if(T.isObject(t)&&T.isIterable(t)){let o={},c,d;for(const m of t){if(!T.isArray(m))throw TypeError("Object iterator must return a key-value pair");o[d=m[0]]=(c=o[d])?T.isArray(c)?[...c,m[1]]:[c,m[1]]:m[1]}i(o,n)}else t!=null&&l(n,t,r);return this}get(t,n){if(t=nr(t),t){const r=T.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return tv(a);if(T.isFunction(n))return n.call(this,a,r);if(T.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=nr(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ci(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function l(i){if(i=nr(i),i){const o=T.findKey(r,i);o&&(!n||ci(r,r[o],o,n))&&(delete r[o],a=!0)}}return T.isArray(t)?t.forEach(l):l(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const l=n[r];(!t||ci(this,this[l],l,t,!0))&&(delete this[l],a=!0)}return a}normalize(t){const n=this,r={};return T.forEach(this,(a,l)=>{const i=T.findKey(r,l);if(i){n[i]=$a(a),delete n[l];return}const o=t?sv(l):String(l).trim();o!==l&&delete n[l],n[o]=$a(a),r[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&T.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[lu]=this[lu]={accessors:{}}).accessors,a=this.prototype;function l(i){const o=nr(i);r[o]||(rv(a,i),r[o]=!0)}return T.isArray(t)?t.forEach(l):l(t),this}};ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(ft.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});T.freezeMethods(ft);function di(e,t){const n=this||Zr,r=t||n,a=ft.from(r.headers);let l=r.data;return T.forEach(e,function(o){l=o.call(n,l,a.normalize(),t?t.status:void 0)}),a.normalize(),l}function E0(e){return!!(e&&e.__CANCEL__)}let ea=class extends ue{constructor(t,n,r){super(t??"canceled",ue.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function R0(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ue("Request failed with status code "+n.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function av(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function lv(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,l=0,i;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),m=r[l];i||(i=d),n[a]=c,r[a]=d;let f=l,p=0;for(;f!==a;)p+=n[f++],f=f%e;if(a=(a+1)%e,a===l&&(l=(l+1)%e),d-i{n=m,a=null,l&&(clearTimeout(l),l=null),e(...d)};return[(...d)=>{const m=Date.now(),f=m-n;f>=r?i(d,m):(a=d,l||(l=setTimeout(()=>{l=null,i(a)},r-f)))},()=>a&&i(a)]}const ul=(e,t,n=3)=>{let r=0;const a=lv(50,250);return iv(l=>{const i=l.loaded,o=l.lengthComputable?l.total:void 0,c=i-r,d=a(c),m=i<=o;r=i;const f={loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:d||void 0,estimated:d&&o&&m?(o-i)/d:void 0,event:l,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(f)},n)},iu=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ou=e=>(...t)=>T.asap(()=>e(...t)),ov=Ze.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ze.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ze.origin),Ze.navigator&&/(msie|trident)/i.test(Ze.navigator.userAgent)):()=>!0,cv=Ze.hasStandardBrowserEnv?{write(e,t,n,r,a,l,i){if(typeof document>"u")return;const o=[`${e}=${encodeURIComponent(t)}`];T.isNumber(n)&&o.push(`expires=${new Date(n).toUTCString()}`),T.isString(r)&&o.push(`path=${r}`),T.isString(a)&&o.push(`domain=${a}`),l===!0&&o.push("secure"),T.isString(i)&&o.push(`SameSite=${i}`),document.cookie=o.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function dv(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function uv(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function T0(e,t,n){let r=!dv(t);return e&&(r||n==!1)?uv(e,t):t}const cu=e=>e instanceof ft?{...e}:e;function cs(e,t){t=t||{};const n={};function r(d,m,f,p){return T.isPlainObject(d)&&T.isPlainObject(m)?T.merge.call({caseless:p},d,m):T.isPlainObject(m)?T.merge({},m):T.isArray(m)?m.slice():m}function a(d,m,f,p){if(T.isUndefined(m)){if(!T.isUndefined(d))return r(void 0,d,f,p)}else return r(d,m,f,p)}function l(d,m){if(!T.isUndefined(m))return r(void 0,m)}function i(d,m){if(T.isUndefined(m)){if(!T.isUndefined(d))return r(void 0,d)}else return r(void 0,m)}function o(d,m,f){if(f in t)return r(d,m);if(f in e)return r(void 0,d)}const c={url:l,method:l,data:l,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:o,headers:(d,m,f)=>a(cu(d),cu(m),f,!0)};return T.forEach(Object.keys({...e,...t}),function(m){if(m==="__proto__"||m==="constructor"||m==="prototype")return;const f=T.hasOwnProp(c,m)?c[m]:a,p=f(e[m],t[m],m);T.isUndefined(p)&&f!==o||(n[m]=p)}),n}const P0=e=>{const t=cs({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:l,headers:i,auth:o}=t;if(t.headers=i=ft.from(i),t.url=_0(T0(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),o&&i.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),T.isFormData(n)){if(Ze.hasStandardBrowserEnv||Ze.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(T.isFunction(n.getHeaders)){const c=n.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([m,f])=>{d.includes(m.toLowerCase())&&i.set(m,f)})}}if(Ze.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&ov(t.url))){const c=a&&l&&cv.read(l);c&&i.set(a,c)}return t},pv=typeof XMLHttpRequest<"u",mv=pv&&function(e){return new Promise(function(n,r){const a=P0(e);let l=a.data;const i=ft.from(a.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:d}=a,m,f,p,N,v;function w(){N&&N(),v&&v(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let k=new XMLHttpRequest;k.open(a.method.toUpperCase(),a.url,!0),k.timeout=a.timeout;function y(){if(!k)return;const g=ft.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),L={data:!o||o==="text"||o==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:g,config:e,request:k};R0(function(R){n(R),w()},function(R){r(R),w()},L),k=null}"onloadend"in k?k.onloadend=y:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(y)},k.onabort=function(){k&&(r(new ue("Request aborted",ue.ECONNABORTED,e,k)),k=null)},k.onerror=function(_){const L=_&&_.message?_.message:"Network Error",D=new ue(L,ue.ERR_NETWORK,e,k);D.event=_||null,r(D),k=null},k.ontimeout=function(){let _=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const L=a.transitional||Ec;a.timeoutErrorMessage&&(_=a.timeoutErrorMessage),r(new ue(_,L.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,e,k)),k=null},l===void 0&&i.setContentType(null),"setRequestHeader"in k&&T.forEach(i.toJSON(),function(_,L){k.setRequestHeader(L,_)}),T.isUndefined(a.withCredentials)||(k.withCredentials=!!a.withCredentials),o&&o!=="json"&&(k.responseType=a.responseType),d&&([p,v]=ul(d,!0),k.addEventListener("progress",p)),c&&k.upload&&([f,N]=ul(c),k.upload.addEventListener("progress",f),k.upload.addEventListener("loadend",N)),(a.cancelToken||a.signal)&&(m=g=>{k&&(r(!g||g.type?new ea(null,e,k):g),k.abort(),k=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));const u=av(a.url);if(u&&Ze.protocols.indexOf(u)===-1){r(new ue("Unsupported protocol "+u+":",ue.ERR_BAD_REQUEST,e));return}k.send(l||null)})},fv=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const l=function(d){if(!a){a=!0,o();const m=d instanceof Error?d:this.reason;r.abort(m instanceof ue?m:new ea(m instanceof Error?m.message:m))}};let i=t&&setTimeout(()=>{i=null,l(new ue(`timeout of ${t}ms exceeded`,ue.ETIMEDOUT))},t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(l):d.removeEventListener("abort",l)}),e=null)};e.forEach(d=>d.addEventListener("abort",l));const{signal:c}=r;return c.unsubscribe=()=>T.asap(o),c}},xv=function*(e,t){let n=e.byteLength;if(n{const a=hv(e,t);let l=0,i,o=c=>{i||(i=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:m}=await a.next();if(d){o(),c.close();return}let f=m.byteLength;if(n){let p=l+=f;n(p)}c.enqueue(new Uint8Array(m))}catch(d){throw o(d),d}},cancel(c){return o(c),a.return()}},{highWaterMark:2})},uu=64*1024,{isFunction:va}=T,yv=(({Request:e,Response:t})=>({Request:e,Response:t}))(T.global),{ReadableStream:pu,TextEncoder:mu}=T.global,fu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},vv=e=>{e=T.merge.call({skipUndefined:!0},yv,e);const{fetch:t,Request:n,Response:r}=e,a=t?va(t):typeof fetch=="function",l=va(n),i=va(r);if(!a)return!1;const o=a&&va(pu),c=a&&(typeof mu=="function"?(v=>w=>v.encode(w))(new mu):async v=>new Uint8Array(await new n(v).arrayBuffer())),d=l&&o&&fu(()=>{let v=!1;const w=new n(Ze.origin,{body:new pu,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!w}),m=i&&o&&fu(()=>T.isReadableStream(new r("").body)),f={stream:m&&(v=>v.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!f[v]&&(f[v]=(w,k)=>{let y=w&&w[v];if(y)return y.call(w);throw new ue(`Response type '${v}' is not supported`,ue.ERR_NOT_SUPPORT,k)})});const p=async v=>{if(v==null)return 0;if(T.isBlob(v))return v.size;if(T.isSpecCompliantForm(v))return(await new n(Ze.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(T.isArrayBufferView(v)||T.isArrayBuffer(v))return v.byteLength;if(T.isURLSearchParams(v)&&(v=v+""),T.isString(v))return(await c(v)).byteLength},N=async(v,w)=>{const k=T.toFiniteNumber(v.getContentLength());return k??p(w)};return async v=>{let{url:w,method:k,data:y,signal:u,cancelToken:g,timeout:_,onDownloadProgress:L,onUploadProgress:D,responseType:R,headers:E,withCredentials:U="same-origin",fetchOptions:q}=P0(v),A=t||fetch;R=R?(R+"").toLowerCase():"text";let te=fv([u,g&&g.toAbortSignal()],_),Q=null;const ne=te&&te.unsubscribe&&(()=>{te.unsubscribe()});let ae;try{if(D&&d&&k!=="get"&&k!=="head"&&(ae=await N(E,y))!==0){let V=new n(w,{method:"POST",body:y,duplex:"half"}),G;if(T.isFormData(y)&&(G=V.headers.get("content-type"))&&E.setContentType(G),V.body){const[ge,he]=iu(ae,ul(ou(D)));y=du(V.body,uu,ge,he)}}T.isString(U)||(U=U?"include":"omit");const ce=l&&"credentials"in n.prototype,xe={...q,signal:te,method:k.toUpperCase(),headers:E.normalize().toJSON(),body:y,duplex:"half",credentials:ce?U:void 0};Q=l&&new n(w,xe);let z=await(l?A(Q,q):A(w,xe));const Y=m&&(R==="stream"||R==="response");if(m&&(L||Y&&ne)){const V={};["status","statusText","headers"].forEach(ke=>{V[ke]=z[ke]});const G=T.toFiniteNumber(z.headers.get("content-length")),[ge,he]=L&&iu(G,ul(ou(L),!0))||[];z=new r(du(z.body,uu,ge,()=>{he&&he(),ne&&ne()}),V)}R=R||"text";let se=await f[T.findKey(f,R)||"text"](z,v);return!Y&&ne&&ne(),await new Promise((V,G)=>{R0(V,G,{data:se,headers:ft.from(z.headers),status:z.status,statusText:z.statusText,config:v,request:Q})})}catch(ce){throw ne&&ne(),ce&&ce.name==="TypeError"&&/Load failed|fetch/i.test(ce.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,v,Q,ce&&ce.response),{cause:ce.cause||ce}):ue.from(ce,ce&&ce.code,v,Q,ce&&ce.response)}}},wv=new Map,L0=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,l=[r,a,n];let i=l.length,o=i,c,d,m=wv;for(;o--;)c=l[o],d=m.get(c),d===void 0&&m.set(c,d=o?new Map:vv(t)),m=d;return d};L0();const Tc={http:My,xhr:mv,fetch:{get:L0}};T.forEach(Tc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const xu=e=>`- ${e}`,jv=e=>T.isFunction(e)||e===null||e===!1;function kv(e,t){e=T.isArray(e)?e:[e];const{length:n}=e;let r,a;const l={};for(let i=0;i`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let o=n?i.length>1?`since : +`+i.map(xu).join(` +`):" "+xu(i[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return a}const A0={getAdapter:kv,adapters:Tc};function ui(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ea(null,e)}function hu(e){return ui(e),e.headers=ft.from(e.headers),e.data=di.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),A0.getAdapter(e.adapter||Zr.adapter,e)(e).then(function(r){return ui(e),r.data=di.call(e,e.transformResponse,r),r.headers=ft.from(r.headers),r},function(r){return E0(r)||(ui(e),r&&r.response&&(r.response.data=di.call(e,e.transformResponse,r.response),r.response.headers=ft.from(r.response.headers))),Promise.reject(r)})}const $0="1.13.5",$l={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$l[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const gu={};$l.transitional=function(t,n,r){function a(l,i){return"[Axios v"+$0+"] Transitional option '"+l+"'"+i+(r?". "+r:"")}return(l,i,o)=>{if(t===!1)throw new ue(a(i," has been removed"+(n?" in "+n:"")),ue.ERR_DEPRECATED);return n&&!gu[i]&&(gu[i]=!0,console.warn(a(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,i,o):!0}};$l.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function bv(e,t,n){if(typeof e!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const l=r[a],i=t[l];if(i){const o=e[l],c=o===void 0||i(o,l,e);if(c!==!0)throw new ue("option "+l+" must be "+c,ue.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ue("Unknown option "+l,ue.ERR_BAD_OPTION)}}const Oa={assertOptions:bv,validators:$l},bt=Oa.validators;let ns=class{constructor(t){this.defaults=t||{},this.interceptors={request:new au,response:new au}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const l=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+l):r.stack=l}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=cs(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:l}=n;r!==void 0&&Oa.assertOptions(r,{silentJSONParsing:bt.transitional(bt.boolean),forcedJSONParsing:bt.transitional(bt.boolean),clarifyTimeoutError:bt.transitional(bt.boolean),legacyInterceptorReqResOrdering:bt.transitional(bt.boolean)},!1),a!=null&&(T.isFunction(a)?n.paramsSerializer={serialize:a}:Oa.assertOptions(a,{encode:bt.function,serialize:bt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Oa.assertOptions(n,{baseUrl:bt.spelling("baseURL"),withXsrfToken:bt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=l&&T.merge(l.common,l[n.method]);l&&T.forEach(["delete","get","head","post","put","patch","common"],v=>{delete l[v]}),n.headers=ft.concat(i,l);const o=[];let c=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(n)===!1)return;c=c&&w.synchronous;const k=n.transitional||Ec;k&&k.legacyInterceptorReqResOrdering?o.unshift(w.fulfilled,w.rejected):o.push(w.fulfilled,w.rejected)});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let m,f=0,p;if(!c){const v=[hu.bind(this),void 0];for(v.unshift(...o),v.push(...d),p=v.length,m=Promise.resolve(n);f{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](a);r._listeners=null}),this.promise.then=a=>{let l;const i=new Promise(o=>{r.subscribe(o),l=o}).then(a);return i.cancel=function(){r.unsubscribe(l)},i},t(function(l,i,o){r.reason||(r.reason=new ea(l,i,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new O0(function(a){t=a}),cancel:t}}};function Sv(e){return function(n){return e.apply(null,n)}}function _v(e){return T.isObject(e)&&e.isAxiosError===!0}const No={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(No).forEach(([e,t])=>{No[t]=e});function I0(e){const t=new ns(e),n=x0(ns.prototype.request,t);return T.extend(n,ns.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return I0(cs(e,a))},n}const Me=I0(Zr);Me.Axios=ns;Me.CanceledError=ea;Me.CancelToken=Nv;Me.isCancel=E0;Me.VERSION=$0;Me.toFormData=Al;Me.AxiosError=ue;Me.Cancel=Me.CanceledError;Me.all=function(t){return Promise.all(t)};Me.spread=Sv;Me.isAxiosError=_v;Me.mergeConfig=cs;Me.AxiosHeaders=ft;Me.formToJSON=e=>C0(T.isHTMLForm(e)?new FormData(e):e);Me.getAdapter=A0.getAdapter;Me.HttpStatusCode=No;Me.default=Me;const{Axios:Hw,AxiosError:Ww,CanceledError:qw,isCancel:Kw,CancelToken:Qw,VERSION:Jw,all:Gw,Cancel:Xw,isAxiosError:Yw,spread:Zw,toFormData:ej,AxiosHeaders:tj,HttpStatusCode:nj,formToJSON:sj,getAdapter:rj,mergeConfig:aj}=Me,W=Me.create({baseURL:"/api/v1",headers:{"Content-Type":"application/json"}}),At={list:async(e=1,t=10,n)=>{const r=new URLSearchParams({page:String(e),per_page:String(t)});return n&&r.append("status",n),(await W.get(`/scans?${r}`)).data},get:async e=>(await W.get(`/scans/${e}`)).data,create:async e=>(await W.post("/scans",e)).data,start:async e=>(await W.post(`/scans/${e}/start`)).data,stop:async e=>(await W.post(`/scans/${e}/stop`)).data,pause:async e=>(await W.post(`/scans/${e}/pause`)).data,resume:async e=>(await W.post(`/scans/${e}/resume`)).data,delete:async e=>(await W.delete(`/scans/${e}`)).data,skipToPhase:async(e,t)=>(await W.post(`/scans/${e}/skip-to/${t}`)).data,getEndpoints:async(e,t=1,n=50)=>(await W.get(`/scans/${e}/endpoints?page=${t}&per_page=${n}`)).data,getVulnerabilities:async(e,t,n=1,r=50)=>{const a=new URLSearchParams({page:String(n),per_page:String(r)});return t&&a.append("severity",t),(await W.get(`/scans/${e}/vulnerabilities?${a}`)).data}},yu={validate:async e=>(await W.post("/targets/validate",{url:e})).data,validateBulk:async e=>(await W.post("/targets/validate/bulk",{urls:e})).data,upload:async e=>{const t=new FormData;return t.append("file",e),(await W.post("/targets/upload",t,{headers:{"Content-Type":"multipart/form-data"}})).data}},We={list:async e=>{const t=new URLSearchParams;e!=null&&e.scanId&&t.append("scan_id",e.scanId),(e==null?void 0:e.autoGenerated)!==void 0&&t.append("auto_generated",String(e.autoGenerated));const n=t.toString();return(await W.get(`/reports${n?`?${n}`:""}`)).data},get:async e=>(await W.get(`/reports/${e}`)).data,generate:async e=>(await W.post("/reports",e)).data,generateAiReport:async e=>(await W.post("/reports/ai-generate",e)).data,getViewUrl:e=>`/api/v1/reports/${e}/view`,getDownloadUrl:(e,t)=>`/api/v1/reports/${e}/download/${t}`,getDownloadZipUrl:e=>`/api/v1/reports/${e}/download-zip`,delete:async e=>(await W.delete(`/reports/${e}`)).data},pi={getStats:async()=>(await W.get("/dashboard/stats")).data,getRecent:async(e=10)=>(await W.get(`/dashboard/recent?limit=${e}`)).data,getFindings:async(e=20,t)=>{const n=new URLSearchParams({limit:String(e)});return t&&n.append("severity",t),(await W.get(`/dashboard/findings?${n}`)).data},getVulnerabilityTypes:async()=>(await W.get("/dashboard/vulnerability-types")).data,getAgentTasks:async(e=20)=>(await W.get(`/dashboard/agent-tasks?limit=${e}`)).data,getActivityFeed:async(e=30)=>(await W.get(`/dashboard/activity-feed?limit=${e}`)).data},mi={getTypes:async()=>(await W.get("/vulnerabilities/types")).data,get:async e=>(await W.get(`/vulnerabilities/${e}`)).data,validate:async(e,t,n)=>(await W.patch(`/scans/vulnerabilities/${e}/validate`,{validation_status:t,notes:n})).data},vu={list:async(e,t,n)=>{const r=new URLSearchParams;return r.append("scan_id",e),t&&r.append("status",t),n&&r.append("task_type",n),(await W.get(`/agent-tasks?${r}`)).data},get:async e=>(await W.get(`/agent-tasks/${e}`)).data,getSummary:async e=>(await W.get(`/agent-tasks/summary?scan_id=${e}`)).data,getTimeline:async e=>(await W.get(`/agent-tasks/scan/${e}/timeline`)).data},we={run:async e=>(await W.post("/agent/run",e)).data,getStatus:async e=>(await W.get(`/agent/status/${e}`)).data,getByScan:async e=>{try{return(await W.get(`/agent/by-scan/${e}`)).data}catch{return null}},getLogs:async(e,t=100)=>(await W.get(`/agent/logs/${e}?limit=${t}`)).data,getFindings:async e=>(await W.get(`/agent/findings/${e}`)).data,delete:async e=>(await W.delete(`/agent/${e}`)).data,stop:async e=>(await W.post(`/agent/stop/${e}`)).data,pause:async e=>(await W.post(`/agent/pause/${e}`)).data,resume:async e=>(await W.post(`/agent/resume/${e}`)).data,skipToPhase:async(e,t)=>(await W.post(`/agent/skip-to/${e}/${t}`)).data,sendPrompt:async(e,t)=>(await W.post(`/agent/prompt/${e}`,{prompt:t})).data,autoPentest:async(e,t)=>(await W.post("/agent/run",{target:e,mode:"auto_pentest",subdomain_discovery:(t==null?void 0:t.subdomain_discovery)||!1,targets:t==null?void 0:t.targets,auth_type:t==null?void 0:t.auth_type,auth_value:t==null?void 0:t.auth_value,prompt:t==null?void 0:t.prompt})).data,quickRun:async(e,t="full_auto")=>(await W.post(`/agent/quick?target=${encodeURIComponent(e)}&mode=${t}`)).data,tasks:{list:async e=>{const t=e?`?category=${e}`:"";return(await W.get(`/agent/tasks${t}`)).data},get:async e=>(await W.get(`/agent/tasks/${e}`)).data,create:async e=>(await W.post("/agent/tasks",e)).data,delete:async e=>(await W.delete(`/agent/tasks/${e}`)).data},realtime:{createSession:async(e,t)=>(await W.post("/agent/realtime/session",{target:e,name:t})).data,sendMessage:async(e,t)=>(await W.post(`/agent/realtime/${e}/message`,{message:t})).data,getSession:async e=>(await W.get(`/agent/realtime/${e}`)).data,getReport:async e=>(await W.get(`/agent/realtime/${e}/report`)).data,deleteSession:async e=>(await W.delete(`/agent/realtime/${e}`)).data,listSessions:async()=>(await W.get("/agent/realtime/sessions/list")).data,getLlmStatus:async()=>(await W.get("/agent/realtime/llm-status")).data,getReportHtml:async e=>(await W.get(`/agent/realtime/${e}/report?format=html`,{responseType:"text"})).data,getToolsList:async()=>(await W.get("/agent/realtime/tools/list")).data,getToolsStatus:async()=>(await W.get("/agent/realtime/tools/status")).data,executeTool:async(e,t,n,r)=>(await W.post(`/agent/realtime/${e}/execute-tool`,{tool:t,options:n,timeout:r||300})).data}},hn={getTypes:async()=>(await W.get("/vuln-lab/types")).data,run:async e=>(await W.post("/vuln-lab/run",e)).data,listChallenges:async e=>{const t=new URLSearchParams;e!=null&&e.vuln_type&&t.append("vuln_type",e.vuln_type),e!=null&&e.vuln_category&&t.append("vuln_category",e.vuln_category),e!=null&&e.status&&t.append("status",e.status),e!=null&&e.result&&t.append("result",e.result),e!=null&&e.limit&&t.append("limit",String(e.limit));const n=t.toString();return(await W.get(`/vuln-lab/challenges${n?`?${n}`:""}`)).data},getChallenge:async e=>(await W.get(`/vuln-lab/challenges/${e}`)).data,getStats:async()=>(await W.get("/vuln-lab/stats")).data,stopChallenge:async e=>(await W.post(`/vuln-lab/challenges/${e}/stop`)).data,deleteChallenge:async e=>(await W.delete(`/vuln-lab/challenges/${e}`)).data,getLogs:async(e,t=100)=>(await W.get(`/vuln-lab/logs/${e}?limit=${t}`)).data},fs={list:async()=>(await W.get("/scheduler/")).data,create:async e=>(await W.post("/scheduler/",e)).data,delete:async e=>(await W.delete(`/scheduler/${e}`)).data,pause:async e=>(await W.post(`/scheduler/${e}/pause`)).data,resume:async e=>(await W.post(`/scheduler/${e}/resume`)).data,getAgentRoles:async()=>(await W.get("/scheduler/agent-roles")).data},Zt={createSession:async(e,t,n)=>(await W.post("/terminal/session",{target:e,name:t,template_id:n})).data,listSessions:async()=>(await W.get("/terminal/sessions")).data,getSession:async e=>(await W.get(`/terminal/sessions/${e}`)).data,deleteSession:async e=>(await W.delete(`/terminal/sessions/${e}`)).data,sendMessage:async(e,t)=>(await W.post(`/terminal/sessions/${e}/message`,{message:t})).data,executeCommand:async(e,t,n)=>(await W.post(`/terminal/sessions/${e}/execute`,{command:t,execution_method:n})).data,addExploitationStep:async(e,t)=>(await W.post(`/terminal/sessions/${e}/exploitation-path`,t)).data,getExploitationPath:async e=>(await W.get(`/terminal/sessions/${e}/exploitation-path`)).data,getVpnStatus:async e=>(await W.get(`/terminal/sessions/${e}/vpn-status`)).data,listTemplates:async()=>(await W.get("/terminal/templates")).data},sr={list:async()=>(await W.get("/sandbox/")).data,healthCheck:async e=>(await W.get(`/sandbox/${e}`)).data,destroy:async e=>(await W.delete(`/sandbox/${e}`)).data,cleanup:async()=>(await W.post("/sandbox/cleanup")).data,cleanupOrphans:async()=>(await W.post("/sandbox/cleanup-orphans")).data},Cv={},wu=e=>{let t;const n=new Set,r=(m,f)=>{const p=typeof m=="function"?m(t):m;if(!Object.is(p,t)){const N=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(v=>v(t,N))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>d,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(Cv?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,a,c);return c},Ev=e=>e?wu(e):wu;var M0={exports:{}},D0={},z0={exports:{}},F0={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Us=x;function Rv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tv=typeof Object.is=="function"?Object.is:Rv,Pv=Us.useState,Lv=Us.useEffect,Av=Us.useLayoutEffect,$v=Us.useDebugValue;function Ov(e,t){var n=t(),r=Pv({inst:{value:n,getSnapshot:t}}),a=r[0].inst,l=r[1];return Av(function(){a.value=n,a.getSnapshot=t,fi(a)&&l({inst:a})},[e,n,t]),Lv(function(){return fi(a)&&l({inst:a}),e(function(){fi(a)&&l({inst:a})})},[e]),$v(n),n}function fi(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tv(e,n)}catch{return!0}}function Iv(e,t){return t()}var Mv=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Iv:Ov;F0.useSyncExternalStore=Us.useSyncExternalStore!==void 0?Us.useSyncExternalStore:Mv;z0.exports=F0;var Dv=z0.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ol=x,zv=Dv;function Fv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Uv=typeof Object.is=="function"?Object.is:Fv,Bv=zv.useSyncExternalStore,Vv=Ol.useRef,Hv=Ol.useEffect,Wv=Ol.useMemo,qv=Ol.useDebugValue;D0.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var l=Vv(null);if(l.current===null){var i={hasValue:!1,value:null};l.current=i}else i=l.current;l=Wv(function(){function c(N){if(!d){if(d=!0,m=N,N=r(N),a!==void 0&&i.hasValue){var v=i.value;if(a(v,N))return f=v}return f=N}if(v=f,Uv(m,N))return v;var w=r(N);return a!==void 0&&a(v,w)?(m=N,v):(m=N,f=w)}var d=!1,m,f,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,a]);var o=Bv(e,l[0],l[1]);return Hv(function(){i.hasValue=!0,i.value=o},[o]),qv(o),o};M0.exports=D0;var Kv=M0.exports;const Qv=Iu(Kv),U0={},{useDebugValue:Jv}=Ro,{useSyncExternalStoreWithSelector:Gv}=Qv;let ju=!1;const Xv=e=>e;function Yv(e,t=Xv,n){(U0?"production":void 0)!=="production"&&n&&!ju&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),ju=!0);const r=Gv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Jv(r),r}const ku=e=>{(U0?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Ev(e):e,n=(r,a)=>Yv(t,r,a);return Object.assign(n,t),n},B0=e=>e?ku(e):ku,Zv={};function ew(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var l;const i=c=>c===null?null:JSON.parse(c,void 0),o=(l=n.getItem(a))!=null?l:null;return o instanceof Promise?o.then(i):i(o)},setItem:(a,l)=>n.setItem(a,JSON.stringify(l,void 0)),removeItem:a=>n.removeItem(a)}}const Fr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Fr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Fr(r)(n)}}}},tw=(e,t)=>(n,r,a)=>{let l={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:k=>k,version:0,merge:(k,y)=>({...y,...k}),...t},i=!1;const o=new Set,c=new Set;let d;try{d=l.getStorage()}catch{}if(!d)return e((...k)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...k)},r,a);const m=Fr(l.serialize),f=()=>{const k=l.partialize({...r()});let y;const u=m({state:k,version:l.version}).then(g=>d.setItem(l.name,g)).catch(g=>{y=g});if(y)throw y;return u},p=a.setState;a.setState=(k,y)=>{p(k,y),f()};const N=e((...k)=>{n(...k),f()},r,a);let v;const w=()=>{var k;if(!d)return;i=!1,o.forEach(u=>u(r()));const y=((k=l.onRehydrateStorage)==null?void 0:k.call(l,r()))||void 0;return Fr(d.getItem.bind(d))(l.name).then(u=>{if(u)return l.deserialize(u)}).then(u=>{if(u)if(typeof u.version=="number"&&u.version!==l.version){if(l.migrate)return l.migrate(u.state,u.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return u.state}).then(u=>{var g;return v=l.merge(u,(g=r())!=null?g:N),n(v,!0),f()}).then(()=>{y==null||y(v,void 0),i=!0,c.forEach(u=>u(v))}).catch(u=>{y==null||y(void 0,u)})};return a.persist={setOptions:k=>{l={...l,...k},k.getStorage&&(d=k.getStorage())},clearStorage:()=>{d==null||d.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>w(),hasHydrated:()=>i,onHydrate:k=>(o.add(k),()=>{o.delete(k)}),onFinishHydration:k=>(c.add(k),()=>{c.delete(k)})},w(),v||N},nw=(e,t)=>(n,r,a)=>{let l={storage:ew(()=>localStorage),partialize:w=>w,version:0,merge:(w,k)=>({...k,...w}),...t},i=!1;const o=new Set,c=new Set;let d=l.storage;if(!d)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...w)},r,a);const m=()=>{const w=l.partialize({...r()});return d.setItem(l.name,{state:w,version:l.version})},f=a.setState;a.setState=(w,k)=>{f(w,k),m()};const p=e((...w)=>{n(...w),m()},r,a);a.getInitialState=()=>p;let N;const v=()=>{var w,k;if(!d)return;i=!1,o.forEach(u=>{var g;return u((g=r())!=null?g:p)});const y=((k=l.onRehydrateStorage)==null?void 0:k.call(l,(w=r())!=null?w:p))||void 0;return Fr(d.getItem.bind(d))(l.name).then(u=>{if(u)if(typeof u.version=="number"&&u.version!==l.version){if(l.migrate)return[!0,l.migrate(u.state,u.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,u.state];return[!1,void 0]}).then(u=>{var g;const[_,L]=u;if(N=l.merge(L,(g=r())!=null?g:p),n(N,!0),_)return m()}).then(()=>{y==null||y(N,void 0),N=r(),i=!0,c.forEach(u=>u(N))}).catch(u=>{y==null||y(void 0,u)})};return a.persist={setOptions:w=>{l={...l,...w},w.storage&&(d=w.storage)},clearStorage:()=>{d==null||d.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>v(),hasHydrated:()=>i,onHydrate:w=>(o.add(w),()=>{o.delete(w)}),onFinishHydration:w=>(c.add(w),()=>{c.delete(w)})},l.skipHydration||v(),N||p},sw=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Zv?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),tw(e,t)):nw(e,t),rw=sw,aw=B0()(rw((e,t)=>({currentScan:null,scans:[],endpoints:[],vulnerabilities:[],logs:[],agentTasks:[],scanDataCache:{},isLoading:!1,error:null,setCurrentScan:n=>e({currentScan:n}),setScans:n=>e({scans:n}),updateScan:(n,r)=>e(a=>{var l;return{currentScan:((l=a.currentScan)==null?void 0:l.id)===n?{...a.currentScan,...r}:a.currentScan,scans:a.scans.map(i=>i.id===n?{...i,...r}:i)}}),addEndpoint:n=>e(r=>r.endpoints.some(l=>l.id===n.id||l.url===n.url&&l.method===n.method)?r:{endpoints:[...r.endpoints,n]}),addVulnerability:n=>e(r=>r.vulnerabilities.some(l=>l.id===n.id)?r:{vulnerabilities:[...r.vulnerabilities,n]}),setEndpoints:n=>e({endpoints:n}),setVulnerabilities:n=>e({vulnerabilities:n}),addLog:(n,r)=>e(a=>({logs:[...a.logs,{level:n,message:r,time:new Date().toISOString()}].slice(-200)})),setLogs:n=>e({logs:n}),addAgentTask:n=>e(r=>r.agentTasks.some(l=>l.id===n.id)?{agentTasks:r.agentTasks.map(l=>l.id===n.id?n:l)}:{agentTasks:[...r.agentTasks,n]}),updateAgentTask:(n,r)=>e(a=>({agentTasks:a.agentTasks.map(l=>l.id===n?{...l,...r}:l)})),setAgentTasks:n=>e({agentTasks:n}),setLoading:n=>e({isLoading:n}),setError:n=>e({error:n}),loadScanData:n=>{const a=t().scanDataCache[n];a&&e({endpoints:a.endpoints,vulnerabilities:a.vulnerabilities,logs:a.logs,agentTasks:a.agentTasks||[]})},saveScanData:n=>{const r=t();e({scanDataCache:{...r.scanDataCache,[n]:{endpoints:r.endpoints,vulnerabilities:r.vulnerabilities,logs:r.logs,agentTasks:r.agentTasks}}})},reset:()=>e({currentScan:null,scans:[],endpoints:[],vulnerabilities:[],logs:[],agentTasks:[],scanDataCache:{},isLoading:!1,error:null}),resetCurrentScan:()=>e({endpoints:[],vulnerabilities:[],logs:[],agentTasks:[]}),getVulnCounts:()=>{const n=t().vulnerabilities;return{critical:n.filter(r=>r.severity==="critical").length,high:n.filter(r=>r.severity==="high").length,medium:n.filter(r=>r.severity==="medium").length,low:n.filter(r=>r.severity==="low").length,info:n.filter(r=>r.severity==="info").length}}}),{name:"neurosploit-scan-store",partialize:e=>({scanDataCache:e.scanDataCache,scans:e.scans})})),lw=B0(e=>({stats:null,recentScans:[],recentVulnerabilities:[],isLoading:!1,setStats:t=>e({stats:t}),setRecentScans:t=>e({recentScans:t}),setRecentVulnerabilities:t=>e({recentVulnerabilities:t}),setLoading:t=>e({isLoading:t})}));function iw(){const{stats:e,recentScans:t,recentVulnerabilities:n,setStats:r,setRecentScans:a,setRecentVulnerabilities:l,setLoading:i}=lw(),[o,c]=x.useState([]),d=x.useCallback(async()=>{try{const[p,N,v]=await Promise.all([pi.getStats(),pi.getRecent(5),pi.getActivityFeed(15)]);r(p),a(N.recent_scans),l(N.recent_vulnerabilities),c(v.activities)}catch(p){console.error("Failed to fetch dashboard data:",p)}},[r,a,l]);x.useEffect(()=>{i(!0),d().finally(()=>i(!1));const p=setInterval(d,3e4);return()=>clearInterval(p)},[d,i]);const m=[{label:"Total Scans",value:(e==null?void 0:e.scans.total)||0,icon:l0,color:"text-blue-400",bgColor:"bg-blue-500/10"},{label:"Running",value:(e==null?void 0:e.scans.running)||0,icon:Ke,color:"text-green-400",bgColor:"bg-green-500/10"},{label:"Completed",value:(e==null?void 0:e.scans.completed)||0,icon:Wt,color:"text-emerald-400",bgColor:"bg-emerald-500/10"},{label:"Stopped",value:(e==null?void 0:e.scans.stopped)||0,icon:es,color:"text-yellow-400",bgColor:"bg-yellow-500/10"}],f=[{label:"Total Vulns",value:(e==null?void 0:e.vulnerabilities.total)||0,icon:Oe,color:"text-red-400",bgColor:"bg-red-500/10"},{label:"Critical",value:(e==null?void 0:e.vulnerabilities.critical)||0,icon:Oe,color:"text-red-500",bgColor:"bg-red-600/10"},{label:"High",value:(e==null?void 0:e.vulnerabilities.high)||0,icon:Oe,color:"text-orange-400",bgColor:"bg-orange-500/10"},{label:"Medium",value:(e==null?void 0:e.vulnerabilities.medium)||0,icon:Oe,color:"text-yellow-400",bgColor:"bg-yellow-500/10"}];return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-white",children:"Welcome to NeuroSploit"}),s.jsx("p",{className:"text-dark-400 mt-1",children:"AI-Powered Penetration Testing Platform"})]}),s.jsx(nn,{to:"/scan/new",children:s.jsxs(H,{size:"lg",children:[s.jsx(Gt,{className:"w-5 h-5 mr-2"}),"New Scan"]})})]}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:m.map(p=>s.jsx(re,{className:"hover:border-dark-700 transition-colors",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:`p-3 rounded-lg ${p.bgColor}`,children:s.jsx(p.icon,{className:`w-6 h-6 ${p.color}`})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:p.value}),s.jsx("p",{className:"text-sm text-dark-400",children:p.label})]})]})},p.label))}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:f.map(p=>s.jsx(re,{className:"hover:border-dark-700 transition-colors",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:`p-3 rounded-lg ${p.bgColor}`,children:s.jsx(p.icon,{className:`w-6 h-6 ${p.color}`})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:p.value}),s.jsx("p",{className:"text-sm text-dark-400",children:p.label})]})]})},p.label))}),e&&e.vulnerabilities.total>0&&s.jsxs(re,{title:"Vulnerability Distribution",children:[s.jsxs("div",{className:"flex h-8 rounded-lg overflow-hidden",children:[e.vulnerabilities.critical>0&&s.jsx("div",{className:"bg-red-500 flex items-center justify-center text-white text-xs font-medium",style:{width:`${e.vulnerabilities.critical/e.vulnerabilities.total*100}%`},children:e.vulnerabilities.critical}),e.vulnerabilities.high>0&&s.jsx("div",{className:"bg-orange-500 flex items-center justify-center text-white text-xs font-medium",style:{width:`${e.vulnerabilities.high/e.vulnerabilities.total*100}%`},children:e.vulnerabilities.high}),e.vulnerabilities.medium>0&&s.jsx("div",{className:"bg-yellow-500 flex items-center justify-center text-white text-xs font-medium",style:{width:`${e.vulnerabilities.medium/e.vulnerabilities.total*100}%`},children:e.vulnerabilities.medium}),e.vulnerabilities.low>0&&s.jsx("div",{className:"bg-blue-500 flex items-center justify-center text-white text-xs font-medium",style:{width:`${e.vulnerabilities.low/e.vulnerabilities.total*100}%`},children:e.vulnerabilities.low})]}),s.jsxs("div",{className:"flex gap-4 mt-3 text-xs",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-3 h-3 rounded bg-red-500"})," Critical"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-3 h-3 rounded bg-orange-500"})," High"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-3 h-3 rounded bg-yellow-500"})," Medium"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-3 h-3 rounded bg-blue-500"})," Low"]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx(re,{title:"Recent Scans",action:s.jsxs(nn,{to:"/reports",className:"text-sm text-primary-500 hover:text-primary-400 flex items-center gap-1",children:["View All ",s.jsx(Gd,{className:"w-4 h-4"})]}),children:s.jsx("div",{className:"space-y-3",children:t.length===0?s.jsx("p",{className:"text-dark-400 text-center py-4",children:"No scans yet. Start your first scan!"}):t.map(p=>s.jsxs(nn,{to:`/scan/${p.id}`,className:"flex items-center justify-between p-3 bg-dark-900/50 rounded-lg hover:bg-dark-900 transition-colors",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:p.name||"Unnamed Scan"}),s.jsx("p",{className:"text-xs text-dark-400",children:new Date(p.created_at).toLocaleDateString()})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ts,{severity:p.status}),s.jsxs("span",{className:"text-sm text-dark-400",children:[p.total_vulnerabilities," vulns"]})]})]},p.id))})}),s.jsx(re,{title:"Recent Findings",action:s.jsxs(nn,{to:"/reports",className:"text-sm text-primary-500 hover:text-primary-400 flex items-center gap-1",children:["View All ",s.jsx(Gd,{className:"w-4 h-4"})]}),children:s.jsx("div",{className:"space-y-3",children:n.length===0?s.jsx("p",{className:"text-dark-400 text-center py-4",children:"No vulnerabilities found yet."}):n.slice(0,5).map(p=>s.jsxs("div",{className:`flex items-center justify-between p-3 bg-dark-900/50 rounded-lg ${p.validation_status==="ai_rejected"?"opacity-60 border-l-2 border-orange-500/40":p.validation_status==="false_positive"?"opacity-40":""}`,children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-white truncate",children:p.title}),s.jsx("p",{className:"text-xs text-dark-400 truncate",children:p.affected_endpoint})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[p.validation_status==="ai_rejected"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-orange-500/20 text-orange-400",children:"Rejected"}),p.validation_status==="validated"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-green-500/20 text-green-400",children:"Validated"}),p.validation_status==="false_positive"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-dark-600 text-dark-400",children:"FP"}),s.jsx(ts,{severity:p.severity})]})]},p.id))})})]}),s.jsx(re,{title:"Activity Feed",subtitle:"Recent activities across all scans",children:s.jsx("div",{className:"space-y-2 max-h-[400px] overflow-auto",children:o.length===0?s.jsx("p",{className:"text-dark-400 text-center py-4",children:"No recent activity."}):o.map((p,N)=>s.jsxs(nn,{to:p.link,className:"flex items-start gap-3 p-3 bg-dark-900/50 rounded-lg hover:bg-dark-900 transition-colors",children:[s.jsx("div",{className:`mt-0.5 p-2 rounded-lg ${p.type==="scan"?"bg-blue-500/20 text-blue-400":p.type==="vulnerability"?"bg-red-500/20 text-red-400":p.type==="agent_task"?"bg-purple-500/20 text-purple-400":"bg-green-500/20 text-green-400"}`,children:p.type==="scan"?s.jsx(Ke,{className:"w-4 h-4"}):p.type==="vulnerability"?s.jsx(Oe,{className:"w-4 h-4"}):p.type==="agent_task"?s.jsx(il,{className:"w-4 h-4"}):s.jsx(yt,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-dark-500 uppercase font-medium",children:p.type.replace("_"," ")}),s.jsx("span",{className:"text-xs text-dark-600",children:"•"}),s.jsx("span",{className:"text-xs text-dark-500",children:p.action})]}),s.jsx("p",{className:"font-medium text-white truncate mt-0.5",children:p.title}),p.description&&s.jsx("p",{className:"text-xs text-dark-400 truncate",children:p.description})]}),s.jsxs("div",{className:"flex flex-col items-end gap-1",children:[p.severity&&s.jsx(ts,{severity:p.severity}),p.status&&!p.severity&&s.jsx("span",{className:`text-xs px-2 py-0.5 rounded font-medium ${p.status==="completed"?"bg-green-500/20 text-green-400":p.status==="running"?"bg-blue-500/20 text-blue-400":p.status==="failed"?"bg-red-500/20 text-red-400":p.status==="stopped"?"bg-yellow-500/20 text-yellow-400":"bg-dark-700 text-dark-300"}`,children:p.status}),s.jsxs("span",{className:"text-xs text-dark-500 flex items-center gap-1",children:[s.jsx(Xt,{className:"w-3 h-3"}),new Date(p.timestamp).toLocaleTimeString()]})]})]},`${p.type}-${p.timestamp}-${N}`))})})]})}const st=x.forwardRef(({label:e,error:t,helperText:n,className:r,...a},l)=>s.jsxs("div",{className:"w-full",children:[e&&s.jsx("label",{className:"block text-sm font-medium text-dark-200 mb-1.5",children:e}),s.jsx("input",{ref:l,className:Jr("w-full px-4 py-2.5 bg-dark-900 border rounded-lg text-white placeholder-dark-500","focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent","transition-colors",t?"border-red-500":"border-dark-700",r),...a}),t&&s.jsx("p",{className:"mt-1 text-sm text-red-400",children:t}),n&&!t&&s.jsx("p",{className:"mt-1 text-sm text-dark-400",children:n})]}));st.displayName="Input";const Ur=x.forwardRef(({label:e,error:t,helperText:n,className:r,...a},l)=>s.jsxs("div",{className:"w-full",children:[e&&s.jsx("label",{className:"block text-sm font-medium text-dark-200 mb-1.5",children:e}),s.jsx("textarea",{ref:l,className:Jr("w-full px-4 py-2.5 bg-dark-900 border rounded-lg text-white placeholder-dark-500","focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent","transition-colors resize-none",t?"border-red-500":"border-dark-700",r),...a}),t&&s.jsx("p",{className:"mt-1 text-sm text-red-400",children:t}),n&&!t&&s.jsx("p",{className:"mt-1 text-sm text-dark-400",children:n})]}));Ur.displayName="Textarea";const bu=[{id:"full_auto",name:"Full Auto",icon:s.jsx(In,{className:"w-5 h-5"}),description:"Complete workflow: Recon -> Analyze -> Test -> Report",color:"primary"},{id:"recon_only",name:"Recon Only",icon:s.jsx(Qr,{className:"w-5 h-5"}),description:"Reconnaissance and enumeration only, no vulnerability testing",color:"blue"},{id:"prompt_only",name:"AI Prompt Mode",icon:s.jsx(Mt,{className:"w-5 h-5"}),description:"AI decides everything based on your prompt - full autonomy",warning:"HIGH TOKEN USAGE - The AI will use more API calls to decide what to do",color:"purple"},{id:"analyze_only",name:"Analyze Only",icon:s.jsx(Kt,{className:"w-5 h-5"}),description:"Analyze provided data without active testing",color:"green"}],ow=[{id:"all",name:"All Tasks"},{id:"full_auto",name:"Full Auto"},{id:"recon",name:"Reconnaissance"},{id:"vulnerability",name:"Vulnerability"},{id:"custom",name:"Custom"},{id:"reporting",name:"Reporting"}];function cw(){const e=Bn(),t=x.useRef(null),[n,r]=x.useState("single"),[a,l]=x.useState(""),[i,o]=x.useState(""),[c,d]=x.useState([]),[m,f]=x.useState(""),[p,N]=x.useState("full_auto"),[v,w]=x.useState([]),[k,y]=x.useState(null),[u,g]=x.useState("all"),[_,L]=x.useState(!1),[D,R]=x.useState(!1),[E,U]=x.useState(!1),[q,A]=x.useState(""),[te,Q]=x.useState(!1),[ne,ae]=x.useState("none"),[ce,xe]=x.useState(""),[z,Y]=x.useState(5),[se,V]=x.useState(!1);x.useEffect(()=>{G()},[]);const G=async M=>{R(!0);try{const me=await we.tasks.list(M==="all"?void 0:M);w(me)}catch(me){console.error("Failed to load tasks:",me)}finally{R(!1)}},ge=M=>{g(M),G(M)},he=async M=>{var de;const me=(de=M.target.files)==null?void 0:de[0];if(me)try{const h=(await yu.upload(me)).filter(b=>b.valid).map(b=>b.normalized_url);d(h),f("")}catch{f("Failed to parse file")}},ke=()=>{var M;switch(n){case"single":return a.trim();case"multiple":return((M=i.split(/[,\n]/)[0])==null?void 0:M.trim())||"";case"file":return c[0]||"";default:return""}},P=async()=>{var me;const M=ke();if(!M){f("Please enter a target URL");return}V(!0);try{const de=await yu.validateBulk([M]);if(!((me=de[0])!=null&&me.valid)){f("Invalid URL format"),V(!1);return}const S={target:de[0].normalized_url,mode:p,max_depth:z};k&&!E?S.task_id=k.id:E&&q.trim()&&(S.prompt=q),ne!=="none"&&ce.trim()&&(S.auth_type=ne,S.auth_value=ce);const h=await we.run(S);e(`/agent/${h.agent_id}`)}catch(de){console.error("Failed to start agent:",de),f("Failed to start agent. Please try again.")}finally{V(!1)}},X=bu.find(M=>M.id===p);return s.jsxs("div",{className:"max-w-5xl mx-auto space-y-6 animate-fadeIn",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"text-3xl font-bold text-white flex items-center gap-3",children:[s.jsx(In,{className:"w-8 h-8 text-primary-500"}),"AI Security Agent"]}),s.jsx("p",{className:"text-dark-400 mt-1",children:"Autonomous penetration testing powered by AI"})]})}),s.jsx(re,{title:"Operation Mode",subtitle:"Select how the AI agent should operate",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:bu.map(M=>s.jsxs("div",{onClick:()=>N(M.id),className:`p-4 rounded-xl border-2 cursor-pointer transition-all ${p===M.id?`border-${M.color}-500 bg-${M.color}-500/10`:"border-dark-700 hover:border-dark-500 bg-dark-900/50"}`,children:[s.jsxs("div",{className:`flex items-center gap-2 mb-2 ${p===M.id?`text-${M.color}-400`:"text-dark-300"}`,children:[M.icon,s.jsx("span",{className:"font-semibold",children:M.name})]}),s.jsx("p",{className:"text-sm text-dark-400",children:M.description}),M.warning&&p===M.id&&s.jsxs("div",{className:"mt-2 flex items-start gap-2 text-yellow-400 text-xs",children:[s.jsx(Oe,{className:"w-4 h-4 flex-shrink-0"}),s.jsx("span",{children:M.warning})]})]},M.id))})}),s.jsx(re,{title:"Target",subtitle:"Enter the URL to test",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(H,{variant:n==="single"?"primary":"secondary",onClick:()=>r("single"),children:[s.jsx(Og,{className:"w-4 h-4 mr-2"}),"Single URL"]}),s.jsxs(H,{variant:n==="multiple"?"primary":"secondary",onClick:()=>r("multiple"),children:[s.jsx(yt,{className:"w-4 h-4 mr-2"}),"Multiple URLs"]}),s.jsxs(H,{variant:n==="file"?"primary":"secondary",onClick:()=>r("file"),children:[s.jsx(tu,{className:"w-4 h-4 mr-2"}),"Upload File"]})]}),n==="single"&&s.jsx(st,{placeholder:"https://example.com",value:a,onChange:M=>{l(M.target.value),f("")},error:m}),n==="multiple"&&s.jsxs("div",{children:[s.jsx(Ur,{placeholder:`Enter URLs separated by commas or new lines: +https://example1.com +https://example2.com`,rows:5,value:i,onChange:M=>{o(M.target.value),f("")}}),s.jsx("p",{className:"text-xs text-dark-500 mt-1",children:"Note: Agent will test the first URL. Multiple URL support coming soon."}),m&&s.jsx("p",{className:"mt-1 text-sm text-red-400",children:m})]}),n==="file"&&s.jsxs("div",{children:[s.jsx("input",{type:"file",ref:t,onChange:he,accept:".txt,.csv,.lst",className:"hidden"}),s.jsxs("div",{onClick:()=>{var M;return(M=t.current)==null?void 0:M.click()},className:"border-2 border-dashed border-dark-700 rounded-lg p-8 text-center cursor-pointer hover:border-primary-500 transition-colors",children:[s.jsx(tu,{className:"w-10 h-10 mx-auto text-dark-400 mb-3"}),s.jsx("p",{className:"text-dark-300",children:"Click to upload a file with URLs"}),s.jsx("p",{className:"text-sm text-dark-500 mt-1",children:"Supports .txt, .csv, .lst files"})]}),c.length>0&&s.jsxs("p",{className:"mt-2 text-sm text-green-400",children:[c.length," valid URLs loaded - using first URL"]}),m&&s.jsx("p",{className:"mt-2 text-sm text-red-400",children:m})]})]})}),s.jsxs(re,{title:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nc,{className:"w-5 h-5 text-primary-500"}),s.jsx("span",{children:"Task Library"})]}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>L(!_),children:s.jsx(pt,{className:`w-4 h-4 transition-transform ${_?"rotate-180":""}`})})]}),subtitle:"Select a preset task or create a custom prompt",children:[s.jsx("div",{className:"flex items-center justify-between mb-4 pb-4 border-b border-dark-700",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"checkbox",id:"customPrompt",checked:E,onChange:M=>U(M.target.checked),className:"w-4 h-4 rounded border-dark-600 bg-dark-800 text-primary-500 focus:ring-primary-500"}),s.jsx("label",{htmlFor:"customPrompt",className:"text-white",children:"Use custom prompt instead of task"})]})}),E?s.jsx(Ur,{placeholder:`Enter your custom prompt for the AI agent... + +Example: Test for SQL injection on all form inputs, check for authentication bypass on the login endpoint, and look for IDOR vulnerabilities in user profile APIs.`,rows:6,value:q,onChange:M=>A(M.target.value)}):s.jsxs(s.Fragment,{children:[_&&s.jsx(s.Fragment,{children:s.jsx("div",{className:"flex gap-2 mb-4 flex-wrap",children:ow.map(M=>s.jsx(H,{variant:u===M.id?"primary":"secondary",size:"sm",onClick:()=>ge(M.id),children:M.name},M.id))})}),s.jsx("div",{className:`grid grid-cols-1 md:grid-cols-2 gap-3 ${_?"max-h-80 overflow-auto":""}`,children:D?s.jsx("p",{className:"text-dark-400 col-span-2 text-center py-4",children:"Loading tasks..."}):(_?v:v.slice(0,4)).map(M=>{var me;return s.jsxs("div",{onClick:()=>y(M),className:`p-4 rounded-lg border cursor-pointer transition-all ${(k==null?void 0:k.id)===M.id?"border-primary-500 bg-primary-500/10":"border-dark-700 hover:border-dark-500 bg-dark-900/50"}`,children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("span",{className:"font-medium text-white",children:M.name}),M.is_preset&&s.jsx("span",{className:"text-xs bg-primary-500/20 text-primary-400 px-2 py-0.5 rounded",children:"Preset"})]}),s.jsx("p",{className:"text-sm text-dark-400 line-clamp-2",children:M.description}),s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-xs text-dark-500",children:M.category}),M.estimated_tokens>0&&s.jsxs("span",{className:"text-xs text-dark-500",children:["~",M.estimated_tokens," tokens"]})]}),((me=M.tags)==null?void 0:me.length)>0&&s.jsx("div",{className:"flex gap-1 mt-2 flex-wrap",children:M.tags.slice(0,3).map(de=>s.jsx("span",{className:"text-xs bg-dark-700 text-dark-300 px-2 py-0.5 rounded",children:de},de))})]},M.id)})}),!_&&v.length>4&&s.jsxs(H,{variant:"ghost",className:"w-full mt-3",onClick:()=>L(!0),children:["Show all ",v.length," tasks"]})]}),k&&!E&&s.jsxs("div",{className:"mt-4 p-4 bg-dark-800 rounded-lg border border-dark-700",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("span",{className:"font-medium text-white",children:["Selected: ",k.name]}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>y(null),children:"Clear"})]}),s.jsx("p",{className:"text-sm text-dark-400 whitespace-pre-wrap line-clamp-4",children:k.prompt})]})]}),s.jsx(re,{title:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ag,{className:"w-5 h-5 text-primary-500"}),s.jsx("span",{children:"Authentication"}),s.jsx("span",{className:"text-xs text-dark-500",children:"(Optional)"})]}),children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex gap-2 flex-wrap",children:[{id:"none",label:"None"},{id:"cookie",label:"Cookie"},{id:"bearer",label:"Bearer Token"},{id:"basic",label:"Basic Auth"},{id:"header",label:"Custom Header"}].map(M=>s.jsx(H,{variant:ne===M.id?"primary":"secondary",size:"sm",onClick:()=>ae(M.id),children:M.label},M.id))}),ne!=="none"&&s.jsx(st,{placeholder:ne==="cookie"?"session=abc123; token=xyz789":ne==="bearer"?"eyJhbGciOiJIUzI1NiIs...":ne==="basic"?"username:password":"X-API-Key: your-api-key",value:ce,onChange:M=>xe(M.target.value),label:ne==="cookie"?"Cookie String":ne==="bearer"?"Bearer Token":ne==="basic"?"Username:Password":"Header:Value"})]})}),s.jsxs(re,{title:s.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>Q(!te),children:[s.jsx(p0,{className:"w-5 h-5 text-primary-500"}),s.jsx("span",{children:"Advanced Options"}),s.jsx(pt,{className:`w-4 h-4 transition-transform ${te?"rotate-180":""}`})]}),children:[te&&s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{children:[s.jsx("label",{className:"text-sm text-dark-300 mb-1 block",children:"Max Crawl Depth"}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("input",{type:"range",min:"1",max:"10",value:z,onChange:M=>Y(parseInt(M.target.value)),className:"flex-1"}),s.jsx("span",{className:"text-white font-medium w-8",children:z})]})]})}),!te&&s.jsx("p",{className:"text-dark-500 text-sm",children:"Click to expand advanced options"})]}),p==="prompt_only"&&s.jsxs("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-4 flex items-start gap-3",children:[s.jsx(Oe,{className:"w-6 h-6 text-yellow-500 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-yellow-400",children:"High Token Usage Warning"}),s.jsx("p",{className:"text-sm text-yellow-300/80 mt-1",children:"In AI Prompt Mode, the agent has full autonomy to decide what tools to use and what tests to run. This results in significantly higher API token consumption. Consider using Full Auto mode for most use cases."})]})]}),s.jsxs("div",{className:"flex justify-end gap-3 sticky bottom-4 bg-dark-950/90 backdrop-blur p-4 -mx-4 rounded-lg",children:[s.jsx(H,{variant:"secondary",onClick:()=>e("/"),children:"Cancel"}),s.jsxs(H,{onClick:P,isLoading:se,size:"lg",children:[s.jsx(Yt,{className:"w-5 h-5 mr-2"}),"Deploy Agent (",X.name,")"]})]})]})}class dw{constructor(){Hn(this,"ws",null);Hn(this,"handlers",new Map);Hn(this,"reconnectAttempts",0);Hn(this,"maxReconnectAttempts",5);Hn(this,"reconnectDelay",1e3);Hn(this,"scanId",null)}connect(t){var a;if(((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.scanId===t)return;this.disconnect(),this.scanId=t;const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/scan/${t}`;try{this.ws=new WebSocket(r),this.ws.onopen=()=>{console.log("WebSocket connected"),this.reconnectAttempts=0},this.ws.onmessage=l=>{try{const i=JSON.parse(l.data);this.notifyHandlers(i.type,i),this.notifyHandlers("*",i)}catch(i){console.error("Failed to parse WebSocket message:",i)}},this.ws.onclose=()=>{console.log("WebSocket disconnected"),this.attemptReconnect()},this.ws.onerror=l=>{console.error("WebSocket error:",l)}}catch(l){console.error("Failed to create WebSocket:",l)}}disconnect(){this.ws&&(this.ws.close(),this.ws=null),this.scanId=null}attemptReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts||!this.scanId)return;this.reconnectAttempts++;const t=this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1);setTimeout(()=>{this.scanId&&(console.log(`Attempting reconnect (${this.reconnectAttempts}/${this.maxReconnectAttempts})...`),this.connect(this.scanId))},t)}subscribe(t,n){return this.handlers.has(t)||this.handlers.set(t,new Set),this.handlers.get(t).add(n),()=>{var r;(r=this.handlers.get(t))==null||r.delete(n)}}notifyHandlers(t,n){const r=this.handlers.get(t);r&&r.forEach(a=>{try{a(n)}catch(l){console.error("Handler error:",l)}})}send(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(typeof t=="string"?t:JSON.stringify(t))}ping(){this.send("ping")}}const xi=new dw;function Nu(e){let t=null;if(typeof e.confidence_score=="number")t=e.confidence_score;else if(e.confidence){const a=Number(e.confidence);isNaN(a)?t={high:90,medium:60,low:30}[e.confidence.toLowerCase()]??null:t=a}if(t===null)return null;const n=t>=90?"green":t>=60?"yellow":"red",r=t>=90?"Confirmed":t>=60?"Likely":"Low";return{score:t,color:n,label:r}}const Su={green:"bg-green-500/15 text-green-400 border-green-500/30",yellow:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",red:"bg-red-500/15 text-red-400 border-red-500/30"};function uw(){const{scanId:e}=bc(),t=Bn(),{currentScan:n,endpoints:r,vulnerabilities:a,logs:l,agentTasks:i,setCurrentScan:o,setEndpoints:c,setVulnerabilities:d,addEndpoint:m,addVulnerability:f,addLog:p,updateScan:N,addAgentTask:v,updateAgentTask:w,setAgentTasks:k,loadScanData:y,saveScanData:u,getVulnCounts:g}=aw(),[_,L]=x.useState(!1),[D,R]=x.useState(new Set),[E,U]=x.useState("vulns"),[q,A]=x.useState(!0),[te,Q]=x.useState(null),[ne,ae]=x.useState(null),[ce,xe]=x.useState(null),[z,Y]=x.useState(null),[se,V]=x.useState(new Set),[G,ge]=x.useState("all"),he=x.useMemo(()=>g(),[a]);x.useEffect(()=>{if(!e)return;y(e),(async()=>{var O,J,C,j,K,F;A(!0),Q(null);try{const ie=await At.get(e);o(ie);const[pe,Te,ve,kt]=await Promise.all([At.getEndpoints(e),At.getVulnerabilities(e),vu.list(e).catch(()=>({tasks:[]})),We.list({scanId:e,autoGenerated:!0}).catch(()=>({reports:[]}))]);if(((O=pe.endpoints)==null?void 0:O.length)>0&&c(pe.endpoints),((J=Te.vulnerabilities)==null?void 0:J.length)>0&&d(Te.vulnerabilities),((C=ve.tasks)==null?void 0:C.length)>0&&k(ve.tasks),((j=kt.reports)==null?void 0:j.length)>0&&ae(kt.reports[0]),!Te.vulnerabilities||Te.vulnerabilities.length===0){const Se=await we.getByScan(e);if(Se){if(xe(Se),Se.findings&&Se.findings.length>0){const ye=le=>({id:le.id,scan_id:e,title:le.title,vulnerability_type:le.vulnerability_type,severity:le.severity,cvss_score:le.cvss_score||null,cvss_vector:le.cvss_vector||null,cwe_id:le.cwe_id||null,description:le.description||null,affected_endpoint:le.affected_endpoint||null,poc_request:le.request||null,poc_response:le.response||null,poc_payload:le.payload||null,poc_parameter:le.parameter||null,poc_evidence:le.evidence||null,poc_code:le.poc_code||null,impact:le.impact||null,remediation:le.remediation||null,references:le.references||[],ai_analysis:le.evidence||null,validation_status:le.ai_status==="rejected"?"ai_rejected":"ai_confirmed",ai_rejection_reason:le.rejection_reason||null,confidence_score:le.confidence_score,confidence_breakdown:le.confidence_breakdown,proof_of_execution:le.proof_of_execution,negative_controls:le.negative_controls,created_at:new Date().toISOString()}),Vn=Se.findings.map(ye),$=(Se.rejected_findings||[]).map(ye),oe=[...Vn,...$];d(oe)}Se.progress!==void 0&&N(e,{progress:Se.progress,current_phase:Se.phase})}}}catch(ie){console.error("Failed to fetch scan:",ie),Q(((F=(K=ie==null?void 0:ie.response)==null?void 0:K.data)==null?void 0:F.detail)||"Failed to load scan")}finally{A(!1)}})();const b=setInterval(async()=>{var O,J,C;if((n==null?void 0:n.status)==="running"||(n==null?void 0:n.status)==="paused"||!n)try{const j=await At.get(e);o(j);const[K,F,ie]=await Promise.all([At.getEndpoints(e),At.getVulnerabilities(e),vu.list(e).catch(()=>({tasks:[]}))]);if(((O=K.endpoints)==null?void 0:O.length)>0&&c(K.endpoints),((J=F.vulnerabilities)==null?void 0:J.length)>0&&d(F.vulnerabilities),((C=ie.tasks)==null?void 0:C.length)>0&&k(ie.tasks),!F.vulnerabilities||F.vulnerabilities.length===0){const pe=await we.getByScan(e);if(pe){if(xe(pe),pe.findings&&pe.findings.length>0){const Te=ye=>({id:ye.id,scan_id:e,title:ye.title,vulnerability_type:ye.vulnerability_type,severity:ye.severity,cvss_score:ye.cvss_score||null,cvss_vector:ye.cvss_vector||null,cwe_id:ye.cwe_id||null,description:ye.description||null,affected_endpoint:ye.affected_endpoint||null,poc_request:ye.request||null,poc_response:ye.response||null,poc_payload:ye.payload||null,poc_parameter:ye.parameter||null,poc_evidence:ye.evidence||null,poc_code:ye.poc_code||null,impact:ye.impact||null,remediation:ye.remediation||null,references:ye.references||[],ai_analysis:ye.evidence||null,validation_status:ye.ai_status==="rejected"?"ai_rejected":"ai_confirmed",ai_rejection_reason:ye.rejection_reason||null,confidence_score:ye.confidence_score,confidence_breakdown:ye.confidence_breakdown,proof_of_execution:ye.proof_of_execution,negative_controls:ye.negative_controls,created_at:new Date().toISOString()}),ve=pe.findings.map(Te),kt=(pe.rejected_findings||[]).map(Te),Se=[...ve,...kt];d(Se)}pe.progress!==void 0&&N(e,{progress:pe.progress,current_phase:pe.phase})}}}catch(j){console.error("Poll error:",j)}},8e3);xi.connect(e);const I=xi.subscribe("*",O=>{switch(O.type){case"progress_update":N(e,{progress:O.progress,current_phase:O.message});break;case"phase_change":{const J=O.phase;N(e,{current_phase:J}),p("info",`Phase: ${J}`),J.endsWith("_skipped")&&V(C=>new Set([...C,J.replace("_skipped","")]));break}case"endpoint_found":m(O.endpoint);break;case"vuln_found":f(O.vulnerability),p("warning",`Found: ${O.vulnerability.title}`);break;case"stats_update":if(O.stats){const J=O.stats;N(e,{total_vulnerabilities:J.total_vulnerabilities,critical_count:J.critical,high_count:J.high,medium_count:J.medium,low_count:J.low,info_count:J.info,total_endpoints:J.total_endpoints})}break;case"log_message":p(O.level,O.message);break;case"scan_completed":N(e,{status:"completed",progress:100}),p("info","Scan completed"),u(e);break;case"scan_stopped":if(O.summary){const J=O.summary;N(e,{status:"stopped",progress:J.progress||(n==null?void 0:n.progress),total_vulnerabilities:J.total_vulnerabilities,critical_count:J.critical,high_count:J.high,medium_count:J.medium,low_count:J.low,info_count:J.info,total_endpoints:J.total_endpoints,duration:J.duration})}else N(e,{status:"stopped"});p("warning","Scan stopped by user"),u(e);break;case"scan_failed":N(e,{status:"failed"}),p("error",`Scan failed: ${O.error||"Unknown error"}`),u(e);break;case"agent_task":case"agent_task_started":O.task&&v(O.task);break;case"agent_task_completed":if(O.task){const J=O.task;w(J.id,J)}break;case"report_generated":if(O.report){const J=O.report;ae(J),p("info",`Report generated: ${J.title}`)}break;case"error":p("error",O.error);break}});return()=>{u(e),I(),xi.disconnect(),clearInterval(b)}},[e]);const ke=async()=>{if(e)try{await At.stop(e),N(e,{status:"stopped"}),u(e)}catch(h){console.error("Failed to stop scan:",h)}},P=async()=>{if(e)try{await At.pause(e),N(e,{status:"paused"})}catch(h){console.error("Failed to pause scan:",h)}},X=async()=>{if(e)try{await At.resume(e),N(e,{status:"running"})}catch(h){console.error("Failed to resume scan:",h)}},M=async h=>{if(e)try{await At.skipToPhase(e,h),Y(null)}catch(b){console.error("Failed to skip phase:",b)}},me=async()=>{if(e){L(!0);try{const h=await We.generate({scan_id:e,format:"html",include_poc:!0,include_remediation:!0});window.open(We.getViewUrl(h.id),"_blank")}catch(h){console.error("Failed to generate report:",h)}finally{L(!1)}}},de=h=>{const b=new Set(D);b.has(h)?b.delete(h):b.add(h),R(b)},S=h=>{navigator.clipboard.writeText(h)};return q?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx(ln,{className:"w-8 h-8 animate-spin text-primary-500"})}):te?s.jsxs("div",{className:"flex flex-col items-center justify-center h-64",children:[s.jsx(Oe,{className:"w-12 h-12 text-red-500 mb-4"}),s.jsx("p",{className:"text-xl text-white mb-2",children:"Failed to load scan"}),s.jsx("p",{className:"text-dark-400 mb-4",children:te}),s.jsx(H,{onClick:()=>t("/"),children:"Go to Dashboard"})]}):n?s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[s.jsx(Ke,{className:"w-6 h-6 text-primary-500"}),n.name||"Unnamed Scan"]}),s.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[s.jsx(ts,{severity:n.status}),s.jsxs("span",{className:"text-dark-400",children:["Started ",new Date(n.created_at).toLocaleString()]})]})]}),s.jsxs("div",{className:"flex gap-2",children:[(ce==null?void 0:ce.agent_id)&&s.jsxs(H,{variant:"secondary",onClick:()=>t(`/agent/${ce.agent_id}`),children:[s.jsx(il,{className:"w-4 h-4 mr-2"}),"Agent View"]}),n.status==="running"&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"secondary",onClick:P,children:[s.jsx(cl,{className:"w-4 h-4 mr-2"}),"Pause"]}),s.jsxs(H,{variant:"danger",onClick:ke,children:[s.jsx(es,{className:"w-4 h-4 mr-2"}),"Stop"]})]}),n.status==="paused"&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"primary",onClick:X,children:[s.jsx(Yt,{className:"w-4 h-4 mr-2"}),"Resume"]}),s.jsxs(H,{variant:"danger",onClick:ke,children:[s.jsx(es,{className:"w-4 h-4 mr-2"}),"Stop"]})]}),ne&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"secondary",onClick:()=>window.open(We.getViewUrl(ne.id),"_blank"),children:[s.jsx(yt,{className:"w-4 h-4 mr-2"}),"View Report"]}),s.jsxs(H,{variant:"secondary",onClick:()=>window.open(We.getDownloadZipUrl(ne.id),"_blank"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Download ZIP"]})]}),(n.status==="completed"||n.status==="stopped")&&s.jsxs(H,{onClick:me,isLoading:_,children:[s.jsx(yt,{className:"w-4 h-4 mr-2"}),ne?"New Report":"Generate Report"]})]})]}),(n.status==="running"||n.status==="paused"||n.status==="completed"||n.status==="stopped")&&(()=>{const h=[{id:"initializing",label:"Init",fullLabel:"Initialization"},{id:"recon",label:"Recon",fullLabel:"Reconnaissance"},{id:"analyzing",label:"Analysis",fullLabel:"AI Analysis"},{id:"testing",label:"Testing",fullLabel:"Vulnerability Testing"},{id:"completed",label:"Done",fullLabel:"Completed"}],b=h.map(j=>j.id),I=n.current_phase||"initializing",O=I.startsWith("skipping_to_")?I.replace("skipping_to_",""):I.replace("_skipped",""),J=b.indexOf(O),C=n.status==="running"||n.status==="paused";return s.jsx(re,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center justify-between relative",children:h.map((j,K)=>{const F=KJ&&C&&j.id!=="initializing";return s.jsxs("div",{className:"flex items-center flex-1 last:flex-none",children:[s.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[ve?z===j.id?s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>M(j.id),className:"w-9 h-9 rounded-full bg-brand-500 text-white flex items-center justify-center hover:bg-brand-400 transition-colors",title:`Skip to ${j.fullLabel}`,children:s.jsx(Yd,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>Y(null),className:"w-7 h-7 rounded-full bg-dark-600 text-dark-300 flex items-center justify-center hover:bg-dark-500 transition-colors",children:s.jsx(Ct,{className:"w-3.5 h-3.5"})})]}):s.jsxs("button",{onClick:()=>Y(j.id),className:"w-9 h-9 rounded-full border-2 border-dark-500 bg-dark-800 text-dark-400 flex items-center justify-center hover:border-brand-400 hover:text-brand-400 hover:bg-brand-500/10 transition-all group",title:`Skip to ${j.fullLabel}`,children:[s.jsx(m0,{className:"w-4 h-4 opacity-0 group-hover:opacity-100 transition-opacity"}),s.jsx("span",{className:"absolute text-[10px] group-hover:hidden",children:K+1})]}):F?s.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center ${pe?"bg-yellow-500/20 border-2 border-yellow-500/50":"bg-green-500/20 border-2 border-green-500/50"}`,children:pe?s.jsx(Mg,{className:"w-4 h-4 text-yellow-400"}):s.jsx(Yd,{className:"w-4 h-4 text-green-400"})}):ie?s.jsx("div",{className:"w-9 h-9 rounded-full bg-brand-500/20 border-2 border-brand-500 flex items-center justify-center animate-pulse",children:s.jsx("div",{className:"w-3 h-3 rounded-full bg-brand-400"})}):s.jsx("div",{className:"w-9 h-9 rounded-full border-2 border-dark-600 bg-dark-800 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-dark-500",children:K+1})}),s.jsx("span",{className:`text-xs mt-2 font-medium ${ie?"text-brand-400":F?pe?"text-yellow-400":"text-green-400":"text-dark-500"}`,children:pe?`${j.label} (skipped)`:j.label}),ve&&z===j.id&&s.jsx("span",{className:"text-[10px] text-brand-400 mt-0.5",children:"Skip here?"})]}),Kwindow.open(We.getViewUrl(ne.id),"_blank"),children:[s.jsx(An,{className:"w-4 h-4 mr-2"}),"View Report"]}),s.jsx(H,{size:"sm",variant:"ghost",onClick:()=>ae(null),children:"Dismiss"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4",children:[s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:r.length}),s.jsx("p",{className:"text-sm text-dark-400",children:"Endpoints"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:a.length}),s.jsx("p",{className:"text-sm text-dark-400",children:"Total Vulns"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-red-500",children:he.critical}),s.jsx("p",{className:"text-sm text-dark-400",children:"Critical"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-orange-500",children:he.high}),s.jsx("p",{className:"text-sm text-dark-400",children:"High"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-yellow-500",children:he.medium}),s.jsx("p",{className:"text-sm text-dark-400",children:"Medium"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-blue-500",children:he.low}),s.jsx("p",{className:"text-sm text-dark-400",children:"Low"})]})})]}),s.jsxs("div",{className:"flex gap-2 border-b border-dark-700 pb-2",children:[s.jsxs(H,{variant:E==="vulns"?"primary":"ghost",onClick:()=>U("vulns"),children:[s.jsx(Oe,{className:"w-4 h-4 mr-2"}),"Vulnerabilities (",a.length,")"]}),s.jsxs(H,{variant:E==="endpoints"?"primary":"ghost",onClick:()=>U("endpoints"),children:[s.jsx(pn,{className:"w-4 h-4 mr-2"}),"Endpoints (",r.length,")"]}),s.jsxs(H,{variant:E==="tasks"?"primary":"ghost",onClick:()=>U("tasks"),children:[s.jsx(il,{className:"w-4 h-4 mr-2"}),"Agent Tasks (",i.length,")"]})]}),E==="vulns"&&s.jsxs("div",{className:"space-y-3",children:[a.length>0&&s.jsx("div",{className:"flex gap-2 mb-2",children:["all","confirmed","rejected","validated"].map(h=>{const b=h==="all"?a.length:h==="confirmed"?a.filter(I=>!I.validation_status||I.validation_status==="ai_confirmed"||I.validation_status==="validated").length:h==="rejected"?a.filter(I=>I.validation_status==="ai_rejected"||I.validation_status==="false_positive").length:a.filter(I=>I.validation_status==="validated").length;return s.jsxs("button",{onClick:()=>ge(h),className:`px-3 py-1 text-xs rounded-full transition-colors ${G===h?"bg-primary-500/20 text-primary-400 border border-primary-500/30":"bg-dark-700 text-dark-400 border border-dark-600 hover:text-dark-300"}`,children:[h.charAt(0).toUpperCase()+h.slice(1)," (",b,")"]},h)})}),a.length===0?s.jsx(re,{children:s.jsx("p",{className:"text-dark-400 text-center py-8",children:n.status==="running"?"Scanning for vulnerabilities...":"No vulnerabilities found"})}):a.filter(h=>G==="all"?!0:G==="confirmed"?!h.validation_status||h.validation_status==="ai_confirmed"||h.validation_status==="validated":G==="rejected"?h.validation_status==="ai_rejected"||h.validation_status==="false_positive":G==="validated"?h.validation_status==="validated":!0).map((h,b)=>{var I;return s.jsxs("div",{className:`bg-dark-800 rounded-lg border overflow-hidden ${h.validation_status==="ai_rejected"?"border-orange-500/40 opacity-70":h.validation_status==="false_positive"?"border-dark-600 opacity-50":h.validation_status==="validated"?"border-green-500/40":"border-dark-700"}`,children:[s.jsx("div",{className:"p-4 cursor-pointer hover:bg-dark-750 transition-colors",onClick:()=>de(h.id||`vuln-${b}`),children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[D.has(h.id||`vuln-${b}`)?s.jsx(pt,{className:"w-4 h-4 mt-1 text-dark-400"}):s.jsx(zr,{className:"w-4 h-4 mt-1 text-dark-400"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-white",children:h.title}),s.jsx("p",{className:"text-sm text-dark-400 truncate mt-1",children:h.affected_endpoint})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[h.cvss_score&&s.jsxs("span",{className:`text-sm font-bold px-2 py-0.5 rounded ${h.cvss_score>=9?"bg-red-500/20 text-red-400":h.cvss_score>=7?"bg-orange-500/20 text-orange-400":h.cvss_score>=4?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:["CVSS ",h.cvss_score.toFixed(1)]}),s.jsx(ts,{severity:h.severity}),(()=>{const O=Nu(h);return O?s.jsxs("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full border ${Su[O.color]}`,children:[O.score,"/100"]}):null})(),h.validation_status==="ai_rejected"&&s.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-orange-500/20 text-orange-400 border border-orange-500/30 flex items-center gap-1",children:[s.jsx(Oe,{className:"w-3 h-3"})," AI Rejected"]}),h.validation_status==="validated"&&s.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-green-500/20 text-green-400 border border-green-500/30 flex items-center gap-1",children:[s.jsx(Wt,{className:"w-3 h-3"})," Validated"]}),h.validation_status==="false_positive"&&s.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-dark-600 text-dark-400 border border-dark-500 flex items-center gap-1",children:[s.jsx(Ct,{className:"w-3 h-3"})," False Positive"]}),(!h.validation_status||h.validation_status==="ai_confirmed")&&s.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:"AI Confirmed"})]})]})}),D.has(h.id||`vuln-${b}`)&&s.jsxs("div",{className:"p-4 pt-0 space-y-4 border-t border-dark-700",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm",children:[h.vulnerability_type&&s.jsxs("span",{className:"text-dark-400",children:["Type: ",s.jsx("span",{className:"text-white",children:h.vulnerability_type})]}),h.cwe_id&&s.jsxs("a",{href:`https://cwe.mitre.org/data/definitions/${h.cwe_id.replace("CWE-","")}.html`,target:"_blank",rel:"noopener noreferrer",className:"text-primary-400 hover:underline flex items-center gap-1",children:[h.cwe_id,s.jsx(An,{className:"w-3 h-3"})]}),h.cvss_vector&&s.jsx("span",{className:"text-xs bg-dark-700 px-2 py-1 rounded font-mono text-dark-300",children:h.cvss_vector})]}),(()=>{const O=Nu(h);return O?s.jsxs("div",{className:`rounded-lg p-3 border ${Su[O.color]}`,children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Ke,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-semibold",children:"Validation Pipeline"}),s.jsxs("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${O.score>=90?"bg-green-500/20 text-green-400":O.score>=60?"bg-yellow-500/20 text-yellow-400":"bg-red-500/20 text-red-400"}`,children:[O.score,"/100 ",O.label]})]}),h.confidence_breakdown&&Object.keys(h.confidence_breakdown).length>0&&s.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs mt-1 mb-2",children:Object.entries(h.confidence_breakdown).map(([J,C])=>s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"opacity-70 capitalize",children:J.replace(/_/g," ")}),s.jsxs("span",{className:`font-mono font-medium ${Number(C)>0?"text-green-400":Number(C)<0?"text-red-400":"opacity-50"}`,children:[Number(C)>0?"+":"",C]})]},J))}),h.proof_of_execution&&s.jsxs("div",{className:"text-xs mt-1 flex items-start gap-1",children:[s.jsx(Wt,{className:"w-3 h-3 mt-0.5 flex-shrink-0 text-green-400"}),s.jsx("span",{className:"opacity-80",children:h.proof_of_execution})]}),h.negative_controls&&s.jsxs("div",{className:"text-xs mt-1 flex items-start gap-1",children:[s.jsx(Ke,{className:"w-3 h-3 mt-0.5 flex-shrink-0 text-blue-400"}),s.jsx("span",{className:"opacity-80",children:h.negative_controls})]})]}):null})(),h.description&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"Description"}),s.jsx("p",{className:"text-sm text-dark-400",children:h.description})]}),h.impact&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"Impact"}),s.jsx("p",{className:"text-sm text-dark-400",children:h.impact})]}),(h.poc_request||h.poc_payload)&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("p",{className:"text-sm font-medium text-dark-300",children:"Proof of Concept"}),s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>S(h.poc_request||h.poc_payload||""),children:[s.jsx(cr,{className:"w-3 h-3 mr-1"}),"Copy"]})]}),h.poc_payload&&s.jsxs("div",{className:"mb-2",children:[s.jsx("p",{className:"text-xs text-dark-500 mb-1",children:"Payload:"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded overflow-x-auto text-yellow-400 font-mono",children:h.poc_payload})]}),h.poc_request&&s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-dark-500 mb-1",children:"Request:"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded overflow-x-auto text-dark-300 font-mono",children:h.poc_request})]}),h.poc_response&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-xs text-dark-500 mb-1",children:"Response:"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded overflow-x-auto text-dark-300 font-mono max-h-40",children:h.poc_response})]})]}),h.poc_code&&s.jsxs("div",{className:"mt-3",children:[s.jsx("p",{className:"text-xs font-medium text-dark-400 mb-1",children:"Exploitation Code"}),s.jsx("pre",{className:"p-3 bg-dark-950 rounded text-xs text-green-400 overflow-x-auto max-h-[400px] overflow-y-auto whitespace-pre-wrap",children:h.poc_code})]}),h.remediation&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-green-400 mb-1",children:"Remediation"}),s.jsx("p",{className:"text-sm text-dark-400",children:h.remediation})]}),h.ai_analysis&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-purple-400 mb-1",children:"AI Analysis"}),s.jsx("p",{className:"text-sm text-dark-400 whitespace-pre-wrap",children:h.ai_analysis})]}),h.validation_status==="ai_rejected"&&h.ai_rejection_reason&&s.jsxs("div",{className:"bg-orange-500/10 border border-orange-500/20 rounded-lg p-3",children:[s.jsxs("p",{className:"text-sm font-medium text-orange-400 mb-1 flex items-center gap-1",children:[s.jsx(Oe,{className:"w-4 h-4"})," AI Rejection Reason"]}),s.jsx("p",{className:"text-sm text-orange-300/80",children:h.ai_rejection_reason})]}),h.validation_status!=="validated"&&h.validation_status!=="false_positive"&&s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-dark-700",children:[s.jsx("span",{className:"text-xs text-dark-500 mr-2",children:"Manual Review:"}),s.jsxs(H,{variant:"ghost",size:"sm",className:"text-green-400 hover:bg-green-500/10 border border-green-500/30",onClick:async O=>{O.stopPropagation();try{await mi.validate(h.id,"validated");const J=a.map(C=>C.id===h.id?{...C,validation_status:"validated"}:C);d(J)}catch(J){console.error("Validate error:",J)}},children:[s.jsx(Wt,{className:"w-3 h-3 mr-1"}),"Validate"]}),s.jsxs(H,{variant:"ghost",size:"sm",className:"text-dark-400 hover:bg-red-500/10 border border-dark-600",onClick:async O=>{O.stopPropagation();try{await mi.validate(h.id,"false_positive");const J=a.map(C=>C.id===h.id?{...C,validation_status:"false_positive"}:C);d(J)}catch(J){console.error("Mark FP error:",J)}},children:[s.jsx(Ct,{className:"w-3 h-3 mr-1"}),"False Positive"]}),h.validation_status==="ai_rejected"&&s.jsx("span",{className:"text-xs text-orange-400/60 ml-2",children:"AI rejected this finding - review the evidence above"})]}),(h.validation_status==="validated"||h.validation_status==="false_positive")&&s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-dark-700",children:[s.jsx("span",{className:"text-xs text-dark-500",children:h.validation_status==="validated"?"Manually validated by pentester":"Marked as false positive"}),s.jsx(H,{variant:"ghost",size:"sm",className:"text-dark-500 hover:text-dark-300 text-xs",onClick:async O=>{O.stopPropagation();try{const J=h.ai_rejection_reason?"ai_rejected":"ai_confirmed";await mi.validate(h.id,J);const C=a.map(j=>j.id===h.id?{...j,validation_status:J}:j);d(C)}catch(J){console.error("Revert error:",J)}},children:"Undo"})]}),((I=h.references)==null?void 0:I.length)>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"References"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:h.references.map((O,J)=>s.jsxs("a",{href:O,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary-400 hover:underline flex items-center gap-1",children:[(()=>{try{return new URL(O).hostname}catch{return O}})(),s.jsx(An,{className:"w-3 h-3"})]},J))})]})]})]},h.id||`vuln-${b}`)})]}),E==="endpoints"&&s.jsx(re,{title:"Discovered Endpoints",subtitle:`${r.length} endpoints found`,children:s.jsx("div",{className:"space-y-2 max-h-[500px] overflow-auto",children:r.length===0?s.jsx("p",{className:"text-dark-400 text-center py-8",children:"No endpoints discovered yet"}):r.map((h,b)=>{var I;return s.jsxs("div",{className:"flex items-center gap-3 p-3 bg-dark-900/50 rounded-lg hover:bg-dark-900 transition-colors",children:[s.jsx(pn,{className:"w-4 h-4 text-dark-400 flex-shrink-0"}),s.jsx("span",{className:`text-xs px-2 py-0.5 rounded font-medium ${h.method==="GET"?"bg-green-500/20 text-green-400":h.method==="POST"?"bg-blue-500/20 text-blue-400":h.method==="PUT"?"bg-yellow-500/20 text-yellow-400":h.method==="DELETE"?"bg-red-500/20 text-red-400":"bg-dark-700 text-dark-300"}`,children:h.method}),s.jsx("span",{className:"text-sm text-dark-200 truncate flex-1 font-mono",children:h.path||h.url}),((I=h.parameters)==null?void 0:I.length)>0&&s.jsxs("span",{className:"text-xs text-dark-500",children:[h.parameters.length," params"]}),h.content_type&&s.jsx("span",{className:"text-xs text-dark-500",children:h.content_type}),h.response_status&&s.jsx("span",{className:`text-xs font-medium ${h.response_status<300?"text-green-400":h.response_status<400?"text-yellow-400":"text-red-400"}`,children:h.response_status})]},h.id||`endpoint-${b}`)})})}),E==="tasks"&&s.jsx(re,{title:"Agent Tasks",subtitle:`${i.length} tasks executed`,children:s.jsx("div",{className:"space-y-3 max-h-[500px] overflow-auto",children:i.length===0?s.jsx("p",{className:"text-dark-400 text-center py-8",children:n.status==="running"?"Agent tasks will appear here...":"No agent tasks recorded"}):i.map((h,b)=>s.jsxs("div",{className:"p-4 bg-dark-900/50 rounded-lg border border-dark-700",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[s.jsx("div",{className:`mt-0.5 ${h.status==="completed"?"text-green-400":h.status==="running"?"text-blue-400":h.status==="failed"?"text-red-400":"text-dark-400"}`,children:h.status==="completed"?s.jsx(Wt,{className:"w-5 h-5"}):h.status==="running"?s.jsx(ln,{className:"w-5 h-5 animate-spin"}):h.status==="failed"?s.jsx(Ct,{className:"w-5 h-5"}):s.jsx(Xt,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-white",children:h.task_name}),h.description&&s.jsx("p",{className:"text-sm text-dark-400 mt-1",children:h.description}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-2 text-xs",children:[h.tool_name&&s.jsx("span",{className:"bg-dark-700 px-2 py-1 rounded text-dark-300",children:h.tool_name}),s.jsx("span",{className:`px-2 py-1 rounded ${h.task_type==="recon"?"bg-blue-500/20 text-blue-400":h.task_type==="analysis"?"bg-purple-500/20 text-purple-400":h.task_type==="testing"?"bg-orange-500/20 text-orange-400":"bg-green-500/20 text-green-400"}`,children:h.task_type}),h.duration_ms!==null&&s.jsx("span",{className:"text-dark-500",children:h.duration_ms<1e3?`${h.duration_ms}ms`:`${(h.duration_ms/1e3).toFixed(1)}s`})]})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("span",{className:`text-xs px-2 py-1 rounded font-medium ${h.status==="completed"?"bg-green-500/20 text-green-400":h.status==="running"?"bg-blue-500/20 text-blue-400":h.status==="failed"?"bg-red-500/20 text-red-400":"bg-dark-700 text-dark-300"}`,children:h.status}),(h.items_processed>0||h.items_found>0)&&s.jsxs("p",{className:"text-xs text-dark-500 mt-2",children:[h.items_processed>0&&`${h.items_processed} processed`,h.items_processed>0&&h.items_found>0&&" / ",h.items_found>0&&`${h.items_found} found`]})]})]}),h.result_summary&&s.jsx("p",{className:"text-xs text-dark-400 mt-3 border-t border-dark-700 pt-3",children:h.result_summary}),h.error_message&&s.jsxs("p",{className:"text-xs text-red-400 mt-3 border-t border-dark-700 pt-3",children:["Error: ",h.error_message]})]},h.id||`task-${b}`))})}),s.jsx(re,{title:"Activity Log",children:s.jsx("div",{className:"space-y-1 max-h-60 overflow-auto font-mono text-xs",children:l.length===0?s.jsx("p",{className:"text-dark-400 text-center py-4",children:"Waiting for activity..."}):l.map((h,b)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-dark-500",children:new Date(h.time).toLocaleTimeString()}),s.jsx("span",{className:`${h.level==="error"?"text-red-400":h.level==="warning"?"text-yellow-400":h.level==="success"?"text-green-400":"text-dark-300"}`,children:h.message})]},b))})})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center h-64",children:[s.jsx(Oe,{className:"w-12 h-12 text-yellow-500 mb-4"}),s.jsx("p",{className:"text-xl text-white mb-2",children:"Scan not found"}),s.jsx("p",{className:"text-dark-400 mb-4",children:"The scan may still be initializing or does not exist."}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(H,{onClick:()=>window.location.reload(),children:"Refresh"}),s.jsx(H,{variant:"secondary",onClick:()=>t("/"),children:"Go to Dashboard"})]})]})}const hi={initializing:s.jsx(Xt,{className:"w-4 h-4"}),reconnaissance:s.jsx(Kt,{className:"w-4 h-4"}),"reconnaissance complete":s.jsx(Kt,{className:"w-4 h-4"}),recon:s.jsx(Kt,{className:"w-4 h-4"}),"starting reconnaissance":s.jsx(Kt,{className:"w-4 h-4"}),scanning:s.jsx(Ke,{className:"w-4 h-4"}),analysis:s.jsx(In,{className:"w-4 h-4"}),"attack surface analyzed":s.jsx(In,{className:"w-4 h-4"}),testing:s.jsx(Ke,{className:"w-4 h-4"}),"vulnerability testing complete":s.jsx(Ke,{className:"w-4 h-4"}),enhancement:s.jsx(Mt,{className:"w-4 h-4"}),"findings enhanced":s.jsx(Mt,{className:"w-4 h-4"}),reporting:s.jsx(yt,{className:"w-4 h-4"}),"assessment complete":s.jsx(Wt,{className:"w-4 h-4"}),completed:s.jsx(Wt,{className:"w-4 h-4"}),stopped:s.jsx(es,{className:"w-4 h-4"}),error:s.jsx(Ct,{className:"w-4 h-4"})},gi=[{key:"recon",label:"Reconnaissance",progress:20},{key:"analysis",label:"Analysis",progress:30},{key:"testing",label:"Testing",progress:70},{key:"enhancement",label:"Enhancement",progress:90},{key:"completed",label:"Completed",progress:100}],yi=e=>{const t=e.toLowerCase();return t.includes("recon")||t.includes("initializing")?0:t.includes("analysis")||t.includes("attack surface")?1:t.includes("test")||t.includes("vuln")?2:t.includes("enhance")||t.includes("finding")?3:t.includes("complete")||t.includes("report")?4:0},vi={full_auto:"Full Auto",recon_only:"Recon Only",prompt_only:"AI Prompt Mode",analyze_only:"Analyze Only"};function pw(){const{agentId:e}=bc(),t=Bn(),n=x.useRef(null),r=x.useRef(null),[a,l]=x.useState(null),[i,o]=x.useState([]),[c,d]=x.useState(!0),[m,f]=x.useState(null),[p,N]=x.useState(new Set),[v,w]=x.useState(!1),[k,y]=x.useState(!1),[u,g]=x.useState(!0),[_,L]=x.useState(""),[D,R]=x.useState(!1),[E,U]=x.useState(null),[q,A]=x.useState(null),[te,Q]=x.useState(!1),[ne,ae]=x.useState(new Set),ce=i.filter(S=>S.source==="script"||!S.source&&!S.message.includes("[LLM]")&&!S.message.includes("[AI]")),xe=i.filter(S=>S.source==="llm"||S.message.includes("[LLM]")||S.message.includes("[AI]"));x.useEffect(()=>{if(!e)return;const S=async()=>{var b;try{const[I,O]=await Promise.all([we.getStatus(e),we.getLogs(e,500)]);l(I),o(O.logs),f(null)}catch(I){((b=I.response)==null?void 0:b.status)===404?f("Agent not found"):console.error("Failed to fetch agent status:",I)}finally{d(!1)}};S();const h=setInterval(()=>{((a==null?void 0:a.status)==="running"||(a==null?void 0:a.status)==="paused")&&S()},5e3);return()=>clearInterval(h)},[e,a==null?void 0:a.status]),x.useEffect(()=>{var S,h;u&&((S=n.current)==null||S.scrollIntoView({behavior:"smooth"}),(h=r.current)==null||h.scrollIntoView({behavior:"smooth"}))},[i,u]);const z=S=>{const h=new Set(p);h.has(S)?h.delete(S):h.add(S),N(h)},Y=()=>{if(!a)return null;const S={critical:a.findings.filter(h=>h.severity==="critical").length,high:a.findings.filter(h=>h.severity==="high").length,medium:a.findings.filter(h=>h.severity==="medium").length,low:a.findings.filter(h=>h.severity==="low").length,info:a.findings.filter(h=>h.severity==="info").length};return{report_info:{agent_id:e,target:a.target,mode:a.mode,status:a.status,started_at:a.started_at,completed_at:a.completed_at||new Date().toISOString(),total_findings:a.findings.length,severity_breakdown:S},findings:a.findings.map(h=>({id:h.id,title:h.title,severity:h.severity,type:h.vulnerability_type,cvss_score:h.cvss_score,cvss_vector:h.cvss_vector,cwe_id:h.cwe_id,affected_endpoint:h.affected_endpoint,parameter:h.parameter,payload:h.payload,evidence:h.evidence,request:h.request,response:h.response,description:h.description,impact:h.impact,poc_code:h.poc_code,remediation:h.remediation,references:h.references,ai_verified:h.ai_verified,confidence:h.confidence})),logs:i.slice(-100)}},se=async(S="json")=>{if(!(!e||!a)){w(!0);try{if(S==="html"){const h=V(),b=new Blob([h],{type:"text/html"}),I=URL.createObjectURL(b),O=document.createElement("a");O.href=I,O.download=`neurosploit-report-${e}-${new Date().toISOString().split("T")[0]}.html`,O.click(),URL.revokeObjectURL(I)}else{const h=a.report||Y(),b=new Blob([JSON.stringify(h,null,2)],{type:"application/json"}),I=URL.createObjectURL(b),O=document.createElement("a");O.href=I,O.download=`neurosploit-report-${e}-${new Date().toISOString().split("T")[0]}.json`,O.click(),URL.revokeObjectURL(I)}}finally{w(!1)}}},V=()=>{if(!a)return"";const S={critical:"#dc2626",high:"#ea580c",medium:"#ca8a04",low:"#2563eb",info:"#6b7280"},h={"sql injection":"A03:2021 - Injection",sqli:"A03:2021 - Injection",xss:"A03:2021 - Injection","cross-site scripting":"A03:2021 - Injection","command injection":"A03:2021 - Injection",ssrf:"A10:2021 - Server-Side Request Forgery",idor:"A01:2021 - Broken Access Control","broken access":"A01:2021 - Broken Access Control",auth:"A07:2021 - Identification and Authentication Failures",csrf:"A01:2021 - Broken Access Control",crypto:"A02:2021 - Cryptographic Failures",config:"A05:2021 - Security Misconfiguration",header:"A05:2021 - Security Misconfiguration",cors:"A05:2021 - Security Misconfiguration",clickjacking:"A05:2021 - Security Misconfiguration"},b=(F,ie)=>{const pe=(F+" "+ie).toLowerCase();for(const[Te,ve]of Object.entries(h))if(pe.includes(Te))return ve;return""},I={critical:a.findings.filter(F=>F.severity==="critical").length,high:a.findings.filter(F=>F.severity==="high").length,medium:a.findings.filter(F=>F.severity==="medium").length,low:a.findings.filter(F=>F.severity==="low").length,info:a.findings.filter(F=>F.severity==="info").length},O=Math.min(100,I.critical*25+I.high*15+I.medium*8+I.low*3),J=O>=75?"Critical":O>=50?"High":O>=25?"Medium":"Low",C=O>=75?"#dc2626":O>=50?"#ea580c":O>=25?"#ca8a04":"#22c55e",j=a.findings.map((F,ie)=>{const pe=b(F.title,F.vulnerability_type),Te=F.cwe_id?`https://cwe.mitre.org/data/definitions/${F.cwe_id.replace("CWE-","")}.html`:"";return` +
+
+
+
+ + ${F.severity} + + Finding #${ie+1} +
+

${F.title}

+

${F.affected_endpoint}

+
+
+ +
+ +
+ ${F.cvss_score?` +
+
CVSS 3.1 Score
+
+ ${F.cvss_score} + ${F.cvss_score>=9?"Critical":F.cvss_score>=7?"High":F.cvss_score>=4?"Medium":"Low"} +
+ ${F.cvss_vector?`
${F.cvss_vector}
`:""} +
+ `:""} + ${F.cwe_id?` +
+
CWE Reference
+ ${F.cwe_id} +
+ `:""} + ${pe?` +
+
OWASP Top 10
+
${pe}
+
+ `:""} +
+
Vulnerability Type
+
${F.vulnerability_type}
+
+
+ + + ${F.description?` +
+

📋 Description

+

${F.description}

+
+ `:""} + + +
+

🎯 Affected Endpoint

+
${F.affected_endpoint}
+
+ + + ${F.evidence?` +
+

🔍 Evidence / Proof of Concept

+
${F.evidence}
+
+ `:""} + + + ${F.impact?` +
+

⚠️ Impact

+

${F.impact}

+
+ `:""} + + + ${F.remediation?` +
+

✅ Remediation

+

${F.remediation}

+
+ `:""} + + + ${F.references&&F.references.length>0?` +
+

📚 References

+
    + ${F.references.map(ve=>`
  • ${ve}
  • `).join("")} +
+
+ `:""} +
+
+ `}).join(""),K=` +
+

📊 Executive Summary

+

+ This security assessment of ${a.target} was conducted using NeuroSploit AI-powered penetration testing platform. + The assessment identified ${a.findings.length} security findings across various severity levels. + ${I.critical>0?`${I.critical} critical vulnerabilities require immediate attention.`:""} + ${I.high>0?`${I.high} high-severity issues should be addressed promptly.`:""} +

+
+
+
Overall Risk Score
+
${O}/100
+
+
+
+
+
+
${J} Risk
+
+
+
+ `;return` + + + + + NeuroSploit Security Report - ${e} + + + +
+
+

🛡️ NeuroSploit Security Assessment Report

+

Target: ${a.target} | Agent ID: ${e} | Mode: ${vi[a.mode]||a.mode}

+

Date: ${new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}

+
+ + ${K} + +
+
${a.findings.length}
Total
+
${I.critical}
Critical
+
${I.high}
High
+
${I.medium}
Medium
+
${I.low}
Low
+
${I.info}
Info
+
+ +

🔍 Detailed Findings

+
+ ${j||'

No vulnerabilities identified during this assessment.

'} +
+ + +
+ +`},G=async()=>{if(e){y(!0);try{await we.stop(e);const S=await we.getStatus(e);l(S)}catch(S){console.error("Failed to stop agent:",S)}finally{y(!1)}}},ge=async()=>{if(e)try{await we.pause(e);const S=await we.getStatus(e);l(S)}catch(S){console.error("Failed to pause agent:",S)}},he=async()=>{if(e)try{await we.resume(e);const S=await we.getStatus(e);l(S)}catch(S){console.error("Failed to resume agent:",S)}},ke=async()=>{if(!_.trim()||!e)return;R(!0),U(null);const S=_;try{await we.sendPrompt(e,_),L(""),U(`Prompt sent: "${S.slice(0,50)}${S.length>50?"...":""}"`),setTimeout(()=>U(null),5e3);const[h,b]=await Promise.all([we.getStatus(e),we.getLogs(e,200)]);l(h),o(b.logs||[])}catch(h){console.error("Failed to send prompt:",h),U("Failed to send prompt"),setTimeout(()=>U(null),3e3)}finally{R(!1)}},P=async S=>{if(e){Q(!0);try{await we.skipToPhase(e,S);const h=a?yi(a.phase):0,b=gi.findIndex(O=>O.key===S),I=new Set(ne);for(let O=h;O{if(!a)return;const S=a.phase.toLowerCase();if(S.includes("_skipped")){const h=S.replace("_skipped","");ae(b=>new Set(b).add(h))}},[a==null?void 0:a.phase]);const X=S=>{navigator.clipboard.writeText(S)};if(c)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx(ln,{className:"w-8 h-8 animate-spin text-primary-500"})});if(m)return s.jsxs("div",{className:"flex flex-col items-center justify-center h-64",children:[s.jsx(Ct,{className:"w-12 h-12 text-red-500 mb-4"}),s.jsx("p",{className:"text-xl text-white mb-2",children:m}),s.jsx(H,{onClick:()=>t("/scan/new"),children:"Start New Agent"})]});if(!a)return null;const M={critical:a.findings.filter(S=>S.severity==="critical").length,high:a.findings.filter(S=>S.severity==="high").length,medium:a.findings.filter(S=>S.severity==="medium").length,low:a.findings.filter(S=>S.severity==="low").length,info:a.findings.filter(S=>S.severity==="info").length},me=S=>{var h;return s.jsxs("div",{className:"p-4 pt-0 space-y-4 border-t border-dark-700",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-dark-400",children:"CVSS:"}),s.jsx("span",{className:`font-bold ${S.cvss_score>=9?"text-red-500":S.cvss_score>=7?"text-orange-500":S.cvss_score>=4?"text-yellow-500":"text-blue-500"}`,children:((h=S.cvss_score)==null?void 0:h.toFixed(1))||"N/A"})]}),S.cwe_id&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-dark-400",children:"CWE:"}),s.jsxs("a",{href:`https://cwe.mitre.org/data/definitions/${S.cwe_id.replace("CWE-","")}.html`,target:"_blank",rel:"noopener noreferrer",className:"text-primary-400 hover:underline flex items-center gap-1",children:[S.cwe_id,s.jsx(An,{className:"w-3 h-3"})]})]}),s.jsx("span",{className:"text-xs bg-dark-700 px-2 py-1 rounded text-dark-300",children:S.vulnerability_type}),S.confidence&&s.jsxs("span",{className:`text-xs px-2 py-1 rounded ${S.confidence==="high"?"bg-green-500/20 text-green-400":S.confidence==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-red-500/20 text-red-400"}`,children:[S.confidence," confidence"]})]}),S.cvss_vector&&s.jsx("div",{className:"text-xs bg-dark-800 p-2 rounded font-mono text-dark-300",children:S.cvss_vector}),s.jsxs("div",{className:"bg-dark-800/50 rounded-lg p-4 space-y-3",children:[s.jsxs("h4",{className:"text-sm font-medium text-primary-400 flex items-center gap-2",children:[s.jsx(i0,{className:"w-4 h-4"}),"Technical Details"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-xs text-dark-500",children:"Endpoint:"}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsx(pn,{className:"w-4 h-4 text-dark-400"}),s.jsx("code",{className:"text-sm text-blue-400 bg-dark-900 px-2 py-1 rounded break-all",children:S.affected_endpoint})]})]}),S.parameter&&s.jsxs("div",{children:[s.jsx("span",{className:"text-xs text-dark-500",children:"Vulnerable Parameter:"}),s.jsx("code",{className:"block mt-1 text-sm text-yellow-400 bg-dark-900 px-2 py-1 rounded",children:S.parameter})]}),S.payload&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-dark-500",children:"Payload Used:"}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>X(S.payload),children:s.jsx(cr,{className:"w-3 h-3"})})]}),s.jsx("code",{className:"block mt-1 text-sm text-red-400 bg-dark-900 px-2 py-1 rounded break-all",children:S.payload})]}),S.request&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-dark-500",children:"HTTP Request:"}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>X(S.request),children:s.jsx(cr,{className:"w-3 h-3"})})]}),s.jsx("pre",{className:"mt-1 text-xs text-green-400 bg-dark-900 p-2 rounded overflow-x-auto max-h-32",children:S.request})]}),S.response&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs text-dark-500",children:"HTTP Response (excerpt):"}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>X(S.response),children:s.jsx(cr,{className:"w-3 h-3"})})]}),s.jsx("pre",{className:"mt-1 text-xs text-orange-400 bg-dark-900 p-2 rounded overflow-x-auto max-h-32",children:S.response})]}),S.evidence&&s.jsxs("div",{children:[s.jsx("span",{className:"text-xs text-dark-500",children:"Evidence:"}),s.jsx("p",{className:"mt-1 text-sm text-dark-300 bg-dark-900 p-2 rounded",children:S.evidence})]})]}),S.description&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"Description"}),s.jsx("p",{className:"text-sm text-dark-400",children:S.description})]}),S.impact&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"Impact"}),s.jsx("p",{className:"text-sm text-dark-400",children:S.impact})]}),S.poc_code&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("p",{className:"text-sm font-medium text-dark-300",children:"Proof of Concept"}),s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>X(S.poc_code),children:[s.jsx(cr,{className:"w-3 h-3 mr-1"}),"Copy"]})]}),s.jsx("pre",{className:"text-xs bg-dark-800 p-3 rounded overflow-x-auto text-dark-300 font-mono",children:S.poc_code})]}),S.remediation&&s.jsxs("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-3",children:[s.jsx("p",{className:"text-sm font-medium text-green-400 mb-1",children:"Remediation"}),s.jsx("p",{className:"text-sm text-dark-400",children:S.remediation})]}),S.references&&S.references.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-1",children:"References"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:S.references.map((b,I)=>s.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary-400 hover:underline flex items-center gap-1 bg-dark-800 px-2 py-1 rounded",children:[(()=>{try{return new URL(b).hostname}catch{return b}})(),s.jsx(An,{className:"w-3 h-3"})]},I))})]})]})},de=(S,h,b,I)=>s.jsxs("div",{className:"space-y-1 max-h-[400px] overflow-auto font-mono text-xs",children:[S.length===0?s.jsxs("p",{className:"text-dark-400 text-center py-8",children:["No ",b.toLowerCase()," activity yet..."]}):S.map((O,J)=>{const C=O.message.includes("[USER PROMPT]"),j=O.message.includes("[AI RESPONSE]")||O.message.includes("[AI]");return s.jsxs("div",{className:`flex gap-2 py-1 px-1 rounded ${C?"bg-blue-500/10 border-l-2 border-blue-500":j&&O.message.includes("[AI RESPONSE]")?"bg-purple-500/10 border-l-2 border-purple-500":"hover:bg-dark-800/30"}`,children:[s.jsx("span",{className:"text-dark-500 flex-shrink-0 w-20",children:new Date(O.time).toLocaleTimeString()}),s.jsx("span",{className:"flex-shrink-0",children:C?s.jsx(dl,{className:"w-3 h-3 text-blue-400"}):j?s.jsx(Mt,{className:"w-3 h-3 text-purple-400"}):I}),s.jsx("span",{className:`break-words ${C?"text-blue-300 font-medium":j&&O.message.includes("[AI RESPONSE]")?"text-purple-300":O.level==="error"?"text-red-400":O.level==="warning"?"text-yellow-400":O.level==="success"?"text-green-400":O.level==="llm"?"text-purple-400":"text-dark-300"}`,children:O.message})]},J)}),s.jsx("div",{ref:h})]});return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[s.jsx(In,{className:"w-7 h-7 text-primary-500"}),"Agent: ",e]}),s.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[s.jsxs("span",{className:`px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1 ${a.status==="running"?"bg-blue-500/20 text-blue-400":a.status==="completed"?"bg-green-500/20 text-green-400":a.status==="paused"?"bg-yellow-500/20 text-yellow-400":a.status==="stopped"?"bg-orange-500/20 text-orange-400":"bg-red-500/20 text-red-400"}`,children:[hi[a.status],a.status.charAt(0).toUpperCase()+a.status.slice(1)]}),s.jsxs("span",{className:"text-dark-400",children:["Mode: ",vi[a.mode]||a.mode]}),a.task&&s.jsxs("span",{className:"text-dark-400",children:["Task: ",a.task]})]})]}),s.jsxs("div",{className:"flex gap-2",children:[a.status==="running"&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"secondary",onClick:ge,children:[s.jsx(cl,{className:"w-4 h-4 mr-2"}),"Pause"]}),s.jsxs(H,{variant:"danger",onClick:G,isLoading:k,children:[s.jsx(es,{className:"w-4 h-4 mr-2"}),"Stop"]})]}),a.status==="paused"&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"primary",onClick:he,children:[s.jsx(Yt,{className:"w-4 h-4 mr-2"}),"Resume"]}),s.jsxs(H,{variant:"danger",onClick:G,isLoading:k,children:[s.jsx(es,{className:"w-4 h-4 mr-2"}),"Stop"]})]}),a.scan_id&&s.jsxs(H,{variant:"secondary",onClick:()=>t(`/scan/${a.scan_id}`),children:[s.jsx(Ke,{className:"w-4 h-4 mr-2"}),"View in Dashboard"]}),(a.findings.length>0||a.report)&&s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(H,{onClick:()=>se("html"),isLoading:v,variant:"primary",children:[s.jsx(yt,{className:"w-4 h-4 mr-2"}),"HTML Report"]}),s.jsxs(H,{onClick:()=>se("json"),isLoading:v,variant:"secondary",children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"JSON"]})]})]})]}),(a.status==="running"||a.status==="completed"||a.status==="stopped")&&s.jsx(re,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center justify-between px-2",children:gi.map((S,h)=>{const b=a.status==="completed"?4:(a.status==="stopped",yi(a.phase)),I=h===b,O=hb,C=ne.has(S.key),j=(a.status==="running"||a.status==="paused")&&h>b&&S.key!=="completed";return s.jsxs("div",{className:"flex flex-col items-center flex-1 relative group",children:[h>0&&s.jsx("div",{className:`absolute top-4 right-1/2 w-full h-0.5 -translate-y-1/2 z-0 ${O||I?"bg-green-500/50":C?"bg-yellow-500/30":"bg-dark-700"}`}),s.jsx("div",{className:`relative z-10 w-8 h-8 rounded-full flex items-center justify-center mb-1 transition-all ${C?"bg-yellow-500/20 text-yellow-500 ring-2 ring-yellow-500/30":O?"bg-green-500 text-white":I?"bg-primary-500 text-white animate-pulse ring-2 ring-primary-500/30":J?"bg-yellow-500/20 text-yellow-500":j?"bg-dark-700 text-dark-400 cursor-pointer hover:bg-primary-500/20 hover:text-primary-400 hover:ring-2 hover:ring-primary-500/30":"bg-dark-700 text-dark-400"}`,onClick:()=>j&&A(S.key),children:C?s.jsx(Ig,{className:"w-4 h-4"}):O?s.jsx(Wt,{className:"w-4 h-4"}):I?hi[S.key==="recon"?"reconnaissance":S.key]||s.jsx("span",{className:"text-xs font-bold",children:h+1}):J?s.jsx(es,{className:"w-4 h-4"}):j?s.jsx(m0,{className:"w-3.5 h-3.5"}):s.jsx("span",{className:"text-xs font-bold",children:h+1})}),s.jsx("span",{className:`text-xs text-center ${C?"text-yellow-500":O||I?"text-white":j?"text-dark-400 group-hover:text-primary-400":"text-dark-500"}`,children:C?`${S.label} (skipped)`:S.label}),j&&s.jsxs("div",{className:"absolute -top-8 left-1/2 -translate-x-1/2 bg-dark-800 text-primary-400 text-[10px] px-2 py-0.5 rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none border border-dark-600",children:["Skip to ",S.label]}),q===S.key&&s.jsxs("div",{className:"absolute top-10 left-1/2 -translate-x-1/2 z-20 bg-dark-800 border border-dark-600 rounded-lg p-3 shadow-xl whitespace-nowrap",children:[s.jsxs("p",{className:"text-xs text-dark-300 mb-2",children:["Skip to ",s.jsx("span",{className:"text-white font-medium",children:S.label}),"?"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>P(S.key),disabled:te,className:"px-3 py-1 bg-primary-500 text-white text-xs rounded hover:bg-primary-600 disabled:opacity-50",children:te?"Skipping...":"Confirm"}),s.jsx("button",{onClick:()=>A(null),className:"px-3 py-1 bg-dark-700 text-dark-300 text-xs rounded hover:bg-dark-600",children:"Cancel"})]})]})]},S.key)})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 text-dark-300",children:[hi[a.phase.toLowerCase()]||s.jsx(Xt,{className:"w-4 h-4"}),s.jsx("span",{className:"capitalize",children:a.phase.replace(/_/g," ")})]}),s.jsxs("span",{className:"text-white font-medium",children:[a.progress,"%"]})]}),s.jsx("div",{className:"h-2 bg-dark-900 rounded-full overflow-hidden",children:s.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${a.status==="completed"?"bg-green-500":a.status==="stopped"?"bg-yellow-500":"bg-primary-500"}`,style:{width:`${a.progress}%`}})})]})}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4",children:[s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:a.findings_count}),s.jsx("p",{className:"text-sm text-dark-400",children:"Total Findings"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-red-500",children:M.critical}),s.jsx("p",{className:"text-sm text-dark-400",children:"Critical"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-orange-500",children:M.high}),s.jsx("p",{className:"text-sm text-dark-400",children:"High"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-yellow-500",children:M.medium}),s.jsx("p",{className:"text-sm text-dark-400",children:"Medium"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-blue-500",children:M.low}),s.jsx("p",{className:"text-sm text-dark-400",children:"Low"})]})}),s.jsx(re,{children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-gray-400",children:M.info}),s.jsx("p",{className:"text-sm text-dark-400",children:"Info"})]})})]}),a.status==="running"&&s.jsx(re,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-primary-400",children:[s.jsx(Mt,{className:"w-5 h-5"}),s.jsx("h3",{className:"font-medium",children:"Custom AI Prompt"})]}),s.jsx("p",{className:"text-sm text-dark-400",children:'Send a custom instruction to the AI agent. Example: "Test for IDOR on /api/users/[id]" or "Check for XXE in XML endpoints"'}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:_,onChange:S=>L(S.target.value),onKeyDown:S=>S.key==="Enter"&&ke(),placeholder:"Enter custom vulnerability test prompt...",className:"flex-1 bg-dark-800 border border-dark-600 rounded-lg px-4 py-2 text-white placeholder-dark-400 focus:outline-none focus:border-primary-500"}),s.jsxs(H,{onClick:ke,isLoading:D,disabled:!_.trim(),children:[s.jsx(dl,{className:"w-4 h-4 mr-2"}),"Send"]})]}),E&&s.jsxs("div",{className:`flex items-center gap-2 text-sm ${E.includes("Failed")?"text-red-400":"text-green-400"}`,children:[E.includes("Failed")?s.jsx(Ct,{className:"w-4 h-4"}):s.jsx(Wt,{className:"w-4 h-4"}),E," - Check AI Analysis logs for response"]})]})}),s.jsx(re,{title:"Vulnerabilities Found",subtitle:`${a.findings_count} findings`,children:s.jsx("div",{className:"space-y-3 max-h-[600px] overflow-auto",children:a.findings.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Oe,{className:"w-12 h-12 text-dark-600 mx-auto mb-3"}),s.jsx("p",{className:"text-dark-400",children:a.status==="running"?"Scanning for vulnerabilities...":"No vulnerabilities found"})]}):a.findings.map(S=>s.jsxs("div",{className:"bg-dark-900/50 rounded-lg border border-dark-700 overflow-hidden",children:[s.jsx("div",{className:"p-4 cursor-pointer hover:bg-dark-800/50 transition-colors",onClick:()=>z(S.id),children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[p.has(S.id)?s.jsx(pt,{className:"w-4 h-4 mt-1 text-dark-400"}):s.jsx(zr,{className:"w-4 h-4 mt-1 text-dark-400"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-white",children:S.title}),s.jsx("p",{className:"text-sm text-dark-400 truncate",children:S.affected_endpoint}),S.parameter&&s.jsxs("p",{className:"text-xs text-yellow-400 mt-1",children:["Parameter: ",s.jsx("code",{className:"bg-dark-800 px-1 rounded",children:S.parameter})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ts,{severity:S.severity}),S.ai_verified&&s.jsxs("span",{className:"text-xs bg-purple-500/20 text-purple-400 px-2 py-0.5 rounded flex items-center gap-1",children:[s.jsx(Mt,{className:"w-3 h-3"}),"AI Verified"]})]})]})}),p.has(S.id)&&me(S)]},S.id))})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx(re,{title:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ye,{className:"w-4 h-4 text-green-400"}),s.jsx("span",{children:"Script Activity"}),s.jsx("span",{className:"text-xs bg-dark-700 px-2 py-0.5 rounded text-dark-400",children:ce.length})]}),subtitle:"Tool executions, HTTP requests, scanning progress",children:de(ce,n,"Script",s.jsx(Ye,{className:"w-3 h-3 text-green-400"}))}),s.jsx(re,{title:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Mt,{className:"w-4 h-4 text-purple-400"}),s.jsx("span",{children:"AI Analysis"}),s.jsx("span",{className:"text-xs bg-dark-700 px-2 py-0.5 rounded text-dark-400",children:xe.length})]}),subtitle:"LLM reasoning, vulnerability analysis, decisions",children:de(xe,r,"AI",s.jsx(Mt,{className:"w-3 h-3 text-purple-400"}))})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs("label",{className:"flex items-center gap-2 text-sm text-dark-400 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:u,onChange:S=>g(S.target.checked),className:"w-4 h-4 rounded border-dark-600 bg-dark-800 text-primary-500 focus:ring-primary-500"}),"Auto-scroll logs"]})}),(a.status==="completed"||a.status==="stopped")&&(a.report||a.findings.length>0)&&(()=>{var h;const S=a.report||{summary:{target:a.target,mode:a.mode,duration:a.started_at?`${Math.round((new Date(a.completed_at||new Date).getTime()-new Date(a.started_at).getTime())/6e4)} min`:"N/A",total_findings:a.findings.length,severity_breakdown:{critical:a.findings.filter(b=>b.severity==="critical").length,high:a.findings.filter(b=>b.severity==="high").length,medium:a.findings.filter(b=>b.severity==="medium").length,low:a.findings.filter(b=>b.severity==="low").length,info:a.findings.filter(b=>b.severity==="info").length}},executive_summary:a.status==="stopped"?`Scan was stopped by user. ${a.findings.length} finding(s) discovered before stopping.`:null,recommendations:[]};return s.jsx(re,{title:a.status==="stopped"?"Partial Report Summary":"Report Summary",children:s.jsxs("div",{className:"space-y-4",children:[a.status==="stopped"&&s.jsxs("div",{className:"flex items-center gap-2 text-yellow-500 bg-yellow-500/10 border border-yellow-500/30 rounded-lg px-3 py-2",children:[s.jsx(Oe,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm",children:"Scan was stopped - showing partial results"})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Target"}),s.jsx("p",{className:"text-white font-medium",children:S.summary.target})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Mode"}),s.jsx("p",{className:"text-white font-medium",children:vi[S.summary.mode]||S.summary.mode})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Duration"}),s.jsx("p",{className:"text-white font-medium",children:S.summary.duration})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Total Findings"}),s.jsx("p",{className:"text-white font-medium",children:S.summary.total_findings})]})]}),S.executive_summary&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-2",children:"Executive Summary"}),s.jsx("p",{className:"text-dark-400 whitespace-pre-wrap",children:S.executive_summary})]}),((h=S.recommendations)==null?void 0:h.length)>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-dark-300 mb-2",children:"Recommendations"}),s.jsx("ul",{className:"space-y-2",children:S.recommendations.map((b,I)=>s.jsxs("li",{className:"flex items-start gap-2 text-dark-400",children:[s.jsx(Wt,{className:"w-4 h-4 text-green-500 flex-shrink-0 mt-0.5"}),b]},I))})]})]})})})(),a.error&&s.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 flex items-start gap-3",children:[s.jsx(Ct,{className:"w-6 h-6 text-red-500 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-red-400",children:"Agent Error"}),s.jsx("p",{className:"text-sm text-red-300/80 mt-1",children:a.error})]})]})]})}const mw=[{id:"all",name:"All Tasks",color:"dark"},{id:"full_auto",name:"Full Auto",color:"primary"},{id:"recon",name:"Reconnaissance",color:"blue"},{id:"vulnerability",name:"Vulnerability",color:"orange"},{id:"custom",name:"Custom",color:"purple"},{id:"reporting",name:"Reporting",color:"green"}];function fw(){var q;const e=Bn(),[t,n]=x.useState([]),[r,a]=x.useState([]),[l,i]=x.useState(!0),[o,c]=x.useState("all"),[d,m]=x.useState(""),[f,p]=x.useState(null),[N,v]=x.useState(!1),[w,k]=x.useState({name:"",description:"",category:"custom",prompt:"",system_prompt:"",tags:""}),[y,u]=x.useState(!1),[g,_]=x.useState(null);x.useEffect(()=>{L()},[]),x.useEffect(()=>{D()},[t,o,d]);const L=async()=>{i(!0);try{const A=await we.tasks.list();n(A)}catch(A){console.error("Failed to load tasks:",A)}finally{i(!1)}},D=()=>{let A=[...t];if(o!=="all"&&(A=A.filter(te=>te.category===o)),d.trim()){const te=d.toLowerCase();A=A.filter(Q=>{var ne;return Q.name.toLowerCase().includes(te)||Q.description.toLowerCase().includes(te)||((ne=Q.tags)==null?void 0:ne.some(ae=>ae.toLowerCase().includes(te)))})}a(A)},R=async()=>{if(!(!w.name.trim()||!w.prompt.trim())){u(!0);try{await we.tasks.create({name:w.name,description:w.description,category:w.category,prompt:w.prompt,system_prompt:w.system_prompt||void 0,tags:w.tags.split(",").map(A=>A.trim()).filter(A=>A)}),await L(),v(!1),k({name:"",description:"",category:"custom",prompt:"",system_prompt:"",tags:""})}catch(A){console.error("Failed to create task:",A)}finally{u(!1)}}},E=async A=>{try{await we.tasks.delete(A),await L(),_(null),(f==null?void 0:f.id)===A&&p(null)}catch(te){console.error("Failed to delete task:",te)}},U=A=>{e("/scan/new",{state:{selectedTaskId:A.id}})};return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-3xl font-bold text-white flex items-center gap-3",children:[s.jsx(Nc,{className:"w-8 h-8 text-primary-500"}),"Task Library"]}),s.jsx("p",{className:"text-dark-400 mt-1",children:"Manage and create reusable security testing tasks"})]}),s.jsxs(H,{onClick:()=>v(!0),children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"Create Task"]})]}),s.jsx(re,{children:s.jsxs("div",{className:"flex flex-wrap gap-4",children:[s.jsx("div",{className:"flex-1 min-w-[200px]",children:s.jsxs("div",{className:"relative",children:[s.jsx(Qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-dark-400"}),s.jsx("input",{type:"text",placeholder:"Search tasks...",value:d,onChange:A=>m(A.target.value),className:"w-full pl-10 pr-4 py-2 bg-dark-900 border border-dark-700 rounded-lg text-white placeholder-dark-500 focus:border-primary-500 focus:outline-none"})]})}),s.jsx("div",{className:"flex gap-2 flex-wrap",children:mw.map(A=>s.jsx(H,{variant:o===A.id?"primary":"secondary",size:"sm",onClick:()=>c(A.id),children:A.name},A.id))})]})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsx("div",{className:"lg:col-span-2 space-y-3",children:l?s.jsx(re,{children:s.jsx("p",{className:"text-dark-400 text-center py-8",children:"Loading tasks..."})}):r.length===0?s.jsx(re,{children:s.jsx("p",{className:"text-dark-400 text-center py-8",children:d||o!=="all"?"No tasks match your filters":"No tasks found. Create your first task!"})}):r.map(A=>{var te;return s.jsx("div",{onClick:()=>p(A),className:`bg-dark-800 rounded-lg border p-4 cursor-pointer transition-all ${(f==null?void 0:f.id)===A.id?"border-primary-500 bg-primary-500/5":"border-dark-700 hover:border-dark-500"}`,children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"font-medium text-white",children:A.name}),A.is_preset&&s.jsx("span",{className:"text-xs bg-primary-500/20 text-primary-400 px-2 py-0.5 rounded",children:"Preset"})]}),s.jsx("p",{className:"text-sm text-dark-400 line-clamp-2",children:A.description}),s.jsxs("div",{className:"flex items-center gap-3 mt-3",children:[s.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${A.category==="full_auto"?"bg-primary-500/20 text-primary-400":A.category==="recon"?"bg-blue-500/20 text-blue-400":A.category==="vulnerability"?"bg-orange-500/20 text-orange-400":A.category==="reporting"?"bg-green-500/20 text-green-400":"bg-purple-500/20 text-purple-400"}`,children:A.category}),A.estimated_tokens>0&&s.jsxs("span",{className:"text-xs text-dark-500 flex items-center gap-1",children:[s.jsx(Rl,{className:"w-3 h-3"}),"~",A.estimated_tokens," tokens"]})]}),((te=A.tags)==null?void 0:te.length)>0&&s.jsxs("div",{className:"flex gap-1 mt-2 flex-wrap",children:[A.tags.slice(0,5).map(Q=>s.jsxs("span",{className:"text-xs bg-dark-700 text-dark-300 px-2 py-0.5 rounded flex items-center gap-1",children:[s.jsx(Bg,{className:"w-3 h-3"}),Q]},Q)),A.tags.length>5&&s.jsxs("span",{className:"text-xs text-dark-500",children:["+",A.tags.length-5," more"]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(H,{variant:"ghost",size:"sm",onClick:Q=>{Q.stopPropagation(),U(A)},children:s.jsx(Yt,{className:"w-4 h-4"})}),!A.is_preset&&s.jsx(H,{variant:"ghost",size:"sm",onClick:Q=>{Q.stopPropagation(),_(A.id)},children:s.jsx(Pt,{className:"w-4 h-4 text-red-400"})})]})]})},A.id)})}),s.jsx("div",{children:s.jsx(re,{title:"Task Details",children:f?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Name"}),s.jsx("p",{className:"text-white font-medium",children:f.name})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Description"}),s.jsx("p",{className:"text-dark-300",children:f.description})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Category"}),s.jsx("p",{className:"text-white",children:f.category})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Prompt"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded-lg overflow-auto max-h-60 text-dark-300 whitespace-pre-wrap",children:f.prompt})]}),f.system_prompt&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"System Prompt"}),s.jsx("pre",{className:"text-xs bg-dark-900 p-3 rounded-lg overflow-auto max-h-40 text-dark-300 whitespace-pre-wrap",children:f.system_prompt})]}),((q=f.tools_required)==null?void 0:q.length)>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400",children:"Required Tools"}),s.jsx("div",{className:"flex gap-1 flex-wrap mt-1",children:f.tools_required.map(A=>s.jsx("span",{className:"text-xs bg-dark-700 text-dark-300 px-2 py-1 rounded",children:A},A))})]}),s.jsx("div",{className:"pt-4 border-t border-dark-700",children:s.jsxs(H,{className:"w-full",onClick:()=>U(f),children:[s.jsx(Yt,{className:"w-4 h-4 mr-2"}),"Run This Task"]})})]}):s.jsx("p",{className:"text-dark-400 text-center py-8",children:"Select a task to view details"})})})]}),N&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-dark-800 rounded-xl border border-dark-700 w-full max-w-2xl max-h-[90vh] overflow-auto",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-dark-700",children:[s.jsx("h3",{className:"text-xl font-bold text-white",children:"Create New Task"}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>v(!1),children:s.jsx(Sc,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsx(st,{label:"Task Name",placeholder:"My Custom Task",value:w.name,onChange:A=>k({...w,name:A.target.value})}),s.jsx(st,{label:"Description",placeholder:"Brief description of what this task does",value:w.description,onChange:A=>k({...w,description:A.target.value})}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Category"}),s.jsxs("select",{value:w.category,onChange:A=>k({...w,category:A.target.value}),className:"w-full px-4 py-2 bg-dark-900 border border-dark-700 rounded-lg text-white focus:border-primary-500 focus:outline-none",children:[s.jsx("option",{value:"custom",children:"Custom"}),s.jsx("option",{value:"recon",children:"Reconnaissance"}),s.jsx("option",{value:"vulnerability",children:"Vulnerability"}),s.jsx("option",{value:"full_auto",children:"Full Auto"}),s.jsx("option",{value:"reporting",children:"Reporting"})]})]}),s.jsx(Ur,{label:"Prompt",placeholder:"Enter the prompt for the AI agent...",rows:8,value:w.prompt,onChange:A=>k({...w,prompt:A.target.value})}),s.jsx(Ur,{label:"System Prompt (Optional)",placeholder:"Enter a system prompt to guide the AI's behavior...",rows:4,value:w.system_prompt,onChange:A=>k({...w,system_prompt:A.target.value})}),s.jsx(st,{label:"Tags (comma separated)",placeholder:"pentest, api, auth, custom",value:w.tags,onChange:A=>k({...w,tags:A.target.value})})]}),s.jsxs("div",{className:"flex justify-end gap-3 p-4 border-t border-dark-700",children:[s.jsx(H,{variant:"secondary",onClick:()=>v(!1),children:"Cancel"}),s.jsxs(H,{onClick:R,isLoading:y,disabled:!w.name.trim()||!w.prompt.trim(),children:[s.jsx(u0,{className:"w-4 h-4 mr-2"}),"Create Task"]})]})]})}),g&&s.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:s.jsxs("div",{className:"bg-dark-800 rounded-xl border border-dark-700 p-6 max-w-md",children:[s.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Delete Task?"}),s.jsx("p",{className:"text-dark-400 mb-6",children:"Are you sure you want to delete this task? This action cannot be undone."}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx(H,{variant:"secondary",onClick:()=>_(null),children:"Cancel"}),s.jsxs(H,{variant:"danger",onClick:()=>E(g),children:[s.jsx(Pt,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})})]})}const _u={critical:0,high:1,medium:2,low:3,info:4},xw={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-blue-500",info:"bg-gray-500"};function hw(){var J,C;const e=x.useRef(null),t=x.useRef(null),[n,r]=x.useState([]),[a,l]=x.useState(null),[i,o]=x.useState(null),[c,d]=x.useState(!1),[m,f]=x.useState(""),[p,N]=x.useState(""),[v,w]=x.useState(!1),[k,y]=x.useState(""),[u,g]=x.useState(!1),[_,L]=x.useState(new Set),[D,R]=x.useState(new Set),[E,U]=x.useState(null),[q,A]=x.useState(!1),[te,Q]=x.useState(null),[ne,ae]=x.useState(null),[ce,xe]=x.useState(!1),z=600,Y=[{label:"Security Headers",prompt:"Analyze security headers and identify misconfigurations",icon:"🛡️"},{label:"Full Scan",prompt:"Perform a comprehensive security assessment including headers, cookies, CORS, and endpoint discovery",icon:"🔍"},{label:"XSS Test",prompt:"Test for Cross-Site Scripting (XSS) vulnerabilities in all input fields",icon:"💉"},{label:"SQL Injection",prompt:"Check for SQL injection vulnerabilities in parameters and forms",icon:"🗃️"},{label:"Directory Enum",prompt:"Discover hidden directories, files, and endpoints using common wordlists",icon:"📁"},{label:"Tech Stack",prompt:"Detect technologies, frameworks, and versions used by this application",icon:"⚙️"}],se=[{tool:"ffuf",label:"FFUF",description:"Fast web fuzzer",icon:"⚡"},{tool:"feroxbuster",label:"Feroxbuster",description:"Directory brute-force",icon:"🦀"},{tool:"nuclei",label:"Nuclei",description:"Vulnerability scanner",icon:"☢️"},{tool:"nmap",label:"Nmap",description:"Port scanner",icon:"🔌"},{tool:"nikto",label:"Nikto",description:"Web server scanner",icon:"🕷️"},{tool:"httpx",label:"HTTPX",description:"HTTP toolkit",icon:"🌐"}];x.useEffect(()=>{ge(),V(),G()},[]);const V=async()=>{try{const j=await we.realtime.getLlmStatus();U({available:j.available,provider:j.provider,error:j.error})}catch(j){console.error("Failed to check LLM status:",j),U({available:!1,provider:null,error:"Failed to connect to backend"})}},G=async()=>{try{const j=await we.realtime.getToolsStatus();Q(j)}catch(j){console.error("Failed to load tools info:",j)}};x.useEffect(()=>{var j;(j=e.current)==null||j.scrollIntoView({behavior:"smooth"})},[a==null?void 0:a.messages]);const ge=async()=>{try{const j=await we.realtime.listSessions();r(j.sessions||[])}catch(j){console.error("Failed to load sessions:",j)}},he=async()=>{var j,K;if(m.trim()){w(!0),o(null);try{const F=await we.realtime.createSession(m,p||void 0);await ge(),await ke(F.session_id),d(!1),f(""),N("")}catch(F){o(((K=(j=F.response)==null?void 0:j.data)==null?void 0:K.detail)||"Failed to create session")}finally{w(!1)}}},ke=async j=>{var K,F;o(null);try{const ie=await we.realtime.getSession(j);l(ie)}catch(ie){o(((F=(K=ie.response)==null?void 0:K.data)==null?void 0:F.detail)||"Failed to load session")}},P=async j=>{var ie,pe,Te;const K=j||k;if(!K.trim()||!a)return;g(!0),y("");const F={role:"user",content:K,timestamp:new Date().toISOString()};l(ve=>ve?{...ve,messages:[...ve.messages,F]}:null);try{const ve=await we.realtime.sendMessage(a.session_id,K),kt={role:"assistant",content:ve.response,timestamp:new Date().toISOString(),metadata:{tests_executed:ve.tests_executed}};l(Se=>Se?{...Se,messages:[...Se.messages,kt],findings:ve.findings||Se.findings}:null),(ie=t.current)==null||ie.focus()}catch(ve){const kt={role:"assistant",content:`Error: ${((Te=(pe=ve.response)==null?void 0:pe.data)==null?void 0:Te.detail)||ve.message||"Failed to send message"}`,timestamp:new Date().toISOString(),metadata:{error:!0}};l(Se=>Se?{...Se,messages:[...Se.messages,kt]}:null)}finally{g(!1)}},X=async j=>{var F,ie;if(!a)return;ae(j),A(!1);const K={role:"user",content:`Execute ${j} scan on target`,timestamp:new Date().toISOString()};l(pe=>pe?{...pe,messages:[...pe.messages,K]}:null);try{await we.realtime.executeTool(a.session_id,j),await ke(a.session_id)}catch(pe){const Te={role:"assistant",content:`Tool execution failed: ${((ie=(F=pe.response)==null?void 0:F.data)==null?void 0:ie.detail)||pe.message}`,timestamp:new Date().toISOString(),metadata:{error:!0}};l(ve=>ve?{...ve,messages:[...ve.messages,Te]}:null)}finally{ae(null)}},M=async j=>{if(confirm("Delete this session?"))try{await we.realtime.deleteSession(j),(a==null?void 0:a.session_id)===j&&l(null),await ge()}catch(K){console.error("Failed to delete session:",K)}},me=async()=>{if(a){xe(!0);try{const j=await we.realtime.getReportHtml(a.session_id),K=window.open("","_blank");K&&(K.document.write(j),K.document.close())}catch(j){console.error("Failed to generate HTML report:",j)}finally{xe(!1)}}},de=async()=>{if(a)try{const j=await we.realtime.getReport(a.session_id),K=new Blob([JSON.stringify(j,null,2)],{type:"application/json"}),F=URL.createObjectURL(K),ie=document.createElement("a");ie.href=F,ie.download=`report-${a.session_id}-${new Date().toISOString().split("T")[0]}.json`,ie.click(),URL.revokeObjectURL(F)}catch(j){console.error("Failed to generate report:",j)}},S=j=>{const K=new Set(_);K.has(j)?K.delete(j):K.add(j),L(K)},h=j=>{const K=new Set(D);K.has(j)?K.delete(j):K.add(j),R(K)},b=(j,K)=>{var ye,Vn,$,oe,le;const F=j.role==="user",ie=(ye=j.metadata)==null?void 0:ye.error,pe=(Vn=j.metadata)==null?void 0:Vn.api_error,Te=($=j.metadata)==null?void 0:$.tool_execution,ve=D.has(K),Se=!F&&j.content.length>z&&!ve?j.content.substring(0,z)+"...":j.content;return s.jsx("div",{className:`flex ${F?"justify-end":"justify-start"} animate-fadeIn`,children:s.jsxs("div",{className:`max-w-[85%] rounded-xl px-4 py-3 shadow-lg overflow-hidden ${F?"bg-gradient-to-r from-primary-600 to-primary-500 text-white":ie||pe?"bg-red-500/10 border border-red-500/30 text-red-300":Te?"bg-purple-500/10 border border-purple-500/30 text-purple-200":"bg-dark-800/80 border border-dark-700 text-dark-200"}`,children:[!F&&s.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs text-dark-400",children:[Te?s.jsx(vr,{className:"w-3 h-3 text-purple-400"}):s.jsx(In,{className:"w-3 h-3"}),s.jsx("span",{children:Te?"Tool Execution":"NeuroSploit AI"}),pe&&s.jsx("span",{className:"bg-red-500/20 text-red-400 px-1.5 py-0.5 rounded text-[10px]",children:"API Error"}),((oe=j.metadata)==null?void 0:oe.tests_executed)&&s.jsx("span",{className:"bg-green-500/20 text-green-400 px-1.5 py-0.5 rounded text-[10px]",children:"Tests Executed"}),((le=j.metadata)==null?void 0:le.new_findings)&&j.metadata.new_findings>0&&s.jsxs("span",{className:"bg-orange-500/20 text-orange-400 px-1.5 py-0.5 rounded text-[10px]",children:["+",j.metadata.new_findings," findings"]})]}),s.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed prose prose-invert prose-sm max-w-none break-words overflow-x-auto",children:Se}),!F&&j.content.length>z&&s.jsx("button",{onClick:()=>h(K),className:"mt-3 text-xs text-primary-400 hover:text-primary-300 transition-colors flex items-center gap-1 font-medium",children:ve?s.jsxs(s.Fragment,{children:[s.jsx(pt,{className:"w-3 h-3"}),"Show less"]}):s.jsxs(s.Fragment,{children:[s.jsx(zr,{className:"w-3 h-3"}),"Show more (",Math.ceil((j.content.length-z)/100)*100,"+ chars)"]})}),s.jsx("div",{className:`text-[10px] mt-2 ${F?"text-primary-200":"text-dark-500"}`,children:new Date(j.timestamp).toLocaleTimeString()})]})},K)},I=a!=null&&a.findings?[...a.findings].sort((j,K)=>(_u[j.severity]||4)-(_u[K.severity]||4)):[],O=I.reduce((j,K)=>{var ie;const F=((ie=K.severity)==null?void 0:ie.toLowerCase())||"info";return j[F]=(j[F]||0)+1,j},{});return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[s.jsx(Rl,{className:"w-7 h-7 text-yellow-500"}),"Real-time Task"]}),s.jsx("p",{className:"text-dark-400 mt-1",children:"Interactive AI-powered security testing with real tool execution"})]}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[E&&s.jsx("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs cursor-help ${E.available?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-red-500/20 text-red-400 border border-red-500/30"}`,title:E.error||`Connected to ${E.provider}`,children:E.available?s.jsxs(s.Fragment,{children:[s.jsx(Mn,{className:"w-3.5 h-3.5"}),s.jsx("span",{className:"font-medium",children:(J=E.provider)==null?void 0:J.toUpperCase()})]}):s.jsxs(s.Fragment,{children:[s.jsx(Jd,{className:"w-3.5 h-3.5"}),s.jsx("span",{children:"No AI"})]})}),te&&s.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs cursor-help ${te.available?"bg-blue-500/20 text-blue-400 border border-blue-500/30":"bg-dark-700 text-dark-400 border border-dark-600"}`,title:te.available?"Docker tools ready":"Docker not available",children:[s.jsx(Ye,{className:"w-3.5 h-3.5"}),s.jsx("span",{children:te.available?"Tools Ready":"No Docker"})]}),s.jsxs(H,{onClick:()=>d(!0),children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"New Session"]})]})]}),c&&s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",children:s.jsxs(re,{className:"w-full max-w-md mx-4 shadow-2xl",children:[s.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[s.jsx(Kt,{className:"w-5 h-5 text-primary-500"}),"Create New Session"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm text-dark-300 mb-1",children:"Target URL *"}),s.jsx("input",{type:"text",value:m,onChange:j=>f(j.target.value),placeholder:"https://example.com",className:"w-full bg-dark-800 border border-dark-600 rounded-lg px-4 py-2.5 text-white placeholder-dark-400 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500",autoFocus:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm text-dark-300 mb-1",children:"Session Name (optional)"}),s.jsx("input",{type:"text",value:p,onChange:j=>N(j.target.value),placeholder:"My Security Test",className:"w-full bg-dark-800 border border-dark-600 rounded-lg px-4 py-2.5 text-white placeholder-dark-400 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500"})]}),i&&s.jsxs("div",{className:"text-red-400 text-sm flex items-center gap-2 bg-red-500/10 p-3 rounded-lg",children:[s.jsx(Ct,{className:"w-4 h-4 flex-shrink-0"}),i]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[s.jsx(H,{variant:"secondary",onClick:()=>d(!1),children:"Cancel"}),s.jsx(H,{onClick:he,isLoading:v,disabled:!m.trim(),children:"Create Session"})]})]})]})}),q&&a&&s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",children:s.jsxs(re,{className:"w-full max-w-2xl mx-4 shadow-2xl",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h3",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[s.jsx(vr,{className:"w-5 h-5 text-purple-500"}),"Execute Security Tool"]}),s.jsx("button",{onClick:()=>A(!1),className:"text-dark-400 hover:text-white",children:s.jsx(Ct,{className:"w-5 h-5"})})]}),s.jsxs("p",{className:"text-dark-400 text-sm mb-4",children:["Target: ",s.jsx("span",{className:"text-white font-mono",children:a.target})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:se.map(j=>s.jsxs("button",{onClick:()=>X(j.tool),disabled:ne!==null||!(te!=null&&te.available),className:"p-4 bg-dark-800 hover:bg-dark-700 border border-dark-600 hover:border-purple-500/50 rounded-xl transition-all text-left disabled:opacity-50 disabled:cursor-not-allowed group",children:[s.jsx("div",{className:"text-2xl mb-2",children:j.icon}),s.jsx("div",{className:"font-medium text-white group-hover:text-purple-400 transition-colors",children:j.label}),s.jsx("div",{className:"text-xs text-dark-400 mt-1",children:j.description})]},j.tool))}),!(te!=null&&te.available)&&s.jsxs("div",{className:"mt-4 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg text-yellow-400 text-sm",children:[s.jsx(Jd,{className:"w-4 h-4 inline mr-2"}),"Docker is not available. Tools require Docker to be running."]})]})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[s.jsx("div",{className:"lg:col-span-1",children:s.jsx(re,{title:"Sessions",className:"h-fit",children:s.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:n.length===0?s.jsx("p",{className:"text-dark-400 text-sm text-center py-4",children:"No sessions yet. Create one to start testing."}):n.map(j=>s.jsxs("div",{className:`p-3 rounded-xl cursor-pointer transition-all ${(a==null?void 0:a.session_id)===j.session_id?"bg-primary-500/20 border border-primary-500/50 shadow-lg shadow-primary-500/10":"bg-dark-800/50 hover:bg-dark-800 border border-transparent hover:border-dark-600"}`,onClick:()=>ke(j.session_id),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-white font-medium truncate text-sm",children:j.name}),s.jsxs("p",{className:"text-dark-400 text-xs truncate flex items-center gap-1 mt-0.5",children:[s.jsx(pn,{className:"w-3 h-3"}),j.target]})]}),s.jsx("button",{onClick:K=>{K.stopPropagation(),M(j.session_id)},className:"p-1.5 text-dark-500 hover:text-red-400 hover:bg-red-500/10 rounded-lg transition-colors",children:s.jsx(Pt,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[s.jsxs("span",{className:"text-dark-400",children:[j.messages_count," msgs"]}),j.findings_count>0&&s.jsxs("span",{className:"bg-red-500/20 text-red-400 px-2 py-0.5 rounded-full font-medium",children:[j.findings_count," findings"]})]})]},j.session_id))})})}),s.jsx("div",{className:"lg:col-span-2",children:a?s.jsxs(re,{className:"flex flex-col h-[calc(100vh-220px)]",children:[s.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-dark-700",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("h3",{className:"text-white font-medium flex items-center gap-2",children:[s.jsx(Kt,{className:"w-4 h-4 text-primary-500 flex-shrink-0"}),s.jsx("span",{className:"truncate",children:a.name})]}),s.jsx("p",{className:"text-dark-400 text-sm truncate",children:a.target})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.jsxs(H,{variant:"secondary",size:"sm",onClick:()=>A(!0),disabled:ne!==null,children:[s.jsx(vr,{className:"w-4 h-4 mr-1"}),"Tools"]}),s.jsxs("div",{className:"relative group",children:[s.jsxs(H,{variant:"secondary",size:"sm",onClick:me,isLoading:ce,children:[s.jsx(yt,{className:"w-4 h-4 mr-1"}),"Report"]}),s.jsxs("div",{className:"absolute right-0 mt-1 w-40 bg-dark-800 border border-dark-600 rounded-lg shadow-xl opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all z-10",children:[s.jsxs("button",{onClick:me,className:"w-full px-3 py-2 text-left text-sm text-dark-300 hover:bg-dark-700 hover:text-white rounded-t-lg flex items-center gap-2",children:[s.jsx(An,{className:"w-3 h-3"}),"Open HTML Report"]}),s.jsxs("button",{onClick:de,className:"w-full px-3 py-2 text-left text-sm text-dark-300 hover:bg-dark-700 hover:text-white rounded-b-lg flex items-center gap-2",children:[s.jsx(i0,{className:"w-3 h-3"}),"Download JSON"]})]})]})]})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto py-4 space-y-4 scroll-smooth",children:[a.messages.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(d0,{className:"w-12 h-12 text-dark-600 mx-auto mb-3"}),s.jsx("p",{className:"text-dark-400",children:"Start by typing a security testing instruction or use a quick prompt"})]}):a.messages.map((j,K)=>b(j,K)),(u||ne)&&s.jsx("div",{className:"flex justify-start",children:s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-xl px-4 py-3 flex items-center gap-3 text-dark-400",children:[s.jsx(ln,{className:"w-4 h-4 animate-spin text-primary-500"}),s.jsx("span",{children:ne?`Running ${ne}...`:"Analyzing and testing..."})]})}),s.jsx("div",{ref:e})]}),s.jsx("div",{className:"flex flex-wrap gap-2 py-3 border-t border-dark-700",children:Y.map((j,K)=>s.jsxs("button",{onClick:()=>P(j.prompt),disabled:u||ne!==null,className:"px-3 py-1.5 text-xs bg-dark-800 hover:bg-dark-700 text-dark-300 hover:text-white rounded-full transition-all disabled:opacity-50 flex items-center gap-1.5 border border-dark-700 hover:border-dark-600",children:[s.jsx("span",{children:j.icon}),j.label]},K))}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsx("input",{ref:t,type:"text",value:k,onChange:j=>y(j.target.value),onKeyDown:j=>j.key==="Enter"&&!j.shiftKey&&P(),placeholder:"Type your security testing instruction...",disabled:u||ne!==null,className:"flex-1 bg-dark-800 border border-dark-600 rounded-xl px-4 py-3 text-white placeholder-dark-400 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500 disabled:opacity-50"}),s.jsx(H,{onClick:()=>P(),isLoading:u,disabled:!k.trim()||ne!==null,className:"px-4",children:s.jsx(dl,{className:"w-4 h-4"})})]})]}):s.jsx(re,{className:"flex flex-col items-center justify-center h-[calc(100vh-220px)]",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-20 h-20 bg-gradient-to-br from-primary-500/20 to-purple-500/20 rounded-2xl flex items-center justify-center mx-auto mb-6",children:s.jsx(Ye,{className:"w-10 h-10 text-primary-400"})}),s.jsx("h3",{className:"text-white text-lg font-medium mb-2",children:"No Session Selected"}),s.jsx("p",{className:"text-dark-400 text-center mb-6 max-w-sm",children:"Select a session from the list or create a new one to start interactive security testing"}),s.jsxs(H,{onClick:()=>d(!0),className:"mx-auto",children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"Create New Session"]})]})})}),s.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[I.length>0&&s.jsx(re,{className:"!p-3",children:s.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:["critical","high","medium","low","info"].map(j=>{const K=O[j]||0;return K===0?null:s.jsxs("div",{className:`px-2 py-1 rounded-lg text-xs font-medium flex items-center gap-1 ${j==="critical"?"bg-red-500/20 text-red-400":j==="high"?"bg-orange-500/20 text-orange-400":j==="medium"?"bg-yellow-500/20 text-yellow-400":j==="low"?"bg-blue-500/20 text-blue-400":"bg-gray-500/20 text-gray-400"}`,children:[s.jsx("span",{className:`w-2 h-2 rounded-full ${xw[j]}`}),K," ",j]},j)})})}),s.jsx(re,{title:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{className:"w-4 h-4 text-red-400"}),s.jsx("span",{children:"Findings"}),I.length>0&&s.jsx("span",{className:"bg-red-500/20 text-red-400 text-xs px-2 py-0.5 rounded-full font-medium",children:I.length})]}),className:"h-fit max-h-[calc(100vh-320px)] overflow-y-auto",children:I.length===0?s.jsxs("div",{className:"text-center py-8",children:[s.jsx(Qr,{className:"w-8 h-8 text-dark-600 mx-auto mb-2"}),s.jsx("p",{className:"text-dark-400 text-sm",children:"No findings yet. Send a testing instruction to discover vulnerabilities."})]}):s.jsx("div",{className:"space-y-2",children:I.map((j,K)=>s.jsxs("div",{className:"bg-dark-900/50 rounded-xl border border-dark-700 overflow-hidden hover:border-dark-600 transition-colors",children:[s.jsx("div",{className:"p-3 cursor-pointer hover:bg-dark-800/50 transition-colors",onClick:()=>S(K),children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[_.has(K)?s.jsx(pt,{className:"w-4 h-4 mt-0.5 text-dark-400 flex-shrink-0"}):s.jsx(zr,{className:"w-4 h-4 mt-0.5 text-dark-400 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-white truncate",children:j.title}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[s.jsx("p",{className:"text-xs text-dark-400 truncate flex-1",children:j.affected_endpoint}),j.cvss_score&&s.jsx("span",{className:`text-[10px] font-bold px-1.5 py-0.5 rounded ${j.cvss_score>=9?"bg-red-500/20 text-red-400":j.cvss_score>=7?"bg-orange-500/20 text-orange-400":j.cvss_score>=4?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:j.cvss_score})]})]})]}),s.jsx(ts,{severity:j.severity})]})}),_.has(K)&&s.jsxs("div",{className:"px-3 pb-3 pt-0 space-y-3 border-t border-dark-700 overflow-hidden",children:[(j.cvss_score||j.cwe_id||j.owasp)&&s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[j.cvss_score&&s.jsxs("div",{className:"bg-dark-800 px-2 py-1 rounded text-xs",children:[s.jsx("span",{className:"text-dark-500",children:"CVSS:"})," ",s.jsx("span",{className:`font-bold ${j.cvss_score>=9?"text-red-400":j.cvss_score>=7?"text-orange-400":j.cvss_score>=4?"text-yellow-400":"text-blue-400"}`,children:j.cvss_score})]}),j.cwe_id&&s.jsxs("div",{className:"bg-dark-800 px-2 py-1 rounded text-xs",children:[s.jsx("span",{className:"text-dark-500",children:"CWE:"})," ",s.jsx("span",{className:"text-blue-400",children:j.cwe_id})]}),j.owasp&&s.jsxs("div",{className:"bg-dark-800 px-2 py-1 rounded text-xs",children:[s.jsx("span",{className:"text-dark-500",children:"OWASP:"})," ",s.jsx("span",{className:"text-yellow-400 truncate",children:j.owasp.split(" - ")[0]})]})]}),s.jsxs("div",{className:"mt-3",children:[s.jsx("p",{className:"text-[10px] text-dark-500 uppercase tracking-wider font-medium",children:"Type"}),s.jsx("p",{className:"text-sm text-dark-300 break-words",children:j.vulnerability_type})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-dark-500 uppercase tracking-wider font-medium",children:"Description"}),s.jsx("p",{className:"text-sm text-dark-300 break-words",children:j.description})]}),j.evidence&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-dark-500 uppercase tracking-wider font-medium",children:"Evidence"}),s.jsx("p",{className:"text-sm text-dark-300 font-mono bg-dark-800 p-2 rounded-lg text-xs overflow-x-auto break-all max-h-32 overflow-y-auto",children:j.evidence})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] text-dark-500 uppercase tracking-wider font-medium",children:"Remediation"}),s.jsx("p",{className:"text-sm text-green-400 break-words",children:j.remediation})]})]})]},K))})}),a&&((C=a.recon_data)==null?void 0:C.technologies)&&a.recon_data.technologies.length>0&&s.jsx(re,{title:"Technologies",className:"!p-4",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:a.recon_data.technologies.map((j,K)=>s.jsx("span",{className:"px-2.5 py-1 text-xs bg-dark-800 text-dark-300 rounded-lg border border-dark-700",children:j},K))})})]})]})]})}function gw(){const[e,t]=x.useState([]),[n,r]=x.useState(new Map),[a,l]=x.useState(!0);x.useEffect(()=>{(async()=>{try{const[d,m]=await Promise.all([We.list(),At.list(1,100)]);t(d.reports);const f=new Map;m.scans.forEach(p=>f.set(p.id,p)),r(f)}catch(d){console.error("Failed to fetch reports:",d)}finally{l(!1)}})()},[]);const i=async c=>{if(confirm("Are you sure you want to delete this report?"))try{await We.delete(c),t(e.filter(d=>d.id!==c))}catch(d){console.error("Failed to delete report:",d)}},o=(c,d)=>{window.open(We.getDownloadUrl(c,d),"_blank")};return a?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-primary-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-white",children:"Reports"}),s.jsx("p",{className:"text-dark-400 mt-1",children:"View and download security assessment reports"})]})}),e.length===0?s.jsx(re,{children:s.jsxs("div",{className:"text-center py-12",children:[s.jsx(yt,{className:"w-16 h-16 mx-auto text-dark-500 mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-white mb-2",children:"No Reports Yet"}),s.jsx("p",{className:"text-dark-400 mb-4",children:"Reports are generated after completing a security scan."}),s.jsx(nn,{to:"/scan/new",children:s.jsx(H,{children:"Start a New Scan"})})]})}):s.jsx("div",{className:"grid gap-4",children:e.map(c=>{const d=n.get(c.scan_id);return s.jsx(re,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"p-3 bg-primary-500/10 rounded-lg",children:s.jsx(yt,{className:"w-6 h-6 text-primary-500"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-white",children:c.title||(d==null?void 0:d.name)||"Security Report"}),s.jsxs("div",{className:"flex items-center gap-3 mt-1 text-sm text-dark-400",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(yo,{className:"w-4 h-4"}),new Date(c.generated_at).toLocaleDateString()]}),s.jsx("span",{className:"uppercase text-xs bg-dark-700 px-2 py-0.5 rounded",children:c.format}),d&&s.jsxs("span",{children:[d.total_vulnerabilities," vulnerabilities"]})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(H,{variant:"ghost",onClick:()=>window.open(We.getViewUrl(c.id),"_blank"),children:[s.jsx(ol,{className:"w-4 h-4 mr-2"}),"View"]}),s.jsxs(H,{variant:"secondary",onClick:()=>o(c.id,"html"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"HTML"]}),s.jsxs(H,{variant:"secondary",onClick:()=>o(c.id,"json"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"JSON"]}),s.jsx(H,{variant:"ghost",onClick:()=>i(c.id),className:"text-red-400 hover:text-red-300",children:s.jsx(Pt,{className:"w-4 h-4"})})]})]})},c.id)})})]})}function yw(){const{reportId:e}=bc(),t=Bn(),[n,r]=x.useState(!0);return x.useEffect(()=>{if(!e){t("/reports");return}r(!1)},[e]),n||!e?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-primary-500 border-t-transparent rounded-full"})}):s.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(H,{variant:"ghost",onClick:()=>t("/reports"),children:[s.jsx(Sg,{className:"w-4 h-4 mr-2"}),"Back to Reports"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(H,{variant:"secondary",onClick:()=>window.open(We.getDownloadUrl(e,"html"),"_blank"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Download HTML"]}),s.jsxs(H,{variant:"secondary",onClick:()=>window.open(We.getDownloadUrl(e,"json"),"_blank"),children:[s.jsx(os,{className:"w-4 h-4 mr-2"}),"Download JSON"]}),s.jsxs(H,{onClick:()=>window.open(We.getViewUrl(e),"_blank"),children:[s.jsx(An,{className:"w-4 h-4 mr-2"}),"Open in New Tab"]})]})]}),s.jsx("div",{className:"bg-dark-800 rounded-xl overflow-hidden border border-dark-900/50",children:s.jsx("iframe",{src:We.getViewUrl(e),className:"w-full h-[calc(100vh-200px)]",title:"Report"})})]})}function vw(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[a,l]=x.useState(""),[i,o]=x.useState(""),[c,d]=x.useState(""),[m,f]=x.useState("claude"),[p,N]=x.useState("3"),[v,w]=x.useState(""),[k,y]=x.useState(!1),[u,g]=x.useState(!1),[_,L]=x.useState(!1),[D,R]=x.useState(!1),[E,U]=x.useState(!1),[q,A]=x.useState(!1),[te,Q]=x.useState(!1),[ne,ae]=x.useState(null);x.useEffect(()=>{ce(),xe()},[]);const ce=async()=>{try{const V=await fetch("/api/v1/settings");if(V.ok){const G=await V.json();t(G),f(G.llm_provider),N(String(G.max_concurrent_scans)),y(G.aggressive_mode),g(G.enable_model_routing??!1),L(G.enable_knowledge_augmentation??!1),R(G.enable_browser_validation??!1),w(G.max_output_tokens?String(G.max_output_tokens):"")}}catch(V){console.error("Failed to fetch settings:",V)}},xe=async()=>{try{const V=await fetch("/api/v1/settings/stats");if(V.ok){const G=await V.json();r(G)}}catch(V){console.error("Failed to fetch db stats:",V)}},z=async()=>{U(!0),ae(null);try{const V=await fetch("/api/v1/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({llm_provider:m,anthropic_api_key:a||void 0,openai_api_key:i||void 0,openrouter_api_key:c||void 0,max_concurrent_scans:parseInt(p),aggressive_mode:k,enable_model_routing:u,enable_knowledge_augmentation:_,enable_browser_validation:D,max_output_tokens:v?parseInt(v):null})});if(V.ok){const G=await V.json();t(G),l(""),o(""),d(""),ae({type:"success",text:"Settings saved successfully!"})}else ae({type:"error",text:"Failed to save settings"})}catch{ae({type:"error",text:"Failed to save settings"})}finally{U(!1)}},Y=async()=>{A(!0),ae(null);try{const V=await fetch("/api/v1/settings/clear-database",{method:"POST"});if(V.ok)ae({type:"success",text:"Database cleared successfully!"}),Q(!1),xe();else{const G=await V.json();ae({type:"error",text:G.detail||"Failed to clear database"})}}catch{ae({type:"error",text:"Failed to clear database"})}finally{A(!1)}},se=({enabled:V,onToggle:G})=>s.jsx("button",{onClick:G,className:`w-12 h-6 rounded-full transition-colors ${V?"bg-primary-500":"bg-dark-700"}`,children:s.jsx("div",{className:`w-5 h-5 bg-white rounded-full shadow-md transform transition-transform ${V?"translate-x-6":"translate-x-0.5"}`})});return s.jsxs("div",{className:"max-w-2xl mx-auto space-y-6 animate-fadeIn",children:[ne&&s.jsx("div",{className:`p-4 rounded-lg ${ne.type==="success"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"}`,children:ne.text}),s.jsx(re,{title:"LLM Configuration",subtitle:"Configure AI model for vulnerability analysis",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-200 mb-2",children:"LLM Provider"}),s.jsx("div",{className:"flex gap-2 flex-wrap",children:["claude","openai","openrouter","ollama"].map(V=>s.jsx(H,{variant:m===V?"primary":"secondary",onClick:()=>f(V),children:V==="openrouter"?"OpenRouter":V.charAt(0).toUpperCase()+V.slice(1)},V))})]}),m==="claude"&&s.jsx(st,{label:"Anthropic API Key",type:"password",placeholder:e!=null&&e.has_anthropic_key?"••••••••••••••••":"sk-ant-...",value:a,onChange:V=>l(V.target.value),helperText:e!=null&&e.has_anthropic_key?"API key is configured. Enter a new key to update.":"Required for Claude-powered analysis"}),m==="openai"&&s.jsx(st,{label:"OpenAI API Key",type:"password",placeholder:e!=null&&e.has_openai_key?"••••••••••••••••":"sk-...",value:i,onChange:V=>o(V.target.value),helperText:e!=null&&e.has_openai_key?"API key is configured. Enter a new key to update.":"Required for OpenAI-powered analysis"}),m==="openrouter"&&s.jsx(st,{label:"OpenRouter API Key",type:"password",placeholder:e!=null&&e.has_openrouter_key?"••••••••••••••••":"sk-or-...",value:c,onChange:V=>d(V.target.value),helperText:e!=null&&e.has_openrouter_key?"API key is configured. Enter a new key to update.":"Required for OpenRouter model access"}),s.jsx(st,{label:"Max Output Tokens",type:"number",min:"1024",max:"64000",placeholder:"Default (profile-based)",value:v,onChange:V=>w(V.target.value),helperText:"Override max output tokens (up to 64000 for Claude). Leave empty for profile defaults."})]})}),s.jsx(re,{title:"Advanced Features",subtitle:"Optional AI enhancement modules",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Dg,{className:"w-5 h-5 text-blue-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Model Routing"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Route tasks to specialized LLM profiles by type (reasoning, analysis, generation)"})]})]}),s.jsx(se,{enabled:u,onToggle:()=>g(!u)})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Mt,{className:"w-5 h-5 text-purple-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Knowledge Augmentation"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Enrich AI context with bug bounty pattern datasets (19 vuln types)"})]})]}),s.jsx(se,{enabled:_,onToggle:()=>L(!_)})]}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ol,{className:"w-5 h-5 text-green-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Browser Validation"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Playwright-based browser validation with screenshot capture"})]})]}),s.jsx(se,{enabled:D,onToggle:()=>R(!D)})]})]})}),s.jsx(re,{title:"Scan Settings",subtitle:"Configure default scan behavior",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(st,{label:"Max Concurrent Scans",type:"number",min:"1",max:"10",value:p,onChange:V=>N(V.target.value),helperText:"Maximum number of scans that can run simultaneously"}),s.jsxs("div",{className:"flex items-center justify-between p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Enable Aggressive Mode"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Use more payloads and bypass techniques (may be slower)"})]}),s.jsx(se,{enabled:k,onToggle:()=>y(!k)})]})]})}),s.jsx(re,{title:"Database Management",subtitle:"Manage stored data",children:s.jsxs("div",{className:"space-y-4",children:[n&&s.jsxs("div",{className:"grid grid-cols-4 gap-4 p-4 bg-dark-900/50 rounded-lg",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:n.scans}),s.jsx("p",{className:"text-xs text-dark-400",children:"Scans"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:n.vulnerabilities}),s.jsx("p",{className:"text-xs text-dark-400",children:"Vulnerabilities"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:n.endpoints}),s.jsx("p",{className:"text-xs text-dark-400",children:"Endpoints"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-white",children:n.reports}),s.jsx("p",{className:"text-xs text-dark-400",children:"Reports"})]})]}),te?s.jsxs("div",{className:"p-4 bg-red-500/20 border border-red-500/50 rounded-lg space-y-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Oe,{className:"w-6 h-6 text-red-400 flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-red-400",children:"Are you sure?"}),s.jsx("p",{className:"text-sm text-dark-300 mt-1",children:"This will permanently delete all scans, vulnerabilities, endpoints, and reports. This action cannot be undone."})]})]}),s.jsxs("div",{className:"flex gap-3 justify-end",children:[s.jsx(H,{variant:"secondary",onClick:()=>Q(!1),children:"Cancel"}),s.jsxs(H,{variant:"danger",onClick:Y,isLoading:q,children:[s.jsx(Pt,{className:"w-4 h-4 mr-2"}),"Yes, Clear Everything"]})]})]}):s.jsxs("div",{className:"flex items-center justify-between p-4 bg-red-500/10 border border-red-500/30 rounded-lg",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-white",children:"Clear All Data"}),s.jsx("p",{className:"text-sm text-dark-400",children:"Remove all scans, vulnerabilities, and reports"})]}),s.jsxs(H,{variant:"danger",onClick:()=>Q(!0),children:[s.jsx(Pt,{className:"w-4 h-4 mr-2"}),"Clear Database"]})]}),s.jsxs(H,{variant:"secondary",onClick:xe,className:"w-full",children:[s.jsx(ln,{className:"w-4 h-4 mr-2"}),"Refresh Statistics"]})]})}),s.jsx(re,{title:"About NeuroSploit",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ke,{className:"w-8 h-8 text-primary-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-bold text-white text-lg",children:"NeuroSploit v3.0"}),s.jsx("p",{className:"text-sm text-dark-400",children:"AI-Powered Penetration Testing Platform"})]})]}),s.jsxs("div",{className:"text-sm text-dark-400 space-y-1",children:[s.jsx("p",{children:"Dynamic vulnerability testing driven by AI prompts"}),s.jsx("p",{children:"50+ vulnerability types across 10 categories"}),s.jsx("p",{children:"Multi-provider LLM support (Claude, GPT, OpenRouter, Ollama)"}),s.jsx("p",{children:"Task-type model routing and knowledge augmentation"}),s.jsx("p",{children:"Playwright browser validation with screenshot capture"}),s.jsx("p",{children:"OHVR-structured PoC reporting"}),s.jsx("p",{children:"Scheduled recurring scans with cron/interval triggers"})]})]})}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(H,{onClick:z,isLoading:E,size:"lg",children:[s.jsx(u0,{className:"w-5 h-5 mr-2"}),"Save Settings"]})})]})}const Cu=[{label:"Every Hour",value:"0 * * * *",desc:"Runs at the start of every hour"},{label:"Every 6 Hours",value:"0 */6 * * *",desc:"Runs every 6 hours"},{label:"Daily at 2 AM",value:"0 2 * * *",desc:"Runs once a day at 2:00 AM"},{label:"Daily at Midnight",value:"0 0 * * *",desc:"Runs once a day at midnight"},{label:"Weekdays at 9 AM",value:"0 9 * * 1-5",desc:"Monday to Friday at 9:00 AM"},{label:"Weekly (Monday)",value:"0 0 * * 1",desc:"Every Monday at midnight"},{label:"Weekly (Friday)",value:"0 18 * * 5",desc:"Every Friday at 6:00 PM"},{label:"Monthly (1st)",value:"0 0 1 * *",desc:"First day of each month"},{label:"Custom",value:"custom",desc:"Enter a custom cron expression"}],ww=[{id:"quick",label:"Quick",icon:Rl,desc:"Fast surface scan"},{id:"full",label:"Full",icon:Qr,desc:"Comprehensive analysis"},{id:"custom",label:"Custom",icon:zg,desc:"Custom configuration"}],Eu=[{id:0,short:"Sun",full:"Sunday"},{id:1,short:"Mon",full:"Monday"},{id:2,short:"Tue",full:"Tuesday"},{id:3,short:"Wed",full:"Wednesday"},{id:4,short:"Thu",full:"Thursday"},{id:5,short:"Fri",full:"Friday"},{id:6,short:"Sat",full:"Saturday"}];function jw(){var h;const[e,t]=x.useState([]),[n,r]=x.useState([]),[a,l]=x.useState(!0),[i,o]=x.useState(!1),[c,d]=x.useState(null),[m,f]=x.useState(null),[p,N]=x.useState(""),[v,w]=x.useState(""),[k,y]=x.useState("quick"),[u,g]=x.useState("preset"),[_,L]=x.useState("0 2 * * *"),[D,R]=x.useState(""),[E,U]=x.useState("60"),[q,A]=x.useState([1,2,3,4,5]),[te,Q]=x.useState("02"),[ne,ae]=x.useState("00"),[ce,xe]=x.useState(""),[z,Y]=x.useState(!1),[se,V]=x.useState(!1),G=x.useCallback(async()=>{l(!0);try{const[b,I]=await Promise.all([fs.list(),fs.getAgentRoles()]);t(b),r(I)}catch(b){console.error("Failed to fetch scheduler data:",b)}finally{l(!1)}},[]);x.useEffect(()=>{G()},[G]),x.useEffect(()=>{if(c){const b=setTimeout(()=>d(null),4e3);return()=>clearTimeout(b)}},[c]);const ge=()=>{if(u==="interval")return;if(u==="preset")return _==="custom"?D:_;if(q.length===0)return;const b=q.sort((I,O)=>I-O).join(",");return`${ne} ${te} * * ${b}`},he=()=>{if(u==="interval")return parseInt(E)||60},ke=async()=>{var O,J;if(!p.trim()){d({type:"error",text:"Job ID is required"});return}if(!v.trim()){d({type:"error",text:"Target URL is required"});return}const b=ge(),I=he();if(!b&&!I){d({type:"error",text:"Please configure a schedule (select days or set interval)"});return}V(!0),d(null);try{await fs.create({job_id:p.trim(),target:v.trim(),scan_type:k,cron_expression:b,interval_minutes:I,agent_role:ce||void 0}),d({type:"success",text:`Schedule "${p}" created successfully`}),o(!1),de(),G()}catch(C){const j=((J=(O=C==null?void 0:C.response)==null?void 0:O.data)==null?void 0:J.detail)||"Failed to create schedule";d({type:"error",text:j})}finally{V(!1)}},P=async b=>{try{await fs.delete(b),d({type:"success",text:`Schedule "${b}" deleted`}),f(null),G()}catch{d({type:"error",text:`Failed to delete "${b}"`})}},X=async b=>{try{await fs.pause(b),G()}catch{d({type:"error",text:`Failed to pause "${b}"`})}},M=async b=>{try{await fs.resume(b),G()}catch{d({type:"error",text:`Failed to resume "${b}"`})}},me=b=>{A(I=>I.includes(b)?I.filter(O=>O!==b):[...I,b])},de=()=>{N(""),w(""),y("quick"),g("preset"),L("0 2 * * *"),R(""),U("60"),A([1,2,3,4,5]),Q("02"),ae("00"),xe(""),Y(!1)},S=n.find(b=>b.id===ce);return s.jsxs("div",{className:"max-w-5xl mx-auto space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-brand-500/20 rounded-lg",children:s.jsx(yo,{className:"w-6 h-6 text-brand-400"})}),"Scan Scheduler"]}),s.jsx("p",{className:"text-dark-400 mt-1 ml-14",children:"Schedule automated recurring scans with agent specialization"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(H,{variant:"secondary",onClick:G,children:[s.jsx(ln,{className:"w-4 h-4 mr-2"}),"Refresh"]}),s.jsxs(H,{onClick:()=>{o(!i),i&&de()},children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"New Schedule"]})]})]}),c&&s.jsxs("div",{className:`flex items-center gap-3 p-4 rounded-lg border transition-all ${c.type==="success"?"bg-green-500/10 border-green-500/30 text-green-400":"bg-red-500/10 border-red-500/30 text-red-400"}`,children:[c.type==="success"?s.jsx(Mn,{className:"w-5 h-5 flex-shrink-0"}):s.jsx(Oe,{className:"w-5 h-5 flex-shrink-0"}),s.jsx("span",{children:c.text})]}),i&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"p-5 border-b border-dark-700",children:[s.jsx("h3",{className:"text-lg font-semibold text-white",children:"Create New Schedule"}),s.jsx("p",{className:"text-dark-400 text-sm mt-1",children:"Configure a recurring scan with specialized agent roles"})]}),s.jsxs("div",{className:"p-5 space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(st,{label:"Job ID",placeholder:"daily-scan-prod",value:p,onChange:b=>N(b.target.value),helperText:"Unique identifier for this schedule"}),s.jsx(st,{label:"Target URL",placeholder:"https://example.com",value:v,onChange:b=>w(b.target.value),helperText:"URL to scan on each execution"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-200 mb-3",children:"Scan Type"}),s.jsx("div",{className:"grid grid-cols-3 gap-3",children:ww.map(({id:b,label:I,icon:O,desc:J})=>s.jsxs("button",{onClick:()=>y(b),className:`p-4 rounded-lg border-2 text-left transition-all ${k===b?"border-brand-500 bg-brand-500/10":"border-dark-600 bg-dark-900/50 hover:border-dark-500"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(O,{className:`w-4 h-4 ${k===b?"text-brand-400":"text-dark-400"}`}),s.jsx("span",{className:`font-medium ${k===b?"text-white":"text-dark-300"}`,children:I})]}),s.jsx("p",{className:"text-xs text-dark-500",children:J})]},b))})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-dark-200 mb-3",children:[s.jsx(Ke,{className:"w-4 h-4 inline mr-1 -mt-0.5"}),"Agent Role"]}),s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>Y(!z),className:"w-full flex items-center justify-between p-3 rounded-lg border border-dark-600 bg-dark-900/50 hover:border-dark-500 transition-colors text-left",children:[s.jsx("div",{children:S?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-white font-medium",children:S.name}),s.jsxs("span",{className:"text-dark-500 text-sm ml-2",children:["- ",S.description]})]}):s.jsx("span",{className:"text-dark-500",children:"Select an agent role (optional)"})}),s.jsx(pt,{className:`w-4 h-4 text-dark-400 transition-transform ${z?"rotate-180":""}`})]}),z&&s.jsxs("div",{className:"absolute z-20 w-full mt-1 bg-dark-800 border border-dark-600 rounded-lg shadow-xl max-h-72 overflow-y-auto",children:[s.jsxs("button",{onClick:()=>{xe(""),Y(!1)},className:`w-full flex items-start gap-3 p-3 text-left hover:bg-dark-700/50 transition-colors border-b border-dark-700/50 ${ce?"":"bg-dark-700/30"}`,children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-dark-600 flex items-center justify-center flex-shrink-0 mt-0.5",children:s.jsx(Kt,{className:"w-4 h-4 text-dark-400"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-dark-300 font-medium",children:"Default Agent"}),s.jsx("p",{className:"text-dark-500 text-xs",children:"No specialization - uses general pentest agent"})]})]}),n.map(b=>s.jsxs("button",{onClick:()=>{xe(b.id),Y(!1)},className:`w-full flex items-start gap-3 p-3 text-left hover:bg-dark-700/50 transition-colors ${ce===b.id?"bg-brand-500/10 border-l-2 border-brand-500":""}`,children:[s.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5 ${ce===b.id?"bg-brand-500/20":"bg-dark-600"}`,children:s.jsx(Ke,{className:`w-4 h-4 ${ce===b.id?"text-brand-400":"text-dark-400"}`})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:`font-medium ${ce===b.id?"text-brand-400":"text-white"}`,children:b.name}),s.jsx("p",{className:"text-dark-500 text-xs mt-0.5",children:b.description}),b.tools.length>0&&s.jsxs("div",{className:"flex flex-wrap gap-1 mt-1.5",children:[b.tools.slice(0,4).map(I=>s.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-dark-600 text-dark-300 rounded",children:I},I)),b.tools.length>4&&s.jsxs("span",{className:"px-1.5 py-0.5 text-[10px] bg-dark-600 text-dark-400 rounded",children:["+",b.tools.length-4]})]})]})]},b.id))]})]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-dark-200 mb-3",children:[s.jsx(Xt,{className:"w-4 h-4 inline mr-1 -mt-0.5"}),"Schedule"]}),s.jsx("div",{className:"flex gap-1 p-1 bg-dark-900/50 rounded-lg mb-4",children:[{id:"preset",label:"Presets"},{id:"days",label:"Days & Time"},{id:"interval",label:"Interval"}].map(b=>s.jsx("button",{onClick:()=>g(b.id),className:`flex-1 py-2 px-3 rounded-md text-sm font-medium transition-all ${u===b.id?"bg-brand-500 text-white shadow-sm":"text-dark-400 hover:text-dark-200"}`,children:b.label},b.id))}),u==="preset"&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"grid grid-cols-2 gap-2",children:Cu.map(b=>s.jsxs("button",{onClick:()=>L(b.value),className:`p-3 rounded-lg border text-left transition-all ${_===b.value?"border-brand-500 bg-brand-500/10":"border-dark-600 bg-dark-900/30 hover:border-dark-500"}`,children:[s.jsx("p",{className:`text-sm font-medium ${_===b.value?"text-brand-400":"text-dark-200"}`,children:b.label}),s.jsx("p",{className:"text-xs text-dark-500 mt-0.5",children:b.desc})]},b.value))}),_==="custom"&&s.jsx(st,{label:"Custom Cron Expression",placeholder:"*/30 * * * *",value:D,onChange:b=>R(b.target.value),helperText:"Format: minute hour day-of-month month day-of-week"})]}),u==="days"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400 mb-2",children:"Select days of the week"}),s.jsx("div",{className:"flex gap-2",children:Eu.map(b=>s.jsx("button",{onClick:()=>me(b.id),className:`flex-1 py-3 rounded-lg border-2 text-center text-sm font-medium transition-all ${q.includes(b.id)?"border-brand-500 bg-brand-500/15 text-brand-400":"border-dark-600 bg-dark-900/30 text-dark-400 hover:border-dark-500"}`,title:b.full,children:b.short},b.id))}),s.jsxs("div",{className:"flex gap-2 mt-2",children:[s.jsx("button",{onClick:()=>A([1,2,3,4,5]),className:"text-xs text-brand-400 hover:text-brand-300 transition-colors",children:"Weekdays"}),s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsx("button",{onClick:()=>A([0,6]),className:"text-xs text-brand-400 hover:text-brand-300 transition-colors",children:"Weekends"}),s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsx("button",{onClick:()=>A([0,1,2,3,4,5,6]),className:"text-xs text-brand-400 hover:text-brand-300 transition-colors",children:"Every Day"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-dark-400 mb-2",children:"Execution Time"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("select",{value:te,onChange:b=>Q(b.target.value),className:"bg-dark-900 border border-dark-600 rounded-lg px-3 py-2.5 text-white text-sm focus:border-brand-500 focus:outline-none",children:Array.from({length:24},(b,I)=>s.jsx("option",{value:String(I).padStart(2,"0"),children:String(I).padStart(2,"0")},I))}),s.jsx("span",{className:"text-dark-400 text-lg font-bold",children:":"}),s.jsx("select",{value:ne,onChange:b=>ae(b.target.value),className:"bg-dark-900 border border-dark-600 rounded-lg px-3 py-2.5 text-white text-sm focus:border-brand-500 focus:outline-none",children:["00","15","30","45"].map(b=>s.jsx("option",{value:b,children:b},b))}),s.jsx("span",{className:"text-dark-500 text-sm ml-2",children:"UTC"})]})]}),q.length>0&&s.jsx("div",{className:"p-3 bg-dark-900/50 rounded-lg border border-dark-700/50",children:s.jsxs("p",{className:"text-xs text-dark-400",children:["Cron: ",s.jsx("code",{className:"text-brand-400 bg-dark-700 px-1.5 py-0.5 rounded",children:`${ne} ${te} * * ${q.sort((b,I)=>b-I).join(",")}`})]})})]}),u==="interval"&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"grid grid-cols-4 gap-2",children:[{label:"15 min",value:"15"},{label:"30 min",value:"30"},{label:"1 hour",value:"60"},{label:"2 hours",value:"120"},{label:"4 hours",value:"240"},{label:"6 hours",value:"360"},{label:"12 hours",value:"720"},{label:"24 hours",value:"1440"}].map(b=>s.jsx("button",{onClick:()=>U(b.value),className:`py-2.5 px-3 rounded-lg border text-sm font-medium transition-all ${E===b.value?"border-brand-500 bg-brand-500/10 text-brand-400":"border-dark-600 bg-dark-900/30 text-dark-400 hover:border-dark-500"}`,children:b.label},b.value))}),s.jsx(st,{label:"Custom interval (minutes)",type:"number",min:"1",value:E,onChange:b=>U(b.target.value),helperText:`Scan runs every ${parseInt(E)>=60?`${Math.floor(parseInt(E)/60)}h ${parseInt(E)%60}m`:`${E} minutes`}`})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-dark-700",children:[s.jsx("p",{className:"text-xs text-dark-500",children:u==="interval"?`Runs every ${parseInt(E)>=60?`${Math.floor(parseInt(E)/60)} hour(s)`:`${E} min`}`:u==="days"&&q.length>0?`Runs on ${q.sort((b,I)=>b-I).map(b=>Eu[b].short).join(", ")} at ${te}:${ne}`:u==="preset"&&_!=="custom"&&((h=Cu.find(b=>b.value===_))==null?void 0:h.desc)||""}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(H,{variant:"secondary",onClick:()=>{o(!1),de()},children:"Cancel"}),s.jsxs(H,{onClick:ke,isLoading:se,children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"Create Schedule"]})]})]})]})]}),e.length>0&&s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"bg-dark-800/50 border border-dark-700/50 rounded-lg p-4",children:[s.jsx("p",{className:"text-dark-400 text-sm",children:"Total Schedules"}),s.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:e.length})]}),s.jsxs("div",{className:"bg-dark-800/50 border border-dark-700/50 rounded-lg p-4",children:[s.jsx("p",{className:"text-dark-400 text-sm",children:"Active"}),s.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:e.filter(b=>b.status==="active").length})]}),s.jsxs("div",{className:"bg-dark-800/50 border border-dark-700/50 rounded-lg p-4",children:[s.jsx("p",{className:"text-dark-400 text-sm",children:"Total Runs"}),s.jsx("p",{className:"text-2xl font-bold text-brand-400 mt-1",children:e.reduce((b,I)=>b+I.run_count,0)})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center justify-between mb-4",children:s.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Scheduled Jobs",s.jsxs("span",{className:"text-dark-500 text-sm font-normal ml-2",children:[e.length," job",e.length!==1?"s":""]})]})}),a?s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsx(ln,{className:"w-6 h-6 text-dark-400 animate-spin"})}):e.length===0?s.jsx(re,{children:s.jsxs("div",{className:"text-center py-16",children:[s.jsx("div",{className:"w-16 h-16 bg-dark-700/50 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(yo,{className:"w-8 h-8 text-dark-500"})}),s.jsx("p",{className:"text-dark-300 font-medium",children:"No scheduled jobs yet"}),s.jsx("p",{className:"text-dark-500 text-sm mt-1 mb-4",children:"Create a schedule to run automated recurring scans"}),s.jsxs(H,{onClick:()=>o(!0),children:[s.jsx(Gt,{className:"w-4 h-4 mr-2"}),"Create First Schedule"]})]})}):s.jsx("div",{className:"space-y-3",children:e.map(b=>s.jsx("div",{className:"bg-dark-800 border border-dark-700/50 rounded-xl p-5 hover:border-dark-600 transition-colors",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 ${b.status==="active"?"bg-green-500/15":"bg-yellow-500/15"}`,children:b.status==="active"?s.jsx(Yt,{className:"w-5 h-5 text-green-400"}):s.jsx(cl,{className:"w-5 h-5 text-yellow-400"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("p",{className:"font-semibold text-white text-lg",children:b.id}),s.jsx("span",{className:`px-2.5 py-0.5 text-xs rounded-full font-medium ${b.status==="active"?"bg-green-500/15 text-green-400 border border-green-500/30":"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30"}`,children:b.status}),s.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-dark-700 text-dark-300",children:b.scan_type}),b.agent_role&&s.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-brand-500/15 text-brand-400 border border-brand-500/30",children:b.agent_role.replace(/_/g," ")})]}),s.jsxs("div",{className:"flex items-center gap-4 mt-2 text-sm text-dark-400",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Kt,{className:"w-3.5 h-3.5"}),b.target]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Xt,{className:"w-3.5 h-3.5"}),b.schedule]}),b.run_count>0&&s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(ln,{className:"w-3.5 h-3.5"}),b.run_count," run",b.run_count!==1?"s":""]})]}),(b.next_run||b.last_run)&&s.jsxs("div",{className:"flex items-center gap-4 mt-1.5 text-xs text-dark-500",children:[b.next_run&&s.jsxs("span",{children:["Next: ",new Date(b.next_run).toLocaleString()]}),b.last_run&&s.jsxs("span",{children:["Last: ",new Date(b.last_run).toLocaleString()]})]})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[b.status==="active"?s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>X(b.id),title:"Pause schedule",children:s.jsx(cl,{className:"w-4 h-4 text-yellow-400"})}):s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>M(b.id),title:"Resume schedule",children:s.jsx(Yt,{className:"w-4 h-4 text-green-400"})}),m===b.id?s.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>P(b.id),children:s.jsx("span",{className:"text-red-400 text-xs font-medium",children:"Confirm"})}),s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>f(null),children:s.jsx("span",{className:"text-dark-400 text-xs",children:"Cancel"})})]}):s.jsx(H,{variant:"ghost",size:"sm",onClick:()=>f(b.id),title:"Delete schedule",children:s.jsx(Pt,{className:"w-4 h-4 text-red-400"})})]})]})},b.id))})]})]})}const kw=[{key:"parallel",label:"Parallel Streams",icon:$g,range:[0,50]},{key:"deep",label:"Deep Analysis",icon:Mt,range:[50,75]},{key:"final",label:"Finalization",icon:Ke,range:[75,100]}],bw=[{key:"recon",label:"Recon",icon:pn,color:"blue",activeUntil:25},{key:"junior",label:"Junior AI",icon:Mt,color:"purple",activeUntil:35},{key:"tools",label:"Tools",icon:vr,color:"orange",activeUntil:50}],Nw={blue:{bg:"bg-blue-500/20",text:"text-blue-400",border:"border-blue-500/40",pulse:"bg-blue-400"},purple:{bg:"bg-purple-500/20",text:"text-purple-400",border:"border-purple-500/40",pulse:"bg-purple-400"},orange:{bg:"bg-orange-500/20",text:"text-orange-400",border:"border-orange-500/40",pulse:"bg-orange-400"}};function Sw(e){return e<50?0:e<75?1:2}function _w({stream:e,progress:t,isRunning:n}){const r=n&&t=e.activeUntil,l=Nw[e.color],i=e.icon;return s.jsxs("div",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border text-xs font-medium transition-all duration-300 ${r?`${l.bg} ${l.text} ${l.border}`:a?"bg-dark-700/50 text-dark-400 border-dark-600":"bg-dark-900 text-dark-500 border-dark-700"}`,children:[r&&s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:`animate-ping absolute inline-flex h-full w-full rounded-full ${l.pulse} opacity-75`}),s.jsx("span",{className:`relative inline-flex rounded-full h-2 w-2 ${l.pulse}`})]}),a&&s.jsx(Mn,{className:"w-3 h-3 text-green-500"}),!r&&!a&&s.jsx(i,{className:"w-3 h-3"}),s.jsx("span",{children:e.label})]})}function Ru(e){return e.startsWith("[STREAM 1]")?"text-blue-400":e.startsWith("[STREAM 2]")?"text-purple-400":e.startsWith("[STREAM 3]")?"text-orange-400":e.startsWith("[TOOL]")?"text-orange-300":e.startsWith("[DEEP]")?"text-cyan-400":e.startsWith("[FINAL]")?"text-green-400":""}const Tu={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-blue-500",info:"bg-gray-500"},Cw={critical:"border-red-500/40",high:"border-orange-500/40",medium:"border-yellow-500/40",low:"border-blue-500/40",info:"border-gray-500/40"};function Pu(e){let t=null;if(typeof e.confidence_score=="number")t=e.confidence_score;else if(e.confidence){const a=Number(e.confidence);isNaN(a)?t={high:90,medium:60,low:30}[e.confidence.toLowerCase()]??null:t=a}if(t===null)return null;const n=t>=90?"green":t>=60?"yellow":"red",r=t>=90?"Confirmed":t>=60?"Likely":"Low";return{score:t,color:n,label:r}}const Lu={green:"bg-green-500/15 text-green-400 border-green-500/30",yellow:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",red:"bg-red-500/15 text-red-400 border-red-500/30"},wi="neurosploit_autopentest_session";function Ew(){const e=Bn(),[t,n]=x.useState(""),[r,a]=x.useState(!1),[l,i]=x.useState(""),[o,c]=x.useState(!1),[d,m]=x.useState(!1),[f,p]=x.useState(""),[N,v]=x.useState(""),[w,k]=x.useState(!1),[y,u]=x.useState(""),[g,_]=x.useState(!1),[L,D]=x.useState(null),[R,E]=x.useState(null),[U,q]=x.useState(null),[A,te]=x.useState(!0),[Q,ne]=x.useState(!1),[ae,ce]=x.useState([]),[xe,z]=x.useState(null),[Y,se]=x.useState(!1),[V,G]=x.useState(null),ge=x.useRef(null),he=x.useRef(null);x.useEffect(()=>{try{const C=localStorage.getItem(wi);if(C){const j=JSON.parse(C);D(j.agentId),n(j.target),_(!0)}}catch{}},[]),x.useEffect(()=>{if(L&&g){const C={agentId:L,target:t||"",startedAt:new Date().toISOString()};localStorage.setItem(wi,JSON.stringify(C))}},[L,g,t]),x.useEffect(()=>{if(!L)return;const C=async()=>{try{const j=await we.getStatus(L);E(j),(j.status==="completed"||j.status==="error"||j.status==="stopped")&&(_(!1),ge.current&&clearInterval(ge.current))}catch{}try{const j=await we.getLogs(L,200);ce(j.logs||[])}catch{}};return C(),ge.current=setInterval(C,3e3),()=>{ge.current&&clearInterval(ge.current)}},[L]),x.useEffect(()=>{Q&&he.current&&he.current.scrollIntoView({behavior:"smooth"})},[ae,Q]);const ke=async()=>{var j,K;const C=t.trim();if(C){q(null),_(!0),E(null),ce([]),G(null);try{const F=r?l.split(` +`).map(pe=>pe.trim()).filter(Boolean):void 0,ie=await we.autoPentest(C,{subdomain_discovery:o,targets:F,auth_type:f||void 0,auth_value:N||void 0,prompt:y.trim()||void 0});D(ie.agent_id)}catch(F){q(((K=(j=F==null?void 0:F.response)==null?void 0:j.data)==null?void 0:K.detail)||(F==null?void 0:F.message)||"Failed to start pentest"),_(!1)}}},P=async()=>{if(L)try{await we.stop(L),_(!1)}catch{}},X=()=>{localStorage.removeItem(wi),D(null),E(null),ce([]),_(!1),q(null),G(null),n("")},M=x.useCallback(async()=>{var C,j;if(R!=null&&R.scan_id){se(!0);try{const K=await We.generateAiReport({scan_id:R.scan_id,title:`AI Pentest Report - ${t}`});G(K.id)}catch(K){q(((j=(C=K==null?void 0:K.response)==null?void 0:C.data)==null?void 0:j.detail)||"Failed to generate AI report")}finally{se(!1)}}},[R==null?void 0:R.scan_id,t]),me=R?Sw(R.progress):-1,de=(R==null?void 0:R.findings)||[],S=(R==null?void 0:R.rejected_findings)||[],h=[...de,...S],[b,I]=x.useState("all"),O=b==="confirmed"?de:b==="rejected"?S:h,J=de.reduce((C,j)=>(C[j.severity]=(C[j.severity]||0)+1,C),{});return s.jsxs("div",{className:"min-h-screen flex flex-col items-center py-12 px-4",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-green-500/20 rounded-2xl mb-4",children:s.jsx(wo,{className:"w-8 h-8 text-green-400"})}),s.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Auto Pentest"}),s.jsx("p",{className:"text-dark-400 max-w-md",children:"One-click comprehensive penetration test. 100 vulnerability types, AI-powered analysis, full report."})]}),!L&&s.jsxs("div",{className:"w-full max-w-2xl bg-dark-800 border border-dark-700 rounded-2xl p-8",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Target URL"}),s.jsx("input",{type:"url",value:t,onChange:C=>n(C.target.value),placeholder:"https://example.com",disabled:g,className:"w-full px-4 py-4 bg-dark-900 border border-dark-600 rounded-xl text-white text-lg placeholder-dark-500 focus:outline-none focus:border-green-500 focus:ring-1 focus:ring-green-500 disabled:opacity-50"})]}),s.jsxs("div",{className:"flex flex-wrap gap-4 mb-6",children:[s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:o,onChange:C=>c(C.target.checked),disabled:g,className:"w-4 h-4 rounded bg-dark-900 border-dark-600 text-green-500 focus:ring-green-500"}),s.jsx("span",{className:"text-sm text-dark-300",children:"Subdomain Discovery"})]}),s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:C=>a(C.target.checked),disabled:g,className:"w-4 h-4 rounded bg-dark-900 border-dark-600 text-green-500 focus:ring-green-500"}),s.jsx("span",{className:"text-sm text-dark-300",children:"Multiple Targets"})]})]}),r&&s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Additional Targets (one per line)"}),s.jsx("textarea",{value:l,onChange:C=>i(C.target.value),rows:4,disabled:g,placeholder:`https://api.example.com +https://admin.example.com`,className:"w-full px-4 py-3 bg-dark-900 border border-dark-600 rounded-xl text-white placeholder-dark-500 focus:outline-none focus:border-green-500 disabled:opacity-50"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>m(!d),disabled:g,className:"flex items-center gap-2 text-sm text-dark-400 hover:text-white transition-colors disabled:opacity-50",children:[s.jsx(c0,{className:"w-4 h-4"}),s.jsx("span",{children:"Authentication (Optional)"}),d?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),d&&s.jsxs("div",{className:"mt-3 space-y-3 pl-6",children:[s.jsxs("select",{value:f,onChange:C=>p(C.target.value),disabled:g,className:"w-full px-3 py-2 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm focus:outline-none focus:border-green-500",children:[s.jsx("option",{value:"",children:"No Authentication"}),s.jsx("option",{value:"bearer",children:"Bearer Token"}),s.jsx("option",{value:"cookie",children:"Cookie"}),s.jsx("option",{value:"basic",children:"Basic Auth (user:pass)"}),s.jsx("option",{value:"header",children:"Custom Header (Name:Value)"})]}),f&&s.jsx("input",{type:"text",value:N,onChange:C=>v(C.target.value),disabled:g,placeholder:f==="bearer"?"eyJhbGciOiJIUzI1NiIs...":f==="cookie"?"session=abc123; token=xyz":f==="basic"?"admin:password123":"X-API-Key:your-api-key",className:"w-full px-3 py-2 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm placeholder-dark-500 focus:outline-none focus:border-green-500"})]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>k(!w),disabled:g,className:"flex items-center gap-2 text-sm text-dark-400 hover:text-white transition-colors disabled:opacity-50",children:[s.jsx(d0,{className:"w-4 h-4"}),s.jsx("span",{children:"Custom AI Prompt (Optional)"}),w?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),w&&s.jsxs("div",{className:"mt-3 pl-6",children:[s.jsx("textarea",{value:y,onChange:C=>u(C.target.value),rows:4,disabled:g,placeholder:`Focus on authentication bypass and IDOR vulnerabilities. +The app uses JWT tokens in localStorage. +Admin panel at /admin requires role=admin cookie.`,className:"w-full px-4 py-3 bg-dark-900 border border-dark-600 rounded-xl text-white text-sm placeholder-dark-500 focus:outline-none focus:border-green-500 disabled:opacity-50"}),s.jsx("p",{className:"mt-1 text-xs text-dark-500",children:"Guide the AI agent with additional context, focus areas, or specific instructions."})]})]}),U&&s.jsxs("div",{className:"mb-6 p-3 bg-red-500/10 border border-red-500/20 rounded-lg flex items-center gap-2",children:[s.jsx(Oe,{className:"w-5 h-5 text-red-400"}),s.jsx("span",{className:"text-red-400 text-sm",children:U})]}),s.jsxs("button",{onClick:ke,disabled:!t.trim(),className:"w-full py-4 bg-green-500 hover:bg-green-600 disabled:bg-dark-600 disabled:text-dark-400 text-white font-bold text-lg rounded-xl transition-colors flex items-center justify-center gap-3",children:[s.jsx(wo,{className:"w-6 h-6"}),"START PENTEST"]})]}),L&&s.jsxs("div",{className:"w-full max-w-4xl",children:[s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${g?"bg-green-500 animate-pulse":(R==null?void 0:R.status)==="completed"?"bg-green-500":(R==null?void 0:R.status)==="error"?"bg-red-500":"bg-gray-500"}`}),s.jsx("h3",{className:"text-white font-semibold",children:g?"Pentest Running":(R==null?void 0:R.status)==="completed"?"Pentest Complete":(R==null?void 0:R.status)==="error"?"Pentest Failed":"Pentest Stopped"}),s.jsx("span",{className:"text-dark-400 text-sm",children:t})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[g&&s.jsxs("button",{onClick:P,className:"px-4 py-1.5 bg-red-500/20 hover:bg-red-500/30 text-red-400 rounded-lg text-sm transition-colors flex items-center gap-1.5",children:[s.jsx(Sc,{className:"w-4 h-4"})," Stop"]}),!g&&s.jsxs("button",{onClick:X,className:"px-4 py-1.5 bg-dark-700 hover:bg-dark-600 text-dark-300 rounded-lg text-sm transition-colors flex items-center gap-1.5",children:[s.jsx(Pt,{className:"w-4 h-4"})," Clear Session"]})]})]}),R&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[s.jsx("span",{className:"text-dark-400",children:R.phase||"Initializing..."}),s.jsxs("span",{className:"text-dark-400",children:[R.progress,"%"]})]}),s.jsx("div",{className:"w-full bg-dark-900 rounded-full h-2 mb-4",children:s.jsx("div",{className:"bg-green-500 h-2 rounded-full transition-all duration-500",style:{width:`${R.progress}%`}})}),s.jsx("div",{className:"grid grid-cols-3 gap-3",children:kw.map((C,j)=>{const K=C.icon,F=j===me&&g,ie=js.jsx(_w,{stream:pe,progress:R.progress,isRunning:g},pe.key))})]},C.key)})})]})]}),de.length>0&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("h3",{className:"text-white font-semibold",children:["Findings (",de.length,")"]}),s.jsx("div",{className:"flex gap-2",children:["critical","high","medium","low","info"].map(C=>{const j=J[C]||0;return j===0?null:s.jsx("span",{className:`${Tu[C]} text-white px-2 py-0.5 rounded-full text-xs font-bold`,children:j},C)})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:()=>{te(!0),ne(!1)},className:`px-3 py-1 rounded-lg text-xs transition-colors ${A?"bg-primary-500 text-white":"bg-dark-700 text-dark-400 hover:text-white"}`,children:[s.jsx(Eg,{className:"w-3 h-3 inline mr-1"}),"Findings (",de.length,")"]}),S.length>0&&s.jsxs("button",{onClick:()=>{te(!0),ne(!1),I(b==="rejected"?"all":"rejected")},className:`px-3 py-1 rounded-lg text-xs transition-colors ${b==="rejected"&&A?"bg-orange-500/30 text-orange-400":"bg-dark-700 text-orange-400/60 hover:text-orange-400"}`,children:[s.jsx(Oe,{className:"w-3 h-3 inline mr-1"}),"Rejected (",S.length,")"]}),s.jsxs("button",{onClick:()=>{ne(!0),te(!1)},className:`px-3 py-1 rounded-lg text-xs transition-colors ${Q?"bg-primary-500 text-white":"bg-dark-700 text-dark-400 hover:text-white"}`,children:[s.jsx(Zd,{className:"w-3 h-3 inline mr-1"}),"Activity Log"]})]})]}),A&&h.length>0&&S.length>0&&s.jsx("div",{className:"flex gap-1 mb-2",children:["all","confirmed","rejected"].map(C=>s.jsx("button",{onClick:()=>I(C),className:`px-2 py-0.5 rounded-full text-xs transition-colors ${b===C?"bg-primary-500/20 text-primary-400":"text-dark-500 hover:text-dark-300"}`,children:C==="all"?`All (${h.length})`:C==="confirmed"?`Confirmed (${de.length})`:`Rejected (${S.length})`},C))}),A&&s.jsx("div",{className:"space-y-2 max-h-[500px] overflow-y-auto pr-1",children:O.map(C=>s.jsxs("div",{className:`border ${C.ai_status==="rejected"?"border-orange-500/30 opacity-70":Cw[C.severity]||"border-dark-600"} rounded-xl bg-dark-900 overflow-hidden`,children:[s.jsxs("button",{onClick:()=>z(xe===C.id?null:C.id),className:"w-full flex items-center gap-3 p-3 text-left hover:bg-dark-800/50 transition-colors",children:[s.jsx("span",{className:`${Tu[C.severity]} text-white px-2 py-0.5 rounded text-xs font-bold uppercase flex-shrink-0`,children:C.severity}),s.jsx("span",{className:`text-sm flex-1 truncate ${C.ai_status==="rejected"?"text-dark-400":"text-white"}`,children:C.title}),C.ai_status==="rejected"&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-orange-500/20 text-orange-400 flex-shrink-0",children:"Rejected"}),(()=>{const j=Pu(C);return j?s.jsxs("span",{className:`text-xs font-semibold px-1.5 py-0.5 rounded-full border flex-shrink-0 ${Lu[j.color]}`,children:[j.score,"/100"]}):null})(),s.jsx("span",{className:"text-dark-500 text-xs flex-shrink-0",children:C.vulnerability_type}),xe===C.id?s.jsx(Zn,{className:"w-4 h-4 text-dark-400"}):s.jsx(pt,{className:"w-4 h-4 text-dark-400"})]}),xe===C.id&&s.jsxs("div",{className:"px-3 pb-3 space-y-2 border-t border-dark-700 pt-2",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[C.affected_endpoint&&s.jsxs("div",{children:[s.jsx("span",{className:"text-dark-500",children:"Endpoint: "}),s.jsx("span",{className:"text-dark-300 break-all",children:C.affected_endpoint})]}),C.parameter&&s.jsxs("div",{children:[s.jsx("span",{className:"text-dark-500",children:"Parameter: "}),s.jsx("span",{className:"text-dark-300",children:C.parameter})]}),C.cwe_id&&s.jsxs("div",{children:[s.jsx("span",{className:"text-dark-500",children:"CWE: "}),s.jsx("span",{className:"text-dark-300",children:C.cwe_id})]}),C.cvss_score>0&&s.jsxs("div",{children:[s.jsx("span",{className:"text-dark-500",children:"CVSS: "}),s.jsx("span",{className:"text-dark-300",children:C.cvss_score})]})]}),C.description&&s.jsxs("p",{className:"text-dark-400 text-xs",children:[C.description.substring(0,300),C.description.length>300?"...":""]}),C.payload&&s.jsxs("div",{className:"bg-dark-800 rounded-lg p-2",children:[s.jsx("span",{className:"text-dark-500 text-xs",children:"Payload: "}),s.jsx("code",{className:"text-green-400 text-xs break-all",children:C.payload.substring(0,200)})]}),C.evidence&&s.jsxs("div",{className:"bg-dark-800 rounded-lg p-2",children:[s.jsx("span",{className:"text-dark-500 text-xs",children:"Evidence: "}),s.jsx("span",{className:"text-dark-300 text-xs",children:C.evidence.substring(0,300)})]}),C.poc_code&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-xs font-medium text-dark-400 mb-1",children:"PoC Code"}),s.jsx("pre",{className:"p-2 bg-dark-950 rounded text-xs text-green-400 overflow-x-auto max-h-[300px] overflow-y-auto whitespace-pre-wrap",children:C.poc_code})]}),C.ai_status==="rejected"&&C.rejection_reason&&s.jsxs("div",{className:"bg-orange-500/10 border border-orange-500/20 rounded-lg p-2",children:[s.jsx("span",{className:"text-orange-400 text-xs font-medium",children:"Rejection: "}),s.jsx("span",{className:"text-orange-300/80 text-xs",children:C.rejection_reason})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:`text-xs ${C.ai_status==="rejected"?"text-orange-400":C.ai_verified?"text-green-400":"text-dark-500"}`,children:C.ai_status==="rejected"?"AI Rejected":C.ai_verified?"AI Verified":"Tool Detected"}),(()=>{const j=Pu(C);return j?s.jsxs("span",{className:`text-xs font-semibold px-1.5 py-0.5 rounded-full border ${Lu[j.color]}`,children:["Confidence: ",j.score,"/100 (",j.label,")"]}):null})()]}),(()=>{const j=C.confidence_breakdown&&Object.keys(C.confidence_breakdown).length>0,K=!!C.proof_of_execution,F=!!C.negative_controls;return!j&&!K&&!F?null:s.jsxs("div",{className:"bg-dark-800 rounded-lg p-2 space-y-1",children:[j&&s.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-0.5 text-xs text-dark-400",children:Object.entries(C.confidence_breakdown).map(([ie,pe])=>s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"capitalize",children:ie.replace(/_/g," ")}),s.jsxs("span",{className:`font-mono font-medium ${Number(pe)>0?"text-green-400":Number(pe)<0?"text-red-400":"text-dark-500"}`,children:[Number(pe)>0?"+":"",pe]})]},ie))}),K&&s.jsxs("p",{className:"text-xs text-dark-400 flex items-start gap-1",children:[s.jsx("span",{className:"text-green-400",children:"✓"}),s.jsxs("span",{children:["Proof: ",s.jsx("span",{className:"text-dark-300",children:C.proof_of_execution})]})]}),F&&s.jsxs("p",{className:"text-xs text-dark-400 flex items-start gap-1",children:[s.jsx("span",{className:"text-blue-400",children:"■"}),s.jsxs("span",{children:["Controls: ",s.jsx("span",{className:"text-dark-300",children:C.negative_controls})]})]})]})})()]})]},C.id))}),Q&&s.jsxs("div",{className:"bg-dark-900 rounded-xl p-3 max-h-[500px] overflow-y-auto font-mono text-xs",children:[ae.length===0?s.jsx("p",{className:"text-dark-500 text-center py-4",children:"No logs yet..."}):ae.map((C,j)=>s.jsxs("div",{className:"flex gap-2 py-0.5",children:[s.jsx("span",{className:"text-dark-600 flex-shrink-0",children:C.time||""}),s.jsx("span",{className:`flex-shrink-0 uppercase w-12 ${C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="info"?"text-blue-400":"text-dark-500"}`,children:C.level}),s.jsx("span",{className:Ru(C.message)||(C.source==="llm"?"text-purple-400":"text-dark-300"),children:C.message})]},j)),s.jsx("div",{ref:he})]})]}),de.length===0&&g&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-white font-semibold",children:"Activity"}),s.jsxs("button",{onClick:()=>ne(!Q),className:`px-3 py-1 rounded-lg text-xs transition-colors ${Q?"bg-primary-500 text-white":"bg-dark-700 text-dark-400 hover:text-white"}`,children:[s.jsx(Zd,{className:"w-3 h-3 inline mr-1"}),Q?"Hide":"Show"," Logs"]})]}),Q?s.jsxs("div",{className:"bg-dark-900 rounded-xl p-3 max-h-[400px] overflow-y-auto font-mono text-xs",children:[ae.length===0?s.jsxs("div",{className:"flex items-center justify-center py-4 text-dark-500",children:[s.jsx(qt,{className:"w-4 h-4 animate-spin mr-2"})," Waiting for logs..."]}):ae.map((C,j)=>s.jsxs("div",{className:"flex gap-2 py-0.5",children:[s.jsx("span",{className:"text-dark-600 flex-shrink-0",children:C.time||""}),s.jsx("span",{className:`flex-shrink-0 uppercase w-12 ${C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="info"?"text-blue-400":"text-dark-500"}`,children:C.level}),s.jsx("span",{className:Ru(C.message)||(C.source==="llm"?"text-purple-400":"text-dark-300"),children:C.message})]},j)),s.jsx("div",{ref:he})]}):s.jsxs("div",{className:"flex items-center justify-center py-6 text-dark-500",children:[s.jsx(qt,{className:"w-5 h-5 animate-spin mr-2"}),"Scanning in progress... Findings will appear here as they are discovered."]})]}),(R==null?void 0:R.status)==="completed"&&s.jsxs("div",{className:"bg-dark-800 border border-green-500/30 rounded-2xl p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(Mn,{className:"w-6 h-6 text-green-500"}),s.jsx("h3",{className:"text-green-400 font-semibold text-lg",children:"Pentest Complete"})]}),s.jsxs("p",{className:"text-dark-400 mb-4",children:["Found ",de.length," vulnerabilities across ",t,"."]}),Y&&s.jsxs("div",{className:"mb-4 p-4 bg-purple-500/10 border border-purple-500/20 rounded-xl flex items-center gap-3",children:[s.jsx(qt,{className:"w-5 h-5 text-purple-400 animate-spin"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-purple-400 font-medium text-sm",children:"Generating AI Report..."}),s.jsx("p",{className:"text-dark-400 text-xs",children:"The AI is analyzing findings and writing the executive summary."})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-3",children:[s.jsxs("button",{onClick:()=>e(`/agent/${L}`),className:"px-5 py-2 bg-primary-500 hover:bg-primary-600 text-white rounded-lg transition-colors flex items-center gap-2 text-sm",children:[s.jsx(An,{className:"w-4 h-4"})," View Full Results"]}),V?s.jsxs(s.Fragment,{children:[s.jsxs("a",{href:We.getViewUrl(V),target:"_blank",rel:"noopener noreferrer",className:"px-5 py-2 bg-green-500 hover:bg-green-600 text-white rounded-lg transition-colors flex items-center gap-2 text-sm",children:[s.jsx(yt,{className:"w-4 h-4"})," View Report"]}),s.jsxs("a",{href:We.getDownloadZipUrl(V),className:"px-5 py-2 bg-dark-700 hover:bg-dark-600 text-white rounded-lg transition-colors flex items-center gap-2 text-sm",children:[s.jsx(os,{className:"w-4 h-4"})," Download ZIP"]})]}):s.jsxs("button",{onClick:M,disabled:Y||!R.scan_id,className:"px-5 py-2 bg-purple-500 hover:bg-purple-600 disabled:opacity-50 text-white rounded-lg transition-colors flex items-center gap-2 text-sm",children:[s.jsx(Ug,{className:"w-4 h-4"})," Generate AI Report"]})]})]}),(R==null?void 0:R.status)==="error"&&s.jsxs("div",{className:"bg-dark-800 border border-red-500/30 rounded-2xl p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(Oe,{className:"w-6 h-6 text-red-400"}),s.jsx("h3",{className:"text-red-400 font-semibold",children:"Pentest Failed"})]}),s.jsx("p",{className:"text-dark-400",children:R.error||"An unexpected error occurred."})]})]})]})}const rr={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-blue-500",info:"bg-gray-500"},wa={detected:{bg:"bg-green-500/20",text:"text-green-400",label:"Detected"},not_detected:{bg:"bg-red-500/20",text:"text-red-400",label:"Not Detected"},error:{bg:"bg-yellow-500/20",text:"text-yellow-400",label:"Error"}},Au={running:{bg:"bg-blue-500/20",text:"text-blue-400"},completed:{bg:"bg-green-500/20",text:"text-green-400"},failed:{bg:"bg-red-500/20",text:"text-red-400"},stopped:{bg:"bg-orange-500/20",text:"text-orange-400"},pending:{bg:"bg-gray-500/20",text:"text-gray-400"}},Rw={error:"text-red-400",warning:"text-yellow-400",info:"text-blue-300",debug:"text-dark-500",critical:"text-red-500 font-bold"};function V0({log:e}){const t=Rw[e.level]||"text-dark-400",n=e.time?new Date(e.time).toLocaleTimeString():"",r=e.source==="llm";return s.jsxs("div",{className:`flex gap-2 text-xs font-mono leading-relaxed ${t}`,children:[s.jsx("span",{className:"text-dark-600 shrink-0 w-16",children:n}),s.jsx("span",{className:`shrink-0 w-12 uppercase ${e.level==="error"?"text-red-500":e.level==="warning"?"text-yellow-500":"text-dark-600"}`,children:e.level}),r&&s.jsx("span",{className:"text-purple-500 shrink-0",children:"[AI]"}),s.jsx("span",{className:"break-all",children:e.message})]})}function Tw(){var kt,Se,ye,Vn;const e=Bn(),[t,n]=x.useState(""),[r,a]=x.useState(""),[l,i]=x.useState(""),[o,c]=x.useState(!1),[d,m]=x.useState(""),[f,p]=x.useState(""),[N,v]=x.useState(""),[w,k]=x.useState(""),[y,u]=x.useState({}),[g,_]=x.useState(null),[L,D]=x.useState([]),[R,E]=x.useState(null),[U,q]=x.useState(!1),[A,te]=x.useState(null),[Q,ne]=x.useState(null),[ae,ce]=x.useState([]),[xe,z]=x.useState(null),[Y,se]=x.useState("test"),[V,G]=x.useState(!0),[ge,he]=x.useState("all"),[ke,P]=x.useState(null),[X,M]=x.useState(null),[me,de]=x.useState(!1),S=x.useRef(null),h=x.useRef(null),b=x.useRef(!0);x.useEffect(()=>{hn.getTypes().then($=>{u($.categories)}).catch(()=>{}),I(),O()},[]),x.useEffect(()=>{b.current&&h.current&&h.current.scrollIntoView({behavior:"smooth"})},[ae]),x.useEffect(()=>{if(!A||!U)return;const $=async()=>{try{const oe=await hn.getChallenge(A);ne(oe),oe.logs&&ce(oe.logs),["completed","failed","stopped","error"].includes(oe.status)&&(q(!1),S.current&&clearInterval(S.current),I(),O())}catch{}};return $(),S.current=setInterval($,3e3),()=>{S.current&&clearInterval(S.current)}},[A,U]);const I=async()=>{try{const $=await hn.listChallenges({limit:50});D($.challenges)}catch{}},O=async()=>{try{const $=await hn.getStats();E($)}catch{}},J=async()=>{var $,oe;if(!(!t.trim()||!l)){z(null),q(!0),ne(null),ce([]),G(!0);try{const le=await hn.run({target_url:t.trim(),vuln_type:l,challenge_name:r||void 0,auth_type:d||void 0,auth_value:f||void 0,notes:N||void 0});te(le.challenge_id)}catch(le){z(((oe=($=le==null?void 0:le.response)==null?void 0:$.data)==null?void 0:oe.detail)||(le==null?void 0:le.message)||"Failed to start test"),q(!1)}}},C=async()=>{if(A)try{await hn.stopChallenge(A),q(!1)}catch{}},j=async $=>{try{await hn.deleteChallenge($),ke===$&&(P(null),M(null)),I(),O()}catch{}},K=x.useCallback(async $=>{if(ke===$){P(null),M(null);return}P($),de(!0);try{const oe=await hn.getChallenge($);M(oe)}catch{M(null)}finally{de(!1)}},[ke]),ie=(()=>{for(const $ of Object.values(y)){const oe=$.types.find(le=>le.key===l);if(oe)return oe}return null})(),pe=Object.entries(y).map(([$,oe])=>{const le=w?oe.types.filter(fn=>fn.key.includes(w.toLowerCase())||fn.title.toLowerCase().includes(w.toLowerCase())):oe.types;return{key:$,...oe,types:le}}).filter($=>$.types.length>0),Te=$=>{if(!$)return"-";if($<60)return`${$}s`;const oe=Math.floor($/60),le=$%60;return`${oe}m ${le}s`},ve=ge==="all"?ae:ae.filter($=>$.level===ge);return s.jsxs("div",{className:"min-h-screen flex flex-col items-center py-8 px-4",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-purple-500/20 rounded-2xl mb-4",children:s.jsx(vo,{className:"w-8 h-8 text-purple-400"})}),s.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Vulnerability Lab"}),s.jsx("p",{className:"text-dark-400 max-w-lg",children:"Test individual vulnerability types against labs, CTFs, and PortSwigger challenges. Track detection performance per vuln type."})]}),s.jsx("div",{className:"flex gap-2 mb-6",children:[{key:"test",label:"New Test",icon:Yt},{key:"history",label:"History",icon:Xt},{key:"stats",label:"Stats",icon:Cg}].map($=>s.jsxs("button",{onClick:()=>se($.key),className:`flex items-center gap-2 px-5 py-2.5 rounded-lg text-sm font-medium transition-colors ${Y===$.key?"bg-purple-500/20 text-purple-400 border border-purple-500/30":"bg-dark-800 text-dark-400 border border-dark-700 hover:text-white"}`,children:[s.jsx($.icon,{className:"w-4 h-4"}),$.label]},$.key))}),Y==="test"&&s.jsxs("div",{className:"w-full max-w-3xl",children:[s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-8",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Target URL"}),s.jsx("input",{type:"url",value:t,onChange:$=>n($.target.value),placeholder:"https://lab.example.com/vuln-page",disabled:U,className:"w-full px-4 py-4 bg-dark-900 border border-dark-600 rounded-xl text-white text-lg placeholder-dark-500 focus:outline-none focus:border-purple-500 focus:ring-1 focus:ring-purple-500 disabled:opacity-50"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Challenge Name (optional)"}),s.jsx("input",{type:"text",value:r,onChange:$=>a($.target.value),placeholder:l!=null&&l.startsWith("xss")?'e.g. "Reflected XSS with most tags and attributes blocked"':"e.g. PortSwigger Lab: Reflected XSS into HTML context",disabled:U,className:"w-full px-4 py-3 bg-dark-900 border border-dark-600 rounded-xl text-white placeholder-dark-500 focus:outline-none focus:border-purple-500 disabled:opacity-50"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:["Vulnerability Type ",ie&&s.jsx("span",{className:`ml-2 px-2 py-0.5 rounded text-xs ${rr[ie.severity]} text-white`,children:ie.severity})]}),s.jsxs("div",{className:"relative mb-3",children:[s.jsx(Qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-dark-500"}),s.jsx("input",{type:"text",value:w,onChange:$=>k($.target.value),placeholder:"Search vuln types...",disabled:U,className:"w-full pl-10 pr-4 py-2.5 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm placeholder-dark-500 focus:outline-none focus:border-purple-500 disabled:opacity-50"})]}),ie&&s.jsxs("div",{className:"mb-3 p-3 bg-purple-500/10 border border-purple-500/20 rounded-lg flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-purple-400 font-medium",children:ie.title}),ie.cwe_id&&s.jsx("span",{className:"ml-2 text-dark-500 text-xs",children:ie.cwe_id})]}),s.jsx("button",{onClick:()=>i(""),disabled:U,className:"text-dark-500 hover:text-white text-xs",children:"Clear"})]}),s.jsx("div",{className:"max-h-80 overflow-y-auto border border-dark-600 rounded-xl bg-dark-900",children:pe.map($=>s.jsxs("div",{className:"border-b border-dark-700 last:border-b-0",children:[s.jsxs("button",{onClick:()=>_(g===$.key?null:$.key),disabled:U,className:"w-full flex items-center justify-between px-4 py-3 text-sm font-medium text-dark-300 hover:text-white hover:bg-dark-800 transition-colors disabled:opacity-50",children:[s.jsxs("span",{children:[$.label," (",$.types.length,")"]}),g===$.key?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),g===$.key&&s.jsx("div",{className:"px-2 pb-2",children:$.types.map(oe=>s.jsxs("button",{onClick:()=>i(oe.key),disabled:U,className:`w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm transition-colors disabled:opacity-50 ${l===oe.key?"bg-purple-500/20 text-purple-400":"text-dark-400 hover:bg-dark-800 hover:text-white"}`,children:[s.jsx("span",{className:"text-left",children:oe.title}),s.jsxs("div",{className:"flex items-center gap-2",children:[oe.cwe_id&&s.jsx("span",{className:"text-dark-600 text-xs",children:oe.cwe_id}),s.jsx("span",{className:`w-2 h-2 rounded-full ${rr[oe.severity]}`})]})]},oe.key))})]},$.key))})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("button",{onClick:()=>c(!o),disabled:U,className:"flex items-center gap-2 text-sm text-dark-400 hover:text-white transition-colors disabled:opacity-50",children:[s.jsx(c0,{className:"w-4 h-4"}),s.jsx("span",{children:"Authentication (Optional)"}),o?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),o&&s.jsxs("div",{className:"mt-3 space-y-3 pl-6",children:[s.jsxs("select",{value:d,onChange:$=>m($.target.value),disabled:U,className:"w-full px-3 py-2 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm focus:outline-none focus:border-purple-500",children:[s.jsx("option",{value:"",children:"No Authentication"}),s.jsx("option",{value:"bearer",children:"Bearer Token"}),s.jsx("option",{value:"cookie",children:"Cookie"}),s.jsx("option",{value:"basic",children:"Basic Auth (user:pass)"}),s.jsx("option",{value:"header",children:"Custom Header (Name:Value)"})]}),d&&s.jsx("input",{type:"text",value:f,onChange:$=>p($.target.value),disabled:U,placeholder:d==="bearer"?"eyJhbGciOiJIUzI1NiIs...":d==="cookie"?"session=abc123; token=xyz":d==="basic"?"admin:password123":"X-API-Key:your-api-key",className:"w-full px-3 py-2 bg-dark-900 border border-dark-600 rounded-lg text-white text-sm placeholder-dark-500 focus:outline-none focus:border-purple-500"})]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Notes (optional)"}),s.jsx("textarea",{value:N,onChange:$=>v($.target.value),rows:2,disabled:U,placeholder:l!=null&&l.startsWith("xss")?"Hints: blocked chars/tags, encoding observed, context (e.g. 'angle brackets HTML-encoded, input in onclick attribute')":"e.g. PortSwigger Apprentice level, no WAF",className:"w-full px-4 py-3 bg-dark-900 border border-dark-600 rounded-xl text-white placeholder-dark-500 focus:outline-none focus:border-purple-500 disabled:opacity-50"})]}),xe&&s.jsxs("div",{className:"mb-6 p-3 bg-red-500/10 border border-red-500/20 rounded-lg flex items-center gap-2",children:[s.jsx(Oe,{className:"w-5 h-5 text-red-400"}),s.jsx("span",{className:"text-red-400 text-sm",children:xe})]}),U?s.jsxs("button",{onClick:C,className:"w-full py-4 bg-red-500 hover:bg-red-600 text-white font-bold text-lg rounded-xl transition-colors flex items-center justify-center gap-3",children:[s.jsx(eu,{className:"w-6 h-6"}),"STOP TEST"]}):s.jsxs("button",{onClick:J,disabled:!t.trim()||!l,className:"w-full py-4 bg-purple-500 hover:bg-purple-600 disabled:bg-dark-600 disabled:text-dark-400 text-white font-bold text-lg rounded-xl transition-colors flex items-center justify-center gap-3",children:[s.jsx(vo,{className:"w-6 h-6"}),"START TEST"]})]}),Q&&s.jsxs("div",{className:"mt-6 space-y-4",children:[s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h3",{className:"text-white font-semibold flex items-center gap-2",children:[Q.status==="running"&&s.jsx(qt,{className:"w-5 h-5 animate-spin text-purple-400"}),Q.status==="completed"&&s.jsx(Mn,{className:"w-5 h-5 text-green-400"}),["failed","error"].includes(Q.status)&&s.jsx(Ct,{className:"w-5 h-5 text-red-400"}),Q.status==="stopped"&&s.jsx(eu,{className:"w-5 h-5 text-orange-400"}),(ie==null?void 0:ie.title)||l]}),s.jsxs("span",{className:"text-sm text-dark-400",children:[Q.progress||0,"%"]})]}),s.jsx("div",{className:"w-full bg-dark-900 rounded-full h-2 mb-4",children:s.jsx("div",{className:`h-2 rounded-full transition-all duration-500 ${Q.status==="completed"?"bg-green-500":Q.status==="error"||Q.status==="failed"?"bg-red-500":"bg-purple-500"}`,style:{width:`${Q.progress||0}%`}})}),s.jsxs("div",{className:"flex items-center gap-4 text-sm text-dark-400 mb-3",children:[Q.phase&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Ke,{className:"w-3.5 h-3.5"}),Q.phase]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Ye,{className:"w-3.5 h-3.5"}),ae.length," log entries"]}),Q.findings_count>0&&s.jsxs("span",{className:"flex items-center gap-1 text-green-400",children:[s.jsx(Oe,{className:"w-3.5 h-3.5"}),Q.findings_count," finding(s)"]})]}),Q.findings&&Q.findings.length>0&&s.jsx("div",{className:"mb-3 space-y-2",children:Q.findings.slice(-3).map(($,oe)=>s.jsxs("div",{className:"p-2 bg-green-500/5 border border-green-500/20 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs font-bold ${rr[$.severity||"medium"]} text-white`,children:($.severity||"medium").toUpperCase()}),s.jsx("span",{className:"text-sm text-green-300",children:$.title||$.vulnerability_type||"Finding"})]}),$.affected_endpoint&&s.jsx("p",{className:"text-xs text-dark-500 mt-1 truncate",children:$.affected_endpoint})]},oe))}),Q.result&&s.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[s.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${((kt=wa[Q.result])==null?void 0:kt.bg)||"bg-gray-500/20"} ${((Se=wa[Q.result])==null?void 0:Se.text)||"text-gray-400"}`,children:((ye=wa[Q.result])==null?void 0:ye.label)||Q.result}),Q.scan_id&&s.jsxs("button",{onClick:()=>e(`/scan/${Q.scan_id}`),className:"text-sm text-purple-400 hover:text-purple-300 flex items-center gap-1",children:[s.jsx(ol,{className:"w-4 h-4"})," View Scan Details"]})]}),Q.error&&s.jsx("div",{className:"mt-3 p-2 bg-red-500/10 border border-red-500/20 rounded text-red-400 text-sm",children:Q.error})]}),s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-dark-700",children:[s.jsxs("button",{onClick:()=>G(!V),className:"flex items-center gap-2 text-sm font-medium text-dark-300 hover:text-white transition-colors",children:[s.jsx(Ye,{className:"w-4 h-4 text-purple-400"}),"Live Agent Logs",s.jsxs("span",{className:"text-dark-600 text-xs",children:["(",ae.length,")"]}),V?s.jsx(Zn,{className:"w-4 h-4"}):s.jsx(pt,{className:"w-4 h-4"})]}),V&&s.jsx("div",{className:"flex items-center gap-1",children:["all","info","warning","error"].map($=>s.jsx("button",{onClick:()=>he($),className:`px-2 py-1 rounded text-xs transition-colors ${ge===$?"bg-purple-500/20 text-purple-400":"text-dark-500 hover:text-white"}`,children:$},$))})]}),V&&s.jsxs("div",{className:"p-3 bg-dark-900 max-h-80 overflow-y-auto space-y-0.5",onScroll:$=>{const oe=$.currentTarget;b.current=oe.scrollTop+oe.clientHeight>=oe.scrollHeight-50},children:[ve.length===0?s.jsx("p",{className:"text-dark-600 text-xs font-mono",children:"Waiting for logs..."}):ve.map(($,oe)=>s.jsx(V0,{log:$},oe)),s.jsx("div",{ref:h})]})]})]})]}),Y==="history"&&s.jsx("div",{className:"w-full max-w-4xl",children:s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl overflow-hidden",children:[s.jsxs("div",{className:"p-4 border-b border-dark-700 flex items-center justify-between",children:[s.jsxs("h3",{className:"text-white font-semibold",children:["Challenge History (",L.length,")"]}),s.jsx("button",{onClick:I,className:"text-sm text-dark-400 hover:text-white",children:"Refresh"})]}),L.length===0?s.jsx("div",{className:"p-8 text-center text-dark-500",children:"No challenges yet. Start your first test!"}):s.jsx("div",{className:"divide-y divide-dark-700",children:L.map($=>{const oe=Au[$.status]||Au.pending,le=$.result?wa[$.result]:null,fn=ke===$.id;return s.jsxs("div",{children:[s.jsxs("div",{className:`p-4 cursor-pointer transition-colors ${fn?"bg-dark-900/80":"hover:bg-dark-900/50"}`,onClick:()=>K($.id),children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(zr,{className:`w-4 h-4 text-dark-500 transition-transform ${fn?"rotate-90":""}`}),s.jsx("span",{className:"text-white font-medium",children:$.challenge_name||$.vuln_type.replace(/_/g," ").replace(/\b\w/g,Ee=>Ee.toUpperCase())}),s.jsx("span",{className:`px-2 py-0.5 rounded text-xs ${oe.bg} ${oe.text}`,children:$.status}),le&&s.jsx("span",{className:`px-2 py-0.5 rounded text-xs ${le.bg} ${le.text}`,children:le.label})]}),s.jsxs("div",{className:"flex items-center gap-2",onClick:Ee=>Ee.stopPropagation(),children:[$.scan_id&&s.jsx("button",{onClick:()=>e(`/scan/${$.scan_id}`),className:"p-1.5 text-dark-400 hover:text-white rounded",title:"View scan details",children:s.jsx(ol,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>j($.id),className:"p-1.5 text-dark-400 hover:text-red-400 rounded",title:"Delete",children:s.jsx(Pt,{className:"w-4 h-4"})})]})]}),s.jsxs("div",{className:"flex items-center gap-4 text-xs text-dark-500 ml-7",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Kt,{className:"w-3 h-3"}),$.target_url.length>50?$.target_url.slice(0,50)+"...":$.target_url]}),s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsx("span",{children:$.vuln_type}),$.vuln_category&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsx("span",{children:$.vuln_category})]}),s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Xt,{className:"w-3 h-3"}),Te($.duration)]}),($.endpoints_count??0)>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(pn,{className:"w-3 h-3"}),$.endpoints_count," endpoints"]})]}),($.logs_count??0)>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-dark-600",children:"|"}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Ye,{className:"w-3 h-3"}),$.logs_count," logs"]})]})]}),$.findings_count>0&&s.jsx("div",{className:"flex gap-2 mt-2 ml-7",children:["critical","high","medium","low","info"].map(Ee=>{const ta=$[`${Ee}_count`];return ta?s.jsxs("span",{className:`${rr[Ee]} text-white px-2 py-0.5 rounded text-xs font-bold`,children:[ta," ",Ee]},Ee):null})})]}),fn&&s.jsx("div",{className:"border-t border-dark-700 bg-dark-900/50",children:me?s.jsxs("div",{className:"p-6 flex items-center justify-center gap-2 text-dark-400",children:[s.jsx(qt,{className:"w-5 h-5 animate-spin"}),"Loading details..."]}):X?s.jsxs("div",{className:"p-4 space-y-4",children:[(X.findings_detail||X.findings||[]).length>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-sm font-medium text-dark-300 mb-2 flex items-center gap-2",children:[s.jsx(Ke,{className:"w-4 h-4 text-green-400"}),"Findings (",(X.findings_detail||X.findings||[]).length,")"]}),s.jsx("div",{className:"space-y-2",children:(X.findings_detail||X.findings||[]).map((Ee,ta)=>s.jsxs("div",{className:"p-3 bg-dark-800 border border-dark-700 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs font-bold ${rr[Ee.severity||"medium"]} text-white`,children:(Ee.severity||"medium").toUpperCase()}),s.jsx("span",{className:"text-sm text-white font-medium",children:Ee.title||Ee.vulnerability_type||"Finding"})]}),Ee.vulnerability_type&&s.jsxs("p",{className:"text-xs text-dark-500 mb-1",children:["Type: ",Ee.vulnerability_type]}),Ee.affected_endpoint&&s.jsxs("p",{className:"text-xs text-dark-400 mb-1 flex items-center gap-1",children:[s.jsx(pn,{className:"w-3 h-3"}),Ee.affected_endpoint]}),Ee.payload&&s.jsxs("div",{className:"mt-1",children:[s.jsx("span",{className:"text-xs text-dark-600",children:"Payload: "}),s.jsx("code",{className:"text-xs text-purple-400 bg-dark-900 px-1.5 py-0.5 rounded break-all",children:Ee.payload})]}),Ee.evidence&&s.jsxs("div",{className:"mt-1",children:[s.jsx("span",{className:"text-xs text-dark-600",children:"Evidence: "}),s.jsx("span",{className:"text-xs text-dark-400",children:Ee.evidence.slice(0,300)})]})]},ta))})]}),(X.findings_detail||X.findings||[]).length===0&&X.status!=="running"&&s.jsx("div",{className:"p-3 bg-dark-800 border border-dark-700 rounded-lg text-center text-dark-500 text-sm",children:"No findings detected for this challenge."}),(X.logs||[]).length>0&&s.jsx(Pw,{logs:X.logs}),X.notes&&s.jsxs("div",{className:"p-3 bg-dark-800 border border-dark-700 rounded-lg",children:[s.jsxs("h4",{className:"text-xs font-medium text-dark-500 mb-1 flex items-center gap-1",children:[s.jsx(yt,{className:"w-3 h-3"})," Notes"]}),s.jsx("p",{className:"text-sm text-dark-300",children:X.notes})]})]}):s.jsx("div",{className:"p-6 text-center text-dark-500 text-sm",children:"Failed to load challenge details."})})]},$.id)})})]})}),Y==="stats"&&s.jsx("div",{className:"w-full max-w-4xl",children:R?s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"grid grid-cols-4 gap-4",children:[{label:"Total Tests",value:R.total,color:"text-white"},{label:"Running",value:R.running,color:"text-blue-400"},{label:"Detection Rate",value:`${R.detection_rate}%`,color:"text-green-400"},{label:"Detected",value:((Vn=R.result_counts)==null?void 0:Vn.detected)||0,color:"text-green-400"}].map(($,oe)=>s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-xl p-4 text-center",children:[s.jsx("div",{className:`text-2xl font-bold ${$.color}`,children:$.value}),s.jsx("div",{className:"text-xs text-dark-500 mt-1",children:$.label})]},oe))}),Object.keys(R.by_category).length>0&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6",children:[s.jsx("h3",{className:"text-white font-semibold mb-4",children:"Detection by Category"}),s.jsx("div",{className:"space-y-3",children:Object.entries(R.by_category).map(([$,oe])=>{var Ee;const le=oe.total>0?Math.round(oe.detected/oe.total*100):0,fn=((Ee=y[$])==null?void 0:Ee.label)||$;return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("span",{className:"text-sm text-dark-300",children:fn}),s.jsxs("span",{className:"text-sm text-dark-400",children:[oe.detected,"/",oe.total," (",le,"%)"]})]}),s.jsx("div",{className:"w-full bg-dark-900 rounded-full h-2",children:s.jsx("div",{className:`h-2 rounded-full transition-all ${le>=70?"bg-green-500":le>=40?"bg-yellow-500":"bg-red-500"}`,style:{width:`${le}%`}})})]},$)})})]}),Object.keys(R.by_type).length>0&&s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl p-6",children:[s.jsx("h3",{className:"text-white font-semibold mb-4",children:"Detection by Vulnerability Type"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(R.by_type).map(([$,oe])=>{const le=oe.total>0?Math.round(oe.detected/oe.total*100):0;return s.jsxs("div",{className:"flex items-center justify-between p-2 bg-dark-900 rounded-lg",children:[s.jsx("span",{className:"text-sm text-dark-300",children:$.replace(/_/g," ")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:`text-xs font-bold ${le>=70?"text-green-400":le>=40?"text-yellow-400":"text-red-400"}`,children:[le,"%"]}),s.jsxs("span",{className:"text-xs text-dark-600",children:["(",oe.detected,"/",oe.total,")"]})]})]},$)})})]}),R.total===0&&s.jsx("div",{className:"text-center text-dark-500 py-8",children:"No test data yet. Run some vulnerability tests to see stats!"})]}):s.jsx("div",{className:"text-center text-dark-500 py-12",children:"Loading stats..."})})]})}function Pw({logs:e}){const[t,n]=x.useState(!1),[r,a]=x.useState("all"),l=r==="all"?e:e.filter(d=>d.level===r),i=t?l:l.slice(-30),o=e.filter(d=>d.level==="error").length,c=e.filter(d=>d.level==="warning").length;return s.jsxs("div",{className:"border border-dark-700 rounded-lg overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-dark-800 border-b border-dark-700",children:[s.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-2 text-sm font-medium text-dark-300 hover:text-white transition-colors",children:[s.jsx(Ye,{className:"w-4 h-4 text-purple-400"}),"Agent Logs (",e.length,")",o>0&&s.jsxs("span",{className:"text-red-400 text-xs",children:["(",o," errors)"]}),c>0&&s.jsxs("span",{className:"text-yellow-400 text-xs",children:["(",c," warnings)"]}),t?s.jsx(Zn,{className:"w-3 h-3"}):s.jsx(pt,{className:"w-3 h-3"})]}),s.jsx("div",{className:"flex items-center gap-1",children:["all","info","warning","error"].map(d=>s.jsx("button",{onClick:()=>a(d),className:`px-2 py-0.5 rounded text-xs transition-colors ${r===d?"bg-purple-500/20 text-purple-400":"text-dark-600 hover:text-white"}`,children:d},d))})]}),s.jsxs("div",{className:`p-2 bg-dark-900 overflow-y-auto space-y-0.5 ${t?"max-h-96":"max-h-48"}`,children:[!t&&l.length>30&&s.jsxs("p",{className:"text-dark-600 text-xs font-mono mb-1",children:["... ",l.length-30," older entries hidden (click to expand)"]}),i.map((d,m)=>s.jsx(V0,{log:d},m)),i.length===0&&s.jsx("p",{className:"text-dark-600 text-xs font-mono",children:"No logs matching filter."})]})]})}const $u={recon:"bg-blue-500",exploit:"bg-red-500",pivot:"bg-orange-500",escalate:"bg-purple-500",action:"bg-green-500"},Lw={recon:"text-blue-400",exploit:"text-red-400",pivot:"text-orange-400",escalate:"text-purple-400",action:"text-green-400"},Aw=[{id:"network_scanner",name:"Network Scanner",description:"Discover hosts, open ports, and running services across a target network.",icon:"globe",accent:"blue"},{id:"lateral_movement",name:"Lateral Movement",description:"Pivot across compromised hosts and expand access within the network.",icon:"arrows",accent:"orange"},{id:"privilege_escalation",name:"Privilege Escalation",description:"Identify and exploit misconfigurations to elevate privileges on a host.",icon:"shield",accent:"red"},{id:"vpn_recon",name:"VPN Reconnaissance",description:"Enumerate VPN endpoints, test credentials, and map internal networks.",icon:"wifi",accent:"green"}],Ou={blue:{bg:"bg-blue-500/10",border:"border-blue-500/30 hover:border-blue-500/60",text:"text-blue-400",icon:"text-blue-400"},orange:{bg:"bg-orange-500/10",border:"border-orange-500/30 hover:border-orange-500/60",text:"text-orange-400",icon:"text-orange-400"},red:{bg:"bg-red-500/10",border:"border-red-500/30 hover:border-red-500/60",text:"text-red-400",icon:"text-red-400"},green:{bg:"bg-green-500/10",border:"border-green-500/30 hover:border-green-500/60",text:"text-green-400",icon:"text-green-400"}};function $w({icon:e,className:t}){switch(e){case"globe":return s.jsx(pn,{className:t});case"arrows":return s.jsx(_g,{className:t});case"shield":return s.jsx(Fg,{className:t});case"wifi":return s.jsx(Hg,{className:t});default:return s.jsx(Ye,{className:t})}}function Ow(){const e=x.useRef(null),t=x.useRef(null),n=x.useRef(null),[r,a]=x.useState([]),[l,i]=x.useState(null),[o,c]=x.useState(null),[d,m]=x.useState(""),[f,p]=x.useState(""),[N,v]=x.useState(!0),[w,k]=x.useState(!1),[y,u]=x.useState(!1),[g,_]=x.useState(!1),[L,D]=x.useState(!1),[R,E]=x.useState(""),[U,q]=x.useState(""),[A,te]=x.useState(null),[Q,ne]=x.useState(Aw),[ae,ce]=x.useState(null);x.useEffect(()=>{xe(),z()},[]),x.useEffect(()=>{if(!l)return;let P=!1;const X=async()=>{try{const me=await Zt.getVpnStatus(l);P||ce(me)}catch{}};X();const M=setInterval(X,3e3);return()=>{P=!0,clearInterval(M)}},[l]),x.useEffect(()=>{var P;(P=e.current)==null||P.scrollIntoView({behavior:"smooth"})},[o==null?void 0:o.messages]);const xe=async()=>{try{const P=await Zt.listSessions();a(P.sessions||P||[])}catch(P){console.error("Failed to load terminal sessions:",P)}},z=async()=>{try{const P=await Zt.listTemplates();P&&Array.isArray(P)&&P.length>0&&ne(P)}catch{}},Y=x.useCallback(async P=>{k(!0);try{const X=await Zt.getSession(P);i(P),c(X),X.vpn_status&&ce(X.vpn_status)}catch(X){console.error("Failed to load session:",X)}finally{k(!1)}},[]),se=async()=>{if(R.trim()){k(!0);try{const P=await Zt.createSession(R.trim(),U.trim()||void 0,A||void 0);await xe(),await Y(P.session_id),D(!1),E(""),q(""),te(null)}catch(P){console.error("Failed to create session:",P)}finally{k(!1)}}},V=async P=>{if(confirm("Delete this terminal session?"))try{await Zt.deleteSession(P),l===P&&(i(null),c(null),ce(null)),await xe()}catch(X){console.error("Failed to delete session:",X)}},G=async()=>{var X,M,me;if(!d.trim()||!l||y)return;const P={role:"user",content:d.trim(),timestamp:new Date().toISOString()};c(de=>de&&{...de,messages:[...de.messages,P]}),m(""),u(!0);try{const de=await Zt.sendMessage(l,d.trim()),S={role:"assistant",content:de.response,timestamp:new Date().toISOString(),suggested_commands:de.suggested_commands||[]};c(h=>h&&{...h,messages:[...h.messages,S]}),(X=t.current)==null||X.focus()}catch(de){const S={role:"system",content:`Error: ${((me=(M=de==null?void 0:de.response)==null?void 0:M.data)==null?void 0:me.detail)||(de==null?void 0:de.message)||"Failed to send message"}`,timestamp:new Date().toISOString()};c(h=>h&&{...h,messages:[...h.messages,S]})}finally{u(!1)}},ge=x.useCallback(async P=>{var me,de,S;const X=P||f;if(!X.trim()||!l||g)return;const M={role:"user",content:`$ ${X.trim()}`,timestamp:new Date().toISOString()};c(h=>h&&{...h,messages:[...h.messages,M]}),P||p(""),_(!0);try{const h=await Zt.executeCommand(l,X.trim(),N?"sandbox":"direct"),I={role:"tool",content:[h.stdout||"",h.stderr?` +[stderr] +${h.stderr}`:""].filter(Boolean).join("")||"(no output)",timestamp:new Date().toISOString(),exit_code:h.exit_code,command:h.command,duration:h.duration};c(O=>O&&{...O,messages:[...O.messages,I]}),(me=n.current)==null||me.focus()}catch(h){const b={role:"tool",content:((S=(de=h==null?void 0:h.response)==null?void 0:de.data)==null?void 0:S.detail)||(h==null?void 0:h.message)||"Command execution failed",timestamp:new Date().toISOString(),exit_code:-1};c(I=>I&&{...I,messages:[...I.messages,b]})}finally{_(!1)}},[l,f,g,N]),he=x.useCallback(async()=>{if(l)try{const P=await Zt.getExploitationPath(l);c(X=>X&&{...X,exploitation_path:P.steps||P||[]})}catch{}},[l]);x.useEffect(()=>{l&&o&&o.messages.length>0&&he()},[l,o==null?void 0:o.messages.length,he]);const ke=(P,X)=>{switch(P.role){case"user":return s.jsx("div",{className:"flex justify-end animate-fadeIn",children:s.jsxs("div",{className:"max-w-[80%] rounded-xl px-4 py-3 border-l-4 border-primary-500 bg-dark-800 text-white shadow-lg",children:[s.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed break-words",children:P.content}),s.jsx("div",{className:"text-[10px] mt-2 text-dark-500",children:new Date(P.timestamp).toLocaleTimeString()})]})},X);case"assistant":return s.jsx("div",{className:"flex justify-start animate-fadeIn",children:s.jsxs("div",{className:"max-w-[85%] rounded-xl px-4 py-3 bg-dark-900 text-dark-200 shadow-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs text-dark-400",children:[s.jsx(In,{className:"w-3.5 h-3.5 text-primary-500"}),s.jsx("span",{className:"font-medium",children:"Terminal Agent"})]}),s.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed break-words",children:P.content}),P.suggested_commands&&P.suggested_commands.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mt-3 pt-3 border-t border-dark-700",children:P.suggested_commands.map((M,me)=>s.jsxs("button",{onClick:()=>ge(M),disabled:g,className:"px-3 py-1.5 text-xs font-mono bg-green-500/20 text-green-400 rounded-lg hover:bg-green-500/30 transition-colors disabled:opacity-50 flex items-center gap-1.5 border border-green-500/20 hover:border-green-500/40",children:[s.jsx(Yt,{className:"w-3 h-3"}),M]},me))}),s.jsx("div",{className:"text-[10px] mt-2 text-dark-500",children:new Date(P.timestamp).toLocaleTimeString()})]})},X);case"tool":return s.jsx("div",{className:"flex justify-start animate-fadeIn",children:s.jsxs("div",{className:`max-w-[90%] rounded-xl px-4 py-3 bg-dark-950 shadow-lg border-l-4 ${P.exit_code!==void 0&&P.exit_code!==0?"border-red-500":"border-green-500/50"}`,children:[P.command&&s.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs",children:[s.jsx(Ye,{className:"w-3.5 h-3.5 text-green-400"}),s.jsx("span",{className:"font-mono text-green-400",children:P.command}),P.exit_code!==void 0&&s.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${P.exit_code===0?"bg-green-500/20 text-green-400":"bg-red-500/10 text-red-400"}`,children:["exit ",P.exit_code]}),P.duration!==void 0&&s.jsx("span",{className:"text-dark-500",children:P.duration<1?"<1s":`${P.duration.toFixed(1)}s`})]}),s.jsx("pre",{className:"font-mono text-xs text-green-400 whitespace-pre-wrap break-all leading-relaxed max-h-80 overflow-y-auto",children:P.content}),s.jsx("div",{className:"text-[10px] mt-2 text-dark-500",children:new Date(P.timestamp).toLocaleTimeString()})]})},X);case"system":return s.jsx("div",{className:"flex justify-center animate-fadeIn",children:s.jsx("p",{className:"text-dark-400 text-xs italic text-center px-4 py-2 max-w-[70%]",children:P.content})},X);default:return null}};return s.jsxs("div",{className:"h-[calc(100vh-80px)] flex gap-0 animate-fadeIn",children:[s.jsxs("div",{className:"w-72 flex-shrink-0 bg-dark-800 border-r border-dark-700 flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b border-dark-700",children:[s.jsx("div",{className:"flex items-center justify-between mb-3",children:s.jsxs("h2",{className:"text-white font-semibold flex items-center gap-2",children:[s.jsx(Ye,{className:"w-5 h-5 text-primary-500"}),"Terminal Agent"]})}),s.jsxs("button",{onClick:()=>D(!0),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-primary-500 hover:bg-primary-600 text-white text-sm font-medium rounded-lg transition-colors",children:[s.jsx(Gt,{className:"w-4 h-4"}),"New Session"]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5",children:r.length===0?s.jsx("p",{className:"text-dark-500 text-sm text-center py-8",children:"No sessions yet."}):r.map(P=>s.jsxs("div",{onClick:()=>Y(P.session_id),className:`p-3 rounded-lg cursor-pointer transition-all group ${l===P.session_id?"bg-primary-500/20 text-primary-500 border border-primary-500/30":"bg-dark-900/50 hover:bg-dark-900 border border-transparent hover:border-dark-700 text-dark-300"}`,children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"font-medium text-sm truncate flex-1",children:P.name||P.target}),s.jsx("button",{onClick:X=>{X.stopPropagation(),V(P.session_id)},className:"p-1 text-dark-500 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-all rounded",children:s.jsx(Pt,{className:"w-3.5 h-3.5"})})]}),s.jsxs("p",{className:"text-dark-500 text-xs truncate mt-0.5 flex items-center gap-1",children:[s.jsx(pn,{className:"w-3 h-3"}),P.target]}),s.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-[10px] text-dark-500",children:[s.jsxs("span",{children:[P.messages_count," msgs"]}),s.jsxs("span",{children:[P.commands_count," cmds"]}),P.template_id&&s.jsx("span",{className:"bg-dark-700 px-1.5 py-0.5 rounded text-dark-400",children:P.template_id.replace(/_/g," ")})]})]},P.session_id))})]}),s.jsx("div",{className:"flex-1 flex flex-col bg-dark-900 min-w-0",children:l&&o?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-dark-700 bg-dark-800/50 flex-shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(Ye,{className:"w-4 h-4 text-primary-500 flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"text-white font-medium text-sm truncate",children:o.name||"Terminal Session"}),s.jsx("p",{className:"text-dark-400 text-xs truncate",children:o.target})]})]}),s.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:o.template_id&&s.jsx("span",{className:"text-dark-500 text-xs bg-dark-700 px-2 py-1 rounded",children:o.template_id.replace(/_/g," ")})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4 scroll-smooth",children:[o.messages.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[s.jsx("div",{className:"w-16 h-16 bg-dark-800 rounded-2xl flex items-center justify-center mb-4",children:s.jsx(Ye,{className:"w-8 h-8 text-dark-600"})}),s.jsx("p",{className:"text-dark-400 text-sm mb-1",children:"Session ready"}),s.jsx("p",{className:"text-dark-500 text-xs max-w-md",children:"Use the prompt input to ask the AI agent for guidance, or use the command input to execute commands directly on the target."})]}):o.messages.map((P,X)=>ke(P,X)),y&&s.jsx("div",{className:"flex justify-start",children:s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-dark-800 border border-dark-700 rounded-xl text-dark-400 text-sm",children:[s.jsx(qt,{className:"w-4 h-4 animate-spin text-primary-500"}),"Agent is thinking..."]})}),g&&s.jsx("div",{className:"flex justify-start",children:s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-dark-950 border border-green-500/20 rounded-xl text-green-400 text-sm font-mono",children:[s.jsx(qt,{className:"w-4 h-4 animate-spin"}),"Executing command..."]})}),s.jsx("div",{ref:e})]}),s.jsxs("div",{className:"border-t border-dark-700 bg-dark-800 px-6 py-4 flex-shrink-0 space-y-3",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{ref:t,type:"text",value:d,onChange:P=>m(P.target.value),onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),G())},placeholder:"Ask the AI agent for guidance...",disabled:y||g,className:"flex-1 bg-dark-900 border border-dark-700 rounded-lg px-4 py-2.5 text-white text-sm placeholder-dark-500 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500 disabled:opacity-50"}),s.jsx("button",{onClick:G,disabled:!d.trim()||y||g,className:"px-4 py-2.5 bg-primary-500 hover:bg-primary-600 text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:s.jsx(dl,{className:"w-4 h-4"})})]}),s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsxs("div",{className:"flex-1 flex items-center bg-dark-950 border border-dark-700 rounded-lg overflow-hidden focus-within:border-green-500/50 focus-within:ring-1 focus-within:ring-green-500/30",children:[s.jsx("span",{className:"pl-4 pr-1 text-green-400 font-mono text-sm select-none",children:"$"}),s.jsx("input",{ref:n,type:"text",value:f,onChange:P=>p(P.target.value),onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),ge())},placeholder:"Enter command to execute...",disabled:y||g,className:"flex-1 bg-transparent py-2.5 pr-4 text-green-400 font-mono text-sm placeholder-dark-500 focus:outline-none disabled:opacity-50"})]}),s.jsx("button",{onClick:()=>ge(),disabled:!f.trim()||y||g,className:"px-4 py-2.5 bg-green-500/20 hover:bg-green-500/30 text-green-400 border border-green-500/30 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5",children:s.jsx(Yt,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex items-center gap-2 pl-2 border-l border-dark-700",children:[s.jsx("button",{onClick:()=>v(!N),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${N?"bg-green-500":"bg-red-500/60"}`,children:s.jsx("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ${N?"translate-x-4.5":"translate-x-0.5"}`,style:{transform:N?"translateX(16px)":"translateX(2px)"}})}),s.jsx("span",{className:`text-xs font-medium ${N?"text-green-400":"text-red-400"}`,children:N?"Sandbox":"Direct"})]})]})]})]}):s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center",children:[s.jsx("div",{className:"w-20 h-20 bg-gradient-to-br from-primary-500/20 to-green-500/20 rounded-2xl flex items-center justify-center mb-6",children:s.jsx(Ye,{className:"w-10 h-10 text-primary-400"})}),s.jsx("h3",{className:"text-white text-lg font-medium mb-2",children:"Terminal Agent"}),s.jsx("p",{className:"text-dark-400 text-center mb-6 max-w-md text-sm",children:"Interactive AI-assisted terminal for infrastructure pentesting. Create a new session or select an existing one to get started."}),s.jsxs("button",{onClick:()=>D(!0),className:"flex items-center gap-2 px-6 py-3 bg-primary-500 hover:bg-primary-600 text-white font-medium rounded-lg transition-colors",children:[s.jsx(Gt,{className:"w-4 h-4"}),"New Session"]}),w&&s.jsxs("div",{className:"flex items-center gap-2 mt-4 text-dark-400 text-sm",children:[s.jsx(qt,{className:"w-4 h-4 animate-spin"}),"Loading..."]})]})}),s.jsxs("div",{className:"w-72 flex-shrink-0 bg-dark-800 border-l border-dark-700 flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b border-dark-700",children:[s.jsx("h3",{className:"text-dark-300 text-xs font-semibold uppercase tracking-wider mb-3",children:"VPN Status"}),ae?s.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${ae.connected?"bg-green-500/10 border-green-500/30":"bg-red-500/10 border-red-500/30"}`,children:[s.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${ae.connected?"bg-green-500 animate-pulse":"bg-red-500"}`}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:`text-sm font-medium ${ae.connected?"text-green-400":"text-red-400"}`,children:ae.connected?"Connected":"Disconnected"}),ae.connected&&ae.ip&&s.jsx("p",{className:"text-xs text-dark-400 truncate font-mono",children:ae.ip}),ae.connected&&ae.interface&&s.jsx("p",{className:"text-xs text-dark-500 truncate",children:ae.interface})]}),ae.connected&&ae.latency_ms!==null&&s.jsxs("span",{className:"text-xs text-dark-400",children:[ae.latency_ms,"ms"]})]}):s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-dark-900 border border-dark-700",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-dark-600"}),s.jsx("span",{className:"text-dark-500 text-sm",children:"No session active"})]})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[s.jsx("h3",{className:"text-dark-300 text-xs font-semibold uppercase tracking-wider mb-4",children:"Exploitation Path"}),o&&o.exploitation_path.length>0?s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-0.5 bg-dark-700"}),s.jsx("div",{className:"space-y-4",children:o.exploitation_path.map((P,X)=>{const M=$u[P.step_type]||"bg-dark-500",me=Lw[P.step_type]||"text-dark-400";return s.jsxs("div",{className:"relative pl-6",children:[s.jsx("div",{className:`absolute left-0 top-1 w-[15px] h-[15px] rounded-full border-2 border-dark-800 ${M} z-10`}),s.jsxs("div",{className:"bg-dark-900 rounded-lg p-3 border border-dark-700",children:[s.jsx("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${me}`,children:P.step_type}),s.jsx("p",{className:"text-dark-300 text-xs mt-1 leading-relaxed",children:P.description}),P.command&&s.jsxs("p",{className:"font-mono text-[10px] text-green-400/70 mt-1.5 truncate bg-dark-950 px-2 py-1 rounded",children:["$ ",P.command]}),P.result&&s.jsx("p",{className:"text-dark-500 text-[10px] mt-1 truncate",children:P.result}),s.jsx("p",{className:"text-dark-600 text-[9px] mt-1.5",children:new Date(P.timestamp).toLocaleTimeString()})]})]},X)})})]}):s.jsxs("div",{className:"text-center py-8",children:[s.jsx(Rg,{className:"w-8 h-8 text-dark-700 mx-auto mb-2"}),s.jsx("p",{className:"text-dark-500 text-xs",children:l?"No exploitation steps yet. Start interacting to build the attack path.":"Select a session to view the exploitation path."})]})]}),o&&o.exploitation_path.length>0&&s.jsx("div",{className:"p-4 border-t border-dark-700",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries($u).map(([P,X])=>s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:`w-2 h-2 rounded-full ${X}`}),s.jsx("span",{className:"text-dark-500 text-[10px] capitalize",children:P})]},P))})})]}),L&&s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-dark-800 border border-dark-700 rounded-2xl w-full max-w-lg mx-4 shadow-2xl",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 pb-4",children:[s.jsxs("h3",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[s.jsx(Ye,{className:"w-5 h-5 text-primary-500"}),"New Terminal Session"]}),s.jsx("button",{onClick:()=>{D(!1),te(null),E(""),q("")},className:"text-dark-400 hover:text-white transition-colors",children:s.jsx(Sc,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"px-6 pb-6 space-y-5",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-2",children:"Session Template"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:Q.map(P=>{const X=Ou[P.accent]||Ou.blue,M=A===P.id;return s.jsxs("button",{onClick:()=>te(M?null:P.id),className:`p-4 rounded-xl border text-left transition-all ${M?`${X.bg} ${X.border.replace("hover:","")} ring-1 ring-${P.accent}-500/30`:"bg-dark-900 border-dark-700 hover:border-dark-600"}`,children:[s.jsx($w,{icon:P.icon,className:`w-6 h-6 mb-2 ${M?X.icon:"text-dark-500"}`}),s.jsx("p",{className:`text-sm font-medium ${M?X.text:"text-dark-300"}`,children:P.name}),s.jsx("p",{className:"text-dark-500 text-xs mt-1 leading-relaxed line-clamp-2",children:P.description})]},P.id)})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-1.5",children:"Target *"}),s.jsx("input",{type:"text",value:R,onChange:P=>E(P.target.value),placeholder:"10.10.10.1 or 192.168.1.0/24 or vpn.target.htb",autoFocus:!0,className:"w-full bg-dark-900 border border-dark-700 rounded-lg px-4 py-2.5 text-white text-sm placeholder-dark-500 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-dark-300 mb-1.5",children:"Session Name (optional)"}),s.jsx("input",{type:"text",value:U,onChange:P=>q(P.target.value),placeholder:"e.g. HTB Machine - Recon Phase",className:"w-full bg-dark-900 border border-dark-700 rounded-lg px-4 py-2.5 text-white text-sm placeholder-dark-500 focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500"})]}),s.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[s.jsx("button",{onClick:()=>{D(!1),te(null),E(""),q("")},className:"px-4 py-2 text-sm text-dark-400 hover:text-white transition-colors",children:"Cancel"}),s.jsx("button",{onClick:se,disabled:!R.trim()||w,className:"flex items-center gap-2 px-5 py-2 bg-primary-500 hover:bg-primary-600 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:w?s.jsxs(s.Fragment,{children:[s.jsx(qt,{className:"w-4 h-4 animate-spin"}),"Creating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Gt,{className:"w-4 h-4"}),"Create Session"]})})]})]})]})})]})}function Iw(e){if(e<60)return`${Math.floor(e)}s`;if(e<3600){const r=Math.floor(e/60),a=Math.floor(e%60);return`${r}m ${a}s`}const t=Math.floor(e/3600),n=Math.floor(e%3600/60);return`${t}h ${n}m`}function Mw(e){if(!e)return"Unknown";const t=(Date.now()-new Date(e).getTime())/1e3;return t<60?"Just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Dw(){var L,D,R;const[e,t]=x.useState(null),[n,r]=x.useState(!0),[a,l]=x.useState(null),[i,o]=x.useState(null),[c,d]=x.useState({}),[m,f]=x.useState({}),[p,N]=x.useState(!1),v=x.useCallback(async(E=!1)=>{E&&r(!0);try{const U=await sr.list();t(U)}catch(U){console.error("Failed to fetch sandbox data:",U),e||t({pool:{active:0,max_concurrent:0,image:"N/A",container_ttl_minutes:0,docker_available:!1},containers:[],error:"Failed to connect to backend"})}finally{r(!1)}},[]);x.useEffect(()=>{v(!0);const E=setInterval(()=>v(!1),5e3);return()=>clearInterval(E)},[v]),x.useEffect(()=>{if(a){const E=setTimeout(()=>l(null),4e3);return()=>clearTimeout(E)}},[a]);const w=async E=>{var U,q;if(i!==E){o(E),setTimeout(()=>o(null),5e3);return}o(null),N(!0);try{await sr.destroy(E),l({type:"success",text:`Container for scan ${E.slice(0,8)}... destroyed`}),v(!1)}catch(A){l({type:"error",text:((q=(U=A==null?void 0:A.response)==null?void 0:U.data)==null?void 0:q.detail)||"Failed to destroy container"})}finally{N(!1)}},k=async E=>{f(U=>({...U,[E]:!0}));try{const U=await sr.healthCheck(E);d(q=>({...q,[E]:U})),setTimeout(()=>{d(q=>({...q,[E]:null}))},8e3)}catch{d(U=>({...U,[E]:{status:"error",tools:[]}}))}finally{f(U=>({...U,[E]:!1}))}},y=async E=>{var U,q;N(!0);try{E==="expired"?await sr.cleanup():await sr.cleanupOrphans(),l({type:"success",text:`${E==="expired"?"Expired":"Orphan"} containers cleaned up`}),v(!1)}catch(A){l({type:"error",text:((q=(U=A==null?void 0:A.response)==null?void 0:U.data)==null?void 0:q.detail)||"Cleanup failed"})}finally{N(!1)}};if(n&&!e)return s.jsxs("div",{className:"animate-pulse space-y-6",children:[s.jsx("div",{className:"h-8 bg-dark-800 rounded w-64"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[1,2,3,4].map(E=>s.jsx("div",{className:"h-24 bg-dark-800 rounded-lg"},E))}),s.jsx("div",{className:"space-y-4",children:[1,2].map(E=>s.jsx("div",{className:"h-40 bg-dark-800 rounded-lg"},E))})]});const u=e==null?void 0:e.pool,g=(e==null?void 0:e.containers)||[],_=u?u.active/u.max_concurrent*100:0;return s.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 bg-blue-500/20 rounded-lg flex items-center justify-center",children:s.jsx(o0,{className:"w-6 h-6 text-blue-400"})}),"Sandbox Containers"]}),s.jsx("p",{className:"text-dark-400 mt-1",children:"Real-time monitoring of per-scan Kali Linux containers"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>y("expired"),isLoading:p,children:[s.jsx(Vg,{className:"w-4 h-4 mr-1"}),"Cleanup Expired"]}),s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>y("orphans"),isLoading:p,children:[s.jsx(Pt,{className:"w-4 h-4 mr-1"}),"Cleanup Orphans"]}),s.jsxs(H,{variant:"secondary",size:"sm",onClick:()=>v(!1),children:[s.jsx(ln,{className:"w-4 h-4 mr-1"}),"Refresh"]})]})]}),a&&s.jsxs("div",{className:`flex items-center gap-2 px-4 py-3 rounded-lg text-sm animate-fadeIn ${a.type==="success"?"bg-green-500/10 border border-green-500/30 text-green-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:[a.type==="success"?s.jsx(Mn,{className:"w-4 h-4 flex-shrink-0"}):s.jsx(Oe,{className:"w-4 h-4 flex-shrink-0"}),a.text]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${_>=100?"bg-red-500/20":_>=80?"bg-yellow-500/20":"bg-green-500/20"}`,children:s.jsx(Xd,{className:`w-5 h-5 ${_>=100?"text-red-400":_>=80?"text-yellow-400":"text-green-400"}`})}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-2xl font-bold text-white",children:[(u==null?void 0:u.active)||0,s.jsxs("span",{className:"text-dark-400 text-lg",children:["/",(u==null?void 0:u.max_concurrent)||0]})]}),s.jsx("p",{className:"text-xs text-dark-400",children:"Active Containers"})]})]})}),s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${u!=null&&u.docker_available?"bg-green-500/20":"bg-red-500/20"}`,children:s.jsx(Tg,{className:`w-5 h-5 ${u!=null&&u.docker_available?"text-green-400":"text-red-400"}`})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-lg font-bold text-white",children:u!=null&&u.docker_available?"Online":"Offline"}),s.jsx("p",{className:"text-xs text-dark-400",children:"Docker Engine"})]})]})}),s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 bg-purple-500/20 rounded-lg flex items-center justify-center",children:s.jsx(il,{className:"w-5 h-5 text-purple-400"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-bold text-white truncate max-w-[140px]",title:u==null?void 0:u.image,children:((D=(L=u==null?void 0:u.image)==null?void 0:L.split(":")[0])==null?void 0:D.split("/").pop())||"N/A"}),s.jsx("p",{className:"text-xs text-dark-400",children:(R=u==null?void 0:u.image)!=null&&R.includes(":")?u.image.split(":")[1]:"latest"})]})]})}),s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 bg-orange-500/20 rounded-lg flex items-center justify-center",children:s.jsx(Xt,{className:"w-5 h-5 text-orange-400"})}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-2xl font-bold text-white",children:[(u==null?void 0:u.container_ttl_minutes)||0,s.jsx("span",{className:"text-dark-400 text-lg",children:" min"})]}),s.jsx("p",{className:"text-xs text-dark-400",children:"Container TTL"})]})]})})]}),u&&u.max_concurrent>0&&s.jsxs("div",{className:"bg-dark-800 rounded-lg p-4 border border-dark-700",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm text-dark-300",children:"Pool Capacity"}),s.jsxs("span",{className:`text-sm font-medium ${_>=100?"text-red-400":_>=80?"text-yellow-400":"text-green-400"}`,children:[Math.round(_),"%"]})]}),s.jsx("div",{className:"w-full bg-dark-900 rounded-full h-2.5",children:s.jsx("div",{className:`h-2.5 rounded-full transition-all duration-500 ${_>=100?"bg-red-500":_>=80?"bg-yellow-500":"bg-green-500"}`,style:{width:`${Math.min(_,100)}%`}})})]}),g.length===0?s.jsxs("div",{className:"bg-dark-800 rounded-lg border border-dark-700 p-12 text-center",children:[s.jsx(Xd,{className:"w-16 h-16 text-dark-600 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-dark-300 mb-2",children:"No Sandbox Containers Running"}),s.jsx("p",{className:"text-dark-400 text-sm max-w-md mx-auto",children:"Containers are automatically created when scans start and destroyed when they complete. Start a scan to see containers here."})]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h2",{className:"text-lg font-semibold text-white",children:["Running Containers (",g.length,")"]}),g.map(E=>{const U=c[E.scan_id],q=m[E.scan_id],A=i===E.scan_id;return s.jsxs("div",{className:"bg-dark-800 rounded-lg border border-dark-700 p-5 hover:border-dark-600 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${E.available?"bg-green-500 animate-pulse":"bg-red-500"}`}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-white font-medium font-mono text-sm",children:E.container_name}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsx("span",{className:"text-xs text-dark-400",children:"Scan:"}),s.jsxs(nn,{to:`/scan/${E.scan_id}`,className:"text-xs text-primary-400 hover:text-primary-300 font-mono",children:[E.scan_id.slice(0,12),"..."]})]})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("span",{className:`inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium ${E.available?"bg-green-500/10 text-green-400 border border-green-500/30":"bg-red-500/10 text-red-400 border border-red-500/30"}`,children:E.available?s.jsxs(s.Fragment,{children:[s.jsx(Mn,{className:"w-3 h-3"})," Running"]}):s.jsxs(s.Fragment,{children:[s.jsx(Ct,{className:"w-3 h-3"})," Stopped"]})})})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-dark-400 mb-1",children:"Uptime"}),s.jsx("p",{className:"text-sm text-white font-medium",children:Iw(E.uptime_seconds)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-dark-400 mb-1",children:"Created"}),s.jsx("p",{className:"text-sm text-dark-300",children:Mw(E.created_at)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-dark-400 mb-1",children:"Installed Tools"}),s.jsx("p",{className:"text-sm text-white font-medium",children:E.installed_tools.length})]})]}),E.installed_tools.length>0&&s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-xs text-dark-400 mb-2",children:"Tools"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:E.installed_tools.map(te=>s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-dark-900 border border-dark-600 rounded text-xs text-dark-300",children:[s.jsx(vr,{className:"w-3 h-3 text-dark-500"}),te]},te))})]}),U&&s.jsxs("div",{className:`mb-4 px-3 py-2 rounded-lg text-xs animate-fadeIn ${U.status==="healthy"?"bg-green-500/10 border border-green-500/20 text-green-400":U.status==="degraded"?"bg-yellow-500/10 border border-yellow-500/20 text-yellow-400":"bg-red-500/10 border border-red-500/20 text-red-400"}`,children:[s.jsxs("span",{className:"font-medium",children:["Health: ",U.status]}),U.tools.length>0&&s.jsxs("span",{className:"ml-2",children:["— Verified: ",U.tools.join(", ")]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-3 border-t border-dark-700",children:[s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>k(E.scan_id),isLoading:q,children:[s.jsx(Pg,{className:"w-4 h-4 mr-1"}),"Health Check"]}),s.jsxs(H,{variant:A?"danger":"ghost",size:"sm",onClick:()=>w(E.scan_id),isLoading:p,children:[s.jsx(Pt,{className:"w-4 h-4 mr-1"}),A?"Confirm Destroy":"Destroy"]})]})]},E.scan_id)})]}),s.jsx("div",{className:"text-center text-xs text-dark-500",children:"Auto-refreshing every 5 seconds"})]})}function zw(){return s.jsx(Jg,{children:s.jsxs(pg,{children:[s.jsx(tt,{path:"/",element:s.jsx(iw,{})}),s.jsx(tt,{path:"/auto",element:s.jsx(Ew,{})}),s.jsx(tt,{path:"/vuln-lab",element:s.jsx(Tw,{})}),s.jsx(tt,{path:"/terminal",element:s.jsx(Ow,{})}),s.jsx(tt,{path:"/scan/new",element:s.jsx(cw,{})}),s.jsx(tt,{path:"/scan/:scanId",element:s.jsx(uw,{})}),s.jsx(tt,{path:"/agent/:agentId",element:s.jsx(pw,{})}),s.jsx(tt,{path:"/tasks",element:s.jsx(fw,{})}),s.jsx(tt,{path:"/realtime",element:s.jsx(hw,{})}),s.jsx(tt,{path:"/scheduler",element:s.jsx(jw,{})}),s.jsx(tt,{path:"/sandboxes",element:s.jsx(Dw,{})}),s.jsx(tt,{path:"/reports",element:s.jsx(gw,{})}),s.jsx(tt,{path:"/reports/:reportId",element:s.jsx(yw,{})}),s.jsx(tt,{path:"/settings",element:s.jsx(vw,{})})]})})}ji.createRoot(document.getElementById("root")).render(s.jsx(Ro.StrictMode,{children:s.jsx(vg,{children:s.jsx(zw,{})})})); +//# sourceMappingURL=index-DScaoRL2.js.map diff --git a/frontend/dist/assets/index-DScaoRL2.js.map b/frontend/dist/assets/index-DScaoRL2.js.map new file mode 100644 index 0000000..39b5d60 --- /dev/null +++ b/frontend/dist/assets/index-DScaoRL2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-DScaoRL2.js","sources":["../../node_modules/react/cjs/react.production.min.js","../../node_modules/react/index.js","../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../node_modules/react/jsx-runtime.js","../../node_modules/scheduler/cjs/scheduler.production.min.js","../../node_modules/scheduler/index.js","../../node_modules/react-dom/cjs/react-dom.production.min.js","../../node_modules/react-dom/index.js","../../node_modules/react-dom/client.js","../../node_modules/@remix-run/router/dist/router.js","../../node_modules/react-router/dist/index.js","../../node_modules/react-router-dom/dist/index.js","../../node_modules/lucide-react/dist/esm/defaultAttributes.js","../../node_modules/lucide-react/dist/esm/createLucideIcon.js","../../node_modules/lucide-react/dist/esm/icons/activity.js","../../node_modules/lucide-react/dist/esm/icons/alert-circle.js","../../node_modules/lucide-react/dist/esm/icons/alert-triangle.js","../../node_modules/lucide-react/dist/esm/icons/arrow-left.js","../../node_modules/lucide-react/dist/esm/icons/arrow-right-left.js","../../node_modules/lucide-react/dist/esm/icons/arrow-right.js","../../node_modules/lucide-react/dist/esm/icons/bar-chart-3.js","../../node_modules/lucide-react/dist/esm/icons/book-open.js","../../node_modules/lucide-react/dist/esm/icons/bot.js","../../node_modules/lucide-react/dist/esm/icons/box.js","../../node_modules/lucide-react/dist/esm/icons/brain.js","../../node_modules/lucide-react/dist/esm/icons/bug.js","../../node_modules/lucide-react/dist/esm/icons/calendar.js","../../node_modules/lucide-react/dist/esm/icons/check-circle-2.js","../../node_modules/lucide-react/dist/esm/icons/check-circle.js","../../node_modules/lucide-react/dist/esm/icons/check.js","../../node_modules/lucide-react/dist/esm/icons/chevron-down.js","../../node_modules/lucide-react/dist/esm/icons/chevron-right.js","../../node_modules/lucide-react/dist/esm/icons/chevron-up.js","../../node_modules/lucide-react/dist/esm/icons/circle.js","../../node_modules/lucide-react/dist/esm/icons/clock.js","../../node_modules/lucide-react/dist/esm/icons/code.js","../../node_modules/lucide-react/dist/esm/icons/container.js","../../node_modules/lucide-react/dist/esm/icons/copy.js","../../node_modules/lucide-react/dist/esm/icons/cpu.js","../../node_modules/lucide-react/dist/esm/icons/download.js","../../node_modules/lucide-react/dist/esm/icons/external-link.js","../../node_modules/lucide-react/dist/esm/icons/eye.js","../../node_modules/lucide-react/dist/esm/icons/file-text.js","../../node_modules/lucide-react/dist/esm/icons/flask-conical.js","../../node_modules/lucide-react/dist/esm/icons/globe.js","../../node_modules/lucide-react/dist/esm/icons/hard-drive.js","../../node_modules/lucide-react/dist/esm/icons/heart.js","../../node_modules/lucide-react/dist/esm/icons/home.js","../../node_modules/lucide-react/dist/esm/icons/key.js","../../node_modules/lucide-react/dist/esm/icons/layers.js","../../node_modules/lucide-react/dist/esm/icons/link.js","../../node_modules/lucide-react/dist/esm/icons/loader-2.js","../../node_modules/lucide-react/dist/esm/icons/lock.js","../../node_modules/lucide-react/dist/esm/icons/message-square.js","../../node_modules/lucide-react/dist/esm/icons/minus-circle.js","../../node_modules/lucide-react/dist/esm/icons/minus.js","../../node_modules/lucide-react/dist/esm/icons/pause.js","../../node_modules/lucide-react/dist/esm/icons/play.js","../../node_modules/lucide-react/dist/esm/icons/plus.js","../../node_modules/lucide-react/dist/esm/icons/refresh-cw.js","../../node_modules/lucide-react/dist/esm/icons/rocket.js","../../node_modules/lucide-react/dist/esm/icons/router.js","../../node_modules/lucide-react/dist/esm/icons/save.js","../../node_modules/lucide-react/dist/esm/icons/scroll-text.js","../../node_modules/lucide-react/dist/esm/icons/search.js","../../node_modules/lucide-react/dist/esm/icons/send.js","../../node_modules/lucide-react/dist/esm/icons/settings-2.js","../../node_modules/lucide-react/dist/esm/icons/settings.js","../../node_modules/lucide-react/dist/esm/icons/shield-alert.js","../../node_modules/lucide-react/dist/esm/icons/shield.js","../../node_modules/lucide-react/dist/esm/icons/skip-forward.js","../../node_modules/lucide-react/dist/esm/icons/sparkles.js","../../node_modules/lucide-react/dist/esm/icons/square.js","../../node_modules/lucide-react/dist/esm/icons/stop-circle.js","../../node_modules/lucide-react/dist/esm/icons/tag.js","../../node_modules/lucide-react/dist/esm/icons/target.js","../../node_modules/lucide-react/dist/esm/icons/terminal.js","../../node_modules/lucide-react/dist/esm/icons/timer.js","../../node_modules/lucide-react/dist/esm/icons/trash-2.js","../../node_modules/lucide-react/dist/esm/icons/upload.js","../../node_modules/lucide-react/dist/esm/icons/wifi.js","../../node_modules/lucide-react/dist/esm/icons/wrench.js","../../node_modules/lucide-react/dist/esm/icons/x-circle.js","../../node_modules/lucide-react/dist/esm/icons/x.js","../../node_modules/lucide-react/dist/esm/icons/zap.js","../../src/components/layout/Sidebar.tsx","../../src/components/layout/Header.tsx","../../src/components/layout/Layout.tsx","../../node_modules/clsx/dist/clsx.mjs","../../src/components/common/Card.tsx","../../src/components/common/Button.tsx","../../src/components/common/Badge.tsx","../../node_modules/axios/lib/helpers/bind.js","../../node_modules/axios/lib/utils.js","../../node_modules/axios/lib/core/AxiosError.js","../../node_modules/axios/lib/helpers/null.js","../../node_modules/axios/lib/helpers/toFormData.js","../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../node_modules/axios/lib/helpers/buildURL.js","../../node_modules/axios/lib/core/InterceptorManager.js","../../node_modules/axios/lib/defaults/transitional.js","../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../node_modules/axios/lib/platform/browser/classes/FormData.js","../../node_modules/axios/lib/platform/browser/classes/Blob.js","../../node_modules/axios/lib/platform/browser/index.js","../../node_modules/axios/lib/platform/common/utils.js","../../node_modules/axios/lib/platform/index.js","../../node_modules/axios/lib/helpers/toURLEncodedForm.js","../../node_modules/axios/lib/helpers/formDataToJSON.js","../../node_modules/axios/lib/defaults/index.js","../../node_modules/axios/lib/helpers/parseHeaders.js","../../node_modules/axios/lib/core/AxiosHeaders.js","../../node_modules/axios/lib/core/transformData.js","../../node_modules/axios/lib/cancel/isCancel.js","../../node_modules/axios/lib/cancel/CanceledError.js","../../node_modules/axios/lib/core/settle.js","../../node_modules/axios/lib/helpers/parseProtocol.js","../../node_modules/axios/lib/helpers/speedometer.js","../../node_modules/axios/lib/helpers/throttle.js","../../node_modules/axios/lib/helpers/progressEventReducer.js","../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../node_modules/axios/lib/helpers/cookies.js","../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../node_modules/axios/lib/helpers/combineURLs.js","../../node_modules/axios/lib/core/buildFullPath.js","../../node_modules/axios/lib/core/mergeConfig.js","../../node_modules/axios/lib/helpers/resolveConfig.js","../../node_modules/axios/lib/adapters/xhr.js","../../node_modules/axios/lib/helpers/composeSignals.js","../../node_modules/axios/lib/helpers/trackStream.js","../../node_modules/axios/lib/adapters/fetch.js","../../node_modules/axios/lib/adapters/adapters.js","../../node_modules/axios/lib/core/dispatchRequest.js","../../node_modules/axios/lib/env/data.js","../../node_modules/axios/lib/helpers/validator.js","../../node_modules/axios/lib/core/Axios.js","../../node_modules/axios/lib/cancel/CancelToken.js","../../node_modules/axios/lib/helpers/spread.js","../../node_modules/axios/lib/helpers/isAxiosError.js","../../node_modules/axios/lib/helpers/HttpStatusCode.js","../../node_modules/axios/lib/axios.js","../../node_modules/axios/index.js","../../src/services/api.ts","../../node_modules/zustand/esm/vanilla.mjs","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../node_modules/use-sync-external-store/shim/with-selector.js","../../node_modules/zustand/esm/index.mjs","../../node_modules/zustand/esm/middleware.mjs","../../src/store/index.ts","../../src/pages/HomePage.tsx","../../src/components/common/Input.tsx","../../src/components/common/Textarea.tsx","../../src/pages/NewScanPage.tsx","../../src/services/websocket.ts","../../src/pages/ScanDetailsPage.tsx","../../src/pages/AgentStatusPage.tsx","../../src/pages/TaskLibraryPage.tsx","../../src/pages/RealtimeTaskPage.tsx","../../src/pages/ReportsPage.tsx","../../src/pages/ReportViewPage.tsx","../../src/pages/SettingsPage.tsx","../../src/pages/SchedulerPage.tsx","../../src/pages/AutoPentestPage.tsx","../../src/pages/VulnLabPage.tsx","../../src/pages/TerminalAgentPage.tsx","../../src/pages/SandboxDashboardPage.tsx","../../src/App.tsx","../../src/main.tsx"],"sourcesContent":["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)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,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,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(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"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(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 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(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={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,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({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});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){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 wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&Ng(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=Lg(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Tg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Rg(f.type,f.key,f.props,null,a.mode,h),h.ref=Lg(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Sg(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);Mg(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=Qg(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(a){var b=Wg.current;E(Wg);a._currentValue=b}function bh(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}\nfunction ch(a,b){Xg=a;Zg=Yg=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(dh=!0),a.firstContext=null)}function eh(a){var b=a._currentValue;if(Zg!==a)if(a={context:a,memoizedValue:b,next:null},null===Yg){if(null===Xg)throw Error(p(308));Yg=a;Xg.dependencies={lanes:0,firstContext:a}}else Yg=Yg.next=a;return b}var fh=null;function gh(a){null===fh?fh=[a]:fh.push(a)}\nfunction hh(a,b,c,d){var e=b.interleaved;null===e?(c.next=c,gh(b)):(c.next=e.next,e.next=c);b.interleaved=c;return ih(a,d)}function ih(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}var jh=!1;function kh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}\nfunction lh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function mh(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}\nfunction nh(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(K&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return ih(a,c)}e=d.interleaved;null===e?(b.next=b,gh(d)):(b.next=e.next,e.next=b);d.interleaved=b;return ih(a,c)}function oh(a,b,c){b=b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nfunction ph(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=\nb;c.lastBaseUpdate=b}\nfunction qh(a,b,c,d){var e=a.updateQueue;jh=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var m=a.alternate;null!==m&&(m=m.updateQueue,h=m.lastBaseUpdate,h!==g&&(null===h?m.firstBaseUpdate=l:h.next=l,m.lastBaseUpdate=k))}if(null!==f){var q=e.baseState;g=0;m=l=k=null;h=f;do{var r=h.lane,y=h.eventTime;if((d&r)===r){null!==m&&(m=m.next={eventTime:y,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,\nnext:null});a:{var n=a,t=h;r=b;y=c;switch(t.tag){case 1:n=t.payload;if(\"function\"===typeof n){q=n.call(y,q,r);break a}q=n;break a;case 3:n.flags=n.flags&-65537|128;case 0:n=t.payload;r=\"function\"===typeof n?n.call(y,q,r):n;if(null===r||void 0===r)break a;q=A({},q,r);break a;case 2:jh=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,r=e.effects,null===r?e.effects=[h]:r.push(h))}else y={eventTime:y,lane:r,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===m?(l=m=y,k=q):m=m.next=y,g|=r;\nh=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else r=h,h=r.next,r.next=null,e.lastBaseUpdate=r,e.shared.pending=null}while(1);null===m&&(k=q);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=m;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);rh|=g;a.lanes=g;a.memoizedState=q}}\nfunction sh(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;bc?c:4;a(!0);var d=Gh.transition;Gh.transition={};try{a(!1),b()}finally{C=c,Gh.transition=d}}function wi(){return Uh().memoizedState}\nfunction xi(a,b,c){var d=yi(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,c);else if(c=hh(a,b,c,d),null!==c){var e=R();gi(c,a,d,e);Bi(c,b,d)}}\nfunction ii(a,b,c){var d=yi(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,gh(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=hh(a,b,e,d);null!==c&&(e=R(),gi(c,a,d,e),Bi(c,b,d))}}\nfunction zi(a){var b=a.alternate;return a===M||null!==b&&b===M}function Ai(a,b){Jh=Ih=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Bi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(a,b){Th().memoizedState=[a,void 0===b?null:b];return a},useContext:eh,useEffect:mi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ki(4194308,\n4,pi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ki(4194308,4,a,b)},useInsertionEffect:function(a,b){return ki(4,2,a,b)},useMemo:function(a,b){var c=Th();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Th();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=xi.bind(null,M,a);return[d.memoizedState,a]},useRef:function(a){var b=\nTh();a={current:a};return b.memoizedState=a},useState:hi,useDebugValue:ri,useDeferredValue:function(a){return Th().memoizedState=a},useTransition:function(){var a=hi(!1),b=a[0];a=vi.bind(null,a[1]);Th().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=M,e=Th();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===Q)throw Error(p(349));0!==(Hh&30)||di(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;mi(ai.bind(null,d,\nf,a),[a]);d.flags|=2048;bi(9,ci.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Th(),b=Q.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Kh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;zj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eGj&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304)}else{if(!d)if(a=Ch(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dj(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Gj&&1073741824!==c&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=L.current,G(L,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Hj(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(fj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Ij(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return zh(),E(Wf),E(H),Eh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Bh(b),null;case 13:E(L);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(b.type._context),null;case 22:case 23:return Hj(),\nnull;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Lj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Mj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Nj=!1;\nfunction Oj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Ci(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Nj;Nj=!1;return n}\nfunction Pj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Mj(b,c,f)}e=e.next}while(e!==d)}}function Qj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Rj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Sj(a){var b=a.alternate;null!==b&&(a.alternate=null,Sj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Tj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Uj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Tj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Vj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Vj(a,b,c),a=a.sibling;null!==a;)Vj(a,b,c),a=a.sibling}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}var X=null,Xj=!1;function Yj(a,b,c){for(c=c.child;null!==c;)Zj(a,b,c),c=c.sibling}\nfunction Zj(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Lj(c,b);case 6:var d=X,e=Xj;X=null;Yj(a,b,c);X=d;Xj=e;null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Xj;X=c.stateNode.containerInfo;Xj=!0;\nYj(a,b,c);X=d;Xj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Mj(c,b,g):0!==(f&4)&&Mj(c,b,g));e=e.next}while(e!==d)}Yj(a,b,c);break;case 1:if(!U&&(Lj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Yj(a,b,c);break;case 21:Yj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Yj(a,b,c),U=d):Yj(a,b,c);break;default:Yj(a,b,c)}}function ak(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Kj);b.forEach(function(b){var d=bk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction ck(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*lk(d/1960))-d;if(10a?16:a;if(null===wk)var d=!1;else{a=wk;wk=null;xk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-fk?Kk(a,0):rk|=c);Dk(a,b)}function Yk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=R();a=ih(a,b);null!==a&&(Ac(a,b,c),Dk(a,c))}function uj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Yk(a,c)}\nfunction bk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Yk(a,c)}var Vk;\nVk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)dh=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return dh=!1,yj(a,b,c);dh=0!==(a.flags&131072)?!0:!1}else dh=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;ij(a,b);a=b.pendingProps;var e=Yf(b,H.current);ch(b,c);e=Nh(null,b,d,a,e,c);var f=Sh();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,kh(b),e.updater=Ei,b.stateNode=e,e._reactInternals=b,Ii(b,d,a,c),b=jj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Xi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{ij(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=Zk(d);a=Ci(d,a);switch(e){case 0:b=cj(null,b,d,a,c);break a;case 1:b=hj(null,b,d,a,c);break a;case 11:b=Yi(null,b,d,a,c);break a;case 14:b=$i(null,b,d,Ci(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),cj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),hj(a,b,d,e,c);case 3:a:{kj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;lh(a,b);qh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ji(Error(p(423)),b);b=lj(a,b,d,c,e);break a}else if(d!==e){e=Ji(Error(p(424)),b);b=lj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Vg(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=Zi(a,b,c);break a}Xi(a,b,d,c)}b=b.child}return b;case 5:return Ah(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\ngj(a,b),Xi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return oj(a,b,c);case 4:return yh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Ug(b,null,d,c):Xi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),Yi(a,b,d,e,c);case 7:return Xi(a,b,b.pendingProps,c),b.child;case 8:return Xi(a,b,b.pendingProps.children,c),b.child;case 12:return Xi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Wg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=Zi(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=mh(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);bh(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);bh(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Xi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,ch(b,c),e=eh(e),d=d(e),b.flags|=1,Xi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Ci(d,b.pendingProps),e=Ci(d.type,e),$i(a,b,d,e,c);case 15:return bj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),ij(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,ch(b,c),Gi(b,d,e),Ii(b,d,e,c),jj(null,b,d,!0,a,c);case 19:return xj(a,b,c);case 22:return dj(a,b,c)}throw Error(p(156,b.tag));};function Fk(a,b){return ac(a,b)}\nfunction $k(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new $k(a,b,c,d)}function aj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction Zk(a){if(\"function\"===typeof a)return aj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction Pg(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Rg(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)aj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Tg(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return pj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Tg(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function pj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function Qg(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction Sg(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction al(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function bl(a,b,c,d,e,f,g,h,k){a=new al(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};kh(f);return a}function cl(a,b,c){var d=3 createMemoryLocation(entry, typeof entry === \"string\" ? null : entry.state, index === 0 ? \"default\" : undefined));\n let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex);\n let action = Action.Pop;\n let listener = null;\n function clampIndex(n) {\n return Math.min(Math.max(n, 0), entries.length - 1);\n }\n function getCurrentLocation() {\n return entries[index];\n }\n function createMemoryLocation(to, state, key) {\n if (state === void 0) {\n state = null;\n }\n let location = createLocation(entries ? getCurrentLocation().pathname : \"/\", to, state, key);\n warning(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in memory history: \" + JSON.stringify(to));\n return location;\n }\n function createHref(to) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n let history = {\n get index() {\n return index;\n },\n get action() {\n return action;\n },\n get location() {\n return getCurrentLocation();\n },\n createHref,\n createURL(to) {\n return new URL(createHref(to), \"http://localhost\");\n },\n encodeLocation(to) {\n let path = typeof to === \"string\" ? parsePath(to) : to;\n return {\n pathname: path.pathname || \"\",\n search: path.search || \"\",\n hash: path.hash || \"\"\n };\n },\n push(to, state) {\n action = Action.Push;\n let nextLocation = createMemoryLocation(to, state);\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n if (v5Compat && listener) {\n listener({\n action,\n location: nextLocation,\n delta: 1\n });\n }\n },\n replace(to, state) {\n action = Action.Replace;\n let nextLocation = createMemoryLocation(to, state);\n entries[index] = nextLocation;\n if (v5Compat && listener) {\n listener({\n action,\n location: nextLocation,\n delta: 0\n });\n }\n },\n go(delta) {\n action = Action.Pop;\n let nextIndex = clampIndex(index + delta);\n let nextLocation = entries[nextIndex];\n index = nextIndex;\n if (listener) {\n listener({\n action,\n location: nextLocation,\n delta\n });\n }\n },\n listen(fn) {\n listener = fn;\n return () => {\n listener = null;\n };\n }\n };\n return history;\n}\n/**\n * Browser history stores the location in regular URLs. This is the standard for\n * most web apps, but it requires some configuration on the server to ensure you\n * serve the same app at multiple URLs.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\n */\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n function createBrowserLocation(window, globalHistory) {\n let {\n pathname,\n search,\n hash\n } = window.location;\n return createLocation(\"\", {\n pathname,\n search,\n hash\n },\n // state defaults to `null` because `window.history.state` does\n globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n }\n function createBrowserHref(window, to) {\n return typeof to === \"string\" ? to : createPath(to);\n }\n return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);\n}\n/**\n * Hash history stores the location in window.location.hash. This makes it ideal\n * for situations where you don't want to send the location to the server for\n * some reason, either because you do cannot configure it or the URL space is\n * reserved for something else.\n *\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\n */\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n function createHashLocation(window, globalHistory) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n } = parsePath(window.location.hash.substr(1));\n // Hash URL should always have a leading / just like window.location.pathname\n // does, so if an app ends up at a route like /#something then we add a\n // leading slash so all of our path-matching behaves the same as if it would\n // in a browser router. This is particularly important when there exists a\n // root splat route () since that matches internally against\n // \"/*\" and we'd expect /#something to 404 in a hash router app.\n if (!pathname.startsWith(\"/\") && !pathname.startsWith(\".\")) {\n pathname = \"/\" + pathname;\n }\n return createLocation(\"\", {\n pathname,\n search,\n hash\n },\n // state defaults to `null` because `window.history.state` does\n globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || \"default\");\n }\n function createHashHref(window, to) {\n let base = window.document.querySelector(\"base\");\n let href = \"\";\n if (base && base.getAttribute(\"href\")) {\n let url = window.location.href;\n let hashIndex = url.indexOf(\"#\");\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n return href + \"#\" + (typeof to === \"string\" ? to : createPath(to));\n }\n function validateHashLocation(location, to) {\n warning(location.pathname.charAt(0) === \"/\", \"relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\");\n }\n return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options);\n}\nfunction invariant(value, message) {\n if (value === false || value === null || typeof value === \"undefined\") {\n throw new Error(message);\n }\n}\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience, so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\n * For browser-based histories, we combine the state and key into an object\n */\nfunction getHistoryState(location, index) {\n return {\n usr: location.state,\n key: location.key,\n idx: index\n };\n}\n/**\n * Creates a Location object with a unique key from the given Path\n */\nfunction createLocation(current, to, state, key) {\n if (state === void 0) {\n state = null;\n }\n let location = _extends({\n pathname: typeof current === \"string\" ? current : current.pathname,\n search: \"\",\n hash: \"\"\n }, typeof to === \"string\" ? parsePath(to) : to, {\n state,\n // TODO: This could be cleaned up. push/replace should probably just take\n // full Locations now and avoid the need to run through this flow at all\n // But that's a pretty big refactor to the current test suite so going to\n // keep as is for the time being and just let any incoming keys take precedence\n key: to && to.key || key || createKey()\n });\n return location;\n}\n/**\n * Creates a string URL path from the given pathname, search, and hash components.\n */\nfunction createPath(_ref) {\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\"\n } = _ref;\n if (search && search !== \"?\") pathname += search.charAt(0) === \"?\" ? search : \"?\" + search;\n if (hash && hash !== \"#\") pathname += hash.charAt(0) === \"#\" ? hash : \"#\" + hash;\n return pathname;\n}\n/**\n * Parses a string URL path into its separate pathname, search, and hash components.\n */\nfunction parsePath(path) {\n let parsedPath = {};\n if (path) {\n let hashIndex = path.indexOf(\"#\");\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n let searchIndex = path.indexOf(\"?\");\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n if (path) {\n parsedPath.pathname = path;\n }\n }\n return parsedPath;\n}\nfunction getUrlBasedHistory(getLocation, createHref, validateLocation, options) {\n if (options === void 0) {\n options = {};\n }\n let {\n window = document.defaultView,\n v5Compat = false\n } = options;\n let globalHistory = window.history;\n let action = Action.Pop;\n let listener = null;\n let index = getIndex();\n // Index should only be null when we initialize. If not, it's because the\n // user called history.pushState or history.replaceState directly, in which\n // case we should log a warning as it will result in bugs.\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), \"\");\n }\n function getIndex() {\n let state = globalHistory.state || {\n idx: null\n };\n return state.idx;\n }\n function handlePop() {\n action = Action.Pop;\n let nextIndex = getIndex();\n let delta = nextIndex == null ? null : nextIndex - index;\n index = nextIndex;\n if (listener) {\n listener({\n action,\n location: history.location,\n delta\n });\n }\n }\n function push(to, state) {\n action = Action.Push;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n index = getIndex() + 1;\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n // try...catch because iOS limits us to 100 pushState calls :/\n try {\n globalHistory.pushState(historyState, \"\", url);\n } catch (error) {\n // If the exception is because `state` can't be serialized, let that throw\n // outwards just like a replace call would so the dev knows the cause\n // https://html.spec.whatwg.org/multipage/nav-history-apis.html#shared-history-push/replace-state-steps\n // https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal\n if (error instanceof DOMException && error.name === \"DataCloneError\") {\n throw error;\n }\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n if (v5Compat && listener) {\n listener({\n action,\n location: history.location,\n delta: 1\n });\n }\n }\n function replace(to, state) {\n action = Action.Replace;\n let location = createLocation(history.location, to, state);\n if (validateLocation) validateLocation(location, to);\n index = getIndex();\n let historyState = getHistoryState(location, index);\n let url = history.createHref(location);\n globalHistory.replaceState(historyState, \"\", url);\n if (v5Compat && listener) {\n listener({\n action,\n location: history.location,\n delta: 0\n });\n }\n }\n function createURL(to) {\n // window.location.origin is \"null\" (the literal string value) in Firefox\n // under certain conditions, notably when serving from a local HTML file\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297\n let base = window.location.origin !== \"null\" ? window.location.origin : window.location.href;\n let href = typeof to === \"string\" ? to : createPath(to);\n // Treating this as a full URL will strip any trailing spaces so we need to\n // pre-encode them since they might be part of a matching splat param from\n // an ancestor route\n href = href.replace(/ $/, \"%20\");\n invariant(base, \"No window.location.(origin|href) available to create URL for href: \" + href);\n return new URL(href, base);\n }\n let history = {\n get action() {\n return action;\n },\n get location() {\n return getLocation(window, globalHistory);\n },\n listen(fn) {\n if (listener) {\n throw new Error(\"A history only accepts one active listener\");\n }\n window.addEventListener(PopStateEventType, handlePop);\n listener = fn;\n return () => {\n window.removeEventListener(PopStateEventType, handlePop);\n listener = null;\n };\n },\n createHref(to) {\n return createHref(window, to);\n },\n createURL,\n encodeLocation(to) {\n // Encode a Location the same way window.location would\n let url = createURL(to);\n return {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash\n };\n },\n push,\n replace,\n go(n) {\n return globalHistory.go(n);\n }\n };\n return history;\n}\n//#endregion\n\nvar ResultType;\n(function (ResultType) {\n ResultType[\"data\"] = \"data\";\n ResultType[\"deferred\"] = \"deferred\";\n ResultType[\"redirect\"] = \"redirect\";\n ResultType[\"error\"] = \"error\";\n})(ResultType || (ResultType = {}));\nconst immutableRouteKeys = new Set([\"lazy\", \"caseSensitive\", \"path\", \"id\", \"index\", \"children\"]);\nfunction isIndexRoute(route) {\n return route.index === true;\n}\n// Walk the route tree generating unique IDs where necessary, so we are working\n// solely with AgnosticDataRouteObject's within the Router\nfunction convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath, manifest) {\n if (parentPath === void 0) {\n parentPath = [];\n }\n if (manifest === void 0) {\n manifest = {};\n }\n return routes.map((route, index) => {\n let treePath = [...parentPath, String(index)];\n let id = typeof route.id === \"string\" ? route.id : treePath.join(\"-\");\n invariant(route.index !== true || !route.children, \"Cannot specify children on an index route\");\n invariant(!manifest[id], \"Found a route id collision on id \\\"\" + id + \"\\\". Route \" + \"id's must be globally unique within Data Router usages\");\n if (isIndexRoute(route)) {\n let indexRoute = _extends({}, route, mapRouteProperties(route), {\n id\n });\n manifest[id] = indexRoute;\n return indexRoute;\n } else {\n let pathOrLayoutRoute = _extends({}, route, mapRouteProperties(route), {\n id,\n children: undefined\n });\n manifest[id] = pathOrLayoutRoute;\n if (route.children) {\n pathOrLayoutRoute.children = convertRoutesToDataRoutes(route.children, mapRouteProperties, treePath, manifest);\n }\n return pathOrLayoutRoute;\n }\n });\n}\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/v6/utils/match-routes\n */\nfunction matchRoutes(routes, locationArg, basename) {\n if (basename === void 0) {\n basename = \"/\";\n }\n return matchRoutesImpl(routes, locationArg, basename, false);\n}\nfunction matchRoutesImpl(routes, locationArg, basename, allowPartial) {\n let location = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n let pathname = stripBasename(location.pathname || \"/\", basename);\n if (pathname == null) {\n return null;\n }\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n let matches = null;\n for (let i = 0; matches == null && i < branches.length; ++i) {\n // Incoming pathnames are generally encoded from either window.location\n // or from router.navigate, but we want to match against the unencoded\n // paths in the route definitions. Memory router locations won't be\n // encoded here but there also shouldn't be anything to decode so this\n // should be a safe operation. This avoids needing matchRoutes to be\n // history-aware.\n let decoded = decodePath(pathname);\n matches = matchRouteBranch(branches[i], decoded, allowPartial);\n }\n return matches;\n}\nfunction convertRouteMatchToUiMatch(match, loaderData) {\n let {\n route,\n pathname,\n params\n } = match;\n return {\n id: route.id,\n pathname,\n params,\n data: loaderData[route.id],\n handle: route.handle\n };\n}\nfunction flattenRoutes(routes, branches, parentsMeta, parentPath) {\n if (branches === void 0) {\n branches = [];\n }\n if (parentsMeta === void 0) {\n parentsMeta = [];\n }\n if (parentPath === void 0) {\n parentPath = \"\";\n }\n let flattenRoute = (route, index, relativePath) => {\n let meta = {\n relativePath: relativePath === undefined ? route.path || \"\" : relativePath,\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route\n };\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(meta.relativePath.startsWith(parentPath), \"Absolute route path \\\"\" + meta.relativePath + \"\\\" nested under path \" + (\"\\\"\" + parentPath + \"\\\" is not valid. An absolute child route path \") + \"must start with the combined path of all its parent routes.\");\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta);\n // Add the children before adding this route to the array, so we traverse the\n // route tree depth-first and child routes appear before their parents in\n // the \"flattened\" version.\n if (route.children && route.children.length > 0) {\n invariant(\n // Our types know better, but runtime JS may not!\n // @ts-expect-error\n route.index !== true, \"Index routes must not have child routes. Please remove \" + (\"all child routes from route path \\\"\" + path + \"\\\".\"));\n flattenRoutes(route.children, branches, routesMeta, path);\n }\n // Routes without a path shouldn't ever match by themselves unless they are\n // index routes, so don't add them to the list of possible branches.\n if (route.path == null && !route.index) {\n return;\n }\n branches.push({\n path,\n score: computeScore(path, route.index),\n routesMeta\n });\n };\n routes.forEach((route, index) => {\n var _route$path;\n // coarse-grain check for optional params\n if (route.path === \"\" || !((_route$path = route.path) != null && _route$path.includes(\"?\"))) {\n flattenRoute(route, index);\n } else {\n for (let exploded of explodeOptionalSegments(route.path)) {\n flattenRoute(route, index, exploded);\n }\n }\n });\n return branches;\n}\n/**\n * Computes all combinations of optional path segments for a given path,\n * excluding combinations that are ambiguous and of lower priority.\n *\n * For example, `/one/:two?/three/:four?/:five?` explodes to:\n * - `/one/three`\n * - `/one/:two/three`\n * - `/one/three/:four`\n * - `/one/three/:five`\n * - `/one/:two/three/:four`\n * - `/one/:two/three/:five`\n * - `/one/three/:four/:five`\n * - `/one/:two/three/:four/:five`\n */\nfunction explodeOptionalSegments(path) {\n let segments = path.split(\"/\");\n if (segments.length === 0) return [];\n let [first, ...rest] = segments;\n // Optional path segments are denoted by a trailing `?`\n let isOptional = first.endsWith(\"?\");\n // Compute the corresponding required segment: `foo?` -> `foo`\n let required = first.replace(/\\?$/, \"\");\n if (rest.length === 0) {\n // Intepret empty string as omitting an optional segment\n // `[\"one\", \"\", \"three\"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`\n return isOptional ? [required, \"\"] : [required];\n }\n let restExploded = explodeOptionalSegments(rest.join(\"/\"));\n let result = [];\n // All child paths with the prefix. Do this for all children before the\n // optional version for all children, so we get consistent ordering where the\n // parent optional aspect is preferred as required. Otherwise, we can get\n // child sections interspersed where deeper optional segments are higher than\n // parent optional segments, where for example, /:two would explode _earlier_\n // then /:one. By always including the parent as required _for all children_\n // first, we avoid this issue\n result.push(...restExploded.map(subpath => subpath === \"\" ? required : [required, subpath].join(\"/\")));\n // Then, if this is an optional value, add all child versions without\n if (isOptional) {\n result.push(...restExploded);\n }\n // for absolute paths, ensure `/` instead of empty segment\n return result.map(exploded => path.startsWith(\"/\") && exploded === \"\" ? \"/\" : exploded);\n}\nfunction rankRouteBranches(branches) {\n branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first\n : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));\n}\nconst paramRe = /^:[\\w-]+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\nconst isSplat = s => s === \"*\";\nfunction computeScore(path, index) {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n if (index) {\n initialScore += indexRouteValue;\n }\n return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === \"\" ? emptySegmentValue : staticSegmentValue), initialScore);\n}\nfunction compareIndexes(a, b) {\n let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n return siblings ?\n // If two routes are siblings, we should try to match the earlier sibling\n // first. This allows people to have fine-grained control over the matching\n // behavior by simply putting routes with identical paths in the order they\n // want them tried.\n a[a.length - 1] - b[b.length - 1] :\n // Otherwise, it doesn't really make sense to rank non-siblings by index,\n // so they sort equally.\n 0;\n}\nfunction matchRouteBranch(branch, pathname, allowPartial) {\n if (allowPartial === void 0) {\n allowPartial = false;\n }\n let {\n routesMeta\n } = branch;\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches = [];\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname = matchedPathname === \"/\" ? pathname : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath({\n path: meta.relativePath,\n caseSensitive: meta.caseSensitive,\n end\n }, remainingPathname);\n let route = meta.route;\n if (!match && end && allowPartial && !routesMeta[routesMeta.length - 1].route.index) {\n match = matchPath({\n path: meta.relativePath,\n caseSensitive: meta.caseSensitive,\n end: false\n }, remainingPathname);\n }\n if (!match) {\n return null;\n }\n Object.assign(matchedParams, match.params);\n matches.push({\n // TODO: Can this as be avoided?\n params: matchedParams,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])),\n route\n });\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n return matches;\n}\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/v6/utils/generate-path\n */\nfunction generatePath(originalPath, params) {\n if (params === void 0) {\n params = {};\n }\n let path = originalPath;\n if (path.endsWith(\"*\") && path !== \"*\" && !path.endsWith(\"/*\")) {\n warning(false, \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n path = path.replace(/\\*$/, \"/*\");\n }\n // ensure `/` is added at the beginning if the path is absolute\n const prefix = path.startsWith(\"/\") ? \"/\" : \"\";\n const stringify = p => p == null ? \"\" : typeof p === \"string\" ? p : String(p);\n const segments = path.split(/\\/+/).map((segment, index, array) => {\n const isLastSegment = index === array.length - 1;\n // only apply the splat if it's the last segment\n if (isLastSegment && segment === \"*\") {\n const star = \"*\";\n // Apply the splat\n return stringify(params[star]);\n }\n const keyMatch = segment.match(/^:([\\w-]+)(\\??)$/);\n if (keyMatch) {\n const [, key, optional] = keyMatch;\n let param = params[key];\n invariant(optional === \"?\" || param != null, \"Missing \\\":\" + key + \"\\\" param\");\n return stringify(param);\n }\n // Remove any optional markers from optional static segments\n return segment.replace(/\\?$/g, \"\");\n })\n // Remove empty segments\n .filter(segment => !!segment);\n return prefix + segments.join(\"/\");\n}\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/v6/utils/match-path\n */\nfunction matchPath(pattern, pathname) {\n if (typeof pattern === \"string\") {\n pattern = {\n path: pattern,\n caseSensitive: false,\n end: true\n };\n }\n let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);\n let match = pathname.match(matcher);\n if (!match) return null;\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params = compiledParams.reduce((memo, _ref, index) => {\n let {\n paramName,\n isOptional\n } = _ref;\n // We need to compute the pathnameBase here using the raw splat value\n // instead of using params[\"*\"] later because it will be decoded then\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\\/+$/, \"$1\");\n }\n const value = captureGroups[index];\n if (isOptional && !value) {\n memo[paramName] = undefined;\n } else {\n memo[paramName] = (value || \"\").replace(/%2F/g, \"/\");\n }\n return memo;\n }, {});\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern\n };\n}\nfunction compilePath(path, caseSensitive, end) {\n if (caseSensitive === void 0) {\n caseSensitive = false;\n }\n if (end === void 0) {\n end = true;\n }\n warning(path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"), \"Route path \\\"\" + path + \"\\\" will be treated as if it were \" + (\"\\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\" because the `*` character must \") + \"always follow a `/` in the pattern. To get rid of this warning, \" + (\"please change the route path to \\\"\" + path.replace(/\\*$/, \"/*\") + \"\\\".\"));\n let params = [];\n let regexpSource = \"^\" + path.replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n .replace(/[\\\\.*+^${}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n .replace(/\\/:([\\w-]+)(\\?)?/g, (_, paramName, isOptional) => {\n params.push({\n paramName,\n isOptional: isOptional != null\n });\n return isOptional ? \"/?([^\\\\/]+)?\" : \"/([^\\\\/]+)\";\n });\n if (path.endsWith(\"*\")) {\n params.push({\n paramName: \"*\"\n });\n regexpSource += path === \"*\" || path === \"/*\" ? \"(.*)$\" // Already matched the initial /, just match the rest\n : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n } else if (end) {\n // When matching to the end, ignore trailing slashes\n regexpSource += \"\\\\/*$\";\n } else if (path !== \"\" && path !== \"/\") {\n // If our path is non-empty and contains anything beyond an initial slash,\n // then we have _some_ form of path in our regex, so we should expect to\n // match only if we find the end of this path segment. Look for an optional\n // non-captured trailing slash (to match a portion of the URL) or the end\n // of the path (if we've matched to the end). We used to do this with a\n // word boundary but that gives false positives on routes like\n // /user-preferences since `-` counts as a word boundary.\n regexpSource += \"(?:(?=\\\\/|$))\";\n } else ;\n let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n return [matcher, params];\n}\nfunction decodePath(value) {\n try {\n return value.split(\"/\").map(v => decodeURIComponent(v).replace(/\\//g, \"%2F\")).join(\"/\");\n } catch (error) {\n warning(false, \"The URL path \\\"\" + value + \"\\\" could not be decoded because it is is a \" + \"malformed URL segment. This is probably due to a bad percent \" + (\"encoding (\" + error + \").\"));\n return value;\n }\n}\n/**\n * @private\n */\nfunction stripBasename(pathname, basename) {\n if (basename === \"/\") return pathname;\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n }\n // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n let startIndex = basename.endsWith(\"/\") ? basename.length - 1 : basename.length;\n let nextChar = pathname.charAt(startIndex);\n if (nextChar && nextChar !== \"/\") {\n // pathname does not start with basename/\n return null;\n }\n return pathname.slice(startIndex) || \"/\";\n}\nconst ABSOLUTE_URL_REGEX$1 = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\nconst isAbsoluteUrl = url => ABSOLUTE_URL_REGEX$1.test(url);\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/v6/utils/resolve-path\n */\nfunction resolvePath(to, fromPathname) {\n if (fromPathname === void 0) {\n fromPathname = \"/\";\n }\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\"\n } = typeof to === \"string\" ? parsePath(to) : to;\n let pathname;\n if (toPathname) {\n if (isAbsoluteUrl(toPathname)) {\n pathname = toPathname;\n } else {\n if (toPathname.includes(\"//\")) {\n let oldPathname = toPathname;\n toPathname = toPathname.replace(/\\/\\/+/g, \"/\");\n warning(false, \"Pathnames cannot have embedded double slashes - normalizing \" + (oldPathname + \" -> \" + toPathname));\n }\n if (toPathname.startsWith(\"/\")) {\n pathname = resolvePathname(toPathname.substring(1), \"/\");\n } else {\n pathname = resolvePathname(toPathname, fromPathname);\n }\n }\n } else {\n pathname = fromPathname;\n }\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash)\n };\n}\nfunction resolvePathname(relativePath, fromPathname) {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n relativeSegments.forEach(segment => {\n if (segment === \"..\") {\n // Keep the root \"\" segment so the pathname starts at /\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\nfunction getInvalidPathError(char, field, dest, path) {\n return \"Cannot include a '\" + char + \"' character in a manually specified \" + (\"`to.\" + field + \"` field [\" + JSON.stringify(path) + \"]. Please separate it out to the \") + (\"`to.\" + dest + \"` field. Alternatively you may provide the full path as \") + \"a string in and the router will parse it for you.\";\n}\n/**\n * @private\n *\n * When processing relative navigation we want to ignore ancestor routes that\n * do not contribute to the path, such that index/pathless layout routes don't\n * interfere.\n *\n * For example, when moving a route element into an index route and/or a\n * pathless layout route, relative link behavior contained within should stay\n * the same. Both of the following examples should link back to the root:\n *\n * \n * \n * \n *\n * \n * \n * }> // <-- Does not contribute\n * // <-- Does not contribute\n * \n * \n */\nfunction getPathContributingMatches(matches) {\n return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);\n}\n// Return the array of pathnames for the current route matches - used to\n// generate the routePathnames input for resolveTo()\nfunction getResolveToMatches(matches, v7_relativeSplatPath) {\n let pathMatches = getPathContributingMatches(matches);\n // When v7_relativeSplatPath is enabled, use the full pathname for the leaf\n // match so we include splat values for \".\" links. See:\n // https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329\n if (v7_relativeSplatPath) {\n return pathMatches.map((match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase);\n }\n return pathMatches.map(match => match.pathnameBase);\n}\n/**\n * @private\n */\nfunction resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {\n if (isPathRelative === void 0) {\n isPathRelative = false;\n }\n let to;\n if (typeof toArg === \"string\") {\n to = parsePath(toArg);\n } else {\n to = _extends({}, toArg);\n invariant(!to.pathname || !to.pathname.includes(\"?\"), getInvalidPathError(\"?\", \"pathname\", \"search\", to));\n invariant(!to.pathname || !to.pathname.includes(\"#\"), getInvalidPathError(\"#\", \"pathname\", \"hash\", to));\n invariant(!to.search || !to.search.includes(\"#\"), getInvalidPathError(\"#\", \"search\", \"hash\", to));\n }\n let isEmptyPath = toArg === \"\" || to.pathname === \"\";\n let toPathname = isEmptyPath ? \"/\" : to.pathname;\n let from;\n // Routing is relative to the current pathname if explicitly requested.\n //\n // If a pathname is explicitly provided in `to`, it should be relative to the\n // route context. This is explained in `Note on `` values` in our\n // migration guide from v5 as a means of disambiguation between `to` values\n // that begin with `/` and those that do not. However, this is problematic for\n // `to` values that do not provide a pathname. `to` can simply be a search or\n // hash string, in which case we should assume that the navigation is relative\n // to the current location's pathname and *not* the route pathname.\n if (toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n // With relative=\"route\" (the default), each leading .. segment means\n // \"go up one route\" instead of \"go up one URL segment\". This is a key\n // difference from how works and a major reason we call this a\n // \"to\" value instead of a \"href\".\n if (!isPathRelative && toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\");\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n to.pathname = toSegments.join(\"/\");\n }\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n let path = resolvePath(to, from);\n // Ensure the pathname has a trailing slash if the original \"to\" had one\n let hasExplicitTrailingSlash = toPathname && toPathname !== \"/\" && toPathname.endsWith(\"/\");\n // Or if this was a link to the current path which has a trailing slash\n let hasCurrentTrailingSlash = (isEmptyPath || toPathname === \".\") && locationPathname.endsWith(\"/\");\n if (!path.pathname.endsWith(\"/\") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {\n path.pathname += \"/\";\n }\n return path;\n}\n/**\n * @private\n */\nfunction getToPathname(to) {\n // Empty strings should be treated the same as / paths\n return to === \"\" || to.pathname === \"\" ? \"/\" : typeof to === \"string\" ? parsePath(to).pathname : to.pathname;\n}\n/**\n * @private\n */\nconst joinPaths = paths => paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n/**\n * @private\n */\nconst normalizePathname = pathname => pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n/**\n * @private\n */\nconst normalizeSearch = search => !search || search === \"?\" ? \"\" : search.startsWith(\"?\") ? search : \"?\" + search;\n/**\n * @private\n */\nconst normalizeHash = hash => !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n/**\n * This is a shortcut for creating `application/json` responses. Converts `data`\n * to JSON and sets the `Content-Type` header.\n *\n * @deprecated The `json` method is deprecated in favor of returning raw objects.\n * This method will be removed in v7.\n */\nconst json = function json(data, init) {\n if (init === void 0) {\n init = {};\n }\n let responseInit = typeof init === \"number\" ? {\n status: init\n } : init;\n let headers = new Headers(responseInit.headers);\n if (!headers.has(\"Content-Type\")) {\n headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n }\n return new Response(JSON.stringify(data), _extends({}, responseInit, {\n headers\n }));\n};\nclass DataWithResponseInit {\n constructor(data, init) {\n this.type = \"DataWithResponseInit\";\n this.data = data;\n this.init = init || null;\n }\n}\n/**\n * Create \"responses\" that contain `status`/`headers` without forcing\n * serialization into an actual `Response` - used by Remix single fetch\n */\nfunction data(data, init) {\n return new DataWithResponseInit(data, typeof init === \"number\" ? {\n status: init\n } : init);\n}\nclass AbortedDeferredError extends Error {}\nclass DeferredData {\n constructor(data, responseInit) {\n this.pendingKeysSet = new Set();\n this.subscribers = new Set();\n this.deferredKeys = [];\n invariant(data && typeof data === \"object\" && !Array.isArray(data), \"defer() only accepts plain objects\");\n // Set up an AbortController + Promise we can race against to exit early\n // cancellation\n let reject;\n this.abortPromise = new Promise((_, r) => reject = r);\n this.controller = new AbortController();\n let onAbort = () => reject(new AbortedDeferredError(\"Deferred data aborted\"));\n this.unlistenAbortSignal = () => this.controller.signal.removeEventListener(\"abort\", onAbort);\n this.controller.signal.addEventListener(\"abort\", onAbort);\n this.data = Object.entries(data).reduce((acc, _ref2) => {\n let [key, value] = _ref2;\n return Object.assign(acc, {\n [key]: this.trackPromise(key, value)\n });\n }, {});\n if (this.done) {\n // All incoming values were resolved\n this.unlistenAbortSignal();\n }\n this.init = responseInit;\n }\n trackPromise(key, value) {\n if (!(value instanceof Promise)) {\n return value;\n }\n this.deferredKeys.push(key);\n this.pendingKeysSet.add(key);\n // We store a little wrapper promise that will be extended with\n // _data/_error props upon resolve/reject\n let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, undefined, data), error => this.onSettle(promise, key, error));\n // Register rejection listeners to avoid uncaught promise rejections on\n // errors or aborted deferred values\n promise.catch(() => {});\n Object.defineProperty(promise, \"_tracked\", {\n get: () => true\n });\n return promise;\n }\n onSettle(promise, key, error, data) {\n if (this.controller.signal.aborted && error instanceof AbortedDeferredError) {\n this.unlistenAbortSignal();\n Object.defineProperty(promise, \"_error\", {\n get: () => error\n });\n return Promise.reject(error);\n }\n this.pendingKeysSet.delete(key);\n if (this.done) {\n // Nothing left to abort!\n this.unlistenAbortSignal();\n }\n // If the promise was resolved/rejected with undefined, we'll throw an error as you\n // should always resolve with a value or null\n if (error === undefined && data === undefined) {\n let undefinedError = new Error(\"Deferred data for key \\\"\" + key + \"\\\" resolved/rejected with `undefined`, \" + \"you must resolve/reject with a value or `null`.\");\n Object.defineProperty(promise, \"_error\", {\n get: () => undefinedError\n });\n this.emit(false, key);\n return Promise.reject(undefinedError);\n }\n if (data === undefined) {\n Object.defineProperty(promise, \"_error\", {\n get: () => error\n });\n this.emit(false, key);\n return Promise.reject(error);\n }\n Object.defineProperty(promise, \"_data\", {\n get: () => data\n });\n this.emit(false, key);\n return data;\n }\n emit(aborted, settledKey) {\n this.subscribers.forEach(subscriber => subscriber(aborted, settledKey));\n }\n subscribe(fn) {\n this.subscribers.add(fn);\n return () => this.subscribers.delete(fn);\n }\n cancel() {\n this.controller.abort();\n this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));\n this.emit(true);\n }\n async resolveData(signal) {\n let aborted = false;\n if (!this.done) {\n let onAbort = () => this.cancel();\n signal.addEventListener(\"abort\", onAbort);\n aborted = await new Promise(resolve => {\n this.subscribe(aborted => {\n signal.removeEventListener(\"abort\", onAbort);\n if (aborted || this.done) {\n resolve(aborted);\n }\n });\n });\n }\n return aborted;\n }\n get done() {\n return this.pendingKeysSet.size === 0;\n }\n get unwrappedData() {\n invariant(this.data !== null && this.done, \"Can only unwrap data on initialized and settled deferreds\");\n return Object.entries(this.data).reduce((acc, _ref3) => {\n let [key, value] = _ref3;\n return Object.assign(acc, {\n [key]: unwrapTrackedPromise(value)\n });\n }, {});\n }\n get pendingKeys() {\n return Array.from(this.pendingKeysSet);\n }\n}\nfunction isTrackedPromise(value) {\n return value instanceof Promise && value._tracked === true;\n}\nfunction unwrapTrackedPromise(value) {\n if (!isTrackedPromise(value)) {\n return value;\n }\n if (value._error) {\n throw value._error;\n }\n return value._data;\n}\n/**\n * @deprecated The `defer` method is deprecated in favor of returning raw\n * objects. This method will be removed in v7.\n */\nconst defer = function defer(data, init) {\n if (init === void 0) {\n init = {};\n }\n let responseInit = typeof init === \"number\" ? {\n status: init\n } : init;\n return new DeferredData(data, responseInit);\n};\n/**\n * A redirect response. Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nconst redirect = function redirect(url, init) {\n if (init === void 0) {\n init = 302;\n }\n let responseInit = init;\n if (typeof responseInit === \"number\") {\n responseInit = {\n status: responseInit\n };\n } else if (typeof responseInit.status === \"undefined\") {\n responseInit.status = 302;\n }\n let headers = new Headers(responseInit.headers);\n headers.set(\"Location\", url);\n return new Response(null, _extends({}, responseInit, {\n headers\n }));\n};\n/**\n * A redirect response that will force a document reload to the new location.\n * Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nconst redirectDocument = (url, init) => {\n let response = redirect(url, init);\n response.headers.set(\"X-Remix-Reload-Document\", \"true\");\n return response;\n};\n/**\n * A redirect response that will perform a `history.replaceState` instead of a\n * `history.pushState` for client-side navigation redirects.\n * Sets the status code and the `Location` header.\n * Defaults to \"302 Found\".\n */\nconst replace = (url, init) => {\n let response = redirect(url, init);\n response.headers.set(\"X-Remix-Replace\", \"true\");\n return response;\n};\n/**\n * @private\n * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies\n *\n * We don't export the class for public use since it's an implementation\n * detail, but we export the interface above so folks can build their own\n * abstractions around instances via isRouteErrorResponse()\n */\nclass ErrorResponseImpl {\n constructor(status, statusText, data, internal) {\n if (internal === void 0) {\n internal = false;\n }\n this.status = status;\n this.statusText = statusText || \"\";\n this.internal = internal;\n if (data instanceof Error) {\n this.data = data.toString();\n this.error = data;\n } else {\n this.data = data;\n }\n }\n}\n/**\n * Check if the given error is an ErrorResponse generated from a 4xx/5xx\n * Response thrown from an action/loader\n */\nfunction isRouteErrorResponse(error) {\n return error != null && typeof error.status === \"number\" && typeof error.statusText === \"string\" && typeof error.internal === \"boolean\" && \"data\" in error;\n}\n\nconst validMutationMethodsArr = [\"post\", \"put\", \"patch\", \"delete\"];\nconst validMutationMethods = new Set(validMutationMethodsArr);\nconst validRequestMethodsArr = [\"get\", ...validMutationMethodsArr];\nconst validRequestMethods = new Set(validRequestMethodsArr);\nconst redirectStatusCodes = new Set([301, 302, 303, 307, 308]);\nconst redirectPreserveMethodStatusCodes = new Set([307, 308]);\nconst IDLE_NAVIGATION = {\n state: \"idle\",\n location: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined\n};\nconst IDLE_FETCHER = {\n state: \"idle\",\n data: undefined,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined\n};\nconst IDLE_BLOCKER = {\n state: \"unblocked\",\n proceed: undefined,\n reset: undefined,\n location: undefined\n};\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\nconst defaultMapRouteProperties = route => ({\n hasErrorBoundary: Boolean(route.hasErrorBoundary)\n});\nconst TRANSITIONS_STORAGE_KEY = \"remix-router-transitions\";\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createRouter\n////////////////////////////////////////////////////////////////////////////////\n/**\n * Create a router and listen to history POP navigations\n */\nfunction createRouter(init) {\n const routerWindow = init.window ? init.window : typeof window !== \"undefined\" ? window : undefined;\n const isBrowser = typeof routerWindow !== \"undefined\" && typeof routerWindow.document !== \"undefined\" && typeof routerWindow.document.createElement !== \"undefined\";\n const isServer = !isBrowser;\n invariant(init.routes.length > 0, \"You must provide a non-empty routes array to createRouter\");\n let mapRouteProperties;\n if (init.mapRouteProperties) {\n mapRouteProperties = init.mapRouteProperties;\n } else if (init.detectErrorBoundary) {\n // If they are still using the deprecated version, wrap it with the new API\n let detectErrorBoundary = init.detectErrorBoundary;\n mapRouteProperties = route => ({\n hasErrorBoundary: detectErrorBoundary(route)\n });\n } else {\n mapRouteProperties = defaultMapRouteProperties;\n }\n // Routes keyed by ID\n let manifest = {};\n // Routes in tree format for matching\n let dataRoutes = convertRoutesToDataRoutes(init.routes, mapRouteProperties, undefined, manifest);\n let inFlightDataRoutes;\n let basename = init.basename || \"/\";\n let dataStrategyImpl = init.dataStrategy || defaultDataStrategy;\n let patchRoutesOnNavigationImpl = init.patchRoutesOnNavigation;\n // Config driven behavior flags\n let future = _extends({\n v7_fetcherPersist: false,\n v7_normalizeFormMethod: false,\n v7_partialHydration: false,\n v7_prependBasename: false,\n v7_relativeSplatPath: false,\n v7_skipActionErrorRevalidation: false\n }, init.future);\n // Cleanup function for history\n let unlistenHistory = null;\n // Externally-provided functions to call on all state changes\n let subscribers = new Set();\n // Externally-provided object to hold scroll restoration locations during routing\n let savedScrollPositions = null;\n // Externally-provided function to get scroll restoration keys\n let getScrollRestorationKey = null;\n // Externally-provided function to get current scroll position\n let getScrollPosition = null;\n // One-time flag to control the initial hydration scroll restoration. Because\n // we don't get the saved positions from until _after_\n // the initial render, we need to manually trigger a separate updateState to\n // send along the restoreScrollPosition\n // Set to true if we have `hydrationData` since we assume we were SSR'd and that\n // SSR did the initial scroll restoration.\n let initialScrollRestored = init.hydrationData != null;\n let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);\n let initialMatchesIsFOW = false;\n let initialErrors = null;\n if (initialMatches == null && !patchRoutesOnNavigationImpl) {\n // If we do not match a user-provided-route, fall back to the root\n // to allow the error boundary to take over\n let error = getInternalRouterError(404, {\n pathname: init.history.location.pathname\n });\n let {\n matches,\n route\n } = getShortCircuitMatches(dataRoutes);\n initialMatches = matches;\n initialErrors = {\n [route.id]: error\n };\n }\n // In SPA apps, if the user provided a patchRoutesOnNavigation implementation and\n // our initial match is a splat route, clear them out so we run through lazy\n // discovery on hydration in case there's a more accurate lazy route match.\n // In SSR apps (with `hydrationData`), we expect that the server will send\n // up the proper matched routes so we don't want to run lazy discovery on\n // initial hydration and want to hydrate into the splat route.\n if (initialMatches && !init.hydrationData) {\n let fogOfWar = checkFogOfWar(initialMatches, dataRoutes, init.history.location.pathname);\n if (fogOfWar.active) {\n initialMatches = null;\n }\n }\n let initialized;\n if (!initialMatches) {\n initialized = false;\n initialMatches = [];\n // If partial hydration and fog of war is enabled, we will be running\n // `patchRoutesOnNavigation` during hydration so include any partial matches as\n // the initial matches so we can properly render `HydrateFallback`'s\n if (future.v7_partialHydration) {\n let fogOfWar = checkFogOfWar(null, dataRoutes, init.history.location.pathname);\n if (fogOfWar.active && fogOfWar.matches) {\n initialMatchesIsFOW = true;\n initialMatches = fogOfWar.matches;\n }\n }\n } else if (initialMatches.some(m => m.route.lazy)) {\n // All initialMatches need to be loaded before we're ready. If we have lazy\n // functions around still then we'll need to run them in initialize()\n initialized = false;\n } else if (!initialMatches.some(m => m.route.loader)) {\n // If we've got no loaders to run, then we're good to go\n initialized = true;\n } else if (future.v7_partialHydration) {\n // If partial hydration is enabled, we're initialized so long as we were\n // provided with hydrationData for every route with a loader, and no loaders\n // were marked for explicit hydration\n let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;\n let errors = init.hydrationData ? init.hydrationData.errors : null;\n // If errors exist, don't consider routes below the boundary\n if (errors) {\n let idx = initialMatches.findIndex(m => errors[m.route.id] !== undefined);\n initialized = initialMatches.slice(0, idx + 1).every(m => !shouldLoadRouteOnHydration(m.route, loaderData, errors));\n } else {\n initialized = initialMatches.every(m => !shouldLoadRouteOnHydration(m.route, loaderData, errors));\n }\n } else {\n // Without partial hydration - we're initialized if we were provided any\n // hydrationData - which is expected to be complete\n initialized = init.hydrationData != null;\n }\n let router;\n let state = {\n historyAction: init.history.action,\n location: init.history.location,\n matches: initialMatches,\n initialized,\n navigation: IDLE_NAVIGATION,\n // Don't restore on initial updateState() if we were SSR'd\n restoreScrollPosition: init.hydrationData != null ? false : null,\n preventScrollReset: false,\n revalidation: \"idle\",\n loaderData: init.hydrationData && init.hydrationData.loaderData || {},\n actionData: init.hydrationData && init.hydrationData.actionData || null,\n errors: init.hydrationData && init.hydrationData.errors || initialErrors,\n fetchers: new Map(),\n blockers: new Map()\n };\n // -- Stateful internal variables to manage navigations --\n // Current navigation in progress (to be committed in completeNavigation)\n let pendingAction = Action.Pop;\n // Should the current navigation prevent the scroll reset if scroll cannot\n // be restored?\n let pendingPreventScrollReset = false;\n // AbortController for the active navigation\n let pendingNavigationController;\n // Should the current navigation enable document.startViewTransition?\n let pendingViewTransitionEnabled = false;\n // Store applied view transitions so we can apply them on POP\n let appliedViewTransitions = new Map();\n // Cleanup function for persisting applied transitions to sessionStorage\n let removePageHideEventListener = null;\n // We use this to avoid touching history in completeNavigation if a\n // revalidation is entirely uninterrupted\n let isUninterruptedRevalidation = false;\n // Use this internal flag to force revalidation of all loaders:\n // - submissions (completed or interrupted)\n // - useRevalidator()\n // - X-Remix-Revalidate (from redirect)\n let isRevalidationRequired = false;\n // Use this internal array to capture routes that require revalidation due\n // to a cancelled deferred on action submission\n let cancelledDeferredRoutes = [];\n // Use this internal array to capture fetcher loads that were cancelled by an\n // action navigation and require revalidation\n let cancelledFetcherLoads = new Set();\n // AbortControllers for any in-flight fetchers\n let fetchControllers = new Map();\n // Track loads based on the order in which they started\n let incrementingLoadId = 0;\n // Track the outstanding pending navigation data load to be compared against\n // the globally incrementing load when a fetcher load lands after a completed\n // navigation\n let pendingNavigationLoadId = -1;\n // Fetchers that triggered data reloads as a result of their actions\n let fetchReloadIds = new Map();\n // Fetchers that triggered redirect navigations\n let fetchRedirectIds = new Set();\n // Most recent href/match for fetcher.load calls for fetchers\n let fetchLoadMatches = new Map();\n // Ref-count mounted fetchers so we know when it's ok to clean them up\n let activeFetchers = new Map();\n // Fetchers that have requested a delete when using v7_fetcherPersist,\n // they'll be officially removed after they return to idle\n let deletedFetchers = new Set();\n // Store DeferredData instances for active route matches. When a\n // route loader returns defer() we stick one in here. Then, when a nested\n // promise resolves we update loaderData. If a new navigation starts we\n // cancel active deferreds for eliminated routes.\n let activeDeferreds = new Map();\n // Store blocker functions in a separate Map outside of router state since\n // we don't need to update UI state if they change\n let blockerFunctions = new Map();\n // Flag to ignore the next history update, so we can revert the URL change on\n // a POP navigation that was blocked by the user without touching router state\n let unblockBlockerHistoryUpdate = undefined;\n // Initialize the router, all side effects should be kicked off from here.\n // Implemented as a Fluent API for ease of:\n // let router = createRouter(init).initialize();\n function initialize() {\n // If history informs us of a POP navigation, start the navigation but do not update\n // state. We'll update our own state once the navigation completes\n unlistenHistory = init.history.listen(_ref => {\n let {\n action: historyAction,\n location,\n delta\n } = _ref;\n // Ignore this event if it was just us resetting the URL from a\n // blocked POP navigation\n if (unblockBlockerHistoryUpdate) {\n unblockBlockerHistoryUpdate();\n unblockBlockerHistoryUpdate = undefined;\n return;\n }\n warning(blockerFunctions.size === 0 || delta != null, \"You are trying to use a blocker on a POP navigation to a location \" + \"that was not created by @remix-run/router. This will fail silently in \" + \"production. This can happen if you are navigating outside the router \" + \"via `window.history.pushState`/`window.location.hash` instead of using \" + \"router navigation APIs. This can also happen if you are using \" + \"createHashRouter and the user manually changes the URL.\");\n let blockerKey = shouldBlockNavigation({\n currentLocation: state.location,\n nextLocation: location,\n historyAction\n });\n if (blockerKey && delta != null) {\n // Restore the URL to match the current UI, but don't update router state\n let nextHistoryUpdatePromise = new Promise(resolve => {\n unblockBlockerHistoryUpdate = resolve;\n });\n init.history.go(delta * -1);\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location,\n proceed() {\n updateBlocker(blockerKey, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location\n });\n // Re-do the same POP navigation we just blocked, after the url\n // restoration is also complete. See:\n // https://github.com/remix-run/react-router/issues/11613\n nextHistoryUpdatePromise.then(() => init.history.go(delta));\n },\n reset() {\n let blockers = new Map(state.blockers);\n blockers.set(blockerKey, IDLE_BLOCKER);\n updateState({\n blockers\n });\n }\n });\n return;\n }\n return startNavigation(historyAction, location);\n });\n if (isBrowser) {\n // FIXME: This feels gross. How can we cleanup the lines between\n // scrollRestoration/appliedTransitions persistance?\n restoreAppliedTransitions(routerWindow, appliedViewTransitions);\n let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions);\n routerWindow.addEventListener(\"pagehide\", _saveAppliedTransitions);\n removePageHideEventListener = () => routerWindow.removeEventListener(\"pagehide\", _saveAppliedTransitions);\n }\n // Kick off initial data load if needed. Use Pop to avoid modifying history\n // Note we don't do any handling of lazy here. For SPA's it'll get handled\n // in the normal navigation flow. For SSR it's expected that lazy modules are\n // resolved prior to router creation since we can't go into a fallbackElement\n // UI for SSR'd apps\n if (!state.initialized) {\n startNavigation(Action.Pop, state.location, {\n initialHydration: true\n });\n }\n return router;\n }\n // Clean up a router and it's side effects\n function dispose() {\n if (unlistenHistory) {\n unlistenHistory();\n }\n if (removePageHideEventListener) {\n removePageHideEventListener();\n }\n subscribers.clear();\n pendingNavigationController && pendingNavigationController.abort();\n state.fetchers.forEach((_, key) => deleteFetcher(key));\n state.blockers.forEach((_, key) => deleteBlocker(key));\n }\n // Subscribe to state updates for the router\n function subscribe(fn) {\n subscribers.add(fn);\n return () => subscribers.delete(fn);\n }\n // Update our state and notify the calling context of the change\n function updateState(newState, opts) {\n if (opts === void 0) {\n opts = {};\n }\n state = _extends({}, state, newState);\n // Prep fetcher cleanup so we can tell the UI which fetcher data entries\n // can be removed\n let completedFetchers = [];\n let deletedFetchersKeys = [];\n if (future.v7_fetcherPersist) {\n state.fetchers.forEach((fetcher, key) => {\n if (fetcher.state === \"idle\") {\n if (deletedFetchers.has(key)) {\n // Unmounted from the UI and can be totally removed\n deletedFetchersKeys.push(key);\n } else {\n // Returned to idle but still mounted in the UI, so semi-remains for\n // revalidations and such\n completedFetchers.push(key);\n }\n }\n });\n }\n // Remove any lingering deleted fetchers that have already been removed\n // from state.fetchers\n deletedFetchers.forEach(key => {\n if (!state.fetchers.has(key) && !fetchControllers.has(key)) {\n deletedFetchersKeys.push(key);\n }\n });\n // Iterate over a local copy so that if flushSync is used and we end up\n // removing and adding a new subscriber due to the useCallback dependencies,\n // we don't get ourselves into a loop calling the new subscriber immediately\n [...subscribers].forEach(subscriber => subscriber(state, {\n deletedFetchers: deletedFetchersKeys,\n viewTransitionOpts: opts.viewTransitionOpts,\n flushSync: opts.flushSync === true\n }));\n // Remove idle fetchers from state since we only care about in-flight fetchers.\n if (future.v7_fetcherPersist) {\n completedFetchers.forEach(key => state.fetchers.delete(key));\n deletedFetchersKeys.forEach(key => deleteFetcher(key));\n } else {\n // We already called deleteFetcher() on these, can remove them from this\n // Set now that we've handed the keys off to the data layer\n deletedFetchersKeys.forEach(key => deletedFetchers.delete(key));\n }\n }\n // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION\n // and setting state.[historyAction/location/matches] to the new route.\n // - Location is a required param\n // - Navigation will always be set to IDLE_NAVIGATION\n // - Can pass any other state in newState\n function completeNavigation(location, newState, _temp) {\n var _location$state, _location$state2;\n let {\n flushSync\n } = _temp === void 0 ? {} : _temp;\n // Deduce if we're in a loading/actionReload state:\n // - We have committed actionData in the store\n // - The current navigation was a mutation submission\n // - We're past the submitting state and into the loading state\n // - The location being loaded is not the result of a redirect\n let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === \"loading\" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true;\n let actionData;\n if (newState.actionData) {\n if (Object.keys(newState.actionData).length > 0) {\n actionData = newState.actionData;\n } else {\n // Empty actionData -> clear prior actionData due to an action error\n actionData = null;\n }\n } else if (isActionReload) {\n // Keep the current data if we're wrapping up the action reload\n actionData = state.actionData;\n } else {\n // Clear actionData on any other completed navigations\n actionData = null;\n }\n // Always preserve any existing loaderData from re-used routes\n let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData;\n // On a successful navigation we can assume we got through all blockers\n // so we can start fresh\n let blockers = state.blockers;\n if (blockers.size > 0) {\n blockers = new Map(blockers);\n blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER));\n }\n // Always respect the user flag. Otherwise don't reset on mutation\n // submission navigations unless they redirect\n let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location.state) == null ? void 0 : _location$state2._isRedirect) !== true;\n // Commit any in-flight routes at the end of the HMR revalidation \"navigation\"\n if (inFlightDataRoutes) {\n dataRoutes = inFlightDataRoutes;\n inFlightDataRoutes = undefined;\n }\n if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) {\n init.history.push(location, location.state);\n } else if (pendingAction === Action.Replace) {\n init.history.replace(location, location.state);\n }\n let viewTransitionOpts;\n // On POP, enable transitions if they were enabled on the original navigation\n if (pendingAction === Action.Pop) {\n // Forward takes precedence so they behave like the original navigation\n let priorPaths = appliedViewTransitions.get(state.location.pathname);\n if (priorPaths && priorPaths.has(location.pathname)) {\n viewTransitionOpts = {\n currentLocation: state.location,\n nextLocation: location\n };\n } else if (appliedViewTransitions.has(location.pathname)) {\n // If we don't have a previous forward nav, assume we're popping back to\n // the new location and enable if that location previously enabled\n viewTransitionOpts = {\n currentLocation: location,\n nextLocation: state.location\n };\n }\n } else if (pendingViewTransitionEnabled) {\n // Store the applied transition on PUSH/REPLACE\n let toPaths = appliedViewTransitions.get(state.location.pathname);\n if (toPaths) {\n toPaths.add(location.pathname);\n } else {\n toPaths = new Set([location.pathname]);\n appliedViewTransitions.set(state.location.pathname, toPaths);\n }\n viewTransitionOpts = {\n currentLocation: state.location,\n nextLocation: location\n };\n }\n updateState(_extends({}, newState, {\n actionData,\n loaderData,\n historyAction: pendingAction,\n location,\n initialized: true,\n navigation: IDLE_NAVIGATION,\n revalidation: \"idle\",\n restoreScrollPosition: getSavedScrollPosition(location, newState.matches || state.matches),\n preventScrollReset,\n blockers\n }), {\n viewTransitionOpts,\n flushSync: flushSync === true\n });\n // Reset stateful navigation vars\n pendingAction = Action.Pop;\n pendingPreventScrollReset = false;\n pendingViewTransitionEnabled = false;\n isUninterruptedRevalidation = false;\n isRevalidationRequired = false;\n cancelledDeferredRoutes = [];\n }\n // Trigger a navigation event, which can either be a numerical POP or a PUSH\n // replace with an optional submission\n async function navigate(to, opts) {\n if (typeof to === \"number\") {\n init.history.go(to);\n return;\n }\n let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, future.v7_relativeSplatPath, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative);\n let {\n path,\n submission,\n error\n } = normalizeNavigateOptions(future.v7_normalizeFormMethod, false, normalizedPath, opts);\n let currentLocation = state.location;\n let nextLocation = createLocation(state.location, path, opts && opts.state);\n // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded\n // URL from window.location, so we need to encode it here so the behavior\n // remains the same as POP and non-data-router usages. new URL() does all\n // the same encoding we'd get from a history.pushState/window.location read\n // without having to touch history\n nextLocation = _extends({}, nextLocation, init.history.encodeLocation(nextLocation));\n let userReplace = opts && opts.replace != null ? opts.replace : undefined;\n let historyAction = Action.Push;\n if (userReplace === true) {\n historyAction = Action.Replace;\n } else if (userReplace === false) ; else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {\n // By default on submissions to the current location we REPLACE so that\n // users don't have to double-click the back button to get to the prior\n // location. If the user redirects to a different location from the\n // action/loader this will be ignored and the redirect will be a PUSH\n historyAction = Action.Replace;\n }\n let preventScrollReset = opts && \"preventScrollReset\" in opts ? opts.preventScrollReset === true : undefined;\n let flushSync = (opts && opts.flushSync) === true;\n let blockerKey = shouldBlockNavigation({\n currentLocation,\n nextLocation,\n historyAction\n });\n if (blockerKey) {\n // Put the blocker into a blocked state\n updateBlocker(blockerKey, {\n state: \"blocked\",\n location: nextLocation,\n proceed() {\n updateBlocker(blockerKey, {\n state: \"proceeding\",\n proceed: undefined,\n reset: undefined,\n location: nextLocation\n });\n // Send the same navigation through\n navigate(to, opts);\n },\n reset() {\n let blockers = new Map(state.blockers);\n blockers.set(blockerKey, IDLE_BLOCKER);\n updateState({\n blockers\n });\n }\n });\n return;\n }\n return await startNavigation(historyAction, nextLocation, {\n submission,\n // Send through the formData serialization error if we have one so we can\n // render at the right error boundary after we match routes\n pendingError: error,\n preventScrollReset,\n replace: opts && opts.replace,\n enableViewTransition: opts && opts.viewTransition,\n flushSync\n });\n }\n // Revalidate all current loaders. If a navigation is in progress or if this\n // is interrupted by a navigation, allow this to \"succeed\" by calling all\n // loaders during the next loader round\n function revalidate() {\n interruptActiveLoads();\n updateState({\n revalidation: \"loading\"\n });\n // If we're currently submitting an action, we don't need to start a new\n // navigation, we'll just let the follow up loader execution call all loaders\n if (state.navigation.state === \"submitting\") {\n return;\n }\n // If we're currently in an idle state, start a new navigation for the current\n // action/location and mark it as uninterrupted, which will skip the history\n // update in completeNavigation\n if (state.navigation.state === \"idle\") {\n startNavigation(state.historyAction, state.location, {\n startUninterruptedRevalidation: true\n });\n return;\n }\n // Otherwise, if we're currently in a loading state, just start a new\n // navigation to the navigation.location but do not trigger an uninterrupted\n // revalidation so that history correctly updates once the navigation completes\n startNavigation(pendingAction || state.historyAction, state.navigation.location, {\n overrideNavigation: state.navigation,\n // Proxy through any rending view transition\n enableViewTransition: pendingViewTransitionEnabled === true\n });\n }\n // Start a navigation to the given action/location. Can optionally provide a\n // overrideNavigation which will override the normalLoad in the case of a redirect\n // navigation\n async function startNavigation(historyAction, location, opts) {\n // Abort any in-progress navigations and start a new one. Unset any ongoing\n // uninterrupted revalidations unless told otherwise, since we want this\n // new navigation to update history normally\n pendingNavigationController && pendingNavigationController.abort();\n pendingNavigationController = null;\n pendingAction = historyAction;\n isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true;\n // Save the current scroll position every time we start a new navigation,\n // and track whether we should reset scroll on completion\n saveScrollPosition(state.location, state.matches);\n pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;\n pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let loadingNavigation = opts && opts.overrideNavigation;\n let matches = opts != null && opts.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ?\n // `matchRoutes()` has already been called if we're in here via `router.initialize()`\n state.matches : matchRoutes(routesToUse, location, basename);\n let flushSync = (opts && opts.flushSync) === true;\n // Short circuit if it's only a hash change and not a revalidation or\n // mutation submission.\n //\n // Ignore on initial page loads because since the initial hydration will always\n // be \"same hash\". For example, on /page#hash and submit a
\n // which will default to a navigation to /page\n if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {\n completeNavigation(location, {\n matches\n }, {\n flushSync\n });\n return;\n }\n let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);\n if (fogOfWar.active && fogOfWar.matches) {\n matches = fogOfWar.matches;\n }\n // Short circuit with a 404 on the root error boundary if we match nothing\n if (!matches) {\n let {\n error,\n notFoundMatches,\n route\n } = handleNavigational404(location.pathname);\n completeNavigation(location, {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error\n }\n }, {\n flushSync\n });\n return;\n }\n // Create a controller/Request for this navigation\n pendingNavigationController = new AbortController();\n let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission);\n let pendingActionResult;\n if (opts && opts.pendingError) {\n // If we have a pendingError, it means the user attempted a GET submission\n // with binary FormData so assign here and skip to handleLoaders. That\n // way we handle calling loaders above the boundary etc. It's not really\n // different from an actionError in that sense.\n pendingActionResult = [findNearestBoundary(matches).route.id, {\n type: ResultType.error,\n error: opts.pendingError\n }];\n } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {\n // Call action if we received an action submission\n let actionResult = await handleAction(request, location, opts.submission, matches, fogOfWar.active, {\n replace: opts.replace,\n flushSync\n });\n if (actionResult.shortCircuited) {\n return;\n }\n // If we received a 404 from handleAction, it's because we couldn't lazily\n // discover the destination route so we don't want to call loaders\n if (actionResult.pendingActionResult) {\n let [routeId, result] = actionResult.pendingActionResult;\n if (isErrorResult(result) && isRouteErrorResponse(result.error) && result.error.status === 404) {\n pendingNavigationController = null;\n completeNavigation(location, {\n matches: actionResult.matches,\n loaderData: {},\n errors: {\n [routeId]: result.error\n }\n });\n return;\n }\n }\n matches = actionResult.matches || matches;\n pendingActionResult = actionResult.pendingActionResult;\n loadingNavigation = getLoadingNavigation(location, opts.submission);\n flushSync = false;\n // No need to do fog of war matching again on loader execution\n fogOfWar.active = false;\n // Create a GET request for the loaders\n request = createClientSideRequest(init.history, request.url, request.signal);\n }\n // Call loaders\n let {\n shortCircuited,\n matches: updatedMatches,\n loaderData,\n errors\n } = await handleLoaders(request, location, matches, fogOfWar.active, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, opts && opts.initialHydration === true, flushSync, pendingActionResult);\n if (shortCircuited) {\n return;\n }\n // Clean up now that the action/loaders have completed. Don't clean up if\n // we short circuited because pendingNavigationController will have already\n // been assigned to a new controller for the next navigation\n pendingNavigationController = null;\n completeNavigation(location, _extends({\n matches: updatedMatches || matches\n }, getActionDataForCommit(pendingActionResult), {\n loaderData,\n errors\n }));\n }\n // Call the action matched by the leaf route for this navigation and handle\n // redirects/errors\n async function handleAction(request, location, submission, matches, isFogOfWar, opts) {\n if (opts === void 0) {\n opts = {};\n }\n interruptActiveLoads();\n // Put us in a submitting state\n let navigation = getSubmittingNavigation(location, submission);\n updateState({\n navigation\n }, {\n flushSync: opts.flushSync === true\n });\n if (isFogOfWar) {\n let discoverResult = await discoverRoutes(matches, location.pathname, request.signal);\n if (discoverResult.type === \"aborted\") {\n return {\n shortCircuited: true\n };\n } else if (discoverResult.type === \"error\") {\n let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;\n return {\n matches: discoverResult.partialMatches,\n pendingActionResult: [boundaryId, {\n type: ResultType.error,\n error: discoverResult.error\n }]\n };\n } else if (!discoverResult.matches) {\n let {\n notFoundMatches,\n error,\n route\n } = handleNavigational404(location.pathname);\n return {\n matches: notFoundMatches,\n pendingActionResult: [route.id, {\n type: ResultType.error,\n error\n }]\n };\n } else {\n matches = discoverResult.matches;\n }\n }\n // Call our action and get the result\n let result;\n let actionMatch = getTargetMatch(matches, location);\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n result = {\n type: ResultType.error,\n error: getInternalRouterError(405, {\n method: request.method,\n pathname: location.pathname,\n routeId: actionMatch.route.id\n })\n };\n } else {\n let results = await callDataStrategy(\"action\", state, request, [actionMatch], matches, null);\n result = results[actionMatch.route.id];\n if (request.signal.aborted) {\n return {\n shortCircuited: true\n };\n }\n }\n if (isRedirectResult(result)) {\n let replace;\n if (opts && opts.replace != null) {\n replace = opts.replace;\n } else {\n // If the user didn't explicity indicate replace behavior, replace if\n // we redirected to the exact same location we're currently at to avoid\n // double back-buttons\n let location = normalizeRedirectLocation(result.response.headers.get(\"Location\"), new URL(request.url), basename, init.history);\n replace = location === state.location.pathname + state.location.search;\n }\n await startRedirectNavigation(request, result, true, {\n submission,\n replace\n });\n return {\n shortCircuited: true\n };\n }\n if (isDeferredResult(result)) {\n throw getInternalRouterError(400, {\n type: \"defer-action\"\n });\n }\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);\n // By default, all submissions to the current location are REPLACE\n // navigations, but if the action threw an error that'll be rendered in\n // an errorElement, we fall back to PUSH so that the user can use the\n // back button to get back to the pre-submission form location to try\n // again\n if ((opts && opts.replace) !== true) {\n pendingAction = Action.Push;\n }\n return {\n matches,\n pendingActionResult: [boundaryMatch.route.id, result]\n };\n }\n return {\n matches,\n pendingActionResult: [actionMatch.route.id, result]\n };\n }\n // Call all applicable loaders for the given matches, handling redirects,\n // errors, etc.\n async function handleLoaders(request, location, matches, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace, initialHydration, flushSync, pendingActionResult) {\n // Figure out the right navigation we want to use for data loading\n let loadingNavigation = overrideNavigation || getLoadingNavigation(location, submission);\n // If this was a redirect from an action we don't have a \"submission\" but\n // we have it on the loading navigation so use that if available\n let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation);\n // If this is an uninterrupted revalidation, we remain in our current idle\n // state. If not, we need to switch to our loading state and load data,\n // preserving any new action data or existing action data (in the case of\n // a revalidation interrupting an actionReload)\n // If we have partialHydration enabled, then don't update the state for the\n // initial data load since it's not a \"navigation\"\n let shouldUpdateNavigationState = !isUninterruptedRevalidation && (!future.v7_partialHydration || !initialHydration);\n // When fog of war is enabled, we enter our `loading` state earlier so we\n // can discover new routes during the `loading` state. We skip this if\n // we've already run actions since we would have done our matching already.\n // If the children() function threw then, we want to proceed with the\n // partial matches it discovered.\n if (isFogOfWar) {\n if (shouldUpdateNavigationState) {\n let actionData = getUpdatedActionData(pendingActionResult);\n updateState(_extends({\n navigation: loadingNavigation\n }, actionData !== undefined ? {\n actionData\n } : {}), {\n flushSync\n });\n }\n let discoverResult = await discoverRoutes(matches, location.pathname, request.signal);\n if (discoverResult.type === \"aborted\") {\n return {\n shortCircuited: true\n };\n } else if (discoverResult.type === \"error\") {\n let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;\n return {\n matches: discoverResult.partialMatches,\n loaderData: {},\n errors: {\n [boundaryId]: discoverResult.error\n }\n };\n } else if (!discoverResult.matches) {\n let {\n error,\n notFoundMatches,\n route\n } = handleNavigational404(location.pathname);\n return {\n matches: notFoundMatches,\n loaderData: {},\n errors: {\n [route.id]: error\n }\n };\n } else {\n matches = discoverResult.matches;\n }\n }\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, future.v7_partialHydration && initialHydration === true, future.v7_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult);\n // Cancel pending deferreds for no-longer-matched routes or routes we're\n // about to reload. Note that if this is an action reload we would have\n // already cancelled all pending deferreds so this would be a no-op\n cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId));\n pendingNavigationLoadId = ++incrementingLoadId;\n // Short circuit if we have no loaders to run\n if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {\n let updatedFetchers = markFetchRedirectsDone();\n completeNavigation(location, _extends({\n matches,\n loaderData: {},\n // Commit pending error if we're short circuiting\n errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? {\n [pendingActionResult[0]]: pendingActionResult[1].error\n } : null\n }, getActionDataForCommit(pendingActionResult), updatedFetchers ? {\n fetchers: new Map(state.fetchers)\n } : {}), {\n flushSync\n });\n return {\n shortCircuited: true\n };\n }\n if (shouldUpdateNavigationState) {\n let updates = {};\n if (!isFogOfWar) {\n // Only update navigation/actionNData if we didn't already do it above\n updates.navigation = loadingNavigation;\n let actionData = getUpdatedActionData(pendingActionResult);\n if (actionData !== undefined) {\n updates.actionData = actionData;\n }\n }\n if (revalidatingFetchers.length > 0) {\n updates.fetchers = getUpdatedRevalidatingFetchers(revalidatingFetchers);\n }\n updateState(updates, {\n flushSync\n });\n }\n revalidatingFetchers.forEach(rf => {\n abortFetcher(rf.key);\n if (rf.controller) {\n // Fetchers use an independent AbortController so that aborting a fetcher\n // (via deleteFetcher) does not abort the triggering navigation that\n // triggered the revalidation\n fetchControllers.set(rf.key, rf.controller);\n }\n });\n // Proxy navigation abort through to revalidation fetchers\n let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(f => abortFetcher(f.key));\n if (pendingNavigationController) {\n pendingNavigationController.signal.addEventListener(\"abort\", abortPendingFetchRevalidations);\n }\n let {\n loaderResults,\n fetcherResults\n } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, request);\n if (request.signal.aborted) {\n return {\n shortCircuited: true\n };\n }\n // Clean up _after_ loaders have completed. Don't clean up if we short\n // circuited because fetchControllers would have been aborted and\n // reassigned to new controllers for the next navigation\n if (pendingNavigationController) {\n pendingNavigationController.signal.removeEventListener(\"abort\", abortPendingFetchRevalidations);\n }\n revalidatingFetchers.forEach(rf => fetchControllers.delete(rf.key));\n // If any loaders returned a redirect Response, start a new REPLACE navigation\n let redirect = findRedirect(loaderResults);\n if (redirect) {\n await startRedirectNavigation(request, redirect.result, true, {\n replace\n });\n return {\n shortCircuited: true\n };\n }\n redirect = findRedirect(fetcherResults);\n if (redirect) {\n // If this redirect came from a fetcher make sure we mark it in\n // fetchRedirectIds so it doesn't get revalidated on the next set of\n // loader executions\n fetchRedirectIds.add(redirect.key);\n await startRedirectNavigation(request, redirect.result, true, {\n replace\n });\n return {\n shortCircuited: true\n };\n }\n // Process and commit output from loaders\n let {\n loaderData,\n errors\n } = processLoaderData(state, matches, loaderResults, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds);\n // Wire up subscribers to update loaderData as promises settle\n activeDeferreds.forEach((deferredData, routeId) => {\n deferredData.subscribe(aborted => {\n // Note: No need to updateState here since the TrackedPromise on\n // loaderData is stable across resolve/reject\n // Remove this instance if we were aborted or if promises have settled\n if (aborted || deferredData.done) {\n activeDeferreds.delete(routeId);\n }\n });\n });\n // Preserve SSR errors during partial hydration\n if (future.v7_partialHydration && initialHydration && state.errors) {\n errors = _extends({}, state.errors, errors);\n }\n let updatedFetchers = markFetchRedirectsDone();\n let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);\n let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;\n return _extends({\n matches,\n loaderData,\n errors\n }, shouldUpdateFetchers ? {\n fetchers: new Map(state.fetchers)\n } : {});\n }\n function getUpdatedActionData(pendingActionResult) {\n if (pendingActionResult && !isErrorResult(pendingActionResult[1])) {\n // This is cast to `any` currently because `RouteData`uses any and it\n // would be a breaking change to use any.\n // TODO: v7 - change `RouteData` to use `unknown` instead of `any`\n return {\n [pendingActionResult[0]]: pendingActionResult[1].data\n };\n } else if (state.actionData) {\n if (Object.keys(state.actionData).length === 0) {\n return null;\n } else {\n return state.actionData;\n }\n }\n }\n function getUpdatedRevalidatingFetchers(revalidatingFetchers) {\n revalidatingFetchers.forEach(rf => {\n let fetcher = state.fetchers.get(rf.key);\n let revalidatingFetcher = getLoadingFetcher(undefined, fetcher ? fetcher.data : undefined);\n state.fetchers.set(rf.key, revalidatingFetcher);\n });\n return new Map(state.fetchers);\n }\n // Trigger a fetcher load/submit for the given fetcher key\n function fetch(key, routeId, href, opts) {\n if (isServer) {\n throw new Error(\"router.fetch() was called during the server render, but it shouldn't be. \" + \"You are likely calling a useFetcher() method in the body of your component. \" + \"Try moving it to a useEffect or a callback.\");\n }\n abortFetcher(key);\n let flushSync = (opts && opts.flushSync) === true;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, future.v7_relativeSplatPath, routeId, opts == null ? void 0 : opts.relative);\n let matches = matchRoutes(routesToUse, normalizedPath, basename);\n let fogOfWar = checkFogOfWar(matches, routesToUse, normalizedPath);\n if (fogOfWar.active && fogOfWar.matches) {\n matches = fogOfWar.matches;\n }\n if (!matches) {\n setFetcherError(key, routeId, getInternalRouterError(404, {\n pathname: normalizedPath\n }), {\n flushSync\n });\n return;\n }\n let {\n path,\n submission,\n error\n } = normalizeNavigateOptions(future.v7_normalizeFormMethod, true, normalizedPath, opts);\n if (error) {\n setFetcherError(key, routeId, error, {\n flushSync\n });\n return;\n }\n let match = getTargetMatch(matches, path);\n let preventScrollReset = (opts && opts.preventScrollReset) === true;\n if (submission && isMutationMethod(submission.formMethod)) {\n handleFetcherAction(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);\n return;\n }\n // Store off the match so we can call it's shouldRevalidate on subsequent\n // revalidations\n fetchLoadMatches.set(key, {\n routeId,\n path\n });\n handleFetcherLoader(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);\n }\n // Call the action for the matched fetcher.submit(), and then handle redirects,\n // errors, and revalidation\n async function handleFetcherAction(key, routeId, path, match, requestMatches, isFogOfWar, flushSync, preventScrollReset, submission) {\n interruptActiveLoads();\n fetchLoadMatches.delete(key);\n function detectAndHandle405Error(m) {\n if (!m.route.action && !m.route.lazy) {\n let error = getInternalRouterError(405, {\n method: submission.formMethod,\n pathname: path,\n routeId: routeId\n });\n setFetcherError(key, routeId, error, {\n flushSync\n });\n return true;\n }\n return false;\n }\n if (!isFogOfWar && detectAndHandle405Error(match)) {\n return;\n }\n // Put this fetcher into it's submitting state\n let existingFetcher = state.fetchers.get(key);\n updateFetcherState(key, getSubmittingFetcher(submission, existingFetcher), {\n flushSync\n });\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);\n if (isFogOfWar) {\n let discoverResult = await discoverRoutes(requestMatches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);\n if (discoverResult.type === \"aborted\") {\n return;\n } else if (discoverResult.type === \"error\") {\n setFetcherError(key, routeId, discoverResult.error, {\n flushSync\n });\n return;\n } else if (!discoverResult.matches) {\n setFetcherError(key, routeId, getInternalRouterError(404, {\n pathname: path\n }), {\n flushSync\n });\n return;\n } else {\n requestMatches = discoverResult.matches;\n match = getTargetMatch(requestMatches, path);\n if (detectAndHandle405Error(match)) {\n return;\n }\n }\n }\n // Call the action for the fetcher\n fetchControllers.set(key, abortController);\n let originatingLoadId = incrementingLoadId;\n let actionResults = await callDataStrategy(\"action\", state, fetchRequest, [match], requestMatches, key);\n let actionResult = actionResults[match.route.id];\n if (fetchRequest.signal.aborted) {\n // We can delete this so long as we weren't aborted by our own fetcher\n // re-submit which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n return;\n }\n // When using v7_fetcherPersist, we don't want errors bubbling up to the UI\n // or redirects processed for unmounted fetchers so we just revert them to\n // idle\n if (future.v7_fetcherPersist && deletedFetchers.has(key)) {\n if (isRedirectResult(actionResult) || isErrorResult(actionResult)) {\n updateFetcherState(key, getDoneFetcher(undefined));\n return;\n }\n // Let SuccessResult's fall through for revalidation\n } else {\n if (isRedirectResult(actionResult)) {\n fetchControllers.delete(key);\n if (pendingNavigationLoadId > originatingLoadId) {\n // A new navigation was kicked off after our action started, so that\n // should take precedence over this redirect navigation. We already\n // set isRevalidationRequired so all loaders for the new route should\n // fire unless opted out via shouldRevalidate\n updateFetcherState(key, getDoneFetcher(undefined));\n return;\n } else {\n fetchRedirectIds.add(key);\n updateFetcherState(key, getLoadingFetcher(submission));\n return startRedirectNavigation(fetchRequest, actionResult, false, {\n fetcherSubmission: submission,\n preventScrollReset\n });\n }\n }\n // Process any non-redirect errors thrown\n if (isErrorResult(actionResult)) {\n setFetcherError(key, routeId, actionResult.error);\n return;\n }\n }\n if (isDeferredResult(actionResult)) {\n throw getInternalRouterError(400, {\n type: \"defer-action\"\n });\n }\n // Start the data load for current matches, or the next location if we're\n // in the middle of a navigation\n let nextLocation = state.navigation.location || state.location;\n let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal);\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let matches = state.navigation.state !== \"idle\" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches;\n invariant(matches, \"Didn't find any matches after fetcher action\");\n let loadId = ++incrementingLoadId;\n fetchReloadIds.set(key, loadId);\n let loadFetcher = getLoadingFetcher(submission, actionResult.data);\n state.fetchers.set(key, loadFetcher);\n let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, false, future.v7_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, [match.route.id, actionResult]);\n // Put all revalidating fetchers into the loading state, except for the\n // current fetcher which we want to keep in it's current loading state which\n // contains it's action submission info + action data\n revalidatingFetchers.filter(rf => rf.key !== key).forEach(rf => {\n let staleKey = rf.key;\n let existingFetcher = state.fetchers.get(staleKey);\n let revalidatingFetcher = getLoadingFetcher(undefined, existingFetcher ? existingFetcher.data : undefined);\n state.fetchers.set(staleKey, revalidatingFetcher);\n abortFetcher(staleKey);\n if (rf.controller) {\n fetchControllers.set(staleKey, rf.controller);\n }\n });\n updateState({\n fetchers: new Map(state.fetchers)\n });\n let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(rf => abortFetcher(rf.key));\n abortController.signal.addEventListener(\"abort\", abortPendingFetchRevalidations);\n let {\n loaderResults,\n fetcherResults\n } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);\n if (abortController.signal.aborted) {\n return;\n }\n abortController.signal.removeEventListener(\"abort\", abortPendingFetchRevalidations);\n fetchReloadIds.delete(key);\n fetchControllers.delete(key);\n revalidatingFetchers.forEach(r => fetchControllers.delete(r.key));\n let redirect = findRedirect(loaderResults);\n if (redirect) {\n return startRedirectNavigation(revalidationRequest, redirect.result, false, {\n preventScrollReset\n });\n }\n redirect = findRedirect(fetcherResults);\n if (redirect) {\n // If this redirect came from a fetcher make sure we mark it in\n // fetchRedirectIds so it doesn't get revalidated on the next set of\n // loader executions\n fetchRedirectIds.add(redirect.key);\n return startRedirectNavigation(revalidationRequest, redirect.result, false, {\n preventScrollReset\n });\n }\n // Process and commit output from loaders\n let {\n loaderData,\n errors\n } = processLoaderData(state, matches, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds);\n // Since we let revalidations complete even if the submitting fetcher was\n // deleted, only put it back to idle if it hasn't been deleted\n if (state.fetchers.has(key)) {\n let doneFetcher = getDoneFetcher(actionResult.data);\n state.fetchers.set(key, doneFetcher);\n }\n abortStaleFetchLoads(loadId);\n // If we are currently in a navigation loading state and this fetcher is\n // more recent than the navigation, we want the newer data so abort the\n // navigation and complete it with the fetcher data\n if (state.navigation.state === \"loading\" && loadId > pendingNavigationLoadId) {\n invariant(pendingAction, \"Expected pending action\");\n pendingNavigationController && pendingNavigationController.abort();\n completeNavigation(state.navigation.location, {\n matches,\n loaderData,\n errors,\n fetchers: new Map(state.fetchers)\n });\n } else {\n // otherwise just update with the fetcher data, preserving any existing\n // loaderData for loaders that did not need to reload. We have to\n // manually merge here since we aren't going through completeNavigation\n updateState({\n errors,\n loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors),\n fetchers: new Map(state.fetchers)\n });\n isRevalidationRequired = false;\n }\n }\n // Call the matched loader for fetcher.load(), handling redirects, errors, etc.\n async function handleFetcherLoader(key, routeId, path, match, matches, isFogOfWar, flushSync, preventScrollReset, submission) {\n let existingFetcher = state.fetchers.get(key);\n updateFetcherState(key, getLoadingFetcher(submission, existingFetcher ? existingFetcher.data : undefined), {\n flushSync\n });\n let abortController = new AbortController();\n let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);\n if (isFogOfWar) {\n let discoverResult = await discoverRoutes(matches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);\n if (discoverResult.type === \"aborted\") {\n return;\n } else if (discoverResult.type === \"error\") {\n setFetcherError(key, routeId, discoverResult.error, {\n flushSync\n });\n return;\n } else if (!discoverResult.matches) {\n setFetcherError(key, routeId, getInternalRouterError(404, {\n pathname: path\n }), {\n flushSync\n });\n return;\n } else {\n matches = discoverResult.matches;\n match = getTargetMatch(matches, path);\n }\n }\n // Call the loader for this fetcher route match\n fetchControllers.set(key, abortController);\n let originatingLoadId = incrementingLoadId;\n let results = await callDataStrategy(\"loader\", state, fetchRequest, [match], matches, key);\n let result = results[match.route.id];\n // Deferred isn't supported for fetcher loads, await everything and treat it\n // as a normal load. resolveDeferredData will return undefined if this\n // fetcher gets aborted, so we just leave result untouched and short circuit\n // below if that happens\n if (isDeferredResult(result)) {\n result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result;\n }\n // We can delete this so long as we weren't aborted by our our own fetcher\n // re-load which would have put _new_ controller is in fetchControllers\n if (fetchControllers.get(key) === abortController) {\n fetchControllers.delete(key);\n }\n if (fetchRequest.signal.aborted) {\n return;\n }\n // We don't want errors bubbling up or redirects followed for unmounted\n // fetchers, so short circuit here if it was removed from the UI\n if (deletedFetchers.has(key)) {\n updateFetcherState(key, getDoneFetcher(undefined));\n return;\n }\n // If the loader threw a redirect Response, start a new REPLACE navigation\n if (isRedirectResult(result)) {\n if (pendingNavigationLoadId > originatingLoadId) {\n // A new navigation was kicked off after our loader started, so that\n // should take precedence over this redirect navigation\n updateFetcherState(key, getDoneFetcher(undefined));\n return;\n } else {\n fetchRedirectIds.add(key);\n await startRedirectNavigation(fetchRequest, result, false, {\n preventScrollReset\n });\n return;\n }\n }\n // Process any non-redirect errors thrown\n if (isErrorResult(result)) {\n setFetcherError(key, routeId, result.error);\n return;\n }\n invariant(!isDeferredResult(result), \"Unhandled fetcher deferred data\");\n // Put the fetcher back into an idle state\n updateFetcherState(key, getDoneFetcher(result.data));\n }\n /**\n * Utility function to handle redirects returned from an action or loader.\n * Normally, a redirect \"replaces\" the navigation that triggered it. So, for\n * example:\n *\n * - user is on /a\n * - user clicks a link to /b\n * - loader for /b redirects to /c\n *\n * In a non-JS app the browser would track the in-flight navigation to /b and\n * then replace it with /c when it encountered the redirect response. In\n * the end it would only ever update the URL bar with /c.\n *\n * In client-side routing using pushState/replaceState, we aim to emulate\n * this behavior and we also do not update history until the end of the\n * navigation (including processed redirects). This means that we never\n * actually touch history until we've processed redirects, so we just use\n * the history action from the original navigation (PUSH or REPLACE).\n */\n async function startRedirectNavigation(request, redirect, isNavigation, _temp2) {\n let {\n submission,\n fetcherSubmission,\n preventScrollReset,\n replace\n } = _temp2 === void 0 ? {} : _temp2;\n if (redirect.response.headers.has(\"X-Remix-Revalidate\")) {\n isRevalidationRequired = true;\n }\n let location = redirect.response.headers.get(\"Location\");\n invariant(location, \"Expected a Location header on the redirect Response\");\n location = normalizeRedirectLocation(location, new URL(request.url), basename, init.history);\n let redirectLocation = createLocation(state.location, location, {\n _isRedirect: true\n });\n if (isBrowser) {\n let isDocumentReload = false;\n if (redirect.response.headers.has(\"X-Remix-Reload-Document\")) {\n // Hard reload if the response contained X-Remix-Reload-Document\n isDocumentReload = true;\n } else if (ABSOLUTE_URL_REGEX.test(location)) {\n const url = init.history.createURL(location);\n isDocumentReload =\n // Hard reload if it's an absolute URL to a new origin\n url.origin !== routerWindow.location.origin ||\n // Hard reload if it's an absolute URL that does not match our basename\n stripBasename(url.pathname, basename) == null;\n }\n if (isDocumentReload) {\n if (replace) {\n routerWindow.location.replace(location);\n } else {\n routerWindow.location.assign(location);\n }\n return;\n }\n }\n // There's no need to abort on redirects, since we don't detect the\n // redirect until the action/loaders have settled\n pendingNavigationController = null;\n let redirectHistoryAction = replace === true || redirect.response.headers.has(\"X-Remix-Replace\") ? Action.Replace : Action.Push;\n // Use the incoming submission if provided, fallback on the active one in\n // state.navigation\n let {\n formMethod,\n formAction,\n formEncType\n } = state.navigation;\n if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) {\n submission = getSubmissionFromNavigation(state.navigation);\n }\n // If this was a 307/308 submission we want to preserve the HTTP method and\n // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the\n // redirected location\n let activeSubmission = submission || fetcherSubmission;\n if (redirectPreserveMethodStatusCodes.has(redirect.response.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) {\n await startNavigation(redirectHistoryAction, redirectLocation, {\n submission: _extends({}, activeSubmission, {\n formAction: location\n }),\n // Preserve these flags across redirects\n preventScrollReset: preventScrollReset || pendingPreventScrollReset,\n enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined\n });\n } else {\n // If we have a navigation submission, we will preserve it through the\n // redirect navigation\n let overrideNavigation = getLoadingNavigation(redirectLocation, submission);\n await startNavigation(redirectHistoryAction, redirectLocation, {\n overrideNavigation,\n // Send fetcher submissions through for shouldRevalidate\n fetcherSubmission,\n // Preserve these flags across redirects\n preventScrollReset: preventScrollReset || pendingPreventScrollReset,\n enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined\n });\n }\n }\n // Utility wrapper for calling dataStrategy client-side without having to\n // pass around the manifest, mapRouteProperties, etc.\n async function callDataStrategy(type, state, request, matchesToLoad, matches, fetcherKey) {\n let results;\n let dataResults = {};\n try {\n results = await callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties);\n } catch (e) {\n // If the outer dataStrategy method throws, just return the error for all\n // matches - and it'll naturally bubble to the root\n matchesToLoad.forEach(m => {\n dataResults[m.route.id] = {\n type: ResultType.error,\n error: e\n };\n });\n return dataResults;\n }\n for (let [routeId, result] of Object.entries(results)) {\n if (isRedirectDataStrategyResultResult(result)) {\n let response = result.result;\n dataResults[routeId] = {\n type: ResultType.redirect,\n response: normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename, future.v7_relativeSplatPath)\n };\n } else {\n dataResults[routeId] = await convertDataStrategyResultToDataResult(result);\n }\n }\n return dataResults;\n }\n async function callLoadersAndMaybeResolveData(state, matches, matchesToLoad, fetchersToLoad, request) {\n let currentMatches = state.matches;\n // Kick off loaders and fetchers in parallel\n let loaderResultsPromise = callDataStrategy(\"loader\", state, request, matchesToLoad, matches, null);\n let fetcherResultsPromise = Promise.all(fetchersToLoad.map(async f => {\n if (f.matches && f.match && f.controller) {\n let results = await callDataStrategy(\"loader\", state, createClientSideRequest(init.history, f.path, f.controller.signal), [f.match], f.matches, f.key);\n let result = results[f.match.route.id];\n // Fetcher results are keyed by fetcher key from here on out, not routeId\n return {\n [f.key]: result\n };\n } else {\n return Promise.resolve({\n [f.key]: {\n type: ResultType.error,\n error: getInternalRouterError(404, {\n pathname: f.path\n })\n }\n });\n }\n }));\n let loaderResults = await loaderResultsPromise;\n let fetcherResults = (await fetcherResultsPromise).reduce((acc, r) => Object.assign(acc, r), {});\n await Promise.all([resolveNavigationDeferredResults(matches, loaderResults, request.signal, currentMatches, state.loaderData), resolveFetcherDeferredResults(matches, fetcherResults, fetchersToLoad)]);\n return {\n loaderResults,\n fetcherResults\n };\n }\n function interruptActiveLoads() {\n // Every interruption triggers a revalidation\n isRevalidationRequired = true;\n // Cancel pending route-level deferreds and mark cancelled routes for\n // revalidation\n cancelledDeferredRoutes.push(...cancelActiveDeferreds());\n // Abort in-flight fetcher loads\n fetchLoadMatches.forEach((_, key) => {\n if (fetchControllers.has(key)) {\n cancelledFetcherLoads.add(key);\n }\n abortFetcher(key);\n });\n }\n function updateFetcherState(key, fetcher, opts) {\n if (opts === void 0) {\n opts = {};\n }\n state.fetchers.set(key, fetcher);\n updateState({\n fetchers: new Map(state.fetchers)\n }, {\n flushSync: (opts && opts.flushSync) === true\n });\n }\n function setFetcherError(key, routeId, error, opts) {\n if (opts === void 0) {\n opts = {};\n }\n let boundaryMatch = findNearestBoundary(state.matches, routeId);\n deleteFetcher(key);\n updateState({\n errors: {\n [boundaryMatch.route.id]: error\n },\n fetchers: new Map(state.fetchers)\n }, {\n flushSync: (opts && opts.flushSync) === true\n });\n }\n function getFetcher(key) {\n activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1);\n // If this fetcher was previously marked for deletion, unmark it since we\n // have a new instance\n if (deletedFetchers.has(key)) {\n deletedFetchers.delete(key);\n }\n return state.fetchers.get(key) || IDLE_FETCHER;\n }\n function deleteFetcher(key) {\n let fetcher = state.fetchers.get(key);\n // Don't abort the controller if this is a deletion of a fetcher.submit()\n // in it's loading phase since - we don't want to abort the corresponding\n // revalidation and want them to complete and land\n if (fetchControllers.has(key) && !(fetcher && fetcher.state === \"loading\" && fetchReloadIds.has(key))) {\n abortFetcher(key);\n }\n fetchLoadMatches.delete(key);\n fetchReloadIds.delete(key);\n fetchRedirectIds.delete(key);\n // If we opted into the flag we can clear this now since we're calling\n // deleteFetcher() at the end of updateState() and we've already handed the\n // deleted fetcher keys off to the data layer.\n // If not, we're eagerly calling deleteFetcher() and we need to keep this\n // Set populated until the next updateState call, and we'll clear\n // `deletedFetchers` then\n if (future.v7_fetcherPersist) {\n deletedFetchers.delete(key);\n }\n cancelledFetcherLoads.delete(key);\n state.fetchers.delete(key);\n }\n function deleteFetcherAndUpdateState(key) {\n let count = (activeFetchers.get(key) || 0) - 1;\n if (count <= 0) {\n activeFetchers.delete(key);\n deletedFetchers.add(key);\n if (!future.v7_fetcherPersist) {\n deleteFetcher(key);\n }\n } else {\n activeFetchers.set(key, count);\n }\n updateState({\n fetchers: new Map(state.fetchers)\n });\n }\n function abortFetcher(key) {\n let controller = fetchControllers.get(key);\n if (controller) {\n controller.abort();\n fetchControllers.delete(key);\n }\n }\n function markFetchersDone(keys) {\n for (let key of keys) {\n let fetcher = getFetcher(key);\n let doneFetcher = getDoneFetcher(fetcher.data);\n state.fetchers.set(key, doneFetcher);\n }\n }\n function markFetchRedirectsDone() {\n let doneKeys = [];\n let updatedFetchers = false;\n for (let key of fetchRedirectIds) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, \"Expected fetcher: \" + key);\n if (fetcher.state === \"loading\") {\n fetchRedirectIds.delete(key);\n doneKeys.push(key);\n updatedFetchers = true;\n }\n }\n markFetchersDone(doneKeys);\n return updatedFetchers;\n }\n function abortStaleFetchLoads(landedId) {\n let yeetedKeys = [];\n for (let [key, id] of fetchReloadIds) {\n if (id < landedId) {\n let fetcher = state.fetchers.get(key);\n invariant(fetcher, \"Expected fetcher: \" + key);\n if (fetcher.state === \"loading\") {\n abortFetcher(key);\n fetchReloadIds.delete(key);\n yeetedKeys.push(key);\n }\n }\n }\n markFetchersDone(yeetedKeys);\n return yeetedKeys.length > 0;\n }\n function getBlocker(key, fn) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n if (blockerFunctions.get(key) !== fn) {\n blockerFunctions.set(key, fn);\n }\n return blocker;\n }\n function deleteBlocker(key) {\n state.blockers.delete(key);\n blockerFunctions.delete(key);\n }\n // Utility function to update blockers, ensuring valid state transitions\n function updateBlocker(key, newBlocker) {\n let blocker = state.blockers.get(key) || IDLE_BLOCKER;\n // Poor mans state machine :)\n // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM\n invariant(blocker.state === \"unblocked\" && newBlocker.state === \"blocked\" || blocker.state === \"blocked\" && newBlocker.state === \"blocked\" || blocker.state === \"blocked\" && newBlocker.state === \"proceeding\" || blocker.state === \"blocked\" && newBlocker.state === \"unblocked\" || blocker.state === \"proceeding\" && newBlocker.state === \"unblocked\", \"Invalid blocker state transition: \" + blocker.state + \" -> \" + newBlocker.state);\n let blockers = new Map(state.blockers);\n blockers.set(key, newBlocker);\n updateState({\n blockers\n });\n }\n function shouldBlockNavigation(_ref2) {\n let {\n currentLocation,\n nextLocation,\n historyAction\n } = _ref2;\n if (blockerFunctions.size === 0) {\n return;\n }\n // We ony support a single active blocker at the moment since we don't have\n // any compelling use cases for multi-blocker yet\n if (blockerFunctions.size > 1) {\n warning(false, \"A router only supports one blocker at a time\");\n }\n let entries = Array.from(blockerFunctions.entries());\n let [blockerKey, blockerFunction] = entries[entries.length - 1];\n let blocker = state.blockers.get(blockerKey);\n if (blocker && blocker.state === \"proceeding\") {\n // If the blocker is currently proceeding, we don't need to re-check\n // it and can let this navigation continue\n return;\n }\n // At this point, we know we're unblocked/blocked so we need to check the\n // user-provided blocker function\n if (blockerFunction({\n currentLocation,\n nextLocation,\n historyAction\n })) {\n return blockerKey;\n }\n }\n function handleNavigational404(pathname) {\n let error = getInternalRouterError(404, {\n pathname\n });\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let {\n matches,\n route\n } = getShortCircuitMatches(routesToUse);\n // Cancel all pending deferred on 404s since we don't keep any routes\n cancelActiveDeferreds();\n return {\n notFoundMatches: matches,\n route,\n error\n };\n }\n function cancelActiveDeferreds(predicate) {\n let cancelledRouteIds = [];\n activeDeferreds.forEach((dfd, routeId) => {\n if (!predicate || predicate(routeId)) {\n // Cancel the deferred - but do not remove from activeDeferreds here -\n // we rely on the subscribers to do that so our tests can assert proper\n // cleanup via _internalActiveDeferreds\n dfd.cancel();\n cancelledRouteIds.push(routeId);\n activeDeferreds.delete(routeId);\n }\n });\n return cancelledRouteIds;\n }\n // Opt in to capturing and reporting scroll positions during navigations,\n // used by the component\n function enableScrollRestoration(positions, getPosition, getKey) {\n savedScrollPositions = positions;\n getScrollPosition = getPosition;\n getScrollRestorationKey = getKey || null;\n // Perform initial hydration scroll restoration, since we miss the boat on\n // the initial updateState() because we've not yet rendered \n // and therefore have no savedScrollPositions available\n if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {\n initialScrollRestored = true;\n let y = getSavedScrollPosition(state.location, state.matches);\n if (y != null) {\n updateState({\n restoreScrollPosition: y\n });\n }\n }\n return () => {\n savedScrollPositions = null;\n getScrollPosition = null;\n getScrollRestorationKey = null;\n };\n }\n function getScrollKey(location, matches) {\n if (getScrollRestorationKey) {\n let key = getScrollRestorationKey(location, matches.map(m => convertRouteMatchToUiMatch(m, state.loaderData)));\n return key || location.key;\n }\n return location.key;\n }\n function saveScrollPosition(location, matches) {\n if (savedScrollPositions && getScrollPosition) {\n let key = getScrollKey(location, matches);\n savedScrollPositions[key] = getScrollPosition();\n }\n }\n function getSavedScrollPosition(location, matches) {\n if (savedScrollPositions) {\n let key = getScrollKey(location, matches);\n let y = savedScrollPositions[key];\n if (typeof y === \"number\") {\n return y;\n }\n }\n return null;\n }\n function checkFogOfWar(matches, routesToUse, pathname) {\n if (patchRoutesOnNavigationImpl) {\n if (!matches) {\n let fogMatches = matchRoutesImpl(routesToUse, pathname, basename, true);\n return {\n active: true,\n matches: fogMatches || []\n };\n } else {\n if (Object.keys(matches[0].params).length > 0) {\n // If we matched a dynamic param or a splat, it might only be because\n // we haven't yet discovered other routes that would match with a\n // higher score. Call patchRoutesOnNavigation just to be sure\n let partialMatches = matchRoutesImpl(routesToUse, pathname, basename, true);\n return {\n active: true,\n matches: partialMatches\n };\n }\n }\n }\n return {\n active: false,\n matches: null\n };\n }\n async function discoverRoutes(matches, pathname, signal, fetcherKey) {\n if (!patchRoutesOnNavigationImpl) {\n return {\n type: \"success\",\n matches\n };\n }\n let partialMatches = matches;\n while (true) {\n let isNonHMR = inFlightDataRoutes == null;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n let localManifest = manifest;\n try {\n await patchRoutesOnNavigationImpl({\n signal,\n path: pathname,\n matches: partialMatches,\n fetcherKey,\n patch: (routeId, children) => {\n if (signal.aborted) return;\n patchRoutesImpl(routeId, children, routesToUse, localManifest, mapRouteProperties);\n }\n });\n } catch (e) {\n return {\n type: \"error\",\n error: e,\n partialMatches\n };\n } finally {\n // If we are not in the middle of an HMR revalidation and we changed the\n // routes, provide a new identity so when we `updateState` at the end of\n // this navigation/fetch `router.routes` will be a new identity and\n // trigger a re-run of memoized `router.routes` dependencies.\n // HMR will already update the identity and reflow when it lands\n // `inFlightDataRoutes` in `completeNavigation`\n if (isNonHMR && !signal.aborted) {\n dataRoutes = [...dataRoutes];\n }\n }\n if (signal.aborted) {\n return {\n type: \"aborted\"\n };\n }\n let newMatches = matchRoutes(routesToUse, pathname, basename);\n if (newMatches) {\n return {\n type: \"success\",\n matches: newMatches\n };\n }\n let newPartialMatches = matchRoutesImpl(routesToUse, pathname, basename, true);\n // Avoid loops if the second pass results in the same partial matches\n if (!newPartialMatches || partialMatches.length === newPartialMatches.length && partialMatches.every((m, i) => m.route.id === newPartialMatches[i].route.id)) {\n return {\n type: \"success\",\n matches: null\n };\n }\n partialMatches = newPartialMatches;\n }\n }\n function _internalSetRoutes(newRoutes) {\n manifest = {};\n inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties, undefined, manifest);\n }\n function patchRoutes(routeId, children) {\n let isNonHMR = inFlightDataRoutes == null;\n let routesToUse = inFlightDataRoutes || dataRoutes;\n patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties);\n // If we are not in the middle of an HMR revalidation and we changed the\n // routes, provide a new identity and trigger a reflow via `updateState`\n // to re-run memoized `router.routes` dependencies.\n // HMR will already update the identity and reflow when it lands\n // `inFlightDataRoutes` in `completeNavigation`\n if (isNonHMR) {\n dataRoutes = [...dataRoutes];\n updateState({});\n }\n }\n router = {\n get basename() {\n return basename;\n },\n get future() {\n return future;\n },\n get state() {\n return state;\n },\n get routes() {\n return dataRoutes;\n },\n get window() {\n return routerWindow;\n },\n initialize,\n subscribe,\n enableScrollRestoration,\n navigate,\n fetch,\n revalidate,\n // Passthrough to history-aware createHref used by useHref so we get proper\n // hash-aware URLs in DOM paths\n createHref: to => init.history.createHref(to),\n encodeLocation: to => init.history.encodeLocation(to),\n getFetcher,\n deleteFetcher: deleteFetcherAndUpdateState,\n dispose,\n getBlocker,\n deleteBlocker,\n patchRoutes,\n _internalFetchControllers: fetchControllers,\n _internalActiveDeferreds: activeDeferreds,\n // TODO: Remove setRoutes, it's temporary to avoid dealing with\n // updating the tree while validating the update algorithm.\n _internalSetRoutes\n };\n return router;\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region createStaticHandler\n////////////////////////////////////////////////////////////////////////////////\nconst UNSAFE_DEFERRED_SYMBOL = Symbol(\"deferred\");\nfunction createStaticHandler(routes, opts) {\n invariant(routes.length > 0, \"You must provide a non-empty routes array to createStaticHandler\");\n let manifest = {};\n let basename = (opts ? opts.basename : null) || \"/\";\n let mapRouteProperties;\n if (opts != null && opts.mapRouteProperties) {\n mapRouteProperties = opts.mapRouteProperties;\n } else if (opts != null && opts.detectErrorBoundary) {\n // If they are still using the deprecated version, wrap it with the new API\n let detectErrorBoundary = opts.detectErrorBoundary;\n mapRouteProperties = route => ({\n hasErrorBoundary: detectErrorBoundary(route)\n });\n } else {\n mapRouteProperties = defaultMapRouteProperties;\n }\n // Config driven behavior flags\n let future = _extends({\n v7_relativeSplatPath: false,\n v7_throwAbortReason: false\n }, opts ? opts.future : null);\n let dataRoutes = convertRoutesToDataRoutes(routes, mapRouteProperties, undefined, manifest);\n /**\n * The query() method is intended for document requests, in which we want to\n * call an optional action and potentially multiple loaders for all nested\n * routes. It returns a StaticHandlerContext object, which is very similar\n * to the router state (location, loaderData, actionData, errors, etc.) and\n * also adds SSR-specific information such as the statusCode and headers\n * from action/loaders Responses.\n *\n * It _should_ never throw and should report all errors through the\n * returned context.errors object, properly associating errors to their error\n * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be\n * used to emulate React error boundaries during SSr by performing a second\n * pass only down to the boundaryId.\n *\n * The one exception where we do not return a StaticHandlerContext is when a\n * redirect response is returned or thrown from any action/loader. We\n * propagate that out and return the raw Response so the HTTP server can\n * return it directly.\n *\n * - `opts.requestContext` is an optional server context that will be passed\n * to actions/loaders in the `context` parameter\n * - `opts.skipLoaderErrorBubbling` is an optional parameter that will prevent\n * the bubbling of errors which allows single-fetch-type implementations\n * where the client will handle the bubbling and we may need to return data\n * for the handling route\n */\n async function query(request, _temp3) {\n let {\n requestContext,\n skipLoaderErrorBubbling,\n dataStrategy\n } = _temp3 === void 0 ? {} : _temp3;\n let url = new URL(request.url);\n let method = request.method;\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"HEAD\") {\n let error = getInternalRouterError(405, {\n method\n });\n let {\n matches: methodNotAllowedMatches,\n route\n } = getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: methodNotAllowedMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null\n };\n } else if (!matches) {\n let error = getInternalRouterError(404, {\n pathname: location.pathname\n });\n let {\n matches: notFoundMatches,\n route\n } = getShortCircuitMatches(dataRoutes);\n return {\n basename,\n location,\n matches: notFoundMatches,\n loaderData: {},\n actionData: null,\n errors: {\n [route.id]: error\n },\n statusCode: error.status,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null\n };\n }\n let result = await queryImpl(request, location, matches, requestContext, dataStrategy || null, skipLoaderErrorBubbling === true, null);\n if (isResponse(result)) {\n return result;\n }\n // When returning StaticHandlerContext, we patch back in the location here\n // since we need it for React Context. But this helps keep our submit and\n // loadRouteData operating on a Request instead of a Location\n return _extends({\n location,\n basename\n }, result);\n }\n /**\n * The queryRoute() method is intended for targeted route requests, either\n * for fetch ?_data requests or resource route requests. In this case, we\n * are only ever calling a single action or loader, and we are returning the\n * returned value directly. In most cases, this will be a Response returned\n * from the action/loader, but it may be a primitive or other value as well -\n * and in such cases the calling context should handle that accordingly.\n *\n * We do respect the throw/return differentiation, so if an action/loader\n * throws, then this method will throw the value. This is important so we\n * can do proper boundary identification in Remix where a thrown Response\n * must go to the Catch Boundary but a returned Response is happy-path.\n *\n * One thing to note is that any Router-initiated Errors that make sense\n * to associate with a status code will be thrown as an ErrorResponse\n * instance which include the raw Error, such that the calling context can\n * serialize the error as they see fit while including the proper response\n * code. Examples here are 404 and 405 errors that occur prior to reaching\n * any user-defined loaders.\n *\n * - `opts.routeId` allows you to specify the specific route handler to call.\n * If not provided the handler will determine the proper route by matching\n * against `request.url`\n * - `opts.requestContext` is an optional server context that will be passed\n * to actions/loaders in the `context` parameter\n */\n async function queryRoute(request, _temp4) {\n let {\n routeId,\n requestContext,\n dataStrategy\n } = _temp4 === void 0 ? {} : _temp4;\n let url = new URL(request.url);\n let method = request.method;\n let location = createLocation(\"\", createPath(url), null, \"default\");\n let matches = matchRoutes(dataRoutes, location, basename);\n // SSR supports HEAD requests while SPA doesn't\n if (!isValidMethod(method) && method !== \"HEAD\" && method !== \"OPTIONS\") {\n throw getInternalRouterError(405, {\n method\n });\n } else if (!matches) {\n throw getInternalRouterError(404, {\n pathname: location.pathname\n });\n }\n let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location);\n if (routeId && !match) {\n throw getInternalRouterError(403, {\n pathname: location.pathname,\n routeId\n });\n } else if (!match) {\n // This should never hit I don't think?\n throw getInternalRouterError(404, {\n pathname: location.pathname\n });\n }\n let result = await queryImpl(request, location, matches, requestContext, dataStrategy || null, false, match);\n if (isResponse(result)) {\n return result;\n }\n let error = result.errors ? Object.values(result.errors)[0] : undefined;\n if (error !== undefined) {\n // If we got back result.errors, that means the loader/action threw\n // _something_ that wasn't a Response, but it's not guaranteed/required\n // to be an `instanceof Error` either, so we have to use throw here to\n // preserve the \"error\" state outside of queryImpl.\n throw error;\n }\n // Pick off the right state value to return\n if (result.actionData) {\n return Object.values(result.actionData)[0];\n }\n if (result.loaderData) {\n var _result$activeDeferre;\n let data = Object.values(result.loaderData)[0];\n if ((_result$activeDeferre = result.activeDeferreds) != null && _result$activeDeferre[match.route.id]) {\n data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];\n }\n return data;\n }\n return undefined;\n }\n async function queryImpl(request, location, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch) {\n invariant(request.signal, \"query()/queryRoute() requests must contain an AbortController signal\");\n try {\n if (isMutationMethod(request.method.toLowerCase())) {\n let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch != null);\n return result;\n }\n let result = await loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch);\n return isResponse(result) ? result : _extends({}, result, {\n actionData: null,\n actionHeaders: {}\n });\n } catch (e) {\n // If the user threw/returned a Response in callLoaderOrAction for a\n // `queryRoute` call, we throw the `DataStrategyResult` to bail out early\n // and then return or throw the raw Response here accordingly\n if (isDataStrategyResult(e) && isResponse(e.result)) {\n if (e.type === ResultType.error) {\n throw e.result;\n }\n return e.result;\n }\n // Redirects are always returned since they don't propagate to catch\n // boundaries\n if (isRedirectResponse(e)) {\n return e;\n }\n throw e;\n }\n }\n async function submit(request, matches, actionMatch, requestContext, dataStrategy, skipLoaderErrorBubbling, isRouteRequest) {\n let result;\n if (!actionMatch.route.action && !actionMatch.route.lazy) {\n let error = getInternalRouterError(405, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: actionMatch.route.id\n });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error\n };\n } else {\n let results = await callDataStrategy(\"action\", request, [actionMatch], matches, isRouteRequest, requestContext, dataStrategy);\n result = results[actionMatch.route.id];\n if (request.signal.aborted) {\n throwStaticHandlerAbortedError(request, isRouteRequest, future);\n }\n }\n if (isRedirectResult(result)) {\n // Uhhhh - this should never happen, we should always throw these from\n // callLoaderOrAction, but the type narrowing here keeps TS happy and we\n // can get back on the \"throw all redirect responses\" train here should\n // this ever happen :/\n throw new Response(null, {\n status: result.response.status,\n headers: {\n Location: result.response.headers.get(\"Location\")\n }\n });\n }\n if (isDeferredResult(result)) {\n let error = getInternalRouterError(400, {\n type: \"defer-action\"\n });\n if (isRouteRequest) {\n throw error;\n }\n result = {\n type: ResultType.error,\n error\n };\n }\n if (isRouteRequest) {\n // Note: This should only be non-Response values if we get here, since\n // isRouteRequest should throw any Response received in callLoaderOrAction\n if (isErrorResult(result)) {\n throw result.error;\n }\n return {\n matches: [actionMatch],\n loaderData: {},\n actionData: {\n [actionMatch.route.id]: result.data\n },\n errors: null,\n // Note: statusCode + headers are unused here since queryRoute will\n // return the raw Response or value\n statusCode: 200,\n loaderHeaders: {},\n actionHeaders: {},\n activeDeferreds: null\n };\n }\n // Create a GET request for the loaders\n let loaderRequest = new Request(request.url, {\n headers: request.headers,\n redirect: request.redirect,\n signal: request.signal\n });\n if (isErrorResult(result)) {\n // Store off the pending error - we use it to determine which loaders\n // to call and will commit it when we complete the navigation\n let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id);\n let context = await loadRouteData(loaderRequest, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, null, [boundaryMatch.route.id, result]);\n // action status codes take precedence over loader status codes\n return _extends({}, context, {\n statusCode: isRouteErrorResponse(result.error) ? result.error.status : result.statusCode != null ? result.statusCode : 500,\n actionData: null,\n actionHeaders: _extends({}, result.headers ? {\n [actionMatch.route.id]: result.headers\n } : {})\n });\n }\n let context = await loadRouteData(loaderRequest, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, null);\n return _extends({}, context, {\n actionData: {\n [actionMatch.route.id]: result.data\n }\n }, result.statusCode ? {\n statusCode: result.statusCode\n } : {}, {\n actionHeaders: result.headers ? {\n [actionMatch.route.id]: result.headers\n } : {}\n });\n }\n async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, pendingActionResult) {\n let isRouteRequest = routeMatch != null;\n // Short circuit if we have no loaders to run (queryRoute())\n if (isRouteRequest && !(routeMatch != null && routeMatch.route.loader) && !(routeMatch != null && routeMatch.route.lazy)) {\n throw getInternalRouterError(400, {\n method: request.method,\n pathname: new URL(request.url).pathname,\n routeId: routeMatch == null ? void 0 : routeMatch.route.id\n });\n }\n let requestMatches = routeMatch ? [routeMatch] : pendingActionResult && isErrorResult(pendingActionResult[1]) ? getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]) : matches;\n let matchesToLoad = requestMatches.filter(m => m.route.loader || m.route.lazy);\n // Short circuit if we have no loaders to run (query())\n if (matchesToLoad.length === 0) {\n return {\n matches,\n // Add a null for all matched routes for proper revalidation on the client\n loaderData: matches.reduce((acc, m) => Object.assign(acc, {\n [m.route.id]: null\n }), {}),\n errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? {\n [pendingActionResult[0]]: pendingActionResult[1].error\n } : null,\n statusCode: 200,\n loaderHeaders: {},\n activeDeferreds: null\n };\n }\n let results = await callDataStrategy(\"loader\", request, matchesToLoad, matches, isRouteRequest, requestContext, dataStrategy);\n if (request.signal.aborted) {\n throwStaticHandlerAbortedError(request, isRouteRequest, future);\n }\n // Process and commit output from loaders\n let activeDeferreds = new Map();\n let context = processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling);\n // Add a null for any non-loader matches for proper revalidation on the client\n let executedLoaders = new Set(matchesToLoad.map(match => match.route.id));\n matches.forEach(match => {\n if (!executedLoaders.has(match.route.id)) {\n context.loaderData[match.route.id] = null;\n }\n });\n return _extends({}, context, {\n matches,\n activeDeferreds: activeDeferreds.size > 0 ? Object.fromEntries(activeDeferreds.entries()) : null\n });\n }\n // Utility wrapper for calling dataStrategy server-side without having to\n // pass around the manifest, mapRouteProperties, etc.\n async function callDataStrategy(type, request, matchesToLoad, matches, isRouteRequest, requestContext, dataStrategy) {\n let results = await callDataStrategyImpl(dataStrategy || defaultDataStrategy, type, null, request, matchesToLoad, matches, null, manifest, mapRouteProperties, requestContext);\n let dataResults = {};\n await Promise.all(matches.map(async match => {\n if (!(match.route.id in results)) {\n return;\n }\n let result = results[match.route.id];\n if (isRedirectDataStrategyResultResult(result)) {\n let response = result.result;\n // Throw redirects and let the server handle them with an HTTP redirect\n throw normalizeRelativeRoutingRedirectResponse(response, request, match.route.id, matches, basename, future.v7_relativeSplatPath);\n }\n if (isResponse(result.result) && isRouteRequest) {\n // For SSR single-route requests, we want to hand Responses back\n // directly without unwrapping\n throw result;\n }\n dataResults[match.route.id] = await convertDataStrategyResultToDataResult(result);\n }));\n return dataResults;\n }\n return {\n dataRoutes,\n query,\n queryRoute\n };\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Helpers\n////////////////////////////////////////////////////////////////////////////////\n/**\n * Given an existing StaticHandlerContext and an error thrown at render time,\n * provide an updated StaticHandlerContext suitable for a second SSR render\n */\nfunction getStaticContextFromError(routes, context, error) {\n let newContext = _extends({}, context, {\n statusCode: isRouteErrorResponse(error) ? error.status : 500,\n errors: {\n [context._deepestRenderedBoundaryId || routes[0].id]: error\n }\n });\n return newContext;\n}\nfunction throwStaticHandlerAbortedError(request, isRouteRequest, future) {\n if (future.v7_throwAbortReason && request.signal.reason !== undefined) {\n throw request.signal.reason;\n }\n let method = isRouteRequest ? \"queryRoute\" : \"query\";\n throw new Error(method + \"() call aborted: \" + request.method + \" \" + request.url);\n}\nfunction isSubmissionNavigation(opts) {\n return opts != null && (\"formData\" in opts && opts.formData != null || \"body\" in opts && opts.body !== undefined);\n}\nfunction normalizeTo(location, matches, basename, prependBasename, to, v7_relativeSplatPath, fromRouteId, relative) {\n let contextualMatches;\n let activeRouteMatch;\n if (fromRouteId) {\n // Grab matches up to the calling route so our route-relative logic is\n // relative to the correct source route\n contextualMatches = [];\n for (let match of matches) {\n contextualMatches.push(match);\n if (match.route.id === fromRouteId) {\n activeRouteMatch = match;\n break;\n }\n }\n } else {\n contextualMatches = matches;\n activeRouteMatch = matches[matches.length - 1];\n }\n // Resolve the relative path\n let path = resolveTo(to ? to : \".\", getResolveToMatches(contextualMatches, v7_relativeSplatPath), stripBasename(location.pathname, basename) || location.pathname, relative === \"path\");\n // When `to` is not specified we inherit search/hash from the current\n // location, unlike when to=\".\" and we just inherit the path.\n // See https://github.com/remix-run/remix/issues/927\n if (to == null) {\n path.search = location.search;\n path.hash = location.hash;\n }\n // Account for `?index` params when routing to the current location\n if ((to == null || to === \"\" || to === \".\") && activeRouteMatch) {\n let nakedIndex = hasNakedIndexQuery(path.search);\n if (activeRouteMatch.route.index && !nakedIndex) {\n // Add one when we're targeting an index route\n path.search = path.search ? path.search.replace(/^\\?/, \"?index&\") : \"?index\";\n } else if (!activeRouteMatch.route.index && nakedIndex) {\n // Remove existing ones when we're not\n let params = new URLSearchParams(path.search);\n let indexValues = params.getAll(\"index\");\n params.delete(\"index\");\n indexValues.filter(v => v).forEach(v => params.append(\"index\", v));\n let qs = params.toString();\n path.search = qs ? \"?\" + qs : \"\";\n }\n }\n // If we're operating within a basename, prepend it to the pathname. If\n // this is a root navigation, then just use the raw basename which allows\n // the basename to have full control over the presence of a trailing slash\n // on root actions\n if (prependBasename && basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n return createPath(path);\n}\n// Normalize navigation options by converting formMethod=GET formData objects to\n// URLSearchParams so they behave identically to links with query params\nfunction normalizeNavigateOptions(normalizeFormMethod, isFetcher, path, opts) {\n // Return location verbatim on non-submission navigations\n if (!opts || !isSubmissionNavigation(opts)) {\n return {\n path\n };\n }\n if (opts.formMethod && !isValidMethod(opts.formMethod)) {\n return {\n path,\n error: getInternalRouterError(405, {\n method: opts.formMethod\n })\n };\n }\n let getInvalidBodyError = () => ({\n path,\n error: getInternalRouterError(400, {\n type: \"invalid-body\"\n })\n });\n // Create a Submission on non-GET navigations\n let rawFormMethod = opts.formMethod || \"get\";\n let formMethod = normalizeFormMethod ? rawFormMethod.toUpperCase() : rawFormMethod.toLowerCase();\n let formAction = stripHashFromPath(path);\n if (opts.body !== undefined) {\n if (opts.formEncType === \"text/plain\") {\n // text only support POST/PUT/PATCH/DELETE submissions\n if (!isMutationMethod(formMethod)) {\n return getInvalidBodyError();\n }\n let text = typeof opts.body === \"string\" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ?\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data\n Array.from(opts.body.entries()).reduce((acc, _ref3) => {\n let [name, value] = _ref3;\n return \"\" + acc + name + \"=\" + value + \"\\n\";\n }, \"\") : String(opts.body);\n return {\n path,\n submission: {\n formMethod,\n formAction,\n formEncType: opts.formEncType,\n formData: undefined,\n json: undefined,\n text\n }\n };\n } else if (opts.formEncType === \"application/json\") {\n // json only supports POST/PUT/PATCH/DELETE submissions\n if (!isMutationMethod(formMethod)) {\n return getInvalidBodyError();\n }\n try {\n let json = typeof opts.body === \"string\" ? JSON.parse(opts.body) : opts.body;\n return {\n path,\n submission: {\n formMethod,\n formAction,\n formEncType: opts.formEncType,\n formData: undefined,\n json,\n text: undefined\n }\n };\n } catch (e) {\n return getInvalidBodyError();\n }\n }\n }\n invariant(typeof FormData === \"function\", \"FormData is not available in this environment\");\n let searchParams;\n let formData;\n if (opts.formData) {\n searchParams = convertFormDataToSearchParams(opts.formData);\n formData = opts.formData;\n } else if (opts.body instanceof FormData) {\n searchParams = convertFormDataToSearchParams(opts.body);\n formData = opts.body;\n } else if (opts.body instanceof URLSearchParams) {\n searchParams = opts.body;\n formData = convertSearchParamsToFormData(searchParams);\n } else if (opts.body == null) {\n searchParams = new URLSearchParams();\n formData = new FormData();\n } else {\n try {\n searchParams = new URLSearchParams(opts.body);\n formData = convertSearchParamsToFormData(searchParams);\n } catch (e) {\n return getInvalidBodyError();\n }\n }\n let submission = {\n formMethod,\n formAction,\n formEncType: opts && opts.formEncType || \"application/x-www-form-urlencoded\",\n formData,\n json: undefined,\n text: undefined\n };\n if (isMutationMethod(submission.formMethod)) {\n return {\n path,\n submission\n };\n }\n // Flatten submission onto URLSearchParams for GET submissions\n let parsedPath = parsePath(path);\n // On GET navigation submissions we can drop the ?index param from the\n // resulting location since all loaders will run. But fetcher GET submissions\n // only run a single loader so we need to preserve any incoming ?index params\n if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {\n searchParams.append(\"index\", \"\");\n }\n parsedPath.search = \"?\" + searchParams;\n return {\n path: createPath(parsedPath),\n submission\n };\n}\n// Filter out all routes at/below any caught error as they aren't going to\n// render so we don't need to load them\nfunction getLoaderMatchesUntilBoundary(matches, boundaryId, includeBoundary) {\n if (includeBoundary === void 0) {\n includeBoundary = false;\n }\n let index = matches.findIndex(m => m.route.id === boundaryId);\n if (index >= 0) {\n return matches.slice(0, includeBoundary ? index + 1 : index);\n }\n return matches;\n}\nfunction getMatchesToLoad(history, state, matches, submission, location, initialHydration, skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult) {\n let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : undefined;\n let currentUrl = history.createURL(state.location);\n let nextUrl = history.createURL(location);\n // Pick navigation matches that are net-new or qualify for revalidation\n let boundaryMatches = matches;\n if (initialHydration && state.errors) {\n // On initial hydration, only consider matches up to _and including_ the boundary.\n // This is inclusive to handle cases where a server loader ran successfully,\n // a child server loader bubbled up to this route, but this route has\n // `clientLoader.hydrate` so we want to still run the `clientLoader` so that\n // we have a complete version of `loaderData`\n boundaryMatches = getLoaderMatchesUntilBoundary(matches, Object.keys(state.errors)[0], true);\n } else if (pendingActionResult && isErrorResult(pendingActionResult[1])) {\n // If an action threw an error, we call loaders up to, but not including the\n // boundary\n boundaryMatches = getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]);\n }\n // Don't revalidate loaders by default after action 4xx/5xx responses\n // when the flag is enabled. They can still opt-into revalidation via\n // `shouldRevalidate` via `actionResult`\n let actionStatus = pendingActionResult ? pendingActionResult[1].statusCode : undefined;\n let shouldSkipRevalidation = skipActionErrorRevalidation && actionStatus && actionStatus >= 400;\n let navigationMatches = boundaryMatches.filter((match, index) => {\n let {\n route\n } = match;\n if (route.lazy) {\n // We haven't loaded this route yet so we don't know if it's got a loader!\n return true;\n }\n if (route.loader == null) {\n return false;\n }\n if (initialHydration) {\n return shouldLoadRouteOnHydration(route, state.loaderData, state.errors);\n }\n // Always call the loader on new route instances and pending defer cancellations\n if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some(id => id === match.route.id)) {\n return true;\n }\n // This is the default implementation for when we revalidate. If the route\n // provides it's own implementation, then we give them full control but\n // provide this value so they can leverage it if needed after they check\n // their own specific use cases\n let currentRouteMatch = state.matches[index];\n let nextRouteMatch = match;\n return shouldRevalidateLoader(match, _extends({\n currentUrl,\n currentParams: currentRouteMatch.params,\n nextUrl,\n nextParams: nextRouteMatch.params\n }, submission, {\n actionResult,\n actionStatus,\n defaultShouldRevalidate: shouldSkipRevalidation ? false :\n // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate\n isRevalidationRequired || currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search ||\n // Search params affect all loaders\n currentUrl.search !== nextUrl.search || isNewRouteInstance(currentRouteMatch, nextRouteMatch)\n }));\n });\n // Pick fetcher.loads that need to be revalidated\n let revalidatingFetchers = [];\n fetchLoadMatches.forEach((f, key) => {\n // Don't revalidate:\n // - on initial hydration (shouldn't be any fetchers then anyway)\n // - if fetcher won't be present in the subsequent render\n // - no longer matches the URL (v7_fetcherPersist=false)\n // - was unmounted but persisted due to v7_fetcherPersist=true\n if (initialHydration || !matches.some(m => m.route.id === f.routeId) || deletedFetchers.has(key)) {\n return;\n }\n let fetcherMatches = matchRoutes(routesToUse, f.path, basename);\n // If the fetcher path no longer matches, push it in with null matches so\n // we can trigger a 404 in callLoadersAndMaybeResolveData. Note this is\n // currently only a use-case for Remix HMR where the route tree can change\n // at runtime and remove a route previously loaded via a fetcher\n if (!fetcherMatches) {\n revalidatingFetchers.push({\n key,\n routeId: f.routeId,\n path: f.path,\n matches: null,\n match: null,\n controller: null\n });\n return;\n }\n // Revalidating fetchers are decoupled from the route matches since they\n // load from a static href. They revalidate based on explicit revalidation\n // (submission, useRevalidator, or X-Remix-Revalidate)\n let fetcher = state.fetchers.get(key);\n let fetcherMatch = getTargetMatch(fetcherMatches, f.path);\n let shouldRevalidate = false;\n if (fetchRedirectIds.has(key)) {\n // Never trigger a revalidation of an actively redirecting fetcher\n shouldRevalidate = false;\n } else if (cancelledFetcherLoads.has(key)) {\n // Always mark for revalidation if the fetcher was cancelled\n cancelledFetcherLoads.delete(key);\n shouldRevalidate = true;\n } else if (fetcher && fetcher.state !== \"idle\" && fetcher.data === undefined) {\n // If the fetcher hasn't ever completed loading yet, then this isn't a\n // revalidation, it would just be a brand new load if an explicit\n // revalidation is required\n shouldRevalidate = isRevalidationRequired;\n } else {\n // Otherwise fall back on any user-defined shouldRevalidate, defaulting\n // to explicit revalidations only\n shouldRevalidate = shouldRevalidateLoader(fetcherMatch, _extends({\n currentUrl,\n currentParams: state.matches[state.matches.length - 1].params,\n nextUrl,\n nextParams: matches[matches.length - 1].params\n }, submission, {\n actionResult,\n actionStatus,\n defaultShouldRevalidate: shouldSkipRevalidation ? false : isRevalidationRequired\n }));\n }\n if (shouldRevalidate) {\n revalidatingFetchers.push({\n key,\n routeId: f.routeId,\n path: f.path,\n matches: fetcherMatches,\n match: fetcherMatch,\n controller: new AbortController()\n });\n }\n });\n return [navigationMatches, revalidatingFetchers];\n}\nfunction shouldLoadRouteOnHydration(route, loaderData, errors) {\n // We dunno if we have a loader - gotta find out!\n if (route.lazy) {\n return true;\n }\n // No loader, nothing to initialize\n if (!route.loader) {\n return false;\n }\n let hasData = loaderData != null && loaderData[route.id] !== undefined;\n let hasError = errors != null && errors[route.id] !== undefined;\n // Don't run if we error'd during SSR\n if (!hasData && hasError) {\n return false;\n }\n // Explicitly opting-in to running on hydration\n if (typeof route.loader === \"function\" && route.loader.hydrate === true) {\n return true;\n }\n // Otherwise, run if we're not yet initialized with anything\n return !hasData && !hasError;\n}\nfunction isNewLoader(currentLoaderData, currentMatch, match) {\n let isNew =\n // [a] -> [a, b]\n !currentMatch ||\n // [a, b] -> [a, c]\n match.route.id !== currentMatch.route.id;\n // Handle the case that we don't have data for a re-used route, potentially\n // from a prior error or from a cancelled pending deferred\n let isMissingData = currentLoaderData[match.route.id] === undefined;\n // Always load if this is a net-new route or we don't yet have data\n return isNew || isMissingData;\n}\nfunction isNewRouteInstance(currentMatch, match) {\n let currentPath = currentMatch.route.path;\n return (\n // param change for this match, /users/123 -> /users/456\n currentMatch.pathname !== match.pathname ||\n // splat param changed, which is not present in match.path\n // e.g. /files/images/avatar.jpg -> files/finances.xls\n currentPath != null && currentPath.endsWith(\"*\") && currentMatch.params[\"*\"] !== match.params[\"*\"]\n );\n}\nfunction shouldRevalidateLoader(loaderMatch, arg) {\n if (loaderMatch.route.shouldRevalidate) {\n let routeChoice = loaderMatch.route.shouldRevalidate(arg);\n if (typeof routeChoice === \"boolean\") {\n return routeChoice;\n }\n }\n return arg.defaultShouldRevalidate;\n}\nfunction patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties) {\n var _childrenToPatch;\n let childrenToPatch;\n if (routeId) {\n let route = manifest[routeId];\n invariant(route, \"No route found to patch children into: routeId = \" + routeId);\n if (!route.children) {\n route.children = [];\n }\n childrenToPatch = route.children;\n } else {\n childrenToPatch = routesToUse;\n }\n // Don't patch in routes we already know about so that `patch` is idempotent\n // to simplify user-land code. This is useful because we re-call the\n // `patchRoutesOnNavigation` function for matched routes with params.\n let uniqueChildren = children.filter(newRoute => !childrenToPatch.some(existingRoute => isSameRoute(newRoute, existingRoute)));\n let newRoutes = convertRoutesToDataRoutes(uniqueChildren, mapRouteProperties, [routeId || \"_\", \"patch\", String(((_childrenToPatch = childrenToPatch) == null ? void 0 : _childrenToPatch.length) || \"0\")], manifest);\n childrenToPatch.push(...newRoutes);\n}\nfunction isSameRoute(newRoute, existingRoute) {\n // Most optimal check is by id\n if (\"id\" in newRoute && \"id\" in existingRoute && newRoute.id === existingRoute.id) {\n return true;\n }\n // Second is by pathing differences\n if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) {\n return false;\n }\n // Pathless layout routes are trickier since we need to check children.\n // If they have no children then they're the same as far as we can tell\n if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) {\n return true;\n }\n // Otherwise, we look to see if every child in the new route is already\n // represented in the existing route's children\n return newRoute.children.every((aChild, i) => {\n var _existingRoute$childr;\n return (_existingRoute$childr = existingRoute.children) == null ? void 0 : _existingRoute$childr.some(bChild => isSameRoute(aChild, bChild));\n });\n}\n/**\n * Execute route.lazy() methods to lazily load route modules (loader, action,\n * shouldRevalidate) and update the routeManifest in place which shares objects\n * with dataRoutes so those get updated as well.\n */\nasync function loadLazyRouteModule(route, mapRouteProperties, manifest) {\n if (!route.lazy) {\n return;\n }\n let lazyRoute = await route.lazy();\n // If the lazy route function was executed and removed by another parallel\n // call then we can return - first lazy() to finish wins because the return\n // value of lazy is expected to be static\n if (!route.lazy) {\n return;\n }\n let routeToUpdate = manifest[route.id];\n invariant(routeToUpdate, \"No route found in manifest\");\n // Update the route in place. This should be safe because there's no way\n // we could yet be sitting on this route as we can't get there without\n // resolving lazy() first.\n //\n // This is different than the HMR \"update\" use-case where we may actively be\n // on the route being updated. The main concern boils down to \"does this\n // mutation affect any ongoing navigations or any current state.matches\n // values?\". If not, it should be safe to update in place.\n let routeUpdates = {};\n for (let lazyRouteProperty in lazyRoute) {\n let staticRouteValue = routeToUpdate[lazyRouteProperty];\n let isPropertyStaticallyDefined = staticRouteValue !== undefined &&\n // This property isn't static since it should always be updated based\n // on the route updates\n lazyRouteProperty !== \"hasErrorBoundary\";\n warning(!isPropertyStaticallyDefined, \"Route \\\"\" + routeToUpdate.id + \"\\\" has a static property \\\"\" + lazyRouteProperty + \"\\\" \" + \"defined but its lazy function is also returning a value for this property. \" + (\"The lazy route property \\\"\" + lazyRouteProperty + \"\\\" will be ignored.\"));\n if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) {\n routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty];\n }\n }\n // Mutate the route with the provided updates. Do this first so we pass\n // the updated version to mapRouteProperties\n Object.assign(routeToUpdate, routeUpdates);\n // Mutate the `hasErrorBoundary` property on the route based on the route\n // updates and remove the `lazy` function so we don't resolve the lazy\n // route again.\n Object.assign(routeToUpdate, _extends({}, mapRouteProperties(routeToUpdate), {\n lazy: undefined\n }));\n}\n// Default implementation of `dataStrategy` which fetches all loaders in parallel\nasync function defaultDataStrategy(_ref4) {\n let {\n matches\n } = _ref4;\n let matchesToLoad = matches.filter(m => m.shouldLoad);\n let results = await Promise.all(matchesToLoad.map(m => m.resolve()));\n return results.reduce((acc, result, i) => Object.assign(acc, {\n [matchesToLoad[i].route.id]: result\n }), {});\n}\nasync function callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties, requestContext) {\n let loadRouteDefinitionsPromises = matches.map(m => m.route.lazy ? loadLazyRouteModule(m.route, mapRouteProperties, manifest) : undefined);\n let dsMatches = matches.map((match, i) => {\n let loadRoutePromise = loadRouteDefinitionsPromises[i];\n let shouldLoad = matchesToLoad.some(m => m.route.id === match.route.id);\n // `resolve` encapsulates route.lazy(), executing the loader/action,\n // and mapping return values/thrown errors to a `DataStrategyResult`. Users\n // can pass a callback to take fine-grained control over the execution\n // of the loader/action\n let resolve = async handlerOverride => {\n if (handlerOverride && request.method === \"GET\" && (match.route.lazy || match.route.loader)) {\n shouldLoad = true;\n }\n return shouldLoad ? callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, requestContext) : Promise.resolve({\n type: ResultType.data,\n result: undefined\n });\n };\n return _extends({}, match, {\n shouldLoad,\n resolve\n });\n });\n // Send all matches here to allow for a middleware-type implementation.\n // handler will be a no-op for unneeded routes and we filter those results\n // back out below.\n let results = await dataStrategyImpl({\n matches: dsMatches,\n request,\n params: matches[0].params,\n fetcherKey,\n context: requestContext\n });\n // Wait for all routes to load here but 'swallow the error since we want\n // it to bubble up from the `await loadRoutePromise` in `callLoaderOrAction` -\n // called from `match.resolve()`\n try {\n await Promise.all(loadRouteDefinitionsPromises);\n } catch (e) {\n // No-op\n }\n return results;\n}\n// Default logic for calling a loader/action is the user has no specified a dataStrategy\nasync function callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, staticContext) {\n let result;\n let onReject;\n let runHandler = handler => {\n // Setup a promise we can race against so that abort signals short circuit\n let reject;\n // This will never resolve so safe to type it as Promise to\n // satisfy the function return value\n let abortPromise = new Promise((_, r) => reject = r);\n onReject = () => reject();\n request.signal.addEventListener(\"abort\", onReject);\n let actualHandler = ctx => {\n if (typeof handler !== \"function\") {\n return Promise.reject(new Error(\"You cannot call the handler for a route which defines a boolean \" + (\"\\\"\" + type + \"\\\" [routeId: \" + match.route.id + \"]\")));\n }\n return handler({\n request,\n params: match.params,\n context: staticContext\n }, ...(ctx !== undefined ? [ctx] : []));\n };\n let handlerPromise = (async () => {\n try {\n let val = await (handlerOverride ? handlerOverride(ctx => actualHandler(ctx)) : actualHandler());\n return {\n type: \"data\",\n result: val\n };\n } catch (e) {\n return {\n type: \"error\",\n result: e\n };\n }\n })();\n return Promise.race([handlerPromise, abortPromise]);\n };\n try {\n let handler = match.route[type];\n // If we have a route.lazy promise, await that first\n if (loadRoutePromise) {\n if (handler) {\n // Run statically defined handler in parallel with lazy()\n let handlerError;\n let [value] = await Promise.all([\n // If the handler throws, don't let it immediately bubble out,\n // since we need to let the lazy() execution finish so we know if this\n // route has a boundary that can handle the error\n runHandler(handler).catch(e => {\n handlerError = e;\n }), loadRoutePromise]);\n if (handlerError !== undefined) {\n throw handlerError;\n }\n result = value;\n } else {\n // Load lazy route module, then run any returned handler\n await loadRoutePromise;\n handler = match.route[type];\n if (handler) {\n // Handler still runs even if we got interrupted to maintain consistency\n // with un-abortable behavior of handler execution on non-lazy or\n // previously-lazy-loaded routes\n result = await runHandler(handler);\n } else if (type === \"action\") {\n let url = new URL(request.url);\n let pathname = url.pathname + url.search;\n throw getInternalRouterError(405, {\n method: request.method,\n pathname,\n routeId: match.route.id\n });\n } else {\n // lazy() route has no loader to run. Short circuit here so we don't\n // hit the invariant below that errors on returning undefined.\n return {\n type: ResultType.data,\n result: undefined\n };\n }\n }\n } else if (!handler) {\n let url = new URL(request.url);\n let pathname = url.pathname + url.search;\n throw getInternalRouterError(404, {\n pathname\n });\n } else {\n result = await runHandler(handler);\n }\n invariant(result.result !== undefined, \"You defined \" + (type === \"action\" ? \"an action\" : \"a loader\") + \" for route \" + (\"\\\"\" + match.route.id + \"\\\" but didn't return anything from your `\" + type + \"` \") + \"function. Please return a value or `null`.\");\n } catch (e) {\n // We should already be catching and converting normal handler executions to\n // DataStrategyResults and returning them, so anything that throws here is an\n // unexpected error we still need to wrap\n return {\n type: ResultType.error,\n result: e\n };\n } finally {\n if (onReject) {\n request.signal.removeEventListener(\"abort\", onReject);\n }\n }\n return result;\n}\nasync function convertDataStrategyResultToDataResult(dataStrategyResult) {\n let {\n result,\n type\n } = dataStrategyResult;\n if (isResponse(result)) {\n let data;\n try {\n let contentType = result.headers.get(\"Content-Type\");\n // Check between word boundaries instead of startsWith() due to the last\n // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type\n if (contentType && /\\bapplication\\/json\\b/.test(contentType)) {\n if (result.body == null) {\n data = null;\n } else {\n data = await result.json();\n }\n } else {\n data = await result.text();\n }\n } catch (e) {\n return {\n type: ResultType.error,\n error: e\n };\n }\n if (type === ResultType.error) {\n return {\n type: ResultType.error,\n error: new ErrorResponseImpl(result.status, result.statusText, data),\n statusCode: result.status,\n headers: result.headers\n };\n }\n return {\n type: ResultType.data,\n data,\n statusCode: result.status,\n headers: result.headers\n };\n }\n if (type === ResultType.error) {\n if (isDataWithResponseInit(result)) {\n var _result$init3, _result$init4;\n if (result.data instanceof Error) {\n var _result$init, _result$init2;\n return {\n type: ResultType.error,\n error: result.data,\n statusCode: (_result$init = result.init) == null ? void 0 : _result$init.status,\n headers: (_result$init2 = result.init) != null && _result$init2.headers ? new Headers(result.init.headers) : undefined\n };\n }\n // Convert thrown data() to ErrorResponse instances\n return {\n type: ResultType.error,\n error: new ErrorResponseImpl(((_result$init3 = result.init) == null ? void 0 : _result$init3.status) || 500, undefined, result.data),\n statusCode: isRouteErrorResponse(result) ? result.status : undefined,\n headers: (_result$init4 = result.init) != null && _result$init4.headers ? new Headers(result.init.headers) : undefined\n };\n }\n return {\n type: ResultType.error,\n error: result,\n statusCode: isRouteErrorResponse(result) ? result.status : undefined\n };\n }\n if (isDeferredData(result)) {\n var _result$init5, _result$init6;\n return {\n type: ResultType.deferred,\n deferredData: result,\n statusCode: (_result$init5 = result.init) == null ? void 0 : _result$init5.status,\n headers: ((_result$init6 = result.init) == null ? void 0 : _result$init6.headers) && new Headers(result.init.headers)\n };\n }\n if (isDataWithResponseInit(result)) {\n var _result$init7, _result$init8;\n return {\n type: ResultType.data,\n data: result.data,\n statusCode: (_result$init7 = result.init) == null ? void 0 : _result$init7.status,\n headers: (_result$init8 = result.init) != null && _result$init8.headers ? new Headers(result.init.headers) : undefined\n };\n }\n return {\n type: ResultType.data,\n data: result\n };\n}\n// Support relative routing in internal redirects\nfunction normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename, v7_relativeSplatPath) {\n let location = response.headers.get(\"Location\");\n invariant(location, \"Redirects returned/thrown from loaders/actions must have a Location header\");\n if (!ABSOLUTE_URL_REGEX.test(location)) {\n let trimmedMatches = matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1);\n location = normalizeTo(new URL(request.url), trimmedMatches, basename, true, location, v7_relativeSplatPath);\n response.headers.set(\"Location\", location);\n }\n return response;\n}\nfunction normalizeRedirectLocation(location, currentUrl, basename, historyInstance) {\n // Match Chrome's behavior:\n // https://github.com/chromium/chromium/blob/216dbeb61db0c667e62082e5f5400a32d6983df3/content/public/common/url_utils.cc#L82\n let invalidProtocols = [\"about:\", \"blob:\", \"chrome:\", \"chrome-untrusted:\", \"content:\", \"data:\", \"devtools:\", \"file:\", \"filesystem:\",\n // eslint-disable-next-line no-script-url\n \"javascript:\"];\n if (ABSOLUTE_URL_REGEX.test(location)) {\n // Strip off the protocol+origin for same-origin + same-basename absolute redirects\n let normalizedLocation = location;\n let url = normalizedLocation.startsWith(\"//\") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation);\n if (invalidProtocols.includes(url.protocol)) {\n throw new Error(\"Invalid redirect location\");\n }\n let isSameBasename = stripBasename(url.pathname, basename) != null;\n if (url.origin === currentUrl.origin && isSameBasename) {\n return url.pathname + url.search + url.hash;\n }\n }\n try {\n let url = historyInstance.createURL(location);\n if (invalidProtocols.includes(url.protocol)) {\n throw new Error(\"Invalid redirect location\");\n }\n } catch (e) {}\n return location;\n}\n// Utility method for creating the Request instances for loaders/actions during\n// client-side navigations and fetches. During SSR we will always have a\n// Request instance from the static handler (query/queryRoute)\nfunction createClientSideRequest(history, location, signal, submission) {\n let url = history.createURL(stripHashFromPath(location)).toString();\n let init = {\n signal\n };\n if (submission && isMutationMethod(submission.formMethod)) {\n let {\n formMethod,\n formEncType\n } = submission;\n // Didn't think we needed this but it turns out unlike other methods, patch\n // won't be properly normalized to uppercase and results in a 405 error.\n // See: https://fetch.spec.whatwg.org/#concept-method\n init.method = formMethod.toUpperCase();\n if (formEncType === \"application/json\") {\n init.headers = new Headers({\n \"Content-Type\": formEncType\n });\n init.body = JSON.stringify(submission.json);\n } else if (formEncType === \"text/plain\") {\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n init.body = submission.text;\n } else if (formEncType === \"application/x-www-form-urlencoded\" && submission.formData) {\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n init.body = convertFormDataToSearchParams(submission.formData);\n } else {\n // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)\n init.body = submission.formData;\n }\n }\n return new Request(url, init);\n}\nfunction convertFormDataToSearchParams(formData) {\n let searchParams = new URLSearchParams();\n for (let [key, value] of formData.entries()) {\n // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs\n searchParams.append(key, typeof value === \"string\" ? value : value.name);\n }\n return searchParams;\n}\nfunction convertSearchParamsToFormData(searchParams) {\n let formData = new FormData();\n for (let [key, value] of searchParams.entries()) {\n formData.append(key, value);\n }\n return formData;\n}\nfunction processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling) {\n // Fill in loaderData/errors from our loaders\n let loaderData = {};\n let errors = null;\n let statusCode;\n let foundError = false;\n let loaderHeaders = {};\n let pendingError = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : undefined;\n // Process loader results into state.loaderData/state.errors\n matches.forEach(match => {\n if (!(match.route.id in results)) {\n return;\n }\n let id = match.route.id;\n let result = results[id];\n invariant(!isRedirectResult(result), \"Cannot handle redirect results in processLoaderData\");\n if (isErrorResult(result)) {\n let error = result.error;\n // If we have a pending action error, we report it at the highest-route\n // that throws a loader error, and then clear it out to indicate that\n // it was consumed\n if (pendingError !== undefined) {\n error = pendingError;\n pendingError = undefined;\n }\n errors = errors || {};\n if (skipLoaderErrorBubbling) {\n errors[id] = error;\n } else {\n // Look upwards from the matched route for the closest ancestor error\n // boundary, defaulting to the root match. Prefer higher error values\n // if lower errors bubble to the same boundary\n let boundaryMatch = findNearestBoundary(matches, id);\n if (errors[boundaryMatch.route.id] == null) {\n errors[boundaryMatch.route.id] = error;\n }\n }\n // Clear our any prior loaderData for the throwing route\n loaderData[id] = undefined;\n // Once we find our first (highest) error, we set the status code and\n // prevent deeper status codes from overriding\n if (!foundError) {\n foundError = true;\n statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else {\n if (isDeferredResult(result)) {\n activeDeferreds.set(id, result.deferredData);\n loaderData[id] = result.deferredData.data;\n // Error status codes always override success status codes, but if all\n // loaders are successful we take the deepest status code.\n if (result.statusCode != null && result.statusCode !== 200 && !foundError) {\n statusCode = result.statusCode;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n } else {\n loaderData[id] = result.data;\n // Error status codes always override success status codes, but if all\n // loaders are successful we take the deepest status code.\n if (result.statusCode && result.statusCode !== 200 && !foundError) {\n statusCode = result.statusCode;\n }\n if (result.headers) {\n loaderHeaders[id] = result.headers;\n }\n }\n }\n });\n // If we didn't consume the pending action error (i.e., all loaders\n // resolved), then consume it here. Also clear out any loaderData for the\n // throwing route\n if (pendingError !== undefined && pendingActionResult) {\n errors = {\n [pendingActionResult[0]]: pendingError\n };\n loaderData[pendingActionResult[0]] = undefined;\n }\n return {\n loaderData,\n errors,\n statusCode: statusCode || 200,\n loaderHeaders\n };\n}\nfunction processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds) {\n let {\n loaderData,\n errors\n } = processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, false // This method is only called client side so we always want to bubble\n );\n // Process results from our revalidating fetchers\n revalidatingFetchers.forEach(rf => {\n let {\n key,\n match,\n controller\n } = rf;\n let result = fetcherResults[key];\n invariant(result, \"Did not find corresponding fetcher result\");\n // Process fetcher non-redirect errors\n if (controller && controller.signal.aborted) {\n // Nothing to do for aborted fetchers\n return;\n } else if (isErrorResult(result)) {\n let boundaryMatch = findNearestBoundary(state.matches, match == null ? void 0 : match.route.id);\n if (!(errors && errors[boundaryMatch.route.id])) {\n errors = _extends({}, errors, {\n [boundaryMatch.route.id]: result.error\n });\n }\n state.fetchers.delete(key);\n } else if (isRedirectResult(result)) {\n // Should never get here, redirects should get processed above, but we\n // keep this to type narrow to a success result in the else\n invariant(false, \"Unhandled fetcher revalidation redirect\");\n } else if (isDeferredResult(result)) {\n // Should never get here, deferred data should be awaited for fetchers\n // in resolveDeferredResults\n invariant(false, \"Unhandled fetcher deferred data\");\n } else {\n let doneFetcher = getDoneFetcher(result.data);\n state.fetchers.set(key, doneFetcher);\n }\n });\n return {\n loaderData,\n errors\n };\n}\nfunction mergeLoaderData(loaderData, newLoaderData, matches, errors) {\n let mergedLoaderData = _extends({}, newLoaderData);\n for (let match of matches) {\n let id = match.route.id;\n if (newLoaderData.hasOwnProperty(id)) {\n if (newLoaderData[id] !== undefined) {\n mergedLoaderData[id] = newLoaderData[id];\n }\n } else if (loaderData[id] !== undefined && match.route.loader) {\n // Preserve existing keys not included in newLoaderData and where a loader\n // wasn't removed by HMR\n mergedLoaderData[id] = loaderData[id];\n }\n if (errors && errors.hasOwnProperty(id)) {\n // Don't keep any loader data below the boundary\n break;\n }\n }\n return mergedLoaderData;\n}\nfunction getActionDataForCommit(pendingActionResult) {\n if (!pendingActionResult) {\n return {};\n }\n return isErrorResult(pendingActionResult[1]) ? {\n // Clear out prior actionData on errors\n actionData: {}\n } : {\n actionData: {\n [pendingActionResult[0]]: pendingActionResult[1].data\n }\n };\n}\n// Find the nearest error boundary, looking upwards from the leaf route (or the\n// route specified by routeId) for the closest ancestor error boundary,\n// defaulting to the root match\nfunction findNearestBoundary(matches, routeId) {\n let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches];\n return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0];\n}\nfunction getShortCircuitMatches(routes) {\n // Prefer a root layout route if present, otherwise shim in a route object\n let route = routes.length === 1 ? routes[0] : routes.find(r => r.index || !r.path || r.path === \"/\") || {\n id: \"__shim-error-route__\"\n };\n return {\n matches: [{\n params: {},\n pathname: \"\",\n pathnameBase: \"\",\n route\n }],\n route\n };\n}\nfunction getInternalRouterError(status, _temp5) {\n let {\n pathname,\n routeId,\n method,\n type,\n message\n } = _temp5 === void 0 ? {} : _temp5;\n let statusText = \"Unknown Server Error\";\n let errorMessage = \"Unknown @remix-run/router error\";\n if (status === 400) {\n statusText = \"Bad Request\";\n if (method && pathname && routeId) {\n errorMessage = \"You made a \" + method + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide a `loader` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n } else if (type === \"defer-action\") {\n errorMessage = \"defer() is not supported in actions\";\n } else if (type === \"invalid-body\") {\n errorMessage = \"Unable to encode submission body\";\n }\n } else if (status === 403) {\n statusText = \"Forbidden\";\n errorMessage = \"Route \\\"\" + routeId + \"\\\" does not match URL \\\"\" + pathname + \"\\\"\";\n } else if (status === 404) {\n statusText = \"Not Found\";\n errorMessage = \"No route matches URL \\\"\" + pathname + \"\\\"\";\n } else if (status === 405) {\n statusText = \"Method Not Allowed\";\n if (method && pathname && routeId) {\n errorMessage = \"You made a \" + method.toUpperCase() + \" request to \\\"\" + pathname + \"\\\" but \" + (\"did not provide an `action` for route \\\"\" + routeId + \"\\\", \") + \"so there is no way to handle the request.\";\n } else if (method) {\n errorMessage = \"Invalid request method \\\"\" + method.toUpperCase() + \"\\\"\";\n }\n }\n return new ErrorResponseImpl(status || 500, statusText, new Error(errorMessage), true);\n}\n// Find any returned redirect errors, starting from the lowest match\nfunction findRedirect(results) {\n let entries = Object.entries(results);\n for (let i = entries.length - 1; i >= 0; i--) {\n let [key, result] = entries[i];\n if (isRedirectResult(result)) {\n return {\n key,\n result\n };\n }\n }\n}\nfunction stripHashFromPath(path) {\n let parsedPath = typeof path === \"string\" ? parsePath(path) : path;\n return createPath(_extends({}, parsedPath, {\n hash: \"\"\n }));\n}\nfunction isHashChangeOnly(a, b) {\n if (a.pathname !== b.pathname || a.search !== b.search) {\n return false;\n }\n if (a.hash === \"\") {\n // /page -> /page#hash\n return b.hash !== \"\";\n } else if (a.hash === b.hash) {\n // /page#hash -> /page#hash\n return true;\n } else if (b.hash !== \"\") {\n // /page#hash -> /page#other\n return true;\n }\n // If the hash is removed the browser will re-perform a request to the server\n // /page#hash -> /page\n return false;\n}\nfunction isDataStrategyResult(result) {\n return result != null && typeof result === \"object\" && \"type\" in result && \"result\" in result && (result.type === ResultType.data || result.type === ResultType.error);\n}\nfunction isRedirectDataStrategyResultResult(result) {\n return isResponse(result.result) && redirectStatusCodes.has(result.result.status);\n}\nfunction isDeferredResult(result) {\n return result.type === ResultType.deferred;\n}\nfunction isErrorResult(result) {\n return result.type === ResultType.error;\n}\nfunction isRedirectResult(result) {\n return (result && result.type) === ResultType.redirect;\n}\nfunction isDataWithResponseInit(value) {\n return typeof value === \"object\" && value != null && \"type\" in value && \"data\" in value && \"init\" in value && value.type === \"DataWithResponseInit\";\n}\nfunction isDeferredData(value) {\n let deferred = value;\n return deferred && typeof deferred === \"object\" && typeof deferred.data === \"object\" && typeof deferred.subscribe === \"function\" && typeof deferred.cancel === \"function\" && typeof deferred.resolveData === \"function\";\n}\nfunction isResponse(value) {\n return value != null && typeof value.status === \"number\" && typeof value.statusText === \"string\" && typeof value.headers === \"object\" && typeof value.body !== \"undefined\";\n}\nfunction isRedirectResponse(result) {\n if (!isResponse(result)) {\n return false;\n }\n let status = result.status;\n let location = result.headers.get(\"Location\");\n return status >= 300 && status <= 399 && location != null;\n}\nfunction isValidMethod(method) {\n return validRequestMethods.has(method.toLowerCase());\n}\nfunction isMutationMethod(method) {\n return validMutationMethods.has(method.toLowerCase());\n}\nasync function resolveNavigationDeferredResults(matches, results, signal, currentMatches, currentLoaderData) {\n let entries = Object.entries(results);\n for (let index = 0; index < entries.length; index++) {\n let [routeId, result] = entries[index];\n let match = matches.find(m => (m == null ? void 0 : m.route.id) === routeId);\n // If we don't have a match, then we can have a deferred result to do\n // anything with. This is for revalidating fetchers where the route was\n // removed during HMR\n if (!match) {\n continue;\n }\n let currentMatch = currentMatches.find(m => m.route.id === match.route.id);\n let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;\n if (isDeferredResult(result) && isRevalidatingLoader) {\n // Note: we do not have to touch activeDeferreds here since we race them\n // against the signal in resolveDeferredData and they'll get aborted\n // there if needed\n await resolveDeferredData(result, signal, false).then(result => {\n if (result) {\n results[routeId] = result;\n }\n });\n }\n }\n}\nasync function resolveFetcherDeferredResults(matches, results, revalidatingFetchers) {\n for (let index = 0; index < revalidatingFetchers.length; index++) {\n let {\n key,\n routeId,\n controller\n } = revalidatingFetchers[index];\n let result = results[key];\n let match = matches.find(m => (m == null ? void 0 : m.route.id) === routeId);\n // If we don't have a match, then we can have a deferred result to do\n // anything with. This is for revalidating fetchers where the route was\n // removed during HMR\n if (!match) {\n continue;\n }\n if (isDeferredResult(result)) {\n // Note: we do not have to touch activeDeferreds here since we race them\n // against the signal in resolveDeferredData and they'll get aborted\n // there if needed\n invariant(controller, \"Expected an AbortController for revalidating fetcher deferred result\");\n await resolveDeferredData(result, controller.signal, true).then(result => {\n if (result) {\n results[key] = result;\n }\n });\n }\n }\n}\nasync function resolveDeferredData(result, signal, unwrap) {\n if (unwrap === void 0) {\n unwrap = false;\n }\n let aborted = await result.deferredData.resolveData(signal);\n if (aborted) {\n return;\n }\n if (unwrap) {\n try {\n return {\n type: ResultType.data,\n data: result.deferredData.unwrappedData\n };\n } catch (e) {\n // Handle any TrackedPromise._error values encountered while unwrapping\n return {\n type: ResultType.error,\n error: e\n };\n }\n }\n return {\n type: ResultType.data,\n data: result.deferredData.data\n };\n}\nfunction hasNakedIndexQuery(search) {\n return new URLSearchParams(search).getAll(\"index\").some(v => v === \"\");\n}\nfunction getTargetMatch(matches, location) {\n let search = typeof location === \"string\" ? parsePath(location).search : location.search;\n if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || \"\")) {\n // Return the leaf index route when index is present\n return matches[matches.length - 1];\n }\n // Otherwise grab the deepest \"path contributing\" match (ignoring index and\n // pathless layout routes)\n let pathMatches = getPathContributingMatches(matches);\n return pathMatches[pathMatches.length - 1];\n}\nfunction getSubmissionFromNavigation(navigation) {\n let {\n formMethod,\n formAction,\n formEncType,\n text,\n formData,\n json\n } = navigation;\n if (!formMethod || !formAction || !formEncType) {\n return;\n }\n if (text != null) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData: undefined,\n json: undefined,\n text\n };\n } else if (formData != null) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData,\n json: undefined,\n text: undefined\n };\n } else if (json !== undefined) {\n return {\n formMethod,\n formAction,\n formEncType,\n formData: undefined,\n json,\n text: undefined\n };\n }\n}\nfunction getLoadingNavigation(location, submission) {\n if (submission) {\n let navigation = {\n state: \"loading\",\n location,\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text\n };\n return navigation;\n } else {\n let navigation = {\n state: \"loading\",\n location,\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined\n };\n return navigation;\n }\n}\nfunction getSubmittingNavigation(location, submission) {\n let navigation = {\n state: \"submitting\",\n location,\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text\n };\n return navigation;\n}\nfunction getLoadingFetcher(submission, data) {\n if (submission) {\n let fetcher = {\n state: \"loading\",\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n data\n };\n return fetcher;\n } else {\n let fetcher = {\n state: \"loading\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n data\n };\n return fetcher;\n }\n}\nfunction getSubmittingFetcher(submission, existingFetcher) {\n let fetcher = {\n state: \"submitting\",\n formMethod: submission.formMethod,\n formAction: submission.formAction,\n formEncType: submission.formEncType,\n formData: submission.formData,\n json: submission.json,\n text: submission.text,\n data: existingFetcher ? existingFetcher.data : undefined\n };\n return fetcher;\n}\nfunction getDoneFetcher(data) {\n let fetcher = {\n state: \"idle\",\n formMethod: undefined,\n formAction: undefined,\n formEncType: undefined,\n formData: undefined,\n json: undefined,\n text: undefined,\n data\n };\n return fetcher;\n}\nfunction restoreAppliedTransitions(_window, transitions) {\n try {\n let sessionPositions = _window.sessionStorage.getItem(TRANSITIONS_STORAGE_KEY);\n if (sessionPositions) {\n let json = JSON.parse(sessionPositions);\n for (let [k, v] of Object.entries(json || {})) {\n if (v && Array.isArray(v)) {\n transitions.set(k, new Set(v || []));\n }\n }\n }\n } catch (e) {\n // no-op, use default empty object\n }\n}\nfunction persistAppliedTransitions(_window, transitions) {\n if (transitions.size > 0) {\n let json = {};\n for (let [k, v] of transitions) {\n json[k] = [...v];\n }\n try {\n _window.sessionStorage.setItem(TRANSITIONS_STORAGE_KEY, JSON.stringify(json));\n } catch (error) {\n warning(false, \"Failed to save applied view transitions in sessionStorage (\" + error + \").\");\n }\n }\n}\n//#endregion\n\nexport { AbortedDeferredError, Action, IDLE_BLOCKER, IDLE_FETCHER, IDLE_NAVIGATION, UNSAFE_DEFERRED_SYMBOL, DeferredData as UNSAFE_DeferredData, ErrorResponseImpl as UNSAFE_ErrorResponseImpl, convertRouteMatchToUiMatch as UNSAFE_convertRouteMatchToUiMatch, convertRoutesToDataRoutes as UNSAFE_convertRoutesToDataRoutes, decodePath as UNSAFE_decodePath, getResolveToMatches as UNSAFE_getResolveToMatches, invariant as UNSAFE_invariant, warning as UNSAFE_warning, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, createRouter, createStaticHandler, data, defer, generatePath, getStaticContextFromError, getToPathname, isDataWithResponseInit, isDeferredData, isRouteErrorResponse, joinPaths, json, matchPath, matchRoutes, normalizePathname, parsePath, redirect, redirectDocument, replace, resolvePath, resolveTo, stripBasename };\n//# sourceMappingURL=router.js.map\n","/**\n * React Router v6.30.3\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport { UNSAFE_invariant, joinPaths, matchPath, UNSAFE_decodePath, UNSAFE_getResolveToMatches, UNSAFE_warning, resolveTo, parsePath, matchRoutes, Action, UNSAFE_convertRouteMatchToUiMatch, stripBasename, IDLE_BLOCKER, isRouteErrorResponse, createMemoryHistory, AbortedDeferredError, createRouter } from '@remix-run/router';\nexport { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, replace, resolvePath } from '@remix-run/router';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\n// Create react-specific types from the agnostic types in @remix-run/router to\n// export from react-router\nconst DataRouterContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n DataRouterContext.displayName = \"DataRouter\";\n}\nconst DataRouterStateContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n DataRouterStateContext.displayName = \"DataRouterState\";\n}\nconst AwaitContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n AwaitContext.displayName = \"Await\";\n}\n\n/**\n * A Navigator is a \"location changer\"; it's how you get to different locations.\n *\n * Every history instance conforms to the Navigator interface, but the\n * distinction is useful primarily when it comes to the low-level `` API\n * where both the location and a navigator must be provided separately in order\n * to avoid \"tearing\" that may occur in a suspense-enabled app if the action\n * and/or location were to be read directly from the history instance.\n */\n\nconst NavigationContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n NavigationContext.displayName = \"Navigation\";\n}\nconst LocationContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n LocationContext.displayName = \"Location\";\n}\nconst RouteContext = /*#__PURE__*/React.createContext({\n outlet: null,\n matches: [],\n isDataRoute: false\n});\nif (process.env.NODE_ENV !== \"production\") {\n RouteContext.displayName = \"Route\";\n}\nconst RouteErrorContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") {\n RouteErrorContext.displayName = \"RouteError\";\n}\n\n/**\n * Returns the full href for the given \"to\" value. This is useful for building\n * custom links that are also accessible and preserve right-click behavior.\n *\n * @see https://reactrouter.com/v6/hooks/use-href\n */\nfunction useHref(to, _temp) {\n let {\n relative\n } = _temp === void 0 ? {} : _temp;\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useHref() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n let {\n basename,\n navigator\n } = React.useContext(NavigationContext);\n let {\n hash,\n pathname,\n search\n } = useResolvedPath(to, {\n relative\n });\n let joinedPathname = pathname;\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to creating the href. If this is a root navigation, then just use the raw\n // basename which allows the basename to have full control over the presence\n // of a trailing slash on root links\n if (basename !== \"/\") {\n joinedPathname = pathname === \"/\" ? basename : joinPaths([basename, pathname]);\n }\n return navigator.createHref({\n pathname: joinedPathname,\n search,\n hash\n });\n}\n\n/**\n * Returns true if this component is a descendant of a ``.\n *\n * @see https://reactrouter.com/v6/hooks/use-in-router-context\n */\nfunction useInRouterContext() {\n return React.useContext(LocationContext) != null;\n}\n\n/**\n * Returns the current location object, which represents the current URL in web\n * browsers.\n *\n * Note: If you're using this it may mean you're doing some of your own\n * \"routing\" in your app, and we'd like to know what your use case is. We may\n * be able to provide something higher-level to better suit your needs.\n *\n * @see https://reactrouter.com/v6/hooks/use-location\n */\nfunction useLocation() {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useLocation() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n return React.useContext(LocationContext).location;\n}\n\n/**\n * Returns the current navigation action which describes how the router came to\n * the current location, either by a pop, push, or replace on the history stack.\n *\n * @see https://reactrouter.com/v6/hooks/use-navigation-type\n */\nfunction useNavigationType() {\n return React.useContext(LocationContext).navigationType;\n}\n\n/**\n * Returns a PathMatch object if the given pattern matches the current URL.\n * This is useful for components that need to know \"active\" state, e.g.\n * ``.\n *\n * @see https://reactrouter.com/v6/hooks/use-match\n */\nfunction useMatch(pattern) {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useMatch() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n let {\n pathname\n } = useLocation();\n return React.useMemo(() => matchPath(pattern, UNSAFE_decodePath(pathname)), [pathname, pattern]);\n}\n\n/**\n * The interface for the navigate() function returned from useNavigate().\n */\n\nconst navigateEffectWarning = \"You should call navigate() in a React.useEffect(), not when \" + \"your component is first rendered.\";\n\n// Mute warnings for calls to useNavigate in SSR environments\nfunction useIsomorphicLayoutEffect(cb) {\n let isStatic = React.useContext(NavigationContext).static;\n if (!isStatic) {\n // We should be able to get rid of this once react 18.3 is released\n // See: https://github.com/facebook/react/pull/26395\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(cb);\n }\n}\n\n/**\n * Returns an imperative method for changing the location. Used by ``s, but\n * may also be used by other elements to change the location.\n *\n * @see https://reactrouter.com/v6/hooks/use-navigate\n */\nfunction useNavigate() {\n let {\n isDataRoute\n } = React.useContext(RouteContext);\n // Conditional usage is OK here because the usage of a data router is static\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return isDataRoute ? useNavigateStable() : useNavigateUnstable();\n}\nfunction useNavigateUnstable() {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useNavigate() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n let dataRouterContext = React.useContext(DataRouterContext);\n let {\n basename,\n future,\n navigator\n } = React.useContext(NavigationContext);\n let {\n matches\n } = React.useContext(RouteContext);\n let {\n pathname: locationPathname\n } = useLocation();\n let routePathnamesJson = JSON.stringify(UNSAFE_getResolveToMatches(matches, future.v7_relativeSplatPath));\n let activeRef = React.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n let navigate = React.useCallback(function (to, options) {\n if (options === void 0) {\n options = {};\n }\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(activeRef.current, navigateEffectWarning) : void 0;\n\n // Short circuit here since if this happens on first render the navigate\n // is useless because we haven't wired up our history listener yet\n if (!activeRef.current) return;\n if (typeof to === \"number\") {\n navigator.go(to);\n return;\n }\n let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === \"path\");\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to handing off to history (but only if we're not in a data router,\n // otherwise it'll prepend the basename inside of the router).\n // If this is a root navigation, then we navigate to the raw basename\n // which allows the basename to have full control over the presence of a\n // trailing slash on root links\n if (dataRouterContext == null && basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);\n }, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]);\n return navigate;\n}\nconst OutletContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the context (if provided) for the child route at this level of the route\n * hierarchy.\n * @see https://reactrouter.com/v6/hooks/use-outlet-context\n */\nfunction useOutletContext() {\n return React.useContext(OutletContext);\n}\n\n/**\n * Returns the element for the child route at this level of the route\n * hierarchy. Used internally by `` to render child routes.\n *\n * @see https://reactrouter.com/v6/hooks/use-outlet\n */\nfunction useOutlet(context) {\n let outlet = React.useContext(RouteContext).outlet;\n if (outlet) {\n return /*#__PURE__*/React.createElement(OutletContext.Provider, {\n value: context\n }, outlet);\n }\n return outlet;\n}\n\n/**\n * Returns an object of key/value pairs of the dynamic params from the current\n * URL that were matched by the route path.\n *\n * @see https://reactrouter.com/v6/hooks/use-params\n */\nfunction useParams() {\n let {\n matches\n } = React.useContext(RouteContext);\n let routeMatch = matches[matches.length - 1];\n return routeMatch ? routeMatch.params : {};\n}\n\n/**\n * Resolves the pathname of the given `to` value against the current location.\n *\n * @see https://reactrouter.com/v6/hooks/use-resolved-path\n */\nfunction useResolvedPath(to, _temp2) {\n let {\n relative\n } = _temp2 === void 0 ? {} : _temp2;\n let {\n future\n } = React.useContext(NavigationContext);\n let {\n matches\n } = React.useContext(RouteContext);\n let {\n pathname: locationPathname\n } = useLocation();\n let routePathnamesJson = JSON.stringify(UNSAFE_getResolveToMatches(matches, future.v7_relativeSplatPath));\n return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === \"path\"), [to, routePathnamesJson, locationPathname, relative]);\n}\n\n/**\n * Returns the element of the route that matched the current location, prepared\n * with the correct context to render the remainder of the route tree. Route\n * elements in the tree must render an `` to render their child route's\n * element.\n *\n * @see https://reactrouter.com/v6/hooks/use-routes\n */\nfunction useRoutes(routes, locationArg) {\n return useRoutesImpl(routes, locationArg);\n}\n\n// Internal implementation with accept optional param for RouterProvider usage\nfunction useRoutesImpl(routes, locationArg, dataRouterState, future) {\n !useInRouterContext() ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n \"useRoutes() may be used only in the context of a component.\") : UNSAFE_invariant(false) : void 0;\n let {\n navigator\n } = React.useContext(NavigationContext);\n let {\n matches: parentMatches\n } = React.useContext(RouteContext);\n let routeMatch = parentMatches[parentMatches.length - 1];\n let parentParams = routeMatch ? routeMatch.params : {};\n let parentPathname = routeMatch ? routeMatch.pathname : \"/\";\n let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : \"/\";\n let parentRoute = routeMatch && routeMatch.route;\n if (process.env.NODE_ENV !== \"production\") {\n // You won't get a warning about 2 different under a \n // without a trailing *, but this is a best-effort warning anyway since we\n // cannot even give the warning unless they land at the parent route.\n //\n // Example:\n //\n // \n // {/* This route path MUST end with /* because otherwise\n // it will never match /blog/post/123 */}\n // } />\n // } />\n // \n //\n // function Blog() {\n // return (\n // \n // } />\n // \n // );\n // }\n let parentPath = parentRoute && parentRoute.path || \"\";\n warningOnce(parentPathname, !parentRoute || parentPath.endsWith(\"*\"), \"You rendered descendant (or called `useRoutes()`) at \" + (\"\\\"\" + parentPathname + \"\\\" (under ) but the \") + \"parent route path has no trailing \\\"*\\\". This means if you navigate \" + \"deeper, the parent won't match anymore and therefore the child \" + \"routes will never render.\\n\\n\" + (\"Please change the parent to .\"));\n }\n let locationFromContext = useLocation();\n let location;\n if (locationArg) {\n var _parsedLocationArg$pa;\n let parsedLocationArg = typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n !(parentPathnameBase === \"/\" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"When overriding the location using `` or `useRoutes(routes, location)`, \" + \"the location pathname must begin with the portion of the URL pathname that was \" + (\"matched by all parent routes. The current pathname base is \\\"\" + parentPathnameBase + \"\\\" \") + (\"but pathname \\\"\" + parsedLocationArg.pathname + \"\\\" was given in the `location` prop.\")) : UNSAFE_invariant(false) : void 0;\n location = parsedLocationArg;\n } else {\n location = locationFromContext;\n }\n let pathname = location.pathname || \"/\";\n let remainingPathname = pathname;\n if (parentPathnameBase !== \"/\") {\n // Determine the remaining pathname by removing the # of URL segments the\n // parentPathnameBase has, instead of removing based on character count.\n // This is because we can't guarantee that incoming/outgoing encodings/\n // decodings will match exactly.\n // We decode paths before matching on a per-segment basis with\n // decodeURIComponent(), but we re-encode pathnames via `new URL()` so they\n // match what `window.location.pathname` would reflect. Those don't 100%\n // align when it comes to encoded URI characters such as % and &.\n //\n // So we may end up with:\n // pathname: \"/descendant/a%25b/match\"\n // parentPathnameBase: \"/descendant/a%b\"\n //\n // And the direct substring removal approach won't work :/\n let parentSegments = parentPathnameBase.replace(/^\\//, \"\").split(\"/\");\n let segments = pathname.replace(/^\\//, \"\").split(\"/\");\n remainingPathname = \"/\" + segments.slice(parentSegments.length).join(\"/\");\n }\n let matches = matchRoutes(routes, {\n pathname: remainingPathname\n });\n if (process.env.NODE_ENV !== \"production\") {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(parentRoute || matches != null, \"No routes matched location \\\"\" + location.pathname + location.search + location.hash + \"\\\" \") : void 0;\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined || matches[matches.length - 1].route.lazy !== undefined, \"Matched leaf route at location \\\"\" + location.pathname + location.search + location.hash + \"\\\" \" + \"does not have an element or Component. This means it will render an with a \" + \"null value by default resulting in an \\\"empty\\\" page.\") : void 0;\n }\n let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {\n params: Object.assign({}, parentParams, match.params),\n pathname: joinPaths([parentPathnameBase,\n // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname]),\n pathnameBase: match.pathnameBase === \"/\" ? parentPathnameBase : joinPaths([parentPathnameBase,\n // Re-encode pathnames that were decoded inside matchRoutes\n navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase])\n })), parentMatches, dataRouterState, future);\n\n // When a user passes in a `locationArg`, the associated routes need to\n // be wrapped in a new `LocationContext.Provider` in order for `useLocation`\n // to use the scoped location instead of the global location.\n if (locationArg && renderedMatches) {\n return /*#__PURE__*/React.createElement(LocationContext.Provider, {\n value: {\n location: _extends({\n pathname: \"/\",\n search: \"\",\n hash: \"\",\n state: null,\n key: \"default\"\n }, location),\n navigationType: Action.Pop\n }\n }, renderedMatches);\n }\n return renderedMatches;\n}\nfunction DefaultErrorComponent() {\n let error = useRouteError();\n let message = isRouteErrorResponse(error) ? error.status + \" \" + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);\n let stack = error instanceof Error ? error.stack : null;\n let lightgrey = \"rgba(200,200,200, 0.5)\";\n let preStyles = {\n padding: \"0.5rem\",\n backgroundColor: lightgrey\n };\n let codeStyles = {\n padding: \"2px 4px\",\n backgroundColor: lightgrey\n };\n let devInfo = null;\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\"Error handled by React Router default ErrorBoundary:\", error);\n devInfo = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"p\", null, \"\\uD83D\\uDCBF Hey developer \\uD83D\\uDC4B\"), /*#__PURE__*/React.createElement(\"p\", null, \"You can provide a way better UX than this when your app throws errors by providing your own \", /*#__PURE__*/React.createElement(\"code\", {\n style: codeStyles\n }, \"ErrorBoundary\"), \" or\", \" \", /*#__PURE__*/React.createElement(\"code\", {\n style: codeStyles\n }, \"errorElement\"), \" prop on your route.\"));\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"h2\", null, \"Unexpected Application Error!\"), /*#__PURE__*/React.createElement(\"h3\", {\n style: {\n fontStyle: \"italic\"\n }\n }, message), stack ? /*#__PURE__*/React.createElement(\"pre\", {\n style: preStyles\n }, stack) : null, devInfo);\n}\nconst defaultErrorElement = /*#__PURE__*/React.createElement(DefaultErrorComponent, null);\nclass RenderErrorBoundary extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n location: props.location,\n revalidation: props.revalidation,\n error: props.error\n };\n }\n static getDerivedStateFromError(error) {\n return {\n error: error\n };\n }\n static getDerivedStateFromProps(props, state) {\n // When we get into an error state, the user will likely click \"back\" to the\n // previous page that didn't have an error. Because this wraps the entire\n // application, that will have no effect--the error page continues to display.\n // This gives us a mechanism to recover from the error when the location changes.\n //\n // Whether we're in an error state or not, we update the location in state\n // so that when we are in an error state, it gets reset when a new location\n // comes in and the user recovers from the error.\n if (state.location !== props.location || state.revalidation !== \"idle\" && props.revalidation === \"idle\") {\n return {\n error: props.error,\n location: props.location,\n revalidation: props.revalidation\n };\n }\n\n // If we're not changing locations, preserve the location but still surface\n // any new errors that may come through. We retain the existing error, we do\n // this because the error provided from the app state may be cleared without\n // the location changing.\n return {\n error: props.error !== undefined ? props.error : state.error,\n location: state.location,\n revalidation: props.revalidation || state.revalidation\n };\n }\n componentDidCatch(error, errorInfo) {\n console.error(\"React Router caught the following error during render\", error, errorInfo);\n }\n render() {\n return this.state.error !== undefined ? /*#__PURE__*/React.createElement(RouteContext.Provider, {\n value: this.props.routeContext\n }, /*#__PURE__*/React.createElement(RouteErrorContext.Provider, {\n value: this.state.error,\n children: this.props.component\n })) : this.props.children;\n }\n}\nfunction RenderedRoute(_ref) {\n let {\n routeContext,\n match,\n children\n } = _ref;\n let dataRouterContext = React.useContext(DataRouterContext);\n\n // Track how deep we got in our render pass to emulate SSR componentDidCatch\n // in a DataStaticRouter\n if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {\n dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;\n }\n return /*#__PURE__*/React.createElement(RouteContext.Provider, {\n value: routeContext\n }, children);\n}\nfunction _renderMatches(matches, parentMatches, dataRouterState, future) {\n var _dataRouterState;\n if (parentMatches === void 0) {\n parentMatches = [];\n }\n if (dataRouterState === void 0) {\n dataRouterState = null;\n }\n if (future === void 0) {\n future = null;\n }\n if (matches == null) {\n var _future;\n if (!dataRouterState) {\n return null;\n }\n if (dataRouterState.errors) {\n // Don't bail if we have data router errors so we can render them in the\n // boundary. Use the pre-matched (or shimmed) matches\n matches = dataRouterState.matches;\n } else if ((_future = future) != null && _future.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {\n // Don't bail if we're initializing with partial hydration and we have\n // router matches. That means we're actively running `patchRoutesOnNavigation`\n // so we should render down the partial matches to the appropriate\n // `HydrateFallback`. We only do this if `parentMatches` is empty so it\n // only impacts the root matches for `RouterProvider` and no descendant\n // ``\n matches = dataRouterState.matches;\n } else {\n return null;\n }\n }\n let renderedMatches = matches;\n\n // If we have data errors, trim matches to the highest error boundary\n let errors = (_dataRouterState = dataRouterState) == null ? void 0 : _dataRouterState.errors;\n if (errors != null) {\n let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]) !== undefined);\n !(errorIndex >= 0) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"Could not find a matching route for errors on route IDs: \" + Object.keys(errors).join(\",\")) : UNSAFE_invariant(false) : void 0;\n renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));\n }\n\n // If we're in a partial hydration mode, detect if we need to render down to\n // a given HydrateFallback while we load the rest of the hydration data\n let renderFallback = false;\n let fallbackIndex = -1;\n if (dataRouterState && future && future.v7_partialHydration) {\n for (let i = 0; i < renderedMatches.length; i++) {\n let match = renderedMatches[i];\n // Track the deepest fallback up until the first route without data\n if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {\n fallbackIndex = i;\n }\n if (match.route.id) {\n let {\n loaderData,\n errors\n } = dataRouterState;\n let needsToRunLoader = match.route.loader && loaderData[match.route.id] === undefined && (!errors || errors[match.route.id] === undefined);\n if (match.route.lazy || needsToRunLoader) {\n // We found the first route that's not ready to render (waiting on\n // lazy, or has a loader that hasn't run yet). Flag that we need to\n // render a fallback and render up until the appropriate fallback\n renderFallback = true;\n if (fallbackIndex >= 0) {\n renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);\n } else {\n renderedMatches = [renderedMatches[0]];\n }\n break;\n }\n }\n }\n }\n return renderedMatches.reduceRight((outlet, match, index) => {\n // Only data routers handle errors/fallbacks\n let error;\n let shouldRenderHydrateFallback = false;\n let errorElement = null;\n let hydrateFallbackElement = null;\n if (dataRouterState) {\n error = errors && match.route.id ? errors[match.route.id] : undefined;\n errorElement = match.route.errorElement || defaultErrorElement;\n if (renderFallback) {\n if (fallbackIndex < 0 && index === 0) {\n warningOnce(\"route-fallback\", false, \"No `HydrateFallback` element provided to render during initial hydration\");\n shouldRenderHydrateFallback = true;\n hydrateFallbackElement = null;\n } else if (fallbackIndex === index) {\n shouldRenderHydrateFallback = true;\n hydrateFallbackElement = match.route.hydrateFallbackElement || null;\n }\n }\n }\n let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));\n let getChildren = () => {\n let children;\n if (error) {\n children = errorElement;\n } else if (shouldRenderHydrateFallback) {\n children = hydrateFallbackElement;\n } else if (match.route.Component) {\n // Note: This is a de-optimized path since React won't re-use the\n // ReactElement since it's identity changes with each new\n // React.createElement call. We keep this so folks can use\n // `` in `` but generally `Component`\n // usage is only advised in `RouterProvider` when we can convert it to\n // `element` ahead of time.\n children = /*#__PURE__*/React.createElement(match.route.Component, null);\n } else if (match.route.element) {\n children = match.route.element;\n } else {\n children = outlet;\n }\n return /*#__PURE__*/React.createElement(RenderedRoute, {\n match: match,\n routeContext: {\n outlet,\n matches,\n isDataRoute: dataRouterState != null\n },\n children: children\n });\n };\n // Only wrap in an error boundary within data router usages when we have an\n // ErrorBoundary/errorElement on this route. Otherwise let it bubble up to\n // an ancestor ErrorBoundary/errorElement\n return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /*#__PURE__*/React.createElement(RenderErrorBoundary, {\n location: dataRouterState.location,\n revalidation: dataRouterState.revalidation,\n component: errorElement,\n error: error,\n children: getChildren(),\n routeContext: {\n outlet: null,\n matches,\n isDataRoute: true\n }\n }) : getChildren();\n }, null);\n}\nvar DataRouterHook = /*#__PURE__*/function (DataRouterHook) {\n DataRouterHook[\"UseBlocker\"] = \"useBlocker\";\n DataRouterHook[\"UseRevalidator\"] = \"useRevalidator\";\n DataRouterHook[\"UseNavigateStable\"] = \"useNavigate\";\n return DataRouterHook;\n}(DataRouterHook || {});\nvar DataRouterStateHook = /*#__PURE__*/function (DataRouterStateHook) {\n DataRouterStateHook[\"UseBlocker\"] = \"useBlocker\";\n DataRouterStateHook[\"UseLoaderData\"] = \"useLoaderData\";\n DataRouterStateHook[\"UseActionData\"] = \"useActionData\";\n DataRouterStateHook[\"UseRouteError\"] = \"useRouteError\";\n DataRouterStateHook[\"UseNavigation\"] = \"useNavigation\";\n DataRouterStateHook[\"UseRouteLoaderData\"] = \"useRouteLoaderData\";\n DataRouterStateHook[\"UseMatches\"] = \"useMatches\";\n DataRouterStateHook[\"UseRevalidator\"] = \"useRevalidator\";\n DataRouterStateHook[\"UseNavigateStable\"] = \"useNavigate\";\n DataRouterStateHook[\"UseRouteId\"] = \"useRouteId\";\n return DataRouterStateHook;\n}(DataRouterStateHook || {});\nfunction getDataRouterConsoleError(hookName) {\n return hookName + \" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.\";\n}\nfunction useDataRouterContext(hookName) {\n let ctx = React.useContext(DataRouterContext);\n !ctx ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return ctx;\n}\nfunction useDataRouterState(hookName) {\n let state = React.useContext(DataRouterStateContext);\n !state ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return state;\n}\nfunction useRouteContext(hookName) {\n let route = React.useContext(RouteContext);\n !route ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return route;\n}\n\n// Internal version with hookName-aware debugging\nfunction useCurrentRouteId(hookName) {\n let route = useRouteContext(hookName);\n let thisRoute = route.matches[route.matches.length - 1];\n !thisRoute.route.id ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, hookName + \" can only be used on routes that contain a unique \\\"id\\\"\") : UNSAFE_invariant(false) : void 0;\n return thisRoute.route.id;\n}\n\n/**\n * Returns the ID for the nearest contextual route\n */\nfunction useRouteId() {\n return useCurrentRouteId(DataRouterStateHook.UseRouteId);\n}\n\n/**\n * Returns the current navigation, defaulting to an \"idle\" navigation when\n * no navigation is in progress\n */\nfunction useNavigation() {\n let state = useDataRouterState(DataRouterStateHook.UseNavigation);\n return state.navigation;\n}\n\n/**\n * Returns a revalidate function for manually triggering revalidation, as well\n * as the current state of any manual revalidations\n */\nfunction useRevalidator() {\n let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);\n let state = useDataRouterState(DataRouterStateHook.UseRevalidator);\n return React.useMemo(() => ({\n revalidate: dataRouterContext.router.revalidate,\n state: state.revalidation\n }), [dataRouterContext.router.revalidate, state.revalidation]);\n}\n\n/**\n * Returns the active route matches, useful for accessing loaderData for\n * parent/child routes or the route \"handle\" property\n */\nfunction useMatches() {\n let {\n matches,\n loaderData\n } = useDataRouterState(DataRouterStateHook.UseMatches);\n return React.useMemo(() => matches.map(m => UNSAFE_convertRouteMatchToUiMatch(m, loaderData)), [matches, loaderData]);\n}\n\n/**\n * Returns the loader data for the nearest ancestor Route loader\n */\nfunction useLoaderData() {\n let state = useDataRouterState(DataRouterStateHook.UseLoaderData);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n if (state.errors && state.errors[routeId] != null) {\n console.error(\"You cannot `useLoaderData` in an errorElement (routeId: \" + routeId + \")\");\n return undefined;\n }\n return state.loaderData[routeId];\n}\n\n/**\n * Returns the loaderData for the given routeId\n */\nfunction useRouteLoaderData(routeId) {\n let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);\n return state.loaderData[routeId];\n}\n\n/**\n * Returns the action data for the nearest ancestor Route action\n */\nfunction useActionData() {\n let state = useDataRouterState(DataRouterStateHook.UseActionData);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n return state.actionData ? state.actionData[routeId] : undefined;\n}\n\n/**\n * Returns the nearest ancestor Route error, which could be a loader/action\n * error or a render error. This is intended to be called from your\n * ErrorBoundary/errorElement to display a proper error message.\n */\nfunction useRouteError() {\n var _state$errors;\n let error = React.useContext(RouteErrorContext);\n let state = useDataRouterState(DataRouterStateHook.UseRouteError);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);\n\n // If this was a render error, we put it in a RouteError context inside\n // of RenderErrorBoundary\n if (error !== undefined) {\n return error;\n }\n\n // Otherwise look for errors from our data router state\n return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];\n}\n\n/**\n * Returns the happy-path data from the nearest ancestor `` value\n */\nfunction useAsyncValue() {\n let value = React.useContext(AwaitContext);\n return value == null ? void 0 : value._data;\n}\n\n/**\n * Returns the error from the nearest ancestor `` value\n */\nfunction useAsyncError() {\n let value = React.useContext(AwaitContext);\n return value == null ? void 0 : value._error;\n}\nlet blockerId = 0;\n\n/**\n * Allow the application to block navigations within the SPA and present the\n * user a confirmation dialog to confirm the navigation. Mostly used to avoid\n * using half-filled form data. This does not handle hard-reloads or\n * cross-origin navigations.\n */\nfunction useBlocker(shouldBlock) {\n let {\n router,\n basename\n } = useDataRouterContext(DataRouterHook.UseBlocker);\n let state = useDataRouterState(DataRouterStateHook.UseBlocker);\n let [blockerKey, setBlockerKey] = React.useState(\"\");\n let blockerFunction = React.useCallback(arg => {\n if (typeof shouldBlock !== \"function\") {\n return !!shouldBlock;\n }\n if (basename === \"/\") {\n return shouldBlock(arg);\n }\n\n // If they provided us a function and we've got an active basename, strip\n // it from the locations we expose to the user to match the behavior of\n // useLocation\n let {\n currentLocation,\n nextLocation,\n historyAction\n } = arg;\n return shouldBlock({\n currentLocation: _extends({}, currentLocation, {\n pathname: stripBasename(currentLocation.pathname, basename) || currentLocation.pathname\n }),\n nextLocation: _extends({}, nextLocation, {\n pathname: stripBasename(nextLocation.pathname, basename) || nextLocation.pathname\n }),\n historyAction\n });\n }, [basename, shouldBlock]);\n\n // This effect is in charge of blocker key assignment and deletion (which is\n // tightly coupled to the key)\n React.useEffect(() => {\n let key = String(++blockerId);\n setBlockerKey(key);\n return () => router.deleteBlocker(key);\n }, [router]);\n\n // This effect handles assigning the blockerFunction. This is to handle\n // unstable blocker function identities, and happens only after the prior\n // effect so we don't get an orphaned blockerFunction in the router with a\n // key of \"\". Until then we just have the IDLE_BLOCKER.\n React.useEffect(() => {\n if (blockerKey !== \"\") {\n router.getBlocker(blockerKey, blockerFunction);\n }\n }, [router, blockerKey, blockerFunction]);\n\n // Prefer the blocker from `state` not `router.state` since DataRouterContext\n // is memoized so this ensures we update on blocker state updates\n return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : IDLE_BLOCKER;\n}\n\n/**\n * Stable version of useNavigate that is used when we are in the context of\n * a RouterProvider.\n */\nfunction useNavigateStable() {\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseNavigateStable);\n let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);\n let activeRef = React.useRef(false);\n useIsomorphicLayoutEffect(() => {\n activeRef.current = true;\n });\n let navigate = React.useCallback(function (to, options) {\n if (options === void 0) {\n options = {};\n }\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(activeRef.current, navigateEffectWarning) : void 0;\n\n // Short circuit here since if this happens on first render the navigate\n // is useless because we haven't wired up our router subscriber yet\n if (!activeRef.current) return;\n if (typeof to === \"number\") {\n router.navigate(to);\n } else {\n router.navigate(to, _extends({\n fromRouteId: id\n }, options));\n }\n }, [router, id]);\n return navigate;\n}\nconst alreadyWarned$1 = {};\nfunction warningOnce(key, cond, message) {\n if (!cond && !alreadyWarned$1[key]) {\n alreadyWarned$1[key] = true;\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, message) : void 0;\n }\n}\n\nconst alreadyWarned = {};\nfunction warnOnce(key, message) {\n if (process.env.NODE_ENV !== \"production\" && !alreadyWarned[message]) {\n alreadyWarned[message] = true;\n console.warn(message);\n }\n}\nconst logDeprecation = (flag, msg, link) => warnOnce(flag, \"\\u26A0\\uFE0F React Router Future Flag Warning: \" + msg + \". \" + (\"You can use the `\" + flag + \"` future flag to opt-in early. \") + (\"For more information, see \" + link + \".\"));\nfunction logV6DeprecationWarnings(renderFuture, routerFuture) {\n if ((renderFuture == null ? void 0 : renderFuture.v7_startTransition) === undefined) {\n logDeprecation(\"v7_startTransition\", \"React Router will begin wrapping state updates in `React.startTransition` in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_starttransition\");\n }\n if ((renderFuture == null ? void 0 : renderFuture.v7_relativeSplatPath) === undefined && (!routerFuture || routerFuture.v7_relativeSplatPath === undefined)) {\n logDeprecation(\"v7_relativeSplatPath\", \"Relative route resolution within Splat routes is changing in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath\");\n }\n if (routerFuture) {\n if (routerFuture.v7_fetcherPersist === undefined) {\n logDeprecation(\"v7_fetcherPersist\", \"The persistence behavior of fetchers is changing in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist\");\n }\n if (routerFuture.v7_normalizeFormMethod === undefined) {\n logDeprecation(\"v7_normalizeFormMethod\", \"Casing of `formMethod` fields is being normalized to uppercase in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod\");\n }\n if (routerFuture.v7_partialHydration === undefined) {\n logDeprecation(\"v7_partialHydration\", \"`RouterProvider` hydration behavior is changing in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_partialhydration\");\n }\n if (routerFuture.v7_skipActionErrorRevalidation === undefined) {\n logDeprecation(\"v7_skipActionErrorRevalidation\", \"The revalidation behavior after 4xx/5xx `action` responses is changing in v7\", \"https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation\");\n }\n }\n}\n\n/**\n Webpack + React 17 fails to compile on any of the following because webpack\n complains that `startTransition` doesn't exist in `React`:\n * import { startTransition } from \"react\"\n * import * as React from from \"react\";\n \"startTransition\" in React ? React.startTransition(() => setState()) : setState()\n * import * as React from from \"react\";\n \"startTransition\" in React ? React[\"startTransition\"](() => setState()) : setState()\n\n Moving it to a constant such as the following solves the Webpack/React 17 issue:\n * import * as React from from \"react\";\n const START_TRANSITION = \"startTransition\";\n START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState()\n\n However, that introduces webpack/terser minification issues in production builds\n in React 18 where minification/obfuscation ends up removing the call of\n React.startTransition entirely from the first half of the ternary. Grabbing\n this exported reference once up front resolves that issue.\n\n See https://github.com/remix-run/react-router/issues/10579\n*/\nconst START_TRANSITION = \"startTransition\";\nconst startTransitionImpl = React[START_TRANSITION];\n\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nfunction RouterProvider(_ref) {\n let {\n fallbackElement,\n router,\n future\n } = _ref;\n let [state, setStateImpl] = React.useState(router.state);\n let {\n v7_startTransition\n } = future || {};\n let setState = React.useCallback(newState => {\n if (v7_startTransition && startTransitionImpl) {\n startTransitionImpl(() => setStateImpl(newState));\n } else {\n setStateImpl(newState);\n }\n }, [setStateImpl, v7_startTransition]);\n\n // Need to use a layout effect here so we are subscribed early enough to\n // pick up on any render-driven redirects/navigations (useEffect/)\n React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);\n React.useEffect(() => {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(fallbackElement == null || !router.future.v7_partialHydration, \"`` is deprecated when using \" + \"`v7_partialHydration`, use a `HydrateFallback` component instead\") : void 0;\n // Only log this once on initial mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let navigator = React.useMemo(() => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: n => router.navigate(n),\n push: (to, state, opts) => router.navigate(to, {\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n }),\n replace: (to, state, opts) => router.navigate(to, {\n replace: true,\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n })\n };\n }, [router]);\n let basename = router.basename || \"/\";\n let dataRouterContext = React.useMemo(() => ({\n router,\n navigator,\n static: false,\n basename\n }), [router, navigator, basename]);\n React.useEffect(() => logV6DeprecationWarnings(future, router.future), [router, future]);\n\n // The fragment and {null} here are important! We need them to keep React 18's\n // useId happy when we are server-rendering since we may have a + + + +
+ + diff --git a/frontend/package-lock.json b/frontend/package-lock.json new file mode 100644 index 0000000..737c65c --- /dev/null +++ b/frontend/package-lock.json @@ -0,0 +1,3467 @@ +{ + "name": "neurosploit-frontend", + "version": "3.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "neurosploit-frontend", + "version": "3.0.0", + "dependencies": { + "axios": "^1.6.0", + "clsx": "^2.1.0", + "lucide-react": "^0.303.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-router-dom": "^6.21.0", + "recharts": "^2.10.0", + "socket.io-client": "^4.6.0", + "tailwind-merge": "^2.2.0", + "zustand": "^4.4.0" + }, + "devDependencies": { + "@types/react": "^18.2.0", + "@types/react-dom": "^18.2.0", + "@vitejs/plugin-react": "^4.2.0", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.32", + "tailwindcss": "^3.4.0", + "typescript": "^5.3.0", + "vite": "^5.0.0" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", + "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", + "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz", + "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz", + "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz", + "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@remix-run/router": { + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.2.tgz", + "integrity": "sha512-Ic6m2U/rMjTkhERIa/0ZtXJP17QUi2CbWE7cqx4J58M8aA3QTfW+2UlQ4psvTX9IO1RfNVhK3pcpdjej7L+t2w==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz", + "integrity": "sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz", + "integrity": "sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz", + "integrity": "sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz", + "integrity": "sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz", + "integrity": "sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz", + "integrity": "sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz", + "integrity": "sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz", + "integrity": "sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz", + "integrity": "sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz", + "integrity": "sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz", + "integrity": "sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz", + "integrity": "sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz", + "integrity": "sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz", + "integrity": "sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz", + "integrity": "sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz", + "integrity": "sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz", + "integrity": "sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz", + "integrity": "sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz", + "integrity": "sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz", + "integrity": "sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz", + "integrity": "sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz", + "integrity": "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz", + "integrity": "sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz", + "integrity": "sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz", + "integrity": "sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", + "license": "MIT" + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/d3-array": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", + "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-shape": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz", + "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.3.28", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.28.tgz", + "integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/autoprefixer": { + "version": "10.4.24", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.24.tgz", + "integrity": "sha512-uHZg7N9ULTVbutaIsDRoUkoS8/h3bdsmVJYZ5l3wv8Cp/6UIIoRDm90hZ+BwxUj/hGBEzLxdHNSKuFpn8WOyZw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.28.1", + "caniuse-lite": "^1.0.30001766", + "fraction.js": "^5.3.4", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/axios": { + "version": "1.13.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.5.tgz", + "integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.19", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.19.tgz", + "integrity": "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001769", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz", + "integrity": "sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", + "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js-light": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", + "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", + "license": "MIT" + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.286", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.286.tgz", + "integrity": "sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==", + "dev": true, + "license": "ISC" + }, + "node_modules/engine.io-client": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.4.tgz", + "integrity": "sha512-+kjUJnZGwzewFDw951CDWcwj35vMNf2fcj7xQWOctq1F2i1jkDdVvdFG9kM/BEChymCH36KgjnW0NsL58JYRxw==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.4.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.18.3", + "xmlhttprequest-ssl": "~2.1.1" + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, + "node_modules/fast-equals": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.4.0.tgz", + "integrity": "sha512-jt2DW/aNFNwke7AUd+Z+e6pz39KO5rzdbbFCg2sGafS4mk13MI7Z8O5z9cADNn5lhGODIgLwug6TZO2ctf7kcw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash": { + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lucide-react": { + "version": "0.303.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.303.0.tgz", + "integrity": "sha512-B0B9T3dLEFBYPCUlnUS1mvAhW1craSbF9HO+JfBjAtpFUJ7gMIqmEwNSclikY3RiN2OnCkj/V1ReAQpaHae8Bg==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz", + "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-router": { + "version": "6.30.3", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.3.tgz", + "integrity": "sha512-XRnlbKMTmktBkjCLE8/XcZFlnHvr2Ltdr1eJX4idL55/9BbORzyZEaIkBFDhFGCEWBBItsVrDxwx3gnisMitdw==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.23.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8" + } + }, + "node_modules/react-router-dom": { + "version": "6.30.3", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.3.tgz", + "integrity": "sha512-pxPcv1AczD4vso7G4Z3TKcvlxK7g7TNt3/FNGMhfqyntocvYKj+GCatfigGDjbLozC4baguJ0ReCigoDJXb0ag==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.23.2", + "react-router": "6.30.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, + "node_modules/react-smooth": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-4.0.4.tgz", + "integrity": "sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q==", + "license": "MIT", + "dependencies": { + "fast-equals": "^5.0.1", + "prop-types": "^15.8.1", + "react-transition-group": "^4.4.5" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/recharts": { + "version": "2.15.4", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.15.4.tgz", + "integrity": "sha512-UT/q6fwS3c1dHbXv2uFgYJ9BMFHu3fwnd7AYZaEQhXuYQ4hgsxLvsUXzGdKeZrW5xopzDCvuA2N41WJ88I7zIw==", + "license": "MIT", + "dependencies": { + "clsx": "^2.0.0", + "eventemitter3": "^4.0.1", + "lodash": "^4.17.21", + "react-is": "^18.3.1", + "react-smooth": "^4.0.4", + "recharts-scale": "^0.4.4", + "tiny-invariant": "^1.3.1", + "victory-vendor": "^36.6.8" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/recharts-scale": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/recharts-scale/-/recharts-scale-0.4.5.tgz", + "integrity": "sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==", + "license": "MIT", + "dependencies": { + "decimal.js-light": "^2.4.1" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.57.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz", + "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.57.1", + "@rollup/rollup-android-arm64": "4.57.1", + "@rollup/rollup-darwin-arm64": "4.57.1", + "@rollup/rollup-darwin-x64": "4.57.1", + "@rollup/rollup-freebsd-arm64": "4.57.1", + "@rollup/rollup-freebsd-x64": "4.57.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.57.1", + "@rollup/rollup-linux-arm-musleabihf": "4.57.1", + "@rollup/rollup-linux-arm64-gnu": "4.57.1", + "@rollup/rollup-linux-arm64-musl": "4.57.1", + "@rollup/rollup-linux-loong64-gnu": "4.57.1", + "@rollup/rollup-linux-loong64-musl": "4.57.1", + "@rollup/rollup-linux-ppc64-gnu": "4.57.1", + "@rollup/rollup-linux-ppc64-musl": "4.57.1", + "@rollup/rollup-linux-riscv64-gnu": "4.57.1", + "@rollup/rollup-linux-riscv64-musl": "4.57.1", + "@rollup/rollup-linux-s390x-gnu": "4.57.1", + "@rollup/rollup-linux-x64-gnu": "4.57.1", + "@rollup/rollup-linux-x64-musl": "4.57.1", + "@rollup/rollup-openbsd-x64": "4.57.1", + "@rollup/rollup-openharmony-arm64": "4.57.1", + "@rollup/rollup-win32-arm64-msvc": "4.57.1", + "@rollup/rollup-win32-ia32-msvc": "4.57.1", + "@rollup/rollup-win32-x64-gnu": "4.57.1", + "@rollup/rollup-win32-x64-msvc": "4.57.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/socket.io-client": { + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.3.tgz", + "integrity": "sha512-uP0bpjWrjQmUt5DTHq9RuoCBdFJF10cdX9X+a368j/Ft0wmaVgxlrjvK3kjvgCODOMMOz9lcaRzxmso0bTWZ/g==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.4.1", + "engine.io-client": "~6.6.1", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.5.tgz", + "integrity": "sha512-bPMmpy/5WWKHea5Y/jYAP6k74A+hvmRCQaJuJB6I/ML5JZq/KfNieUVo/3Mh7SAqn7TyFdIo6wqYHInG1MU1bQ==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.4.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tailwind-merge": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.6.1.tgz", + "integrity": "sha512-Oo6tHdpZsGpkKG88HJ8RR1rg/RdnEkQEfMoEk2x1XRI3F1AxeU+ijRXpiVUF4UbLfcxxRGw6TbUINKYdWVsQTQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.19", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz", + "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.6.0", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.7", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", + "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/victory-vendor": { + "version": "36.9.2", + "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz", + "integrity": "sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==", + "license": "MIT AND ISC", + "dependencies": { + "@types/d3-array": "^3.0.3", + "@types/d3-ease": "^3.0.0", + "@types/d3-interpolate": "^3.0.1", + "@types/d3-scale": "^4.0.2", + "@types/d3-shape": "^3.1.0", + "@types/d3-time": "^3.0.0", + "@types/d3-timer": "^3.0.0", + "d3-array": "^3.1.6", + "d3-ease": "^3.0.1", + "d3-interpolate": "^3.0.1", + "d3-scale": "^4.0.2", + "d3-shape": "^3.1.0", + "d3-time": "^3.0.0", + "d3-timer": "^3.0.1" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xmlhttprequest-ssl": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.1.2.tgz", + "integrity": "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/zustand": { + "version": "4.5.7", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", + "integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==", + "license": "MIT", + "dependencies": { + "use-sync-external-store": "^1.2.2" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "@types/react": ">=16.8", + "immer": ">=9.0.6", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } + } + } +} diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 988f9a0..12f2f1f 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -9,17 +9,27 @@ import RealtimeTaskPage from './pages/RealtimeTaskPage' import ReportsPage from './pages/ReportsPage' import ReportViewPage from './pages/ReportViewPage' import SettingsPage from './pages/SettingsPage' +import SchedulerPage from './pages/SchedulerPage' +import AutoPentestPage from './pages/AutoPentestPage' +import VulnLabPage from './pages/VulnLabPage' +import TerminalAgentPage from './pages/TerminalAgentPage' +import SandboxDashboardPage from './pages/SandboxDashboardPage' function App() { return ( } /> + } /> + } /> + } /> } /> } /> } /> } /> } /> + } /> + } /> } /> } /> } /> diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index 7154bac..4dfffb4 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -7,14 +7,24 @@ import { Settings, Activity, Shield, - Zap + Zap, + Clock, + Rocket, + FlaskConical, + Terminal, + Container } from 'lucide-react' const navItems = [ { path: '/', icon: Home, label: 'Dashboard' }, + { path: '/auto', icon: Rocket, label: 'Auto Pentest' }, + { path: '/vuln-lab', icon: FlaskConical, label: 'Vuln Lab' }, + { path: '/terminal', icon: Terminal, label: 'Terminal Agent' }, + { path: '/sandboxes', icon: Container, label: 'Sandboxes' }, { path: '/scan/new', icon: Bot, label: 'AI Agent' }, { path: '/realtime', icon: Zap, label: 'Real-time Task' }, { path: '/tasks', icon: BookOpen, label: 'Task Library' }, + { path: '/scheduler', icon: Clock, label: 'Scheduler' }, { path: '/reports', icon: FileText, label: 'Reports' }, { path: '/settings', icon: Settings, label: 'Settings' }, ] diff --git a/frontend/src/pages/AgentStatusPage.tsx b/frontend/src/pages/AgentStatusPage.tsx index f8aa2e2..87c1846 100644 --- a/frontend/src/pages/AgentStatusPage.tsx +++ b/frontend/src/pages/AgentStatusPage.tsx @@ -3,7 +3,8 @@ import { useParams, useNavigate } from 'react-router-dom' import { Bot, RefreshCw, FileText, CheckCircle, XCircle, Clock, Target, Shield, ChevronDown, ChevronRight, ExternalLink, - Copy, Download, StopCircle, Terminal, Brain, Send, Code, Globe, AlertTriangle + Copy, Download, StopCircle, Terminal, Brain, Send, Code, Globe, AlertTriangle, + SkipForward, MinusCircle, Pause, Play } from 'lucide-react' import Card from '../components/common/Card' import Button from '../components/common/Button' @@ -77,6 +78,11 @@ export default function AgentStatusPage() { const [isSubmittingPrompt, setIsSubmittingPrompt] = useState(false) const [promptSentMessage, setPromptSentMessage] = useState(null) + // Phase skip state + const [skipConfirm, setSkipConfirm] = useState(null) + const [isSkipping, setIsSkipping] = useState(false) + const [skippedPhases, setSkippedPhases] = useState>(new Set()) + // Separate logs by source const scriptLogs = logs.filter(l => l.source === 'script' || (!l.source && !l.message.includes('[LLM]') && !l.message.includes('[AI]'))) const llmLogs = logs.filter(l => l.source === 'llm' || l.message.includes('[LLM]') || l.message.includes('[AI]')) @@ -107,12 +113,12 @@ export default function AgentStatusPage() { fetchStatus() - // Poll every 2 seconds while running + // Poll every 5 seconds while running or paused const interval = setInterval(() => { - if (status?.status === 'running') { + if (status?.status === 'running' || status?.status === 'paused') { fetchStatus() } - }, 2000) + }, 5000) return () => clearInterval(interval) }, [agentId, status?.status]) @@ -466,6 +472,28 @@ export default function AgentStatusPage() { } } + const handlePauseScan = async () => { + if (!agentId) return + try { + await agentApi.pause(agentId) + const statusData = await agentApi.getStatus(agentId) + setStatus(statusData) + } catch (err: any) { + console.error('Failed to pause agent:', err) + } + } + + const handleResumeScan = async () => { + if (!agentId) return + try { + await agentApi.resume(agentId) + const statusData = await agentApi.getStatus(agentId) + setStatus(statusData) + } catch (err: any) { + console.error('Failed to resume agent:', err) + } + } + const handleSubmitPrompt = async () => { if (!customPrompt.trim() || !agentId) return setIsSubmittingPrompt(true) @@ -496,6 +524,37 @@ export default function AgentStatusPage() { } } + const handleSkipToPhase = async (targetPhase: string) => { + if (!agentId) return + setIsSkipping(true) + try { + await agentApi.skipToPhase(agentId, targetPhase) + // Mark intermediate phases as skipped + const currentIndex = status ? getPhaseIndex(status.phase) : 0 + const targetIndex = SCAN_PHASES.findIndex(p => p.key === targetPhase) + const newSkipped = new Set(skippedPhases) + for (let i = currentIndex; i < targetIndex; i++) { + newSkipped.add(SCAN_PHASES[i].key) + } + setSkippedPhases(newSkipped) + setSkipConfirm(null) + } catch (err: any) { + console.error('Failed to skip phase:', err) + } finally { + setIsSkipping(false) + } + } + + // Track skipped phases from status updates + useEffect(() => { + if (!status) return + const phase = status.phase.toLowerCase() + if (phase.includes('_skipped')) { + const skippedKey = phase.replace('_skipped', '') + setSkippedPhases(prev => new Set(prev).add(skippedKey)) + } + }, [status?.phase]) + const copyToClipboard = (text: string) => { navigator.clipboard.writeText(text) } @@ -790,7 +849,8 @@ export default function AgentStatusPage() { {PHASE_ICONS[status.status]} @@ -802,10 +862,28 @@ export default function AgentStatusPage() {
{status.status === 'running' && ( - + <> + + + + )} + {status.status === 'paused' && ( + <> + + + )} {status.scan_id && ( + +
+ + )} ) })} diff --git a/frontend/src/pages/AutoPentestPage.tsx b/frontend/src/pages/AutoPentestPage.tsx new file mode 100644 index 0000000..d45f0b5 --- /dev/null +++ b/frontend/src/pages/AutoPentestPage.tsx @@ -0,0 +1,929 @@ +import { useState, useEffect, useRef, useCallback } from 'react' +import { useNavigate } from 'react-router-dom' +import { + Rocket, Shield, ChevronDown, ChevronUp, Loader2, + AlertTriangle, CheckCircle2, Globe, Lock, Bug, MessageSquare, + FileText, ScrollText, X, ExternalLink, Download, Sparkles, Trash2, + Brain, Wrench, Layers +} from 'lucide-react' +import { agentApi, reportsApi } from '../services/api' +import type { AgentStatus, AgentFinding, AgentLog } from '../types' + +const PHASES = [ + { key: 'parallel', label: 'Parallel Streams', icon: Layers, range: [0, 50] as const }, + { key: 'deep', label: 'Deep Analysis', icon: Brain, range: [50, 75] as const }, + { key: 'final', label: 'Finalization', icon: Shield, range: [75, 100] as const }, +] + +const STREAMS = [ + { key: 'recon', label: 'Recon', icon: Globe, color: 'blue', activeUntil: 25 }, + { key: 'junior', label: 'Junior AI', icon: Brain, color: 'purple', activeUntil: 35 }, + { key: 'tools', label: 'Tools', icon: Wrench, color: 'orange', activeUntil: 50 }, +] as const + +const STREAM_COLORS: Record = { + blue: { bg: 'bg-blue-500/20', text: 'text-blue-400', border: 'border-blue-500/40', pulse: 'bg-blue-400' }, + purple: { bg: 'bg-purple-500/20', text: 'text-purple-400', border: 'border-purple-500/40', pulse: 'bg-purple-400' }, + orange: { bg: 'bg-orange-500/20', text: 'text-orange-400', border: 'border-orange-500/40', pulse: 'bg-orange-400' }, +} + +function phaseFromProgress(progress: number): number { + if (progress < 50) return 0 + if (progress < 75) return 1 + return 2 +} + +function StreamBadge({ stream, progress, isRunning }: { + stream: typeof STREAMS[number] + progress: number + isRunning: boolean +}) { + const active = isRunning && progress < stream.activeUntil + const done = progress >= stream.activeUntil + const colors = STREAM_COLORS[stream.color] + const Icon = stream.icon + + return ( +
+ {active && ( + + + + + )} + {done && } + {!active && !done && } + {stream.label} +
+ ) +} + +function logMessageColor(message: string): string { + if (message.startsWith('[STREAM 1]')) return 'text-blue-400' + if (message.startsWith('[STREAM 2]')) return 'text-purple-400' + if (message.startsWith('[STREAM 3]')) return 'text-orange-400' + if (message.startsWith('[TOOL]')) return 'text-orange-300' + if (message.startsWith('[DEEP]')) return 'text-cyan-400' + if (message.startsWith('[FINAL]')) return 'text-green-400' + return '' +} + +const SEVERITY_COLORS: Record = { + critical: 'bg-red-500', + high: 'bg-orange-500', + medium: 'bg-yellow-500', + low: 'bg-blue-500', + info: 'bg-gray-500', +} + +const SEVERITY_BORDER: Record = { + critical: 'border-red-500/40', + high: 'border-orange-500/40', + medium: 'border-yellow-500/40', + low: 'border-blue-500/40', + info: 'border-gray-500/40', +} + +// Resolve a confidence score from the various possible sources on a finding. +function getConfidenceDisplay(finding: { confidence_score?: number; confidence?: string }): { score: number; color: string; label: string } | null { + let score: number | null = null + + if (typeof finding.confidence_score === 'number') { + score = finding.confidence_score + } else if (finding.confidence) { + const parsed = Number(finding.confidence) + if (!isNaN(parsed)) { + score = parsed + } else { + const map: Record = { high: 90, medium: 60, low: 30 } + score = map[finding.confidence.toLowerCase()] ?? null + } + } + + if (score === null) return null + + const color = score >= 90 ? 'green' : score >= 60 ? 'yellow' : 'red' + const label = score >= 90 ? 'Confirmed' : score >= 60 ? 'Likely' : 'Low' + return { score, color, label } +} + +const CONFIDENCE_STYLES: Record = { + green: 'bg-green-500/15 text-green-400 border-green-500/30', + yellow: 'bg-yellow-500/15 text-yellow-400 border-yellow-500/30', + red: 'bg-red-500/15 text-red-400 border-red-500/30', +} + +const SESSION_KEY = 'neurosploit_autopentest_session' + +interface SavedSession { + agentId: string + target: string + startedAt: string +} + +export default function AutoPentestPage() { + const navigate = useNavigate() + const [target, setTarget] = useState('') + const [multiTarget, setMultiTarget] = useState(false) + const [targets, setTargets] = useState('') + const [subdomainDiscovery, setSubdomainDiscovery] = useState(false) + const [showAuth, setShowAuth] = useState(false) + const [authType, setAuthType] = useState('') + const [authValue, setAuthValue] = useState('') + const [showPrompt, setShowPrompt] = useState(false) + const [customPrompt, setCustomPrompt] = useState('') + + // Running state + const [isRunning, setIsRunning] = useState(false) + const [agentId, setAgentId] = useState(null) + const [status, setStatus] = useState(null) + const [error, setError] = useState(null) + + // Live findings & logs + const [showFindings, setShowFindings] = useState(true) + const [showLogs, setShowLogs] = useState(false) + const [logs, setLogs] = useState([]) + const [expandedFinding, setExpandedFinding] = useState(null) + + // Report generation + const [generatingReport, setGeneratingReport] = useState(false) + const [reportId, setReportId] = useState(null) + + const pollRef = useRef | null>(null) + const logsEndRef = useRef(null) + + // Restore session on mount + useEffect(() => { + try { + const saved = localStorage.getItem(SESSION_KEY) + if (saved) { + const session: SavedSession = JSON.parse(saved) + setAgentId(session.agentId) + setTarget(session.target) + setIsRunning(true) + } + } catch { + // ignore parse errors + } + }, []) + + // Save session when agentId changes + useEffect(() => { + if (agentId && isRunning) { + const session: SavedSession = { + agentId, + target: target || '', + startedAt: new Date().toISOString(), + } + localStorage.setItem(SESSION_KEY, JSON.stringify(session)) + } + }, [agentId, isRunning, target]) + + // Poll agent status + logs + useEffect(() => { + if (!agentId) return + + const poll = async () => { + try { + const s = await agentApi.getStatus(agentId) + setStatus(s) + if (s.status === 'completed' || s.status === 'error' || s.status === 'stopped') { + setIsRunning(false) + if (pollRef.current) clearInterval(pollRef.current) + } + } catch { + // ignore polling errors + } + + // Fetch recent logs + try { + const logData = await agentApi.getLogs(agentId, 200) + setLogs(logData.logs || []) + } catch { + // ignore + } + } + + poll() + pollRef.current = setInterval(poll, 3000) + return () => { if (pollRef.current) clearInterval(pollRef.current) } + }, [agentId]) + + // Auto-scroll logs + useEffect(() => { + if (showLogs && logsEndRef.current) { + logsEndRef.current.scrollIntoView({ behavior: 'smooth' }) + } + }, [logs, showLogs]) + + const handleStart = async () => { + const primaryTarget = target.trim() + if (!primaryTarget) return + + setError(null) + setIsRunning(true) + setStatus(null) + setLogs([]) + setReportId(null) + + try { + const targetList = multiTarget + ? targets.split('\n').map(t => t.trim()).filter(Boolean) + : undefined + + const resp = await agentApi.autoPentest(primaryTarget, { + subdomain_discovery: subdomainDiscovery, + targets: targetList, + auth_type: authType || undefined, + auth_value: authValue || undefined, + prompt: customPrompt.trim() || undefined, + }) + setAgentId(resp.agent_id) + } catch (err: any) { + setError(err?.response?.data?.detail || err?.message || 'Failed to start pentest') + setIsRunning(false) + } + } + + const handleStop = async () => { + if (!agentId) return + try { + await agentApi.stop(agentId) + setIsRunning(false) + } catch { + // ignore + } + } + + const handleClearSession = () => { + localStorage.removeItem(SESSION_KEY) + setAgentId(null) + setStatus(null) + setLogs([]) + setIsRunning(false) + setError(null) + setReportId(null) + setTarget('') + } + + const handleGenerateAiReport = useCallback(async () => { + if (!status?.scan_id) return + setGeneratingReport(true) + try { + const report = await reportsApi.generateAiReport({ + scan_id: status.scan_id, + title: `AI Pentest Report - ${target}`, + }) + setReportId(report.id) + } catch (err: any) { + setError(err?.response?.data?.detail || 'Failed to generate AI report') + } finally { + setGeneratingReport(false) + } + }, [status?.scan_id, target]) + + const currentPhaseIdx = status ? phaseFromProgress(status.progress) : -1 + const findings = status?.findings || [] + const rejectedFindings = status?.rejected_findings || [] + const allFindings = [...findings, ...rejectedFindings] + const [findingsFilter, setFindingsFilter] = useState<'confirmed' | 'rejected' | 'all'>('all') + const displayFindings = findingsFilter === 'confirmed' ? findings + : findingsFilter === 'rejected' ? rejectedFindings + : allFindings + const sevCounts = findings.reduce( + (acc, f) => { + acc[f.severity] = (acc[f.severity] || 0) + 1 + return acc + }, + {} as Record + ) + + return ( +
+ {/* Header */} +
+
+ +
+

Auto Pentest

+

+ One-click comprehensive penetration test. 100 vulnerability types, AI-powered analysis, full report. +

+
+ + {/* Main Card - only show config when no session is active */} + {!agentId && ( +
+ {/* URL Input */} +
+ + setTarget(e.target.value)} + placeholder="https://example.com" + disabled={isRunning} + className="w-full px-4 py-4 bg-dark-900 border border-dark-600 rounded-xl text-white text-lg placeholder-dark-500 focus:outline-none focus:border-green-500 focus:ring-1 focus:ring-green-500 disabled:opacity-50" + /> +
+ + {/* Toggles */} +
+ + + +
+ + {/* Multi-target textarea */} + {multiTarget && ( +
+ +