From ea371ccfc6d1ffccade34ffd9676cb0a9416ea8e Mon Sep 17 00:00:00 2001 From: Finessse Date: Tue, 30 Dec 2025 00:25:15 +0700 Subject: [PATCH] refactor: remove desktop GUI, keep CLI + tray architecture - Delete cmd/proxypilotui/main_windows.go (desktop GUI) - Keep cmd/proxypilotui/assets/ (web dashboard) - Update cliproxytray to remove embedded asset server - Update proxypilot_dashboard.go for standalone dashboard - Update README and docs for CLI + tray architecture - Update proxypilotpack build scripts --- README.md | 5 +- cmd/cliproxytray/main_windows.go | 12 - cmd/proxypilotpack/main.go | 35 +- cmd/proxypilotui/assets/assets/index.css | 1 - cmd/proxypilotui/assets/assets/index.js | 340 +------ cmd/proxypilotui/assets/index.html | 27 +- cmd/proxypilotui/main_windows.go | 1173 ---------------------- docs/desktop-app-build-process.md | 137 +-- docs/proxypilot.md | 4 +- internal/api/proxypilot_dashboard.go | 74 +- 10 files changed, 118 insertions(+), 1690 deletions(-) delete mode 100644 cmd/proxypilotui/assets/assets/index.css delete mode 100644 cmd/proxypilotui/main_windows.go diff --git a/README.md b/README.md index 6074981a..c9811ea4 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ - 🧩 **Context Compression** - LLM-based summarization for long sessions (Factory.ai research) - 🤖 **Agentic Harness** - Guided workflow for coding agents (Anthropic research) - 💾 **Session Memory** - Persistent storage across conversation turns -- 🎨 **Desktop App** - Native Windows control center with system tray +- 🎨 **System Tray** - Native Windows tray app for quick access - 📡 **60+ Management APIs** - Full control via REST endpoints --- @@ -169,9 +169,8 @@ All endpoints auto-translate between formats based on the target provider. | Binary | Description | |--------|-------------| | `proxypilot` | Main API proxy server | -| `proxypilotui` | Desktop control center (Windows) | | `cliproxytray` | System tray application (Windows) | -| `proxypilotpack` | Build and packaging tool | +| `ppswitch` | Provider/model switching utility | --- diff --git a/cmd/cliproxytray/main_windows.go b/cmd/cliproxytray/main_windows.go index 819791ea..8dacd329 100644 --- a/cmd/cliproxytray/main_windows.go +++ b/cmd/cliproxytray/main_windows.go @@ -7,7 +7,6 @@ import ( "encoding/json" "flag" "fmt" - "io/fs" "net" "net/http" "net/http/httputil" @@ -22,7 +21,6 @@ import ( "github.com/getlantern/systray" "github.com/jchv/go-webview2" - "github.com/router-for-me/CLIProxyAPI/v6/cmd/proxypilotui/assets" "github.com/router-for-me/CLIProxyAPI/v6/internal/api/middleware" "github.com/router-for-me/CLIProxyAPI/v6/internal/config" "github.com/router-for-me/CLIProxyAPI/v6/internal/desktopctl" @@ -45,16 +43,6 @@ var dashboardMu sync.Mutex var dashboardOpen bool func main() { - // Start embedded asset server for the dashboard UI - assetLn, err := net.Listen("tcp", "127.0.0.1:0") - if err == nil { - assetServerURL = "http://" + assetLn.Addr().String() - go func() { - fsys, _ := fs.Sub(assets.FS, ".") - http.Serve(assetLn, http.FileServer(http.FS(fsys))) - }() - } - var repoRoot string var configPath string flag.StringVar(&repoRoot, "repo", "", "Repo root (used to locate logs/)") diff --git a/cmd/proxypilotpack/main.go b/cmd/proxypilotpack/main.go index 350b7995..9d35faae 100644 --- a/cmd/proxypilotpack/main.go +++ b/cmd/proxypilotpack/main.go @@ -125,10 +125,6 @@ func buildBinaries(repoRoot, binRoot string) error { if runtime.GOOS != "windows" { trayExe = filepath.Join(binRoot, "ProxyPilot") } - uiExe := filepath.Join(binRoot, "ProxyPilotUI.exe") - if runtime.GOOS != "windows" { - uiExe = filepath.Join(binRoot, "ProxyPilotUI") - } if err := run(repoRoot, "go", "build", "-o", proxyExe, "./cmd/server"); err != nil { return err @@ -143,13 +139,6 @@ func buildBinaries(repoRoot, binRoot string) error { return err } } - if runtime.GOOS == "windows" { - if err := run(repoRoot, "go", "build", "-ldflags", "-H=windowsgui", "-o", uiExe, "./cmd/proxypilotui"); err != nil { - return err - } - } else { - // The UI binary is only supported on Windows for now; skip on other OSes. - } if runtime.GOOS == "windows" { ico := trayicon.ProxyPilotICO() @@ -169,7 +158,6 @@ func packageZip(repoRoot, binRoot, distRoot string) error { dst string }{ {src: filepath.Join(binRoot, "ProxyPilot.exe"), dst: "ProxyPilot.exe"}, - {src: filepath.Join(binRoot, "ProxyPilotUI.exe"), dst: "ProxyPilotUI.exe"}, {src: filepath.Join(binRoot, "ProxyPilot.ico"), dst: "ProxyPilot.ico"}, {src: filepath.Join(binRoot, "proxypilot-engine.exe"), dst: "proxypilot-engine.exe"}, // Back-compat: keep a copy under the legacy name for older launchers/scripts. @@ -223,14 +211,10 @@ func packageSetup(repoRoot, binRoot, distRoot string) error { // Payload files mgrExe := filepath.Join(binRoot, "ProxyPilot.exe") - uiExe := filepath.Join(binRoot, "ProxyPilotUI.exe") srvExe := filepath.Join(binRoot, "proxypilot-engine.exe") if err := copyFile(mgrExe, filepath.Join(staging, "ProxyPilot.exe")); err != nil { return err } - if err := copyFile(uiExe, filepath.Join(staging, "ProxyPilotUI.exe")); err != nil { - return err - } if err := copyFile(srvExe, filepath.Join(staging, "proxypilot-engine.exe")); err != nil { return err } @@ -250,7 +234,6 @@ func packageSetup(repoRoot, binRoot, distRoot string) error { "set \"DEST=%LOCALAPPDATA%\\ProxyPilot\"\r\n" + "if not exist \"%DEST%\" mkdir \"%DEST%\" >nul 2>&1\r\n" + "copy /Y \"%SRC%ProxyPilot.exe\" \"%DEST%\\ProxyPilot.exe\" >nul\r\n" + - "copy /Y \"%SRC%ProxyPilotUI.exe\" \"%DEST%\\ProxyPilotUI.exe\" >nul\r\n" + "copy /Y \"%SRC%proxypilot-engine.exe\" \"%DEST%\\proxypilot-engine.exe\" >nul\r\n" + "copy /Y \"%SRC%proxypilot-engine.exe\" \"%DEST%\\cliproxyapi-latest.exe\" >nul\r\n" + "if exist \"%SRC%config.example.yaml\" copy /Y \"%SRC%config.example.yaml\" \"%DEST%\\config.example.yaml\" >nul\r\n" + @@ -279,8 +262,8 @@ func packageSetup(repoRoot, binRoot, distRoot string) error { } // If config.example.yaml is absent, omit it to avoid IExpress build failure. if _, err := os.Stat(filepath.Join(staging, "config.example.yaml")); errors.Is(err, os.ErrNotExist) { - sed = strings.ReplaceAll(sed, "%FILE3%=config.example.yaml\r\n", "") - sed = strings.ReplaceAll(sed, "FILE3=config.example.yaml\r\n", "") + sed = strings.ReplaceAll(sed, "%FILE2%=config.example.yaml\r\n", "") + sed = strings.ReplaceAll(sed, "FILE2=config.example.yaml\r\n", "") } if err := os.WriteFile(sedPath, []byte(sed), 0o644); err != nil { return err @@ -334,16 +317,14 @@ SourceFiles=SourceFiles SourceFiles0=%s [SourceFiles0] %%FILE0%%=ProxyPilot.exe -%%FILE1%%=ProxyPilotUI.exe -%%FILE2%%=proxypilot-engine.exe -%%FILE3%%=config.example.yaml -%%FILE4%%=install.cmd +%%FILE1%%=proxypilot-engine.exe +%%FILE2%%=config.example.yaml +%%FILE3%%=install.cmd [Strings] FILE0=ProxyPilot.exe -FILE1=ProxyPilotUI.exe -FILE2=proxypilot-engine.exe -FILE3=config.example.yaml -FILE4=install.cmd +FILE1=proxypilot-engine.exe +FILE2=config.example.yaml +FILE3=install.cmd `, outEsc, stagingEsc), nil } diff --git a/cmd/proxypilotui/assets/assets/index.css b/cmd/proxypilotui/assets/assets/index.css deleted file mode 100644 index 18bb54be..00000000 --- a/cmd/proxypilotui/assets/assets/index.css +++ /dev/null @@ -1 +0,0 @@ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:"JetBrains Mono","Fira Code",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-900:oklch(40.8% .123 38.172);--color-orange-950:oklch(26.6% .079 36.259);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-teal-500:oklch(70.4% .14 182.503);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-900:oklch(21% .006 285.885);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:"JetBrains Mono","Fira Code",monospace;--font-display:"Space Grotesk",system-ui,sans-serif;--font-body:"IBM Plex Sans",system-ui,sans-serif;--bg-void:var(--bg-void);--bg-panel:var(--bg-panel);--bg-elevated:var(--bg-elevated);--bg-active:var(--bg-active);--accent-primary:var(--accent-primary);--accent-secondary:var(--accent-secondary);--accent-glow:var(--accent-glow);--status-online:var(--status-online);--status-offline:var(--status-offline);--status-warning:var(--status-warning);--status-processing:var(--status-processing);--text-primary:var(--text-primary);--text-secondary:var(--text-secondary);--text-muted:var(--text-muted);--text-accent:var(--text-accent);--border-subtle:var(--border-subtle);--border-default:var(--border-default);--border-accent:var(--border-accent)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground);font-family:var(--font-body)}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.inset-4{inset:calc(var(--spacing)*4)}.inset-8{inset:calc(var(--spacing)*8)}.inset-12{inset:calc(var(--spacing)*12)}.-top-8{top:calc(var(--spacing)*-8)}.top-0{top:calc(var(--spacing)*0)}.top-1{top:calc(var(--spacing)*1)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.right-full{right:100%}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.left-0{left:calc(var(--spacing)*0)}.left-1{left:calc(var(--spacing)*1)}.left-1\/2{left:50%}.left-7{left:calc(var(--spacing)*7)}.left-full{left:100%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-4{margin-inline:calc(var(--spacing)*4)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.-ml-0\.5{margin-left:calc(var(--spacing)*-.5)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-2\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-0\.5{height:calc(var(--spacing)*.5)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-16{height:calc(var(--spacing)*16)}.h-24{height:calc(var(--spacing)*24)}.h-32{height:calc(var(--spacing)*32)}.h-48{height:calc(var(--spacing)*48)}.h-64{height:calc(var(--spacing)*64)}.h-\[1\.15rem\]{height:1.15rem}.h-\[2px\]{height:2px}.h-\[30px\]{height:30px}.h-\[500px\]{height:500px}.h-full{height:100%}.h-px{height:1px}.max-h-0{max-height:calc(var(--spacing)*0)}.max-h-48{max-height:calc(var(--spacing)*48)}.max-h-56{max-height:calc(var(--spacing)*56)}.max-h-60{max-height:calc(var(--spacing)*60)}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-\[80vh\]{max-height:80vh}.w-1\.5{width:calc(var(--spacing)*1.5)}.w-1\/2{width:50%}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-11{width:calc(var(--spacing)*11)}.w-12{width:calc(var(--spacing)*12)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-48{width:calc(var(--spacing)*48)}.w-80{width:calc(var(--spacing)*80)}.w-\[5px\]{width:5px}.w-\[160px\]{width:160px}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-\[200px\]{min-width:200px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.origin-left{transform-origin:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-none{appearance:none}.auto-rows-min{grid-auto-rows:min-content}.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-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}.gap-\[3px\]{gap:3px}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*0)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*0)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--border-subtle\)\]\/30>:not(:last-child)){border-color:var(--border-subtle)}@supports (color:color-mix(in lab,red,red)){:where(.divide-\[var\(--border-subtle\)\]\/30>:not(:last-child)){border-color:color-mix(in oklab,var(--border-subtle)30%,transparent)}}:where(.divide-border\/40>:not(:last-child)){border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){:where(.divide-border\/40>:not(:last-child)){border-color:color-mix(in oklab,var(--border)40%,transparent)}}:where(.divide-orange-500\/10>:not(:last-child)){border-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){:where(.divide-orange-500\/10>:not(:last-child)){border-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-\[2px\]{border-radius:2px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-t-sm{border-top-left-radius:calc(var(--radius) - 4px);border-top-right-radius:calc(var(--radius) - 4px)}.rounded-r-sm{border-top-right-radius:calc(var(--radius) - 4px);border-bottom-right-radius:calc(var(--radius) - 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[hsl\(var\(--border-primary\)\)\]{border-color:hsl(var(--border-primary))}.border-\[oklch\(0\.30_0\.05_260\)\]{border-color:#1f2e47}.border-\[oklch\(0\.35_0\.05_260\)\]{border-color:#2b3b55}.border-\[oklch\(0\.40_0\.15_25\)\]{border-color:#861118}.border-\[oklch\(0\.72_0\.19_145\/0\.4\)\]{border-color:#43c25166}.border-\[oklch\(0\.75_0\.18_55\)\]{border-color:#ff8b26;border-color:oklch(75% .18 55)}.border-\[var\(--accent-glow\)\]{border-color:var(--accent-glow)}.border-\[var\(--accent-primary\)\],.border-\[var\(--accent-primary\)\]\/30{border-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--accent-primary\)\]\/30{border-color:color-mix(in oklab,var(--accent-primary)30%,transparent)}}.border-\[var\(--border-default\)\]{border-color:var(--border-default)}.border-\[var\(--border-subtle\)\],.border-\[var\(--border-subtle\)\]\/50{border-color:var(--border-subtle)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--border-subtle\)\]\/50{border-color:color-mix(in oklab,var(--border-subtle)50%,transparent)}}.border-\[var\(--status-error\)\]{border-color:var(--status-error)}.border-\[var\(--status-offline\)\],.border-\[var\(--status-offline\)\]\/20{border-color:var(--status-offline)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--status-offline\)\]\/20{border-color:color-mix(in oklab,var(--status-offline)20%,transparent)}}.border-\[var\(--status-online\)\],.border-\[var\(--status-online\)\]\/20{border-color:var(--status-online)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--status-online\)\]\/20{border-color:color-mix(in oklab,var(--status-online)20%,transparent)}}.border-\[var\(--status-online\)\]\/30{border-color:var(--status-online)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--status-online\)\]\/30{border-color:color-mix(in oklab,var(--status-online)30%,transparent)}}.border-\[var\(--status-online\)\]\/50{border-color:var(--status-online)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--status-online\)\]\/50{border-color:color-mix(in oklab,var(--status-online)50%,transparent)}}.border-\[var\(--status-processing\)\]{border-color:var(--status-processing)}.border-\[var\(--status-warning\)\],.border-\[var\(--status-warning\)\]\/20{border-color:var(--status-warning)}@supports (color:color-mix(in lab,red,red)){.border-\[var\(--status-warning\)\]\/20{border-color:color-mix(in oklab,var(--status-warning)20%,transparent)}}.border-\[var\(--text-muted\)\]{border-color:var(--text-muted)}.border-amber-500{border-color:var(--color-amber-500)}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-border,.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border)50%,transparent)}}.border-current{border-color:currentColor}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500)30%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-orange-500\/20{border-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/20{border-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500)40%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.border-transparent{border-color:#0000}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500)30%,transparent)}}.border-t-transparent{border-top-color:#0000}.border-l-\[var\(--accent-glow\)\]{border-left-color:var(--accent-glow)}.border-l-\[var\(--status-offline\)\]{border-left-color:var(--status-offline)}.border-l-\[var\(--status-warning\)\]{border-left-color:var(--status-warning)}.border-l-\[var\(--text-muted\)\]{border-left-color:var(--text-muted)}.bg-\[color-mix\(in_oklch\,var\(--accent-glow\)_10\%\,transparent\)\]{background-color:var(--accent-glow)}@supports (color:color-mix(in lab,red,red)){.bg-\[color-mix\(in_oklch\,var\(--accent-glow\)_10\%\,transparent\)\]{background-color:color-mix(in oklch,var(--accent-glow)10%,transparent)}}.bg-\[hsl\(var\(--accent-primary\)\)\]{background-color:hsl(var(--accent-primary))}.bg-\[hsl\(var\(--bg-primary\)\)\]{background-color:hsl(var(--bg-primary))}.bg-\[hsl\(var\(--bg-secondary\)\)\]{background-color:hsl(var(--bg-secondary))}.bg-\[hsl\(var\(--status-offline\)\)\]{background-color:hsl(var(--status-offline))}.bg-\[hsl\(var\(--status-online\)\)\]{background-color:hsl(var(--status-online))}.bg-\[hsl\(var\(--status-processing\)\)\]{background-color:hsl(var(--status-processing))}.bg-\[hsl\(var\(--status-warning\)\)\]{background-color:hsl(var(--status-warning))}.bg-\[hsl\(var\(--text-secondary\)\)\]{background-color:hsl(var(--text-secondary))}.bg-\[oklch\(0\.18_0\.04_260\)\]{background-color:#071123}.bg-\[oklch\(0\.20_0\.05_260\)\]{background-color:#08152c}.bg-\[oklch\(0\.35_0\.12_25\)\]{background-color:#6c1517}.bg-\[oklch\(0\.72_0\.19_145\)\]{background-color:#43c251}.bg-\[oklch\(0\.72_0\.19_145\/0\.3\)\]{background-color:#43c2514d}.bg-\[oklch\(0\.72_0\.19_145\/0\.08\)\]{background-color:#43c25114}.bg-\[oklch\(0\.72_0\.19_145\/0\.15\)\]{background-color:#43c25126}.bg-\[oklch\(0\.75_0\.18_55\)\]{background-color:#ff8b26;background-color:oklch(75% .18 55)}.bg-\[var\(--accent-glow\)\],.bg-\[var\(--accent-glow\)\]\/20{background-color:var(--accent-glow)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent-glow\)\]\/20{background-color:color-mix(in oklab,var(--accent-glow)20%,transparent)}}.bg-\[var\(--accent-primary\)\],.bg-\[var\(--accent-primary\)\]\/10{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent-primary\)\]\/10{background-color:color-mix(in oklab,var(--accent-primary)10%,transparent)}}.bg-\[var\(--accent-primary\)\]\/20{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--accent-primary\)\]\/20{background-color:color-mix(in oklab,var(--accent-primary)20%,transparent)}}.bg-\[var\(--bg-elevated\)\],.bg-\[var\(--bg-elevated\)\]\/50{background-color:var(--bg-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-elevated\)\]\/50{background-color:color-mix(in oklab,var(--bg-elevated)50%,transparent)}}.bg-\[var\(--bg-panel\)\],.bg-\[var\(--bg-panel\)\]\/30{background-color:var(--bg-panel)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-panel\)\]\/30{background-color:color-mix(in oklab,var(--bg-panel)30%,transparent)}}.bg-\[var\(--bg-panel\)\]\/50{background-color:var(--bg-panel)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-panel\)\]\/50{background-color:color-mix(in oklab,var(--bg-panel)50%,transparent)}}.bg-\[var\(--bg-void\)\],.bg-\[var\(--bg-void\)\]\/30{background-color:var(--bg-void)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--bg-void\)\]\/30{background-color:color-mix(in oklab,var(--bg-void)30%,transparent)}}.bg-\[var\(--border-subtle\)\]{background-color:var(--border-subtle)}.bg-\[var\(--status-error\)\]\/10{background-color:var(--status-error)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--status-error\)\]\/10{background-color:color-mix(in oklab,var(--status-error)10%,transparent)}}.bg-\[var\(--status-offline\)\],.bg-\[var\(--status-offline\)\]\/10{background-color:var(--status-offline)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--status-offline\)\]\/10{background-color:color-mix(in oklab,var(--status-offline)10%,transparent)}}.bg-\[var\(--status-offline\)\]\/20{background-color:var(--status-offline)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--status-offline\)\]\/20{background-color:color-mix(in oklab,var(--status-offline)20%,transparent)}}.bg-\[var\(--status-online\)\],.bg-\[var\(--status-online\)\]\/5{background-color:var(--status-online)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--status-online\)\]\/5{background-color:color-mix(in oklab,var(--status-online)5%,transparent)}}.bg-\[var\(--status-online\)\]\/10{background-color:var(--status-online)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--status-online\)\]\/10{background-color:color-mix(in oklab,var(--status-online)10%,transparent)}}.bg-\[var\(--status-online\)\]\/15{background-color:var(--status-online)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--status-online\)\]\/15{background-color:color-mix(in oklab,var(--status-online)15%,transparent)}}.bg-\[var\(--status-processing\)\]\/10{background-color:var(--status-processing)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--status-processing\)\]\/10{background-color:color-mix(in oklab,var(--status-processing)10%,transparent)}}.bg-\[var\(--status-warning\)\],.bg-\[var\(--status-warning\)\]\/10{background-color:var(--status-warning)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--status-warning\)\]\/10{background-color:color-mix(in oklab,var(--status-warning)10%,transparent)}}.bg-\[var\(--status-warning\)\]\/20{background-color:var(--status-warning)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--status-warning\)\]\/20{background-color:color-mix(in oklab,var(--status-warning)20%,transparent)}}.bg-\[var\(--text-muted\)\],.bg-\[var\(--text-muted\)\]\/15{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--text-muted\)\]\/15{background-color:color-mix(in oklab,var(--text-muted)15%,transparent)}}.bg-\[var\(--text-muted\)\]\/20{background-color:var(--text-muted)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--text-muted\)\]\/20{background-color:color-mix(in oklab,var(--text-muted)20%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-600\/80{background-color:#dd7400cc}@supports (color:color-mix(in lab,red,red)){.bg-amber-600\/80{background-color:color-mix(in oklab,var(--color-amber-600)80%,transparent)}}.bg-background,.bg-background\/50{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/50{background-color:color-mix(in oklab,var(--background)50%,transparent)}}.bg-background\/60{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/60{background-color:color-mix(in oklab,var(--background)60%,transparent)}}.bg-background\/80{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/80{background-color:color-mix(in oklab,var(--background)80%,transparent)}}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black)40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/40{background-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/40{background-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.bg-blue-500\/50{background-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/50{background-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.bg-border{background-color:var(--border)}.bg-card\/60{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/60{background-color:color-mix(in oklab,var(--card)60%,transparent)}}.bg-card\/80{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/80{background-color:color-mix(in oklab,var(--card)80%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500)10%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.bg-emerald-500\/60{background-color:#00bb7f99}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/60{background-color:color-mix(in oklab,var(--color-emerald-500)60%,transparent)}}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-foreground{background-color:var(--foreground)}.bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500)10%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-muted,.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--muted)30%,transparent)}}.bg-muted\/40{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,var(--muted)40%,transparent)}}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/5{background-color:#fe6e000d}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/5{background-color:color-mix(in oklab,var(--color-orange-500)5%,transparent)}}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-orange-500\/50{background-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/50{background-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-purple-500\/10{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/10{background-color:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.bg-purple-600{background-color:var(--color-purple-600)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-red-500\/60{background-color:#fb2c3699}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/60{background-color:color-mix(in oklab,var(--color-red-500)60%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-500\/5{background-color:#edb2000d}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/5{background-color:color-mix(in oklab,var(--color-yellow-500)5%,transparent)}}.bg-zinc-700\/50{background-color:#3f3f4680}@supports (color:color-mix(in lab,red,red)){.bg-zinc-700\/50{background-color:color-mix(in oklab,var(--color-zinc-700)50%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[radial-gradient\(ellipse_at_top_right\,_var\(--tw-gradient-stops\)\)\]{background-image:radial-gradient(ellipse at top right,var(--tw-gradient-stops))}.from-\[var\(--accent-glow\)\]\/\[0\.07\]{--tw-gradient-from:var(--accent-glow)}@supports (color:color-mix(in lab,red,red)){.from-\[var\(--accent-glow\)\]\/\[0\.07\]{--tw-gradient-from:color-mix(in oklab,var(--accent-glow)7%,transparent)}}.from-\[var\(--accent-glow\)\]\/\[0\.07\]{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[var\(--accent-primary\)\]{--tw-gradient-from:var(--accent-primary);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[var\(--bg-elevated\)\]{--tw-gradient-from:var(--bg-elevated);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-emerald-400\/10{--tw-gradient-from:#00d2941a}@supports (color:color-mix(in lab,red,red)){.from-emerald-400\/10{--tw-gradient-from:color-mix(in oklab,var(--color-emerald-400)10%,transparent)}}.from-emerald-400\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-emerald-500\/10{--tw-gradient-from:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.from-emerald-500\/10{--tw-gradient-from:color-mix(in oklab,var(--color-emerald-500)10%,transparent)}}.from-emerald-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-orange-500\/5{--tw-gradient-from:#fe6e000d}@supports (color:color-mix(in lab,red,red)){.from-orange-500\/5{--tw-gradient-from:color-mix(in oklab,var(--color-orange-500)5%,transparent)}}.from-orange-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-orange-950\/80{--tw-gradient-from:#441306cc}@supports (color:color-mix(in lab,red,red)){.from-orange-950\/80{--tw-gradient-from:color-mix(in oklab,var(--color-orange-950)80%,transparent)}}.from-orange-950\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/5{--tw-gradient-from:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/5{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)5%,transparent)}}.from-purple-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-zinc-900{--tw-gradient-from:var(--color-zinc-900);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-\[var\(--accent-primary\)\]{--tw-gradient-via:var(--accent-primary);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[var\(--border-default\)\]{--tw-gradient-via:var(--border-default);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\[var\(--status-processing\)\]\/30{--tw-gradient-via:var(--status-processing)}@supports (color:color-mix(in lab,red,red)){.via-\[var\(--status-processing\)\]\/30{--tw-gradient-via:color-mix(in oklab,var(--status-processing)30%,transparent)}}.via-\[var\(--status-processing\)\]\/30{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-300{--tw-gradient-via:var(--color-orange-300);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-orange-900\/60{--tw-gradient-via:#7e2a0c99}@supports (color:color-mix(in lab,red,red)){.via-orange-900\/60{--tw-gradient-via:color-mix(in oklab,var(--color-orange-900)60%,transparent)}}.via-orange-900\/60{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-teal-500\/5{--tw-gradient-via:#00baa70d}@supports (color:color-mix(in lab,red,red)){.via-teal-500\/5{--tw-gradient-via:color-mix(in oklab,var(--color-teal-500)5%,transparent)}}.via-teal-500\/5{--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-\[var\(--accent-secondary\)\]{--tw-gradient-to:var(--accent-secondary);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[var\(--bg-active\)\]{--tw-gradient-to:var(--bg-active);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[var\(--bg-panel\)\]{--tw-gradient-to:var(--bg-panel);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-black{--tw-gradient-to:var(--color-black);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500\/10{--tw-gradient-to:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.to-cyan-500\/10{--tw-gradient-to:color-mix(in oklab,var(--color-cyan-500)10%,transparent)}}.to-cyan-500\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-orange-950\/80{--tw-gradient-to:#441306cc}@supports (color:color-mix(in lab,red,red)){.to-orange-950\/80{--tw-gradient-to:color-mix(in oklab,var(--color-orange-950)80%,transparent)}}.to-orange-950\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.fill-foreground{fill:var(--foreground)}.fill-red-500{fill:var(--color-red-500)}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-1\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0{padding-block:calc(var(--spacing)*0)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-5{padding-top:calc(var(--spacing)*5)}.pt-6{padding-top:calc(var(--spacing)*6)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-display{font-family:Space Grotesk,system-ui,sans-serif}.font-mono{font-family:JetBrains Mono,Fira Code,monospace}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.7rem\]{font-size:.7rem}.text-\[0\.65rem\]{font-size:.65rem}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading:1;line-height:1}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-\[var\(--font-display\)\]{--tw-font-weight:var(--font-display);font-weight:var(--font-display)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.05em\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\[0\.15em\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[hsl\(var\(--bg-primary\)\)\]{color:hsl(var(--bg-primary))}.text-\[hsl\(var\(--text-secondary\)\)\]{color:hsl(var(--text-secondary))}.text-\[oklch\(0\.15_0\.02_55\)\]{color:#120904}.text-\[oklch\(0\.72_0\.19_145\)\]{color:#43c251}.text-\[oklch\(0\.72_0\.19_145\/0\.8\)\]{color:#43c251cc}.text-\[oklch\(0\.75_0\.18_55\)\]{color:#ff8b26;color:oklch(75% .18 55)}.text-\[oklch\(0\.85_0\.02_260\)\]{color:#c6cedb}.text-\[oklch\(0\.90_0\.02_25\)\]{color:#ebd9d7}.text-\[var\(--accent-glow\)\]{color:var(--accent-glow)}.text-\[var\(--accent-primary\)\]{color:var(--accent-primary)}.text-\[var\(--border-default\)\]{color:var(--border-default)}.text-\[var\(--primary-foreground\)\]{color:var(--primary-foreground)}.text-\[var\(--status-error\)\]{color:var(--status-error)}.text-\[var\(--status-offline\)\]{color:var(--status-offline)}.text-\[var\(--status-online\)\]{color:var(--status-online)}.text-\[var\(--status-processing\)\]{color:var(--status-processing)}.text-\[var\(--status-warning\)\]{color:var(--status-warning)}.text-\[var\(--text-accent\)\]{color:var(--text-accent)}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.text-\[var\(--text-secondary\)\]{color:var(--text-secondary)}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-background{color:var(--background)}.text-black{color:var(--color-black)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-emerald-100{color:var(--color-emerald-100)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-300\/60{color:#5ee9b599}@supports (color:color-mix(in lab,red,red)){.text-emerald-300\/60{color:color-mix(in oklab,var(--color-emerald-300)60%,transparent)}}.text-emerald-300\/70{color:#5ee9b5b3}@supports (color:color-mix(in lab,red,red)){.text-emerald-300\/70{color:color-mix(in oklab,var(--color-emerald-300)70%,transparent)}}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-foreground,.text-foreground\/90{color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.text-foreground\/90{color:color-mix(in oklab,var(--foreground)90%,transparent)}}.text-green-500{color:var(--color-green-500)}.text-muted{color:var(--muted)}.text-muted-foreground{color:var(--muted-foreground)}.text-orange-200{color:var(--color-orange-200)}.text-orange-200\/70{color:#ffd7a8b3}@supports (color:color-mix(in lab,red,red)){.text-orange-200\/70{color:color-mix(in oklab,var(--color-orange-200)70%,transparent)}}.text-orange-200\/80{color:#ffd7a8cc}@supports (color:color-mix(in lab,red,red)){.text-orange-200\/80{color:color-mix(in oklab,var(--color-orange-200)80%,transparent)}}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/80{color:#ffb96dcc}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/80{color:color-mix(in oklab,var(--color-orange-300)80%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-orange-500{color:var(--color-orange-500)}.text-orange-500\/30{color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.text-orange-500\/30{color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.text-orange-500\/50{color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.text-orange-500\/50{color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.text-orange-500\/60{color:#fe6e0099}@supports (color:color-mix(in lab,red,red)){.text-orange-500\/60{color:color-mix(in oklab,var(--color-orange-500)60%,transparent)}}.text-orange-500\/70{color:#fe6e00b3}@supports (color:color-mix(in lab,red,red)){.text-orange-500\/70{color:color-mix(in oklab,var(--color-orange-500)70%,transparent)}}.text-purple-400{color:var(--color-purple-400)}.text-purple-500{color:var(--color-purple-500)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-red-400\/70{color:#ff6568b3}@supports (color:color-mix(in lab,red,red)){.text-red-400\/70{color:color-mix(in oklab,var(--color-red-400)70%,transparent)}}.text-red-500{color:var(--color-red-500)}.text-white{color:var(--color-white)}.text-yellow-500{color:var(--color-yellow-500)}.text-zinc-300{color:var(--color-zinc-300)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-100{opacity:1}.opacity-\[0\.03\]{opacity:.03}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_0_oklch\(0\.72_0\.19_145\)\]{--tw-shadow:0 0 8px 0 var(--tw-shadow-color,oklch(72% .19 145));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_var\(--status-online\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,var(--status-online));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_10px_var\(--accent-primary\)\/20\]{--tw-shadow:0 0 10px var(--tw-shadow-color,var(--accent-primary)/20);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_16px_0_oklch\(0\.72_0\.19_145\/0\.25\)\,inset_0_1px_0_0_oklch\(0\.72_0\.19_145\/0\.1\)\]{--tw-shadow:0 0 16px 0 var(--tw-shadow-color,oklch(72% .19 145/.25)),inset 0 1px 0 0 var(--tw-shadow-color,oklch(72% .19 145/.1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_20px_0_var\(--accent-glow\)\]{--tw-shadow:0 0 20px 0 var(--tw-shadow-color,var(--accent-glow));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_30px_var\(--status-online\)\]{--tw-shadow:0 0 30px var(--tw-shadow-color,var(--status-online));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_0_0_oklch\(0\.75_0\.18_55\/0\.4\)\,0_0_12px_0_oklch\(0\.75_0\.18_55\/0\.2\)\]{--tw-shadow:0 2px 0 0 var(--tw-shadow-color,oklch(75% .18 55/.4)),0 0 12px 0 var(--tw-shadow-color,oklch(75% .18 55/.2));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_0_0_oklch\(0_0_0\/0\.1\)\]{--tw-shadow:0 2px 0 0 var(--tw-shadow-color,oklch(0% 0 0/.1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_0_0_oklch\(0_0_0\/0\.2\)\]{--tw-shadow:0 2px 0 0 var(--tw-shadow-color,oklch(0% 0 0/.2));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_0_0_oklch\(0_0_0\/0\.3\)\]{--tw-shadow:0 2px 0 0 var(--tw-shadow-color,oklch(0% 0 0/.3));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_0_0_oklch\(0_0_0\/0\.25\)\]{--tw-shadow:0 2px 0 0 var(--tw-shadow-color,oklch(0% 0 0/.25));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_0_var\(--border-subtle\)\,inset_0_-1px_0_0_oklch\(0_0_0\/0\.2\)\,0_2px_0_0_oklch\(0_0_0\/0\.1\)\]{--tw-shadow:inset 0 1px 0 0 var(--tw-shadow-color,var(--border-subtle)),inset 0 -1px 0 0 var(--tw-shadow-color,oklch(0% 0 0/.2)),0 2px 0 0 var(--tw-shadow-color,oklch(0% 0 0/.1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.1\)\,0_2px_4px_rgba\(0\,0\,0\,0\.3\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff1a),0 2px 4px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-emerald-500\/5{--tw-shadow-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/5{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-emerald-500)5%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-orange-500\/10{--tw-shadow-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.shadow-orange-500\/10{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-orange-500)10%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-emerald-500\/30{--tw-ring-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.ring-emerald-500\/30{--tw-ring-color:color-mix(in oklab,var(--color-emerald-500)30%,transparent)}}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur-sm{--tw-blur:blur(var(--blur-sm));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,)}.grayscale{--tw-grayscale:grayscale(100%);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,)}.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-sm{--tw-backdrop-blur:blur(var(--blur-sm));-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{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[height\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[transform\,box-shadow\]{transition-property:transform,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-50{--tw-duration:50ms;transition-duration:50ms}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.fade-in{--tw-enter-opacity:0}.running{animation-play-state:running}.slide-in-from-right{--tw-enter-translate-x:100%}.slide-in-from-top-2{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}@media(hover:hover){.group-hover\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:scale-105:is(:where(.group):hover *){--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.group-hover\:text-\[var\(--text-primary\)\]:is(:where(.group):hover *){color:var(--text-primary)}.group-hover\:text-orange-500:is(:where(.group):hover *){color:var(--color-orange-500)}.group-hover\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\:bg-purple-500\/30 ::selection{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.selection\:bg-purple-500\/30 ::selection{background-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.selection\:bg-purple-500\/30::selection{background-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.selection\:bg-purple-500\/30::selection{background-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.placeholder\:text-muted-foreground\/50::placeholder{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-muted-foreground\/50::placeholder{color:color-mix(in oklab,var(--muted-foreground)50%,transparent)}}.before\:pointer-events-none:before{content:var(--tw-content);pointer-events:none}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:inset-0:before{content:var(--tw-content);inset:calc(var(--spacing)*0)}.before\:bg-gradient-to-b:before{content:var(--tw-content);--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.before\:from-white\/\[0\.02\]:before{content:var(--tw-content);--tw-gradient-from:#ffffff05}@supports (color:color-mix(in lab,red,red)){.before\:from-white\/\[0\.02\]:before{--tw-gradient-from:color-mix(in oklab,var(--color-white)2%,transparent)}}.before\:from-white\/\[0\.02\]:before{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.before\:to-transparent:before{content:var(--tw-content);--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}@media(hover:hover){.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:translate-y-\[-2px\]:hover{--tw-translate-y:-2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\:border-\[oklch\(0\.50_0\.18_25\)\]:hover{border-color:#b32228}.hover\:border-\[oklch\(0\.65_0\.2_55\)\]:hover{border-color:#d76f00;border-color:oklch(65% .2 55)}.hover\:border-\[oklch\(0\.75_0\.18_55\)\]:hover{border-color:#ff8b26;border-color:oklch(75% .18 55)}.hover\:border-\[var\(--accent-primary\)\]:hover{border-color:var(--accent-primary)}.hover\:border-\[var\(--border-accent\)\]:hover{border-color:var(--border-accent)}.hover\:border-\[var\(--border-default\)\]:hover{border-color:var(--border-default)}.hover\:border-\[var\(--text-muted\)\]:hover{border-color:var(--text-muted)}.hover\:border-border:hover{border-color:var(--border)}.hover\:border-orange-500\/50:hover{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.hover\:border-orange-500\/50:hover{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.hover\:border-transparent:hover{border-color:#0000}.hover\:bg-\[oklch\(0\.22_0\.05_260\)\]:hover{background-color:#0c1a32}.hover\:bg-\[oklch\(0\.25_0\.04_260\)\]:hover{background-color:#162235}.hover\:bg-\[oklch\(0\.25_0\.06_260\)\]:hover{background-color:#10213e}.hover\:bg-\[oklch\(0\.40_0\.14_25\)\]:hover{background-color:#831a1d}.hover\:bg-\[oklch\(0\.78_0\.19_55\)\]:hover{background-color:#ff9b51;background-color:oklch(78% .19 55)}.hover\:bg-\[var\(--accent-primary\)\]:hover,.hover\:bg-\[var\(--accent-primary\)\]\/20:hover{background-color:var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--accent-primary\)\]\/20:hover{background-color:color-mix(in oklab,var(--accent-primary)20%,transparent)}}.hover\:bg-\[var\(--bg-active\)\]:hover{background-color:var(--bg-active)}.hover\:bg-\[var\(--bg-elevated\)\]:hover{background-color:var(--bg-elevated)}.hover\:bg-\[var\(--bg-panel\)\]\/50:hover{background-color:var(--bg-panel)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--bg-panel\)\]\/50:hover{background-color:color-mix(in oklab,var(--bg-panel)50%,transparent)}}.hover\:bg-\[var\(--bg-void\)\]:hover{background-color:var(--bg-void)}.hover\:bg-\[var\(--status-error\)\]\/20:hover{background-color:var(--status-error)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--status-error\)\]\/20:hover{background-color:color-mix(in oklab,var(--status-error)20%,transparent)}}.hover\:bg-\[var\(--status-offline\)\]\/10:hover{background-color:var(--status-offline)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--status-offline\)\]\/10:hover{background-color:color-mix(in oklab,var(--status-offline)10%,transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-blue-500\/60:hover{background-color:#3080ff99}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/60:hover{background-color:color-mix(in oklab,var(--color-blue-500)60%,transparent)}}.hover\:bg-card:hover{background-color:var(--card)}.hover\:bg-destructive\/10:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/10:hover{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.hover\:bg-emerald-500:hover{background-color:var(--color-emerald-500)}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-muted:hover,.hover\:bg-muted\/20:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/20:hover{background-color:color-mix(in oklab,var(--muted)20%,transparent)}}.hover\:bg-orange-500\/5:hover{background-color:#fe6e000d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/5:hover{background-color:color-mix(in oklab,var(--color-orange-500)5%,transparent)}}.hover\:bg-orange-500\/10:hover{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/10:hover{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-500\/30:hover{background-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/30:hover{background-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-700:hover{background-color:var(--color-purple-700)}.hover\:bg-red-500\/30:hover{background-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/30:hover{background-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.hover\:text-\[oklch\(0\.75_0\.18_55\)\]:hover{color:#ff8b26;color:oklch(75% .18 55)}.hover\:text-\[oklch\(0\.80_0\.20_55\)\]:hover{color:#ffa566;color:oklch(80% .2 55)}.hover\:text-\[oklch\(0\.85_0\.02_260\)\]:hover{color:#c6cedb}.hover\:text-\[var\(--accent-primary\)\]:hover{color:var(--accent-primary)}.hover\:text-\[var\(--bg-panel\)\]:hover{color:var(--bg-panel)}.hover\:text-\[var\(--status-offline\)\]:hover{color:var(--status-offline)}.hover\:text-\[var\(--text-primary\)\]:hover{color:var(--text-primary)}.hover\:text-\[var\(--text-secondary\)\]:hover{color:var(--text-secondary)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-orange-300:hover{color:var(--color-orange-300)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-\[0_0_0_1px_var\(--accent-primary\)\,0_0_20px_oklch\(0\.75_0\.18_55\/0\.2\)\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,var(--accent-primary)),0 0 20px var(--tw-shadow-color,oklch(75% .18 55/.2));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_0_10px_var\(--accent-primary\)\]:hover{--tw-shadow:0 0 10px var(--tw-shadow-color,var(--accent-primary));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_0_15px_var\(--accent-primary\)\]:hover{--tw-shadow:0 0 15px var(--tw-shadow-color,var(--accent-primary));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_0_15px_var\(--status-offline\)\]:hover{--tw-shadow:0 0 15px var(--tw-shadow-color,var(--status-offline));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_0_15px_var\(--status-online\)\]:hover{--tw-shadow:0 0 15px var(--tw-shadow-color,var(--status-online));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_0_20px_var\(--accent-primary\)\/15\]:hover{--tw-shadow:0 0 20px var(--tw-shadow-color,var(--accent-primary)/15);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-\[0_2px_0_0_oklch\(0\.75_0\.18_55\/0\.6\)\,0_0_20px_0_oklch\(0\.75_0\.18_55\/0\.35\)\]:hover{--tw-shadow:0 2px 0 0 var(--tw-shadow-color,oklch(75% .18 55/.6)),0 0 20px 0 var(--tw-shadow-color,oklch(75% .18 55/.35));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:border-orange-500\/50:focus{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.focus\:border-orange-500\/50:focus{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-orange-500\/30:focus{--tw-ring-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.focus\:ring-orange-500\/30:focus{--tw-ring-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[hsl\(var\(--status-offline\)\)\]\/20:focus-visible{--tw-ring-color:hsl(var(--status-offline))}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-\[hsl\(var\(--status-offline\)\)\]\/20:focus-visible{--tw-ring-color:color-mix(in oklab,hsl(var(--status-offline))20%,transparent)}}.focus-visible\:ring-\[oklch\(0\.45_0\.08_260\)\]:focus-visible{--tw-ring-color:oklch(45% .08 260)}.focus-visible\:ring-\[oklch\(0\.45_0\.15_25\)\]:focus-visible{--tw-ring-color:oklch(45% .15 25)}.focus-visible\:ring-\[oklch\(0\.75_0\.18_55\)\]:focus-visible{--tw-ring-color:oklch(75% .18 55)}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[var\(--bg-panel\)\]:focus-visible{--tw-ring-offset-color:var(--bg-panel)}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color:var(--background)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:translate-y-0:active{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.active\:translate-y-0\.5:active{--tw-translate-y:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.active\:bg-\[oklch\(0\.20_0\.04_260\)\]:active{background-color:#0b1628}.active\:shadow-\[0_0_8px_0_oklch\(0\.75_0\.18_55\/0\.4\)\]:active{--tw-shadow:0 0 8px 0 var(--tw-shadow-color,oklch(75% .18 55/.4));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.active\:shadow-none:active{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:active\:translate-y-0:disabled:active{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[var\(--accent-glow\)\][data-state=checked]{background-color:var(--accent-glow)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:var(--input)}@media(min-width:40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:block{display:block}.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-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}@media(min-width:64rem){.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))}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input)80%,transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}@media(hover:hover){a.\[a\&\]\:hover\:bg-\[hsl\(var\(--accent-primary\)\)\]\/90:hover{background-color:hsl(var(--accent-primary))}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-\[hsl\(var\(--accent-primary\)\)\]\/90:hover{background-color:color-mix(in oklab,hsl(var(--accent-primary))90%,transparent)}}a.\[a\&\]\:hover\:bg-\[hsl\(var\(--bg-tertiary\)\)\]:hover{background-color:hsl(var(--bg-tertiary))}a.\[a\&\]\:hover\:bg-\[hsl\(var\(--status-offline\)\)\]\/90:hover{background-color:hsl(var(--status-offline))}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-\[hsl\(var\(--status-offline\)\)\]\/90:hover{background-color:color-mix(in oklab,hsl(var(--status-offline))90%,transparent)}}a.\[a\&\]\:hover\:bg-\[hsl\(var\(--status-online\)\)\]\/90:hover{background-color:hsl(var(--status-online))}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-\[hsl\(var\(--status-online\)\)\]\/90:hover{background-color:color-mix(in oklab,hsl(var(--status-online))90%,transparent)}}a.\[a\&\]\:hover\:bg-\[hsl\(var\(--status-processing\)\)\]\/90:hover{background-color:hsl(var(--status-processing))}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-\[hsl\(var\(--status-processing\)\)\]\/90:hover{background-color:color-mix(in oklab,hsl(var(--status-processing))90%,transparent)}}a.\[a\&\]\:hover\:bg-\[hsl\(var\(--status-warning\)\)\]\/90:hover{background-color:hsl(var(--status-warning))}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-\[hsl\(var\(--status-warning\)\)\]\/90:hover{background-color:color-mix(in oklab,hsl(var(--status-warning))90%,transparent)}}a.\[a\&\]\:hover\:text-\[hsl\(var\(--text-primary\)\)\]:hover{color:hsl(var(--text-primary))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.5rem;--bg-void:oklch(97% .01 240);--bg-panel:oklch(100% 0 0);--bg-elevated:oklch(98% .01 240);--bg-active:oklch(94% .02 240);--accent-primary:oklch(50% .18 250);--accent-secondary:oklch(45% .15 255);--accent-glow:oklch(75% .12 220);--status-online:oklch(60% .18 145);--status-offline:oklch(50% .12 25);--status-warning:oklch(70% .16 85);--status-processing:oklch(65% .15 250);--text-primary:oklch(20% .03 250);--text-secondary:oklch(40% .02 250);--text-muted:oklch(55% .02 250);--text-accent:oklch(45% .16 250);--border-subtle:oklch(92% .01 240);--border-default:oklch(85% .02 240);--border-accent:oklch(50% .12 250);--background:oklch(97% .01 240);--foreground:oklch(20% .03 250);--card:oklch(100% 0 0);--card-foreground:oklch(20% .03 250);--popover:oklch(100% 0 0);--popover-foreground:oklch(20% .03 250);--primary:oklch(50% .18 250);--primary-foreground:oklch(98% .01 240);--secondary:oklch(94% .02 240);--secondary-foreground:oklch(30% .03 250);--muted:oklch(94% .02 240);--muted-foreground:oklch(50% .02 250);--accent:oklch(94% .03 220);--accent-foreground:oklch(40% .15 250);--destructive:oklch(55% .2 25);--border:oklch(92% .01 240);--input:oklch(92% .01 240);--ring:oklch(50% .18 250);--chart-1:oklch(50% .18 250);--chart-2:oklch(60% .18 145);--chart-3:oklch(65% .15 220);--chart-4:oklch(70% .16 85);--chart-5:oklch(45% .15 255);--sidebar:oklch(98% .01 240);--sidebar-foreground:oklch(20% .03 250);--sidebar-primary:oklch(50% .18 250);--sidebar-primary-foreground:oklch(98% 0 0);--sidebar-accent:oklch(94% .03 220);--sidebar-accent-foreground:oklch(40% .15 250);--sidebar-border:oklch(92% .01 240);--sidebar-ring:oklch(50% .18 250)}.dark{--bg-void:oklch(12% .03 250);--bg-panel:oklch(16% .04 250);--bg-elevated:oklch(20% .05 250);--bg-active:oklch(25% .06 250);--accent-primary:oklch(65% .18 250);--accent-secondary:oklch(55% .15 255);--accent-glow:oklch(80% .14 220);--status-online:oklch(72% .19 145);--status-offline:oklch(55% .12 25);--status-warning:oklch(80% .16 85);--status-processing:oklch(70% .15 250);--text-primary:oklch(96% .01 90);--text-secondary:oklch(75% .02 240);--text-muted:oklch(55% .03 250);--text-accent:oklch(80% .14 220);--border-subtle:oklch(25% .04 250);--border-default:oklch(32% .05 250);--border-accent:oklch(55% .12 250);--background:oklch(12% .03 250);--foreground:oklch(96% .01 90);--card:oklch(16% .04 250);--card-foreground:oklch(96% .01 90);--popover:oklch(16% .04 250);--popover-foreground:oklch(96% .01 90);--primary:oklch(65% .18 250);--primary-foreground:oklch(12% .03 250);--secondary:oklch(20% .05 250);--secondary-foreground:oklch(96% .01 90);--muted:oklch(20% .05 250);--muted-foreground:oklch(55% .03 250);--accent:oklch(25% .06 250);--accent-foreground:oklch(80% .14 220);--destructive:oklch(55% .18 25);--destructive-foreground:oklch(96% .01 90);--border:oklch(25% .04 250);--input:oklch(25% .04 250);--ring:oklch(65% .18 250);--chart-1:oklch(65% .18 250);--chart-2:oklch(72% .19 145);--chart-3:oklch(70% .15 220);--chart-4:oklch(80% .16 85);--chart-5:oklch(55% .15 255);--sidebar:oklch(14% .035 250);--sidebar-foreground:oklch(96% .01 90);--sidebar-primary:oklch(65% .18 250);--sidebar-primary-foreground:oklch(12% .03 250);--sidebar-accent:oklch(25% .06 250);--sidebar-accent-foreground:oklch(80% .14 220);--sidebar-border:oklch(25% .04 250);--sidebar-ring:oklch(65% .18 250)}@keyframes statusPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.05)}}@keyframes slideInFromRight{0%{opacity:0;transform:translate(1rem)}to{opacity:1;transform:translate(0)}}@keyframes scanLine{0%{background-position:-100% 0}to{background-position:200% 0}}.animate-status-pulse{animation:2s ease-in-out infinite statusPulse}.animate-slide-in-right{animation:.3s ease-out forwards slideInFromRight}.animate-scan-line{background:linear-gradient(90deg,transparent 0%,var(--accent-glow)50%,transparent 100%);background-size:200% 100%;animation:1.5s ease-in-out infinite scanLine}@keyframes fadeInUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in-up{animation:.4s ease-out forwards fadeInUp}.stagger-children>*{opacity:0;animation:.3s ease-out forwards fadeInUp}.stagger-children>:first-child{animation-delay:50ms}.stagger-children>:nth-child(2){animation-delay:.1s}.stagger-children>:nth-child(3){animation-delay:.15s}.stagger-children>:nth-child(4){animation-delay:.2s}.stagger-children>:nth-child(5){animation-delay:.25s}.stagger-children>:nth-child(6){animation-delay:.3s}@keyframes radarPulse{0%{opacity:.6;transform:scale(1)}to{opacity:0;transform:scale(2.5)}}@keyframes radarSweep{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes dataFlow{0%{stroke-dashoffset:100px}to{stroke-dashoffset:0}}@keyframes signalPulse{0%,to{opacity:1;transform:scaleY(1)}50%{opacity:.7;transform:scaleY(.95)}}@keyframes scanline{0%{opacity:0;top:-10%}10%{opacity:.5}90%{opacity:.5}to{opacity:0;top:110%}}@keyframes glowPulse{0%,to{box-shadow:0 0 8px var(--accent-glow)}50%{box-shadow:0 0 20px var(--accent-glow),0 0 40px var(--accent-primary)}}@keyframes flightPath{0%{stroke-dashoffset:1000px;opacity:0}10%{opacity:1}to{stroke-dashoffset:0;opacity:1}}@keyframes connectingPulse{0%,to{box-shadow:0 0 8px var(--status-processing);border-color:var(--status-processing);opacity:1}50%{box-shadow:0 0 15px var(--status-processing),0 0 30px var(--status-processing);border-color:var(--accent-primary);opacity:.8}}.animate-radar-pulse{animation:2s ease-out infinite radarPulse}.animate-radar-sweep{animation:4s linear infinite radarSweep}.animate-data-flow{animation:1.5s ease-in-out forwards dataFlow}.animate-signal-pulse{animation:1.5s ease-in-out infinite signalPulse}.animate-scanline{animation:3s linear infinite scanline}.animate-glow-pulse{animation:2s ease-in-out infinite glowPulse}.animate-connecting-pulse{animation:1s ease-in-out infinite connectingPulse}.animate-flight-path{animation:2s ease-out forwards flightPath}.delay-0{animation-delay:0s}.delay-75{animation-delay:75ms}.delay-100{animation-delay:.1s}.delay-150{animation-delay:.15s}.delay-200{animation-delay:.2s}.delay-300{animation-delay:.3s}.delay-400{animation-delay:.4s}.delay-500{animation-delay:.5s}.aviation-grid{background-image:linear-gradient(rgba(var(--accent-glow-rgb),.03)1px,transparent 1px),linear-gradient(90deg,rgba(var(--accent-glow-rgb),.03)1px,transparent 1px);background-size:20px 20px}.btn-cockpit{border-radius:calc(var(--radius) - 2px);padding-inline:calc(var(--spacing)*4);padding-block:calc(var(--spacing)*2);font-family:JetBrains Mono,Fira Code,monospace;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider);text-transform:uppercase;background:linear-gradient(to bottom,var(--bg-elevated),var(--bg-panel));border:1px solid var(--border-default);position:relative;box-shadow:inset 0 1px #ffffff1a,0 2px 4px #0000004d}.btn-cockpit:active{transform:translateY(1px);box-shadow:inset 0 2px 4px #0000004d}.instrument-segment{border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--border-subtle);padding-inline:calc(var(--spacing)*3);padding-block:calc(var(--spacing)*1);font-family:JetBrains Mono,Fira Code,monospace;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));background:linear-gradient(#0000,#0000001a)}.instrument-segment:last-child{border-right:none}.card-glow{transition:box-shadow .2s ease-out,border-color .2s ease-out}.card-glow:hover{box-shadow:0 0 20px var(--accent-primary)}@supports (color:color-mix(in lab,red,red)){.card-glow:hover{box-shadow:0 0 20px color-mix(in oklch,var(--accent-primary)15%,transparent)}}.card-glow:hover{border-color:var(--accent-primary)}.btn-mechanical{transition:transform .1s ease-out,box-shadow .1s ease-out}.btn-mechanical:active{box-shadow:none;transform:translateY(2px)}.dark ::-webkit-scrollbar{width:8px;height:8px}.dark ::-webkit-scrollbar-track{background:var(--bg-panel)}.dark ::-webkit-scrollbar-thumb{background:var(--border-default);border-radius:4px}.dark ::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}.focus-ring:focus{--tw-outline-style:none;outline-style:none}.focus-ring:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--ring);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} diff --git a/cmd/proxypilotui/assets/assets/index.js b/cmd/proxypilotui/assets/assets/index.js index 611fcd1f..0d6a16e4 100644 --- a/cmd/proxypilotui/assets/assets/index.js +++ b/cmd/proxypilotui/assets/assets/index.js @@ -1,338 +1,2 @@ -function xv(l,o){for(var c=0;cu[f]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))u(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const g of m.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&u(g)}).observe(document,{childList:!0,subtree:!0});function c(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function u(f){if(f.ep)return;f.ep=!0;const m=c(f);fetch(f.href,m)}})();function Lp(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var cu={exports:{}},tr={};var Zh;function vv(){if(Zh)return tr;Zh=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function c(u,f,m){var g=null;if(m!==void 0&&(g=""+m),f.key!==void 0&&(g=""+f.key),"key"in f){m={};for(var v in f)v!=="key"&&(m[v]=f[v])}else m=f;return f=m.ref,{$$typeof:l,type:u,key:g,ref:f!==void 0?f:null,props:m}}return tr.Fragment=o,tr.jsx=c,tr.jsxs=c,tr}var Kh;function yv(){return Kh||(Kh=1,cu.exports=vv()),cu.exports}var s=yv(),uu={exports:{}},_e={};var Jh;function bv(){if(Jh)return _e;Jh=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),g=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),N=Symbol.iterator;function E(S){return S===null||typeof S!="object"?null:(S=N&&S[N]||S["@@iterator"],typeof S=="function"?S:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,G={};function T(S,Q,$){this.props=S,this.context=Q,this.refs=G,this.updater=$||A}T.prototype.isReactComponent={},T.prototype.setState=function(S,Q){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,Q,"setState")},T.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function K(){}K.prototype=T.prototype;function q(S,Q,$){this.props=S,this.context=Q,this.refs=G,this.updater=$||A}var F=q.prototype=new K;F.constructor=q,U(F,T.prototype),F.isPureReactComponent=!0;var ae=Array.isArray;function te(){}var _={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function Y(S,Q,$){var ee=$.ref;return{$$typeof:l,type:S,key:Q,ref:ee!==void 0?ee:null,props:$}}function z(S,Q){return Y(S.type,Q,S.props)}function se(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function ie(S){var Q={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function($){return Q[$]})}var O=/\/+/g;function ne(S,Q){return typeof S=="object"&&S!==null&&S.key!=null?ie(""+S.key):Q.toString(36)}function oe(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(te,te):(S.status="pending",S.then(function(Q){S.status==="pending"&&(S.status="fulfilled",S.value=Q)},function(Q){S.status==="pending"&&(S.status="rejected",S.reason=Q)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function k(S,Q,$,ee,re){var xe=typeof S;(xe==="undefined"||xe==="boolean")&&(S=null);var ue=!1;if(S===null)ue=!0;else switch(xe){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(S.$$typeof){case l:case o:ue=!0;break;case b:return ue=S._init,k(ue(S._payload),Q,$,ee,re)}}if(ue)return re=re(S),ue=ee===""?"."+ne(S,0):ee,ae(re)?($="",ue!=null&&($=ue.replace(O,"$&/")+"/"),k(re,Q,$,"",function(We){return We})):re!=null&&(se(re)&&(re=z(re,$+(re.key==null||S&&S.key===re.key?"":(""+re.key).replace(O,"$&/")+"/")+ue)),Q.push(re)),1;ue=0;var we=ee===""?".":ee+":";if(ae(S))for(var Te=0;Te>>1,ge=k[ce];if(0>>1;cef($,B))eef(re,$)?(k[ce]=re,k[ee]=B,ce=ee):(k[ce]=$,k[Q]=B,ce=Q);else if(eef(re,B))k[ce]=re,k[ee]=B,ce=ee;else break e}}return V}function f(k,V){var B=k.sortIndex-V.sortIndex;return B!==0?B:k.id-V.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var g=Date,v=g.now();l.unstable_now=function(){return g.now()-v}}var x=[],p=[],b=1,h=null,N=3,E=!1,A=!1,U=!1,G=!1,T=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function F(k){for(var V=c(p);V!==null;){if(V.callback===null)u(p);else if(V.startTime<=k)u(p),V.sortIndex=V.expirationTime,o(x,V);else break;V=c(p)}}function ae(k){if(U=!1,F(k),!A)if(c(x)!==null)A=!0,te||(te=!0,ie());else{var V=c(p);V!==null&&oe(ae,V.startTime-k)}}var te=!1,_=-1,L=5,Y=-1;function z(){return G?!0:!(l.unstable_now()-Yk&&z());){var ce=h.callback;if(typeof ce=="function"){h.callback=null,N=h.priorityLevel;var ge=ce(h.expirationTime<=k);if(k=l.unstable_now(),typeof ge=="function"){h.callback=ge,F(k),V=!0;break t}h===c(x)&&u(x),F(k)}else u(x);h=c(x)}if(h!==null)V=!0;else{var S=c(p);S!==null&&oe(ae,S.startTime-k),V=!1}}break e}finally{h=null,N=B,E=!1}V=void 0}}finally{V?ie():te=!1}}}var ie;if(typeof q=="function")ie=function(){q(se)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,ne=O.port2;O.port1.onmessage=se,ie=function(){ne.postMessage(null)}}else ie=function(){T(se,0)};function oe(k,V){_=T(function(){k(l.unstable_now())},V)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(k){k.callback=null},l.unstable_forceFrameRate=function(k){0>k||125ce?(k.sortIndex=B,o(p,k),c(x)===null&&k===c(p)&&(U?(K(_),_=-1):U=!0,oe(ae,B-ce))):(k.sortIndex=ge,o(x,k),A||E||(A=!0,te||(te=!0,ie()))),k},l.unstable_shouldYield=z,l.unstable_wrapCallback=function(k){var V=N;return function(){var B=N;N=V;try{return k.apply(this,arguments)}finally{N=B}}}})(mu)),mu}var Ph;function Nv(){return Ph||(Ph=1,fu.exports=wv()),fu.exports}var hu={exports:{}},Nt={};var Ih;function jv(){if(Ih)return Nt;Ih=1;var l=Lu();function o(x){var p="https://react.dev/errors/"+x;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),hu.exports=jv(),hu.exports}var tp;function Sv(){if(tp)return ar;tp=1;var l=Nv(),o=Lu(),c=Up();function u(e){var t="https://react.dev/errors/"+e;if(1ge||(e.current=ce[ge],ce[ge]=null,ge--)}function $(e,t){ge++,ce[ge]=e.current,e.current=t}var ee=S(null),re=S(null),xe=S(null),ue=S(null);function we(e,t){switch($(xe,t),$(re,e),$(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gh(t),e=xh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Q(ee),$(ee,e)}function Te(){Q(ee),Q(re),Q(xe)}function We(e){e.memoizedState!==null&&$(ue,e);var t=ee.current,a=xh(t,e.type);t!==a&&($(re,e),$(ee,a))}function it(e){re.current===e&&(Q(ee),Q(re)),ue.current===e&&(Q(ue),Wl._currentValue=B)}var qe,P;function Ye(e){if(qe===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);qe=t&&t[1]||"",P=-1)":-1r||j[n]!==D[r]){var J=` -`+j[n].replace(" at new "," at ");return e.displayName&&J.includes("")&&(J=J.replace("",e.displayName)),J}while(1<=n&&0<=r);break}}}finally{Z=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ye(a):""}function at(e,t){switch(e.tag){case 26:case 27:case 5:return Ye(e.type);case 16:return Ye("Lazy");case 13:return e.child!==t&&t!==null?Ye("Suspense Fallback"):Ye("Suspense");case 19:return Ye("SuspenseList");case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return Ye("Activity");default:return""}}function _t(e){try{var t="",a=null;do t+=at(e,a),a=e,e=e.return;while(e);return t}catch(n){return` -Error generating stack: `+n.message+` -`+n.stack}}var Xt=Object.prototype.hasOwnProperty,il=l.unstable_scheduleCallback,cl=l.unstable_cancelCallback,Et=l.unstable_shouldYield,ln=l.unstable_requestPaint,Ct=l.unstable_now,Wo=l.unstable_getCurrentPriorityLevel,Un=l.unstable_ImmediatePriority,cr=l.unstable_UserBlockingPriority,Hn=l.unstable_NormalPriority,ul=l.unstable_LowPriority,La=l.unstable_IdlePriority,ur=l.log,rn=l.unstable_setDisableYieldValue,Bn=null,Tt=null;function fa(e){if(typeof ur=="function"&&rn(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(Bn,e)}catch{}}var bt=Math.clz32?Math.clz32:ja,Po=Math.log,dl=Math.LN2;function ja(e){return e>>>=0,e===0?32:31-(Po(e)/dl|0)|0}var cs=256,us=262144,qn=4194304;function Sa(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Se(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var y=n&134217727;return y!==0?(n=y&~i,n!==0?r=Sa(n):(d&=y,d!==0?r=Sa(d):a||(a=y&~e,a!==0&&(r=Sa(a))))):(y=n&~i,y!==0?r=Sa(y):d!==0?r=Sa(d):a||(a=n&~e,a!==0&&(r=Sa(a)))),r===0?0:t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:r}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wt(){var e=qn;return qn<<=1,(qn&62914560)===0&&(qn=4194304),e}function on(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Fe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ot(e,t,a,n,r,i){var d=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var y=e.entanglements,j=e.expirationTimes,D=e.hiddenUpdates;for(a=d&~a;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var dg=/[\n"\\]/g;function ta(e){return e.replace(dg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ni(e,t,a,n,r,i,d,y){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ea(t)):e.value!==""+ea(t)&&(e.value=""+ea(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?si(e,d,ea(t)):a!=null?si(e,d,ea(a)):n!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+ea(y):e.removeAttribute("name")}function cd(e,t,a,n,r,i,d,y){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){ai(e);return}a=a!=null?""+ea(a):"",t=t!=null?""+ea(t):a,y||t===e.value||(e.value=t),e.defaultValue=t}n=n??r,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=y?e.checked:!!n,e.defaultChecked=!!n,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),ai(e)}function si(e,t,a){t==="number"&&mr(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function xs(e,t,a,n){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ci=!1;if(Ba)try{var pl={};Object.defineProperty(pl,"passive",{get:function(){ci=!0}}),window.addEventListener("test",pl,pl),window.removeEventListener("test",pl,pl)}catch{ci=!1}var un=null,ui=null,pr=null;function gd(){if(pr)return pr;var e,t=ui,a=t.length,n,r="value"in un?un.value:un.textContent,i=r.length;for(e=0;e=vl),Nd=" ",jd=!1;function Sd(e,t){switch(e){case"keyup":return Bg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _d(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ws=!1;function Yg(e,t){switch(e){case"compositionend":return _d(t);case"keypress":return t.which!==32?null:(jd=!0,Nd);case"textInput":return e=t.data,e===Nd&&jd?null:e;default:return null}}function Gg(e,t){if(ws)return e==="compositionend"||!pi&&Sd(e,t)?(e=gd(),pr=ui=un=null,ws=!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:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=zd(a)}}function Dd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ld(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mr(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=mr(e.document)}return t}function vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Fg=Ba&&"documentMode"in document&&11>=document.documentMode,Ns=null,yi=null,Nl=null,bi=!1;function Ud(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;bi||Ns==null||Ns!==mr(n)||(n=Ns,"selectionStart"in n&&vi(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Nl&&wl(Nl,n)||(Nl=n,n=io(yi,"onSelect"),0>=d,r-=d,_a=1<<32-bt(t)+r|a<Ce?(ze=pe,pe=null):ze=pe.sibling;var Le=H(M,pe,R[Ce],W);if(Le===null){pe===null&&(pe=ze);break}e&&pe&&Le.alternate===null&&t(M,pe),C=i(Le,C,Ce),De===null?ye=Le:De.sibling=Le,De=Le,pe=ze}if(Ce===R.length)return a(M,pe),Re&&Ya(M,Ce),ye;if(pe===null){for(;CeCe?(ze=pe,pe=null):ze=pe.sibling;var On=H(M,pe,Le.value,W);if(On===null){pe===null&&(pe=ze);break}e&&pe&&On.alternate===null&&t(M,pe),C=i(On,C,Ce),De===null?ye=On:De.sibling=On,De=On,pe=ze}if(Le.done)return a(M,pe),Re&&Ya(M,Ce),ye;if(pe===null){for(;!Le.done;Ce++,Le=R.next())Le=I(M,Le.value,W),Le!==null&&(C=i(Le,C,Ce),De===null?ye=Le:De.sibling=Le,De=Le);return Re&&Ya(M,Ce),ye}for(pe=n(pe);!Le.done;Ce++,Le=R.next())Le=X(pe,M,Ce,Le.value,W),Le!==null&&(e&&Le.alternate!==null&&pe.delete(Le.key===null?Ce:Le.key),C=i(Le,C,Ce),De===null?ye=Le:De.sibling=Le,De=Le);return e&&pe.forEach(function(gv){return t(M,gv)}),Re&&Ya(M,Ce),ye}function Xe(M,C,R,W){if(typeof R=="object"&&R!==null&&R.type===U&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case E:e:{for(var ye=R.key;C!==null;){if(C.key===ye){if(ye=R.type,ye===U){if(C.tag===7){a(M,C.sibling),W=r(C,R.props.children),W.return=M,M=W;break e}}else if(C.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===L&&Pn(ye)===C.type){a(M,C.sibling),W=r(C,R.props),Tl(W,R),W.return=M,M=W;break e}a(M,C);break}else t(M,C);C=C.sibling}R.type===U?(W=Zn(R.props.children,M.mode,W,R.key),W.return=M,M=W):(W=_r(R.type,R.key,R.props,null,M.mode,W),Tl(W,R),W.return=M,M=W)}return d(M);case A:e:{for(ye=R.key;C!==null;){if(C.key===ye)if(C.tag===4&&C.stateNode.containerInfo===R.containerInfo&&C.stateNode.implementation===R.implementation){a(M,C.sibling),W=r(C,R.children||[]),W.return=M,M=W;break e}else{a(M,C);break}else t(M,C);C=C.sibling}W=Ci(R,M.mode,W),W.return=M,M=W}return d(M);case L:return R=Pn(R),Xe(M,C,R,W)}if(oe(R))return de(M,C,R,W);if(ie(R)){if(ye=ie(R),typeof ye!="function")throw Error(u(150));return R=ye.call(R),be(M,C,R,W)}if(typeof R.then=="function")return Xe(M,C,Or(R),W);if(R.$$typeof===q)return Xe(M,C,Tr(M,R),W);zr(M,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,C!==null&&C.tag===6?(a(M,C.sibling),W=r(C,R),W.return=M,M=W):(a(M,C),W=Ei(R,M.mode,W),W.return=M,M=W),d(M)):a(M,C)}return function(M,C,R,W){try{Cl=0;var ye=Xe(M,C,R,W);return zs=null,ye}catch(pe){if(pe===Os||pe===Ar)throw pe;var De=Qt(29,pe,null,M.mode);return De.lanes=W,De.return=M,De}}}var es=rf(!0),of=rf(!1),pn=!1;function Bi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function gn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xn(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ue&2)!==0){var r=n.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),n.pending=t,t=Sr(e),Xd(e,null,a),t}return jr(e,n,t,a),Sr(e)}function kl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,zt(e,a)}}function Yi(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var r=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?r=i=d:i=i.next=d,a=a.next}while(a!==null);i===null?r=i=t:i=i.next=t}else r=i=t;a={baseState:n.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Gi=!1;function Al(){if(Gi){var e=Ms;if(e!==null)throw e}}function Ml(e,t,a,n){Gi=!1;var r=e.updateQueue;pn=!1;var i=r.firstBaseUpdate,d=r.lastBaseUpdate,y=r.shared.pending;if(y!==null){r.shared.pending=null;var j=y,D=j.next;j.next=null,d===null?i=D:d.next=D,d=j;var J=e.alternate;J!==null&&(J=J.updateQueue,y=J.lastBaseUpdate,y!==d&&(y===null?J.firstBaseUpdate=D:y.next=D,J.lastBaseUpdate=j))}if(i!==null){var I=r.baseState;d=0,J=D=j=null,y=i;do{var H=y.lane&-536870913,X=H!==y.lane;if(X?(Oe&H)===H:(n&H)===H){H!==0&&H===As&&(Gi=!0),J!==null&&(J=J.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var de=e,be=y;H=t;var Xe=a;switch(be.tag){case 1:if(de=be.payload,typeof de=="function"){I=de.call(Xe,I,H);break e}I=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=be.payload,H=typeof de=="function"?de.call(Xe,I,H):de,H==null)break e;I=h({},I,H);break e;case 2:pn=!0}}H=y.callback,H!==null&&(e.flags|=64,X&&(e.flags|=8192),X=r.callbacks,X===null?r.callbacks=[H]:X.push(H))}else X={lane:H,tag:y.tag,payload:y.payload,callback:y.callback,next:null},J===null?(D=J=X,j=I):J=J.next=X,d|=H;if(y=y.next,y===null){if(y=r.shared.pending,y===null)break;X=y,y=X.next,X.next=null,r.lastBaseUpdate=X,r.shared.pending=null}}while(!0);J===null&&(j=I),r.baseState=j,r.firstBaseUpdate=D,r.lastBaseUpdate=J,i===null&&(r.shared.lanes=0),Nn|=d,e.lanes=d,e.memoizedState=I}}function cf(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function uf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;ei?i:8;var d=k.T,y={};k.T=y,oc(e,!1,t,a);try{var j=r(),D=k.S;if(D!==null&&D(y,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var J=lx(j,n);Rl(e,t,J,Wt(e))}else Rl(e,t,n,Wt(e))}catch(I){Rl(e,t,{then:function(){},status:"rejected",reason:I},Wt())}finally{V.p=i,d!==null&&y.types!==null&&(d.types=y.types),k.T=d}}function dx(){}function lc(e,t,a,n){if(e.tag!==5)throw Error(u(476));var r=Gf(e).queue;Yf(e,r,t,B,a===null?dx:function(){return Vf(e),a(n)})}function Gf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:B},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Vf(e){var t=Gf(e);t.next===null&&(t=e.alternate.memoizedState),Rl(e,t.next.queue,{},Wt())}function rc(){return gt(Wl)}function Xf(){return tt().memoizedState}function $f(){return tt().memoizedState}function fx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Wt();e=gn(a);var n=xn(t,e,a);n!==null&&(Yt(n,t,a),kl(n,t,a)),t={cache:Di()},e.payload=t;return}t=t.return}}function mx(e,t,a){var n=Wt();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Vr(e)?Zf(t,a):(a=Si(e,t,a,n),a!==null&&(Yt(a,e,n),Kf(a,t,n)))}function Qf(e,t,a){var n=Wt();Rl(e,t,a,n)}function Rl(e,t,a,n){var r={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Vr(e))Zf(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,y=i(d,a);if(r.hasEagerState=!0,r.eagerState=y,$t(y,d))return jr(e,t,r,0),$e===null&&Nr(),!1}catch{}if(a=Si(e,t,r,n),a!==null)return Yt(a,e,n),Kf(a,t,n),!0}return!1}function oc(e,t,a,n){if(n={lane:2,revertLane:Bc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vr(e)){if(t)throw Error(u(479))}else t=Si(e,a,n,2),t!==null&&Yt(t,e,2)}function Vr(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Zf(e,t){Ds=Lr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Kf(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,zt(e,a)}}var Dl={readContext:gt,use:Br,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useLayoutEffect:Pe,useInsertionEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useSyncExternalStore:Pe,useId:Pe,useHostTransitionStatus:Pe,useFormState:Pe,useActionState:Pe,useOptimistic:Pe,useMemoCache:Pe,useCacheRefresh:Pe};Dl.useEffectEvent=Pe;var Jf={readContext:gt,use:Br,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Of,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Yr(4194308,4,Lf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Yr(4194308,4,e,t)},useInsertionEffect:function(e,t){Yr(4,2,e,t)},useMemo:function(e,t){var a=kt();t=t===void 0?null:t;var n=e();if(ts){fa(!0);try{e()}finally{fa(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=kt();if(a!==void 0){var r=a(t);if(ts){fa(!0);try{a(t)}finally{fa(!1)}}}else r=t;return n.memoizedState=n.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},n.queue=e,e=e.dispatch=mx.bind(null,Ee,e),[n.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:function(e){e=ec(e);var t=e.queue,a=Qf.bind(null,Ee,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:nc,useDeferredValue:function(e,t){var a=kt();return sc(a,e,t)},useTransition:function(){var e=ec(!1);return e=Yf.bind(null,Ee,e.queue,!0,!1),kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Ee,r=kt();if(Re){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),$e===null)throw Error(u(349));(Oe&127)!==0||gf(n,t,a)}r.memoizedState=a;var i={value:a,getSnapshot:t};return r.queue=i,Of(vf.bind(null,n,i,e),[e]),n.flags|=2048,Us(9,{destroy:void 0},xf.bind(null,n,i,a,t),null),a},useId:function(){var e=kt(),t=$e.identifierPrefix;if(Re){var a=Ea,n=_a;a=(n&~(1<<32-bt(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Ur++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?d.createElement("select",{is:n.is}):d.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?d.createElement(r,{is:n.is}):d.createElement(r)}}i[ht]=t,i[Dt]=n;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=i;e:switch(vt(i,r,n),r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Za(t)}}return Ze(t),wc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Za(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=xe.current,Ts(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,r=pt,r!==null)switch(r.tag){case 27:case 5:n=r.memoizedProps}e[ht]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||hh(e.nodeValue,a)),e||mn(t,!0)}else e=co(e).createTextNode(n),e[ht]=t,t.stateNode=e}return Ze(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ts(t),a!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[ht]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else a=Mi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Kt(t),t):(Kt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ze(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Ts(t),n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(u(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(u(317));r[ht]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),r=!1}else r=Mi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Kt(t),t):(Kt(t),null)}return Kt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,r=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(r=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==r&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Kr(t,t.updateQueue),Ze(t),null);case 4:return Te(),e===null&&Vc(t.stateNode.containerInfo),Ze(t),null;case 10:return Va(t.type),Ze(t),null;case 19:if(Q(et),n=t.memoizedState,n===null)return Ze(t),null;if(r=(t.flags&128)!==0,i=n.rendering,i===null)if(r)Ul(n,!1);else{if(Ie!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Dr(e),i!==null){for(t.flags|=128,Ul(n,!1),e=i.updateQueue,t.updateQueue=e,Kr(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)$d(a,e),a=a.sibling;return $(et,et.current&1|2),Re&&Ya(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Ct()>Ir&&(t.flags|=128,r=!0,Ul(n,!1),t.lanes=4194304)}else{if(!r)if(e=Dr(i),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Kr(t,e),Ul(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!Re)return Ze(t),null}else 2*Ct()-n.renderingStartTime>Ir&&a!==536870912&&(t.flags|=128,r=!0,Ul(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Ct(),e.sibling=null,a=et.current,$(et,r?a&1|2:a&1),Re&&Ya(t,n.treeForkCount),e):(Ze(t),null);case 22:case 23:return Kt(t),Xi(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),a=t.updateQueue,a!==null&&Kr(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&Q(Wn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Va(nt),Ze(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function vx(e,t){switch(ki(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Va(nt),Te(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return it(t),null;case 31:if(t.memoizedState!==null){if(Kt(t),t.alternate===null)throw Error(u(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Kt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Q(et),null;case 4:return Te(),null;case 10:return Va(t.type),null;case 22:case 23:return Kt(t),Xi(),e!==null&&Q(Wn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Va(nt),null;case 25:return null;default:return null}}function ym(e,t){switch(ki(t),t.tag){case 3:Va(nt),Te();break;case 26:case 27:case 5:it(t);break;case 4:Te();break;case 31:t.memoizedState!==null&&Kt(t);break;case 13:Kt(t);break;case 19:Q(et);break;case 10:Va(t.type);break;case 22:case 23:Kt(t),Xi(),e!==null&&Q(Wn);break;case 24:Va(nt)}}function Hl(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var r=n.next;a=r;do{if((a.tag&e)===e){n=void 0;var i=a.create,d=a.inst;n=i(),d.destroy=n}a=a.next}while(a!==r)}}catch(y){Be(t,t.return,y)}}function bn(e,t,a){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){var d=n.inst,y=d.destroy;if(y!==void 0){d.destroy=void 0,r=t;var j=a,D=y;try{D()}catch(J){Be(r,j,J)}}}n=n.next}while(n!==i)}}catch(J){Be(t,t.return,J)}}function bm(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{uf(t,a)}catch(n){Be(e,e.return,n)}}}function wm(e,t,a){a.props=as(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Be(e,t,n)}}function Bl(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(r){Be(e,t,r)}}function Ca(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(r){Be(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){Be(e,t,r)}else a.current=null}function Nm(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(r){Be(e,e.return,r)}}function Nc(e,t,a){try{var n=e.stateNode;qx(n,e.type,a,t),n[Dt]=t}catch(r){Be(e,e.return,r)}}function jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cn(e.type)||e.tag===4}function jc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jm(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.tag===27&&Cn(e.type)||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 Sc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ha));else if(n!==4&&(n===27&&Cn(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Sc(e,t,a),e=e.sibling;e!==null;)Sc(e,t,a),e=e.sibling}function Jr(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Cn(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Jr(e,t,a),e=e.sibling;e!==null;)Jr(e,t,a),e=e.sibling}function Sm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);vt(t,n,a),t[ht]=e,t[Dt]=a}catch(i){Be(e,e.return,i)}}var Ka=!1,rt=!1,_c=!1,_m=typeof WeakSet=="function"?WeakSet:Set,mt=null;function yx(e,t){if(e=e.containerInfo,Qc=xo,e=Ld(e),vi(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var r=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var d=0,y=-1,j=-1,D=0,J=0,I=e,H=null;t:for(;;){for(var X;I!==a||r!==0&&I.nodeType!==3||(y=d+r),I!==i||n!==0&&I.nodeType!==3||(j=d+n),I.nodeType===3&&(d+=I.nodeValue.length),(X=I.firstChild)!==null;)H=I,I=X;for(;;){if(I===e)break t;if(H===a&&++D===r&&(y=d),H===i&&++J===n&&(j=d),(X=I.nextSibling)!==null)break;I=H,H=I.parentNode}I=X}a=y===-1||j===-1?null:{start:y,end:j}}else a=null}a=a||{start:0,end:0}}else a=null;for(Zc={focusedElem:e,selectionRange:a},xo=!1,mt=t;mt!==null;)if(t=mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,mt=e;else for(;mt!==null;){switch(t=mt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a title"))),vt(i,n,a),i[ht]=e,ft(i),n=i;break e;case"link":var d=Mh("link","href",r).get(n+(a.href||""));if(d){for(var y=0;yXe&&(d=Xe,Xe=be,be=d);var M=Rd(y,be),C=Rd(y,Xe);if(M&&C&&(X.rangeCount!==1||X.anchorNode!==M.node||X.anchorOffset!==M.offset||X.focusNode!==C.node||X.focusOffset!==C.offset)){var R=I.createRange();R.setStart(M.node,M.offset),X.removeAllRanges(),be>Xe?(X.addRange(R),X.extend(C.node,C.offset)):(R.setEnd(C.node,C.offset),X.addRange(R))}}}}for(I=[],X=y;X=X.parentNode;)X.nodeType===1&&I.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;ya?32:a,k.T=null,a=Oc,Oc=null;var i=Sn,d=Ia;if(ct=0,Gs=Sn=null,Ia=0,(Ue&6)!==0)throw Error(u(331));var y=Ue;if(Ue|=4,Lm(i.current),zm(i,i.current,d,a),Ue=y,$l(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Bn,i)}catch{}return!0}finally{V.p=r,k.T=n,eh(e,t)}}function ah(e,t,a){t=na(a,t),t=dc(e.stateNode,t,2),e=xn(e,t,2),e!==null&&(Fe(e,2),Ta(e))}function Be(e,t,a){if(e.tag===3)ah(e,e,a);else for(;t!==null;){if(t.tag===3){ah(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(jn===null||!jn.has(n))){e=na(a,e),a=nm(2),n=xn(t,a,2),n!==null&&(sm(a,n,t,e),Fe(n,2),Ta(n));break}}t=t.return}}function Lc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Nx;var r=new Set;n.set(t,r)}else r=n.get(t),r===void 0&&(r=new Set,n.set(t,r));r.has(a)||(Tc=!0,r.add(a),e=Cx.bind(null,e,t,a),t.then(e,e))}function Cx(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,$e===e&&(Oe&a)===a&&(Ie===4||Ie===3&&(Oe&62914560)===Oe&&300>Ct()-Pr?(Ue&2)===0&&Vs(e,0):kc|=a,Ys===Oe&&(Ys=0)),Ta(e)}function nh(e,t){t===0&&(t=wt()),e=Qn(e,t),e!==null&&(Fe(e,t),Ta(e))}function Tx(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),nh(e,a)}function kx(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),nh(e,a)}function Ax(e,t){return il(e,t)}var lo=null,$s=null,Uc=!1,ro=!1,Hc=!1,En=0;function Ta(e){e!==$s&&e.next===null&&($s===null?lo=$s=e:$s=$s.next=e),ro=!0,Uc||(Uc=!0,Ox())}function $l(e,t){if(!Hc&&ro){Hc=!0;do for(var a=!1,n=lo;n!==null;){if(e!==0){var r=n.pendingLanes;if(r===0)var i=0;else{var d=n.suspendedLanes,y=n.pingedLanes;i=(1<<31-bt(42|e)+1)-1,i&=r&~(d&~y),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,oh(n,i))}else i=Oe,i=Se(n,n===$e?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||Ke(n,i)||(a=!0,oh(n,i));n=n.next}while(a);Hc=!1}}function Mx(){sh()}function sh(){ro=Uc=!1;var e=0;En!==0&&Gx()&&(e=En);for(var t=Ct(),a=null,n=lo;n!==null;){var r=n.next,i=lh(n,t);i===0?(n.next=null,a===null?lo=r:a.next=r,r===null&&($s=a)):(a=n,(e!==0||(i&3)!==0)&&(ro=!0)),n=r}ct!==0&&ct!==5||$l(e),En!==0&&(En=0)}function lh(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0y)break;var J=j.transferSize,I=j.initiatorType;J&&ph(I)&&(j=j.responseEnd,d+=J*(j"u"?null:document;function Ch(e,t,a){var n=Qs;if(n&&typeof t=="string"&&t){var r=ta(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),Eh.has(r)||(Eh.add(r),e={rel:e,crossOrigin:a,href:t},n.querySelector(r)===null&&(t=n.createElement("link"),vt(t,"link",e),ft(t),n.head.appendChild(t)))}}function Wx(e){en.D(e),Ch("dns-prefetch",e,null)}function Px(e,t){en.C(e,t),Ch("preconnect",e,t)}function Ix(e,t,a){en.L(e,t,a);var n=Qs;if(n&&e&&t){var r='link[rel="preload"][as="'+ta(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+ta(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+ta(a.imageSizes)+'"]')):r+='[href="'+ta(e)+'"]';var i=r;switch(t){case"style":i=Zs(e);break;case"script":i=Ks(e)}ca.has(i)||(e=h({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ca.set(i,e),n.querySelector(r)!==null||t==="style"&&n.querySelector(Jl(i))||t==="script"&&n.querySelector(Fl(i))||(t=n.createElement("link"),vt(t,"link",e),ft(t),n.head.appendChild(t)))}}function ev(e,t){en.m(e,t);var a=Qs;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+ta(n)+'"][href="'+ta(e)+'"]',i=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Ks(e)}if(!ca.has(i)&&(e=h({rel:"modulepreload",href:e},t),ca.set(i,e),a.querySelector(r)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Fl(i)))return}n=a.createElement("link"),vt(n,"link",e),ft(n),a.head.appendChild(n)}}}function tv(e,t,a){en.S(e,t,a);var n=Qs;if(n&&e){var r=ps(n).hoistableStyles,i=Zs(e);t=t||"default";var d=r.get(i);if(!d){var y={loading:0,preload:null};if(d=n.querySelector(Jl(i)))y.loading=5;else{e=h({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ca.get(i))&&eu(e,a);var j=d=n.createElement("link");ft(j),vt(j,"link",e),j._p=new Promise(function(D,J){j.onload=D,j.onerror=J}),j.addEventListener("load",function(){y.loading|=1}),j.addEventListener("error",function(){y.loading|=2}),y.loading|=4,fo(d,t,n)}d={type:"stylesheet",instance:d,count:1,state:y},r.set(i,d)}}}function av(e,t){en.X(e,t);var a=Qs;if(a&&e){var n=ps(a).hoistableScripts,r=Ks(e),i=n.get(r);i||(i=a.querySelector(Fl(r)),i||(e=h({src:e,async:!0},t),(t=ca.get(r))&&tu(e,t),i=a.createElement("script"),ft(i),vt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(r,i))}}function nv(e,t){en.M(e,t);var a=Qs;if(a&&e){var n=ps(a).hoistableScripts,r=Ks(e),i=n.get(r);i||(i=a.querySelector(Fl(r)),i||(e=h({src:e,async:!0,type:"module"},t),(t=ca.get(r))&&tu(e,t),i=a.createElement("script"),ft(i),vt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(r,i))}}function Th(e,t,a,n){var r=(r=xe.current)?uo(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Zs(a.href),a=ps(r).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Zs(a.href);var i=ps(r).hoistableStyles,d=i.get(e);if(d||(r=r.ownerDocument||r,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,d),(i=r.querySelector(Jl(e)))&&!i._p&&(d.instance=i,d.state.loading=5),ca.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ca.set(e,a),i||sv(r,e,a,d.state))),t&&n===null)throw Error(u(528,""));return d}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ks(a),a=ps(r).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Zs(e){return'href="'+ta(e)+'"'}function Jl(e){return'link[rel="stylesheet"]['+e+"]"}function kh(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function sv(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),vt(t,"link",a),ft(t),e.head.appendChild(t))}function Ks(e){return'[src="'+ta(e)+'"]'}function Fl(e){return"script[async]"+e}function Ah(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+ta(a.href)+'"]');if(n)return t.instance=n,ft(n),n;var r=h({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ft(n),vt(n,"style",r),fo(n,a.precedence,e),t.instance=n;case"stylesheet":r=Zs(a.href);var i=e.querySelector(Jl(r));if(i)return t.state.loading|=4,t.instance=i,ft(i),i;n=kh(a),(r=ca.get(r))&&eu(n,r),i=(e.ownerDocument||e).createElement("link"),ft(i);var d=i;return d._p=new Promise(function(y,j){d.onload=y,d.onerror=j}),vt(i,"link",n),t.state.loading|=4,fo(i,a.precedence,e),t.instance=i;case"script":return i=Ks(a.src),(r=e.querySelector(Fl(i)))?(t.instance=r,ft(r),r):(n=a,(r=ca.get(i))&&(n=h({},a),tu(n,r)),e=e.ownerDocument||e,r=e.createElement("script"),ft(r),vt(r,"link",n),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,fo(n,a.precedence,e));return t.instance}function fo(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=n.length?n[n.length-1]:null,i=r,d=0;d title"):null)}function lv(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function zh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function rv(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=Zs(n.href),i=t.querySelector(Jl(r));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ho.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,ft(i);return}i=t.ownerDocument||t,n=kh(n),(r=ca.get(r))&&eu(n,r),i=i.createElement("link"),ft(i);var d=i;d._p=new Promise(function(y,j){d.onload=y,d.onerror=j}),vt(i,"link",n),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=ho.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var au=0;function ov(e,t){return e.stylesheets&&e.count===0&&go(e,e.stylesheets),0au?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(r)}}:null}function ho(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)go(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var po=null;function go(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,po=new Map,t.forEach(iv,e),po=null,ho.call(e))}function iv(e,t){if(!(t.state.loading&4)){var a=po.get(e);if(a)var n=a.get(null);else{a=new Map,po.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),du.exports=Sv(),du.exports}var Ev=_v();function Aa(l,o,{checkForDefaultPrevented:c=!0}={}){return function(f){if(l?.(f),c===!1||!f.defaultPrevented)return o?.(f)}}function np(l,o){if(typeof l=="function")return l(o);l!=null&&(l.current=o)}function Hu(...l){return o=>{let c=!1;const u=l.map(f=>{const m=np(f,o);return!c&&typeof m=="function"&&(c=!0),m});if(c)return()=>{for(let f=0;f{const{scope:N,children:E,...A}=h,U=N?.[l]?.[x]||v,G=w.useMemo(()=>A,Object.values(A));return s.jsx(U.Provider,{value:G,children:E})};p.displayName=m+"Provider";function b(h,N){const E=N?.[l]?.[x]||v,A=w.useContext(E);if(A)return A;if(g!==void 0)return g;throw new Error(`\`${h}\` must be used within \`${m}\``)}return[p,b]}const f=()=>{const m=c.map(g=>w.createContext(g));return function(v){const x=v?.[l]||m;return w.useMemo(()=>({[`__scope${l}`]:{...v,[l]:x}}),[v,x])}};return f.scopeName=l,[u,Cv(f,...o)]}function Cv(...l){const o=l[0];if(l.length===1)return o;const c=()=>{const u=l.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(m){const g=u.reduce((v,{useScope:x,scopeName:p})=>{const h=x(m)[`__scope${p}`];return{...v,...h}},{});return w.useMemo(()=>({[`__scope${o.scopeName}`]:g}),[g])}};return c.scopeName=o.scopeName,c}var qu=Up();const Hp=Lp(qu);function Tv(l){const o=kv(l),c=w.forwardRef((u,f)=>{const{children:m,...g}=u,v=w.Children.toArray(m),x=v.find(Mv);if(x){const p=x.props.children,b=v.map(h=>h===x?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:h);return s.jsx(o,{...g,ref:f,children:w.isValidElement(p)?w.cloneElement(p,void 0,b):null})}return s.jsx(o,{...g,ref:f,children:m})});return c.displayName=`${l}.Slot`,c}function kv(l){const o=w.forwardRef((c,u)=>{const{children:f,...m}=c;if(w.isValidElement(f)){const g=zv(f),v=Ov(m,f.props);return f.type!==w.Fragment&&(v.ref=u?Hu(u,g):g),w.cloneElement(f,v)}return w.Children.count(f)>1?w.Children.only(null):null});return o.displayName=`${l}.SlotClone`,o}var Av=Symbol("radix.slottable");function Mv(l){return w.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===Av}function Ov(l,o){const c={...o};for(const u in o){const f=l[u],m=o[u];/^on[A-Z]/.test(u)?f&&m?c[u]=(...v)=>{const x=m(...v);return f(...v),x}:f&&(c[u]=f):u==="style"?c[u]={...f,...m}:u==="className"&&(c[u]=[f,m].filter(Boolean).join(" "))}return{...l,...c}}function zv(l){let o=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,c=o&&"isReactWarning"in o&&o.isReactWarning;return c?l.ref:(o=Object.getOwnPropertyDescriptor(l,"ref")?.get,c=o&&"isReactWarning"in o&&o.isReactWarning,c?l.props.ref:l.props.ref||l.ref)}var Rv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ra=Rv.reduce((l,o)=>{const c=Tv(`Primitive.${o}`),u=w.forwardRef((f,m)=>{const{asChild:g,...v}=f,x=g?c:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(x,{...v,ref:m})});return u.displayName=`Primitive.${o}`,{...l,[o]:u}},{});function Dv(l,o){l&&qu.flushSync(()=>l.dispatchEvent(o))}function Yo(l){const o=w.useRef(l);return w.useEffect(()=>{o.current=l}),w.useMemo(()=>(...c)=>o.current?.(...c),[])}function Lv(l,o=globalThis?.document){const c=Yo(l);w.useEffect(()=>{const u=f=>{f.key==="Escape"&&c(f)};return o.addEventListener("keydown",u,{capture:!0}),()=>o.removeEventListener("keydown",u,{capture:!0})},[c,o])}var Uv="DismissableLayer",Nu="dismissableLayer.update",Hv="dismissableLayer.pointerDownOutside",Bv="dismissableLayer.focusOutside",sp,Bp=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qp=w.forwardRef((l,o)=>{const{disableOutsidePointerEvents:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:g,onDismiss:v,...x}=l,p=w.useContext(Bp),[b,h]=w.useState(null),N=b?.ownerDocument??globalThis?.document,[,E]=w.useState({}),A=sn(o,_=>h(_)),U=Array.from(p.layers),[G]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=U.indexOf(G),K=b?U.indexOf(b):-1,q=p.layersWithOutsidePointerEventsDisabled.size>0,F=K>=T,ae=Gv(_=>{const L=_.target,Y=[...p.branches].some(z=>z.contains(L));!F||Y||(f?.(_),g?.(_),_.defaultPrevented||v?.())},N),te=Vv(_=>{const L=_.target;[...p.branches].some(z=>z.contains(L))||(m?.(_),g?.(_),_.defaultPrevented||v?.())},N);return Lv(_=>{K===p.layers.size-1&&(u?.(_),!_.defaultPrevented&&v&&(_.preventDefault(),v()))},N),w.useEffect(()=>{if(b)return c&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(sp=N.body.style.pointerEvents,N.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(b)),p.layers.add(b),lp(),()=>{c&&p.layersWithOutsidePointerEventsDisabled.size===1&&(N.body.style.pointerEvents=sp)}},[b,N,c,p]),w.useEffect(()=>()=>{b&&(p.layers.delete(b),p.layersWithOutsidePointerEventsDisabled.delete(b),lp())},[b,p]),w.useEffect(()=>{const _=()=>E({});return document.addEventListener(Nu,_),()=>document.removeEventListener(Nu,_)},[]),s.jsx(Ra.div,{...x,ref:A,style:{pointerEvents:q?F?"auto":"none":void 0,...l.style},onFocusCapture:Aa(l.onFocusCapture,te.onFocusCapture),onBlurCapture:Aa(l.onBlurCapture,te.onBlurCapture),onPointerDownCapture:Aa(l.onPointerDownCapture,ae.onPointerDownCapture)})});qp.displayName=Uv;var qv="DismissableLayerBranch",Yv=w.forwardRef((l,o)=>{const c=w.useContext(Bp),u=w.useRef(null),f=sn(o,u);return w.useEffect(()=>{const m=u.current;if(m)return c.branches.add(m),()=>{c.branches.delete(m)}},[c.branches]),s.jsx(Ra.div,{...l,ref:f})});Yv.displayName=qv;function Gv(l,o=globalThis?.document){const c=Yo(l),u=w.useRef(!1),f=w.useRef(()=>{});return w.useEffect(()=>{const m=v=>{if(v.target&&!u.current){let x=function(){Yp(Hv,c,p,{discrete:!0})};const p={originalEvent:v};v.pointerType==="touch"?(o.removeEventListener("click",f.current),f.current=x,o.addEventListener("click",f.current,{once:!0})):x()}else o.removeEventListener("click",f.current);u.current=!1},g=window.setTimeout(()=>{o.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(g),o.removeEventListener("pointerdown",m),o.removeEventListener("click",f.current)}},[o,c]),{onPointerDownCapture:()=>u.current=!0}}function Vv(l,o=globalThis?.document){const c=Yo(l),u=w.useRef(!1);return w.useEffect(()=>{const f=m=>{m.target&&!u.current&&Yp(Bv,c,{originalEvent:m},{discrete:!1})};return o.addEventListener("focusin",f),()=>o.removeEventListener("focusin",f)},[o,c]),{onFocusCapture:()=>u.current=!0,onBlurCapture:()=>u.current=!1}}function lp(){const l=new CustomEvent(Nu);document.dispatchEvent(l)}function Yp(l,o,c,{discrete:u}){const f=c.originalEvent.target,m=new CustomEvent(l,{bubbles:!1,cancelable:!0,detail:c});o&&f.addEventListener(l,o,{once:!0}),u?Dv(f,m):f.dispatchEvent(m)}var Rn=globalThis?.document?w.useLayoutEffect:()=>{},Xv=Uu[" useId ".trim().toString()]||(()=>{}),$v=0;function Qv(l){const[o,c]=w.useState(Xv());return Rn(()=>{c(u=>u??String($v++))},[l]),o?`radix-${o}`:""}const Zv=["top","right","bottom","left"],Dn=Math.min,Pt=Math.max,Oo=Math.round,So=Math.floor,Oa=l=>({x:l,y:l}),Kv={left:"right",right:"left",bottom:"top",top:"bottom"},Jv={start:"end",end:"start"};function ju(l,o,c){return Pt(l,Dn(o,c))}function an(l,o){return typeof l=="function"?l(o):l}function nn(l){return l.split("-")[0]}function sl(l){return l.split("-")[1]}function Yu(l){return l==="x"?"y":"x"}function Gu(l){return l==="y"?"height":"width"}const Fv=new Set(["top","bottom"]);function Ma(l){return Fv.has(nn(l))?"y":"x"}function Vu(l){return Yu(Ma(l))}function Wv(l,o,c){c===void 0&&(c=!1);const u=sl(l),f=Vu(l),m=Gu(f);let g=f==="x"?u===(c?"end":"start")?"right":"left":u==="start"?"bottom":"top";return o.reference[m]>o.floating[m]&&(g=zo(g)),[g,zo(g)]}function Pv(l){const o=zo(l);return[Su(l),o,Su(o)]}function Su(l){return l.replace(/start|end/g,o=>Jv[o])}const rp=["left","right"],op=["right","left"],Iv=["top","bottom"],ey=["bottom","top"];function ty(l,o,c){switch(l){case"top":case"bottom":return c?o?op:rp:o?rp:op;case"left":case"right":return o?Iv:ey;default:return[]}}function ay(l,o,c,u){const f=sl(l);let m=ty(nn(l),c==="start",u);return f&&(m=m.map(g=>g+"-"+f),o&&(m=m.concat(m.map(Su)))),m}function zo(l){return l.replace(/left|right|bottom|top/g,o=>Kv[o])}function ny(l){return{top:0,right:0,bottom:0,left:0,...l}}function Gp(l){return typeof l!="number"?ny(l):{top:l,right:l,bottom:l,left:l}}function Ro(l){const{x:o,y:c,width:u,height:f}=l;return{width:u,height:f,top:c,left:o,right:o+u,bottom:c+f,x:o,y:c}}function ip(l,o,c){let{reference:u,floating:f}=l;const m=Ma(o),g=Vu(o),v=Gu(g),x=nn(o),p=m==="y",b=u.x+u.width/2-f.width/2,h=u.y+u.height/2-f.height/2,N=u[v]/2-f[v]/2;let E;switch(x){case"top":E={x:b,y:u.y-f.height};break;case"bottom":E={x:b,y:u.y+u.height};break;case"right":E={x:u.x+u.width,y:h};break;case"left":E={x:u.x-f.width,y:h};break;default:E={x:u.x,y:u.y}}switch(sl(o)){case"start":E[g]-=N*(c&&p?-1:1);break;case"end":E[g]+=N*(c&&p?-1:1);break}return E}const sy=async(l,o,c)=>{const{placement:u="bottom",strategy:f="absolute",middleware:m=[],platform:g}=c,v=m.filter(Boolean),x=await(g.isRTL==null?void 0:g.isRTL(o));let p=await g.getElementRects({reference:l,floating:o,strategy:f}),{x:b,y:h}=ip(p,u,x),N=u,E={},A=0;for(let U=0;U({name:"arrow",options:l,async fn(o){const{x:c,y:u,placement:f,rects:m,platform:g,elements:v,middlewareData:x}=o,{element:p,padding:b=0}=an(l,o)||{};if(p==null)return{};const h=Gp(b),N={x:c,y:u},E=Vu(f),A=Gu(E),U=await g.getDimensions(p),G=E==="y",T=G?"top":"left",K=G?"bottom":"right",q=G?"clientHeight":"clientWidth",F=m.reference[A]+m.reference[E]-N[E]-m.floating[A],ae=N[E]-m.reference[E],te=await(g.getOffsetParent==null?void 0:g.getOffsetParent(p));let _=te?te[q]:0;(!_||!await(g.isElement==null?void 0:g.isElement(te)))&&(_=v.floating[q]||m.floating[A]);const L=F/2-ae/2,Y=_/2-U[A]/2-1,z=Dn(h[T],Y),se=Dn(h[K],Y),ie=z,O=_-U[A]-se,ne=_/2-U[A]/2+L,oe=ju(ie,ne,O),k=!x.arrow&&sl(f)!=null&&ne!==oe&&m.reference[A]/2-(nene<=0)){var se,ie;const ne=(((se=m.flip)==null?void 0:se.index)||0)+1,oe=_[ne];if(oe&&(!(h==="alignment"?K!==Ma(oe):!1)||z.every(B=>Ma(B.placement)===K?B.overflows[0]>0:!0)))return{data:{index:ne,overflows:z},reset:{placement:oe}};let k=(ie=z.filter(V=>V.overflows[0]<=0).sort((V,B)=>V.overflows[1]-B.overflows[1])[0])==null?void 0:ie.placement;if(!k)switch(E){case"bestFit":{var O;const V=(O=z.filter(B=>{if(te){const ce=Ma(B.placement);return ce===K||ce==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ce=>ce>0).reduce((ce,ge)=>ce+ge,0)]).sort((B,ce)=>B[1]-ce[1])[0])==null?void 0:O[0];V&&(k=V);break}case"initialPlacement":k=v;break}if(f!==k)return{reset:{placement:k}}}return{}}}};function cp(l,o){return{top:l.top-o.height,right:l.right-o.width,bottom:l.bottom-o.height,left:l.left-o.width}}function up(l){return Zv.some(o=>l[o]>=0)}const oy=function(l){return l===void 0&&(l={}),{name:"hide",options:l,async fn(o){const{rects:c}=o,{strategy:u="referenceHidden",...f}=an(l,o);switch(u){case"referenceHidden":{const m=await sr(o,{...f,elementContext:"reference"}),g=cp(m,c.reference);return{data:{referenceHiddenOffsets:g,referenceHidden:up(g)}}}case"escaped":{const m=await sr(o,{...f,altBoundary:!0}),g=cp(m,c.floating);return{data:{escapedOffsets:g,escaped:up(g)}}}default:return{}}}}},Vp=new Set(["left","top"]);async function iy(l,o){const{placement:c,platform:u,elements:f}=l,m=await(u.isRTL==null?void 0:u.isRTL(f.floating)),g=nn(c),v=sl(c),x=Ma(c)==="y",p=Vp.has(g)?-1:1,b=m&&x?-1:1,h=an(o,l);let{mainAxis:N,crossAxis:E,alignmentAxis:A}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return v&&typeof A=="number"&&(E=v==="end"?A*-1:A),x?{x:E*b,y:N*p}:{x:N*p,y:E*b}}const cy=function(l){return l===void 0&&(l=0),{name:"offset",options:l,async fn(o){var c,u;const{x:f,y:m,placement:g,middlewareData:v}=o,x=await iy(o,l);return g===((c=v.offset)==null?void 0:c.placement)&&(u=v.arrow)!=null&&u.alignmentOffset?{}:{x:f+x.x,y:m+x.y,data:{...x,placement:g}}}}},uy=function(l){return l===void 0&&(l={}),{name:"shift",options:l,async fn(o){const{x:c,y:u,placement:f}=o,{mainAxis:m=!0,crossAxis:g=!1,limiter:v={fn:G=>{let{x:T,y:K}=G;return{x:T,y:K}}},...x}=an(l,o),p={x:c,y:u},b=await sr(o,x),h=Ma(nn(f)),N=Yu(h);let E=p[N],A=p[h];if(m){const G=N==="y"?"top":"left",T=N==="y"?"bottom":"right",K=E+b[G],q=E-b[T];E=ju(K,E,q)}if(g){const G=h==="y"?"top":"left",T=h==="y"?"bottom":"right",K=A+b[G],q=A-b[T];A=ju(K,A,q)}const U=v.fn({...o,[N]:E,[h]:A});return{...U,data:{x:U.x-c,y:U.y-u,enabled:{[N]:m,[h]:g}}}}}},dy=function(l){return l===void 0&&(l={}),{options:l,fn(o){const{x:c,y:u,placement:f,rects:m,middlewareData:g}=o,{offset:v=0,mainAxis:x=!0,crossAxis:p=!0}=an(l,o),b={x:c,y:u},h=Ma(f),N=Yu(h);let E=b[N],A=b[h];const U=an(v,o),G=typeof U=="number"?{mainAxis:U,crossAxis:0}:{mainAxis:0,crossAxis:0,...U};if(x){const q=N==="y"?"height":"width",F=m.reference[N]-m.floating[q]+G.mainAxis,ae=m.reference[N]+m.reference[q]-G.mainAxis;Eae&&(E=ae)}if(p){var T,K;const q=N==="y"?"width":"height",F=Vp.has(nn(f)),ae=m.reference[h]-m.floating[q]+(F&&((T=g.offset)==null?void 0:T[h])||0)+(F?0:G.crossAxis),te=m.reference[h]+m.reference[q]+(F?0:((K=g.offset)==null?void 0:K[h])||0)-(F?G.crossAxis:0);Ate&&(A=te)}return{[N]:E,[h]:A}}}},fy=function(l){return l===void 0&&(l={}),{name:"size",options:l,async fn(o){var c,u;const{placement:f,rects:m,platform:g,elements:v}=o,{apply:x=()=>{},...p}=an(l,o),b=await sr(o,p),h=nn(f),N=sl(f),E=Ma(f)==="y",{width:A,height:U}=m.floating;let G,T;h==="top"||h==="bottom"?(G=h,T=N===(await(g.isRTL==null?void 0:g.isRTL(v.floating))?"start":"end")?"left":"right"):(T=h,G=N==="end"?"top":"bottom");const K=U-b.top-b.bottom,q=A-b.left-b.right,F=Dn(U-b[G],K),ae=Dn(A-b[T],q),te=!o.middlewareData.shift;let _=F,L=ae;if((c=o.middlewareData.shift)!=null&&c.enabled.x&&(L=q),(u=o.middlewareData.shift)!=null&&u.enabled.y&&(_=K),te&&!N){const z=Pt(b.left,0),se=Pt(b.right,0),ie=Pt(b.top,0),O=Pt(b.bottom,0);E?L=A-2*(z!==0||se!==0?z+se:Pt(b.left,b.right)):_=U-2*(ie!==0||O!==0?ie+O:Pt(b.top,b.bottom))}await x({...o,availableWidth:L,availableHeight:_});const Y=await g.getDimensions(v.floating);return A!==Y.width||U!==Y.height?{reset:{rects:!0}}:{}}}};function Go(){return typeof window<"u"}function ll(l){return Xp(l)?(l.nodeName||"").toLowerCase():"#document"}function It(l){var o;return(l==null||(o=l.ownerDocument)==null?void 0:o.defaultView)||window}function Da(l){var o;return(o=(Xp(l)?l.ownerDocument:l.document)||window.document)==null?void 0:o.documentElement}function Xp(l){return Go()?l instanceof Node||l instanceof It(l).Node:!1}function wa(l){return Go()?l instanceof Element||l instanceof It(l).Element:!1}function za(l){return Go()?l instanceof HTMLElement||l instanceof It(l).HTMLElement:!1}function dp(l){return!Go()||typeof ShadowRoot>"u"?!1:l instanceof ShadowRoot||l instanceof It(l).ShadowRoot}const my=new Set(["inline","contents"]);function or(l){const{overflow:o,overflowX:c,overflowY:u,display:f}=Na(l);return/auto|scroll|overlay|hidden|clip/.test(o+u+c)&&!my.has(f)}const hy=new Set(["table","td","th"]);function py(l){return hy.has(ll(l))}const gy=[":popover-open",":modal"];function Vo(l){return gy.some(o=>{try{return l.matches(o)}catch{return!1}})}const xy=["transform","translate","scale","rotate","perspective"],vy=["transform","translate","scale","rotate","perspective","filter"],yy=["paint","layout","strict","content"];function Xu(l){const o=$u(),c=wa(l)?Na(l):l;return xy.some(u=>c[u]?c[u]!=="none":!1)||(c.containerType?c.containerType!=="normal":!1)||!o&&(c.backdropFilter?c.backdropFilter!=="none":!1)||!o&&(c.filter?c.filter!=="none":!1)||vy.some(u=>(c.willChange||"").includes(u))||yy.some(u=>(c.contain||"").includes(u))}function by(l){let o=Ln(l);for(;za(o)&&!Is(o);){if(Xu(o))return o;if(Vo(o))return null;o=Ln(o)}return null}function $u(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wy=new Set(["html","body","#document"]);function Is(l){return wy.has(ll(l))}function Na(l){return It(l).getComputedStyle(l)}function Xo(l){return wa(l)?{scrollLeft:l.scrollLeft,scrollTop:l.scrollTop}:{scrollLeft:l.scrollX,scrollTop:l.scrollY}}function Ln(l){if(ll(l)==="html")return l;const o=l.assignedSlot||l.parentNode||dp(l)&&l.host||Da(l);return dp(o)?o.host:o}function $p(l){const o=Ln(l);return Is(o)?l.ownerDocument?l.ownerDocument.body:l.body:za(o)&&or(o)?o:$p(o)}function lr(l,o,c){var u;o===void 0&&(o=[]),c===void 0&&(c=!0);const f=$p(l),m=f===((u=l.ownerDocument)==null?void 0:u.body),g=It(f);if(m){const v=_u(g);return o.concat(g,g.visualViewport||[],or(f)?f:[],v&&c?lr(v):[])}return o.concat(f,lr(f,[],c))}function _u(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}function Qp(l){const o=Na(l);let c=parseFloat(o.width)||0,u=parseFloat(o.height)||0;const f=za(l),m=f?l.offsetWidth:c,g=f?l.offsetHeight:u,v=Oo(c)!==m||Oo(u)!==g;return v&&(c=m,u=g),{width:c,height:u,$:v}}function Qu(l){return wa(l)?l:l.contextElement}function Ws(l){const o=Qu(l);if(!za(o))return Oa(1);const c=o.getBoundingClientRect(),{width:u,height:f,$:m}=Qp(o);let g=(m?Oo(c.width):c.width)/u,v=(m?Oo(c.height):c.height)/f;return(!g||!Number.isFinite(g))&&(g=1),(!v||!Number.isFinite(v))&&(v=1),{x:g,y:v}}const Ny=Oa(0);function Zp(l){const o=It(l);return!$u()||!o.visualViewport?Ny:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function jy(l,o,c){return o===void 0&&(o=!1),!c||o&&c!==It(l)?!1:o}function os(l,o,c,u){o===void 0&&(o=!1),c===void 0&&(c=!1);const f=l.getBoundingClientRect(),m=Qu(l);let g=Oa(1);o&&(u?wa(u)&&(g=Ws(u)):g=Ws(l));const v=jy(m,c,u)?Zp(m):Oa(0);let x=(f.left+v.x)/g.x,p=(f.top+v.y)/g.y,b=f.width/g.x,h=f.height/g.y;if(m){const N=It(m),E=u&&wa(u)?It(u):u;let A=N,U=_u(A);for(;U&&u&&E!==A;){const G=Ws(U),T=U.getBoundingClientRect(),K=Na(U),q=T.left+(U.clientLeft+parseFloat(K.paddingLeft))*G.x,F=T.top+(U.clientTop+parseFloat(K.paddingTop))*G.y;x*=G.x,p*=G.y,b*=G.x,h*=G.y,x+=q,p+=F,A=It(U),U=_u(A)}}return Ro({width:b,height:h,x,y:p})}function $o(l,o){const c=Xo(l).scrollLeft;return o?o.left+c:os(Da(l)).left+c}function Kp(l,o){const c=l.getBoundingClientRect(),u=c.left+o.scrollLeft-$o(l,c),f=c.top+o.scrollTop;return{x:u,y:f}}function Sy(l){let{elements:o,rect:c,offsetParent:u,strategy:f}=l;const m=f==="fixed",g=Da(u),v=o?Vo(o.floating):!1;if(u===g||v&&m)return c;let x={scrollLeft:0,scrollTop:0},p=Oa(1);const b=Oa(0),h=za(u);if((h||!h&&!m)&&((ll(u)!=="body"||or(g))&&(x=Xo(u)),za(u))){const E=os(u);p=Ws(u),b.x=E.x+u.clientLeft,b.y=E.y+u.clientTop}const N=g&&!h&&!m?Kp(g,x):Oa(0);return{width:c.width*p.x,height:c.height*p.y,x:c.x*p.x-x.scrollLeft*p.x+b.x+N.x,y:c.y*p.y-x.scrollTop*p.y+b.y+N.y}}function _y(l){return Array.from(l.getClientRects())}function Ey(l){const o=Da(l),c=Xo(l),u=l.ownerDocument.body,f=Pt(o.scrollWidth,o.clientWidth,u.scrollWidth,u.clientWidth),m=Pt(o.scrollHeight,o.clientHeight,u.scrollHeight,u.clientHeight);let g=-c.scrollLeft+$o(l);const v=-c.scrollTop;return Na(u).direction==="rtl"&&(g+=Pt(o.clientWidth,u.clientWidth)-f),{width:f,height:m,x:g,y:v}}const fp=25;function Cy(l,o){const c=It(l),u=Da(l),f=c.visualViewport;let m=u.clientWidth,g=u.clientHeight,v=0,x=0;if(f){m=f.width,g=f.height;const b=$u();(!b||b&&o==="fixed")&&(v=f.offsetLeft,x=f.offsetTop)}const p=$o(u);if(p<=0){const b=u.ownerDocument,h=b.body,N=getComputedStyle(h),E=b.compatMode==="CSS1Compat"&&parseFloat(N.marginLeft)+parseFloat(N.marginRight)||0,A=Math.abs(u.clientWidth-h.clientWidth-E);A<=fp&&(m-=A)}else p<=fp&&(m+=p);return{width:m,height:g,x:v,y:x}}const Ty=new Set(["absolute","fixed"]);function ky(l,o){const c=os(l,!0,o==="fixed"),u=c.top+l.clientTop,f=c.left+l.clientLeft,m=za(l)?Ws(l):Oa(1),g=l.clientWidth*m.x,v=l.clientHeight*m.y,x=f*m.x,p=u*m.y;return{width:g,height:v,x,y:p}}function mp(l,o,c){let u;if(o==="viewport")u=Cy(l,c);else if(o==="document")u=Ey(Da(l));else if(wa(o))u=ky(o,c);else{const f=Zp(l);u={x:o.x-f.x,y:o.y-f.y,width:o.width,height:o.height}}return Ro(u)}function Jp(l,o){const c=Ln(l);return c===o||!wa(c)||Is(c)?!1:Na(c).position==="fixed"||Jp(c,o)}function Ay(l,o){const c=o.get(l);if(c)return c;let u=lr(l,[],!1).filter(v=>wa(v)&&ll(v)!=="body"),f=null;const m=Na(l).position==="fixed";let g=m?Ln(l):l;for(;wa(g)&&!Is(g);){const v=Na(g),x=Xu(g);!x&&v.position==="fixed"&&(f=null),(m?!x&&!f:!x&&v.position==="static"&&!!f&&Ty.has(f.position)||or(g)&&!x&&Jp(l,g))?u=u.filter(b=>b!==g):f=v,g=Ln(g)}return o.set(l,u),u}function My(l){let{element:o,boundary:c,rootBoundary:u,strategy:f}=l;const g=[...c==="clippingAncestors"?Vo(o)?[]:Ay(o,this._c):[].concat(c),u],v=g[0],x=g.reduce((p,b)=>{const h=mp(o,b,f);return p.top=Pt(h.top,p.top),p.right=Dn(h.right,p.right),p.bottom=Dn(h.bottom,p.bottom),p.left=Pt(h.left,p.left),p},mp(o,v,f));return{width:x.right-x.left,height:x.bottom-x.top,x:x.left,y:x.top}}function Oy(l){const{width:o,height:c}=Qp(l);return{width:o,height:c}}function zy(l,o,c){const u=za(o),f=Da(o),m=c==="fixed",g=os(l,!0,m,o);let v={scrollLeft:0,scrollTop:0};const x=Oa(0);function p(){x.x=$o(f)}if(u||!u&&!m)if((ll(o)!=="body"||or(f))&&(v=Xo(o)),u){const E=os(o,!0,m,o);x.x=E.x+o.clientLeft,x.y=E.y+o.clientTop}else f&&p();m&&!u&&f&&p();const b=f&&!u&&!m?Kp(f,v):Oa(0),h=g.left+v.scrollLeft-x.x-b.x,N=g.top+v.scrollTop-x.y-b.y;return{x:h,y:N,width:g.width,height:g.height}}function pu(l){return Na(l).position==="static"}function hp(l,o){if(!za(l)||Na(l).position==="fixed")return null;if(o)return o(l);let c=l.offsetParent;return Da(l)===c&&(c=c.ownerDocument.body),c}function Fp(l,o){const c=It(l);if(Vo(l))return c;if(!za(l)){let f=Ln(l);for(;f&&!Is(f);){if(wa(f)&&!pu(f))return f;f=Ln(f)}return c}let u=hp(l,o);for(;u&&py(u)&&pu(u);)u=hp(u,o);return u&&Is(u)&&pu(u)&&!Xu(u)?c:u||by(l)||c}const Ry=async function(l){const o=this.getOffsetParent||Fp,c=this.getDimensions,u=await c(l.floating);return{reference:zy(l.reference,await o(l.floating),l.strategy),floating:{x:0,y:0,width:u.width,height:u.height}}};function Dy(l){return Na(l).direction==="rtl"}const Ly={convertOffsetParentRelativeRectToViewportRelativeRect:Sy,getDocumentElement:Da,getClippingRect:My,getOffsetParent:Fp,getElementRects:Ry,getClientRects:_y,getDimensions:Oy,getScale:Ws,isElement:wa,isRTL:Dy};function Wp(l,o){return l.x===o.x&&l.y===o.y&&l.width===o.width&&l.height===o.height}function Uy(l,o){let c=null,u;const f=Da(l);function m(){var v;clearTimeout(u),(v=c)==null||v.disconnect(),c=null}function g(v,x){v===void 0&&(v=!1),x===void 0&&(x=1),m();const p=l.getBoundingClientRect(),{left:b,top:h,width:N,height:E}=p;if(v||o(),!N||!E)return;const A=So(h),U=So(f.clientWidth-(b+N)),G=So(f.clientHeight-(h+E)),T=So(b),q={rootMargin:-A+"px "+-U+"px "+-G+"px "+-T+"px",threshold:Pt(0,Dn(1,x))||1};let F=!0;function ae(te){const _=te[0].intersectionRatio;if(_!==x){if(!F)return g();_?g(!1,_):u=setTimeout(()=>{g(!1,1e-7)},1e3)}_===1&&!Wp(p,l.getBoundingClientRect())&&g(),F=!1}try{c=new IntersectionObserver(ae,{...q,root:f.ownerDocument})}catch{c=new IntersectionObserver(ae,q)}c.observe(l)}return g(!0),m}function Hy(l,o,c,u){u===void 0&&(u={});const{ancestorScroll:f=!0,ancestorResize:m=!0,elementResize:g=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:x=!1}=u,p=Qu(l),b=f||m?[...p?lr(p):[],...lr(o)]:[];b.forEach(T=>{f&&T.addEventListener("scroll",c,{passive:!0}),m&&T.addEventListener("resize",c)});const h=p&&v?Uy(p,c):null;let N=-1,E=null;g&&(E=new ResizeObserver(T=>{let[K]=T;K&&K.target===p&&E&&(E.unobserve(o),cancelAnimationFrame(N),N=requestAnimationFrame(()=>{var q;(q=E)==null||q.observe(o)})),c()}),p&&!x&&E.observe(p),E.observe(o));let A,U=x?os(l):null;x&&G();function G(){const T=os(l);U&&!Wp(U,T)&&c(),U=T,A=requestAnimationFrame(G)}return c(),()=>{var T;b.forEach(K=>{f&&K.removeEventListener("scroll",c),m&&K.removeEventListener("resize",c)}),h?.(),(T=E)==null||T.disconnect(),E=null,x&&cancelAnimationFrame(A)}}const By=cy,qy=uy,Yy=ry,Gy=fy,Vy=oy,pp=ly,Xy=dy,$y=(l,o,c)=>{const u=new Map,f={platform:Ly,...c},m={...f.platform,_c:u};return sy(l,o,{...f,platform:m})};var Qy=typeof document<"u",Zy=function(){},Ao=Qy?w.useLayoutEffect:Zy;function Do(l,o){if(l===o)return!0;if(typeof l!=typeof o)return!1;if(typeof l=="function"&&l.toString()===o.toString())return!0;let c,u,f;if(l&&o&&typeof l=="object"){if(Array.isArray(l)){if(c=l.length,c!==o.length)return!1;for(u=c;u--!==0;)if(!Do(l[u],o[u]))return!1;return!0}if(f=Object.keys(l),c=f.length,c!==Object.keys(o).length)return!1;for(u=c;u--!==0;)if(!{}.hasOwnProperty.call(o,f[u]))return!1;for(u=c;u--!==0;){const m=f[u];if(!(m==="_owner"&&l.$$typeof)&&!Do(l[m],o[m]))return!1}return!0}return l!==l&&o!==o}function Pp(l){return typeof window>"u"?1:(l.ownerDocument.defaultView||window).devicePixelRatio||1}function gp(l,o){const c=Pp(l);return Math.round(o*c)/c}function gu(l){const o=w.useRef(l);return Ao(()=>{o.current=l}),o}function Ky(l){l===void 0&&(l={});const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f,elements:{reference:m,floating:g}={},transform:v=!0,whileElementsMounted:x,open:p}=l,[b,h]=w.useState({x:0,y:0,strategy:c,placement:o,middlewareData:{},isPositioned:!1}),[N,E]=w.useState(u);Do(N,u)||E(u);const[A,U]=w.useState(null),[G,T]=w.useState(null),K=w.useCallback(B=>{B!==te.current&&(te.current=B,U(B))},[]),q=w.useCallback(B=>{B!==_.current&&(_.current=B,T(B))},[]),F=m||A,ae=g||G,te=w.useRef(null),_=w.useRef(null),L=w.useRef(b),Y=x!=null,z=gu(x),se=gu(f),ie=gu(p),O=w.useCallback(()=>{if(!te.current||!_.current)return;const B={placement:o,strategy:c,middleware:N};se.current&&(B.platform=se.current),$y(te.current,_.current,B).then(ce=>{const ge={...ce,isPositioned:ie.current!==!1};ne.current&&!Do(L.current,ge)&&(L.current=ge,qu.flushSync(()=>{h(ge)}))})},[N,o,c,se,ie]);Ao(()=>{p===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[p]);const ne=w.useRef(!1);Ao(()=>(ne.current=!0,()=>{ne.current=!1}),[]),Ao(()=>{if(F&&(te.current=F),ae&&(_.current=ae),F&&ae){if(z.current)return z.current(F,ae,O);O()}},[F,ae,O,z,Y]);const oe=w.useMemo(()=>({reference:te,floating:_,setReference:K,setFloating:q}),[K,q]),k=w.useMemo(()=>({reference:F,floating:ae}),[F,ae]),V=w.useMemo(()=>{const B={position:c,left:0,top:0};if(!k.floating)return B;const ce=gp(k.floating,b.x),ge=gp(k.floating,b.y);return v?{...B,transform:"translate("+ce+"px, "+ge+"px)",...Pp(k.floating)>=1.5&&{willChange:"transform"}}:{position:c,left:ce,top:ge}},[c,v,k.floating,b.x,b.y]);return w.useMemo(()=>({...b,update:O,refs:oe,elements:k,floatingStyles:V}),[b,O,oe,k,V])}const Jy=l=>{function o(c){return{}.hasOwnProperty.call(c,"current")}return{name:"arrow",options:l,fn(c){const{element:u,padding:f}=typeof l=="function"?l(c):l;return u&&o(u)?u.current!=null?pp({element:u.current,padding:f}).fn(c):{}:u?pp({element:u,padding:f}).fn(c):{}}}},Fy=(l,o)=>({...By(l),options:[l,o]}),Wy=(l,o)=>({...qy(l),options:[l,o]}),Py=(l,o)=>({...Xy(l),options:[l,o]}),Iy=(l,o)=>({...Yy(l),options:[l,o]}),eb=(l,o)=>({...Gy(l),options:[l,o]}),tb=(l,o)=>({...Vy(l),options:[l,o]}),ab=(l,o)=>({...Jy(l),options:[l,o]});var nb="Arrow",Ip=w.forwardRef((l,o)=>{const{children:c,width:u=10,height:f=5,...m}=l;return s.jsx(Ra.svg,{...m,ref:o,width:u,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:l.asChild?c:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ip.displayName=nb;var sb=Ip;function e0(l){const[o,c]=w.useState(void 0);return Rn(()=>{if(l){c({width:l.offsetWidth,height:l.offsetHeight});const u=new ResizeObserver(f=>{if(!Array.isArray(f)||!f.length)return;const m=f[0];let g,v;if("borderBoxSize"in m){const x=m.borderBoxSize,p=Array.isArray(x)?x[0]:x;g=p.inlineSize,v=p.blockSize}else g=l.offsetWidth,v=l.offsetHeight;c({width:g,height:v})});return u.observe(l,{box:"border-box"}),()=>u.unobserve(l)}else c(void 0)},[l]),o}var Zu="Popper",[t0,a0]=Bu(Zu),[lb,n0]=t0(Zu),s0=l=>{const{__scopePopper:o,children:c}=l,[u,f]=w.useState(null);return s.jsx(lb,{scope:o,anchor:u,onAnchorChange:f,children:c})};s0.displayName=Zu;var l0="PopperAnchor",r0=w.forwardRef((l,o)=>{const{__scopePopper:c,virtualRef:u,...f}=l,m=n0(l0,c),g=w.useRef(null),v=sn(o,g),x=w.useRef(null);return w.useEffect(()=>{const p=x.current;x.current=u?.current||g.current,p!==x.current&&m.onAnchorChange(x.current)}),u?null:s.jsx(Ra.div,{...f,ref:v})});r0.displayName=l0;var Ku="PopperContent",[rb,ob]=t0(Ku),o0=w.forwardRef((l,o)=>{const{__scopePopper:c,side:u="bottom",sideOffset:f=0,align:m="center",alignOffset:g=0,arrowPadding:v=0,avoidCollisions:x=!0,collisionBoundary:p=[],collisionPadding:b=0,sticky:h="partial",hideWhenDetached:N=!1,updatePositionStrategy:E="optimized",onPlaced:A,...U}=l,G=n0(Ku,c),[T,K]=w.useState(null),q=sn(o,ue=>K(ue)),[F,ae]=w.useState(null),te=e0(F),_=te?.width??0,L=te?.height??0,Y=u+(m!=="center"?"-"+m:""),z=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},se=Array.isArray(p)?p:[p],ie=se.length>0,O={padding:z,boundary:se.filter(cb),altBoundary:ie},{refs:ne,floatingStyles:oe,placement:k,isPositioned:V,middlewareData:B}=Ky({strategy:"fixed",placement:Y,whileElementsMounted:(...ue)=>Hy(...ue,{animationFrame:E==="always"}),elements:{reference:G.anchor},middleware:[Fy({mainAxis:f+L,alignmentAxis:g}),x&&Wy({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Py():void 0,...O}),x&&Iy({...O}),eb({...O,apply:({elements:ue,rects:we,availableWidth:Te,availableHeight:We})=>{const{width:it,height:qe}=we.reference,P=ue.floating.style;P.setProperty("--radix-popper-available-width",`${Te}px`),P.setProperty("--radix-popper-available-height",`${We}px`),P.setProperty("--radix-popper-anchor-width",`${it}px`),P.setProperty("--radix-popper-anchor-height",`${qe}px`)}}),F&&ab({element:F,padding:v}),ub({arrowWidth:_,arrowHeight:L}),N&&tb({strategy:"referenceHidden",...O})]}),[ce,ge]=u0(k),S=Yo(A);Rn(()=>{V&&S?.()},[V,S]);const Q=B.arrow?.x,$=B.arrow?.y,ee=B.arrow?.centerOffset!==0,[re,xe]=w.useState();return Rn(()=>{T&&xe(window.getComputedStyle(T).zIndex)},[T]),s.jsx("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...oe,transform:V?oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:l.dir,children:s.jsx(rb,{scope:c,placedSide:ce,onArrowChange:ae,arrowX:Q,arrowY:$,shouldHideArrow:ee,children:s.jsx(Ra.div,{"data-side":ce,"data-align":ge,...U,ref:q,style:{...U.style,animation:V?void 0:"none"}})})})});o0.displayName=Ku;var i0="PopperArrow",ib={top:"bottom",right:"left",bottom:"top",left:"right"},c0=w.forwardRef(function(o,c){const{__scopePopper:u,...f}=o,m=ob(i0,u),g=ib[m.placedSide];return s.jsx("span",{ref:m.onArrowChange,style:{position:"absolute",left:m.arrowX,top:m.arrowY,[g]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[m.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[m.placedSide],visibility:m.shouldHideArrow?"hidden":void 0},children:s.jsx(sb,{...f,ref:c,style:{...f.style,display:"block"}})})});c0.displayName=i0;function cb(l){return l!==null}var ub=l=>({name:"transformOrigin",options:l,fn(o){const{placement:c,rects:u,middlewareData:f}=o,g=f.arrow?.centerOffset!==0,v=g?0:l.arrowWidth,x=g?0:l.arrowHeight,[p,b]=u0(c),h={start:"0%",center:"50%",end:"100%"}[b],N=(f.arrow?.x??0)+v/2,E=(f.arrow?.y??0)+x/2;let A="",U="";return p==="bottom"?(A=g?h:`${N}px`,U=`${-x}px`):p==="top"?(A=g?h:`${N}px`,U=`${u.floating.height+x}px`):p==="right"?(A=`${-x}px`,U=g?h:`${E}px`):p==="left"&&(A=`${u.floating.width+x}px`,U=g?h:`${E}px`),{data:{x:A,y:U}}}});function u0(l){const[o,c="center"]=l.split("-");return[o,c]}var db=s0,fb=r0,mb=o0,hb=c0,pb="Portal",d0=w.forwardRef((l,o)=>{const{container:c,...u}=l,[f,m]=w.useState(!1);Rn(()=>m(!0),[]);const g=c||f&&globalThis?.document?.body;return g?Hp.createPortal(s.jsx(Ra.div,{...u,ref:o}),g):null});d0.displayName=pb;function gb(l,o){return w.useReducer((c,u)=>o[c][u]??c,l)}var Ju=l=>{const{present:o,children:c}=l,u=xb(o),f=typeof c=="function"?c({present:u.isPresent}):w.Children.only(c),m=sn(u.ref,vb(f));return typeof c=="function"||u.isPresent?w.cloneElement(f,{ref:m}):null};Ju.displayName="Presence";function xb(l){const[o,c]=w.useState(),u=w.useRef(null),f=w.useRef(l),m=w.useRef("none"),g=l?"mounted":"unmounted",[v,x]=gb(g,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const p=_o(u.current);m.current=v==="mounted"?p:"none"},[v]),Rn(()=>{const p=u.current,b=f.current;if(b!==l){const N=m.current,E=_o(p);l?x("MOUNT"):E==="none"||p?.display==="none"?x("UNMOUNT"):x(b&&N!==E?"ANIMATION_OUT":"UNMOUNT"),f.current=l}},[l,x]),Rn(()=>{if(o){let p;const b=o.ownerDocument.defaultView??window,h=E=>{const U=_o(u.current).includes(CSS.escape(E.animationName));if(E.target===o&&U&&(x("ANIMATION_END"),!f.current)){const G=o.style.animationFillMode;o.style.animationFillMode="forwards",p=b.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=G)})}},N=E=>{E.target===o&&(m.current=_o(u.current))};return o.addEventListener("animationstart",N),o.addEventListener("animationcancel",h),o.addEventListener("animationend",h),()=>{b.clearTimeout(p),o.removeEventListener("animationstart",N),o.removeEventListener("animationcancel",h),o.removeEventListener("animationend",h)}}else x("ANIMATION_END")},[o,x]),{isPresent:["mounted","unmountSuspended"].includes(v),ref:w.useCallback(p=>{u.current=p?getComputedStyle(p):null,c(p)},[])}}function _o(l){return l?.animationName||"none"}function vb(l){let o=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,c=o&&"isReactWarning"in o&&o.isReactWarning;return c?l.ref:(o=Object.getOwnPropertyDescriptor(l,"ref")?.get,c=o&&"isReactWarning"in o&&o.isReactWarning,c?l.props.ref:l.props.ref||l.ref)}var yb=Symbol("radix.slottable");function bb(l){const o=({children:c})=>s.jsx(s.Fragment,{children:c});return o.displayName=`${l}.Slottable`,o.__radixId=yb,o}var wb=Uu[" useInsertionEffect ".trim().toString()]||Rn;function f0({prop:l,defaultProp:o,onChange:c=()=>{},caller:u}){const[f,m,g]=Nb({defaultProp:o,onChange:c}),v=l!==void 0,x=v?l:f;{const b=w.useRef(l!==void 0);w.useEffect(()=>{const h=b.current;h!==v&&console.warn(`${u} is changing from ${h?"controlled":"uncontrolled"} to ${v?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),b.current=v},[v,u])}const p=w.useCallback(b=>{if(v){const h=jb(b)?b(l):b;h!==l&&g.current?.(h)}else m(b)},[v,l,m,g]);return[x,p]}function Nb({defaultProp:l,onChange:o}){const[c,u]=w.useState(l),f=w.useRef(c),m=w.useRef(o);return wb(()=>{m.current=o},[o]),w.useEffect(()=>{f.current!==c&&(m.current?.(c),f.current=c)},[c,f]),[c,u,m]}function jb(l){return typeof l=="function"}var Sb=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),_b="VisuallyHidden",m0=w.forwardRef((l,o)=>s.jsx(Ra.span,{...l,ref:o,style:{...Sb,...l.style}}));m0.displayName=_b;var Eb=m0,[Qo]=Bu("Tooltip",[a0]),Zo=a0(),h0="TooltipProvider",Cb=700,Eu="tooltip.open",[Tb,Fu]=Qo(h0),p0=l=>{const{__scopeTooltip:o,delayDuration:c=Cb,skipDelayDuration:u=300,disableHoverableContent:f=!1,children:m}=l,g=w.useRef(!0),v=w.useRef(!1),x=w.useRef(0);return w.useEffect(()=>{const p=x.current;return()=>window.clearTimeout(p)},[]),s.jsx(Tb,{scope:o,isOpenDelayedRef:g,delayDuration:c,onOpen:w.useCallback(()=>{window.clearTimeout(x.current),g.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>g.current=!0,u)},[u]),isPointerInTransitRef:v,onPointerInTransitChange:w.useCallback(p=>{v.current=p},[]),disableHoverableContent:f,children:m})};p0.displayName=h0;var rr="Tooltip",[kb,ir]=Qo(rr),g0=l=>{const{__scopeTooltip:o,children:c,open:u,defaultOpen:f,onOpenChange:m,disableHoverableContent:g,delayDuration:v}=l,x=Fu(rr,l.__scopeTooltip),p=Zo(o),[b,h]=w.useState(null),N=Qv(),E=w.useRef(0),A=g??x.disableHoverableContent,U=v??x.delayDuration,G=w.useRef(!1),[T,K]=f0({prop:u,defaultProp:f??!1,onChange:_=>{_?(x.onOpen(),document.dispatchEvent(new CustomEvent(Eu))):x.onClose(),m?.(_)},caller:rr}),q=w.useMemo(()=>T?G.current?"delayed-open":"instant-open":"closed",[T]),F=w.useCallback(()=>{window.clearTimeout(E.current),E.current=0,G.current=!1,K(!0)},[K]),ae=w.useCallback(()=>{window.clearTimeout(E.current),E.current=0,K(!1)},[K]),te=w.useCallback(()=>{window.clearTimeout(E.current),E.current=window.setTimeout(()=>{G.current=!0,K(!0),E.current=0},U)},[U,K]);return w.useEffect(()=>()=>{E.current&&(window.clearTimeout(E.current),E.current=0)},[]),s.jsx(db,{...p,children:s.jsx(kb,{scope:o,contentId:N,open:T,stateAttribute:q,trigger:b,onTriggerChange:h,onTriggerEnter:w.useCallback(()=>{x.isOpenDelayedRef.current?te():F()},[x.isOpenDelayedRef,te,F]),onTriggerLeave:w.useCallback(()=>{A?ae():(window.clearTimeout(E.current),E.current=0)},[ae,A]),onOpen:F,onClose:ae,disableHoverableContent:A,children:c})})};g0.displayName=rr;var Cu="TooltipTrigger",x0=w.forwardRef((l,o)=>{const{__scopeTooltip:c,...u}=l,f=ir(Cu,c),m=Fu(Cu,c),g=Zo(c),v=w.useRef(null),x=sn(o,v,f.onTriggerChange),p=w.useRef(!1),b=w.useRef(!1),h=w.useCallback(()=>p.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(fb,{asChild:!0,...g,children:s.jsx(Ra.button,{"aria-describedby":f.open?f.contentId:void 0,"data-state":f.stateAttribute,...u,ref:x,onPointerMove:Aa(l.onPointerMove,N=>{N.pointerType!=="touch"&&!b.current&&!m.isPointerInTransitRef.current&&(f.onTriggerEnter(),b.current=!0)}),onPointerLeave:Aa(l.onPointerLeave,()=>{f.onTriggerLeave(),b.current=!1}),onPointerDown:Aa(l.onPointerDown,()=>{f.open&&f.onClose(),p.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Aa(l.onFocus,()=>{p.current||f.onOpen()}),onBlur:Aa(l.onBlur,f.onClose),onClick:Aa(l.onClick,f.onClose)})})});x0.displayName=Cu;var Wu="TooltipPortal",[Ab,Mb]=Qo(Wu,{forceMount:void 0}),v0=l=>{const{__scopeTooltip:o,forceMount:c,children:u,container:f}=l,m=ir(Wu,o);return s.jsx(Ab,{scope:o,forceMount:c,children:s.jsx(Ju,{present:c||m.open,children:s.jsx(d0,{asChild:!0,container:f,children:u})})})};v0.displayName=Wu;var el="TooltipContent",y0=w.forwardRef((l,o)=>{const c=Mb(el,l.__scopeTooltip),{forceMount:u=c.forceMount,side:f="top",...m}=l,g=ir(el,l.__scopeTooltip);return s.jsx(Ju,{present:u||g.open,children:g.disableHoverableContent?s.jsx(b0,{side:f,...m,ref:o}):s.jsx(Ob,{side:f,...m,ref:o})})}),Ob=w.forwardRef((l,o)=>{const c=ir(el,l.__scopeTooltip),u=Fu(el,l.__scopeTooltip),f=w.useRef(null),m=sn(o,f),[g,v]=w.useState(null),{trigger:x,onClose:p}=c,b=f.current,{onPointerInTransitChange:h}=u,N=w.useCallback(()=>{v(null),h(!1)},[h]),E=w.useCallback((A,U)=>{const G=A.currentTarget,T={x:A.clientX,y:A.clientY},K=Lb(T,G.getBoundingClientRect()),q=Ub(T,K),F=Hb(U.getBoundingClientRect()),ae=qb([...q,...F]);v(ae),h(!0)},[h]);return w.useEffect(()=>()=>N(),[N]),w.useEffect(()=>{if(x&&b){const A=G=>E(G,b),U=G=>E(G,x);return x.addEventListener("pointerleave",A),b.addEventListener("pointerleave",U),()=>{x.removeEventListener("pointerleave",A),b.removeEventListener("pointerleave",U)}}},[x,b,E,N]),w.useEffect(()=>{if(g){const A=U=>{const G=U.target,T={x:U.clientX,y:U.clientY},K=x?.contains(G)||b?.contains(G),q=!Bb(T,g);K?N():q&&(N(),p())};return document.addEventListener("pointermove",A),()=>document.removeEventListener("pointermove",A)}},[x,b,g,p,N]),s.jsx(b0,{...l,ref:m})}),[zb,Rb]=Qo(rr,{isInside:!1}),Db=bb("TooltipContent"),b0=w.forwardRef((l,o)=>{const{__scopeTooltip:c,children:u,"aria-label":f,onEscapeKeyDown:m,onPointerDownOutside:g,...v}=l,x=ir(el,c),p=Zo(c),{onClose:b}=x;return w.useEffect(()=>(document.addEventListener(Eu,b),()=>document.removeEventListener(Eu,b)),[b]),w.useEffect(()=>{if(x.trigger){const h=N=>{N.target?.contains(x.trigger)&&b()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[x.trigger,b]),s.jsx(qp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:h=>h.preventDefault(),onDismiss:b,children:s.jsxs(mb,{"data-state":x.stateAttribute,...p,...v,ref:o,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(Db,{children:u}),s.jsx(zb,{scope:c,isInside:!0,children:s.jsx(Eb,{id:x.contentId,role:"tooltip",children:f||u})})]})})});y0.displayName=el;var w0="TooltipArrow",N0=w.forwardRef((l,o)=>{const{__scopeTooltip:c,...u}=l,f=Zo(c);return Rb(w0,c).isInside?null:s.jsx(hb,{...f,...u,ref:o})});N0.displayName=w0;function Lb(l,o){const c=Math.abs(o.top-l.y),u=Math.abs(o.bottom-l.y),f=Math.abs(o.right-l.x),m=Math.abs(o.left-l.x);switch(Math.min(c,u,f,m)){case m:return"left";case f:return"right";case c:return"top";case u:return"bottom";default:throw new Error("unreachable")}}function Ub(l,o,c=5){const u=[];switch(o){case"top":u.push({x:l.x-c,y:l.y+c},{x:l.x+c,y:l.y+c});break;case"bottom":u.push({x:l.x-c,y:l.y-c},{x:l.x+c,y:l.y-c});break;case"left":u.push({x:l.x+c,y:l.y-c},{x:l.x+c,y:l.y+c});break;case"right":u.push({x:l.x-c,y:l.y-c},{x:l.x-c,y:l.y+c});break}return u}function Hb(l){const{top:o,right:c,bottom:u,left:f}=l;return[{x:f,y:o},{x:c,y:o},{x:c,y:u},{x:f,y:u}]}function Bb(l,o){const{x:c,y:u}=l;let f=!1;for(let m=0,g=o.length-1;mu!=N>u&&c<(h-p)*(u-b)/(N-b)+p&&(f=!f)}return f}function qb(l){const o=l.slice();return o.sort((c,u)=>c.xu.x?1:c.yu.y?1:0),Yb(o)}function Yb(l){if(l.length<=1)return l.slice();const o=[];for(let u=0;u=2;){const m=o[o.length-1],g=o[o.length-2];if((m.x-g.x)*(f.y-g.y)>=(m.y-g.y)*(f.x-g.x))o.pop();else break}o.push(f)}o.pop();const c=[];for(let u=l.length-1;u>=0;u--){const f=l[u];for(;c.length>=2;){const m=c[c.length-1],g=c[c.length-2];if((m.x-g.x)*(f.y-g.y)>=(m.y-g.y)*(f.x-g.x))c.pop();else break}c.push(f)}return c.pop(),o.length===1&&c.length===1&&o[0].x===c[0].x&&o[0].y===c[0].y?o:o.concat(c)}var Gb=p0,Vb=g0,Xb=x0,$b=v0,Qb=y0,Zb=N0;function j0(l){var o,c,u="";if(typeof l=="string"||typeof l=="number")u+=l;else if(typeof l=="object")if(Array.isArray(l)){var f=l.length;for(o=0;o{const c=new Array(l.length+o.length);for(let u=0;u({classGroupId:l,validator:o}),_0=(l=new Map,o=null,c)=>({nextPart:l,validators:o,classGroupId:c}),Lo="-",xp=[],Fb="arbitrary..",Wb=l=>{const o=Ib(l),{conflictingClassGroups:c,conflictingClassGroupModifiers:u}=l;return{getClassGroupId:g=>{if(g.startsWith("[")&&g.endsWith("]"))return Pb(g);const v=g.split(Lo),x=v[0]===""&&v.length>1?1:0;return E0(v,x,o)},getConflictingClassGroupIds:(g,v)=>{if(v){const x=u[g],p=c[g];return x?p?Kb(p,x):x:p||xp}return c[g]||xp}}},E0=(l,o,c)=>{if(l.length-o===0)return c.classGroupId;const f=l[o],m=c.nextPart.get(f);if(m){const p=E0(l,o+1,m);if(p)return p}const g=c.validators;if(g===null)return;const v=o===0?l.join(Lo):l.slice(o).join(Lo),x=g.length;for(let p=0;pl.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=l.slice(1,-1),c=o.indexOf(":"),u=o.slice(0,c);return u?Fb+u:void 0})(),Ib=l=>{const{theme:o,classGroups:c}=l;return e1(c,o)},e1=(l,o)=>{const c=_0();for(const u in l){const f=l[u];Pu(f,c,u,o)}return c},Pu=(l,o,c,u)=>{const f=l.length;for(let m=0;m{if(typeof l=="string"){a1(l,o,c);return}if(typeof l=="function"){n1(l,o,c,u);return}s1(l,o,c,u)},a1=(l,o,c)=>{const u=l===""?o:C0(o,l);u.classGroupId=c},n1=(l,o,c,u)=>{if(l1(l)){Pu(l(u),o,c,u);return}o.validators===null&&(o.validators=[]),o.validators.push(Jb(c,l))},s1=(l,o,c,u)=>{const f=Object.entries(l),m=f.length;for(let g=0;g{let c=l;const u=o.split(Lo),f=u.length;for(let m=0;m"isThemeGetter"in l&&l.isThemeGetter===!0,r1=l=>{if(l<1)return{get:()=>{},set:()=>{}};let o=0,c=Object.create(null),u=Object.create(null);const f=(m,g)=>{c[m]=g,o++,o>l&&(o=0,u=c,c=Object.create(null))};return{get(m){let g=c[m];if(g!==void 0)return g;if((g=u[m])!==void 0)return f(m,g),g},set(m,g){m in c?c[m]=g:f(m,g)}}},Tu="!",vp=":",o1=[],yp=(l,o,c,u,f)=>({modifiers:l,hasImportantModifier:o,baseClassName:c,maybePostfixModifierPosition:u,isExternal:f}),i1=l=>{const{prefix:o,experimentalParseClassName:c}=l;let u=f=>{const m=[];let g=0,v=0,x=0,p;const b=f.length;for(let U=0;Ux?p-x:void 0;return yp(m,E,N,A)};if(o){const f=o+vp,m=u;u=g=>g.startsWith(f)?m(g.slice(f.length)):yp(o1,!1,g,void 0,!0)}if(c){const f=u;u=m=>c({className:m,parseClassName:f})}return u},c1=l=>{const o=new Map;return l.orderSensitiveModifiers.forEach((c,u)=>{o.set(c,1e6+u)}),c=>{const u=[];let f=[];for(let m=0;m0&&(f.sort(),u.push(...f),f=[]),u.push(g)):f.push(g)}return f.length>0&&(f.sort(),u.push(...f)),u}},u1=l=>({cache:r1(l.cacheSize),parseClassName:i1(l),sortModifiers:c1(l),...Wb(l)}),d1=/\s+/,f1=(l,o)=>{const{parseClassName:c,getClassGroupId:u,getConflictingClassGroupIds:f,sortModifiers:m}=o,g=[],v=l.trim().split(d1);let x="";for(let p=v.length-1;p>=0;p-=1){const b=v[p],{isExternal:h,modifiers:N,hasImportantModifier:E,baseClassName:A,maybePostfixModifierPosition:U}=c(b);if(h){x=b+(x.length>0?" "+x:x);continue}let G=!!U,T=u(G?A.substring(0,U):A);if(!T){if(!G){x=b+(x.length>0?" "+x:x);continue}if(T=u(A),!T){x=b+(x.length>0?" "+x:x);continue}G=!1}const K=N.length===0?"":N.length===1?N[0]:m(N).join(":"),q=E?K+Tu:K,F=q+T;if(g.indexOf(F)>-1)continue;g.push(F);const ae=f(T,G);for(let te=0;te0?" "+x:x)}return x},m1=(...l)=>{let o=0,c,u,f="";for(;o{if(typeof l=="string")return l;let o,c="";for(let u=0;u{let c,u,f,m;const g=x=>{const p=o.reduce((b,h)=>h(b),l());return c=u1(p),u=c.cache.get,f=c.cache.set,m=v,v(x)},v=x=>{const p=u(x);if(p)return p;const b=f1(x,c);return f(x,b),b};return m=g,(...x)=>m(m1(...x))},p1=[],ut=l=>{const o=c=>c[l]||p1;return o.isThemeGetter=!0,o},k0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,A0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,g1=/^\d+\/\d+$/,x1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,v1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,y1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,b1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,w1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fs=l=>g1.test(l),ke=l=>!!l&&!Number.isNaN(Number(l)),zn=l=>!!l&&Number.isInteger(Number(l)),xu=l=>l.endsWith("%")&&ke(l.slice(0,-1)),tn=l=>x1.test(l),N1=()=>!0,j1=l=>v1.test(l)&&!y1.test(l),M0=()=>!1,S1=l=>b1.test(l),_1=l=>w1.test(l),E1=l=>!me(l)&&!he(l),C1=l=>rl(l,R0,M0),me=l=>k0.test(l),ls=l=>rl(l,D0,j1),vu=l=>rl(l,O1,ke),bp=l=>rl(l,O0,M0),T1=l=>rl(l,z0,_1),Eo=l=>rl(l,L0,S1),he=l=>A0.test(l),nr=l=>ol(l,D0),k1=l=>ol(l,z1),wp=l=>ol(l,O0),A1=l=>ol(l,R0),M1=l=>ol(l,z0),Co=l=>ol(l,L0,!0),rl=(l,o,c)=>{const u=k0.exec(l);return u?u[1]?o(u[1]):c(u[2]):!1},ol=(l,o,c=!1)=>{const u=A0.exec(l);return u?u[1]?o(u[1]):c:!1},O0=l=>l==="position"||l==="percentage",z0=l=>l==="image"||l==="url",R0=l=>l==="length"||l==="size"||l==="bg-size",D0=l=>l==="length",O1=l=>l==="number",z1=l=>l==="family-name",L0=l=>l==="shadow",R1=()=>{const l=ut("color"),o=ut("font"),c=ut("text"),u=ut("font-weight"),f=ut("tracking"),m=ut("leading"),g=ut("breakpoint"),v=ut("container"),x=ut("spacing"),p=ut("radius"),b=ut("shadow"),h=ut("inset-shadow"),N=ut("text-shadow"),E=ut("drop-shadow"),A=ut("blur"),U=ut("perspective"),G=ut("aspect"),T=ut("ease"),K=ut("animate"),q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ae=()=>[...F(),he,me],te=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],L=()=>[he,me,x],Y=()=>[Fs,"full","auto",...L()],z=()=>[zn,"none","subgrid",he,me],se=()=>["auto",{span:["full",zn,he,me]},zn,he,me],ie=()=>[zn,"auto",he,me],O=()=>["auto","min","max","fr",he,me],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],oe=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...L()],V=()=>[Fs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],B=()=>[l,he,me],ce=()=>[...F(),wp,bp,{position:[he,me]}],ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],S=()=>["auto","cover","contain",A1,C1,{size:[he,me]}],Q=()=>[xu,nr,ls],$=()=>["","none","full",p,he,me],ee=()=>["",ke,nr,ls],re=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[ke,xu,wp,bp],we=()=>["","none",A,he,me],Te=()=>["none",ke,he,me],We=()=>["none",ke,he,me],it=()=>[ke,he,me],qe=()=>[Fs,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[tn],breakpoint:[tn],color:[N1],container:[tn],"drop-shadow":[tn],ease:["in","out","in-out"],font:[E1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[tn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[tn],shadow:[tn],spacing:["px",ke],text:[tn],"text-shadow":[tn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fs,me,he,G]}],container:["container"],columns:[{columns:[ke,me,he,v]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:ae()}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{start:Y()}],end:[{end:Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[zn,"auto",he,me]}],basis:[{basis:[Fs,"full","auto",v,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,Fs,"auto","initial","none",me]}],grow:[{grow:["",ke,he,me]}],shrink:[{shrink:["",ke,he,me]}],order:[{order:[zn,"first","last","none",he,me]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...oe()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...oe(),"baseline"]}],"place-self":[{"place-self":["auto",...oe()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[v,"screen",...V()]}],"min-w":[{"min-w":[v,"screen","none",...V()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[g]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",c,nr,ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[u,he,vu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",xu,me]}],"font-family":[{font:[k1,me,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[f,he,me]}],"line-clamp":[{"line-clamp":[ke,"none",he,vu]}],leading:[{leading:[m,...L()]}],"list-image":[{"list-image":["none",he,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",he,ls]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[ke,"auto",he,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:ge()}],"bg-size":[{bg:S()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},zn,he,me],radial:["",he,me],conic:[zn,he,me]},M1,T1]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,he,me]}],"outline-w":[{outline:["",ke,nr,ls]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",b,Co,Eo]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",h,Co,Eo]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[ke,ls]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",N,Co,Eo]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[ke,he,me]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[he,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":F()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:ge()}],"mask-size":[{mask:S()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,me]}],filter:[{filter:["","none",he,me]}],blur:[{blur:we()}],brightness:[{brightness:[ke,he,me]}],contrast:[{contrast:[ke,he,me]}],"drop-shadow":[{"drop-shadow":["","none",E,Co,Eo]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",ke,he,me]}],"hue-rotate":[{"hue-rotate":[ke,he,me]}],invert:[{invert:["",ke,he,me]}],saturate:[{saturate:[ke,he,me]}],sepia:[{sepia:["",ke,he,me]}],"backdrop-filter":[{"backdrop-filter":["","none",he,me]}],"backdrop-blur":[{"backdrop-blur":we()}],"backdrop-brightness":[{"backdrop-brightness":[ke,he,me]}],"backdrop-contrast":[{"backdrop-contrast":[ke,he,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,he,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,he,me]}],"backdrop-invert":[{"backdrop-invert":["",ke,he,me]}],"backdrop-opacity":[{"backdrop-opacity":[ke,he,me]}],"backdrop-saturate":[{"backdrop-saturate":[ke,he,me]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,he,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",he,me]}],ease:[{ease:["linear","initial",T,he,me]}],delay:[{delay:[ke,he,me]}],animate:[{animate:["none",K,he,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[U,he,me]}],"perspective-origin":[{"perspective-origin":ae()}],rotate:[{rotate:Te()}],"rotate-x":[{"rotate-x":Te()}],"rotate-y":[{"rotate-y":Te()}],"rotate-z":[{"rotate-z":Te()}],scale:[{scale:We()}],"scale-x":[{"scale-x":We()}],"scale-y":[{"scale-y":We()}],"scale-z":[{"scale-z":We()}],"scale-3d":["scale-3d"],skew:[{skew:it()}],"skew-x":[{"skew-x":it()}],"skew-y":[{"skew-y":it()}],transform:[{transform:[he,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:ae()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:qe()}],"translate-x":[{"translate-x":qe()}],"translate-y":[{"translate-y":qe()}],"translate-z":[{"translate-z":qe()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[ke,nr,ls,vu]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},D1=h1(R1);function je(...l){return D1(S0(l))}function U0({delayDuration:l=0,...o}){return s.jsx(Gb,{"data-slot":"tooltip-provider",delayDuration:l,...o})}function xa({...l}){return s.jsx(U0,{children:s.jsx(Vb,{"data-slot":"tooltip",...l})})}function va({...l}){return s.jsx(Xb,{"data-slot":"tooltip-trigger",...l})}function ya({className:l,sideOffset:o=0,children:c,...u}){return s.jsx($b,{children:s.jsxs(Qb,{"data-slot":"tooltip-content",sideOffset:o,className:je("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",l),...u,children:[c,s.jsx(Zb,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function L1(l){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.type="text/css",o.appendChild(c),c.styleSheet?c.styleSheet.cssText=l:c.appendChild(document.createTextNode(l))}const U1=l=>{switch(l){case"success":return q1;case"info":return G1;case"warning":return Y1;case"error":return V1;default:return null}},H1=Array(12).fill(0),B1=({visible:l,className:o})=>le.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":l},le.createElement("div",{className:"sonner-spinner"},H1.map((c,u)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${u}`})))),q1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Y1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),G1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),V1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),X1=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),$1=()=>{const[l,o]=le.useState(document.hidden);return le.useEffect(()=>{const c=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",c),()=>window.removeEventListener("visibilitychange",c)},[]),l};let ku=1;class Q1{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{const c=this.subscribers.indexOf(o);this.subscribers.splice(c,1)}),this.publish=o=>{this.subscribers.forEach(c=>c(o))},this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]},this.create=o=>{var c;const{message:u,...f}=o,m=typeof o?.id=="number"||((c=o.id)==null?void 0:c.length)>0?o.id:ku++,g=this.toasts.find(x=>x.id===m),v=o.dismissible===void 0?!0:o.dismissible;return this.dismissedToasts.has(m)&&this.dismissedToasts.delete(m),g?this.toasts=this.toasts.map(x=>x.id===m?(this.publish({...x,...o,id:m,title:u}),{...x,...o,id:m,dismissible:v,title:u}):x):this.addToast({title:u,...f,dismissible:v,id:m}),m},this.dismiss=o=>(o?(this.dismissedToasts.add(o),requestAnimationFrame(()=>this.subscribers.forEach(c=>c({id:o,dismiss:!0})))):this.toasts.forEach(c=>{this.subscribers.forEach(u=>u({id:c.id,dismiss:!0}))}),o),this.message=(o,c)=>this.create({...c,message:o}),this.error=(o,c)=>this.create({...c,message:o,type:"error"}),this.success=(o,c)=>this.create({...c,type:"success",message:o}),this.info=(o,c)=>this.create({...c,type:"info",message:o}),this.warning=(o,c)=>this.create({...c,type:"warning",message:o}),this.loading=(o,c)=>this.create({...c,type:"loading",message:o}),this.promise=(o,c)=>{if(!c)return;let u;c.loading!==void 0&&(u=this.create({...c,promise:o,type:"loading",message:c.loading,description:typeof c.description!="function"?c.description:void 0}));const f=Promise.resolve(o instanceof Function?o():o);let m=u!==void 0,g;const v=f.then(async p=>{if(g=["resolve",p],le.isValidElement(p))m=!1,this.create({id:u,type:"default",message:p});else if(K1(p)&&!p.ok){m=!1;const h=typeof c.error=="function"?await c.error(`HTTP error! status: ${p.status}`):c.error,N=typeof c.description=="function"?await c.description(`HTTP error! status: ${p.status}`):c.description,A=typeof h=="object"&&!le.isValidElement(h)?h:{message:h};this.create({id:u,type:"error",description:N,...A})}else if(p instanceof Error){m=!1;const h=typeof c.error=="function"?await c.error(p):c.error,N=typeof c.description=="function"?await c.description(p):c.description,A=typeof h=="object"&&!le.isValidElement(h)?h:{message:h};this.create({id:u,type:"error",description:N,...A})}else if(c.success!==void 0){m=!1;const h=typeof c.success=="function"?await c.success(p):c.success,N=typeof c.description=="function"?await c.description(p):c.description,A=typeof h=="object"&&!le.isValidElement(h)?h:{message:h};this.create({id:u,type:"success",description:N,...A})}}).catch(async p=>{if(g=["reject",p],c.error!==void 0){m=!1;const b=typeof c.error=="function"?await c.error(p):c.error,h=typeof c.description=="function"?await c.description(p):c.description,E=typeof b=="object"&&!le.isValidElement(b)?b:{message:b};this.create({id:u,type:"error",description:h,...E})}}).finally(()=>{m&&(this.dismiss(u),u=void 0),c.finally==null||c.finally.call(c)}),x=()=>new Promise((p,b)=>v.then(()=>g[0]==="reject"?b(g[1]):p(g[1])).catch(b));return typeof u!="string"&&typeof u!="number"?{unwrap:x}:Object.assign(u,{unwrap:x})},this.custom=(o,c)=>{const u=c?.id||ku++;return this.create({jsx:o(u),id:u,...c}),u},this.getActiveToasts=()=>this.toasts.filter(o=>!this.dismissedToasts.has(o.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Gt=new Q1,Z1=(l,o)=>{const c=o?.id||ku++;return Gt.addToast({title:l,...o,id:c}),c},K1=l=>l&&typeof l=="object"&&"ok"in l&&typeof l.ok=="boolean"&&"status"in l&&typeof l.status=="number",J1=Z1,F1=()=>Gt.toasts,W1=()=>Gt.getActiveToasts(),yt=Object.assign(J1,{success:Gt.success,info:Gt.info,warning:Gt.warning,error:Gt.error,custom:Gt.custom,message:Gt.message,promise:Gt.promise,dismiss:Gt.dismiss,loading:Gt.loading},{getHistory:F1,getToasts:W1});L1("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function To(l){return l.label!==void 0}const P1=3,I1="24px",e2="16px",Np=4e3,t2=356,a2=14,n2=45,s2=200;function ka(...l){return l.filter(Boolean).join(" ")}function l2(l){const[o,c]=l.split("-"),u=[];return o&&u.push(o),c&&u.push(c),u}const r2=l=>{var o,c,u,f,m,g,v,x,p;const{invert:b,toast:h,unstyled:N,interacting:E,setHeights:A,visibleToasts:U,heights:G,index:T,toasts:K,expanded:q,removeToast:F,defaultRichColors:ae,closeButton:te,style:_,cancelButtonStyle:L,actionButtonStyle:Y,className:z="",descriptionClassName:se="",duration:ie,position:O,gap:ne,expandByDefault:oe,classNames:k,icons:V,closeButtonAriaLabel:B="Close toast"}=l,[ce,ge]=le.useState(null),[S,Q]=le.useState(null),[$,ee]=le.useState(!1),[re,xe]=le.useState(!1),[ue,we]=le.useState(!1),[Te,We]=le.useState(!1),[it,qe]=le.useState(!1),[P,Ye]=le.useState(0),[Z,ve]=le.useState(0),at=le.useRef(h.duration||ie||Np),_t=le.useRef(null),Xt=le.useRef(null),il=T===0,cl=T+1<=U,Et=h.type,ln=h.dismissible!==!1,Ct=h.className||"",Wo=h.descriptionClassName||"",Un=le.useMemo(()=>G.findIndex(Se=>Se.toastId===h.id)||0,[G,h.id]),cr=le.useMemo(()=>{var Se;return(Se=h.closeButton)!=null?Se:te},[h.closeButton,te]),Hn=le.useMemo(()=>h.duration||ie||Np,[h.duration,ie]),ul=le.useRef(0),La=le.useRef(0),ur=le.useRef(0),rn=le.useRef(null),[Bn,Tt]=O.split("-"),fa=le.useMemo(()=>G.reduce((Se,Ke,dt)=>dt>=Un?Se:Se+Ke.height,0),[G,Un]),bt=$1(),Po=h.invert||b,dl=Et==="loading";La.current=le.useMemo(()=>Un*ne+fa,[Un,fa]),le.useEffect(()=>{at.current=Hn},[Hn]),le.useEffect(()=>{ee(!0)},[]),le.useEffect(()=>{const Se=Xt.current;if(Se){const Ke=Se.getBoundingClientRect().height;return ve(Ke),A(dt=>[{toastId:h.id,height:Ke,position:h.position},...dt]),()=>A(dt=>dt.filter(wt=>wt.toastId!==h.id))}},[A,h.id]),le.useLayoutEffect(()=>{if(!$)return;const Se=Xt.current,Ke=Se.style.height;Se.style.height="auto";const dt=Se.getBoundingClientRect().height;Se.style.height=Ke,ve(dt),A(wt=>wt.find(Fe=>Fe.toastId===h.id)?wt.map(Fe=>Fe.toastId===h.id?{...Fe,height:dt}:Fe):[{toastId:h.id,height:dt,position:h.position},...wt])},[$,h.title,h.description,A,h.id,h.jsx,h.action,h.cancel]);const ja=le.useCallback(()=>{xe(!0),Ye(La.current),A(Se=>Se.filter(Ke=>Ke.toastId!==h.id)),setTimeout(()=>{F(h)},s2)},[h,F,A,La]);le.useEffect(()=>{if(h.promise&&Et==="loading"||h.duration===1/0||h.type==="loading")return;let Se;return q||E||bt?(()=>{if(ur.current{h.onAutoClose==null||h.onAutoClose.call(h,h),ja()},at.current)),()=>clearTimeout(Se)},[q,E,h,Et,bt,ja]),le.useEffect(()=>{h.delete&&(ja(),h.onDismiss==null||h.onDismiss.call(h,h))},[ja,h.delete]);function cs(){var Se;if(V?.loading){var Ke;return le.createElement("div",{className:ka(k?.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":Et==="loading"},V.loading)}return le.createElement(B1,{className:ka(k?.loader,h==null||(Se=h.classNames)==null?void 0:Se.loader),visible:Et==="loading"})}const us=h.icon||V?.[Et]||U1(Et);var qn,Sa;return le.createElement("li",{tabIndex:0,ref:Xt,className:ka(z,Ct,k?.toast,h==null||(o=h.classNames)==null?void 0:o.toast,k?.default,k?.[Et],h==null||(c=h.classNames)==null?void 0:c[Et]),"data-sonner-toast":"","data-rich-colors":(qn=h.richColors)!=null?qn:ae,"data-styled":!(h.jsx||h.unstyled||N),"data-mounted":$,"data-promise":!!h.promise,"data-swiped":it,"data-removed":re,"data-visible":cl,"data-y-position":Bn,"data-x-position":Tt,"data-index":T,"data-front":il,"data-swiping":ue,"data-dismissible":ln,"data-type":Et,"data-invert":Po,"data-swipe-out":Te,"data-swipe-direction":S,"data-expanded":!!(q||oe&&$),"data-testid":h.testId,style:{"--index":T,"--toasts-before":T,"--z-index":K.length-T,"--offset":`${re?P:La.current}px`,"--initial-height":oe?"auto":`${Z}px`,..._,...h.style},onDragEnd:()=>{we(!1),ge(null),rn.current=null},onPointerDown:Se=>{Se.button!==2&&(dl||!ln||(_t.current=new Date,Ye(La.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(we(!0),rn.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,Ke,dt;if(Te||!ln)return;rn.current=null;const wt=Number(((Se=Xt.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),on=Number(((Ke=Xt.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Fe=new Date().getTime()-((dt=_t.current)==null?void 0:dt.getTime()),Ot=ce==="x"?wt:on,Yn=Math.abs(Ot)/Fe;if(Math.abs(Ot)>=n2||Yn>.11){Ye(La.current),h.onDismiss==null||h.onDismiss.call(h,h),Q(ce==="x"?wt>0?"right":"left":on>0?"down":"up"),ja(),We(!0);return}else{var zt,Rt;(zt=Xt.current)==null||zt.style.setProperty("--swipe-amount-x","0px"),(Rt=Xt.current)==null||Rt.style.setProperty("--swipe-amount-y","0px")}qe(!1),we(!1),ge(null)},onPointerMove:Se=>{var Ke,dt,wt;if(!rn.current||!ln||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;const Fe=Se.clientY-rn.current.y,Ot=Se.clientX-rn.current.x;var Yn;const zt=(Yn=l.swipeDirections)!=null?Yn:l2(O);!ce&&(Math.abs(Ot)>1||Math.abs(Fe)>1)&&ge(Math.abs(Ot)>Math.abs(Fe)?"x":"y");let Rt={x:0,y:0};const ds=ma=>1/(1.5+Math.abs(ma)/20);if(ce==="y"){if(zt.includes("top")||zt.includes("bottom"))if(zt.includes("top")&&Fe<0||zt.includes("bottom")&&Fe>0)Rt.y=Fe;else{const ma=Fe*ds(Fe);Rt.y=Math.abs(ma)0)Rt.x=Ot;else{const ma=Ot*ds(Ot);Rt.x=Math.abs(ma)0||Math.abs(Rt.y)>0)&&qe(!0),(dt=Xt.current)==null||dt.style.setProperty("--swipe-amount-x",`${Rt.x}px`),(wt=Xt.current)==null||wt.style.setProperty("--swipe-amount-y",`${Rt.y}px`)}},cr&&!h.jsx&&Et!=="loading"?le.createElement("button",{"aria-label":B,"data-disabled":dl,"data-close-button":!0,onClick:dl||!ln?()=>{}:()=>{ja(),h.onDismiss==null||h.onDismiss.call(h,h)},className:ka(k?.closeButton,h==null||(u=h.classNames)==null?void 0:u.closeButton)},(Sa=V?.close)!=null?Sa:X1):null,(Et||h.icon||h.promise)&&h.icon!==null&&(V?.[Et]!==null||h.icon)?le.createElement("div",{"data-icon":"",className:ka(k?.icon,h==null||(f=h.classNames)==null?void 0:f.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||cs():null,h.type!=="loading"?us:null):null,le.createElement("div",{"data-content":"",className:ka(k?.content,h==null||(m=h.classNames)==null?void 0:m.content)},le.createElement("div",{"data-title":"",className:ka(k?.title,h==null||(g=h.classNames)==null?void 0:g.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?le.createElement("div",{"data-description":"",className:ka(se,Wo,k?.description,h==null||(v=h.classNames)==null?void 0:v.description)},typeof h.description=="function"?h.description():h.description):null),le.isValidElement(h.cancel)?h.cancel:h.cancel&&To(h.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||L,onClick:Se=>{To(h.cancel)&&ln&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Se),ja())},className:ka(k?.cancelButton,h==null||(x=h.classNames)==null?void 0:x.cancelButton)},h.cancel.label):null,le.isValidElement(h.action)?h.action:h.action&&To(h.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||Y,onClick:Se=>{To(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Se),!Se.defaultPrevented&&ja())},className:ka(k?.actionButton,h==null||(p=h.classNames)==null?void 0:p.actionButton)},h.action.label):null)};function jp(){if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?window.getComputedStyle(document.documentElement).direction:l}function o2(l,o){const c={};return[l,o].forEach((u,f)=>{const m=f===1,g=m?"--mobile-offset":"--offset",v=m?e2:I1;function x(p){["top","right","bottom","left"].forEach(b=>{c[`${g}-${b}`]=typeof p=="number"?`${p}px`:p})}typeof u=="number"||typeof u=="string"?x(u):typeof u=="object"?["top","right","bottom","left"].forEach(p=>{u[p]===void 0?c[`${g}-${p}`]=v:c[`${g}-${p}`]=typeof u[p]=="number"?`${u[p]}px`:u[p]}):x(v)}),c}const i2=le.forwardRef(function(o,c){const{id:u,invert:f,position:m="bottom-right",hotkey:g=["altKey","KeyT"],expand:v,closeButton:x,className:p,offset:b,mobileOffset:h,theme:N="light",richColors:E,duration:A,style:U,visibleToasts:G=P1,toastOptions:T,dir:K=jp(),gap:q=a2,icons:F,containerAriaLabel:ae="Notifications"}=o,[te,_]=le.useState([]),L=le.useMemo(()=>u?te.filter($=>$.toasterId===u):te.filter($=>!$.toasterId),[te,u]),Y=le.useMemo(()=>Array.from(new Set([m].concat(L.filter($=>$.position).map($=>$.position)))),[L,m]),[z,se]=le.useState([]),[ie,O]=le.useState(!1),[ne,oe]=le.useState(!1),[k,V]=le.useState(N!=="system"?N:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=le.useRef(null),ce=g.join("+").replace(/Key/g,"").replace(/Digit/g,""),ge=le.useRef(null),S=le.useRef(!1),Q=le.useCallback($=>{_(ee=>{var re;return(re=ee.find(xe=>xe.id===$.id))!=null&&re.delete||Gt.dismiss($.id),ee.filter(({id:xe})=>xe!==$.id)})},[]);return le.useEffect(()=>Gt.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{_(ee=>ee.map(re=>re.id===$.id?{...re,delete:!0}:re))});return}setTimeout(()=>{Hp.flushSync(()=>{_(ee=>{const re=ee.findIndex(xe=>xe.id===$.id);return re!==-1?[...ee.slice(0,re),{...ee[re],...$},...ee.slice(re+1)]:[$,...ee]})})})}),[te]),le.useEffect(()=>{if(N!=="system"){V(N);return}if(N==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:ee})=>{V(ee?"dark":"light")})}catch{$.addListener(({matches:re})=>{try{V(re?"dark":"light")}catch(xe){console.error(xe)}})}},[N]),le.useEffect(()=>{te.length<=1&&O(!1)},[te]),le.useEffect(()=>{const $=ee=>{var re;if(g.every(we=>ee[we]||ee.code===we)){var ue;O(!0),(ue=B.current)==null||ue.focus()}ee.code==="Escape"&&(document.activeElement===B.current||(re=B.current)!=null&&re.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[g]),le.useEffect(()=>{if(B.current)return()=>{ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null,S.current=!1)}},[B.current]),le.createElement("section",{ref:c,"aria-label":`${ae} ${ce}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Y.map(($,ee)=>{var re;const[xe,ue]=$.split("-");return L.length?le.createElement("ol",{key:$,dir:K==="auto"?jp():K,tabIndex:-1,ref:B,className:p,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":xe,"data-x-position":ue,style:{"--front-toast-height":`${((re=z[0])==null?void 0:re.height)||0}px`,"--width":`${t2}px`,"--gap":`${q}px`,...U,...o2(b,h)},onBlur:we=>{S.current&&!we.currentTarget.contains(we.relatedTarget)&&(S.current=!1,ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null))},onFocus:we=>{we.target instanceof HTMLElement&&we.target.dataset.dismissible==="false"||S.current||(S.current=!0,ge.current=we.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{ne||O(!1)},onDragEnd:()=>O(!1),onPointerDown:we=>{we.target instanceof HTMLElement&&we.target.dataset.dismissible==="false"||oe(!0)},onPointerUp:()=>oe(!1)},L.filter(we=>!we.position&&ee===0||we.position===$).map((we,Te)=>{var We,it;return le.createElement(r2,{key:we.id,icons:F,index:Te,toast:we,defaultRichColors:E,duration:(We=T?.duration)!=null?We:A,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:f,visibleToasts:G,closeButton:(it=T?.closeButton)!=null?it:x,interacting:ne,position:$,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:Q,toasts:L.filter(qe=>qe.position==we.position),heights:z.filter(qe=>qe.position==we.position),setHeights:se,expandByDefault:v,gap:q,expanded:ie,swipeDirections:o.swipeDirections})})):null}))});class ot extends Error{constructor(){super("Engine Offline"),this.name="EngineOfflineError"}}const H0=w.createContext(null);function Mt(){const l=w.useContext(H0);if(!l)throw new Error("useProxyContext must be used within ProxyProvider");return l}function c2({children:l}){const[o,c]=w.useState(null),u=w.useRef(null),[f,m]=w.useState(null),[g,v]=w.useState([]),[x,p]=w.useState(null),[b,h]=w.useState(!1),[N,E]=w.useState(1200),[A,U]=w.useState(!1),[G,T]=w.useState(!1),K=typeof window.pp_status=="function",q=w.useCallback((_,L="success")=>{L==="success"?yt.success(_):yt.error(_)},[]),F=w.useCallback(async()=>{try{let _=!1;if(window.pp_status){const L=await window.pp_status();c(L),u.current=L,_=L.running}else try{const L=await fetch("/healthz");if(L.ok){const z={running:!0,port:(await L.json().catch(()=>({}))).port||0,base_url:location.origin,last_error:""};c(z),u.current=z,_=!0}else{const Y={running:!1,port:0,base_url:location.origin,last_error:L.statusText};c(Y),u.current=Y}}catch(L){const Y={running:!1,port:0,base_url:location.origin,last_error:String(L)};c(Y),u.current=Y,_=!1}if(_){if(U(!0),T(!1),E(1200),f)try{const Y=await fetch("/v0/management/auth-files",{headers:{"X-Management-Key":f}});if(Y.ok){const z=await Y.json();Array.isArray(z)&&v(z)}}catch(L){console.error("Auth files error:",L)}}else A&&!G&&K&&window.pp_start&&(console.log("Unexpected stop detected, attempting auto-reconnect..."),window.pp_start().catch(L=>console.error("Auto-reconnect failed:",L))),v([]),E(L=>Math.min(L*1.5,1e4))}catch(_){console.error("Status error:",_),E(L=>Math.min(L*1.5,1e4))}},[f]),ae=w.useCallback(async(_,L={})=>{if(!u.current?.running)throw new ot;if(!f)throw new Error("Missing management key");h(!0);try{const z=Object.assign({},L.headers||{},{"X-Management-Key":f}),se=await fetch(_,{...L,headers:z}),O=(se.headers.get("content-type")||"").toLowerCase().includes("application/json")?await se.json():await se.text();if(!se.ok){const ne=u.current;if(se.status===404&&(!ne||!ne.running))throw new ot;const oe=typeof O=="string"?O:O?.error?O.error:JSON.stringify(O);throw new Error(`${se.status} ${se.statusText}: ${oe}`)}return O}catch(z){throw z instanceof TypeError?new ot:z}finally{h(!1)}},[f]),te=w.useCallback(async(_,L,Y)=>{if(_){L==="stop"&&T(!0),(L==="start"||L==="restart")&&T(!1),p(L);try{await _(),q(Y,"success"),await F()}catch(z){q(z instanceof Error?z.message:String(z),"error")}finally{p(null)}}},[q,F]);return w.useEffect(()=>{F();let _;const L=()=>{_=setTimeout(async()=>{await F(),L()},N)};return L(),(async()=>{try{if(window.pp_get_management_key){const Y=await window.pp_get_management_key();m(Y)}else if(!K){const Y=document.querySelector('meta[name="pp-mgmt-key"]');m(Y?Y.getAttribute("content"):null)}}catch(Y){console.error("Management key error:",Y)}})(),()=>clearTimeout(_)},[F,K,N]),s.jsx(H0.Provider,{value:{status:o,isDesktop:K,mgmtKey:f,authFiles:g,loading:x,isMgmtLoading:b,setLoading:p,refreshStatus:F,showToast:q,mgmtFetch:ae,handleAction:te,pp_get_usage:window.pp_get_usage,pp_detect_agents:window.pp_detect_agents,pp_configure_agent:window.pp_configure_agent,pp_unconfigure_agent:window.pp_unconfigure_agent,pp_check_updates:window.pp_check_updates,pp_download_update:window.pp_download_update},children:l})}const u2=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d2=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,c,u)=>u?u.toUpperCase():c.toLowerCase()),Sp=l=>{const o=d2(l);return o.charAt(0).toUpperCase()+o.slice(1)},B0=(...l)=>l.filter((o,c,u)=>!!o&&o.trim()!==""&&u.indexOf(o)===c).join(" ").trim(),f2=l=>{for(const o in l)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};var m2={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"};const h2=w.forwardRef(({color:l="currentColor",size:o=24,strokeWidth:c=2,absoluteStrokeWidth:u,className:f="",children:m,iconNode:g,...v},x)=>w.createElement("svg",{ref:x,...m2,width:o,height:o,stroke:l,strokeWidth:u?Number(c)*24/Number(o):c,className:B0("lucide",f),...!m&&!f2(v)&&{"aria-hidden":"true"},...v},[...g.map(([p,b])=>w.createElement(p,b)),...Array.isArray(m)?m:[m]]));const fe=(l,o)=>{const c=w.forwardRef(({className:u,...f},m)=>w.createElement(h2,{ref:m,iconNode:o,className:B0(`lucide-${u2(Sp(l))}`,`lucide-${l}`,u),...f}));return c.displayName=Sp(l),c};const p2=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ko=fe("activity",p2);const g2=[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]],_p=fe("anchor",g2);const x2=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Au=fe("brain",x2);const v2=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Mu=fe("chart-column",v2);const y2=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],b2=fe("chart-pie",y2);const w2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],tl=fe("check",w2);const N2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],al=fe("chevron-down",N2);const j2=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],S2=fe("chevron-left",j2);const _2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ou=fe("chevron-right",_2);const E2=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],C2=fe("chevrons-left",E2);const T2=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],k2=fe("chevrons-right",T2);const A2=[["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"}]],Uo=fe("circle-alert",A2);const M2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],q0=fe("circle-check",M2);const O2=[["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"}]],z2=fe("circle-x",O2);const R2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ho=fe("circle",R2);const D2=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],L2=fe("clipboard",D2);const U2=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],H2=fe("clock",U2);const B2=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Ep=fe("code-xml",B2);const q2=[["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"}]],nl=fe("copy",q2);const Y2=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Y0=fe("database",Y2);const G2=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],V2=fe("dollar-sign",G2);const X2=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],is=fe("download",X2);const $2=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],G0=fe("external-link",$2);const Q2=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Z2=fe("file-code",Q2);const K2=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],V0=fe("file-text",K2);const J2=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],zu=fe("folder-open",J2);const F2=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],W2=fe("funnel",F2);const P2=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],I2=fe("gauge",P2);const ew=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],tw=fe("git-branch",ew);const aw=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],nw=fe("history",aw);const sw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],lw=fe("info",sw);const rw=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],ow=fe("key",rw);const iw=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Vt=fe("loader-circle",iw);const cw=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],X0=fe("lock-open",cw);const uw=[["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"}]],$0=fe("lock",uw);const dw=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],fw=fe("monitor",dw);const mw=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],hw=fe("moon",mw);const pw=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],gw=fe("pencil",pw);const xw=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],vw=fe("pin",xw);const yw=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Q0=fe("play",yw);const bw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ww=fe("plus",bw);const Nw=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],yu=fe("radar",Nw);const jw=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Z0=fe("radio",jw);const Sw=[["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"}]],ba=fe("refresh-cw",Sw);const _w=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ew=fe("rotate-ccw",_w);const Cw=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Tw=fe("rotate-cw",Cw);const kw=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Ps=fe("save",kw);const Aw=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],Mw=fe("scissors",Aw);const Ow=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],zw=fe("scroll-text",Ow);const Rw=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Dw=fe("search",Rw);const Lw=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Mo=fe("settings",Lw);const Uw=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Hw=fe("settings-2",Uw);const Bw=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],qw=fe("shield",Bw);const Yw=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],K0=fe("sparkles",Yw);const Gw=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Vw=fe("square",Gw);const Xw=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],$w=fe("sun",Xw);const Qw=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ru=fe("terminal",Qw);const Zw=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Jo=fe("trash-2",Zw);const Kw=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],Jw=fe("trending-down",Kw);const Fw=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Iu=fe("triangle-alert",Fw);const Ww=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Pw=fe("undo-2",Ww);const Iw=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],eN=fe("upload",Iw);const tN=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],J0=fe("wrench",tN);const aN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ed=fe("x",aN);const nN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Du=fe("zap",nN);function sN(l){const o=Math.floor(l/3600),c=Math.floor(l%3600/60),u=l%60;return o>0?`${o}h ${c}m`:c>0?`${c}m ${u}s`:`${u}s`}function lN(){const{status:l,loading:o,handleAction:c,showToast:u,isDesktop:f}=Mt(),[m,g]=w.useState(0),[v,x]=w.useState(!1),p=w.useRef(null),b=l?.running??!1;w.useEffect(()=>{if(b){p.current===null&&(p.current=Date.now());const N=setInterval(()=>{p.current&&g(Math.floor((Date.now()-p.current)/1e3))},1e3);return()=>clearInterval(N)}p.current=null,g(0)},[b]);const h=async()=>{if(l?.base_url)try{await navigator.clipboard.writeText(l.base_url),x(!0),u("URL copied to clipboard","success"),setTimeout(()=>x(!1),2e3)}catch{u("Failed to copy URL","error")}};return s.jsxs("div",{className:"rounded-lg border border-[var(--border-default)] bg-[var(--bg-panel)] shadow-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-[var(--bg-elevated)] border-b border-[var(--border-default)]",children:[s.jsx(Z0,{className:"h-4 w-4 text-[var(--accent-primary)]"}),s.jsx("span",{className:"font-mono text-xs font-bold uppercase tracking-widest text-[var(--text-secondary)]",children:"Engine Control"}),s.jsx("div",{className:"flex-1"}),s.jsx("div",{className:`h-2 w-2 rounded-full ${b?"bg-[var(--status-online)] animate-pulse":"bg-[var(--status-offline)]"}`})]}),s.jsxs("div",{className:"p-6 flex flex-col items-center",children:[s.jsxs("div",{className:"relative w-48 h-48 mb-6",children:[b&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-[var(--status-online)] opacity-0",style:{animation:"radar-pulse 2s ease-out infinite"}}),s.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-[var(--status-online)] opacity-0",style:{animation:"radar-pulse 2s ease-out infinite 0.5s"}}),s.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-[var(--status-online)] opacity-0",style:{animation:"radar-pulse 2s ease-out infinite 1s"}})]}),s.jsx("div",{className:`absolute inset-4 rounded-full border-2 transition-colors duration-300 ${b?"border-[var(--status-online)]/30":"border-[var(--border-subtle)]"}`}),s.jsx("div",{className:`absolute inset-8 rounded-full border transition-colors duration-300 ${b?"border-[var(--status-online)]/20":"border-[var(--border-subtle)]/50"}`}),s.jsx("div",{className:`absolute inset-12 rounded-full flex flex-col items-center justify-center transition-all duration-500 ${b?"bg-gradient-to-br from-[var(--accent-primary)] to-[var(--accent-secondary)] shadow-[0_0_30px_var(--status-online)]":"bg-gradient-to-br from-[var(--bg-elevated)] to-[var(--bg-active)] border border-[var(--border-default)]"}`,children:s.jsx("span",{className:`font-mono text-xs font-bold tracking-wider ${b?"text-white":"text-[var(--text-muted)]"}`,children:b?"ONLINE":"OFFLINE"})}),b&&s.jsx("div",{className:"absolute inset-0 rounded-full overflow-hidden",style:{animation:"radar-sweep 3s linear infinite"},children:s.jsx("div",{className:"absolute top-1/2 left-1/2 w-1/2 h-0.5 origin-left",style:{background:"linear-gradient(90deg, var(--status-online) 0%, transparent 100%)"}})})]}),s.jsxs("div",{className:"w-full grid grid-cols-2 gap-3 mb-6",children:[s.jsxs("div",{className:"bg-[var(--bg-void)] rounded-md border border-[var(--border-subtle)] p-3",children:[s.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:"Port"}),s.jsx("div",{className:`font-mono text-lg font-bold ${b?"text-[var(--accent-glow)]":"text-[var(--text-muted)]"}`,children:b&&l?.port||"---"})]}),s.jsxs("div",{className:"bg-[var(--bg-void)] rounded-md border border-[var(--border-subtle)] p-3",children:[s.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:"Uptime"}),s.jsx("div",{className:`font-mono text-lg font-bold ${b?"text-[var(--accent-glow)]":"text-[var(--text-muted)]"}`,children:b?sN(m):"--:--"})]})]}),l?.last_error&&s.jsx("div",{className:"w-full mb-6 rounded-md border-2 border-[var(--status-warning)] bg-[var(--status-warning)]/10 p-4",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"p-1.5 rounded bg-[var(--status-warning)]/20",children:s.jsx(Iu,{className:"h-4 w-4 text-[var(--status-warning)]"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-[var(--status-warning)] mb-1",children:"Caution"}),s.jsx("div",{className:"font-mono text-sm text-[var(--status-warning)] break-all",children:l.last_error})]})]})}),s.jsxs("div",{className:"w-full grid grid-cols-3 gap-3 mb-6",children:[s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsxs("button",{type:"button",disabled:b||o==="start",onClick:()=>c(window.pp_start,"start","Proxy started"),className:` - relative flex flex-col items-center justify-center gap-1 py-4 px-3 rounded-lg - font-mono text-xs font-bold uppercase tracking-wider - border-2 transition-all duration-150 - ${b||o==="start"?"opacity-40 cursor-not-allowed border-[var(--border-subtle)] bg-[var(--bg-elevated)] text-[var(--text-muted)]":"border-[var(--status-online)] bg-gradient-to-b from-[var(--bg-elevated)] to-[var(--bg-panel)] text-[var(--status-online)] hover:shadow-[0_0_15px_var(--status-online)] active:translate-y-0.5 active:shadow-none cursor-pointer"} - shadow-[inset_0_1px_0_rgba(255,255,255,0.1),0_2px_4px_rgba(0,0,0,0.3)] - `,children:[s.jsx(Q0,{className:"h-5 w-5 fill-current"}),s.jsx("span",{children:"Start"})]})}),s.jsx(ya,{children:"Start the proxy server"})]}),s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsxs("button",{type:"button",disabled:!b||o==="stop",onClick:()=>c(window.pp_stop,"stop","Proxy stopped"),className:` - relative flex flex-col items-center justify-center gap-1 py-4 px-3 rounded-lg - font-mono text-xs font-bold uppercase tracking-wider - border-2 transition-all duration-150 - ${!b||o==="stop"?"opacity-40 cursor-not-allowed border-[var(--border-subtle)] bg-[var(--bg-elevated)] text-[var(--text-muted)]":"border-[var(--status-offline)] bg-gradient-to-b from-[var(--bg-elevated)] to-[var(--bg-panel)] text-[var(--status-offline)] hover:shadow-[0_0_15px_var(--status-offline)] active:translate-y-0.5 active:shadow-none cursor-pointer"} - shadow-[inset_0_1px_0_rgba(255,255,255,0.1),0_2px_4px_rgba(0,0,0,0.3)] - `,children:[s.jsx(Vw,{className:"h-5 w-5 fill-current"}),s.jsx("span",{children:"Stop"})]})}),s.jsx(ya,{children:"Stop the proxy server"})]}),s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsxs("button",{type:"button",disabled:!b||o==="restart",onClick:()=>c(window.pp_restart,"restart","Proxy restarted"),className:` - relative flex flex-col items-center justify-center gap-1 py-4 px-3 rounded-lg - font-mono text-xs font-bold uppercase tracking-wider - border-2 transition-all duration-150 - ${!b||o==="restart"?"opacity-40 cursor-not-allowed border-[var(--border-subtle)] bg-[var(--bg-elevated)] text-[var(--text-muted)]":"border-[var(--accent-primary)] bg-gradient-to-b from-[var(--bg-elevated)] to-[var(--bg-panel)] text-[var(--accent-primary)] hover:shadow-[0_0_15px_var(--accent-primary)] active:translate-y-0.5 active:shadow-none cursor-pointer"} - shadow-[inset_0_1px_0_rgba(255,255,255,0.1),0_2px_4px_rgba(0,0,0,0.3)] - `,children:[s.jsx(Tw,{className:`h-5 w-5 ${o==="restart"?"animate-spin":""}`}),s.jsx("span",{children:"Restart"})]})}),s.jsx(ya,{children:"Restart the proxy server"})]})]}),l?.base_url&&s.jsx("div",{className:"w-full bg-[var(--bg-void)] rounded-md border border-[var(--border-subtle)] p-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:"Base URL"}),s.jsx("div",{className:"font-mono text-sm text-[var(--text-accent)] truncate",children:l.base_url})]}),s.jsxs("button",{type:"button",onClick:h,className:` - flex items-center gap-1.5 px-3 py-1.5 rounded - font-mono text-xs uppercase tracking-wider - border transition-all duration-150 - ${v?"border-[var(--status-online)] bg-[var(--status-online)]/10 text-[var(--status-online)]":"border-[var(--border-default)] bg-[var(--bg-elevated)] text-[var(--text-secondary)] hover:border-[var(--accent-primary)] hover:text-[var(--accent-primary)]"} - active:translate-y-0.5 cursor-pointer - `,children:[v?s.jsx(tl,{className:"h-3.5 w-3.5"}):s.jsx(nl,{className:"h-3.5 w-3.5"}),v?"Copied":"Copy"]})]})}),f&&s.jsxs("div",{className:"w-full mt-4 pt-4 border-t border-[var(--border-subtle)]",children:[s.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider text-[var(--text-muted)] mb-3",children:"Quick Actions"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{type:"button",onClick:()=>c(window.pp_open_logs,"logs","Opened logs"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded border border-[var(--border-default)] bg-[var(--bg-elevated)] text-[var(--text-secondary)] font-mono text-xs hover:border-[var(--accent-primary)] hover:text-[var(--accent-primary)] transition-colors active:translate-y-0.5 cursor-pointer",children:[s.jsx(V0,{className:"h-3.5 w-3.5"}),"Logs"]}),s.jsxs("button",{type:"button",onClick:()=>c(window.pp_open_auth_folder,"auth","Opened auth folder"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded border border-[var(--border-default)] bg-[var(--bg-elevated)] text-[var(--text-secondary)] font-mono text-xs hover:border-[var(--accent-primary)] hover:text-[var(--accent-primary)] transition-colors active:translate-y-0.5 cursor-pointer",children:[s.jsx(zu,{className:"h-3.5 w-3.5"}),"Auth"]}),s.jsxs("button",{type:"button",disabled:!b,onClick:()=>c(window.pp_open_diagnostics,"diag-open","Opened diagnostics"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded border font-mono text-xs transition-colors active:translate-y-0.5 cursor-pointer ${b?"border-[var(--border-default)] bg-[var(--bg-elevated)] text-[var(--text-secondary)] hover:border-[var(--accent-primary)] hover:text-[var(--accent-primary)]":"opacity-40 cursor-not-allowed border-[var(--border-subtle)] bg-[var(--bg-elevated)] text-[var(--text-muted)]"}`,children:[s.jsx(Ko,{className:"h-3.5 w-3.5"}),"Diagnostics"]})]})]}),!f&&!l?.base_url&&s.jsx("div",{className:"w-full mt-4 pt-4 border-t border-[var(--border-subtle)]",children:s.jsxs("button",{type:"button",onClick:h,disabled:!l?.base_url,className:"flex items-center gap-1.5 px-3 py-1.5 rounded border border-[var(--border-default)] bg-[var(--bg-elevated)] text-[var(--text-secondary)] font-mono text-xs hover:border-[var(--accent-primary)] hover:text-[var(--accent-primary)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed active:translate-y-0.5 cursor-pointer",children:[v?s.jsx(tl,{className:"h-3.5 w-3.5"}):s.jsx(nl,{className:"h-3.5 w-3.5"}),v?"Copied":"Copy URL"]})})]}),s.jsx("style",{children:` - @keyframes radar-pulse { - 0% { - transform: scale(0.8); - opacity: 0.8; - } - 100% { - transform: scale(1.5); - opacity: 0; - } - } - - @keyframes radar-sweep { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } - } - `})]})}function rN(l){const o=w.useRef({value:l,previous:l});return w.useMemo(()=>(o.current.value!==l&&(o.current.previous=o.current.value,o.current.value=l),o.current.previous),[l])}var Fo="Switch",[oN]=Bu(Fo),[iN,cN]=oN(Fo),F0=w.forwardRef((l,o)=>{const{__scopeSwitch:c,name:u,checked:f,defaultChecked:m,required:g,disabled:v,value:x="on",onCheckedChange:p,form:b,...h}=l,[N,E]=w.useState(null),A=sn(o,q=>E(q)),U=w.useRef(!1),G=N?b||!!N.closest("form"):!0,[T,K]=f0({prop:f,defaultProp:m??!1,onChange:p,caller:Fo});return s.jsxs(iN,{scope:c,checked:T,disabled:v,children:[s.jsx(Ra.button,{type:"button",role:"switch","aria-checked":T,"aria-required":g,"data-state":eg(T),"data-disabled":v?"":void 0,disabled:v,value:x,...h,ref:A,onClick:Aa(l.onClick,q=>{K(F=>!F),G&&(U.current=q.isPropagationStopped(),U.current||q.stopPropagation())})}),G&&s.jsx(I0,{control:N,bubbles:!U.current,name:u,value:x,checked:T,required:g,disabled:v,form:b,style:{transform:"translateX(-100%)"}})]})});F0.displayName=Fo;var W0="SwitchThumb",P0=w.forwardRef((l,o)=>{const{__scopeSwitch:c,...u}=l,f=cN(W0,c);return s.jsx(Ra.span,{"data-state":eg(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:o})});P0.displayName=W0;var uN="SwitchBubbleInput",I0=w.forwardRef(({__scopeSwitch:l,control:o,checked:c,bubbles:u=!0,...f},m)=>{const g=w.useRef(null),v=sn(g,m),x=rN(c),p=e0(o);return w.useEffect(()=>{const b=g.current;if(!b)return;const h=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(h,"checked").set;if(x!==c&&E){const A=new Event("click",{bubbles:u});E.call(b,c),b.dispatchEvent(A)}},[x,c,u]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:c,...f,tabIndex:-1,ref:v,style:{...f.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});I0.displayName=uN;function eg(l){return l?"checked":"unchecked"}var dN=F0,fN=P0;function Bo({className:l,...o}){return s.jsx(dN,{"data-slot":"switch",className:je("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",l),...o,children:s.jsx(fN,{"data-slot":"switch-thumb",className:je("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}var mN=Symbol.for("react.lazy"),qo=Uu[" use ".trim().toString()];function hN(l){return typeof l=="object"&&l!==null&&"then"in l}function tg(l){return l!=null&&typeof l=="object"&&"$$typeof"in l&&l.$$typeof===mN&&"_payload"in l&&hN(l._payload)}function ag(l){const o=pN(l),c=w.forwardRef((u,f)=>{let{children:m,...g}=u;tg(m)&&typeof qo=="function"&&(m=qo(m._payload));const v=w.Children.toArray(m),x=v.find(xN);if(x){const p=x.props.children,b=v.map(h=>h===x?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:h);return s.jsx(o,{...g,ref:f,children:w.isValidElement(p)?w.cloneElement(p,void 0,b):null})}return s.jsx(o,{...g,ref:f,children:m})});return c.displayName=`${l}.Slot`,c}var ng=ag("Slot");function pN(l){const o=w.forwardRef((c,u)=>{let{children:f,...m}=c;if(tg(f)&&typeof qo=="function"&&(f=qo(f._payload)),w.isValidElement(f)){const g=yN(f),v=vN(m,f.props);return f.type!==w.Fragment&&(v.ref=u?Hu(u,g):g),w.cloneElement(f,v)}return w.Children.count(f)>1?w.Children.only(null):null});return o.displayName=`${l}.SlotClone`,o}var gN=Symbol("radix.slottable");function xN(l){return w.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===gN}function vN(l,o){const c={...o};for(const u in o){const f=l[u],m=o[u];/^on[A-Z]/.test(u)?f&&m?c[u]=(...v)=>{const x=m(...v);return f(...v),x}:f&&(c[u]=f):u==="style"?c[u]={...f,...m}:u==="className"&&(c[u]=[f,m].filter(Boolean).join(" "))}return{...l,...c}}function yN(l){let o=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,c=o&&"isReactWarning"in o&&o.isReactWarning;return c?l.ref:(o=Object.getOwnPropertyDescriptor(l,"ref")?.get,c=o&&"isReactWarning"in o&&o.isReactWarning,c?l.props.ref:l.props.ref||l.ref)}var bN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wN=bN.reduce((l,o)=>{const c=ag(`Primitive.${o}`),u=w.forwardRef((f,m)=>{const{asChild:g,...v}=f,x=g?c:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(x,{...v,ref:m})});return u.displayName=`Primitive.${o}`,{...l,[o]:u}},{}),NN="Label",sg=w.forwardRef((l,o)=>s.jsx(wN.label,{...l,ref:o,onMouseDown:c=>{c.target.closest("button, input, select, textarea")||(l.onMouseDown?.(c),!c.defaultPrevented&&c.detail>1&&c.preventDefault())}}));sg.displayName=NN;var jN=sg;function ua({className:l,...o}){return s.jsx(jN,{"data-slot":"label",className:je("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",l),...o})}const SN=[{id:"claude",name:"Claude",color:"oklch(0.60 0.15 35)",icon:"🤖"},{id:"gemini",name:"Gemini",color:"oklch(0.55 0.18 250)",icon:"✨"},{id:"gemini-cli",name:"Gemini CLI",color:"oklch(0.58 0.16 240)",icon:"🌐"},{id:"codex",name:"Codex",color:"oklch(0.60 0.16 145)",icon:"💻"},{id:"qwen",name:"Qwen",color:"oklch(0.60 0.14 280)",icon:"🔮"},{id:"antigravity",name:"Antigravity",color:"oklch(0.65 0.20 320)",icon:"🚀"},{id:"kiro",name:"Kiro",color:"oklch(0.58 0.17 200)",icon:"🛸"},{id:"amazonq",name:"Amazon Q",color:"oklch(0.55 0.16 30)",icon:"📦",isImport:!0},{id:"minimax",name:"MiniMax",color:"oklch(0.60 0.18 60)",icon:"🔶",isApiKey:!0},{id:"zhipu",name:"Zhipu",color:"oklch(0.55 0.15 180)",icon:"🧠",isApiKey:!0}],_N=[20,40,60,80,100];function EN({isConnected:l,color:o}){return s.jsx("div",{className:"flex items-end justify-center gap-[3px] h-5",children:_N.map((c,u)=>s.jsx("div",{className:je("w-[5px] rounded-sm transition-all duration-300",l&&"animate-signal-pulse"),style:{height:`${c}%`,background:l?o:"var(--border-subtle)",boxShadow:l?`0 0 6px ${o}`:"none",animationDelay:l?`${u*100}ms`:"0ms"}},u))})}function CN({provider:l,isAuthenticated:o,isLoading:c,isDisabled:u,onClick:f,index:m}){const g=`delay-${m%6*100}`;return s.jsxs("div",{className:je("group relative flex flex-col items-center p-5","bg-[var(--bg-panel)] border border-[var(--border-subtle)] rounded-lg","transition-all duration-300 ease-out","hover:border-transparent","animate-fade-in-up",g,c&&"animate-connecting-pulse",u&&"opacity-50 grayscale pointer-events-none"),style:{"--provider-color":l.color},children:[s.jsx("div",{className:"absolute inset-0 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none",style:{boxShadow:`0 0 30px color-mix(in oklch, ${l.color} 25%, transparent), inset 0 0 20px color-mix(in oklch, ${l.color} 8%, transparent)`}}),s.jsx("div",{className:"absolute inset-0 rounded-lg border-2 opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none",style:{borderColor:l.color,boxShadow:`inset 0 0 15px color-mix(in oklch, ${l.color} 15%, transparent)`}}),s.jsxs("div",{className:je("relative w-14 h-14 rounded-xl flex items-center justify-center text-2xl","transition-all duration-300","group-hover:scale-110"),style:{background:`linear-gradient(135deg, color-mix(in oklch, ${l.color} 20%, transparent), color-mix(in oklch, ${l.color} 10%, transparent))`,border:`1px solid color-mix(in oklch, ${l.color} 40%, transparent)`,boxShadow:o?`0 0 20px color-mix(in oklch, ${l.color} 40%, transparent), inset 0 0 10px color-mix(in oklch, ${l.color} 15%, transparent)`:`0 0 10px color-mix(in oklch, ${l.color} 20%, transparent)`},children:[o&&s.jsx("div",{className:"absolute inset-0 rounded-xl animate-pulse-glow",style:{boxShadow:`0 0 25px ${l.color}`}}),s.jsx("span",{className:"relative z-10",children:l.icon})]}),s.jsx("div",{className:"mt-4 font-bold uppercase tracking-[0.15em] text-[var(--text-primary)] text-center text-xs",style:{fontFamily:"var(--font-display)"},children:l.name}),s.jsx("div",{className:"mt-4",children:s.jsx(EN,{isConnected:o,color:l.color})}),s.jsx("div",{className:je("mt-2 text-[0.65rem] uppercase tracking-wider",o?"text-[var(--accent-glow)]":"text-[var(--text-muted)]"),style:{fontFamily:"var(--font-mono)"},children:o?"Connected":"Offline"}),s.jsx("button",{onClick:f,disabled:c||u,className:je("mt-4 px-5 py-1.5 rounded text-[0.7rem] uppercase tracking-wider font-semibold","border transition-all duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--bg-panel)]","disabled:opacity-50 disabled:cursor-wait",o?"bg-transparent hover:bg-[var(--bg-elevated)]":"hover:scale-105"),style:{fontFamily:"var(--font-mono)",borderColor:l.color,color:l.color,boxShadow:`0 0 10px color-mix(in oklch, ${l.color} 30%, transparent)`},children:c?s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-3 h-3 border-2 border-current border-t-transparent rounded-full animate-spin"}),"Linking"]}):o?"Relink":"Login"})]})}function TN(){return s.jsxs("div",{className:"flex flex-col items-center p-5 bg-[var(--bg-panel)] border border-[var(--border-subtle)] rounded-lg animate-pulse",children:[s.jsx("div",{className:"w-14 h-14 rounded-xl bg-[var(--bg-elevated)]"}),s.jsx("div",{className:"mt-4 h-3 w-16 bg-[var(--bg-elevated)] rounded"}),s.jsx("div",{className:"mt-4 h-5 w-12 bg-[var(--bg-elevated)] rounded"}),s.jsx("div",{className:"mt-2 h-2 w-10 bg-[var(--bg-elevated)] rounded"}),s.jsx("div",{className:"mt-4 h-8 w-20 bg-[var(--bg-elevated)] rounded"})]})}function kN(){const{loading:l,setLoading:o,showToast:c,authFiles:u,status:f,isMgmtLoading:m,mgmtKey:g,mgmtFetch:v}=Mt(),[x,p]=w.useState(!1),[b,h]=w.useState(!1),[N,E]=w.useState([]),[A,U]=w.useState(null),G=f?.running??!1,T={claude:u.some(z=>z.toLowerCase().includes("claude")),gemini:u.some(z=>z.toLowerCase().includes("gemini")&&!z.toLowerCase().includes("gemini-")),"gemini-cli":u.some(z=>z.toLowerCase().includes("gemini-")&&!z.toLowerCase().includes("antigravity")),codex:u.some(z=>z.toLowerCase().includes("codex")),qwen:u.some(z=>z.toLowerCase().includes("qwen")),antigravity:u.some(z=>z.toLowerCase().includes("antigravity")),kiro:u.some(z=>z.toLowerCase().includes("kiro")),amazonq:u.some(z=>z.toLowerCase().includes("amazonq")),minimax:u.some(z=>z.toLowerCase().includes("minimax")),zhipu:u.some(z=>z.toLowerCase().includes("zhipu"))};w.useEffect(()=>{(async()=>{try{if(window.pp_get_oauth_private){const z=await window.pp_get_oauth_private();p(z)}}catch(z){console.error("OAuth private error:",z)}})()},[]),w.useEffect(()=>{!g||!G||(async()=>{try{const z=await v("/v0/management/config");U(z);const se=await v("/v0/management/auth-files");E(se.files||[])}catch(z){z instanceof ot||console.error("Config load error:",z)}})()},[g,G]);const K=async z=>{try{window.pp_set_oauth_private&&(await window.pp_set_oauth_private(z),p(z),c("Encryption mode updated","success"))}catch(se){c(se instanceof Error?se.message:String(se),"error")}},q=async z=>{o(`oauth-${z}`);try{window.pp_oauth&&(await window.pp_oauth(z),c(`Establishing uplink to ${z}...`,"success"))}catch(se){c(se instanceof Error?se.message:String(se),"error")}finally{o(null)}},F=async z=>{o(`oauth-${z}`);try{if(z==="amazonq"){const se=await v("/v0/management/amazonq-import",{method:"POST"});if(se.success){c(`Amazon Q CLI token imported: ${se.email||"success"}`,"success");const ie=await v("/v0/management/auth-files");E(ie.files||[])}else c(se.message||"Import failed","error")}}catch(se){c(se instanceof Error?se.message:String(se),"error")}finally{o(null)}},ae=async z=>{const se=window.prompt(`Enter your ${z==="minimax"?"MiniMax":"Zhipu AI"} API key:`);if(se){o(`oauth-${z}`);try{const O=await v(z==="minimax"?"/v0/management/minimax-api-key":"/v0/management/zhipu-api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:se})});if(O.success){c(`${z==="minimax"?"MiniMax":"Zhipu"} API key saved`,"success");const ne=await v("/v0/management/auth-files");E(ne.files||[])}else c(O.message||"Save failed","error")}catch(ie){c(ie instanceof Error?ie.message:String(ie),"error")}finally{o(null)}}},te=z=>{"isImport"in z&&z.isImport?F(z.id):"isApiKey"in z&&z.isApiKey?ae(z.id):q(z.id)},_=async()=>{try{const z=await v("/v0/management/debug");await v("/v0/management/debug",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:!z.value})});const se=await v("/v0/management/config");U(se)}catch(z){console.error(z)}},L=async z=>{try{await v("/v0/management/auth/reset-cooldown",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z?{auth_id:z}:{})});const se=await v("/v0/management/auth-files");E(se.files||[]),c("Cooldowns reset","success")}catch(se){c(se instanceof Error?se.message:String(se),"error")}},Y=!!A?.debug;return s.jsxs("div",{className:je("bg-[var(--bg-panel)] border border-[var(--border-subtle)] rounded-lg","shadow-lg overflow-hidden"),children:[s.jsxs("div",{className:je("flex items-center justify-between px-5 py-3","border-b border-[var(--border-subtle)]","bg-gradient-to-r from-[var(--bg-elevated)] to-transparent"),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[var(--accent-glow)] text-sm tracking-wider",style:{fontFamily:"var(--font-mono)"},children:"::"}),s.jsx("span",{className:"text-[var(--text-primary)] text-sm font-bold uppercase tracking-[0.15em]",style:{fontFamily:"var(--font-display)"},children:"Providers"})]}),s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("div",{className:je("flex items-center gap-2 px-3 py-1 rounded-full border transition-all duration-200",x?"border-[var(--accent-glow)] bg-[color-mix(in_oklch,var(--accent-glow)_10%,transparent)]":"border-[var(--border-subtle)] bg-transparent"),children:[x?s.jsx($0,{className:"h-3.5 w-3.5 text-[var(--accent-glow)]"}):s.jsx(X0,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),s.jsx(ua,{htmlFor:"private-oauth-providers",className:je("text-[0.65rem] cursor-pointer uppercase tracking-wider",x?"text-[var(--accent-glow)]":"text-[var(--text-muted)]"),style:{fontFamily:"var(--font-mono)"},children:x?"Encrypted":"Private"}),s.jsx(Bo,{id:"private-oauth-providers",checked:x,onCheckedChange:K,className:"scale-75 data-[state=checked]:bg-[var(--accent-glow)]"})]})})]}),s.jsxs("div",{className:"p-5",children:[!G&&s.jsx("div",{className:"mb-6 p-4 rounded-lg border border-yellow-500/30 bg-yellow-500/5 text-yellow-500 text-xs text-center uppercase tracking-widest font-mono",children:"⚠️ Please start the proxy engine to manage providers"}),s.jsx("div",{className:"grid gap-5",style:{gridTemplateColumns:"repeat(auto-fill, minmax(160px, 1fr))"},children:m&&u.length===0?Array.from({length:6}).map((z,se)=>s.jsx(TN,{},se)):SN.map((z,se)=>s.jsx(CN,{index:se,provider:z,isAuthenticated:T[z.id],isLoading:l===`oauth-${z.id}`,isDisabled:!G,onClick:()=>te(z)},z.id))}),g&&G&&s.jsxs("div",{className:"mt-6 pt-5 border-t border-[var(--border-subtle)]",children:[s.jsxs("button",{onClick:()=>h(!b),className:"flex items-center justify-between w-full text-left group",children:[s.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--text-muted)] group-hover:text-[var(--text-primary)] transition-colors",style:{fontFamily:"var(--font-mono)"},children:"Configuration & Accounts"}),s.jsx(al,{className:je("h-4 w-4 text-[var(--text-muted)] transition-transform",b&&"rotate-180")})]}),b&&s.jsxs("div",{className:"mt-4 space-y-4 animate-in slide-in-from-top-2 duration-200",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsxs("button",{onClick:()=>_().catch(console.error),className:je("px-3 py-1.5 rounded-md text-xs font-semibold uppercase tracking-wider border transition-all",Y?"border-[var(--accent-primary)] bg-[var(--accent-primary)]/10 text-[var(--accent-primary)] shadow-[0_0_10px_var(--accent-primary)/20]":"border-[var(--border-default)] bg-[var(--bg-elevated)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"),style:{fontFamily:"var(--font-mono)"},children:["Debug: ",Y?"ON":"OFF"]}),s.jsxs("button",{onClick:()=>L().catch(console.error),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold uppercase tracking-wider border border-[var(--border-default)] bg-[var(--bg-elevated)] text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",style:{fontFamily:"var(--font-mono)"},children:[s.jsx(ba,{className:"h-3 w-3"}),"Reset Cooldowns"]})]}),N.length>0&&s.jsx("div",{className:"rounded-lg border border-[var(--border-subtle)] overflow-hidden",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{className:"bg-[var(--bg-elevated)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)] font-semibold uppercase tracking-wider",style:{fontFamily:"var(--font-mono)"},children:"Provider"}),s.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)] font-semibold uppercase tracking-wider",style:{fontFamily:"var(--font-mono)"},children:"Account"}),s.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)] font-semibold uppercase tracking-wider",style:{fontFamily:"var(--font-mono)"},children:"Status"})]})}),s.jsx("tbody",{children:N.map(z=>s.jsxs("tr",{className:"border-t border-[var(--border-subtle)]",children:[s.jsx("td",{className:"px-3 py-2 font-mono text-[var(--text-primary)]",children:z.provider||z.type||"—"}),s.jsx("td",{className:"px-3 py-2 text-[var(--text-secondary)]",children:z.email||z.label||"—"}),s.jsx("td",{className:"px-3 py-2",children:s.jsx("span",{className:je("inline-flex px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wider",z.status==="active"||z.status==="ok"?"bg-[var(--status-online)]/15 text-[var(--status-online)]":"bg-[var(--text-muted)]/15 text-[var(--text-muted)]"),style:{fontFamily:"var(--font-mono)"},children:z.status||"unknown"})})]},z.id))})]})})]})]})]}),s.jsx("style",{children:` - @keyframes pulse-glow { - 0%, 100% { opacity: 0.4; } - 50% { opacity: 0.8; } - } - - .animate-pulse-glow { - animation: pulse-glow 2s ease-in-out infinite; - } - `})]})}const Cp=l=>typeof l=="boolean"?`${l}`:l===0?"0":l,Tp=S0,lg=(l,o)=>c=>{var u;if(o?.variants==null)return Tp(l,c?.class,c?.className);const{variants:f,defaultVariants:m}=o,g=Object.keys(f).map(p=>{const b=c?.[p],h=m?.[p];if(b===null)return null;const N=Cp(b)||Cp(h);return f[p][N]}),v=c&&Object.entries(c).reduce((p,b)=>{let[h,N]=b;return N===void 0||(p[h]=N),p},{}),x=o==null||(u=o.compoundVariants)===null||u===void 0?void 0:u.reduce((p,b)=>{let{class:h,className:N,...E}=b;return Object.entries(E).every(A=>{let[U,G]=A;return Array.isArray(G)?G.includes({...m,...v}[U]):{...m,...v}[U]===G})?[...p,h,N]:p},[]);return Tp(l,g,x,c?.class,c?.className)},AN=lg(["inline-flex items-center justify-center gap-2 whitespace-nowrap","text-sm font-semibold uppercase tracking-wide","rounded-md","border border-transparent","transition-[transform,box-shadow] duration-50 ease-out","active:translate-y-0.5 active:shadow-none","outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0"].join(" "),{variants:{variant:{default:["bg-[oklch(0.75_0.18_55)] text-[oklch(0.15_0.02_55)]","shadow-[0_2px_0_0_oklch(0_0_0/0.25)]","hover:bg-[oklch(0.78_0.19_55)] hover:border-[oklch(0.65_0.2_55)]","focus-visible:ring-[oklch(0.75_0.18_55)]"].join(" "),secondary:["bg-[oklch(0.18_0.04_260)] text-[oklch(0.85_0.02_260)]","border-[oklch(0.30_0.05_260)]","shadow-[0_2px_0_0_oklch(0_0_0/0.3)]","hover:bg-[oklch(0.22_0.05_260)] hover:border-[oklch(0.75_0.18_55)]","focus-visible:ring-[oklch(0.45_0.08_260)]"].join(" "),destructive:["bg-[oklch(0.35_0.12_25)] text-[oklch(0.90_0.02_25)]","border-[oklch(0.40_0.15_25)]","shadow-[0_2px_0_0_oklch(0_0_0/0.3)]","hover:bg-[oklch(0.40_0.14_25)] hover:border-[oklch(0.50_0.18_25)]","focus-visible:ring-[oklch(0.45_0.15_25)]"].join(" "),outline:["bg-transparent text-foreground","border-[oklch(0.35_0.05_260)]","shadow-[0_2px_0_0_oklch(0_0_0/0.1)]","hover:border-[oklch(0.75_0.18_55)] hover:text-[oklch(0.75_0.18_55)]","focus-visible:ring-[oklch(0.75_0.18_55)]"].join(" "),ghost:["bg-transparent text-foreground","shadow-none","hover:bg-[oklch(0.25_0.04_260)] hover:text-[oklch(0.85_0.02_260)]","active:translate-y-0 active:bg-[oklch(0.20_0.04_260)]","focus-visible:ring-[oklch(0.45_0.08_260)]"].join(" "),command:["bg-[oklch(0.20_0.05_260)] text-[oklch(0.75_0.18_55)]","border-[oklch(0.75_0.18_55)]","shadow-[0_2px_0_0_oklch(0.75_0.18_55/0.4),0_0_12px_0_oklch(0.75_0.18_55/0.2)]","hover:bg-[oklch(0.25_0.06_260)] hover:shadow-[0_2px_0_0_oklch(0.75_0.18_55/0.6),0_0_20px_0_oklch(0.75_0.18_55/0.35)]","hover:text-[oklch(0.80_0.20_55)]","active:shadow-[0_0_8px_0_oklch(0.75_0.18_55/0.4)]","focus-visible:ring-[oklch(0.75_0.18_55)]"].join(" "),link:["text-[oklch(0.75_0.18_55)] underline-offset-4","shadow-none","hover:underline hover:text-[oklch(0.80_0.20_55)]","active:translate-y-0","focus-visible:ring-[oklch(0.75_0.18_55)]"].join(" ")},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 text-xs has-[>svg]:px-2.5",lg:"h-11 rounded-md px-6 text-base has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ne({className:l,variant:o="default",size:c="default",asChild:u=!1,...f}){const m=u?ng:"button";return s.jsx(m,{"data-slot":"button","data-variant":o,"data-size":c,className:je(AN({variant:o,size:c,className:l})),...f})}function MN(){const{mgmtFetch:l,showToast:o,status:c,isMgmtLoading:u,pp_detect_agents:f,pp_configure_agent:m,pp_unconfigure_agent:g,isDesktop:v}=Mt(),[x,p]=w.useState([]),[b,h]=w.useState(!1),[N,E]=w.useState(null),[A,U]=w.useState(null),[G,T]=w.useState(null),K=c?.running??!1,q=w.useCallback(async()=>{if(K){h(!0);try{let Y=[];v&&f?Y=await f():Y=(await l("/v0/management/agents")).agents||[],p(Y)}catch(Y){Y instanceof ot||console.error("Failed to fetch agents:",Y)}h(!1)}},[l,K,v,f]);w.useEffect(()=>{K?q():p([])},[K,q]);const F=(Y,z)=>{navigator.clipboard.writeText(Y),o(`${z} copied to clipboard`,"success")},ae=Y=>{const z=Object.entries(Y).map(([se,ie])=>`${se}=${ie}`).join(` -`);F(z,"Environment variables")},te=Y=>["claude-code","gemini-cli"].includes(Y),_=async Y=>{if(Y.id){E(Y.id);try{v&&m?await m(Y.id):await l(`/v0/management/agents/${Y.id}/configure`,{method:"POST"});const z=te(Y.id)?`${Y.name} configured! Restart shell to apply.`:`${Y.name} configured!`;o(z,"success"),await q()}catch(z){o(z instanceof Error?z.message:String(z),"error")}E(null)}},L=async Y=>{if(Y.id){U(Y.id);try{v&&g?await g(Y.id):await l(`/v0/management/agents/${Y.id}/unconfigure`,{method:"POST"});const z=te(Y.id)?`${Y.name} configuration removed. Restart shell to apply.`:`${Y.name} configuration removed.`;o(z,"success"),await q()}catch(z){o(z instanceof Error?z.message:String(z),"error")}U(null)}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"rounded-lg border border-[var(--border-default)] bg-[var(--bg-panel)] shadow-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-[var(--bg-elevated)] border-b border-[var(--border-default)]",children:[s.jsx(Ru,{className:`h-4 w-4 text-[var(--accent-primary)] ${b?"animate-pulse":""}`}),s.jsx("span",{className:"font-mono text-xs font-bold uppercase tracking-widest text-[var(--text-secondary)]",children:"CLI Agent Detection"}),u&&s.jsx(Vt,{className:"h-3 w-3 animate-spin text-muted-foreground"}),s.jsx("div",{className:"flex-1"}),s.jsx("button",{onClick:q,disabled:b||!K,className:"p-1.5 rounded hover:bg-[var(--bg-void)] text-[var(--text-muted)] hover:text-[var(--accent-primary)] transition-colors disabled:opacity-50",children:s.jsx(ba,{className:`h-3.5 w-3.5 ${b?"animate-spin":""}`})})]}),s.jsx("div",{className:"p-4",children:K?x.length===0&&!b?s.jsx("div",{className:"text-center py-8 text-[var(--text-muted)] font-mono text-xs uppercase",children:"No agents detected"}):s.jsx("div",{className:"grid gap-3",children:x.map(Y=>s.jsxs("div",{className:` - flex items-center gap-4 p-3 rounded border transition-all - ${Y.detected?"bg-[var(--bg-elevated)]/50 border-[var(--border-default)]":"bg-[var(--bg-void)]/30 border-[var(--border-subtle)] opacity-60"} - `,children:[s.jsx("div",{className:"shrink-0",children:Y.configured?s.jsx("div",{className:"p-1.5 rounded-full bg-[var(--status-online)]/10 text-[var(--status-online)]",children:s.jsx(tl,{className:"h-4 w-4"})}):Y.detected?s.jsx("div",{className:"p-1.5 rounded-full bg-[var(--status-warning)]/10 text-[var(--status-warning)]",children:s.jsx(Iu,{className:"h-4 w-4"})}):s.jsx("div",{className:"p-1.5 rounded-full bg-[var(--bg-void)] text-[var(--text-muted)]",children:s.jsx(Ru,{className:"h-4 w-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:"font-mono text-sm font-bold text-[var(--text-primary)]",children:Y.name}),Y.detected&&!Y.configured&&s.jsx("span",{className:"text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-[var(--status-warning)]/10 text-[var(--status-warning)] border border-[var(--status-warning)]/20",children:"Needs Config"})]}),s.jsx("div",{className:"text-[10px] font-mono text-[var(--text-muted)] truncate",children:Y.detected?Y.configured?"Fully configured and ready":"Detected but not configured":"Not found on this system"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[Y.detected&&Y.shell_config&&s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsxs("button",{onClick:()=>T(Y),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded border border-[var(--border-default)] bg-[var(--bg-panel)] text-[var(--text-secondary)] hover:border-[var(--accent-primary)] hover:text-[var(--accent-primary)] transition-all font-mono text-xs uppercase tracking-wider",children:[s.jsx(Ep,{className:"h-3.5 w-3.5"}),"Shell"]})}),s.jsx(ya,{children:"View Shell Profile Configuration"})]}),Y.detected&&!Y.configured&&Y.canAutoConfigure&&s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsxs("button",{onClick:()=>_(Y),disabled:N===Y.id,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded border border-[var(--accent-primary)] bg-[var(--accent-primary)]/10 text-[var(--accent-primary)] hover:bg-[var(--accent-primary)]/20 transition-all disabled:opacity-50 font-mono text-xs uppercase tracking-wider",children:[N===Y.id?s.jsx(Vt,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(J0,{className:"h-3.5 w-3.5"}),"Configure"]})}),s.jsxs(ya,{children:["Auto-configure ",Y.name," for ProxyPilot"]})]}),Y.detected&&Y.configured&&s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsxs("button",{onClick:()=>L(Y),disabled:A===Y.id,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded border border-[var(--status-error)] bg-[var(--status-error)]/10 text-[var(--status-error)] hover:bg-[var(--status-error)]/20 transition-all disabled:opacity-50 font-mono text-xs uppercase tracking-wider",children:[A===Y.id?s.jsx(Vt,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(Pw,{className:"h-3.5 w-3.5"}),"Reset"]})}),s.jsxs(ya,{children:["Remove ProxyPilot configuration from ",Y.name]})]}),Y.envVars&&s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsx("button",{onClick:()=>ae(Y.envVars),className:"p-2 rounded border border-[var(--border-default)] bg-[var(--bg-panel)] text-[var(--text-secondary)] hover:border-[var(--accent-primary)] hover:text-[var(--accent-primary)] transition-all",children:s.jsx(nl,{className:"h-3.5 w-3.5"})})}),s.jsx(ya,{children:"Copy Environment Variables"})]}),Y.configInstructions&&s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsx("button",{onClick:()=>{o(Y.configInstructions,"success")},className:"p-2 rounded border border-[var(--border-default)] bg-[var(--bg-panel)] text-[var(--text-secondary)] hover:border-[var(--accent-primary)] hover:text-[var(--accent-primary)] transition-all",children:s.jsx(lw,{className:"h-3.5 w-3.5"})})}),s.jsx(ya,{children:"View Setup Instructions"})]})]})]},Y.name))}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("div",{className:"font-mono text-sm text-[var(--text-muted)] uppercase tracking-wider mb-1",children:"Engine Offline"}),s.jsx("div",{className:"text-xs text-[var(--text-muted)]",children:"Start the proxy engine to detect agents"})]})})]}),G&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:s.jsxs("div",{className:"bg-[var(--bg-panel)] border border-[var(--border-default)] rounded-lg shadow-2xl max-w-2xl w-full mx-4 max-h-[80vh] flex flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border-subtle)]",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ep,{className:"h-4 w-4 text-[var(--accent-primary)]"}),s.jsxs("span",{className:"font-mono text-sm font-bold",children:[G.name," - Shell Configuration"]})]}),s.jsx("button",{onClick:()=>T(null),className:"p-1 rounded hover:bg-[var(--bg-elevated)] text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:s.jsx(ed,{className:"h-4 w-4"})})]}),s.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[s.jsx("div",{className:"mb-3",children:s.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["Add these lines to your shell profile (",s.jsx("code",{className:"text-[var(--accent-primary)]",children:"~/.bashrc"}),", ",s.jsx("code",{className:"text-[var(--accent-primary)]",children:"~/.zshrc"}),", or ",s.jsx("code",{className:"text-[var(--accent-primary)]",children:"~/.profile"}),"):"]})}),s.jsx("pre",{className:"bg-[var(--bg-void)] border border-[var(--border-subtle)] rounded-lg p-4 text-xs font-mono text-[var(--text-secondary)] overflow-x-auto whitespace-pre-wrap",children:G.shell_config})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-[var(--border-subtle)]",children:[s.jsx(Ne,{size:"sm",variant:"outline",onClick:()=>T(null),className:"text-xs font-mono",children:"Close"}),s.jsxs(Ne,{size:"sm",onClick:()=>{F(G.shell_config||"","Shell configuration")},className:"text-xs font-mono gap-1",children:[s.jsx(nl,{className:"h-3 w-3"}),"Copy to Clipboard"]})]})]})})]})}function ON(){const{mgmtKey:l,mgmtFetch:o,showToast:c,status:u,isMgmtLoading:f}=Mt(),[m,g]=w.useState([]),[v,x]=w.useState(!1),[p,b]=w.useState(null),[h,N]=w.useState(0),E=u?.running??!1,A=w.useCallback(async()=>{if(!(!l||!E)){x(!0),N(T=>T+1);try{const K=((await o("/v0/management/integrations/status")).integrations||[]).map(q=>({...q,detected:q.installed??q.detected??!1}));g(K)}catch(T){T instanceof ot||console.error("Failed to fetch integrations:",T)}x(!1)}},[l,o,E]),U=async T=>{b(T);try{await o(`/v0/management/integrations/${T}/configure`,{method:"POST"}),await A(),c(`Configured ${T}`,"success")}catch(K){c(K instanceof Error?K.message:String(K),"error")}b(null)};w.useEffect(()=>{l&&E?A():E||g([])},[l,E,A]);const G=(T,K=35)=>{if(T.length<=K)return T;const q=T.slice(0,15),F=T.slice(-17);return`${q}...${F}`};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-lg border border-[var(--border-default)] bg-[var(--bg-panel)] shadow-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 bg-[var(--bg-elevated)] border-b border-[var(--border-default)]",children:[s.jsxs("div",{className:"relative",children:[s.jsx(yu,{className:`h-4 w-4 text-[var(--accent-primary)] ${v||f?"animate-spin":""}`}),(v||f)&&s.jsx("div",{className:"absolute inset-0 rounded-full border border-[var(--accent-primary)] animate-ping opacity-50"})]}),s.jsx("span",{className:"font-mono text-xs font-bold uppercase tracking-widest text-[var(--text-secondary)]",children:"Ground Control"}),f&&s.jsx(Vt,{className:"h-3 w-3 animate-spin text-muted-foreground"}),s.jsx("div",{className:"flex-1"}),s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:A,disabled:v||!E,className:` - relative flex items-center gap-1.5 px-3 py-1.5 rounded - font-mono text-[10px] uppercase tracking-wider font-bold - border transition-all duration-150 - ${v?"border-[var(--status-processing)] bg-[var(--status-processing)]/10 text-[var(--status-processing)]":E?"border-[var(--border-default)] bg-[var(--bg-panel)] text-[var(--text-secondary)] hover:border-[var(--accent-primary)] hover:text-[var(--accent-primary)] hover:shadow-[0_0_10px_var(--accent-primary)]":"border-[var(--border-subtle)] bg-transparent text-[var(--text-muted)] cursor-not-allowed opacity-50"} - active:translate-y-0.5 cursor-pointer - overflow-hidden - `,children:[v&&s.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-[var(--status-processing)]/30 to-transparent",style:{animation:"scan-sweep 1s ease-in-out infinite"}}),s.jsx(yu,{className:`h-3 w-3 relative z-10 ${v?"animate-spin":""}`}),s.jsx("span",{className:"relative z-10",children:v?"Scanning":"Scan"})]})}),s.jsx(ya,{children:"Scan for CLI agent integrations"})]})]}),s.jsxs("div",{className:"p-4 relative",children:[v&&s.jsx("div",{className:"absolute inset-0 pointer-events-none z-10 overflow-hidden",style:{background:"linear-gradient(90deg, transparent 0%, var(--accent-primary) 50%, transparent 100%)",opacity:.08,animation:"radar-scan-horizontal 1.5s ease-in-out"}}),E?m.length===0&&!v&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx("div",{className:"relative mb-4",children:s.jsx("div",{className:"w-16 h-16 rounded-full border-2 border-dashed border-[var(--border-subtle)] flex items-center justify-center",children:s.jsx(yu,{className:"h-6 w-6 text-[var(--text-muted)]"})})}),s.jsx("div",{className:"font-mono text-sm text-[var(--text-muted)] uppercase tracking-wider mb-1",children:"No Signals Detected"}),s.jsx("div",{className:"text-xs text-[var(--text-muted)]",children:"Click SCAN to search for CLI agents"})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx("div",{className:"font-mono text-sm text-[var(--text-muted)] uppercase tracking-wider mb-1",children:"⚠️ Engine Offline"}),s.jsx("div",{className:"text-xs text-[var(--text-muted)]",children:"Start the proxy engine to manage integrations"})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:m.map((T,K)=>s.jsxs("div",{className:` - group relative rounded-lg border overflow-hidden - transition-all duration-300 - ${T.detected?"border-[var(--status-online)]/50 bg-gradient-to-b from-[var(--bg-elevated)] to-[var(--bg-panel)]":"border-[var(--border-subtle)] bg-[var(--bg-void)]"} - hover:border-[var(--accent-primary)] hover:shadow-[0_0_20px_var(--accent-primary)/15] - hover:translate-y-[-2px] - `,style:{animation:`station-fade-in 0.4s ease-out ${K*.08}s both`},children:[s.jsxs("div",{className:` - flex items-center gap-2 px-3 py-2 border-b - ${T.detected?"border-[var(--status-online)]/30 bg-[var(--status-online)]/5":"border-[var(--border-subtle)] bg-[var(--bg-elevated)]"} - `,children:[s.jsx("div",{className:"relative",children:s.jsx("div",{className:` - w-3 h-3 rounded-full transition-all duration-300 - ${T.detected?"bg-[var(--status-online)] shadow-[0_0_8px_var(--status-online)]":"border-2 border-[var(--text-muted)] bg-transparent"} - `,children:T.detected&&s.jsx("div",{className:"absolute inset-0 rounded-full bg-[var(--status-online)]",style:{animation:"status-glow 2s ease-in-out infinite"}})})}),s.jsx("span",{className:` - font-mono text-xs font-bold uppercase tracking-wider flex-1 - ${T.detected?"text-[var(--text-primary)]":"text-[var(--text-muted)]"} - `,children:T.name||T.id})]}),s.jsxs("div",{className:"p-3 space-y-3",children:[s.jsx("div",{className:` - flex items-center gap-2 font-mono text-xs uppercase tracking-wider - ${T.detected?"text-[var(--status-online)]":"text-[var(--text-muted)]"} - `,children:T.detected?s.jsxs(s.Fragment,{children:[s.jsx(tl,{className:"h-3 w-3"}),s.jsx("span",{children:"Detected"})]}):s.jsxs(s.Fragment,{children:[s.jsx(Uo,{className:"h-3 w-3"}),s.jsx("span",{children:"Not Detected"})]})}),T.detected&&s.jsxs("div",{className:"space-y-1.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[T.binary_path&&s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-[var(--text-muted)] truncate cursor-help",children:[s.jsx(G0,{className:"h-2.5 w-2.5 shrink-0"}),s.jsx("span",{className:"truncate",children:G(T.binary_path)})]})}),s.jsx(ya,{side:"bottom",className:"max-w-xs",children:s.jsx("div",{className:"font-mono text-xs break-all",children:T.binary_path})})]}),T.config_path&&s.jsxs(xa,{children:[s.jsx(va,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-[var(--text-muted)] truncate cursor-help",children:[s.jsx(Mo,{className:"h-2.5 w-2.5 shrink-0"}),s.jsx("span",{className:"truncate",children:G(T.config_path)})]})}),s.jsx(ya,{side:"bottom",className:"max-w-xs",children:s.jsx("div",{className:"font-mono text-xs break-all",children:T.config_path})})]})]}),!T.detected&&s.jsx("div",{className:"h-[30px]"}),s.jsx("button",{type:"button",onClick:()=>T.detected&&U(T.id),disabled:!T.detected||p===T.id,className:` - w-full flex items-center justify-center gap-2 px-3 py-2 rounded - font-mono text-xs font-bold uppercase tracking-wider - border transition-all duration-150 - ${p===T.id?"border-[var(--status-processing)] bg-[var(--status-processing)]/10 text-[var(--status-processing)]":T.detected?"border-[var(--accent-primary)] bg-transparent text-[var(--accent-primary)] hover:bg-[var(--accent-primary)] hover:text-[var(--bg-panel)] hover:shadow-[0_0_15px_var(--accent-primary)]":"border-[var(--border-subtle)] bg-transparent text-[var(--text-muted)] cursor-not-allowed opacity-50"} - active:translate-y-0.5 cursor-pointer - disabled:active:translate-y-0 - `,children:p===T.id?s.jsxs(s.Fragment,{children:[s.jsx(Mo,{className:"h-3 w-3 animate-spin"}),s.jsx("span",{children:"Configuring"})]}):T.detected?s.jsxs(s.Fragment,{children:[s.jsx(Mo,{className:"h-3 w-3"}),s.jsx("span",{children:"Configure"})]}):s.jsxs(s.Fragment,{children:[s.jsx(is,{className:"h-3 w-3"}),s.jsx("span",{children:"Install"})]})})]}),p===T.id&&s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"linear-gradient(180deg, transparent 0%, var(--status-processing) 50%, transparent 100%)",opacity:.1,animation:"config-scan 1s ease-in-out infinite"}})]},T.id))},h)]}),m.length>0&&s.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-[var(--bg-void)] border-t border-[var(--border-subtle)]",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 rounded-full bg-[var(--status-online)]"}),s.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:[m.filter(T=>T.detected).length," Online"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 rounded-full border border-[var(--text-muted)]"}),s.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:[m.filter(T=>!T.detected).length," Offline"]})]})]})]}),s.jsx(MN,{}),s.jsx("style",{children:` - @keyframes station-fade-in { - 0% { - opacity: 0; - transform: translateY(10px) scale(0.98); - } - 100% { - opacity: 1; - transform: translateY(0) scale(1); - } - } - - @keyframes status-glow { - 0%, 100% { - opacity: 1; - transform: scale(1); - } - 50% { - opacity: 0.6; - transform: scale(1.3); - } - } - - @keyframes scan-sweep { - 0% { - transform: translateX(-100%); - } - 100% { - transform: translateX(200%); - } - } - - @keyframes radar-scan-horizontal { - 0% { - transform: translateX(-100%); - } - 100% { - transform: translateX(100%); - } - } - - @keyframes config-scan { - 0% { - transform: translateY(-100%); - } - 100% { - transform: translateY(100%); - } - } - `})]})}function jt({className:l,...o}){return s.jsx("div",{"data-slot":"card",className:je("flex flex-col gap-6 rounded-md py-6","bg-[var(--bg-panel)] border border-[var(--border-subtle)]","text-card-foreground","shadow-[inset_0_1px_0_0_var(--border-subtle),inset_0_-1px_0_0_oklch(0_0_0/0.2),0_2px_0_0_oklch(0_0_0/0.1)]",l),...o})}function At({className:l,...o}){return s.jsx("div",{"data-slot":"card-header",className:je("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6","has-data-[slot=card-action]:grid-cols-[1fr_auto]","border-b border-[var(--border-subtle)] pb-4 mb-2",l),...o})}function da({className:l,...o}){return s.jsx("div",{"data-slot":"card-title",className:je("font-display text-lg font-bold leading-tight tracking-tight",l),...o})}function rs({className:l,...o}){return s.jsx("div",{"data-slot":"card-description",className:je("text-muted-foreground text-xs uppercase tracking-wider",l),...o})}function St({className:l,...o}){return s.jsx("div",{"data-slot":"card-content",className:je("px-6",l),...o})}function zN(l,o){const c=[/^\[?(\d{4}-\d{2}-\d{2}\s+)?(\d{2}:\d{2}:\d{2}(?:\.\d{3})?)\]?\s*\[?(ERROR|WARN(?:ING)?|INFO|DEBUG)\]?:?\s*(.*)$/i,/^\[?(ERROR|WARN(?:ING)?|INFO|DEBUG)\]?:?\s*(.*)$/i,/^(\d{2}:\d{2}:\d{2}(?:\.\d{3})?)\s+(ERROR|WARN(?:ING)?|INFO|DEBUG)\s+(.*)$/i],f=new Date().toTimeString().slice(0,12).replace(",",".");for(const m of c){const g=l.match(m);if(g){if(m===c[0]){const v=g[2]||f,x=bu(g[3]),p=g[4]||"";return{id:`log-${o}`,timestamp:kp(v),level:x,message:p,raw:l}}else if(m===c[1]){const v=bu(g[1]),x=g[2]||"";return{id:`log-${o}`,timestamp:f,level:v,message:x,raw:l}}else if(m===c[2]){const v=g[1],x=bu(g[2]),p=g[3]||"";return{id:`log-${o}`,timestamp:kp(v),level:x,message:p,raw:l}}}}return{id:`log-${o}`,timestamp:f,level:"INFO",message:l,raw:l}}function bu(l){const o=l.toUpperCase();return o==="WARNING"?"WARN":["ERROR","WARN","INFO","DEBUG"].includes(o)?o:"INFO"}function kp(l){if(l.includes(".")){const[o,c]=l.split(".");return`${o}.${c.padEnd(3,"0").slice(0,3)}`}return`${l}.000`}function RN(l){switch(l){case"ERROR":return"border-l-[var(--status-offline)]";case"WARN":return"border-l-[var(--status-warning)]";case"INFO":return"border-l-[var(--accent-glow)]";case"DEBUG":return"border-l-[var(--text-muted)]";default:return"border-l-[var(--text-muted)]"}}function Ap(l){switch(l){case"ERROR":return"bg-[var(--status-offline)]/20 text-[var(--status-offline)]";case"WARN":return"bg-[var(--status-warning)]/20 text-[var(--status-warning)]";case"INFO":return"bg-[var(--accent-glow)]/20 text-[var(--accent-glow)]";case"DEBUG":return"bg-[var(--text-muted)]/20 text-[var(--text-muted)]";default:return"bg-[var(--text-muted)]/20 text-[var(--text-muted)]"}}function DN(){const{mgmtFetch:l,showToast:o,status:c,isMgmtLoading:u}=Mt(),[f,m]=w.useState(""),[g,v]=w.useState(""),[x,p]=w.useState("stdout"),[b,h]=w.useState("ALL"),[N,E]=w.useState(!1),[A,U]=w.useState(!0),G=w.useRef(null),T=w.useRef(null),K=c?.running??!1,q=async()=>{try{const O=await l("/v0/management/proxypilot/diagnostics?lines=120");m(O.text||"")}catch(O){O instanceof ot||o(O instanceof Error?O.message:String(O),"error")}},F=async()=>{if(!f){o("No diagnostics to copy","error");return}try{await navigator.clipboard.writeText(f),o("Copied diagnostics to clipboard","success")}catch(O){o(O instanceof Error?O.message:String(O),"error")}},ae=w.useCallback(async O=>{try{p(O);const ne=await l(`/v0/management/proxypilot/logs/tail?file=${O}&lines=200`);v((ne.lines||[]).join(` -`))}catch(ne){ne instanceof ot||o(ne instanceof Error?ne.message:String(ne),"error")}},[l,o]),te=async()=>{if(!g){o("No logs to copy","error");return}try{await navigator.clipboard.writeText(g),o("Copied logs to clipboard","success")}catch(O){o(O instanceof Error?O.message:String(O),"error")}},_=()=>{v(""),E(!1),T.current&&(clearInterval(T.current),T.current=null)},L=async()=>{try{const ne=((await l(`/v0/management/proxypilot/logs/tail?file=${x}&lines=2000`)).lines||[]).join(` -`);if(!ne){o("No logs available to download","error");return}const oe=new Blob([ne],{type:"text/plain"}),k=URL.createObjectURL(oe),V=document.createElement("a");V.href=k,V.download=`proxypilot-${x}-${new Date().toISOString().slice(0,19).replace(/:/g,"-")}.log`,document.body.appendChild(V),V.click(),document.body.removeChild(V),URL.revokeObjectURL(k),o("Logs download started","success")}catch(O){o(O instanceof Error?O.message:String(O),"error")}},Y=()=>{N?(E(!1),T.current&&(clearInterval(T.current),T.current=null)):(E(!0),ae(x),T.current=setInterval(()=>{ae(x)},2e3))};w.useEffect(()=>{A&&G.current&&(G.current.scrollTop=G.current.scrollHeight)},[g,A]),w.useEffect(()=>()=>{T.current&&clearInterval(T.current)},[]);const z=g?g.split(` -`).filter(Boolean).map((O,ne)=>zN(O,ne)):[],se=b==="ALL"?z:z.filter(O=>O.level===b),ie=["ALL","ERROR","WARN","INFO","DEBUG"];return s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl",children:[s.jsx(At,{className:"pb-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-xl bg-blue-500/10 flex items-center justify-center",children:s.jsx(V0,{className:"h-5 w-5 text-blue-500"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Diagnostics"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Engine snapshot"})]})]}),u&&s.jsx(Vt,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}),s.jsxs(St,{className:"space-y-3",children:[!K&&s.jsx("div",{className:"py-4 text-center text-muted-foreground",children:s.jsx("p",{className:"text-xs uppercase tracking-widest font-mono",children:"⚠️ Engine Offline"})}),K&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Ne,{size:"sm",variant:"outline",onClick:q,children:[s.jsx(is,{className:"h-4 w-4 mr-1"}),"Load"]}),s.jsxs(Ne,{size:"sm",variant:"outline",onClick:F,disabled:!f,className:"gap-2",children:[s.jsx(nl,{className:"h-4 w-4"}),"Copy"]})]}),s.jsx("pre",{className:"max-h-48 overflow-auto rounded-md border border-border/50 bg-muted/30 p-2 text-xs font-mono",children:f||"No diagnostics loaded."})]})]})]}),s.jsxs(jt,{className:"backdrop-blur-sm bg-[var(--bg-void)] border-[var(--border-default)] shadow-xl overflow-hidden",children:[s.jsxs(At,{className:"pb-3 border-b border-[var(--border-subtle)] bg-[var(--bg-panel)]",children:[s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ho,{className:`h-3 w-3 fill-current ${N&&K?"text-[var(--status-offline)] animate-pulse":"text-[var(--text-muted)]"}`}),s.jsx("span",{className:"font-mono text-sm font-semibold tracking-wider text-[var(--text-primary)]",children:"FLIGHT RECORDER"})]}),u&&s.jsx(Vt,{className:"h-3 w-3 animate-spin text-muted-foreground"}),s.jsxs("button",{onClick:Y,disabled:!K,className:`flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-mono transition-all ${N&&K?"bg-[var(--status-offline)]/20 text-[var(--status-offline)] animate-pulse":"bg-[var(--bg-elevated)] text-[var(--text-muted)] hover:text-[var(--text-secondary)]"} ${K?"":"opacity-50 cursor-not-allowed"}`,children:[s.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${N&&K?"bg-[var(--status-offline)]":"bg-[var(--text-muted)]"}`}),"LIVE"]})]}),s.jsx("div",{className:"flex items-center gap-1",children:ie.map(O=>s.jsx("button",{onClick:()=>h(O),className:`px-2 py-0.5 rounded text-xs font-mono uppercase transition-all ${b===O?O==="ALL"?"bg-[var(--accent-primary)] text-[var(--primary-foreground)]":Ap(O).replace("/20","/40"):"bg-[var(--bg-elevated)] text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:O==="ALL"?"ALL":O.slice(0,3)},O))})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[s.jsx(Ne,{size:"sm",variant:x==="stdout"?"default":"outline",onClick:()=>ae("stdout"),className:"text-xs h-7 font-mono",children:"STDOUT"}),s.jsx(Ne,{size:"sm",variant:x==="stderr"?"default":"outline",onClick:()=>ae("stderr"),className:"text-xs h-7 font-mono",children:"STDERR"}),s.jsx("div",{className:"flex-1"}),s.jsx(Ne,{size:"sm",variant:"ghost",onClick:te,disabled:!g,className:"text-xs h-7 gap-1 text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:s.jsx(nl,{className:"h-3 w-3"})}),s.jsx(Ne,{size:"sm",variant:"ghost",onClick:L,disabled:!g,className:"text-xs h-7 gap-1 text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:s.jsx(is,{className:"h-3 w-3"})}),s.jsx(Ne,{size:"sm",variant:"ghost",onClick:_,disabled:!g,className:"text-xs h-7 gap-1 text-[var(--text-muted)] hover:text-[var(--status-offline)]",children:s.jsx(Jo,{className:"h-3 w-3"})})]})]}),s.jsxs(St,{className:"p-0 relative",children:[s.jsx("div",{className:"absolute inset-0 pointer-events-none z-10 overflow-hidden","aria-hidden":"true",children:s.jsx("div",{className:"absolute left-0 right-0 h-8 bg-gradient-to-b from-[var(--accent-glow)]/[0.07] to-transparent animate-scanline",style:{top:"-10%"}})}),s.jsx("div",{ref:G,className:"max-h-64 overflow-auto bg-[var(--bg-void)] font-mono text-xs",onScroll:O=>{const ne=O.target,oe=ne.scrollHeight-ne.scrollTop<=ne.clientHeight+50;U(oe)},children:K?se.length===0?s.jsx("div",{className:"p-4 text-center text-[var(--text-muted)]",children:g?"No matching log entries.":"No logs loaded. Click STDOUT or STDERR to load logs."}):s.jsx("div",{className:"divide-y divide-[var(--border-subtle)]/30",children:se.map(O=>s.jsxs("div",{className:`flex items-start gap-2 px-3 py-1.5 border-l-2 hover:bg-[var(--bg-panel)]/50 transition-colors ${RN(O.level)}`,children:[s.jsx("span",{className:"text-[var(--text-muted)] shrink-0 tabular-nums",children:O.timestamp}),s.jsx("span",{className:"text-[var(--border-default)]",children:"|"}),s.jsx("span",{className:`shrink-0 px-1.5 py-0 rounded text-[10px] font-semibold uppercase ${Ap(O.level)}`,children:O.level.padEnd(5)}),s.jsx("span",{className:"text-[var(--border-default)]",children:"|"}),s.jsx("span",{className:"text-[var(--text-primary)] break-all",children:O.message})]},O.id))}):s.jsxs("div",{className:"p-8 text-center text-[var(--text-muted)]",children:[s.jsx("p",{className:"text-xs uppercase tracking-widest font-mono",children:"⚠️ Engine Offline"}),s.jsx("p",{className:"text-[10px] mt-1",children:"Start the proxy engine to view logs"})]})}),!A&&se.length>0&&s.jsx("button",{onClick:()=>{U(!0),G.current&&(G.current.scrollTop=G.current.scrollHeight)},className:"absolute bottom-2 right-4 px-2 py-1 rounded bg-[var(--accent-primary)] text-[var(--primary-foreground)] text-xs font-mono shadow-lg hover:opacity-90 transition-opacity z-20",children:"SCROLL TO BOTTOM"})]}),s.jsxs("div",{className:"px-3 py-1.5 bg-[var(--bg-panel)] border-t border-[var(--border-subtle)] flex items-center justify-between text-[10px] font-mono text-[var(--text-muted)]",children:[s.jsxs("span",{children:[se.length," entries ",b!=="ALL"&&`(filtered: ${b})`]}),s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:A?"text-[var(--status-online)]":"",children:A?"AUTO-SCROLL ON":"AUTO-SCROLL OFF"}),s.jsx("span",{children:"|"}),s.jsx("span",{children:x.toUpperCase()})]})]})]})]})}const Mp=["anthropic","google","openai","azure","bedrock","vertex","other"];function Op(l){const o=l.toLowerCase();return o.includes("anthropic")?"oklch(0.60 0.15 35)":o.includes("google")||o.includes("vertex")?"oklch(0.55 0.18 250)":o.includes("openai")||o.includes("azure")?"oklch(0.55 0.12 145)":o.includes("bedrock")||o.includes("aws")?"oklch(0.58 0.14 50)":"oklch(0.50 0.08 280)"}function zp(l){const o=l.toLowerCase();return o.includes("anthropic")?"oklch(0.60 0.15 35 / 0.15)":o.includes("google")||o.includes("vertex")?"oklch(0.55 0.18 250 / 0.15)":o.includes("openai")||o.includes("azure")?"oklch(0.55 0.12 145 / 0.15)":o.includes("bedrock")||o.includes("aws")?"oklch(0.58 0.14 50 / 0.15)":"oklch(0.50 0.08 280 / 0.15)"}function LN(){const{mgmtKey:l,mgmtFetch:o,showToast:c,status:u,isMgmtLoading:f}=Mt(),[m,g]=w.useState([]),[v,x]=w.useState(!1),[p,b]=w.useState({from:"",to:"",provider:""}),[h,N]=w.useState(null),[E,A]=w.useState({from:"",to:"",provider:""}),[U,G]=w.useState(""),[T,K]=w.useState(null),[q,F]=w.useState(null),[ae,te]=w.useState(null),_=u?.running??!1,L=async()=>{try{const O=await o("/v0/management/model-mappings");g(O.mappings||[])}catch(O){O instanceof ot||console.error("Failed to fetch model mappings:",O)}},Y=async()=>{if(!p.from.trim()||!p.to.trim()){c('Both "from" and "to" fields are required',"error");return}try{await o("/v0/management/model-mappings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}),b({from:"",to:"",provider:""}),x(!1),await L(),te(m.length),setTimeout(()=>te(null),500),c("Route added to flight plan","success")}catch(O){c(O instanceof Error?O.message:String(O),"error")}},z=async(O,ne)=>{try{await o(`/v0/management/model-mappings/${O}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(ne)}),N(null),await L(),c("Route updated","success")}catch(oe){c(oe instanceof Error?oe.message:String(oe),"error")}},se=async O=>{F(O);try{await o(`/v0/management/model-mappings/${O}`,{method:"DELETE"}),setTimeout(async()=>{await L(),F(null),c("Route removed","success")},300)}catch(ne){F(null),c(ne instanceof Error?ne.message:String(ne),"error")}},ie=async()=>{if(!U.trim()){K({matched:!1});return}try{const O=await o(`/v0/management/model-mappings/test?model=${encodeURIComponent(U.trim())}`);K({model:O.model||O.to||U,provider:O.provider,matched:O.model!==U||!!O.provider})}catch{K({matched:!1})}};return w.useEffect(()=>{l&&_?L():_||g([])},[l,_]),l?s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl overflow-hidden",children:[s.jsx("div",{className:"px-6 py-4 border-b border-border/50 bg-gradient-to-r from-orange-500/5 to-transparent",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:`h-3 w-3 rounded-full ${_?"bg-orange-500 animate-pulse":"bg-muted"}`}),_&&s.jsx("div",{className:"absolute inset-0 h-3 w-3 rounded-full bg-orange-500/50 animate-ping"})]}),s.jsx("h2",{className:"text-base font-semibold tracking-wide uppercase text-foreground/90",children:"Flight Plan"}),f&&s.jsx(Vt,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),s.jsxs(Ne,{size:"sm",variant:"outline",disabled:!_,onClick:()=>x(!v),className:"gap-1.5 text-xs border-orange-500/30 hover:border-orange-500/50 hover:bg-orange-500/10",children:[s.jsx(ww,{className:"h-3.5 w-3.5"}),"Add Route"]})]})}),s.jsxs(St,{className:"p-4 space-y-3",children:[!_&&s.jsxs("div",{className:"py-8 text-center text-muted-foreground",children:[s.jsx("p",{className:"text-sm uppercase tracking-widest font-mono",children:"⚠️ Engine Offline"}),s.jsx("p",{className:"text-xs mt-1",children:"Start the proxy engine to manage model mappings"})]}),_&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-out ${v?"max-h-48 opacity-100":"max-h-0 opacity-0"}`,children:s.jsxs("div",{className:"p-4 rounded-lg bg-orange-500/5 border border-orange-500/20 space-y-3 mb-3",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"From Model"}),s.jsx("input",{type:"text",className:"w-full rounded-md border border-border bg-background/80 px-3 py-2 text-sm font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-2 focus:ring-orange-500/30 focus:border-orange-500/50 transition-all",placeholder:"gpt-4",value:p.from,onChange:O=>b({...p,from:O.target.value})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"To Model"}),s.jsx("input",{type:"text",className:"w-full rounded-md border border-border bg-background/80 px-3 py-2 text-sm font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-2 focus:ring-orange-500/30 focus:border-orange-500/50 transition-all",placeholder:"claude-3-opus",value:p.to,onChange:O=>b({...p,to:O.target.value})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Provider"}),s.jsxs("div",{className:"relative",children:[s.jsxs("select",{className:"w-full rounded-md border border-border bg-background/80 px-3 py-2 text-sm font-mono appearance-none cursor-pointer focus:outline-none focus:ring-2 focus:ring-orange-500/30 focus:border-orange-500/50 transition-all",value:p.provider,onChange:O=>b({...p,provider:O.target.value}),children:[s.jsx("option",{value:"",children:"Select provider..."}),Mp.map(O=>s.jsx("option",{value:O,children:O.charAt(0).toUpperCase()+O.slice(1)},O))]}),s.jsx(al,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"})]})]})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(Ne,{size:"sm",variant:"ghost",onClick:()=>{x(!1),b({from:"",to:"",provider:""})},className:"text-xs",children:"Cancel"}),s.jsx(Ne,{size:"sm",onClick:()=>Y().catch(O=>c(String(O),"error")),className:"text-xs bg-orange-500 hover:bg-orange-600 text-white",children:"Save Route"})]})]})}),s.jsxs("div",{className:"space-y-2",children:[m.length===0&&!v&&!f&&s.jsxs("div",{className:"py-8 text-center text-muted-foreground",children:[s.jsx("div",{className:"text-3xl mb-2",children:"---"}),s.jsx("p",{className:"text-sm",children:"No routes configured"}),s.jsx("p",{className:"text-xs mt-1",children:"Add a route to start mapping models"})]}),f&&m.length===0&&s.jsxs("div",{className:"py-8 text-center text-muted-foreground",children:[s.jsx(Vt,{className:"h-8 w-8 animate-spin mx-auto mb-2 opacity-20"}),s.jsx("p",{className:"text-xs uppercase tracking-widest font-mono opacity-50",children:"Loading Flight Plan..."})]}),m.map((O,ne)=>s.jsx("div",{className:`group relative rounded-lg border transition-all duration-300 ${q===ne?"opacity-0 scale-95 max-h-0 overflow-hidden border-transparent":ae===ne?"opacity-0 animate-fade-in border-border/50 bg-card/80 hover:bg-card hover:border-border":"border-border/50 bg-card/80 hover:bg-card hover:border-border"}`,style:{animation:ae===ne?"fadeIn 0.3s ease-out forwards":void 0},children:h===ne?s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"From"}),s.jsx("input",{type:"text",className:"w-full rounded-md border border-border bg-background/80 px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-orange-500/30 transition-all",value:E.from,onChange:oe=>A(k=>({...k,from:oe.target.value}))})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"To"}),s.jsx("input",{type:"text",className:"w-full rounded-md border border-border bg-background/80 px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-orange-500/30 transition-all",value:E.to,onChange:oe=>A(k=>({...k,to:oe.target.value}))})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs text-muted-foreground",children:"Provider"}),s.jsxs("div",{className:"relative",children:[s.jsxs("select",{className:"w-full rounded-md border border-border bg-background/80 px-3 py-2 text-sm font-mono appearance-none cursor-pointer focus:outline-none focus:ring-2 focus:ring-orange-500/30 transition-all",value:E.provider,onChange:oe=>A(k=>({...k,provider:oe.target.value})),children:[s.jsx("option",{value:"",children:"None"}),Mp.map(oe=>s.jsx("option",{value:oe,children:oe.charAt(0).toUpperCase()+oe.slice(1)},oe))]}),s.jsx(al,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"})]})]})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsxs(Ne,{size:"sm",variant:"ghost",onClick:()=>N(null),className:"h-8 px-3 text-xs",children:[s.jsx(ed,{className:"h-3.5 w-3.5 mr-1"}),"Cancel"]}),s.jsxs(Ne,{size:"sm",onClick:()=>z(ne,E).catch(oe=>c(String(oe),"error")),className:"h-8 px-3 text-xs bg-green-600 hover:bg-green-700 text-white",children:[s.jsx(tl,{className:"h-3.5 w-3.5 mr-1"}),"Save"]})]})]}):s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[s.jsx("div",{className:"flex-shrink-0 min-w-[100px]",children:s.jsx("code",{className:"text-sm font-mono font-medium text-foreground/90",children:O.from})}),s.jsxs("div",{className:"flex-shrink-0 flex items-center gap-0.5 text-orange-500/70 group-hover:text-orange-500 transition-colors",children:[s.jsx("span",{className:"inline-block w-8 h-[2px] bg-current rounded-full relative overflow-hidden",children:s.jsx("span",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-orange-300 to-transparent opacity-0 group-hover:opacity-100 group-hover:animate-flow"})}),s.jsx("span",{className:"inline-block w-8 h-[2px] bg-current rounded-full relative overflow-hidden",children:s.jsx("span",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-orange-300 to-transparent opacity-0 group-hover:opacity-100 group-hover:animate-flow animation-delay-100"})}),s.jsx("svg",{className:"h-4 w-4 -ml-0.5 transition-transform group-hover:translate-x-0.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})})]}),s.jsx("div",{className:"flex-1 min-w-[100px]",children:s.jsx("code",{className:"text-sm font-mono font-medium text-orange-400",children:O.to})}),O.provider&&s.jsx("div",{className:"flex-shrink-0 px-2.5 py-1 rounded text-xs font-semibold uppercase tracking-wider",style:{color:Op(O.provider),backgroundColor:zp(O.provider)},children:O.provider}),s.jsxs("div",{className:"flex-shrink-0 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(Ne,{size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted",onClick:()=>{N(ne),A({from:O.from||"",to:O.to||"",provider:O.provider||""})},children:s.jsx(gw,{className:"h-3.5 w-3.5"})}),s.jsx(Ne,{size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-destructive/10 text-destructive",onClick:()=>se(ne).catch(oe=>c(String(oe),"error")),children:s.jsx(Jo,{className:"h-3.5 w-3.5"})})]})]})},ne))]}),s.jsx("div",{className:"mt-4 pt-4 border-t border-border/50",children:s.jsx("div",{className:"rounded-lg bg-muted/30 border border-border/50 p-4",children:s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[200px]",children:[s.jsx(Dw,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Test Route:"}),s.jsx("input",{type:"text",className:"flex-1 min-w-[120px] rounded-md border border-border bg-background/80 px-3 py-1.5 text-sm font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-2 focus:ring-orange-500/30 transition-all",placeholder:"Enter model name...",value:U,onChange:O=>{G(O.target.value),O.target.value.trim()||K(null)},onKeyDown:O=>{O.key==="Enter"&&ie().catch(ne=>c(String(ne),"error"))}}),s.jsx(Ne,{size:"sm",variant:"outline",onClick:()=>ie().catch(O=>c(String(O),"error")),className:"text-xs",children:"Lookup"})]}),T&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-orange-500",children:"---"}),T.matched?s.jsxs(s.Fragment,{children:[s.jsx("code",{className:"text-sm font-mono font-medium text-orange-400",children:T.model}),T.provider&&s.jsx("span",{className:"px-2 py-0.5 rounded text-xs font-semibold uppercase",style:{color:Op(T.provider),backgroundColor:zp(T.provider)},children:T.provider})]}):s.jsx("span",{className:"text-sm text-muted-foreground italic",children:"No match found"})]})]})})})]})]}),s.jsx("style",{children:` - @keyframes fadeIn { - from { - opacity: 0; - transform: translateY(-10px); - } - to { - opacity: 1; - transform: translateY(0); - } - } - - @keyframes flow { - 0% { - transform: translateX(-100%); - } - 100% { - transform: translateX(100%); - } - } - - .animate-fade-in { - animation: fadeIn 0.3s ease-out forwards; - } - - .group:hover .group-hover\\:animate-flow { - animation: flow 0.8s ease-in-out infinite; - } - - .animation-delay-100 { - animation-delay: 0.15s; - } - `})]}):null}const Rp=(l,o)=>{const c=URL.createObjectURL(l),u=document.createElement("a");u.href=c,u.download=o,u.click(),URL.revokeObjectURL(c)},wu=l=>{if(!l)return"--:--:--";try{return new Date(l).toTimeString().slice(0,8)}catch{return l.slice(11,19)||l}},UN=(l,o)=>{try{const c=new Date(l),f=new Date(o).getTime()-c.getTime(),m=Math.floor(f/36e5),g=Math.floor(f%36e5/6e4),v=Math.floor(f%6e4/1e3);return`${m.toString().padStart(2,"0")}:${g.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}`}catch{return"--:--:--"}};function ko({title:l,icon:o,count:c,children:u,defaultOpen:f=!1}){const[m,g]=w.useState(f),v=w.useRef(null),[x,p]=w.useState(f?void 0:0);return w.useEffect(()=>{if(m){const b=v.current;if(b){p(b.scrollHeight);const h=setTimeout(()=>p(void 0),300);return()=>clearTimeout(h)}}else p(0)},[m]),s.jsxs("div",{className:"border border-orange-500/30 rounded bg-black/40",children:[s.jsxs("button",{onClick:()=>g(!m),className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-orange-500/10 transition-colors",children:[m?s.jsx(al,{className:"h-4 w-4 text-orange-400"}):s.jsx(Ou,{className:"h-4 w-4 text-orange-400"}),s.jsx(o,{className:"h-4 w-4 text-orange-400"}),s.jsx("span",{className:"text-xs font-mono text-orange-300 uppercase tracking-wider",children:l}),c!==void 0&&s.jsx("span",{className:"ml-auto text-xs font-mono bg-orange-500/20 text-orange-300 px-2 py-0.5 rounded",children:c})]}),s.jsx("div",{style:{height:x!==void 0?`${x}px`:"auto"},className:"overflow-hidden transition-[height] duration-300 ease-in-out",children:s.jsx("div",{ref:v,className:"px-3 pb-3",children:u})})]})}function HN(){const{mgmtKey:l,mgmtFetch:o,showToast:c,status:u,isMgmtLoading:f}=Mt(),[m,g]=w.useState([]),[v,x]=w.useState(""),[p,b]=w.useState(null),[h,N]=w.useState(""),[E,A]=w.useState(""),[U,G]=w.useState(""),[T,K]=w.useState(!0),[q,F]=w.useState([]),[ae,te]=w.useState([]),[_,L]=w.useState(120),[Y,z]=w.useState(20),[se,ie]=w.useState(!1),[O,ne]=w.useState({maxAgeDays:30,maxSessions:200,maxBytesPerSession:2e6,maxNamespaces:200,maxBytesPerNamespace:2e6}),[oe,k]=w.useState(!1),V=u?.running??!1,B=w.useCallback(async()=>{try{const ve=(await o("/v0/management/memory/sessions?limit=200")).sessions||[];g(ve),!v&&ve.length>0&&x(ve[0].key)}catch(Z){Z instanceof ot||c(Z instanceof Error?Z.message:String(Z),"error")}},[o,c,v]),ce=w.useCallback(async()=>{if(!v){b(null);return}try{const ve=(await o(`/v0/management/memory/session?session=${encodeURIComponent(v)}`)).session||null;b(ve),ve&&(N(ve.summary||""),A(ve.pinned||""),G(ve.todo||""),K(!ve.semantic_disabled))}catch(Z){Z instanceof ot||c(Z instanceof Error?Z.message:String(Z),"error")}},[v,o,c]),ge=w.useCallback(async()=>{if(!v){F([]);return}try{const ve=(await o(`/v0/management/memory/events?session=${encodeURIComponent(v)}&limit=${encodeURIComponent(_)}`)).events||[];if(!Array.isArray(ve)||ve.length===0){F([]);return}const at=ve.map(_t=>({ts:_t.ts||"",kind:_t.kind||"",role:_t.role||"",text:(_t.text||"").toString()}));F(at)}catch(Z){Z instanceof ot||c(Z instanceof Error?Z.message:String(Z),"error")}},[v,_,o,c]),S=w.useCallback(async()=>{if(!v){te([]);return}try{const ve=(await o(`/v0/management/memory/anchors?session=${encodeURIComponent(v)}&limit=${encodeURIComponent(Y)}`)).anchors||[];if(!Array.isArray(ve)||ve.length===0){te([]);return}const at=ve.map(_t=>({ts:_t.ts||"",summary:(_t.summary||"").toString()}));te(at)}catch(Z){Z instanceof ot||c(Z instanceof Error?Z.message:String(Z),"error")}},[v,Y,o,c]),Q=async()=>{if(v)try{await o("/v0/management/memory/todo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:v,value:U})}),await ce(),c("Saved TODO","success")}catch(Z){c(Z instanceof Error?Z.message:String(Z),"error")}},$=async()=>{if(v)try{await o("/v0/management/memory/pinned",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:v,value:E})}),await ce(),c("Saved pinned context","success")}catch(Z){c(Z instanceof Error?Z.message:String(Z),"error")}},ee=async()=>{if(v)try{await o("/v0/management/memory/summary",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:v,value:h})}),await ce(),c("Saved anchor summary","success")}catch(Z){c(Z instanceof Error?Z.message:String(Z),"error")}},re=async Z=>{if(v)try{await o("/v0/management/memory/semantic",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:v,enabled:Z})}),K(Z),await ce(),c(`Semantic ${Z?"enabled":"disabled"}`,"success")}catch(ve){c(ve instanceof Error?ve.message:String(ve),"error")}},xe=async()=>{if(v)try{await o(`/v0/management/memory/session?session=${encodeURIComponent(v)}`,{method:"DELETE"}),x(""),b(null),F([]),te([]),await B(),c("Deleted session","success")}catch(Z){c(Z instanceof Error?Z.message:String(Z),"error")}},ue=async()=>{if(!(!v||!l))try{const Z=await fetch(`/v0/management/memory/export?session=${encodeURIComponent(v)}`,{headers:{"X-Management-Key":l}});if(!Z.ok){const at=await Z.text();throw new Error(at)}const ve=await Z.blob();Rp(ve,`flight-log-${v}.zip`)}catch(Z){c(Z instanceof Error?Z.message:String(Z),"error")}},we=async()=>{if(l)try{const Z=await fetch("/v0/management/memory/export-all",{headers:{"X-Management-Key":l}});if(!Z.ok){const at=await Z.text();throw new Error(at)}const ve=await Z.blob();Rp(ve,"flight-data-complete.zip")}catch(Z){c(Z instanceof Error?Z.message:String(Z),"error")}},Te=async()=>{if(l&&window.confirm("PURGE ALL FLIGHT DATA? This action cannot be reversed."))try{await o("/v0/management/memory/delete-all?confirm=true",{method:"POST"}),x(""),b(null),F([]),te([]),await B(),c("All flight data purged","success")}catch(Z){c(Z instanceof Error?Z.message:String(Z),"error")}},We=async Z=>{if(!(!Z||!v||!l))try{const ve=new FormData;ve.append("file",Z);const at=await fetch(`/v0/management/memory/import?session=${encodeURIComponent(v)}&replace=${se?"true":"false"}`,{method:"POST",headers:{"X-Management-Key":l},body:ve});if(!at.ok){const _t=await at.text();throw new Error(_t)}await ce(),c("Flight data imported","success")}catch(ve){c(ve instanceof Error?ve.message:String(ve),"error")}},it=async()=>{try{await o("/v0/management/memory/prune",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({max_age_days:O.maxAgeDays,max_sessions:O.maxSessions,max_bytes_per_session:O.maxBytesPerSession,max_namespaces:O.maxNamespaces,max_bytes_per_namespace:O.maxBytesPerNamespace})}),await B(),c("Maintenance complete","success")}catch(Z){c(Z instanceof Error?Z.message:String(Z),"error")}};if(w.useEffect(()=>{l&&V?B():V||(g([]),b(null),F([]),te([]))},[l,V,B]),w.useEffect(()=>{v&&V&&(ce(),S(),ge())},[v,V,ce,S,ge]),!l)return null;const qe=q.length>0?q[q.length-1]?.ts:"",P=q.length>0?q[0]?.ts:"",Ye=qe&&P?UN(qe,P):"--:--:--";return s.jsxs("div",{className:"bg-gradient-to-b from-zinc-900 to-black border border-orange-500/40 rounded-lg shadow-2xl shadow-orange-500/10 overflow-hidden",children:[s.jsx("div",{className:"bg-gradient-to-r from-orange-950/80 via-orange-900/60 to-orange-950/80 border-b border-orange-500/40 px-4 py-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Ho,{className:`h-4 w-4 ${V?"text-red-500 fill-red-500 animate-pulse":"text-muted"}`}),V&&s.jsx("div",{className:"absolute inset-0 h-4 w-4 bg-red-500 rounded-full blur-sm opacity-50 animate-pulse"})]}),s.jsx("span",{className:"text-sm font-mono font-bold text-orange-300 uppercase tracking-widest",children:"Black Box Recorder"}),f&&s.jsx(Vt,{className:"h-4 w-4 animate-spin text-orange-500/60"}),s.jsxs("span",{className:"text-xs font-mono text-orange-500/60",children:["[",m.length," LOGS]"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Ne,{size:"sm",variant:"ghost",onClick:ue,disabled:!v||!V,className:"gap-1.5 text-xs font-mono bg-orange-500/10 hover:bg-orange-500/20 text-orange-300 border border-orange-500/30",children:[s.jsx(is,{className:"h-3 w-3"}),"EXPORT"]}),s.jsxs(Ne,{size:"sm",variant:"ghost",onClick:we,disabled:!V,className:"gap-1.5 text-xs font-mono bg-orange-500/10 hover:bg-orange-500/20 text-orange-300 border border-orange-500/30",children:[s.jsx(is,{className:"h-3 w-3"}),"EXPORT ALL"]}),s.jsxs("label",{className:je("cursor-pointer",!V&&"opacity-50 pointer-events-none"),children:[s.jsx("input",{type:"file",accept:".zip",className:"hidden",disabled:!V,onChange:Z=>We(Z.target.files?.[0]||null)}),s.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-mono bg-orange-500/10 hover:bg-orange-500/20 text-orange-300 border border-orange-500/30 px-3 py-1.5 rounded-md transition-colors",children:[s.jsx(eN,{className:"h-3 w-3"}),"IMPORT"]})]})]})]})}),s.jsxs("div",{className:"p-4 space-y-4",children:[!V&&s.jsxs("div",{className:"py-8 text-center text-muted-foreground border border-dashed border-orange-500/20 rounded bg-black/20",children:[s.jsx("p",{className:"text-sm uppercase tracking-widest font-mono",children:"⚠️ Engine Offline"}),s.jsx("p",{className:"text-xs mt-1",children:"Start the proxy engine to access flight data"})]}),V&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs font-mono text-orange-400 uppercase tracking-wider",children:"Session:"}),s.jsxs("div",{className:"relative flex-1",children:[s.jsxs("button",{onClick:()=>k(!oe),className:"w-full flex items-center justify-between px-3 py-2 bg-black/60 border border-orange-500/30 rounded text-left hover:border-orange-500/50 transition-colors",children:[s.jsx("span",{className:"font-mono text-sm text-orange-200",children:v||"(no session selected)"}),s.jsx(al,{className:`h-4 w-4 text-orange-400 transition-transform ${oe?"rotate-180":""}`})]}),oe&&s.jsx("div",{className:"absolute z-10 w-full mt-1 max-h-60 overflow-auto bg-zinc-900 border border-orange-500/30 rounded shadow-xl",children:m.length===0?s.jsx("div",{className:"px-3 py-2 text-xs font-mono text-orange-500/60",children:"(no sessions)"}):m.map(Z=>s.jsx("button",{onClick:()=>{x(Z.key),k(!1)},className:`w-full px-3 py-2 text-left text-sm font-mono hover:bg-orange-500/10 transition-colors ${Z.key===v?"bg-orange-500/20 text-orange-200":"text-orange-300/80"}`,children:Z.key},Z.key))})]}),s.jsx(Ne,{size:"sm",variant:"ghost",onClick:B,className:"text-orange-400 hover:text-orange-300 hover:bg-orange-500/10",children:s.jsx(ba,{className:"h-4 w-4"})})]}),v&&s.jsxs("div",{className:"bg-black/40 border border-orange-500/20 rounded p-3",children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs font-mono",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-orange-500/60",children:"Started:"}),s.jsxs("div",{className:"text-orange-200",children:[wu(qe)," UTC"]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-orange-500/60",children:"Duration:"}),s.jsx("div",{className:"text-orange-200",children:Ye})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-orange-500/60",children:"Anchors:"}),s.jsx("div",{className:"text-orange-200",children:ae.length})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-orange-500/60",children:"Events:"}),s.jsx("div",{className:"text-orange-200",children:q.length})]})]}),s.jsxs("div",{className:"flex items-center gap-4 mt-3 pt-3 border-t border-orange-500/20",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Au,{className:"h-4 w-4 text-orange-400"}),s.jsx(ua,{htmlFor:"semantic-toggle",className:"text-xs font-mono text-orange-300 cursor-pointer",children:"SEMANTIC"}),s.jsx(Bo,{id:"semantic-toggle",checked:T,disabled:!v,onCheckedChange:re})]}),s.jsx("span",{className:"text-xs font-mono text-orange-500/60",children:p?.updated_at?`Last update: ${p.updated_at}`:""})]})]})]}),s.jsx(ko,{title:"Anchors",icon:_p,count:ae.length,defaultOpen:!0,children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(ua,{className:"text-xs font-mono text-orange-500/60",children:"Limit:"}),s.jsx("input",{type:"number",min:5,max:200,className:"w-16 rounded bg-black/60 border border-orange-500/30 px-2 py-1 text-xs font-mono text-orange-200 focus:border-orange-500/50 focus:outline-none",value:Y,onChange:Z=>z(parseInt(Z.target.value||"20",10))}),s.jsxs(Ne,{size:"sm",variant:"ghost",onClick:S,className:"text-xs font-mono text-orange-400 hover:bg-orange-500/10",children:[s.jsx(ba,{className:"h-3 w-3 mr-1"}),"Reload"]})]}),s.jsx("div",{className:"bg-black/60 border border-orange-500/20 rounded max-h-48 overflow-auto",children:ae.length===0?s.jsx("div",{className:"px-3 py-4 text-xs font-mono text-orange-500/50 text-center",children:"No anchors recorded."}):s.jsx("div",{className:"divide-y divide-orange-500/10",children:ae.map((Z,ve)=>s.jsx("div",{className:"px-3 py-2 hover:bg-orange-500/5",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-xs font-mono text-orange-400 shrink-0",children:wu(Z.ts)}),s.jsx("span",{className:"text-xs font-mono text-orange-500/30",children:"|"}),s.jsx("span",{className:"text-xs font-mono text-orange-200/80 break-words",children:Z.summary.length>100?Z.summary.slice(0,100)+"...":Z.summary})]})},ve))})}),s.jsxs("div",{className:"space-y-2 mt-3",children:[s.jsx(ua,{className:"text-xs font-mono text-orange-500/60",children:"Anchor Summary:"}),s.jsx("textarea",{className:"w-full h-24 rounded bg-black/60 border border-orange-500/30 px-3 py-2 text-xs font-mono text-orange-200 resize-y focus:border-orange-500/50 focus:outline-none",value:h,onChange:Z=>N(Z.target.value),placeholder:"Session anchor summary..."}),s.jsxs(Ne,{size:"sm",onClick:ee,className:"gap-1 text-xs font-mono bg-orange-500/20 hover:bg-orange-500/30 text-orange-300 border border-orange-500/30",children:[s.jsx(Ps,{className:"h-3 w-3"}),"Save Summary"]})]})]})}),s.jsx(ko,{title:"Pinned Context",icon:vw,defaultOpen:!1,children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("textarea",{className:"w-full h-32 rounded bg-black/60 border border-orange-500/30 px-3 py-2 text-xs font-mono text-orange-200 resize-y focus:border-orange-500/50 focus:outline-none",value:E,onChange:Z=>A(Z.target.value),placeholder:"Pinned context that persists across turns..."}),s.jsxs(Ne,{size:"sm",onClick:$,className:"gap-1 text-xs font-mono bg-orange-500/20 hover:bg-orange-500/30 text-orange-300 border border-orange-500/30",children:[s.jsx(Ps,{className:"h-3 w-3"}),"Save Pinned"]})]})}),s.jsx(ko,{title:"TODO Log",icon:_p,defaultOpen:!1,children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("textarea",{className:"w-full h-32 rounded bg-black/60 border border-orange-500/30 px-3 py-2 text-xs font-mono text-orange-200 resize-y focus:border-orange-500/50 focus:outline-none",value:U,onChange:Z=>G(Z.target.value),placeholder:"Session TODO list..."}),s.jsxs(Ne,{size:"sm",onClick:Q,className:"gap-1 text-xs font-mono bg-orange-500/20 hover:bg-orange-500/30 text-orange-300 border border-orange-500/30",children:[s.jsx(Ps,{className:"h-3 w-3"}),"Save TODO"]})]})}),s.jsx(ko,{title:"Event Log",icon:Ho,count:q.length,defaultOpen:!1,children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(ua,{className:"text-xs font-mono text-orange-500/60",children:"Limit:"}),s.jsx("input",{type:"number",min:10,max:500,className:"w-16 rounded bg-black/60 border border-orange-500/30 px-2 py-1 text-xs font-mono text-orange-200 focus:border-orange-500/50 focus:outline-none",value:_,onChange:Z=>L(parseInt(Z.target.value||"120",10))}),s.jsxs(Ne,{size:"sm",variant:"ghost",onClick:ge,className:"text-xs font-mono text-orange-400 hover:bg-orange-500/10",children:[s.jsx(ba,{className:"h-3 w-3 mr-1"}),"Reload"]})]}),s.jsx("div",{className:"bg-black/60 border border-orange-500/20 rounded max-h-64 overflow-auto",children:q.length===0?s.jsx("div",{className:"px-3 py-4 text-xs font-mono text-orange-500/50 text-center",children:"No events recorded."}):s.jsx("div",{className:"divide-y divide-orange-500/10",children:q.map((Z,ve)=>s.jsx("div",{className:"px-3 py-2 hover:bg-orange-500/5",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-xs font-mono text-orange-400 shrink-0",children:wu(Z.ts)}),s.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-orange-500/20 text-orange-300 shrink-0",children:Z.kind}),s.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-zinc-700/50 text-zinc-300 shrink-0",children:Z.role}),s.jsx("span",{className:"text-xs font-mono text-orange-200/70 break-words",children:Z.text.length>80?Z.text.slice(0,80)+"...":Z.text})]})},ve))})})]})}),s.jsxs("div",{className:"relative pt-6",children:[s.jsxs("div",{className:"absolute top-0 left-0 right-0 flex items-center",children:[s.jsx("div",{className:"flex-1 border-t border-dashed border-orange-500/30"}),s.jsxs("span",{className:"px-3 text-xs font-mono text-orange-500/60 uppercase tracking-widest flex items-center gap-2",children:[s.jsx(J0,{className:"h-3 w-3"}),"Maintenance"]}),s.jsx("div",{className:"flex-1 border-t border-dashed border-orange-500/30"})]}),s.jsxs("div",{className:"bg-black/40 border border-orange-500/20 rounded p-4 space-y-4",children:[s.jsx("div",{className:"flex items-center gap-4 pb-3 border-b border-orange-500/20",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Bo,{id:"import-replace",checked:se,onCheckedChange:ie}),s.jsx(ua,{htmlFor:"import-replace",className:"text-xs font-mono text-orange-300 cursor-pointer",children:"Replace on Import"})]})}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(ua,{className:"text-xs font-mono text-orange-500/60",children:"Max Sessions"}),s.jsx("input",{type:"number",min:0,className:"w-full rounded bg-black/60 border border-orange-500/30 px-2 py-1.5 text-xs font-mono text-orange-200 focus:border-orange-500/50 focus:outline-none",value:O.maxSessions,onChange:Z=>ne({...O,maxSessions:parseInt(Z.target.value||"0",10)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(ua,{className:"text-xs font-mono text-orange-500/60",children:"Max Age (days)"}),s.jsx("input",{type:"number",min:0,className:"w-full rounded bg-black/60 border border-orange-500/30 px-2 py-1.5 text-xs font-mono text-orange-200 focus:border-orange-500/50 focus:outline-none",value:O.maxAgeDays,onChange:Z=>ne({...O,maxAgeDays:parseInt(Z.target.value||"0",10)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(ua,{className:"text-xs font-mono text-orange-500/60",children:"Max Namespaces"}),s.jsx("input",{type:"number",min:0,className:"w-full rounded bg-black/60 border border-orange-500/30 px-2 py-1.5 text-xs font-mono text-orange-200 focus:border-orange-500/50 focus:outline-none",value:O.maxNamespaces,onChange:Z=>ne({...O,maxNamespaces:parseInt(Z.target.value||"0",10)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(ua,{className:"text-xs font-mono text-orange-500/60",children:"Bytes/Session"}),s.jsx("input",{type:"number",min:0,className:"w-full rounded bg-black/60 border border-orange-500/30 px-2 py-1.5 text-xs font-mono text-orange-200 focus:border-orange-500/50 focus:outline-none",value:O.maxBytesPerSession,onChange:Z=>ne({...O,maxBytesPerSession:parseInt(Z.target.value||"0",10)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(ua,{className:"text-xs font-mono text-orange-500/60",children:"Bytes/Namespace"}),s.jsx("input",{type:"number",min:0,className:"w-full rounded bg-black/60 border border-orange-500/30 px-2 py-1.5 text-xs font-mono text-orange-200 focus:border-orange-500/50 focus:outline-none",value:O.maxBytesPerNamespace,onChange:Z=>ne({...O,maxBytesPerNamespace:parseInt(Z.target.value||"0",10)})})]})]}),s.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[s.jsxs(Ne,{size:"sm",onClick:it,className:"gap-1.5 text-xs font-mono bg-amber-600/80 hover:bg-amber-600 text-black border border-amber-500",children:[s.jsx(Mw,{className:"h-3 w-3"}),"PRUNE NOW"]}),s.jsxs(Ne,{size:"sm",variant:"ghost",onClick:xe,disabled:!v,className:"gap-1.5 text-xs font-mono bg-red-500/20 hover:bg-red-500/30 text-red-400 border border-red-500/30",children:[s.jsx(Jo,{className:"h-3 w-3"}),"Delete Session"]}),s.jsxs(Ne,{size:"sm",variant:"ghost",onClick:Te,className:"gap-1.5 text-xs font-mono bg-red-500/20 hover:bg-red-500/30 text-red-400 border border-red-500/30",children:[s.jsx(Iu,{className:"h-3 w-3"}),"Purge All Data"]})]})]})]})]})]})]})}const BN=lg("inline-flex items-center justify-center rounded-sm border px-1.5 py-0.5 w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden font-mono text-[0.65rem] uppercase tracking-wide",{variants:{variant:{default:"border-transparent bg-[hsl(var(--accent-primary))] text-[hsl(var(--bg-primary))] font-semibold [a&]:hover:bg-[hsl(var(--accent-primary))]/90",secondary:"border-[hsl(var(--border-primary))] bg-[hsl(var(--bg-secondary))] text-[hsl(var(--text-secondary))] [a&]:hover:bg-[hsl(var(--bg-tertiary))]",destructive:"border-transparent bg-[hsl(var(--status-offline))] text-white [a&]:hover:bg-[hsl(var(--status-offline))]/90 focus-visible:ring-[hsl(var(--status-offline))]/20",outline:"border-[hsl(var(--border-primary))] bg-transparent text-[hsl(var(--text-secondary))] [a&]:hover:bg-[hsl(var(--bg-tertiary))] [a&]:hover:text-[hsl(var(--text-primary))]",success:"border-transparent bg-[hsl(var(--status-online))] text-white font-semibold [a&]:hover:bg-[hsl(var(--status-online))]/90",warning:"border-transparent bg-[hsl(var(--status-warning))] text-[hsl(var(--bg-primary))] font-semibold [a&]:hover:bg-[hsl(var(--status-warning))]/90",processing:"border-transparent bg-[hsl(var(--status-processing))] text-white font-semibold [a&]:hover:bg-[hsl(var(--status-processing))]/90"}},defaultVariants:{variant:"default"}});function qN({className:l,variant:o,asChild:c=!1,...u}){const f=c?ng:"span";return s.jsx(f,{"data-slot":"badge",className:je(BN({variant:o}),l),...u})}function YN(){const{mgmtKey:l,mgmtFetch:o,showToast:c,status:u,isMgmtLoading:f}=Mt(),[m,g]=w.useState(null),[v,x]=w.useState([]),[p,b]=w.useState(""),[h,N]=w.useState(50),[E,A]=w.useState(""),U=u?.running??!1,G=w.useCallback(async()=>{try{const q=await o("/v0/management/semantic/health");g(q)}catch(q){q instanceof ot||c(q instanceof Error?q.message:String(q),"error")}},[o,c]),T=w.useCallback(async()=>{try{const F=(await o("/v0/management/semantic/namespaces")).namespaces||[];x(F),!p&&F.length>0&&b(F[0].key)}catch(q){q instanceof ot||c(q instanceof Error?q.message:String(q),"error")}},[o,c,p]),K=w.useCallback(async()=>{if(!p){A("Select a namespace.");return}try{const F=(await o(`/v0/management/semantic/items?namespace=${encodeURIComponent(p)}&limit=${encodeURIComponent(h)}`)).items||[];if(!Array.isArray(F)||F.length===0){A("No items.");return}const ae=F.map(te=>{const _=te.ts||"",L=te.source||"",Y=te.role||"",z=(te.text||"").toString();return`[${_}][${L}][${Y}] ${z}`});A(ae.join(` - -`))}catch(q){q instanceof ot||c(q instanceof Error?q.message:String(q),"error")}},[o,c,p,h]);return w.useEffect(()=>{l&&U?(G(),T()):U||(g(null),x([]),A(""))},[l,U,G,T]),l?s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl",children:[s.jsx(At,{className:"pb-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(da,{className:"text-lg",children:"Semantic Memory"}),s.jsx(rs,{children:"Ollama embeddings + per-repo namespaces"})]}),f&&s.jsx(Vt,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}),s.jsxs(St,{className:"space-y-3",children:[!U&&s.jsx("div",{className:"py-4 text-center text-muted-foreground",children:s.jsx("p",{className:"text-xs uppercase tracking-widest font-mono",children:"⚠️ Engine Offline"})}),U&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ne,{size:"sm",variant:"outline",onClick:G,children:"Refresh"}),s.jsx(qN,{variant:m?.status==="ok"?"default":"secondary",children:m?.status||"unknown"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[m?.model," ",m?.version?`v${m.version}`:""]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:m?.model_present===!1?"model missing":""})]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[m?.latency_ms?`latency ${m.latency_ms}ms`:"latency n/a",m?.queue?` · queue q${m.queue.queued} d${m.queue.dropped} p${m.queue.processed} f${m.queue.failed}`:""]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("select",{className:"min-w-[200px] rounded-md border border-border bg-background/60 px-2 py-1 text-xs font-mono",value:p,onChange:q=>b(q.target.value),children:[v.length===0&&s.jsx("option",{value:"",children:"(no namespaces)"}),v.map(q=>s.jsx("option",{value:q.key,children:q.label||q.key},q.key))]}),s.jsx("input",{type:"number",min:10,max:200,className:"w-20 rounded-md border border-border bg-background/60 px-2 py-1 text-xs",value:h,onChange:q=>N(parseInt(q.target.value||"50",10))}),s.jsx(Ne,{size:"sm",variant:"outline",onClick:K,children:"Load"})]}),s.jsx("pre",{className:"max-h-56 overflow-auto rounded-md border border-border/50 bg-muted/30 p-2 text-xs",children:E||"No items loaded."})]})]})]}):null}function GN(){const{mgmtFetch:l,showToast:o,status:c,isMgmtLoading:u}=Mt(),[f,m]=w.useState(""),[g,v]=w.useState(!1),x=c?.running??!1,p=async()=>{try{const h=await l("/v0/management/config.yaml");m(typeof h=="string"?h:JSON.stringify(h,null,2))}catch(h){h instanceof ot||o(h instanceof Error?h.message:String(h),"error")}},b=async()=>{v(!0);try{await l("/v0/management/config.yaml",{method:"PUT",headers:{"Content-Type":"application/yaml"},body:f}),o("Configuration saved successfully","success")}catch(h){o(h instanceof Error?h.message:String(h),"error")}finally{v(!1)}};return w.useEffect(()=>{x&&p()},[x]),s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl overflow-hidden",children:[s.jsx(At,{className:"pb-4 border-b border-border/50 bg-gradient-to-r from-purple-500/5 to-transparent",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-xl bg-purple-500/10 flex items-center justify-center",children:s.jsx(Z2,{className:"h-5 w-5 text-purple-500"})}),s.jsxs("div",{children:[s.jsx(da,{className:"text-lg",children:"Config Editor"}),s.jsx(rs,{children:"Edit config.yaml directly"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Ne,{size:"sm",variant:"outline",onClick:p,disabled:!x||u,className:"gap-1.5 text-xs",children:[s.jsx(Ew,{className:"h-3.5 w-3.5"}),"Reset"]}),s.jsxs(Ne,{size:"sm",onClick:b,disabled:!x||g||u,className:"gap-1.5 text-xs bg-purple-600 hover:bg-purple-700 text-white",children:[g?s.jsx(Vt,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(Ps,{className:"h-3.5 w-3.5"}),"Save Changes"]})]})]})}),s.jsx(St,{className:"p-0",children:x?s.jsxs("div",{className:"relative",children:[s.jsx("textarea",{value:f,onChange:h=>m(h.target.value),spellCheck:!1,className:"w-full h-[500px] p-6 bg-[var(--bg-void)] text-[var(--text-primary)] font-mono text-sm resize-none focus:outline-none selection:bg-purple-500/30",style:{fontFamily:'"JetBrains Mono", "Fira Code", monospace',lineHeight:"1.6"}}),s.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03]",style:{backgroundImage:"linear-gradient(var(--border-subtle) 1px, transparent 1px), linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px)",backgroundSize:"20px 20px"}})]}):s.jsxs("div",{className:"py-12 text-center text-muted-foreground",children:[s.jsx("p",{className:"text-sm uppercase tracking-widest font-mono",children:"⚠️ Engine Offline"}),s.jsx("p",{className:"text-xs mt-1",children:"Start the proxy engine to edit configuration"})]})})]})}function VN(){const{mgmtFetch:l,showToast:o,status:c,isMgmtLoading:u}=Mt(),[f,m]=w.useState([]),[g,v]=w.useState(null),[x,p]=w.useState(!1),[b,h]=w.useState("live"),[N,E]=w.useState(new Set),A=w.useRef(null),U=c?.running??!1,[G,T]=w.useState(!1),[K,q]=w.useState(""),[F,ae]=w.useState(""),[te,_]=w.useState("all"),[L,Y]=w.useState(""),[z,se]=w.useState(""),[ie,O]=w.useState(1),[ne]=w.useState(50),[oe,k]=w.useState(0),[V,B]=w.useState([]),[ce,ge]=w.useState([]),S=w.useCallback(async()=>{try{let P=[];window.pp_get_requests?P=await window.pp_get_requests():P=(await l("/v0/management/requests")).requests||[],m([...P].sort((ve,at)=>new Date(at.timestamp).getTime()-new Date(ve.timestamp).getTime()));const Ye=new Set,Z=new Set;P.forEach(ve=>{ve.model&&Ye.add(ve.model),ve.provider&&Z.add(ve.provider)}),B(Array.from(Ye).sort()),ge(Array.from(Z).sort())}catch(P){P instanceof ot||o(P instanceof Error?P.message:String(P),"error")}},[l,o]),Q=w.useCallback(async()=>{try{const P=new URLSearchParams;P.set("limit",String(ne)),P.set("offset",String((ie-1)*ne)),K&&P.set("model",K),F&&P.set("provider",F),L&&P.set("start_date",new Date(L).toISOString()),z&&P.set("end_date",new Date(z).toISOString()),te==="success"?(P.set("status_min","200"),P.set("status_max","299")):te==="error"&&P.set("errors_only","true");const Ye=await l(`/v0/management/request-history?${P.toString()}`);m(Ye.entries||[]),k(Ye.total||0);const Z=await l("/v0/management/request-history/stats");v(Z.stats||null),Z.stats?.by_model&&B(Object.keys(Z.stats.by_model).sort()),Z.stats?.by_provider&&ge(Object.keys(Z.stats.by_provider).sort())}catch(P){P instanceof ot||o(P instanceof Error?P.message:String(P),"error")}},[l,o,ie,ne,K,F,te,L,z]),$=()=>{x?(p(!1),A.current&&(clearInterval(A.current),A.current=null)):(p(!0),S(),A.current=setInterval(()=>{S()},2e3))},ee=P=>{const Ye=new Set(N);Ye.has(P)?Ye.delete(P):Ye.add(P),E(Ye)},re=async()=>{try{const P=await l("/v0/management/request-history/export"),Ye=new Blob([JSON.stringify(P,null,2)],{type:"application/json"}),Z=URL.createObjectURL(Ye),ve=document.createElement("a");ve.href=Z,ve.download=`proxypilot-request-history-${new Date().toISOString().split("T")[0]}.json`,ve.click(),URL.revokeObjectURL(Z),o("Request history exported","success")}catch(P){o(P instanceof Error?P.message:String(P),"error")}},xe=async()=>{if(confirm("Are you sure you want to clear all request history? This cannot be undone."))try{await l("/v0/management/request-history",{method:"DELETE"}),o("Request history cleared","success"),m([]),k(0),v(null)}catch(P){o(P instanceof Error?P.message:String(P),"error")}},ue=async()=>{try{await l("/v0/management/request-history/save",{method:"POST"}),o("Request history saved to disk","success")}catch(P){o(P instanceof Error?P.message:String(P),"error")}};w.useEffect(()=>(b==="live"?S():Q(),()=>{A.current&&clearInterval(A.current)}),[b,S,Q]),w.useEffect(()=>{O(1)},[K,F,te,L,z]);const we=P=>P>=200&&P<300?"text-[var(--status-online)]":P>=400&&P<500?"text-[var(--status-warning)]":P>=500?"text-[var(--status-offline)]":"text-[var(--text-muted)]",Te=P=>P>=200&&P<300?s.jsx(q0,{className:"h-3 w-3"}):P>=400&&P<500?s.jsx(Uo,{className:"h-3 w-3"}):P>=500?s.jsx(z2,{className:"h-3 w-3"}):s.jsx(Ho,{className:"h-3 w-3"}),We=P=>new Date(P).toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),it=P=>new Date(P).toLocaleDateString([],{month:"short",day:"numeric"}),qe=Math.ceil(oe/ne);return s.jsxs(jt,{className:"backdrop-blur-sm bg-[var(--bg-void)] border-[var(--border-default)] shadow-xl overflow-hidden",children:[s.jsxs(At,{className:"pb-3 border-b border-[var(--border-subtle)] bg-[var(--bg-panel)]",children:[s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ko,{className:`h-4 w-4 ${x&&U?"text-[var(--accent-glow)] animate-pulse":"text-[var(--text-muted)]"}`}),s.jsx("span",{className:"font-mono text-sm font-semibold tracking-wider text-[var(--text-primary)]",children:"REQUEST MONITOR"})]}),u&&s.jsx(ba,{className:"h-3 w-3 animate-spin text-muted-foreground"}),s.jsxs("div",{className:"flex items-center gap-1 bg-[var(--bg-elevated)] rounded p-0.5",children:[s.jsxs("button",{onClick:()=>{h("live"),p(!1)},className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs font-mono transition-all ${b==="live"?"bg-[var(--accent-primary)]/20 text-[var(--accent-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:[s.jsx(Z0,{className:"h-3 w-3"}),"LIVE"]}),s.jsxs("button",{onClick:()=>{h("history"),p(!1),A.current&&(clearInterval(A.current),A.current=null)},className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs font-mono transition-all ${b==="history"?"bg-[var(--accent-primary)]/20 text-[var(--accent-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:[s.jsx(nw,{className:"h-3 w-3"}),"HISTORY"]})]}),b==="live"&&s.jsxs("button",{onClick:$,disabled:!U,className:`flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-mono transition-all ${x&&U?"bg-[var(--accent-glow)]/20 text-[var(--accent-glow)]":"bg-[var(--bg-elevated)] text-[var(--text-muted)] hover:text-[var(--text-secondary)]"} ${U?"":"opacity-50 cursor-not-allowed"}`,children:[s.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${x&&U?"bg-[var(--accent-glow)]":"bg-[var(--text-muted)]"}`}),"AUTO"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[b==="history"&&s.jsxs(s.Fragment,{children:[s.jsxs(Ne,{size:"sm",variant:"outline",onClick:()=>T(!G),className:`text-xs h-7 font-mono gap-1 ${G?"bg-[var(--accent-primary)]/10 border-[var(--accent-primary)]":""}`,children:[s.jsx(W2,{className:"h-3 w-3"}),"FILTER"]}),s.jsxs(Ne,{size:"sm",variant:"outline",onClick:ue,disabled:!U||u,className:"text-xs h-7 font-mono gap-1",children:[s.jsx(Ps,{className:"h-3 w-3"}),"SAVE"]}),s.jsxs(Ne,{size:"sm",variant:"outline",onClick:re,disabled:!U||u,className:"text-xs h-7 font-mono gap-1",children:[s.jsx(is,{className:"h-3 w-3"}),"EXPORT"]}),s.jsxs(Ne,{size:"sm",variant:"outline",onClick:xe,disabled:!U||u,className:"text-xs h-7 font-mono gap-1 text-[var(--status-offline)] hover:bg-[var(--status-offline)]/10",children:[s.jsx(Jo,{className:"h-3 w-3"}),"CLEAR"]})]}),s.jsxs(Ne,{size:"sm",variant:"outline",onClick:b==="live"?S:Q,disabled:!U||u,className:"text-xs h-7 font-mono gap-1",children:[s.jsx(ba,{className:"h-3 w-3"}),"REFRESH"]})]})]}),G&&b==="history"&&s.jsxs("div",{className:"mt-3 pt-3 border-t border-[var(--border-subtle)] grid grid-cols-2 md:grid-cols-5 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] font-mono text-[var(--text-muted)] uppercase mb-1",children:"Model"}),s.jsxs("select",{value:K,onChange:P=>q(P.target.value),className:"w-full px-2 py-1.5 rounded border border-[var(--border-default)] bg-[var(--bg-elevated)] text-xs font-mono",children:[s.jsx("option",{value:"",children:"All Models"}),V.map(P=>s.jsx("option",{value:P,children:P},P))]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] font-mono text-[var(--text-muted)] uppercase mb-1",children:"Provider"}),s.jsxs("select",{value:F,onChange:P=>ae(P.target.value),className:"w-full px-2 py-1.5 rounded border border-[var(--border-default)] bg-[var(--bg-elevated)] text-xs font-mono",children:[s.jsx("option",{value:"",children:"All Providers"}),ce.map(P=>s.jsx("option",{value:P,children:P},P))]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] font-mono text-[var(--text-muted)] uppercase mb-1",children:"Status"}),s.jsxs("select",{value:te,onChange:P=>_(P.target.value),className:"w-full px-2 py-1.5 rounded border border-[var(--border-default)] bg-[var(--bg-elevated)] text-xs font-mono",children:[s.jsx("option",{value:"all",children:"All"}),s.jsx("option",{value:"success",children:"Success (2xx)"}),s.jsx("option",{value:"error",children:"Errors"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] font-mono text-[var(--text-muted)] uppercase mb-1",children:"From"}),s.jsx("input",{type:"date",value:L,onChange:P=>Y(P.target.value),className:"w-full px-2 py-1.5 rounded border border-[var(--border-default)] bg-[var(--bg-elevated)] text-xs font-mono"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] font-mono text-[var(--text-muted)] uppercase mb-1",children:"To"}),s.jsx("input",{type:"date",value:z,onChange:P=>se(P.target.value),className:"w-full px-2 py-1.5 rounded border border-[var(--border-default)] bg-[var(--bg-elevated)] text-xs font-mono"})]})]}),b==="history"&&g&&s.jsxs("div",{className:"mt-3 pt-3 border-t border-[var(--border-subtle)] grid grid-cols-3 md:grid-cols-6 gap-4 text-center",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-lg font-bold text-[var(--text-primary)]",children:g.total_requests}),s.jsx("div",{className:"text-[10px] font-mono text-[var(--text-muted)] uppercase",children:"Total"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-lg font-bold text-[var(--status-online)]",children:g.success_count}),s.jsx("div",{className:"text-[10px] font-mono text-[var(--text-muted)] uppercase",children:"Success"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-lg font-bold text-[var(--status-offline)]",children:g.failure_count}),s.jsx("div",{className:"text-[10px] font-mono text-[var(--text-muted)] uppercase",children:"Failed"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-lg font-bold text-[var(--text-primary)]",children:(g.total_tokens_in+g.total_tokens_out).toLocaleString()}),s.jsx("div",{className:"text-[10px] font-mono text-[var(--text-muted)] uppercase",children:"Tokens"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-lg font-bold text-emerald-400",children:["$",g.total_cost_usd.toFixed(2)]}),s.jsx("div",{className:"text-[10px] font-mono text-[var(--text-muted)] uppercase",children:"Cost"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"text-lg font-bold text-emerald-400",children:["$",g.savings.toFixed(2)]}),s.jsx("div",{className:"text-[10px] font-mono text-[var(--text-muted)] uppercase",children:"Saved"})]})]})]}),s.jsx(St,{className:"p-0",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left border-collapse font-mono text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-[var(--bg-panel)]/50 text-[var(--text-muted)] border-b border-[var(--border-subtle)]",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:b==="history"?"DATE":"TIME"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"MODEL"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"PROVIDER"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"STATUS"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"LATENCY"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"TOKENS"}),s.jsx("th",{className:"px-4 py-2 font-medium w-10"})]})}),s.jsx("tbody",{className:"divide-y divide-[var(--border-subtle)]/30",children:U?f.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"p-8 text-center text-[var(--text-muted)]",children:b==="history"?"No request history found.":"No requests recorded yet."})}):f.map(P=>s.jsxs(le.Fragment,{children:[s.jsxs("tr",{className:"hover:bg-[var(--bg-panel)]/50 transition-colors cursor-pointer group",onClick:()=>ee(P.id),children:[s.jsx("td",{className:"px-4 py-2.5 text-[var(--text-muted)] tabular-nums",children:b==="history"?s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:it(P.timestamp)}),s.jsx("span",{className:"text-[10px]",children:We(P.timestamp)})]}):We(P.timestamp)}),s.jsx("td",{className:"px-4 py-2.5 text-[var(--text-primary)] font-medium",children:P.model||"-"}),s.jsx("td",{className:"px-4 py-2.5",children:s.jsx("span",{className:"px-1.5 py-0.5 rounded bg-[var(--bg-elevated)] text-[var(--text-secondary)] text-[10px]",children:P.provider?.toUpperCase()||"UNKNOWN"})}),s.jsx("td",{className:`px-4 py-2.5 font-bold ${we(P.status)}`,children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[Te(P.status),P.status]})}),s.jsxs("td",{className:"px-4 py-2.5 text-[var(--text-secondary)] tabular-nums",children:[P.latencyMs,"ms"]}),s.jsx("td",{className:"px-4 py-2.5 text-[var(--text-muted)] tabular-nums",children:s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("span",{children:["In: ",P.inputTokens]}),s.jsxs("span",{children:["Out: ",P.outputTokens]})]})}),s.jsx("td",{className:"px-4 py-2.5 text-right",children:N.has(P.id)?s.jsx(al,{className:"h-4 w-4 text-[var(--text-muted)]"}):s.jsx(Ou,{className:"h-4 w-4 text-[var(--text-muted)] group-hover:text-[var(--text-primary)]"})})]}),N.has(P.id)&&s.jsx("tr",{className:"bg-[var(--bg-panel)]/30",children:s.jsx("td",{colSpan:7,className:"px-4 py-4 border-l-2 border-l-[var(--accent-glow)]",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-[var(--text-muted)] text-[10px] uppercase tracking-wider",children:[s.jsx(H2,{className:"h-3 w-3"}),"Request Details"]}),s.jsxs("div",{className:"space-y-1 text-[var(--text-secondary)]",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Method:"}),s.jsx("span",{className:"text-[var(--text-primary)]",children:P.method})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Path:"}),s.jsx("span",{className:"text-[var(--text-primary)] break-all ml-4",children:P.path})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"ID:"}),s.jsx("span",{className:"text-[var(--text-primary)] text-[10px]",children:P.id})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-[var(--text-muted)] text-[10px] uppercase tracking-wider",children:[s.jsx(Y0,{className:"h-3 w-3"}),"Performance & Usage"]}),s.jsxs("div",{className:"space-y-1 text-[var(--text-secondary)]",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Latency:"}),s.jsxs("span",{className:"text-[var(--text-primary)]",children:[P.latencyMs,"ms"]})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Total Tokens:"}),s.jsx("span",{className:"text-[var(--text-primary)]",children:P.inputTokens+P.outputTokens})]}),P.error&&s.jsxs("div",{className:"mt-2 p-2 rounded bg-[var(--status-offline)]/10 border border-[var(--status-offline)]/20 text-[var(--status-offline)]",children:[s.jsxs("div",{className:"flex items-center gap-1 mb-1 font-bold",children:[s.jsx(Uo,{className:"h-3 w-3"}),"ERROR"]}),s.jsx("div",{className:"text-[10px] break-all",children:P.error})]})]})]})]})})})]},P.id)):s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"p-8 text-center text-[var(--text-muted)]",children:s.jsx("p",{className:"text-xs uppercase tracking-widest",children:"Engine Offline"})})})})]})})}),s.jsx("div",{className:"px-3 py-1.5 bg-[var(--bg-panel)] border-t border-[var(--border-subtle)] flex items-center justify-between text-[10px] font-mono text-[var(--text-muted)]",children:b==="live"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:[f.length," requests tracked"]}),s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:x?"text-[var(--accent-glow)]":"",children:x?"AUTO REFRESH ON":"AUTO REFRESH OFF"}),s.jsx("span",{children:"|"}),s.jsx("span",{children:"2s INTERVAL"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Showing ",f.length," of ",oe," entries"]}),qe>1&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>O(1),disabled:ie===1,className:"p-1 rounded hover:bg-[var(--bg-elevated)] disabled:opacity-30",children:s.jsx(C2,{className:"h-3 w-3"})}),s.jsx("button",{onClick:()=>O(P=>Math.max(1,P-1)),disabled:ie===1,className:"p-1 rounded hover:bg-[var(--bg-elevated)] disabled:opacity-30",children:s.jsx(S2,{className:"h-3 w-3"})}),s.jsxs("span",{className:"px-2",children:["Page ",ie," of ",qe]}),s.jsx("button",{onClick:()=>O(P=>Math.min(qe,P+1)),disabled:ie===qe,className:"p-1 rounded hover:bg-[var(--bg-elevated)] disabled:opacity-30",children:s.jsx(Ou,{className:"h-3 w-3"})}),s.jsx("button",{onClick:()=>O(qe),disabled:ie===qe,className:"p-1 rounded hover:bg-[var(--bg-elevated)] disabled:opacity-30",children:s.jsx(k2,{className:"h-3 w-3"})})]})]})})]})}function XN(){const{mgmtFetch:l}=Mt(),[o,c]=w.useState(null),[u,f]=w.useState(null),[m,g]=w.useState(!0),v=async()=>{try{let h;if(window.pp_get_usage)h=await window.pp_get_usage();else if(l)h=await l("/v0/management/usage");else throw new Error("No method available to fetch usage data");const N=h?.usage||h;N&&typeof N=="object"&&(c({total_requests:N.total_requests??N.totalRequests??0,success_count:N.success_count??N.successCount??0,failure_count:N.failure_count??N.failureCount??0,total_input_tokens:N.total_input_tokens??N.totalInputTokens??0,total_output_tokens:N.total_output_tokens??N.totalOutputTokens??0,estimated_cost_saved:N.estimated_cost_saved??N.estimatedCostSaved??0,actual_cost:N.actual_cost??N.actualCost??0,direct_api_cost:N.direct_api_cost??N.directApiCost??0,savings:N.savings??0,savings_percent:N.savings_percent??N.savingsPercent??0,by_model:N.by_model??N.byModel??{},by_provider:N.by_provider??N.byProvider??{},cost_by_model:N.cost_by_model??N.costByModel??{},cost_by_provider:N.cost_by_provider??N.costByProvider??{},daily:N.daily??[]}),f(null))}catch(h){console.error("Failed to fetch usage stats:",h),f(h instanceof Error?h.message:String(h))}finally{g(!1)}};if(w.useEffect(()=>{v();const h=setInterval(v,3e4);return()=>clearInterval(h)},[]),m&&!o)return s.jsx("div",{className:"flex h-64 items-center justify-center",children:s.jsx(Vt,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(u&&!o)return s.jsxs("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-6 text-center",children:[s.jsx("p",{className:"text-red-300",children:"Failed to load usage statistics"}),s.jsx("p",{className:"mt-2 text-xs text-red-400/70",children:u})]});if(!o)return s.jsxs("div",{className:"rounded-xl border border-[var(--border-subtle)] bg-[var(--bg-panel)] p-8 text-center",children:[s.jsx(Mu,{className:"mx-auto h-12 w-12 text-[var(--text-muted)] opacity-50"}),s.jsx("p",{className:"mt-4 text-[var(--text-primary)]",children:"No usage data available yet"}),s.jsx("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:"Start making requests through the proxy to see statistics here."})]});const x=Math.max(...o.daily.map(h=>h.requests),1),p=Object.entries(o.by_provider).sort((h,N)=>N[1]-h[1]),b=p.reduce((h,[N,E])=>h+E,0);return s.jsxs("div",{className:"space-y-6",children:[(o.direct_api_cost>0||o.actual_cost>0)&&s.jsxs(jt,{className:je("relative overflow-hidden","bg-gradient-to-br from-emerald-500/10 via-teal-500/5 to-cyan-500/10","border-emerald-500/30 shadow-xl shadow-emerald-500/5"),children:[s.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,_var(--tw-gradient-stops))] from-emerald-400/10 via-transparent to-transparent"}),s.jsx(At,{className:"relative pb-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-emerald-500/20 ring-1 ring-emerald-500/30",children:s.jsx(Jw,{className:"h-5 w-5 text-emerald-400"})}),s.jsxs("div",{children:[s.jsx(da,{className:"text-lg text-emerald-100",children:"Cost Savings"}),s.jsx(rs,{className:"text-emerald-300/70",children:"ProxyPilot vs Direct API"})]})]})}),s.jsx(St,{className:"relative",children:s.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-emerald-300/60",children:"You Saved"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-3xl font-bold text-emerald-400",children:["$",o.savings.toFixed(2)]}),o.savings_percent>0&&s.jsxs("span",{className:"rounded-full bg-emerald-500/20 px-2 py-0.5 text-xs font-medium text-emerald-300",children:[o.savings_percent.toFixed(0),"% off"]})]})]}),s.jsxs("div",{className:"md:col-span-2 space-y-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Direct API Cost"}),s.jsxs("span",{className:"font-medium text-red-400",children:["$",o.direct_api_cost.toFixed(2)]})]}),s.jsx("div",{className:"h-3 w-full overflow-hidden rounded-full bg-red-500/20",children:s.jsx("div",{className:"h-full bg-red-500/60",style:{width:"100%"}})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[s.jsx(K0,{className:"h-3 w-3 text-emerald-400"}),"ProxyPilot Cost"]}),s.jsxs("span",{className:"font-medium text-emerald-400",children:["$",o.actual_cost.toFixed(2)]})]}),s.jsx("div",{className:"h-3 w-full overflow-hidden rounded-full bg-emerald-500/20",children:s.jsx("div",{className:"h-full bg-emerald-500/60 transition-all",style:{width:o.direct_api_cost>0?`${o.actual_cost/o.direct_api_cost*100}%`:"0%"}})})]})]})]})})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl",children:[s.jsxs(At,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(da,{className:"text-sm font-medium",children:"Total Requests"}),s.jsx(Ko,{className:"h-4 w-4 text-blue-400"})]}),s.jsxs(St,{children:[s.jsx("div",{className:"text-2xl font-bold",children:o.total_requests.toLocaleString()}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[o.success_count.toLocaleString()," successful"]})]})]}),s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl",children:[s.jsxs(At,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(da,{className:"text-sm font-medium",children:"Input Tokens"}),s.jsx(Du,{className:"h-4 w-4 text-amber-400"})]}),s.jsxs(St,{children:[s.jsx("div",{className:"text-2xl font-bold",children:o.total_input_tokens.toLocaleString()}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Prompt tokens"})]})]}),s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl",children:[s.jsxs(At,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(da,{className:"text-sm font-medium",children:"Output Tokens"}),s.jsx(Du,{className:"h-4 w-4 text-emerald-400"})]}),s.jsxs(St,{children:[s.jsx("div",{className:"text-2xl font-bold",children:o.total_output_tokens.toLocaleString()}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Completion tokens"})]})]}),s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl",children:[s.jsxs(At,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(da,{className:"text-sm font-medium",children:"Total Cost"}),s.jsx(V2,{className:"h-4 w-4 text-purple-400"})]}),s.jsxs(St,{children:[s.jsxs("div",{className:"text-2xl font-bold",children:["$",o.actual_cost.toFixed(2)]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Based on model pricing"})]})]})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl",children:[s.jsxs(At,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Mu,{className:"h-4 w-4 text-muted-foreground"}),s.jsx(da,{className:"text-lg",children:"Daily Activity"})]}),s.jsx(rs,{children:"Requests over the last 7 days"})]}),s.jsx(St,{children:s.jsx("div",{className:"flex h-48 items-end gap-2 pt-4",children:o.daily.map(h=>{const N=h.requests/x*100,E=new Date(h.date).toLocaleDateString(void 0,{weekday:"short"});return s.jsxs("div",{className:"group relative flex flex-1 flex-col items-center gap-2",children:[s.jsx("div",{className:"w-full rounded-t-sm bg-blue-500/40 transition-all hover:bg-blue-500/60",style:{height:`${Math.max(N,4)}%`},children:s.jsxs("div",{className:"absolute -top-8 left-1/2 -translate-x-1/2 rounded bg-popover px-2 py-1 text-[10px] opacity-0 transition-opacity group-hover:opacity-100",children:[h.requests," reqs"]})}),s.jsx("span",{className:"text-[10px] text-muted-foreground",children:E})]},h.date)})})})]}),s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl",children:[s.jsxs(At,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(b2,{className:"h-4 w-4 text-muted-foreground"}),s.jsx(da,{className:"text-lg",children:"Providers"})]}),s.jsx(rs,{children:"Requests by backend provider"})]}),s.jsx(St,{children:s.jsxs("div",{className:"space-y-4 pt-2",children:[p.length===0&&s.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:"No provider data available"}),p.map(([h,N])=>{const E=N/b*100;return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"font-medium capitalize",children:h}),s.jsxs("span",{className:"text-muted-foreground",children:[N," (",E.toFixed(1),"%)"]})]}),s.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted/30",children:s.jsx("div",{className:"h-full bg-blue-500/50",style:{width:`${E}%`}})})]},h)})]})})]})]}),s.jsxs(jt,{className:"backdrop-blur-sm bg-card/60 border-border/50 shadow-xl",children:[s.jsxs(At,{children:[s.jsx(da,{className:"text-lg",children:"Model Breakdown"}),s.jsx(rs,{children:"Usage and cost statistics per model"})]}),s.jsx(St,{children:s.jsx("div",{className:"overflow-hidden rounded-md border border-border/50",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-muted/40",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Model"}),s.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Requests"}),s.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Share"}),s.jsx("th",{className:"px-4 py-3 text-right font-medium",children:"Cost"})]})}),s.jsxs("tbody",{className:"divide-y divide-border/40",children:[Object.entries(o.by_model).sort((h,N)=>N[1]-h[1]).map(([h,N])=>{const E=o.cost_by_model?.[h]??0;return s.jsxs("tr",{className:"hover:bg-muted/20 transition-colors",children:[s.jsx("td",{className:"px-4 py-3 font-mono text-xs",children:h}),s.jsx("td",{className:"px-4 py-3 text-right",children:N.toLocaleString()}),s.jsxs("td",{className:"px-4 py-3 text-right text-muted-foreground",children:[(N/o.total_requests*100).toFixed(1),"%"]}),s.jsxs("td",{className:"px-4 py-3 text-right font-medium text-emerald-400",children:["$",E.toFixed(4)]})]},h)}),Object.keys(o.by_model).length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"px-4 py-8 text-center text-muted-foreground",children:"No model usage recorded yet."})})]})]})})})]})]})}const $N={low:{icon:s.jsx(Du,{className:"h-4 w-4"}),label:"Low",description:"2,048 tokens - Fast, minimal reasoning",color:"text-amber-400"},medium:{icon:s.jsx(I2,{className:"h-4 w-4"}),label:"Medium",description:"8,192 tokens - Balanced reasoning",color:"text-blue-400"},high:{icon:s.jsx(K0,{className:"h-4 w-4"}),label:"High",description:"32,768 tokens - Deep reasoning",color:"text-purple-400"},custom:{icon:s.jsx(Hw,{className:"h-4 w-4"}),label:"Custom",description:"Set your own token budget",color:"text-emerald-400"}};function QN(){const{mgmtFetch:l,showToast:o,status:c,isMgmtLoading:u}=Mt(),[f,m]=w.useState(null),[g,v]=w.useState("medium"),[x,p]=w.useState(16e3),[b,h]=w.useState(!0),[N,E]=w.useState(!1),[A,U]=w.useState(!1),G=c?.running??!1,T=w.useCallback(async()=>{try{const _=await l("/v0/management/thinking-budget");m(_),v(_.mode||"medium"),p(_.custom_tokens||16e3),h(_.enabled!==!1),E(!1)}catch(_){_ instanceof ot||console.error("Failed to fetch thinking budget:",_)}},[l]);w.useEffect(()=>{G&&T()},[G,T]);const K=_=>{v(_),E(!0)},q=_=>{const L=parseInt(_,10);!isNaN(L)&&L>0&&(p(L),E(!0))},F=()=>{h(!b),E(!0)},ae=async()=>{U(!0);try{await l("/v0/management/thinking-budget",{method:"PUT",body:JSON.stringify({mode:g,custom_tokens:x,enabled:b})}),o("Thinking budget settings saved","success"),E(!1),await T()}catch(_){o(_ instanceof Error?_.message:String(_),"error")}U(!1)},te=()=>g==="custom"?x:f?.presets?.[g]||8192;return G?s.jsxs(jt,{className:"backdrop-blur-sm bg-[var(--bg-void)] border-[var(--border-default)] shadow-xl",children:[s.jsxs(At,{className:"pb-3 border-b border-[var(--border-subtle)] bg-[var(--bg-panel)]",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Au,{className:`h-4 w-4 ${b?"text-[var(--accent-primary)]":"text-[var(--text-muted)]"}`}),s.jsx(da,{className:"text-sm font-mono uppercase tracking-wider",children:"Thinking Budget"}),u&&s.jsx(ba,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Ne,{size:"sm",variant:"outline",onClick:T,disabled:u,className:"text-xs h-7 font-mono gap-1",children:[s.jsx(ba,{className:"h-3 w-3"}),"REFRESH"]}),s.jsxs(Ne,{size:"sm",onClick:ae,disabled:!N||A,className:`text-xs h-7 font-mono gap-1 ${N?"bg-[var(--accent-primary)] text-white":""}`,children:[A?s.jsx(ba,{className:"h-3 w-3 animate-spin"}):s.jsx(Ps,{className:"h-3 w-3"}),"SAVE"]})]})]}),s.jsx(rs,{className:"text-xs text-[var(--text-muted)]",children:"Configure default thinking budget for reasoning models (Claude, Gemini with thinking)"})]}),s.jsxs(St,{className:"p-4 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[var(--bg-panel)] border border-[var(--border-subtle)]",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-mono text-sm text-[var(--text-primary)]",children:"Enable Thinking"}),s.jsx("div",{className:"text-xs text-[var(--text-muted)]",children:"Allow models to use extended reasoning"})]}),s.jsx("button",{onClick:F,className:`relative w-12 h-6 rounded-full transition-colors ${b?"bg-[var(--accent-primary)]":"bg-[var(--bg-elevated)]"}`,children:s.jsx("span",{className:`absolute top-1 w-4 h-4 rounded-full bg-white transition-transform ${b?"left-7":"left-1"}`})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"block text-[10px] font-mono text-[var(--text-muted)] uppercase tracking-wider",children:"Budget Preset"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:Object.entries($N).map(([_,L])=>s.jsxs("button",{onClick:()=>K(_),disabled:!b,className:`relative p-3 rounded-lg border transition-all text-left ${g===_?"border-[var(--accent-primary)] bg-[var(--accent-primary)]/10":"border-[var(--border-subtle)] bg-[var(--bg-panel)] hover:border-[var(--border-default)]"} ${b?"":"opacity-50 cursor-not-allowed"}`,children:[g===_&&s.jsx("div",{className:"absolute top-2 right-2",children:s.jsx(tl,{className:"h-3 w-3 text-[var(--accent-primary)]"})}),s.jsxs("div",{className:`flex items-center gap-2 ${L.color}`,children:[L.icon,s.jsx("span",{className:"font-mono text-sm font-bold",children:L.label})]}),s.jsx("div",{className:"text-[10px] text-[var(--text-muted)] mt-1",children:L.description})]},_))})]}),g==="custom"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"block text-[10px] font-mono text-[var(--text-muted)] uppercase tracking-wider",children:"Custom Token Budget"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"number",value:x,onChange:_=>q(_.target.value),disabled:!b,min:1024,max:128e3,step:1024,className:"flex-1 px-3 py-2 rounded-lg border border-[var(--border-default)] bg-[var(--bg-elevated)] font-mono text-sm disabled:opacity-50"}),s.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"tokens"})]}),s.jsx("div",{className:"text-[10px] text-[var(--text-muted)]",children:"Recommended range: 1,024 - 128,000 tokens"})]}),s.jsx("div",{className:"p-3 rounded-lg bg-[var(--bg-elevated)] border border-[var(--border-subtle)]",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"text-xs text-[var(--text-muted)]",children:"Effective Thinking Budget"}),s.jsxs("div",{className:`font-mono text-lg font-bold ${b?"text-[var(--accent-primary)]":"text-[var(--text-muted)]"}`,children:[b?te().toLocaleString():"0"," ",s.jsx("span",{className:"text-xs font-normal",children:"tokens"})]})]})}),s.jsxs("div",{className:"text-xs text-[var(--text-muted)] p-3 rounded-lg bg-[var(--bg-panel)] border border-[var(--border-subtle)]",children:[s.jsx("strong",{children:"Note:"})," Thinking budget applies to models that support extended reasoning, including Claude with thinking mode and Gemini Pro/Flash with thinking enabled. Higher budgets allow for more thorough reasoning but consume more tokens."]})]})]}):s.jsxs(jt,{className:"backdrop-blur-sm bg-[var(--bg-void)] border-[var(--border-default)] shadow-xl",children:[s.jsx(At,{className:"pb-3 border-b border-[var(--border-subtle)] bg-[var(--bg-panel)]",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Au,{className:"h-4 w-4 text-[var(--text-muted)]"}),s.jsx(da,{className:"text-sm font-mono uppercase tracking-wider",children:"Thinking Budget"})]})}),s.jsx(St,{className:"p-8 text-center text-[var(--text-muted)]",children:s.jsx("p",{className:"text-xs uppercase tracking-widest",children:"Engine Offline"})})]})}function ZN(){const[l,o]=w.useState(()=>typeof window>"u"?"dark":localStorage.getItem("pp-theme")||"dark");return w.useEffect(()=>{const u=document.documentElement,f=window.matchMedia("(prefers-color-scheme: dark)").matches,m=l==="system"?f?"dark":"light":l;u.classList.remove("light","dark"),u.classList.add(m),localStorage.setItem("pp-theme",l)},[l]),w.useEffect(()=>{if(l!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),f=m=>{const g=document.documentElement;g.classList.remove("light","dark"),g.classList.add(m.matches?"dark":"light")};return u.addEventListener("change",f),()=>u.removeEventListener("change",f)},[l]),{theme:l,setTheme:u=>{o(u)}}}function KN(){const{theme:l,setTheme:o}=ZN(),c=()=>{o(l==="dark"?"light":l==="light"?"system":"dark")};return s.jsxs(Ne,{variant:"ghost",size:"icon-sm",onClick:c,className:"text-muted-foreground hover:text-foreground",title:`Theme: ${l}`,children:[l==="dark"&&s.jsx(hw,{className:"h-4 w-4"}),l==="light"&&s.jsx($w,{className:"h-4 w-4"}),l==="system"&&s.jsx(fw,{className:"h-4 w-4"})]})}function JN({isOpen:l,onClose:o}){const{mgmtFetch:c}=Mt(),[u,f]=w.useState(!1),[m,g]=w.useState(!1),[v,x]=w.useState(null),[p,b]=w.useState("idle"),[h,N]=w.useState(0),[E,A]=w.useState(null);w.useEffect(()=>{(async()=>{try{if(window.pp_get_oauth_private){const _=await window.pp_get_oauth_private();f(_)}}catch(_){console.error("Failed to load OAuth private setting:",_)}})()},[]),w.useEffect(()=>{if(p!=="downloading")return;const L=setInterval(async()=>{try{let Y;if(c)Y=await c("/v0/management/updates/status");else return;if(Y.error){A(Y.error),b("available");return}Y.downloading?N(Y.progress?.percent||0):Y.ready&&(b("ready"),N(100))}catch(Y){console.error("Failed to poll update status:",Y)}},500);return()=>clearInterval(L)},[p,c]);const U=async _=>{try{window.pp_set_oauth_private&&(await window.pp_set_oauth_private(_),f(_),yt.success(_?"Private browsing enabled":"Private browsing disabled"))}catch(L){yt.error(L instanceof Error?L.message:String(L))}},G=async()=>{try{window.pp_open_logs&&(await window.pp_open_logs(),yt.success("Opened logs folder"))}catch(_){yt.error(_ instanceof Error?_.message:String(_))}},T=async()=>{try{window.pp_open_auth_folder&&(await window.pp_open_auth_folder(),yt.success("Opened auth folder"))}catch(_){yt.error(_ instanceof Error?_.message:String(_))}},K=async()=>{try{window.pp_copy_diagnostics&&(await window.pp_copy_diagnostics(),yt.success("Diagnostics copied to clipboard"))}catch(_){yt.error(_ instanceof Error?_.message:String(_))}},q=async()=>{g(!0),b("checking"),A(null);try{let _=null;window.pp_check_updates?_=await window.pp_check_updates():c&&(_=await c("/v0/management/updates/check")),x(_),_?.available?(b("available"),yt.success(`Update available: v${_.version}`)):(b("idle"),yt.success("You are on the latest version"))}catch(_){b("idle"),yt.error(_ instanceof Error?_.message:String(_))}finally{g(!1)}},F=async()=>{if(v?.version){b("downloading"),N(0),A(null);try{c?await c("/v0/management/updates/download",{method:"POST",body:JSON.stringify({version:v.version})}):window.pp_download_update&&(await window.pp_download_update(v.download_url),b("available"),yt.success("Opening download page..."))}catch(_){b("available"),A(_ instanceof Error?_.message:String(_)),yt.error(_ instanceof Error?_.message:String(_))}}},ae=async()=>{b("installing");try{if(c){const _=await c("/v0/management/updates/install",{method:"POST"});if(_?.success)yt.success(_.message||"Update installed! Restarting...");else throw new Error(_?.message||"Installation failed")}}catch(_){b("ready"),A(_ instanceof Error?_.message:String(_)),yt.error(_ instanceof Error?_.message:String(_))}},te=()=>{v?.download_url&&window.open(v.download_url,"_blank")};return l?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-40 animate-in fade-in duration-200",onClick:o}),s.jsxs("div",{className:je("fixed right-0 top-0 bottom-0 w-80 z-50","bg-[var(--bg-panel)] border-l border-[var(--border-subtle)]","shadow-2xl","animate-in slide-in-from-right duration-300"),children:[s.jsxs("div",{className:je("flex items-center justify-between px-5 py-4","border-b border-[var(--border-subtle)]"),children:[s.jsx("h2",{className:"text-sm font-bold uppercase tracking-[0.15em] text-[var(--text-primary)]",style:{fontFamily:"var(--font-display)"},children:"Settings"}),s.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:o,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:s.jsx(ed,{className:"h-4 w-4"})})]}),s.jsxs("div",{className:"p-5 space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--text-muted)]",style:{fontFamily:"var(--font-mono)"},children:"Authentication"}),s.jsxs("div",{className:je("flex items-center justify-between p-3 rounded-lg","bg-[var(--bg-elevated)] border border-[var(--border-subtle)]"),children:[s.jsxs("div",{className:"flex items-center gap-3",children:[u?s.jsx($0,{className:"h-4 w-4 text-[var(--accent-glow)]"}):s.jsx(X0,{className:"h-4 w-4 text-[var(--text-muted)]"}),s.jsxs("div",{children:[s.jsx(ua,{htmlFor:"private-oauth",className:"text-sm text-[var(--text-primary)] cursor-pointer",children:"Private Browsing"}),s.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Use InPrivate mode for OAuth"})]})]}),s.jsx(Bo,{id:"private-oauth",checked:u,onCheckedChange:U})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--text-muted)]",style:{fontFamily:"var(--font-mono)"},children:"Folders"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ne,{variant:"outline",className:"w-full justify-start gap-3",onClick:G,children:[s.jsx(zu,{className:"h-4 w-4"}),"Open Logs Folder"]}),s.jsxs(Ne,{variant:"outline",className:"w-full justify-start gap-3",onClick:T,children:[s.jsx(zu,{className:"h-4 w-4"}),"Open Auth Folder"]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--text-muted)]",style:{fontFamily:"var(--font-mono)"},children:"Diagnostics"}),s.jsxs(Ne,{variant:"outline",className:"w-full justify-start gap-3",onClick:K,children:[s.jsx(L2,{className:"h-4 w-4"}),"Copy Diagnostics"]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--text-muted)]",style:{fontFamily:"var(--font-mono)"},children:"Updates"}),s.jsxs(Ne,{variant:"outline",className:"w-full justify-start gap-3",onClick:q,disabled:m||p==="downloading"||p==="installing",children:[m?s.jsx(Vt,{className:"h-4 w-4 animate-spin"}):s.jsx(ba,{className:"h-4 w-4"}),"Check for Updates"]}),(v||p!=="idle")&&s.jsxs("div",{className:je("p-4 rounded-lg border text-sm space-y-3",p==="ready"||p==="installing"?"bg-emerald-500/10 border-emerald-500/30":v?.available?"bg-[var(--accent-primary)]/10 border-[var(--accent-primary)]/30":"bg-green-500/10 border-green-500/30"),children:[s.jsxs("div",{className:"flex items-start gap-2",children:[p==="ready"?s.jsx(qw,{className:"h-4 w-4 text-emerald-500 mt-0.5 shrink-0"}):p==="installing"?s.jsx(Vt,{className:"h-4 w-4 text-emerald-500 mt-0.5 shrink-0 animate-spin"}):v?.available?s.jsx(Uo,{className:"h-4 w-4 text-[var(--accent-primary)] mt-0.5 shrink-0"}):s.jsx(q0,{className:"h-4 w-4 text-green-500 mt-0.5 shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("p",{className:"font-medium text-[var(--text-primary)]",children:[p==="downloading"&&"Downloading...",p==="ready"&&`v${v?.version} ready to install`,p==="installing"&&"Installing update...",p==="available"&&`v${v?.version} available`,p==="idle"&&!v?.available&&"Up to date"]}),v?.release_notes&&!v?.available&&s.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-1",children:v.release_notes})]})]}),p==="downloading"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-[var(--bg-void)]",children:s.jsx("div",{className:"h-full bg-[var(--accent-primary)] transition-all duration-300",style:{width:`${h}%`}})}),s.jsxs("p",{className:"text-xs text-[var(--text-muted)] text-center",children:[h.toFixed(0),"% complete"]})]}),E&&s.jsx("div",{className:"p-2 rounded bg-red-500/10 border border-red-500/30 text-red-400 text-xs",children:E}),s.jsxs("div",{className:"flex gap-2",children:[p==="available"&&s.jsxs(s.Fragment,{children:[s.jsxs(Ne,{size:"sm",onClick:F,className:"flex-1 gap-2",children:[s.jsx(is,{className:"h-3 w-3"}),"Download & Install"]}),s.jsx(Ne,{size:"sm",variant:"outline",onClick:te,className:"gap-2",children:s.jsx(G0,{className:"h-3 w-3"})})]}),p==="ready"&&s.jsxs(Ne,{size:"sm",onClick:ae,className:"flex-1 gap-2 bg-emerald-600 hover:bg-emerald-500",children:[s.jsx(Q0,{className:"h-3 w-3"}),"Install & Restart"]}),p==="installing"&&s.jsx("div",{className:"flex-1 text-center text-xs text-emerald-400",children:"Please wait, do not close the application..."})]})]})]}),s.jsx("div",{className:"pt-4 border-t border-[var(--border-subtle)]",children:s.jsx("p",{className:"text-xs text-center text-[var(--text-muted)]",style:{fontFamily:"var(--font-mono)"},children:"ProxyPilot v0.1.0"})})]})]})]}):null}function FN({isVisible:l}){return s.jsxs("svg",{viewBox:"0 0 200 12",className:je("absolute left-0 bottom-0 w-full h-3 pointer-events-none","transition-opacity duration-300",l?"opacity-100":"opacity-0"),preserveAspectRatio:"none",children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"flightPathGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",stopColor:"var(--accent-primary)",stopOpacity:"0"}),s.jsx("stop",{offset:"20%",stopColor:"var(--accent-primary)",stopOpacity:"0.6"}),s.jsx("stop",{offset:"80%",stopColor:"var(--accent-glow)",stopOpacity:"0.8"}),s.jsx("stop",{offset:"100%",stopColor:"var(--accent-glow)",stopOpacity:"0"})]})}),s.jsx("path",{d:"M0 6 Q25 2, 50 6 T100 6 T150 6 T200 6",fill:"none",stroke:"url(#flightPathGradient)",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"200",strokeDashoffset:l?"0":"200",className:"transition-all duration-1000 ease-out"}),[40,80,120,160].map(o=>s.jsx("circle",{cx:o,cy:"6",r:"1.5",fill:"var(--accent-glow)",className:je("transition-all duration-500",l?"opacity-60":"opacity-0"),style:{transitionDelay:`${o*3}ms`}},o))]})}function WN({isRunning:l,port:o=8318,version:c="v0.1.0"}){const[u,f]=w.useState(!1),[m,g]=w.useState(!1);return s.jsxs(s.Fragment,{children:[s.jsx(JN,{isOpen:m,onClose:()=>g(!1)}),s.jsxs("header",{className:je("relative h-16 flex items-center justify-between px-6","bg-[var(--bg-panel)] border-b border-[var(--border-subtle)]","before:absolute before:inset-0 before:pointer-events-none","before:bg-gradient-to-b before:from-white/[0.02] before:to-transparent"),children:[s.jsxs("div",{className:"relative flex items-center gap-4",onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[s.jsx("div",{className:je("relative w-11 h-11 flex items-center justify-center","rounded-lg overflow-hidden","shadow-[0_2px_0_0_oklch(0_0_0/0.2)]","transition-all duration-300",u&&"shadow-[0_0_20px_0_var(--accent-glow)]",l&&"animate-glow-pulse"),children:s.jsx("img",{src:"/logo.png",alt:"ProxyPilot",className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"relative flex flex-col",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:je("text-xl font-bold uppercase tracking-[0.2em]","text-[var(--text-primary)]","transition-colors duration-300"),style:{fontFamily:"var(--font-display)"},children:"PROXYPILOT"}),s.jsx("span",{className:je("px-2 py-0.5 rounded text-[10px] font-medium uppercase tracking-wider","bg-[var(--bg-elevated)] border border-[var(--border-subtle)]","text-[var(--text-muted)]"),style:{fontFamily:"var(--font-mono)"},children:c})]}),s.jsx(FN,{isVisible:u})]})]}),s.jsx("div",{className:je("hidden md:block h-8 w-px mx-4","bg-gradient-to-b from-transparent via-[var(--border-default)] to-transparent")}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:je("flex items-center gap-2.5 px-4 py-2 rounded-lg","font-medium text-sm tracking-wide","border transition-all duration-300",l?["bg-[oklch(0.72_0.19_145/0.08)]","border-[oklch(0.72_0.19_145/0.4)]","text-[oklch(0.72_0.19_145)]","shadow-[0_0_16px_0_oklch(0.72_0.19_145/0.25),inset_0_1px_0_0_oklch(0.72_0.19_145/0.1)]"].join(" "):["bg-[var(--bg-elevated)]","border-[var(--border-subtle)]","text-[var(--text-muted)]"].join(" ")),children:[s.jsxs("span",{className:"relative flex items-center justify-center",children:[l&&s.jsx("span",{className:je("absolute w-4 h-4 rounded-full","bg-[oklch(0.72_0.19_145/0.3)]","animate-radar-pulse")}),s.jsx("span",{className:je("relative w-2.5 h-2.5 rounded-full",l?"bg-[oklch(0.72_0.19_145)] shadow-[0_0_8px_0_oklch(0.72_0.19_145)]":"bg-[var(--text-muted)]")})]}),s.jsx("span",{className:"uppercase tracking-wider",style:{fontFamily:"var(--font-mono)"},children:l?"ONLINE":"OFFLINE"}),l&&s.jsxs("span",{className:je("ml-1 px-1.5 py-0.5 rounded text-[10px]","bg-[oklch(0.72_0.19_145/0.15)]","text-[oklch(0.72_0.19_145/0.8)]"),style:{fontFamily:"var(--font-mono)"},children:[":",o]})]}),s.jsx("div",{className:je("h-6 w-px","bg-[var(--border-subtle)]")}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(KN,{}),s.jsx(Ne,{variant:"ghost",size:"icon-sm",onClick:()=>g(!0),className:je("text-[var(--text-muted)]","hover:text-[var(--text-primary)]","hover:bg-[var(--bg-active)]"),title:"Settings",children:s.jsx(Mo,{className:"h-4 w-4"})})]})]}),s.jsx("div",{className:je("absolute bottom-0 left-0 right-0 h-px","bg-gradient-to-r from-transparent via-[var(--accent-primary)] to-transparent","opacity-20")})]})]})}const PN=[{id:"claude",name:"Claude"},{id:"gemini",name:"Gemini"},{id:"codex",name:"Codex"},{id:"qwen",name:"Qwen"},{id:"anthropic",name:"Anthropic"}];function IN(l){const o=Math.floor(l/3600),c=Math.floor(l%3600/60),u=l%60;return`${o.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}`}function ej(l){return l.toLocaleString()}const tj=({version:l="v0.1.0",requestCount:o=0,providerStatus:c})=>{const{status:u,authFiles:f}=Mt(),[m,g]=w.useState(0),[v]=w.useState(()=>Date.now()),x=w.useMemo(()=>c||{claude:f.some(h=>h.toLowerCase().includes("claude")),gemini:f.some(h=>h.toLowerCase().includes("gemini")),codex:f.some(h=>h.toLowerCase().includes("codex")),qwen:f.some(h=>h.toLowerCase().includes("qwen")),anthropic:f.some(h=>h.toLowerCase().includes("anthropic"))},[c,f]);w.useEffect(()=>{const h=setInterval(()=>{g(Math.floor((Date.now()-v)/1e3))},1e3);return()=>clearInterval(h)},[v]);const p=u?.running??!1,b=u?.port??8317;return s.jsxs("div",{className:"instrument-panel",children:[s.jsx("div",{className:"instrument-segment instrument-segment--providers",title:"Provider Status",children:s.jsx("div",{className:"provider-lights",children:PN.map(h=>s.jsx("span",{className:`provider-light ${x[h.id]?"provider-light--active":"provider-light--inactive"}`,title:`${h.name}: ${x[h.id]?"Connected":"Offline"}`},h.id))})}),s.jsxs("div",{className:"instrument-segment",title:"Proxy Port",children:[s.jsx("span",{className:"segment-label",children:"PORT"}),s.jsx("span",{className:"segment-value segment-value--accent",children:b})]}),s.jsxs("div",{className:"instrument-segment",title:"Session Uptime",children:[s.jsx("span",{className:"segment-label",children:"UPTIME"}),s.jsx("span",{className:"segment-value segment-value--uptime",children:IN(m)})]}),s.jsxs("div",{className:"instrument-segment",title:"Total Requests",children:[s.jsx("span",{className:"segment-label",children:"REQ"}),s.jsx("span",{className:"segment-value",children:ej(o)})]}),s.jsx("div",{className:"instrument-segment instrument-segment--version",title:"ProxyPilot Version",children:s.jsx("span",{className:"segment-value segment-value--muted",children:l})}),s.jsx("div",{className:"instrument-segment instrument-segment--status",title:"Proxy Status",children:s.jsxs("span",{className:`status-indicator ${p?"status-indicator--online":"status-indicator--offline"}`,children:[s.jsx("span",{className:"status-dot"}),s.jsx("span",{className:"status-text",children:p?"READY":"OFFLINE"})]})}),s.jsx("style",{children:` - .instrument-panel { - height: 30px; - background: linear-gradient(to bottom, var(--bg-panel), var(--bg-void)); - border-top: 1px solid var(--border-subtle); - display: flex; - align-items: center; - font-family: var(--font-mono); - font-size: 0.65rem; - user-select: none; - } - - .instrument-segment { - display: flex; - align-items: center; - gap: 6px; - padding: 0 12px; - height: 100%; - border-right: 1px solid var(--border-subtle); - background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.05)); - } - - .instrument-segment:last-child { - border-right: none; - } - - .instrument-segment--providers { - padding: 0 10px; - } - - .instrument-segment--version { - margin-left: auto; - border-left: 1px solid var(--border-subtle); - border-right: 1px solid var(--border-subtle); - } - - .instrument-segment--status { - padding: 0 14px; - } - - .provider-lights { - display: flex; - align-items: center; - gap: 5px; - } - - .provider-light { - width: 7px; - height: 7px; - border-radius: 50%; - transition: all 0.3s ease; - } - - .provider-light--active { - background: var(--accent-glow); - box-shadow: 0 0 6px var(--accent-glow), 0 0 10px var(--accent-primary); - } - - .provider-light--inactive { - background: var(--border-subtle); - opacity: 0.6; - } - - .segment-label { - color: var(--text-muted); - font-size: 0.6rem; - letter-spacing: 0.05em; - } - - .segment-value { - color: var(--text-primary); - font-weight: 500; - letter-spacing: 0.02em; - } - - .segment-value--accent { - color: var(--accent-primary); - } - - .segment-value--muted { - color: var(--text-muted); - font-weight: 400; - } - - .segment-value--uptime { - font-variant-numeric: tabular-nums; - min-width: 5.5em; - } - - .status-indicator { - display: flex; - align-items: center; - gap: 6px; - } - - .status-dot { - width: 6px; - height: 6px; - border-radius: 50%; - transition: all 0.3s ease; - } - - .status-indicator--online .status-dot { - background: var(--status-online); - box-shadow: 0 0 6px var(--status-online); - animation: statusPulse 2s ease-in-out infinite; - } - - .status-indicator--offline .status-dot { - background: var(--status-offline); - } - - .status-indicator--online .status-text { - color: var(--status-online); - } - - .status-indicator--offline .status-text { - color: var(--status-offline); - } - - .status-text { - font-weight: 600; - letter-spacing: 0.08em; - } - - @keyframes statusPulse { - 0%, 100% { - opacity: 1; - transform: scale(1); - } - 50% { - opacity: 0.7; - transform: scale(1.15); - } - } - - /* Dark mode adjustments */ - .dark .instrument-segment { - background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.15)); - } - - .dark .provider-light--inactive { - background: var(--border-default); - opacity: 0.4; - } - `})]})},Dp=[{id:"command",icon:Ru,label:"Command",color:"var(--accent-primary)",shortcut:"Ctrl+1"},{id:"providers",icon:ow,label:"Providers",color:"var(--accent-glow)",shortcut:"Ctrl+2"},{id:"routing",icon:tw,label:"Routing",color:"var(--status-processing)",shortcut:"Ctrl+3"},{id:"memory",icon:Y0,label:"Memory",color:"var(--accent-secondary)",shortcut:"Ctrl+4"},{id:"logs",icon:zw,label:"Logs",color:"var(--text-secondary)",shortcut:"Ctrl+5"},{id:"requests",icon:Ko,label:"Monitor",color:"var(--accent-glow)",shortcut:"Ctrl+6"},{id:"analytics",icon:Mu,label:"Analytics",color:"var(--accent-primary)",shortcut:"Ctrl+7"}];function aj({items:l,activeId:o,onSelect:c}){return s.jsxs("nav",{className:"relative flex flex-col items-center py-3 gap-1",style:{width:"64px",minWidth:"64px",height:"100%",backgroundColor:"var(--bg-panel)",borderRight:"1px solid var(--border-subtle)"},children:[s.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-30",style:{backgroundImage:` - linear-gradient(to right, var(--border-subtle) 1px, transparent 1px), - linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px) - `,backgroundSize:"8px 8px"}}),s.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 pointer-events-none opacity-20",style:{top:"12px",bottom:"12px",width:"2px",background:`repeating-linear-gradient( - to bottom, - var(--border-default) 0px, - var(--border-default) 8px, - transparent 8px, - transparent 16px - )`}}),l.map(u=>{const f=u.id===o,m=u.icon,g=u.color||"var(--text-muted)";return s.jsxs("div",{className:"relative group z-10",children:[s.jsxs("button",{onClick:()=>c(u.id),className:je("relative flex items-center justify-center transition-all duration-300 ease-out","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","group-hover:scale-105"),style:{width:"48px",height:"48px",borderRadius:"8px",backgroundColor:f?`color-mix(in srgb, ${g} 15%, transparent)`:"transparent",boxShadow:f?`inset 0 0 12px color-mix(in srgb, ${g} 20%, transparent)`:"none"},"aria-label":u.label,"aria-current":f?"page":void 0,children:[f&&s.jsx("span",{className:"absolute left-0 top-0 bottom-0 rounded-r-sm animate-glow-pulse",style:{width:"3px",backgroundColor:g,boxShadow:`0 0 8px ${g}, 0 0 16px ${g}`}}),s.jsx("div",{className:je("relative flex items-center justify-center transition-all duration-300",f&&"animate-signal-pulse","group-hover:scale-110"),style:{filter:f?`drop-shadow(0 0 8px ${g})`:"none"},children:s.jsx(m,{size:20,className:"transition-all duration-300",style:{color:f?g:"var(--text-muted)",filter:f?void 0:"drop-shadow(0 0 0px transparent)"}})}),s.jsx("span",{className:je("absolute inset-0 rounded-lg transition-all duration-300","opacity-0 group-hover:opacity-100",f&&"group-hover:opacity-0"),style:{backgroundColor:"var(--bg-elevated)",boxShadow:`0 0 15px color-mix(in srgb, ${g} 15%, transparent), inset 0 0 8px color-mix(in srgb, ${g} 10%, transparent)`}})]}),s.jsx("div",{className:je("absolute left-full top-1/2 -translate-y-1/2 ml-3","opacity-0 invisible group-hover:opacity-100 group-hover:visible","transition-all duration-200 ease-out","pointer-events-none z-50"),children:s.jsxs("div",{className:"relative px-3 py-2 rounded",style:{backgroundColor:"var(--bg-void)",border:"1px solid var(--accent-glow)",boxShadow:"0 0 12px color-mix(in srgb, var(--accent-glow) 30%, transparent), 0 4px 16px rgba(0, 0, 0, 0.4)"},children:[s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 whitespace-nowrap",style:{fontFamily:"var(--font-mono)",fontSize:"11px",fontWeight:600,letterSpacing:"0.05em",color:"var(--text-primary)"},children:[s.jsx("span",{style:{color:g},children:"▸"}),s.jsx("span",{children:u.label.toUpperCase()})]}),u.shortcut&&s.jsx("div",{className:"whitespace-nowrap",style:{fontFamily:"var(--font-mono)",fontSize:"9px",color:"var(--text-muted)",letterSpacing:"0.02em",paddingLeft:"14px"},children:u.shortcut})]}),s.jsx("span",{className:"absolute right-full top-1/2 -translate-y-1/2",style:{width:0,height:0,borderTop:"6px solid transparent",borderBottom:"6px solid transparent",borderRight:"6px solid var(--accent-glow)"}}),s.jsx("span",{className:"absolute right-full top-1/2 -translate-y-1/2",style:{width:0,height:0,marginRight:"-1px",borderTop:"5px solid transparent",borderBottom:"5px solid transparent",borderRight:"5px solid var(--bg-void)"}})]})})]},u.id)})]})}function nj(){const{status:l,isDesktop:o,mgmtKey:c}=Mt(),[u,f]=w.useState("command"),m=l?.running??!1;w.useEffect(()=>{const v=x=>{if(x.ctrlKey&&x.key>="1"&&x.key<="7"){x.preventDefault();const p=parseInt(x.key,10)-1,b=Dp[p];b&&f(b.id)}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[]);const g=()=>{switch(u){case"command":return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"grid gap-6 lg:grid-cols-2",children:s.jsx(lN,{})}),s.jsx(ON,{})]});case"providers":return s.jsxs("div",{className:"space-y-6",children:[s.jsx(kN,{}),!o&&!c&&s.jsx("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm text-amber-300",children:"Management key missing. Start ProxyPilot from the tray app to inject a local key, or set `MANAGEMENT_PASSWORD` before loading this page."})]});case"routing":return s.jsx("div",{className:"space-y-6",children:c?s.jsxs(s.Fragment,{children:[s.jsx(LN,{}),s.jsx(QN,{}),s.jsx(GN,{})]}):s.jsx("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm text-amber-300",children:"Management key required to access routing settings."})});case"memory":return s.jsx("div",{className:"space-y-6",children:c?s.jsxs(s.Fragment,{children:[s.jsx(HN,{}),s.jsx(YN,{})]}):s.jsx("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm text-amber-300",children:"Management key required to access memory settings."})});case"logs":return s.jsx("div",{className:"space-y-6",children:c?s.jsx(DN,{}):s.jsx("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm text-amber-300",children:"Management key required to access logs."})});case"requests":return s.jsx("div",{className:"space-y-6",children:c?s.jsx(VN,{}):s.jsx("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm text-amber-300",children:"Management key required to access request monitor."})});case"analytics":return s.jsx("div",{className:"space-y-6",children:c?s.jsx(XN,{}):s.jsx("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm text-amber-300",children:"Management key required to access analytics."})});default:return null}};return s.jsxs("div",{className:"text-foreground transition-colors duration-500",style:{display:"grid",gridTemplateRows:"64px 1fr 32px",gridTemplateColumns:"64px 1fr",height:"100vh",background:"var(--bg-void)"},children:[s.jsx("div",{style:{gridColumn:"1 / -1"},children:s.jsx(WN,{isRunning:m,port:l?.port})}),s.jsx("div",{style:{gridRow:2},children:s.jsx(aj,{items:Dp,activeId:u,onSelect:v=>f(v)})}),s.jsx("main",{className:"animate-fade-in-up",style:{gridRow:2,overflow:"auto",padding:"24px"},children:g()},u),s.jsx("div",{style:{gridColumn:"1 / -1"},children:s.jsx(tj,{})}),s.jsx(i2,{position:"bottom-center",theme:"dark"})]})}function sj(){return s.jsx(U0,{children:s.jsx(c2,{children:s.jsx(nj,{})})})}Ev.createRoot(document.getElementById("root")).render(s.jsx(w.StrictMode,{children:s.jsx(sj,{})})); +// Placeholder - run npm run build in webui directory to generate actual assets +console.log('ProxyPilot dashboard placeholder'); diff --git a/cmd/proxypilotui/assets/index.html b/cmd/proxypilotui/assets/index.html index 3ab3c9ea..ade06f69 100644 --- a/cmd/proxypilotui/assets/index.html +++ b/cmd/proxypilotui/assets/index.html @@ -1,20 +1,13 @@ - + - - - - - - webui - - - - - - - - - + + + + + ProxyPilot + +
- +

Run npm run build in the webui directory to build the dashboard.

+ diff --git a/cmd/proxypilotui/main_windows.go b/cmd/proxypilotui/main_windows.go deleted file mode 100644 index 351c5896..00000000 --- a/cmd/proxypilotui/main_windows.go +++ /dev/null @@ -1,1173 +0,0 @@ -//go:build windows - -package main - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "io/fs" - "net" - "net/http" - "os" - "os/exec" - "path/filepath" - "strings" - "syscall" - "time" - "unsafe" - - "github.com/jchv/go-webview2" - "github.com/router-for-me/CLIProxyAPI/v6/cmd/proxypilotui/assets" - "github.com/router-for-me/CLIProxyAPI/v6/internal/desktopctl" - "github.com/router-for-me/CLIProxyAPI/v6/internal/logging" - _ "github.com/router-for-me/CLIProxyAPI/v6/internal/translator" -) - -func main() { - var repoRoot string - var configPath string - var exePath string - var url string - var standalone bool - var legacyMode bool - flag.StringVar(&repoRoot, "repo", "", "Repo root (used to locate bin/ and logs/)") - flag.StringVar(&configPath, "config", "", "Path to config.yaml (defaults to /config.yaml)") - flag.StringVar(&exePath, "exe", "", "Path to proxy engine binary (legacy mode only)") - flag.StringVar(&url, "url", "", "Open a specific URL in-app (advanced)") - flag.BoolVar(&standalone, "standalone", false, "Run standalone UI without connecting to proxy server") - flag.BoolVar(&legacyMode, "legacy", false, "Use legacy subprocess mode (separate engine binary)") - flag.Parse() - - // Enable embedded mode by default (single binary) - if !legacyMode { - desktopctl.SetEmbeddedMode(true) - logging.SetupBaseLogger() - } - - repoRoot, configPath, exePath = applyDefaults(repoRoot, configPath, exePath) - - var assetServerURL string - if standalone { - // Start embedded asset server - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - _ = messageBox("ProxyPilot", "Failed to start asset server: "+err.Error()) - os.Exit(1) - } - assetServerURL = "http://" + ln.Addr().String() - go func() { - fsys, _ := fs.Sub(assets.FS, ".") - http.Serve(ln, http.FileServer(http.FS(fsys))) - }() - } else { - st, _ := desktopctl.StatusFor(configPath) - if !st.Running { - _, _ = desktopctl.Start(desktopctl.StartOptions{RepoRoot: repoRoot, ConfigPath: configPath, ExePath: exePath}) - deadline := time.Now().Add(5 * time.Second) - for time.Now().Before(deadline) { - st, _ = desktopctl.StatusFor(configPath) - if st.Running { - break - } - time.Sleep(200 * time.Millisecond) - } - } - - if !st.Running || strings.TrimSpace(st.BaseURL) == "" { - _ = messageBox("ProxyPilot", "Proxy is not running.\n\nClick Start in the ProxyPilot tray menu, then try again.") - os.Exit(1) - } - } - - if strings.TrimSpace(url) == "" { - url = "control" - } - - var target string - if standalone { - if strings.EqualFold(strings.TrimSpace(url), "control") { - target = assetServerURL + "/index.html" - } else if strings.HasPrefix(strings.TrimSpace(url), "http://") || strings.HasPrefix(strings.TrimSpace(url), "https://") { - target = strings.TrimSpace(url) - } else { - target = assetServerURL + "/index.html" - } - } else { - st, _ := desktopctl.StatusFor(configPath) - if strings.EqualFold(strings.TrimSpace(url), "control") { - target = st.BaseURL + "/proxypilot.html" - } else if strings.HasPrefix(strings.TrimSpace(url), "http://") || strings.HasPrefix(strings.TrimSpace(url), "https://") { - target = strings.TrimSpace(url) - } - } - - // Prefer an in-app window (WebView2) so this behaves like a native dashboard app. - w := webview2.NewWithOptions(webview2.WebViewOptions{ - Debug: true, - AutoFocus: true, - WindowOptions: webview2.WindowOptions{ - Title: "ProxyPilot", - Width: 1200, - Height: 850, - Center: true, - }, - }) - if w == nil { - // Fallback: Edge app mode or default browser. - if target == "" { - if standalone { - target = assetServerURL + "/index.html" - } else { - st, _ := desktopctl.StatusFor(configPath) - target = st.BaseURL + "/proxypilot.html" - } - } - edge, err := findEdge() - if err != nil { - _ = exec.Command("rundll32", "url.dll,FileProtocolHandler", target).Start() - return - } - _ = exec.Command(edge, "--app="+target, "--window-size=1200,850", "--lang=en-US").Start() - return - } - defer w.Destroy() - w.SetSize(1200, 850, webview2.HintNone) - - // Bindings used by the Control Center UI. - _ = w.Bind("pp_status", func() (map[string]any, error) { - cur, _ := desktopctl.StatusFor(configPath) - return map[string]any{ - "running": cur.Running, - "version": cur.Version, - "port": cur.Port, - "thinking_port": cur.ThinkingPort, - "thinking_running": cur.ThinkingRunning, - "base_url": cur.BaseURL, - "last_error": cur.LastError, - }, nil - }) - _ = w.Bind("pp_start", func() error { - _, err := desktopctl.Start(desktopctl.StartOptions{RepoRoot: repoRoot, ConfigPath: configPath, ExePath: exePath}) - return err - }) - _ = w.Bind("pp_stop", func() error { return desktopctl.Stop(desktopctl.StopOptions{}) }) - _ = w.Bind("pp_restart", func() error { - _, err := desktopctl.Restart(desktopctl.StartOptions{RepoRoot: repoRoot, ConfigPath: configPath, ExePath: exePath}) - return err - }) - _ = w.Bind("pp_open_logs", func() error { return desktopctl.OpenLogsFolder(repoRoot, configPath) }) - _ = w.Bind("pp_open_auth_folder", func() error { - dir, err := desktopctl.AuthDirFor(configPath) - if err != nil { - return err - } - return desktopctl.OpenFolder(dir) - }) - _ = w.Bind("pp_open_legacy_ui", func() error { - cur, _ := desktopctl.StatusFor(configPath) - if !cur.Running || strings.TrimSpace(cur.BaseURL) == "" { - return fmt.Errorf("proxy is not running") - } - return openNewWindow(repoRoot, configPath, exePath, cur.BaseURL+"/management.html?legacy=1") - }) - _ = w.Bind("pp_open_diagnostics", func() error { - cur, _ := desktopctl.StatusFor(configPath) - if !cur.Running || strings.TrimSpace(cur.BaseURL) == "" { - return fmt.Errorf("proxy is not running") - } - return openNewWindow(repoRoot, configPath, exePath, cur.BaseURL+"/proxypilot.html") - }) - _ = w.Bind("pp_get_oauth_private", func() (bool, error) { return desktopctl.GetOAuthPrivate() }) - _ = w.Bind("pp_set_oauth_private", func(enabled bool) error { return desktopctl.SetOAuthPrivate(enabled) }) - _ = w.Bind("pp_oauth", func(provider string) error { - endpoint := "" - switch strings.ToLower(strings.TrimSpace(provider)) { - case "antigravity": - endpoint = "/v0/management/antigravity-auth-url" - case "gemini-cli", "geminicli": - endpoint = "/v0/management/gemini-cli-auth-url" - case "codex": - endpoint = "/v0/management/codex-auth-url" - case "claude", "anthropic": - endpoint = "/v0/management/anthropic-auth-url" - case "qwen": - endpoint = "/v0/management/qwen-auth-url" - case "kiro": - endpoint = "/v0/management/kiro-auth-url" - default: - return fmt.Errorf("unknown provider: %s", provider) - } - return startOAuthFlow(configPath, endpoint) - }) - _ = w.Bind("pp_import_amazonq", func() error { - return importAmazonQToken(configPath) - }) - _ = w.Bind("pp_save_api_key", func(provider, apiKey string) error { - return saveAPIKey(configPath, provider, apiKey) - }) - _ = w.Bind("pp_copy_diagnostics", func() error { return copyDiagnosticsToClipboard(configPath) }) - _ = w.Bind("pp_get_management_key", func() (string, error) { return desktopctl.GetManagementPassword() }) - - _ = w.Bind("pp_check_updates", func() (map[string]any, error) { - st, _ := desktopctl.StatusFor(configPath) - if !st.Running { - return nil, fmt.Errorf("proxy not running") - } - key, _ := desktopctl.GetManagementPassword() - client := &http.Client{Timeout: 10 * time.Second} - req, _ := http.NewRequest("GET", st.BaseURL+"/v0/management/updates/check", nil) - req.Header.Set("X-Management-Key", key) - resp, err := client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - var res map[string]any - if err := json.NewDecoder(resp.Body).Decode(&res); err != nil { - return nil, err - } - return res, nil - }) - - _ = w.Bind("pp_download_update", func(url string) error { - return desktopctl.OpenBrowser(url) - }) - - // Integration bindings - _ = w.Bind("pp_get_integrations", func() ([]map[string]any, error) { - st, _ := desktopctl.StatusFor(configPath) - if !st.Running { - return nil, fmt.Errorf("proxy not running") - } - key, _ := desktopctl.GetManagementPassword() - client := &http.Client{Timeout: 5 * time.Second} - req, _ := http.NewRequest("GET", st.BaseURL+"/v0/management/integrations", nil) - req.Header.Set("X-Management-Key", key) - resp, err := client.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - var res struct { - Integrations []map[string]any `json:"integrations"` - } - if err := json.NewDecoder(resp.Body).Decode(&res); err != nil { - return nil, err - } - return res.Integrations, nil - }) - - _ = w.Bind("pp_configure_integration", func(id string) error { - st, _ := desktopctl.StatusFor(configPath) - if !st.Running { - return fmt.Errorf("proxy not running") - } - key, _ := desktopctl.GetManagementPassword() - client := &http.Client{Timeout: 10 * time.Second} - req, _ := http.NewRequest("POST", st.BaseURL+"/v0/management/integrations/"+id, nil) - req.Header.Set("X-Management-Key", key) - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - if resp.StatusCode != 200 { - b, _ := io.ReadAll(resp.Body) - return fmt.Errorf("failed: %s", string(b)) - } - return nil - }) - - // Agent detection bindings - _ = w.Bind("pp_detect_agents", func() ([]map[string]any, error) { - agents := detectCLIAgents() - return agents, nil - }) - - _ = w.Bind("pp_configure_agent", func(agentID string) error { - st, _ := desktopctl.StatusFor(configPath) - if !st.Running { - return fmt.Errorf("proxy not running") - } - key, _ := desktopctl.GetManagementPassword() - client := &http.Client{Timeout: 10 * time.Second} - req, _ := http.NewRequest("POST", st.BaseURL+"/v0/management/integrations/"+agentID, nil) - req.Header.Set("X-Management-Key", key) - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - if resp.StatusCode != 200 { - b, _ := io.ReadAll(resp.Body) - return fmt.Errorf("failed: %s", string(b)) - } - return nil - }) - - // Model mappings bindings - _ = w.Bind("pp_get_model_mappings", func() ([]map[string]any, error) { - return getModelMappings(), nil - }) - - _ = w.Bind("pp_save_model_mappings", func(mappings []map[string]any) error { - return saveModelMappings(mappings) - }) - - if target != "" { - w.Navigate(target) - w.Run() - return - } - - w.SetHtml(controlCenterHTML()) - w.Run() -} - -func findEdge() (string, error) { - if p, err := exec.LookPath("msedge.exe"); err == nil && strings.TrimSpace(p) != "" { - return p, nil - } - if p, err := exec.LookPath("msedge"); err == nil && strings.TrimSpace(p) != "" { - return p, nil - } - candidates := []string{ - filepath.Join(os.Getenv("ProgramFiles(x86)"), "Microsoft", "Edge", "Application", "msedge.exe"), - filepath.Join(os.Getenv("ProgramFiles"), "Microsoft", "Edge", "Application", "msedge.exe"), - } - for _, c := range candidates { - if strings.TrimSpace(c) == "" { - continue - } - if _, err := os.Stat(c); err == nil { - return c, nil - } - } - return "", fmt.Errorf("msedge.exe not found") -} - -func applyDefaults(repoRoot, configPath, exePath string) (string, string, string) { - repoRoot = strings.TrimSpace(repoRoot) - configPath = strings.TrimSpace(configPath) - exePath = strings.TrimSpace(exePath) - - exe, _ := os.Executable() - exeDir := "" - if strings.TrimSpace(exe) != "" { - exeDir = filepath.Dir(filepath.Clean(exe)) - } - - // If launched from a repo/app "bin" directory, treat its parent as the root. - defaultRoot := exeDir - if strings.EqualFold(filepath.Base(defaultRoot), "bin") { - defaultRoot = filepath.Dir(defaultRoot) - } - - if repoRoot == "" && defaultRoot != "" { - repoRoot = defaultRoot - } - - if configPath == "" && exeDir != "" { - configPath = filepath.Join(repoRoot, "config.yaml") - } - - if exePath == "" && exeDir != "" { - for _, name := range []string{"proxypilot-engine.exe", "cliproxyapi-latest.exe"} { - cand := filepath.Join(exeDir, name) - if _, err := os.Stat(cand); err == nil { - exePath = cand - break - } - } - } - - return repoRoot, configPath, exePath -} - -func openNewWindow(repoRoot, configPath, exePath, url string) error { - exe, err := os.Executable() - if err != nil || strings.TrimSpace(exe) == "" { - return desktopctl.OpenBrowser(url) - } - args := []string{"-url", url} - if strings.TrimSpace(repoRoot) != "" { - args = append(args, "-repo", repoRoot) - } - if strings.TrimSpace(configPath) != "" { - args = append(args, "-config", configPath) - } - if strings.TrimSpace(exePath) != "" { - args = append(args, "-exe", exePath) - } - return exec.Command(exe, args...).Start() -} - -type authURLResponse struct { - Status string `json:"status"` - URL string `json:"url"` - State string `json:"state"` - Error string `json:"error"` -} - -func startOAuthFlow(configPath string, endpointPath string) error { - st, _ := desktopctl.StatusFor(configPath) - if !st.Running || strings.TrimSpace(st.BaseURL) == "" { - return fmt.Errorf("proxy is not running") - } - key, err := desktopctl.GetManagementPassword() - if err != nil { - return err - } - - client := &http.Client{Timeout: 15 * time.Second} - req, err := http.NewRequest(http.MethodGet, st.BaseURL+endpointPath, nil) - if err != nil { - return err - } - req.Header.Set("X-Management-Key", key) - - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - var out authURLResponse - if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { - return err - } - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - if strings.TrimSpace(out.Error) != "" { - return fmt.Errorf("%s", out.Error) - } - return fmt.Errorf("auth url request failed: %s", resp.Status) - } - if strings.TrimSpace(out.URL) == "" { - return fmt.Errorf("missing auth url") - } - - private, _ := desktopctl.GetOAuthPrivate() - return openOAuthURL(out.URL, private) -} - -func importAmazonQToken(configPath string) error { - st, _ := desktopctl.StatusFor(configPath) - if !st.Running || strings.TrimSpace(st.BaseURL) == "" { - return fmt.Errorf("proxy is not running") - } - key, err := desktopctl.GetManagementPassword() - if err != nil { - return err - } - - client := &http.Client{Timeout: 30 * time.Second} - req, err := http.NewRequest(http.MethodPost, st.BaseURL+"/v0/management/amazonq-import", nil) - if err != nil { - return err - } - req.Header.Set("X-Management-Key", key) - - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - var out map[string]any - if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { - return err - } - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - if errMsg, ok := out["error"].(string); ok && errMsg != "" { - return fmt.Errorf("%s", errMsg) - } - if msg, ok := out["message"].(string); ok && msg != "" { - return fmt.Errorf("%s", msg) - } - return fmt.Errorf("import failed: %s", resp.Status) - } - return nil -} - -func saveAPIKey(configPath, provider, apiKey string) error { - st, _ := desktopctl.StatusFor(configPath) - if !st.Running || strings.TrimSpace(st.BaseURL) == "" { - return fmt.Errorf("proxy is not running") - } - key, err := desktopctl.GetManagementPassword() - if err != nil { - return err - } - - var endpoint string - switch provider { - case "minimax": - endpoint = "/v0/management/minimax-api-key" - case "zhipu": - endpoint = "/v0/management/zhipu-api-key" - default: - return fmt.Errorf("unknown provider: %s", provider) - } - - body := fmt.Sprintf(`{"api_key":"%s"}`, apiKey) - client := &http.Client{Timeout: 15 * time.Second} - req, err := http.NewRequest(http.MethodPost, st.BaseURL+endpoint, strings.NewReader(body)) - if err != nil { - return err - } - req.Header.Set("X-Management-Key", key) - req.Header.Set("Content-Type", "application/json") - - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - var out map[string]any - if err := json.NewDecoder(resp.Body).Decode(&out); err != nil { - return err - } - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - if errMsg, ok := out["error"].(string); ok && errMsg != "" { - return fmt.Errorf("%s", errMsg) - } - return fmt.Errorf("save failed: %s", resp.Status) - } - return nil -} - -func openOAuthURL(url string, private bool) error { - if !private { - return desktopctl.OpenBrowser(url) - } - edge, err := findEdge() - if err != nil { - return desktopctl.OpenBrowser(url) - } - return exec.Command(edge, "--inprivate", url).Start() -} - -func copyDiagnosticsToClipboard(configPath string) error { - st, _ := desktopctl.StatusFor(configPath) - if !st.Running || strings.TrimSpace(st.BaseURL) == "" { - return fmt.Errorf("proxy is not running") - } - key, err := desktopctl.GetManagementPassword() - if err != nil { - return err - } - - client := &http.Client{Timeout: 15 * time.Second} - req, err := http.NewRequest(http.MethodGet, st.BaseURL+"/v0/management/proxypilot/diagnostics?lines=200", nil) - if err != nil { - return err - } - req.Header.Set("X-Management-Key", key) - - resp, err := client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - b, _ := io.ReadAll(resp.Body) - msg := strings.TrimSpace(string(b)) - if msg == "" { - msg = resp.Status - } - return fmt.Errorf("diagnostics failed: %s", msg) - } - - var payload struct { - Text string `json:"text"` - } - if err := json.NewDecoder(resp.Body).Decode(&payload); err != nil { - return err - } - if strings.TrimSpace(payload.Text) == "" { - return fmt.Errorf("empty diagnostics") - } - return copyToClipboard(payload.Text) -} - -func copyToClipboard(text string) error { - cmd := exec.Command("cmd", "/c", "clip") - cmd.Stdin = strings.NewReader(text) - return cmd.Run() -} - -func controlCenterHTML() string { - return ` - - - - - ProxyPilot - - - -
-
-
- -
-

ProxyPilot

-
Local proxy controller + dashboard (Windows)
-
-
-
- - Checking… -
-
- -
-
-
Engine
-
- - - - - -
-
-
Base URL
-
-
Port
-
-
Thinking Port
-
-
Last error
-
-
-
- - - -
-
- - -
-
- Tip: keep the tray menu minimal — use this Control Center for day-to-day actions. -
-
- -
-
Logins
-
- - - - - - - - - -
-
OAuth providers open browser login. Amazon Q imports from CLI. MiniMax/Zhipu require API keys.
-
- -
-
CLI Agents
-
-
Detecting agents...
-
-
- Detected CLI agents. Click to configure for ProxyPilot. -
-
- -
-
Model Mappings
-
-
- - - -
-
- Route friendly model names to actual models. -
-
- -
-
Integrations
-
-
Loading integrations...
-
-
- Automatically configure local tools to use ProxyPilot. -
-
- -
-
Live Logs
-
Waiting for logs...
-
- - -
-
-
-
- -
- - -` -} - -func messageBox(title, text string) error { - user32 := syscall.NewLazyDLL("user32.dll") - proc := user32.NewProc("MessageBoxW") - t, _ := syscall.UTF16PtrFromString(title) - m, _ := syscall.UTF16PtrFromString(text) - // MB_OK | MB_ICONERROR - _, _, err := proc.Call(0, uintptr(unsafe.Pointer(m)), uintptr(unsafe.Pointer(t)), 0x00000000|0x00000010) - if err == syscall.Errno(0) { - return nil - } - return err -} - -// detectCLIAgents returns a list of detected CLI agents -func detectCLIAgents() []map[string]any { - agents := []map[string]any{} - - // Claude Code - claude := map[string]any{ - "id": "claude", - "name": "Claude Code", - "detected": false, - "configured": false, - } - if path, err := exec.LookPath("claude"); err == nil { - claude["detected"] = true - claude["binary_path"] = path - } - home, _ := os.UserHomeDir() - claudeConfig := filepath.Join(home, ".claude", "settings.json") - if _, err := os.Stat(claudeConfig); err == nil { - claude["detected"] = true - claude["config_path"] = claudeConfig - if content, err := os.ReadFile(claudeConfig); err == nil { - if strings.Contains(string(content), "127.0.0.1:8317") || strings.Contains(string(content), "127.0.0.1:8318") { - claude["configured"] = true - } - } - } - agents = append(agents, claude) - - // Codex CLI - codex := map[string]any{ - "id": "codex", - "name": "Codex CLI", - "detected": false, - "configured": false, - } - if path, err := exec.LookPath("codex"); err == nil { - codex["detected"] = true - codex["binary_path"] = path - } - codexDir := filepath.Join(home, ".codex") - if info, err := os.Stat(codexDir); err == nil && info.IsDir() { - codex["detected"] = true - codex["config_path"] = codexDir - codexConfig := filepath.Join(codexDir, "config.toml") - if content, err := os.ReadFile(codexConfig); err == nil { - if strings.Contains(string(content), "127.0.0.1:8317") || strings.Contains(string(content), "127.0.0.1:8318") { - codex["configured"] = true - } - } - } - agents = append(agents, codex) - - // Factory Droid - droid := map[string]any{ - "id": "droid", - "name": "Factory Droid", - "detected": false, - "configured": false, - } - if path, err := exec.LookPath("droid"); err == nil { - droid["detected"] = true - droid["binary_path"] = path - } else if path, err := exec.LookPath("factory"); err == nil { - droid["detected"] = true - droid["binary_path"] = path - } - // Droid uses settings.json for runtime config (not config.json) - droidSettings := filepath.Join(home, ".factory", "settings.json") - if _, err := os.Stat(droidSettings); err == nil { - droid["config_path"] = droidSettings - droid["detected"] = true - if content, err := os.ReadFile(droidSettings); err == nil { - // Check for ProxyPilot models in customModels array - if strings.Contains(string(content), "ProxyPilot") || strings.Contains(string(content), "127.0.0.1:8318") { - droid["configured"] = true - } - } - } - agents = append(agents, droid) - - // Gemini CLI - gemini := map[string]any{ - "id": "gemini", - "name": "Gemini CLI", - "detected": false, - "configured": false, - } - if path, err := exec.LookPath("gemini"); err == nil { - gemini["detected"] = true - gemini["binary_path"] = path - } - agents = append(agents, gemini) - - return agents -} - -// getModelMappings reads model mappings from the config file -func getModelMappings() []map[string]any { - home, _ := os.UserHomeDir() - mappingsPath := filepath.Join(home, ".proxypilot", "model-mappings.json") - - data, err := os.ReadFile(mappingsPath) - if err != nil { - return []map[string]any{} - } - - var mappings []map[string]any - if err := json.Unmarshal(data, &mappings); err != nil { - return []map[string]any{} - } - return mappings -} - -// saveModelMappings saves model mappings to the config file -func saveModelMappings(mappings []map[string]any) error { - home, _ := os.UserHomeDir() - mappingsDir := filepath.Join(home, ".proxypilot") - if err := os.MkdirAll(mappingsDir, 0755); err != nil { - return err - } - - mappingsPath := filepath.Join(mappingsDir, "model-mappings.json") - data, err := json.MarshalIndent(mappings, "", " ") - if err != nil { - return err - } - return os.WriteFile(mappingsPath, data, 0644) -} diff --git a/docs/desktop-app-build-process.md b/docs/desktop-app-build-process.md index 590013de..78b5dd3f 100644 --- a/docs/desktop-app-build-process.md +++ b/docs/desktop-app-build-process.md @@ -1,58 +1,60 @@ -# ProxyPilot Desktop App Build Process +# ProxyPilot CLI + Tray Build Process -Documentation of the desktop application build and release process established on December 27, 2025. +Documentation of the CLI and system tray application build and release process. ## Overview -ProxyPilot Desktop is a **single executable** that includes both the system tray UI and the proxy engine: -- **ProxyPilot.exe** - System tray app with embedded WebView2 dashboard and embedded proxy engine +ProxyPilot uses a **CLI + system tray architecture**: +- **proxypilot.exe** - CLI executable with all proxy functionality +- **ProxyPilot.exe** - System tray app that manages the CLI process and provides quick access to controls + +The dashboard is accessed via web browser at `http://127.0.0.1:/proxypilot.html`. ## Architecture ``` ┌─────────────────────────────────────────────────────────────────┐ -│ ProxyPilot.exe │ -│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │ -│ │ System Tray │ │ WebView2 │ │ Embedded Assets │ │ -│ │ (systray) │ │ Dashboard │ │ (webui/dist) │ │ -│ └─────────────┘ └─────────────┘ └─────────────────────────┘ │ +│ ProxyPilot System │ │ │ -│ ┌─────────────────────────────────────────────────────────────┐│ -│ │ Embedded Proxy Engine (goroutine) ││ -│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ ││ -│ │ │Thinking Proxy│ │ Routing │ │ Provider Auth │ ││ -│ │ │ (port 8317) │ │ Engine │ │ Management │ ││ -│ │ └─────────────┘ └─────────────┘ └─────────────────────┘ ││ -│ └─────────────────────────────────────────────────────────────┘│ +│ ┌─────────────────────┐ ┌─────────────────────────────┐ │ +│ │ ProxyPilot.exe │ │ proxypilot.exe │ │ +│ │ (System Tray) │─────▶│ (CLI / Engine) │ │ +│ │ │ │ │ │ +│ │ - Start/Stop │ │ - Proxy Engine (port 8317) │ │ +│ │ - Open Dashboard │ │ - Web Dashboard Server │ │ +│ │ - Copy API URL │ │ - Provider Auth Mgmt │ │ +│ │ - Autostart toggle │ │ - Routing Engine │ │ +│ └─────────────────────┘ └─────────────────────────────┘ │ +│ │ +│ ┌─────────────────────┐ │ +│ │ Web Browser │ │ +│ │ (Dashboard UI) │ │ +│ │ proxypilot.html │ │ +│ └─────────────────────┘ │ └─────────────────────────────────────────────────────────────────┘ ``` -### In-Process Engine +### CLI + Tray Separation -The proxy engine runs as a goroutine within the same process, managed by `EmbeddedEngine`: +The architecture separates concerns: -```go -// cmd/cliproxytray/engine.go -type EmbeddedEngine struct { - mu sync.Mutex - service *cliproxy.Service - cancel context.CancelFunc - running bool - port int - // ... -} +**proxypilot.exe (CLI)**: +- All proxy engine functionality +- Serves web dashboard at `/proxypilot.html` +- Can run standalone from command line +- Supports all CLI flags (`--help`, `--setup-claude`, etc.) -func (e *EmbeddedEngine) Start(cfg *config.Config, configPath, password string) error -func (e *EmbeddedEngine) Stop() error -func (e *EmbeddedEngine) Restart(cfg *config.Config, configPath, password string) error -func (e *EmbeddedEngine) Status() Status -``` +**ProxyPilot.exe (Tray)**: +- Lightweight system tray wrapper +- Manages CLI process lifecycle (start/stop/restart) +- Opens dashboard in default browser +- Provides quick-access menu -Benefits of single-binary architecture: -- **Simpler deployment**: One file to distribute and install -- **Smaller total size**: ~29MB vs ~46MB (shared Go runtime) -- **Faster startup**: No process spawning overhead -- **Easier debugging**: Single process to monitor +Benefits of CLI + tray architecture: +- **Flexibility**: Use CLI directly or via tray app +- **No WebView2 dependency**: Dashboard runs in any browser +- **Simpler debugging**: Inspect network/console in browser DevTools +- **Cross-platform dashboard**: Same web UI works on all platforms ## Build Process @@ -73,7 +75,7 @@ npm install npm run build ``` -This generates `webui/dist/` with the dashboard assets. +This generates `webui/dist/` with the dashboard assets that are served by the CLI at `/proxypilot.html`. ### Step 2: Create Multi-Resolution Icon @@ -106,10 +108,13 @@ goversioninfo -icon="../../static/icon.ico" This creates `resource.syso` files that Go automatically includes during build. -### Step 4: Build Executable +### Step 4: Build Executables ```bash -# Build single-binary tray app (with -H windowsgui to hide console) +# Build CLI executable +GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o dist/proxypilot.exe ./cmd/server + +# Build tray app (with -H windowsgui to hide console) GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -H windowsgui" -o dist/ProxyPilot.exe ./cmd/cliproxytray ``` @@ -134,7 +139,7 @@ Output: `dist/ProxyPilot-0.1.0-Setup.exe` "ProductVersion": {"Major": 0, "Minor": 1, "Patch": 0, "Build": 0} }, "StringFileInfo": { - "FileDescription": "ProxyPilot Desktop App", + "FileDescription": "ProxyPilot System Tray", "ProductName": "ProxyPilot", "ProductVersion": "0.1.0" }, @@ -142,12 +147,12 @@ Output: `dist/ProxyPilot-0.1.0-Setup.exe` } ``` -### Embedded Engine +### Tray Process Manager -**cmd/cliproxytray/engine.go** - Manages the in-process proxy service: -- Uses `cliproxy.NewBuilder()` SDK to build the service -- Runs in a goroutine with cancellable context -- Thread-safe start/stop/restart operations +**cmd/cliproxytray/engine.go** - Manages the CLI process: +- Spawns/stops `proxypilot.exe` subprocess +- Monitors process health +- Passes configuration and management password ### Tray Icon Embedding @@ -170,8 +175,8 @@ func ProxyPilotICO() []byte { ### Installer Script **installer/proxypilot.iss** - Inno Setup script that: -- Installs ProxyPilot.exe to `%LOCALAPPDATA%\ProxyPilot` -- Creates Start Menu and Desktop shortcuts +- Installs `proxypilot.exe` and `ProxyPilot.exe` to `%LOCALAPPDATA%\ProxyPilot` +- Creates Start Menu shortcut - Adds optional Windows startup entry - Copies config.example.yaml and creates config.yaml on first install - Uses ProxyPilot icon for installer and shortcuts @@ -182,12 +187,12 @@ Simplified flat menu structure: ``` ┌─────────────────────┐ -│ Open Dashboard │ → Opens WebView2 window +│ Open Dashboard │ → Opens browser to proxypilot.html ├─────────────────────┤ -│ Start/Stop │ → Toggle proxy engine +│ Start/Stop │ → Toggle proxy engine (CLI process) │ Copy API URL │ → Copies http://127.0.0.1:8317/v1 ├─────────────────────┤ -│ Quit │ → Exit application +│ Quit │ → Stop engine and exit └─────────────────────┘ ``` @@ -228,11 +233,11 @@ gh release upload v0.1.0 dist/ProxyPilot.exe 3. Verify resource.syso was generated after icon update 4. Rebuild the executable -### WebView2 Dashboard Not Loading +### Dashboard Not Loading in Browser -1. Ensure WebView2 runtime is installed on the system -2. Check that webui/dist/ assets are embedded (go:embed directive) -3. Verify the asset server is starting on a free port +1. Ensure the CLI process is running (check tray status) +2. Verify the port is correct: `http://127.0.0.1:8317/proxypilot.html` +3. Check for port conflicts with another application ### Tray Icon Shows Wrong Image @@ -251,9 +256,11 @@ gh release upload v0.1.0 dist/ProxyPilot.exe ``` ProxyPilot/ ├── cmd/ +│ ├── server/ +│ │ └── main.go # CLI entry point │ └── cliproxytray/ -│ ├── main_windows.go # Tray app with embedded engine -│ ├── engine.go # EmbeddedEngine implementation +│ ├── main_windows.go # Tray app entry point +│ ├── engine.go # CLI process manager │ ├── versioninfo.json # Version/icon config │ └── resource.syso # Compiled resources ├── internal/ @@ -265,23 +272,29 @@ ProxyPilot/ │ └── icon.png # Original PNG logo ├── webui/ │ ├── src/ # React dashboard source -│ └── dist/ # Built assets (embedded) +│ └── dist/ # Built assets (served by CLI) ├── installer/ │ └── proxypilot.iss # Inno Setup script └── dist/ # Distribution files - └── ProxyPilot.exe # Single-binary (~29MB) + ├── proxypilot.exe # CLI executable + └── ProxyPilot.exe # Tray app ``` ## Version History +- **v0.3.0** (2025-12-30) - CLI + Tray architecture + - Removed WebView2 dependency + - Dashboard served by CLI, opened in browser + - Tray app manages CLI subprocess + - Simplified deployment and debugging + - **v0.2.0** (2025-12-27) - Single-binary architecture - Embedded proxy engine runs in-process - Removed separate proxypilot-engine.exe - Reduced total size from ~46MB to ~29MB - Faster startup with no process spawning -- **v0.1.0** (2025-12-27) - Initial desktop app release +- **v0.1.0** (2025-12-27) - Initial release - System tray with minimal menu - - Embedded WebView2 dashboard - Multi-resolution icon support - Single-file Windows installer diff --git a/docs/proxypilot.md b/docs/proxypilot.md index 52fed20c..eb71017c 100644 --- a/docs/proxypilot.md +++ b/docs/proxypilot.md @@ -1,12 +1,12 @@ # ProxyPilot -ProxyPilot is a local “AI proxy + desktop UX” for agentic CLIs (Droid/Factory, Codex CLI, Warp). +ProxyPilot is a local AI proxy with CLI + system tray interface for agentic tools (Droid/Factory, Codex CLI, Warp). This repo started as a fork of CLIProxyAPI, but is now branded as ProxyPilot. For compatibility, some internal names and headers still use `CLIProxyAPI` (e.g. `X-CLIProxyAPI-*`). ## What’s included -- ProxyPilot tray app (Windows) to start/stop/restart the proxy engine, open the dashboard, open logs, and toggle autostart. +- ProxyPilot tray app (Windows) to start/stop/restart the proxy engine, open the web dashboard in browser, open logs, and toggle autostart. - Prompt-budget middleware to reduce “prompt too long” failures in strict CLIs. - Long-session memory with pinned state + persistent TODO (local disk). - Optional auth debugging and cooldown reset endpoints for local troubleshooting. diff --git a/internal/api/proxypilot_dashboard.go b/internal/api/proxypilot_dashboard.go index 6fb75833..b6a5d7cf 100644 --- a/internal/api/proxypilot_dashboard.go +++ b/internal/api/proxypilot_dashboard.go @@ -1,16 +1,12 @@ package api import ( - "io" "net/http" "os" - "path" "regexp" "strings" "github.com/gin-gonic/gin" - ppassets "github.com/router-for-me/CLIProxyAPI/v6/cmd/proxypilotui/assets" - "github.com/router-for-me/CLIProxyAPI/v6/internal/misc" ) // ppMgmtKeyRegex matches existing pp-mgmt-key meta tags to be replaced @@ -36,12 +32,19 @@ func (s *Server) serveProxyPilotDashboard(c *gin.Context) { return } - index, err := fsReadFile("index.html") - if err != nil { - c.AbortWithStatus(http.StatusNotFound) - return - } - html := string(index) + // Dashboard assets are not available - return a placeholder message + html := ` + + + +ProxyPilot + + +

ProxyPilot Dashboard

+

Dashboard UI assets are not available.

+ +` + // Use localPassword from the server instance (set via WithLocalManagementPassword) // Fall back to MANAGEMENT_PASSWORD env var for legacy subprocess mode key := strings.TrimSpace(s.localPassword) @@ -68,18 +71,8 @@ func (s *Server) serveProxyPilotAsset(c *gin.Context) { c.AbortWithStatus(http.StatusForbidden) return } - fp := strings.TrimPrefix(c.Param("filepath"), "/") - if fp == "" { - c.AbortWithStatus(http.StatusNotFound) - return - } - name := path.Clean("assets/" + fp) - data, err := fsReadFile(name) - if err != nil { - c.AbortWithStatus(http.StatusNotFound) - return - } - writeAssetResponse(c, name, data) + // Assets not available + c.AbortWithStatus(http.StatusNotFound) } func (s *Server) serveProxyPilotViteIcon(c *gin.Context) { @@ -87,12 +80,8 @@ func (s *Server) serveProxyPilotViteIcon(c *gin.Context) { c.AbortWithStatus(http.StatusForbidden) return } - data, err := fsReadFile("vite.svg") - if err != nil { - c.AbortWithStatus(http.StatusNotFound) - return - } - writeAssetResponse(c, "vite.svg", data) + // Asset not available + c.AbortWithStatus(http.StatusNotFound) } func (s *Server) serveProxyPilotLogo(c *gin.Context) { @@ -100,33 +89,8 @@ func (s *Server) serveProxyPilotLogo(c *gin.Context) { c.AbortWithStatus(http.StatusForbidden) return } - data, err := fsReadFile("logo.png") - if err != nil { - c.AbortWithStatus(http.StatusNotFound) - return - } - writeAssetResponse(c, "logo.png", data) -} - -func writeAssetResponse(c *gin.Context, name string, data []byte) { - ext := strings.TrimPrefix(path.Ext(name), ".") - if mt := misc.MimeTypes[strings.ToLower(ext)]; mt != "" { - c.Header("Content-Type", mt) - } else { - c.Header("Content-Type", "application/octet-stream") - } - c.Header("Cache-Control", "public, max-age=600") - c.Writer.WriteHeader(http.StatusOK) - _, _ = c.Writer.Write(data) -} - -func fsReadFile(name string) ([]byte, error) { - f, err := ppassets.FS.Open(name) - if err != nil { - return nil, err - } - defer func() { _ = f.Close() }() - return io.ReadAll(f) + // Asset not available + c.AbortWithStatus(http.StatusNotFound) } func isLocalClient(c *gin.Context) bool {