diff --git a/internal/webapp/frontend/e2e/browse.spec.ts b/internal/webapp/frontend/e2e/browse.spec.ts index a513097..23e0f5d 100644 --- a/internal/webapp/frontend/e2e/browse.spec.ts +++ b/internal/webapp/frontend/e2e/browse.spec.ts @@ -88,6 +88,14 @@ test("back/forward walks file → folder → file", async ({ page }) => { await expect(page.locator(".dl-title")).toContainText("notes"); }); +test("header search button opens the palette", async ({ page }) => { + await login(page); + await wikiId(page); + await page.click("#search-btn"); + await expect(page.locator("#palette")).toBeVisible(); + await page.keyboard.press("Escape"); +}); + test("palette (⌘K) fuzzy-jumps to a file", async ({ page }) => { await login(page); const pid = await wikiId(page); diff --git a/internal/webapp/frontend/src/apps/Browser.tsx b/internal/webapp/frontend/src/apps/Browser.tsx index 9a7e063..3ffce54 100644 --- a/internal/webapp/frontend/src/apps/Browser.tsx +++ b/internal/webapp/frontend/src/apps/Browser.tsx @@ -12,6 +12,7 @@ import { urlForPath, urlForView, type Route } from "../router"; import { currentNavType, navigate, useLocationPath } from "../nav"; import { copyText } from "../util"; import { toast } from "../toast"; +import { onSearchRequest } from "../search"; import { AppShell, Icon, Topbar, closeSidebarOnMobile } from "../components/shell"; import { FileTree, ancestorsOf } from "../components/FileTree"; import { Breadcrumbs } from "../components/Breadcrumbs"; @@ -141,6 +142,7 @@ export default function Browser(props: { const [share, setShare] = useState<{ url: string; copied: boolean } | null>(null); const [moreOpen, setMoreOpen] = useState(false); const [paletteOpen, setPaletteOpen] = useState(false); + useEffect(() => onSearchRequest(() => setPaletteOpen(true)), []); const downloadRef = useRef(null); const panel = props.panel ?? null; @@ -348,9 +350,6 @@ export default function Browser(props: { meta={meta} actions={ <> - {canShare && ( + )} {showSignout && ( diff --git a/internal/webapp/frontend/src/search.ts b/internal/webapp/frontend/src/search.ts new file mode 100644 index 0000000..4378d54 --- /dev/null +++ b/internal/webapp/frontend/src/search.ts @@ -0,0 +1,14 @@ +// Tiny cross-component signal: the sidebar's search button asks whichever +// surface owns the ⌘K palette (Browser) to open it — same in-repo-emitter +// spirit as nav.ts, no context plumbing through the shell. +type Listener = () => void; +const listeners = new Set(); + +export function onSearchRequest(l: Listener): () => void { + listeners.add(l); + return () => listeners.delete(l); +} + +export function requestSearch(): void { + for (const l of listeners) l(); +} diff --git a/internal/webapp/frontend/src/style.css b/internal/webapp/frontend/src/style.css index 8194632..9daa20a 100644 --- a/internal/webapp/frontend/src/style.css +++ b/internal/webapp/frontend/src/style.css @@ -217,17 +217,27 @@ button, input, a.btn { font-family: inherit; } .btn:hover { background: var(--hover); color: var(--text); border-color: var(--border-2); } .btn .ico { width: 15px; height: 15px; } .btn.ghost { color: var(--text-dim); } -/* The search control sits dead-center in the topbar, twice its natural - width, reading as an input field. */ -#search-btn { - position: absolute; left: 50%; transform: translateX(-50%); - width: 260px; justify-content: flex-start; +/* Hover tooltip for icon-only controls (the header search): label + kbd + chip in a floating card below the button, arrow pointing up. */ +.has-tip { position: relative; } +.has-tip .tip { + position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); + display: flex; align-items: center; gap: 7px; white-space: nowrap; + padding: 6px 9px; border-radius: 8px; border: 1px solid var(--border-2); + background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500; + box-shadow: 0 8px 24px rgba(0, 0, 0, .35); + opacity: 0; visibility: hidden; transition: opacity .12s ease .15s; z-index: 40; } -#search-btn kbd { margin-left: auto; } -#search-btn kbd { +.has-tip .tip::before { + content: ""; position: absolute; top: -4.5px; left: 50%; + width: 8px; height: 8px; transform: translateX(-50%) rotate(45deg); + background: var(--surface); border-left: 1px solid var(--border-2); border-top: 1px solid var(--border-2); +} +.has-tip:hover .tip, .has-tip:focus-visible .tip { opacity: 1; visibility: visible; } +.has-tip .tip kbd { font: 11px var(--ui); color: var(--text-faint); background: var(--hover); border: 1px solid var(--border-2); border-radius: 5px; - padding: 1px 5px; margin-left: 2px; + padding: 1px 5px; } #more-menu { position: absolute; right: 12px; top: calc(100% - 4px); z-index: 80; @@ -463,8 +473,7 @@ button, input, a.btn { font-family: inherit; } .icon-btn { display: inline-flex; width: 44px; height: 44px; } #content { padding: 24px 18px 70px; } #topbar { padding: 0 8px; gap: 4px; } - #search-btn { position: static; transform: none; width: auto; justify-content: center; } - #search-btn kbd, .btn .lbl { display: none; } + .btn .lbl { display: none; } #topbar .btn { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; gap: 0; } #topbar .btn .ico { width: 18px; height: 18px; } #more-btn:not([hidden]) { display: inline-flex; } diff --git a/internal/webapp/static/assets/index-4kYunG_6.css b/internal/webapp/static/assets/index-4kYunG_6.css new file mode 100644 index 0000000..f5bc269 --- /dev/null +++ b/internal/webapp/static/assets/index-4kYunG_6.css @@ -0,0 +1 @@ +:root{--bg: #0a0b0d;--bg-side: #0c0e10;--bg-raise: #15171b;--surface: rgba(255,255,255,.03);--hover: rgba(255,255,255,.06);--border: rgba(255,255,255,.07);--border-2: rgba(255,255,255,.11);--code-bg: #0d0f12;--text: #eef0f3;--text-dim: #9aa0a9;--text-faint: #868b93;--text-ghost: #666b74;--accent: #f5a623;--accent-bright: #ffcf85;--accent-dim: #d3861a;--accent-press: #e0951a;--glow: rgba(245,166,35,.13);--add: #4cc38a;--del: #f26d6d;--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;--ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;--r-ctl: 7px;--r-card: 10px;--r-over: 14px}*{box-sizing:border-box}[hidden]{display:none!important}html,body{height:100%;margin:0}#root{display:contents}body{display:flex;background:var(--bg);color:var(--text);font:13px/1.5 var(--ui);letter-spacing:-.006em;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}::selection{background:var(--glow);color:var(--accent-bright)}:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-radius:5px}.sprite{position:absolute}.ico{width:16px;height:16px;flex:none;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}button,input,a.btn{font-family:inherit}#sidebar{width:264px;min-width:210px;background:var(--bg-side);border-right:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden}#vault{display:flex;align-items:center;gap:9px;height:52px;padding:0 12px 0 14px;border-bottom:1px solid var(--border)}#vault-badge{width:22px;height:22px;border-radius:6px;flex:none;display:grid;place-items:center;font-size:13px;line-height:1;background:linear-gradient(160deg,#ffcf85,#f5a623 55%,#d3861a);box-shadow:0 1px #ffffff59 inset,0 2px 6px -1px #f5a62366}#vault-name{font-weight:600;font-size:13px;letter-spacing:-.01em;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vault-actions{display:flex;align-items:center;gap:4px}#vault #signout,.icon-btn2{width:28px;height:28px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:var(--text-ghost);background:transparent;border:none;cursor:pointer;text-decoration:none}#vault #signout:hover,.icon-btn2:hover{color:var(--text);background:var(--hover)}#vault #signout .ico,.icon-btn2 .ico{width:16px;height:16px}#projects{flex:none;max-height:32%;overflow-y:auto;padding:10px 8px 8px;border-bottom:1px solid var(--border)}.nav-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--text-ghost)}.nav-add{display:grid;place-items:center;width:18px;height:18px;border:none;background:transparent;color:var(--text-ghost);cursor:pointer;border-radius:5px}.nav-add .ico{width:14px;height:14px}.nav-add:hover{color:var(--text);background:var(--hover)}#projects ul{list-style:none;margin:0;padding:0}#projects .row{display:flex;align-items:center;gap:9px;height:31px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}.proj-mark{width:17px;height:17px;border-radius:5px;flex:none;display:grid;place-items:center;font-size:10px;font-weight:700;color:#0a0b0d;letter-spacing:-.02em;text-transform:uppercase}#projects .row .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#projects .row:hover{background:var(--hover);color:var(--text)}#projects .row.active{background:var(--glow);color:var(--accent-bright)}#projects .row.active:before{content:"";position:absolute;left:0;top:6px;bottom:6px;width:2px;border-radius:2px;background:var(--accent)}#tree{flex:1;overflow-y:auto;padding:8px 8px 24px}#tree ul{list-style:none;margin:0;padding-left:13px;position:relative}#tree>ul{padding-left:0}#tree ul ul:before{content:"";position:absolute;left:5px;top:0;bottom:0;width:1px;background:var(--border)}#tree li>.row{display:flex;align-items:center;gap:6px;height:28px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}#tree li>.row:hover{background:var(--hover);color:var(--text)}#tree li>.row.active{background:var(--glow);color:var(--accent-bright)}#tree li>.row.active:before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;border-radius:2px;background:var(--accent)}#tree .chev{width:14px;height:14px;flex:none;color:var(--text-ghost);transition:transform .12s;display:flex;align-items:center;justify-content:center}#tree .chev .ico{width:13px;height:13px}#tree .ticon{flex:none;display:flex;color:var(--text-ghost)}#tree .ticon .ico{width:15px;height:15px}#tree li>.row:hover .ticon,#tree li>.row:hover .chev{color:var(--text-faint)}#tree li>.row.active .ticon,#tree li>.row.active .chev{color:var(--accent)}#tree .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#tree .file .label{font-size:12.5px}#tree .file .chev{visibility:hidden}#tree li.collapsed>ul{display:none}#tree li.collapsed>.row .chev{transform:rotate(-90deg)}.nav-menu{list-style:none;margin:6px 0 0;padding:0}.nav-menu .row .ico{width:15px;height:15px;flex:none;color:var(--text-ghost)}.nav-menu .row.active .ico{color:var(--accent-bright)}.proj-row{display:flex;align-items:center;gap:4px;padding:0 10px 4px 12px}.proj-select-wrap{position:relative;flex:1;min-width:0;display:flex;align-items:center}.proj-select-wrap .proj-mark{position:absolute;left:9px;pointer-events:none}.proj-select-wrap>.ico{position:absolute;right:8px;width:14px;height:14px;color:var(--text-ghost);pointer-events:none}#project-select{flex:1;min-width:0;height:30px;padding:0 26px 0 30px;appearance:none;-webkit-appearance:none;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;font-weight:500;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#project-select:hover{background:var(--hover);border-color:var(--border-2)}#accountbar{position:relative;border-top:1px solid var(--border);padding:7px 10px}#account-btn{width:100%;display:flex;align-items:center;gap:9px;text-align:left;padding:6px 8px;border:none;border-radius:7px;background:transparent;color:var(--text-dim);cursor:pointer;font:inherit}#account-btn:hover{background:var(--hover);color:var(--text)}#account-btn .avatar{width:26px;height:26px;flex:none;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:700}#account-btn .acct{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}#account-btn .acct b{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn .acct small{font-size:11px;color:var(--text-ghost);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn>.ico{width:14px;height:14px;color:var(--text-ghost)}#account-menu{position:absolute;left:10px;right:10px;bottom:calc(100% + 4px);padding:5px;border:1px solid var(--border-2);border-radius:9px;background:var(--surface);box-shadow:0 10px 32px #00000059;display:flex;flex-direction:column;z-index:30}#account-menu .menu-sec{padding:7px 9px 3px;font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-ghost)}#account-menu [role=menuitem]{display:flex;align-items:center;gap:8px;padding:7px 9px;border:none;border-radius:6px;background:transparent;text-align:left;color:var(--text-dim);font:inherit;font-size:12.5px;cursor:pointer;text-decoration:none}#account-menu [role=menuitem]:hover{background:var(--hover);color:var(--text)}#account-menu [role=menuitem] b{font-weight:600}#account-menu [role=menuitem] .ico{width:15px;height:15px}#account-menu #signout{color:var(--danger, #e5534b)}#account-menu #signout:hover{color:var(--danger, #e5534b);background:var(--hover)}#main{flex:1;display:flex;flex-direction:column;min-width:0}#topbar{position:relative;display:flex;align-items:center;gap:9px;height:52px;padding:0 16px;border-bottom:1px solid var(--border)}.icon-btn{display:none;width:34px;height:34px;border:none;background:transparent;color:var(--text-dim);cursor:pointer;border-radius:7px;align-items:center;justify-content:center}.icon-btn:hover{color:var(--text);background:var(--hover)}#crumb{font-size:12.5px;color:var(--text);font-weight:500;letter-spacing:-.01em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#crumb .crumb-seg{color:var(--text-dim);cursor:pointer}#crumb .crumb-seg:hover{color:var(--accent-bright)}#crumb .crumb-sep{color:var(--text-ghost);margin:0 5px}#meta{flex:1;min-width:0;font-size:12px;color:var(--text-faint);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn{display:inline-flex;align-items:center;gap:6px;flex:none;height:30px;padding:0 11px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font-size:12.5px;font-weight:500;cursor:pointer;text-decoration:none}.btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.btn .ico{width:15px;height:15px}.btn.ghost{color:var(--text-dim)}.has-tip{position:relative}.has-tip .tip{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);display:flex;align-items:center;gap:7px;white-space:nowrap;padding:6px 9px;border-radius:8px;border:1px solid var(--border-2);background:var(--surface);color:var(--text);font-size:12.5px;font-weight:500;box-shadow:0 8px 24px #00000059;opacity:0;visibility:hidden;transition:opacity .12s ease .15s;z-index:40}.has-tip .tip:before{content:"";position:absolute;top:-4.5px;left:50%;width:8px;height:8px;transform:translate(-50%) rotate(45deg);background:var(--surface);border-left:1px solid var(--border-2);border-top:1px solid var(--border-2)}.has-tip:hover .tip,.has-tip:focus-visible .tip{opacity:1;visibility:visible}.has-tip .tip kbd{font:11px var(--ui);color:var(--text-faint);background:var(--hover);border:1px solid var(--border-2);border-radius:5px;padding:1px 5px}#more-menu{position:absolute;right:12px;top:calc(100% - 4px);z-index:80;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-card);box-shadow:0 18px 44px -14px #000000bf;padding:6px;min-width:168px}.more-item{display:block;width:100%;text-align:left;min-height:40px;padding:0 12px;background:transparent;border:none;cursor:pointer;color:var(--text);font:inherit;font-size:13.5px;border-radius:var(--r-ctl)}.more-item:hover{background:var(--hover)}#content{flex:1;overflow-y:auto;padding:44px 40px 110px;scroll-behavior:smooth}.empty{color:var(--text-faint);text-align:center;margin-top:22vh}.empty-hint{display:block;margin-top:6px;font-size:12px;color:var(--text-ghost)}.onboard{max-width:560px;margin:8vh auto 0}.onboard h1{font-size:25px;font-weight:640;letter-spacing:-.02em;margin:0 0 8px;color:#f4f6f9}.onboard>p{color:var(--text-dim);margin:0 0 28px;font-size:14px}.ob-card{background:var(--bg-side);border:1px solid var(--border);border-radius:var(--r-card);padding:20px 22px;margin-bottom:14px}.ob-card h3{margin:0 0 6px;font-size:14.5px;font-weight:600}.ob-card p{margin:0 0 14px;font-size:13px;color:var(--text-dim)}.ob-row{display:flex;gap:9px}.ob-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.ob-row input:focus{border-color:var(--accent);background:var(--hover)}.pbtn{display:inline-flex;align-items:center;gap:6px;flex:none;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:var(--accent);color:#241704;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap}.pbtn:hover{background:var(--accent-bright)}.pbtn .ico{width:15px;height:15px}.danger-btn{display:inline-flex;align-items:center;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:#b3382e;color:#fff;font-size:13px;font-weight:600;cursor:pointer}.danger-btn:hover{background:#c94336}.admin{max-width:760px}.admin h1{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 6px;color:#f4f6f9}.admin h3{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-ghost);font-weight:600;margin:30px 0 10px}.admin-sub{color:var(--text-dim);font-size:13.5px;margin:0 0 6px;line-height:1.55}.admin-h{display:flex;align-items:center;justify-content:space-between;margin:30px 0 10px}.admin-h h3{margin:0}.admin-row{display:flex;gap:9px;margin-bottom:8px}.admin-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.admin-row input:focus{border-color:var(--accent);background:var(--hover)}.admin-list{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.admin-item{display:flex;align-items:center;gap:11px;padding:11px 14px;border-bottom:1px solid var(--border);font-size:13.5px}.admin-item:last-child{border-bottom:none}.admin-item:hover{background:#ffffff04}.ai-main{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.ai-main.mono{font:12px var(--mono);color:var(--text-dim);cursor:pointer}.ai-tag{font-size:11.5px;color:var(--text-faint);flex:none}.admin-item select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.admin-item select:hover{border-color:var(--border-2)}.ai-btn,.ai-del{flex:none;height:27px;padding:0 11px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font:inherit;font-size:12px;font-weight:500;cursor:pointer}.ai-btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.ai-del{color:var(--del);border-color:transparent;background:transparent}.ai-del:hover{background:#f26d6d1f;color:#ff8b8b}.admin-empty{padding:14px;color:var(--text-faint);font-size:13px}.admin-item.toggle{cursor:pointer;align-items:flex-start}.admin-item.toggle .ai-main{white-space:normal}.tg-label{font-size:13.5px;font-weight:550;color:var(--text)}.tg-desc{font-size:12px;color:var(--text-faint);margin-top:3px;line-height:1.5}.admin-item.toggle input{width:16px;height:16px;margin-top:2px;accent-color:var(--accent);flex:none}.dirlist{max-width:704px;margin:0 auto}.dl-title{display:flex;align-items:center;gap:10px;font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.dl-title-icon{display:flex;color:var(--accent)}.dl-title-icon .ico{width:20px;height:20px}.dl-sub{color:var(--text-faint);font-size:12.5px;margin:0 0 18px}.dl-items{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.dl-row{display:flex;align-items:center;gap:11px;padding:10px 14px;border-bottom:1px solid var(--border);cursor:pointer}.dl-row:last-child{border-bottom:none}.dl-row:hover{background:var(--hover)}.dl-row .ticon{flex:none;display:flex;color:var(--text-ghost)}.dl-row .ticon .ico{width:16px;height:16px}.dl-row:hover .ticon{color:var(--text-faint)}.dl-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--text)}.dl-meta{flex:none;font-size:12px;color:var(--text-faint);font-variant-numeric:tabular-nums}.heatdot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent)}.heatdot.lvl1{opacity:.3}.heatdot.lvl2{opacity:.55}.heatdot.lvl3{opacity:.8}.heatdot.lvl4{opacity:1;box-shadow:0 0 6px #f5a6238c}.dl-empty{padding:24px 14px;color:var(--text-faint);font-size:13px;border:1px dashed var(--border);border-radius:var(--r-card);text-align:center}.dl-h3{margin:28px 0 8px;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-ghost);font-weight:600}.dl-hlist{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden;max-width:none}.dl-hlist .hentry:last-child{border-bottom:none}.hentry.clickable{cursor:pointer}.hentry.clickable:hover{background:var(--hover)}.dl-more{margin-top:10px}#vault-name.vault-link{cursor:pointer}#vault-name.vault-link:hover{color:var(--accent-bright)}.guide{max-width:760px;margin:0 auto}.gd-tabs{display:flex;gap:2px;margin:20px 0 16px;border-bottom:1px solid var(--border);overflow-x:auto}.gd-tab{font:inherit;font-size:13px;font-weight:600;padding:7px 12px 9px;background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;color:var(--text-faint);cursor:pointer;white-space:nowrap}.gd-tab:hover{color:var(--text)}.gd-tab.active{color:var(--accent-bright);border-bottom-color:var(--accent)}.gd-step{margin:0 0 18px}.gd-step-head{display:flex;align-items:center;gap:10px;margin-bottom:3px}.gd-num{flex:none;width:22px;height:22px;border-radius:50%;background:var(--glow);color:var(--accent-bright);font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center}.gd-step-title{font-weight:600;font-size:14px;color:var(--text)}.gd-desc{margin:2px 0 8px 32px;color:var(--text-faint);font-size:13px;line-height:1.5}.gd-extra{font-size:12.5px;margin-top:6px}.gd-code{position:relative;margin:6px 0 6px 32px;padding:10px 72px 10px 12px;background:var(--bg-raise);border:1px solid var(--border);border-radius:var(--r-card);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;color:var(--text);overflow-x:auto;white-space:pre}.gd-copy{position:absolute;top:7px;right:7px;font:inherit;font-family:inherit;font-size:11px;font-weight:600;padding:3px 9px;border-radius:6px;border:1px solid var(--border-2);background:var(--bg-raise);color:var(--text-faint);cursor:pointer;box-shadow:-14px 0 12px -6px var(--bg-raise)}.gd-copy:hover{color:var(--accent-bright);border-color:var(--accent-dim)}.gd-done{margin:22px 0 8px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);color:var(--text-faint);font-size:13px;line-height:1.5}.home-insights{margin-top:30px;padding-top:22px;border-top:1px solid var(--border)}.insights{max-width:760px;margin:0 auto}.in-title{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.in-title .in-scope{color:var(--text-ghost);font-weight:500;font-size:15px}.in-lens{display:flex;gap:6px;margin:0 0 14px}.in-lens-btn{font:inherit;font-size:12px;padding:5px 12px;border-radius:999px;border:1px solid var(--border);background:none;color:var(--text-faint);cursor:pointer}.in-lens-btn:hover{color:var(--text)}.in-lens-btn.active{color:var(--accent);border-color:var(--accent)}.in-chart{width:100%;height:auto;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin-bottom:6px}.in-axis{stroke:var(--border);stroke-width:1}.in-threshold{stroke:var(--border);stroke-width:1;stroke-dasharray:4 4}.in-danger-zone{fill:#f26d6d0d}.in-label{fill:var(--text-ghost);font-size:11px}.in-quad{fill:var(--text-ghost);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em}.in-quad-danger{fill:#e07070}.in-pt{fill:var(--accent);opacity:.5;cursor:pointer}.in-pt:hover{opacity:1}.in-pt.cold{fill:var(--text-ghost);opacity:.25}.in-pt.danger{fill:#e05d5d;opacity:.6}.in-treemap{background:#0c0d10}.in-tm-group{fill:none;stroke:var(--border);stroke-width:1;cursor:pointer;pointer-events:all}.in-tm-glabel{fill:var(--text-faint);font-size:10px;text-transform:uppercase;letter-spacing:.05em;cursor:pointer}.in-tm-cell{cursor:pointer}.in-tm-cell:hover{stroke:#fff;stroke-width:1}.in-tm-label{fill:#0c0d10;font-size:10.5px;font-weight:620;cursor:pointer;pointer-events:none}.in-hotpath{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden}.in-hp-row{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:1px solid var(--border);cursor:pointer}.in-hp-row:last-child{border-bottom:none}.in-hp-row:hover{background:var(--hover)}.in-hp-name{flex:0 0 300px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--text)}.in-hp-name.danger{color:var(--accent)}.in-hp-bar{flex:1;display:flex;height:10px;border-radius:3px;overflow:hidden}.in-hp-agent{background:var(--accent)}.in-hp-human{background:#5b8def}.in-hp-count{flex:none;width:40px;text-align:right;font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.in-legend{margin:8px 2px 0;font-size:11.5px;color:var(--text-faint)}.in-sw{display:inline-block;width:10px;height:10px;border-radius:2px;vertical-align:-1px}.in-sw.agent{background:var(--accent)}.in-sw.human{background:#5b8def}.in-matrix rect{transition:opacity .1s}.in-matrix rect:hover{opacity:.85}.history{max-width:860px}.hentry{padding:11px 12px;border-bottom:1px solid var(--border)}.hentry:hover{background:#ffffff04}.hline{display:flex;gap:10px;align-items:center}.hkind{display:inline-flex;color:var(--add)}.hkind .ico{width:13px;height:13px}.hentry.edit .hkind{color:var(--accent)}.hentry.delete .hkind{color:var(--del)}.htag{flex:none;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:1px 6px;border-radius:4px}.hentry.add .htag{color:var(--add);background:#4cc38a1f}.hentry.edit .htag{color:var(--accent-bright);background:var(--glow)}.hentry.delete .htag{color:#ff8b8b;background:#f26d6d1f}.hpath{font-weight:500;cursor:pointer;color:var(--text);font-size:13px}.hpath:hover{color:var(--accent-bright)}.htime{margin-left:auto;color:var(--text-faint);font-size:12px;font-variant-numeric:tabular-nums}.hmeta{display:flex;align-items:center;gap:14px;margin-top:4px;padding-left:23px;font-size:12px;color:var(--text-dim)}.hdev,.hsize{color:var(--text-faint)}.hsize{font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}.hnote{margin-top:4px;padding-left:23px;font-size:12px;color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.hnote:hover{color:var(--text)}.hnote.open{white-space:normal;overflow-wrap:anywhere}.hnote:before{content:"› ";color:var(--text-ghost)}.hnote a{color:var(--accent-bright);text-decoration:none}.hnote a:hover{text-decoration:underline}#palette-overlay{position:fixed;inset:0;background:#0607099e;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);display:flex;justify-content:center;align-items:flex-start;padding-top:12vh;z-index:100}#palette{width:min(560px,92vw);background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);box-shadow:0 24px 70px -18px #000c;overflow:hidden}#palette-inputwrap{display:flex;align-items:center;gap:11px;padding:14px 16px;border-bottom:1px solid var(--border)}#palette-inputwrap .ico{width:17px;height:17px;color:var(--text-faint)}#palette-input{flex:1;width:100%;border:none;background:transparent;color:var(--text);font:inherit;font-size:15px;letter-spacing:-.01em;outline:none;padding:0}#palette-input::placeholder{color:var(--text-ghost)}#palette-results{list-style:none;margin:0;padding:8px;max-height:46vh;overflow-y:auto}#palette-results li{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette-results li.selected{background:var(--glow)}#palette-results li.selected .picon{color:var(--accent)}#palette-results li.selected .plabel,#palette-results li.selected .plabel b{color:var(--accent-bright)}#palette-results li .picon{width:18px;flex:none;display:flex;justify-content:center;color:var(--text-faint)}#palette-results li .picon .ico{width:15px;height:15px}#palette-results li .plabel{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}#palette-results li .plabel b{color:var(--accent-bright);font-weight:600}#palette-results li .pkind{flex:none;font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-ghost)}#palette-results .pempty{color:var(--text-faint);cursor:default;justify-content:center;height:auto;padding:14px}#palette-hint{padding:9px 16px;border-top:1px solid var(--border);font-size:11px;color:var(--text-ghost)}.modal-back{position:fixed;inset:0;background:#06070999;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;z-index:150;padding:20px}.modal{background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);padding:22px 24px;width:min(460px,100%);box-shadow:0 24px 70px -18px #000c}.modal h3{margin:0 0 10px;font-size:16px;font-weight:620;letter-spacing:-.01em}.modal p{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal p b{color:var(--text)}.modal-url{font:12px var(--mono);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);padding:9px 11px;color:var(--text-dim);word-break:break-all;margin-bottom:16px}.modal-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.modal-label{display:block;font-size:12.5px;color:var(--text-dim);margin:0 0 6px}.modal-msg{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal-input{width:100%;height:36px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:14px;margin-bottom:16px;outline:none}.modal-input:focus{border-color:var(--accent);background:var(--hover)}#toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%) translateY(20px);background:var(--bg-raise);color:var(--text);border:1px solid var(--border-2);border-radius:10px;padding:11px 18px;font-size:13.5px;box-shadow:0 18px 44px -12px #000000b3;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:200}#toast.show{opacity:1;transform:translate(-50%) translateY(0)}#toast.err{border-color:#f26d6d80;color:#ffb0aa}#sb-backdrop{display:none}@media(max-width:900px){#sidebar{position:fixed;z-index:60;top:0;left:0;height:100%;transform:translate(-100%);transition:transform .2s ease;box-shadow:0 0 40px #0009}body.sb-open #sidebar{transform:translate(0)}body.sb-open #sb-backdrop{display:block;position:fixed;inset:0;background:#0000008c;z-index:50}.icon-btn{display:inline-flex;width:44px;height:44px}#content{padding:24px 18px 70px}#topbar{padding:0 8px;gap:4px}.btn .lbl{display:none}#topbar .btn{min-width:44px;min-height:44px;padding:0;justify-content:center;gap:0}#topbar .btn .ico{width:18px;height:18px}#more-btn:not([hidden]){display:inline-flex}#history-btn,#upload-btn,#download{display:none!important}#meta{display:none}#crumb{flex:1}#vault{padding:0 8px 0 12px}.icon-btn2,#signout,#tree li>.row,#projects .row{height:44px}#account-btn,#project-select{min-height:44px}.nav-add{min-width:44px;min-height:44px}.markdown,.admin,.onboard,.history,.dirlist{max-width:100%}.markdown table,pre.plain{display:block;overflow-x:auto;max-width:100%}.ob-row{flex-direction:column}.ob-row input{flex:none;min-height:44px}.admin-item{flex-wrap:wrap;row-gap:8px;padding:12px 14px}.admin-item select{height:44px}.ai-btn,.ai-del{height:auto;min-height:44px;padding:0 12px}.admin-item .ai-main{flex:1 1 100%;white-space:normal;overflow-wrap:break-word}.gd-code{min-height:62px;padding-top:12px;padding-bottom:12px}.gd-copy{min-height:44px;padding:0 14px}.gd-tab{min-height:44px}.in-lens-btn{min-height:44px;padding:0 14px}.modal-input{height:44px}.modal-actions button,.pbtn,#palette-results li{height:auto;min-height:44px}.more-item{min-height:44px}}.modal-actions .ai-del{margin-right:auto}@media(max-width:430px){.dl-meta{display:none}.ai-tag{font-size:11px}.htime{white-space:nowrap;font-size:12px}.hline{flex-wrap:wrap}.modal-actions .ai-del{flex:0 0 100%}}.markdown{max-width:704px;width:100%;margin:0 auto}.markdown h1,.markdown h2,.markdown h3,.markdown h4{color:#f4f6f9;line-height:1.25;letter-spacing:-.018em;margin:1.5em 0 .5em;text-wrap:balance}.markdown h1:first-child{margin-top:0}.markdown h1{font-size:1.85em;font-weight:660;letter-spacing:-.024em}.markdown h2{font-size:1.32em;font-weight:620;margin-top:1.7em}.markdown h3{font-size:1.08em;font-weight:620}.markdown p,.markdown li{color:#c6cbd3;font-size:14.5px;line-height:1.72}.markdown p{margin:0 0 1em}.markdown strong{color:var(--text);font-weight:620}.markdown a{color:var(--accent-bright);text-decoration:none;border-bottom:1px solid rgba(245,166,35,.28)}.markdown a:hover{border-bottom-color:var(--accent)}.markdown ul,.markdown ol{margin:0 0 1em;padding-left:1.4em}.markdown li{margin-bottom:.4em}.markdown li::marker{color:var(--text-ghost)}.markdown code{background:var(--hover);border:1px solid var(--border);padding:.1em .4em;border-radius:5px;font:12.5px/1.5 var(--mono);color:#e4d9c4}.markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;margin:1.3em 0}.markdown pre code{background:none;border:none;padding:0;color:#c6cbd3}.markdown blockquote{margin:1.3em 0;padding:.3em 1em;border-left:2px solid var(--accent);background:linear-gradient(90deg,var(--glow),transparent);border-radius:0 8px 8px 0;color:#d8cdb6}.markdown blockquote p{margin:.3em 0;color:#d8cdb6}.markdown table{border-collapse:collapse;margin:1.3em 0;font-size:13.5px}.markdown th,.markdown td{border-bottom:1px solid var(--border);padding:9px 13px;text-align:left}.markdown th{color:var(--text-faint);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;border-bottom-color:var(--border-2)}.markdown tr:hover td{background:#ffffff05}.markdown img{max-width:100%;border-radius:8px;border:1px solid var(--border)}.markdown hr{border:none;border-top:1px solid var(--border);margin:2.2em 0}.markdown table.frontmatter{margin:0 0 1.8em;font-size:12px;background:var(--surface);border:1px solid var(--border);border-radius:8px;border-collapse:separate;border-spacing:0}.markdown table.frontmatter th{text-transform:none;letter-spacing:0;font-size:11.5px;color:var(--text-faint);font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;padding:6px 14px 6px 12px;border-bottom:1px solid var(--border)}.markdown table.frontmatter td{color:var(--text-dim);padding:6px 12px 6px 0;border-bottom:1px solid var(--border)}.markdown table.frontmatter tr:last-child th,.markdown table.frontmatter tr:last-child td{border-bottom:none}.markdown table.frontmatter code{white-space:pre-wrap;font-size:11px}.markdown input[type=checkbox]{accent-color:var(--accent)}.htmlview{display:block;width:100%;height:calc(100vh - 150px);border:1px solid var(--border);border-radius:var(--r-card);background:#fff}.notfound{margin-top:12vh;text-align:center;color:var(--text-dim)}.notfound h1{color:var(--text);font-size:1.4em;margin-bottom:.5em}.notfound code{background:var(--hover);border:1px solid var(--border);padding:.15em .5em;border-radius:6px}.notfound .nf-sub{max-width:440px;margin:12px auto 20px;font-size:13px;color:var(--text-faint);line-height:1.6}pre.plain{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;font:12.5px/1.6 var(--mono);color:#c6cbd3;white-space:pre-wrap;overflow-wrap:anywhere;max-width:900px}#content.markdown{min-width:0}.filecard{margin-top:15vh;text-align:center;color:var(--text-dim)}.filecard .name{font-size:1.2em;color:var(--text);margin-bottom:.3em}.filecard .btn{margin-top:14px} diff --git a/internal/webapp/static/assets/index-CCQsgUR1.css b/internal/webapp/static/assets/index-CCQsgUR1.css deleted file mode 100644 index 4a5af14..0000000 --- a/internal/webapp/static/assets/index-CCQsgUR1.css +++ /dev/null @@ -1 +0,0 @@ -:root{--bg: #0a0b0d;--bg-side: #0c0e10;--bg-raise: #15171b;--surface: rgba(255,255,255,.03);--hover: rgba(255,255,255,.06);--border: rgba(255,255,255,.07);--border-2: rgba(255,255,255,.11);--code-bg: #0d0f12;--text: #eef0f3;--text-dim: #9aa0a9;--text-faint: #868b93;--text-ghost: #666b74;--accent: #f5a623;--accent-bright: #ffcf85;--accent-dim: #d3861a;--accent-press: #e0951a;--glow: rgba(245,166,35,.13);--add: #4cc38a;--del: #f26d6d;--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;--ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;--r-ctl: 7px;--r-card: 10px;--r-over: 14px}*{box-sizing:border-box}[hidden]{display:none!important}html,body{height:100%;margin:0}#root{display:contents}body{display:flex;background:var(--bg);color:var(--text);font:13px/1.5 var(--ui);letter-spacing:-.006em;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}::selection{background:var(--glow);color:var(--accent-bright)}:focus-visible{outline:2px solid var(--accent);outline-offset:1px;border-radius:5px}.sprite{position:absolute}.ico{width:16px;height:16px;flex:none;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}button,input,a.btn{font-family:inherit}#sidebar{width:264px;min-width:210px;background:var(--bg-side);border-right:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden}#vault{display:flex;align-items:center;gap:9px;height:52px;padding:0 12px 0 14px;border-bottom:1px solid var(--border)}#vault-badge{width:22px;height:22px;border-radius:6px;flex:none;display:grid;place-items:center;font-size:13px;line-height:1;background:linear-gradient(160deg,#ffcf85,#f5a623 55%,#d3861a);box-shadow:0 1px #ffffff59 inset,0 2px 6px -1px #f5a62366}#vault-name{font-weight:600;font-size:13px;letter-spacing:-.01em;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vault-actions{display:flex;align-items:center;gap:4px}#vault #signout,.icon-btn2{width:28px;height:28px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:var(--text-ghost);background:transparent;border:none;cursor:pointer;text-decoration:none}#vault #signout:hover,.icon-btn2:hover{color:var(--text);background:var(--hover)}#vault #signout .ico,.icon-btn2 .ico{width:16px;height:16px}#projects{flex:none;max-height:32%;overflow-y:auto;padding:10px 8px 8px;border-bottom:1px solid var(--border)}.nav-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:var(--text-ghost)}.nav-add{display:grid;place-items:center;width:18px;height:18px;border:none;background:transparent;color:var(--text-ghost);cursor:pointer;border-radius:5px}.nav-add .ico{width:14px;height:14px}.nav-add:hover{color:var(--text);background:var(--hover)}#projects ul{list-style:none;margin:0;padding:0}#projects .row{display:flex;align-items:center;gap:9px;height:31px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}.proj-mark{width:17px;height:17px;border-radius:5px;flex:none;display:grid;place-items:center;font-size:10px;font-weight:700;color:#0a0b0d;letter-spacing:-.02em;text-transform:uppercase}#projects .row .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#projects .row:hover{background:var(--hover);color:var(--text)}#projects .row.active{background:var(--glow);color:var(--accent-bright)}#projects .row.active:before{content:"";position:absolute;left:0;top:6px;bottom:6px;width:2px;border-radius:2px;background:var(--accent)}#tree{flex:1;overflow-y:auto;padding:8px 8px 24px}#tree ul{list-style:none;margin:0;padding-left:13px;position:relative}#tree>ul{padding-left:0}#tree ul ul:before{content:"";position:absolute;left:5px;top:0;bottom:0;width:1px;background:var(--border)}#tree li>.row{display:flex;align-items:center;gap:6px;height:28px;padding:0 8px;border-radius:7px;color:var(--text-dim);cursor:pointer;position:relative;white-space:nowrap;overflow:hidden}#tree li>.row:hover{background:var(--hover);color:var(--text)}#tree li>.row.active{background:var(--glow);color:var(--accent-bright)}#tree li>.row.active:before{content:"";position:absolute;left:0;top:5px;bottom:5px;width:2px;border-radius:2px;background:var(--accent)}#tree .chev{width:14px;height:14px;flex:none;color:var(--text-ghost);transition:transform .12s;display:flex;align-items:center;justify-content:center}#tree .chev .ico{width:13px;height:13px}#tree .ticon{flex:none;display:flex;color:var(--text-ghost)}#tree .ticon .ico{width:15px;height:15px}#tree li>.row:hover .ticon,#tree li>.row:hover .chev{color:var(--text-faint)}#tree li>.row.active .ticon,#tree li>.row.active .chev{color:var(--accent)}#tree .label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}#tree .file .label{font-size:12.5px}#tree .file .chev{visibility:hidden}#tree li.collapsed>ul{display:none}#tree li.collapsed>.row .chev{transform:rotate(-90deg)}.nav-menu{list-style:none;margin:6px 0 0;padding:0}.nav-menu .row .ico{width:15px;height:15px;flex:none;color:var(--text-ghost)}.nav-menu .row.active .ico{color:var(--accent-bright)}.proj-row{display:flex;align-items:center;gap:4px;padding:0 10px 4px 12px}.proj-select-wrap{position:relative;flex:1;min-width:0;display:flex;align-items:center}.proj-select-wrap .proj-mark{position:absolute;left:9px;pointer-events:none}.proj-select-wrap>.ico{position:absolute;right:8px;width:14px;height:14px;color:var(--text-ghost);pointer-events:none}#project-select{flex:1;min-width:0;height:30px;padding:0 26px 0 30px;appearance:none;-webkit-appearance:none;border:1px solid var(--border);border-radius:var(--r-ctl);background:var(--surface);color:var(--text);font:inherit;font-size:12.5px;font-weight:500;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#project-select:hover{background:var(--hover);border-color:var(--border-2)}#accountbar{position:relative;border-top:1px solid var(--border);padding:7px 10px}#account-btn{width:100%;display:flex;align-items:center;gap:9px;text-align:left;padding:6px 8px;border:none;border-radius:7px;background:transparent;color:var(--text-dim);cursor:pointer;font:inherit}#account-btn:hover{background:var(--hover);color:var(--text)}#account-btn .avatar{width:26px;height:26px;flex:none;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:700}#account-btn .acct{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}#account-btn .acct b{font-size:12.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn .acct small{font-size:11px;color:var(--text-ghost);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#account-btn>.ico{width:14px;height:14px;color:var(--text-ghost)}#account-menu{position:absolute;left:10px;right:10px;bottom:calc(100% + 4px);padding:5px;border:1px solid var(--border-2);border-radius:9px;background:var(--surface);box-shadow:0 10px 32px #00000059;display:flex;flex-direction:column;z-index:30}#account-menu .menu-sec{padding:7px 9px 3px;font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-ghost)}#account-menu [role=menuitem]{display:flex;align-items:center;gap:8px;padding:7px 9px;border:none;border-radius:6px;background:transparent;text-align:left;color:var(--text-dim);font:inherit;font-size:12.5px;cursor:pointer;text-decoration:none}#account-menu [role=menuitem]:hover{background:var(--hover);color:var(--text)}#account-menu [role=menuitem] b{font-weight:600}#account-menu [role=menuitem] .ico{width:15px;height:15px}#account-menu #signout{color:var(--danger, #e5534b)}#account-menu #signout:hover{color:var(--danger, #e5534b);background:var(--hover)}#main{flex:1;display:flex;flex-direction:column;min-width:0}#topbar{position:relative;display:flex;align-items:center;gap:9px;height:52px;padding:0 16px;border-bottom:1px solid var(--border)}.icon-btn{display:none;width:34px;height:34px;border:none;background:transparent;color:var(--text-dim);cursor:pointer;border-radius:7px;align-items:center;justify-content:center}.icon-btn:hover{color:var(--text);background:var(--hover)}#crumb{font-size:12.5px;color:var(--text);font-weight:500;letter-spacing:-.01em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#crumb .crumb-seg{color:var(--text-dim);cursor:pointer}#crumb .crumb-seg:hover{color:var(--accent-bright)}#crumb .crumb-sep{color:var(--text-ghost);margin:0 5px}#meta{flex:1;min-width:0;font-size:12px;color:var(--text-faint);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.btn{display:inline-flex;align-items:center;gap:6px;flex:none;height:30px;padding:0 11px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font-size:12.5px;font-weight:500;cursor:pointer;text-decoration:none}.btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.btn .ico{width:15px;height:15px}.btn.ghost{color:var(--text-dim)}#search-btn{position:absolute;left:50%;transform:translate(-50%);width:260px;justify-content:flex-start}#search-btn kbd{margin-left:auto}#search-btn kbd{font:11px var(--ui);color:var(--text-faint);background:var(--hover);border:1px solid var(--border-2);border-radius:5px;padding:1px 5px;margin-left:2px}#more-menu{position:absolute;right:12px;top:calc(100% - 4px);z-index:80;background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-card);box-shadow:0 18px 44px -14px #000000bf;padding:6px;min-width:168px}.more-item{display:block;width:100%;text-align:left;min-height:40px;padding:0 12px;background:transparent;border:none;cursor:pointer;color:var(--text);font:inherit;font-size:13.5px;border-radius:var(--r-ctl)}.more-item:hover{background:var(--hover)}#content{flex:1;overflow-y:auto;padding:44px 40px 110px;scroll-behavior:smooth}.empty{color:var(--text-faint);text-align:center;margin-top:22vh}.empty-hint{display:block;margin-top:6px;font-size:12px;color:var(--text-ghost)}.onboard{max-width:560px;margin:8vh auto 0}.onboard h1{font-size:25px;font-weight:640;letter-spacing:-.02em;margin:0 0 8px;color:#f4f6f9}.onboard>p{color:var(--text-dim);margin:0 0 28px;font-size:14px}.ob-card{background:var(--bg-side);border:1px solid var(--border);border-radius:var(--r-card);padding:20px 22px;margin-bottom:14px}.ob-card h3{margin:0 0 6px;font-size:14.5px;font-weight:600}.ob-card p{margin:0 0 14px;font-size:13px;color:var(--text-dim)}.ob-row{display:flex;gap:9px}.ob-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.ob-row input:focus{border-color:var(--accent);background:var(--hover)}.pbtn{display:inline-flex;align-items:center;gap:6px;flex:none;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:var(--accent);color:#241704;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap}.pbtn:hover{background:var(--accent-bright)}.pbtn .ico{width:15px;height:15px}.danger-btn{display:inline-flex;align-items:center;height:32px;padding:0 14px;border-radius:var(--r-ctl);border:none;background:#b3382e;color:#fff;font-size:13px;font-weight:600;cursor:pointer}.danger-btn:hover{background:#c94336}.admin{max-width:760px}.admin h1{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 6px;color:#f4f6f9}.admin h3{font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-ghost);font-weight:600;margin:30px 0 10px}.admin-sub{color:var(--text-dim);font-size:13.5px;margin:0 0 6px;line-height:1.55}.admin-h{display:flex;align-items:center;justify-content:space-between;margin:30px 0 10px}.admin-h h3{margin:0}.admin-row{display:flex;gap:9px;margin-bottom:8px}.admin-row input{flex:1;height:34px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.admin-row input:focus{border-color:var(--accent);background:var(--hover)}.admin-list{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.admin-item{display:flex;align-items:center;gap:11px;padding:11px 14px;border-bottom:1px solid var(--border);font-size:13.5px}.admin-item:last-child{border-bottom:none}.admin-item:hover{background:#ffffff04}.ai-main{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.ai-main.mono{font:12px var(--mono);color:var(--text-dim);cursor:pointer}.ai-tag{font-size:11.5px;color:var(--text-faint);flex:none}.admin-item select{height:28px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:0 8px;font:inherit;font-size:12.5px;cursor:pointer}.admin-item select:hover{border-color:var(--border-2)}.ai-btn,.ai-del{flex:none;height:27px;padding:0 11px;border-radius:6px;border:1px solid var(--border);background:var(--surface);color:var(--text-dim);font:inherit;font-size:12px;font-weight:500;cursor:pointer}.ai-btn:hover{background:var(--hover);color:var(--text);border-color:var(--border-2)}.ai-del{color:var(--del);border-color:transparent;background:transparent}.ai-del:hover{background:#f26d6d1f;color:#ff8b8b}.admin-empty{padding:14px;color:var(--text-faint);font-size:13px}.admin-item.toggle{cursor:pointer;align-items:flex-start}.admin-item.toggle .ai-main{white-space:normal}.tg-label{font-size:13.5px;font-weight:550;color:var(--text)}.tg-desc{font-size:12px;color:var(--text-faint);margin-top:3px;line-height:1.5}.admin-item.toggle input{width:16px;height:16px;margin-top:2px;accent-color:var(--accent);flex:none}.dirlist{max-width:704px;margin:0 auto}.dl-title{display:flex;align-items:center;gap:10px;font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.dl-title-icon{display:flex;color:var(--accent)}.dl-title-icon .ico{width:20px;height:20px}.dl-sub{color:var(--text-faint);font-size:12.5px;margin:0 0 18px}.dl-items{border:1px solid var(--border);border-radius:var(--r-card);overflow:hidden;background:var(--bg-side)}.dl-row{display:flex;align-items:center;gap:11px;padding:10px 14px;border-bottom:1px solid var(--border);cursor:pointer}.dl-row:last-child{border-bottom:none}.dl-row:hover{background:var(--hover)}.dl-row .ticon{flex:none;display:flex;color:var(--text-ghost)}.dl-row .ticon .ico{width:16px;height:16px}.dl-row:hover .ticon{color:var(--text-faint)}.dl-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px;color:var(--text)}.dl-meta{flex:none;font-size:12px;color:var(--text-faint);font-variant-numeric:tabular-nums}.heatdot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--accent)}.heatdot.lvl1{opacity:.3}.heatdot.lvl2{opacity:.55}.heatdot.lvl3{opacity:.8}.heatdot.lvl4{opacity:1;box-shadow:0 0 6px #f5a6238c}.dl-empty{padding:24px 14px;color:var(--text-faint);font-size:13px;border:1px dashed var(--border);border-radius:var(--r-card);text-align:center}.dl-h3{margin:28px 0 8px;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--text-ghost);font-weight:600}.dl-hlist{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden;max-width:none}.dl-hlist .hentry:last-child{border-bottom:none}.hentry.clickable{cursor:pointer}.hentry.clickable:hover{background:var(--hover)}.dl-more{margin-top:10px}#vault-name.vault-link{cursor:pointer}#vault-name.vault-link:hover{color:var(--accent-bright)}.guide{max-width:760px;margin:0 auto}.gd-tabs{display:flex;gap:2px;margin:20px 0 16px;border-bottom:1px solid var(--border);overflow-x:auto}.gd-tab{font:inherit;font-size:13px;font-weight:600;padding:7px 12px 9px;background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;color:var(--text-faint);cursor:pointer;white-space:nowrap}.gd-tab:hover{color:var(--text)}.gd-tab.active{color:var(--accent-bright);border-bottom-color:var(--accent)}.gd-step{margin:0 0 18px}.gd-step-head{display:flex;align-items:center;gap:10px;margin-bottom:3px}.gd-num{flex:none;width:22px;height:22px;border-radius:50%;background:var(--glow);color:var(--accent-bright);font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center}.gd-step-title{font-weight:600;font-size:14px;color:var(--text)}.gd-desc{margin:2px 0 8px 32px;color:var(--text-faint);font-size:13px;line-height:1.5}.gd-extra{font-size:12.5px;margin-top:6px}.gd-code{position:relative;margin:6px 0 6px 32px;padding:10px 72px 10px 12px;background:var(--bg-raise);border:1px solid var(--border);border-radius:var(--r-card);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;color:var(--text);overflow-x:auto;white-space:pre}.gd-copy{position:absolute;top:7px;right:7px;font:inherit;font-family:inherit;font-size:11px;font-weight:600;padding:3px 9px;border-radius:6px;border:1px solid var(--border-2);background:var(--bg-raise);color:var(--text-faint);cursor:pointer;box-shadow:-14px 0 12px -6px var(--bg-raise)}.gd-copy:hover{color:var(--accent-bright);border-color:var(--accent-dim)}.gd-done{margin:22px 0 8px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);color:var(--text-faint);font-size:13px;line-height:1.5}.home-insights{margin-top:30px;padding-top:22px;border-top:1px solid var(--border)}.insights{max-width:760px;margin:0 auto}.in-title{font-size:21px;font-weight:640;letter-spacing:-.02em;margin:0 0 4px;color:#f4f6f9}.in-title .in-scope{color:var(--text-ghost);font-weight:500;font-size:15px}.in-lens{display:flex;gap:6px;margin:0 0 14px}.in-lens-btn{font:inherit;font-size:12px;padding:5px 12px;border-radius:999px;border:1px solid var(--border);background:none;color:var(--text-faint);cursor:pointer}.in-lens-btn:hover{color:var(--text)}.in-lens-btn.active{color:var(--accent);border-color:var(--accent)}.in-chart{width:100%;height:auto;border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);margin-bottom:6px}.in-axis{stroke:var(--border);stroke-width:1}.in-threshold{stroke:var(--border);stroke-width:1;stroke-dasharray:4 4}.in-danger-zone{fill:#f26d6d0d}.in-label{fill:var(--text-ghost);font-size:11px}.in-quad{fill:var(--text-ghost);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em}.in-quad-danger{fill:#e07070}.in-pt{fill:var(--accent);opacity:.5;cursor:pointer}.in-pt:hover{opacity:1}.in-pt.cold{fill:var(--text-ghost);opacity:.25}.in-pt.danger{fill:#e05d5d;opacity:.6}.in-treemap{background:#0c0d10}.in-tm-group{fill:none;stroke:var(--border);stroke-width:1;cursor:pointer;pointer-events:all}.in-tm-glabel{fill:var(--text-faint);font-size:10px;text-transform:uppercase;letter-spacing:.05em;cursor:pointer}.in-tm-cell{cursor:pointer}.in-tm-cell:hover{stroke:#fff;stroke-width:1}.in-tm-label{fill:#0c0d10;font-size:10.5px;font-weight:620;cursor:pointer;pointer-events:none}.in-hotpath{border:1px solid var(--border);border-radius:var(--r-card);background:var(--bg-side);overflow:hidden}.in-hp-row{display:flex;align-items:center;gap:10px;padding:6px 12px;border-bottom:1px solid var(--border);cursor:pointer}.in-hp-row:last-child{border-bottom:none}.in-hp-row:hover{background:var(--hover)}.in-hp-name{flex:0 0 300px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--text)}.in-hp-name.danger{color:var(--accent)}.in-hp-bar{flex:1;display:flex;height:10px;border-radius:3px;overflow:hidden}.in-hp-agent{background:var(--accent)}.in-hp-human{background:#5b8def}.in-hp-count{flex:none;width:40px;text-align:right;font-size:11.5px;color:var(--text-faint);font-variant-numeric:tabular-nums}.in-legend{margin:8px 2px 0;font-size:11.5px;color:var(--text-faint)}.in-sw{display:inline-block;width:10px;height:10px;border-radius:2px;vertical-align:-1px}.in-sw.agent{background:var(--accent)}.in-sw.human{background:#5b8def}.in-matrix rect{transition:opacity .1s}.in-matrix rect:hover{opacity:.85}.history{max-width:860px}.hentry{padding:11px 12px;border-bottom:1px solid var(--border)}.hentry:hover{background:#ffffff04}.hline{display:flex;gap:10px;align-items:center}.hkind{display:inline-flex;color:var(--add)}.hkind .ico{width:13px;height:13px}.hentry.edit .hkind{color:var(--accent)}.hentry.delete .hkind{color:var(--del)}.htag{flex:none;font-size:10px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:1px 6px;border-radius:4px}.hentry.add .htag{color:var(--add);background:#4cc38a1f}.hentry.edit .htag{color:var(--accent-bright);background:var(--glow)}.hentry.delete .htag{color:#ff8b8b;background:#f26d6d1f}.hpath{font-weight:500;cursor:pointer;color:var(--text);font-size:13px}.hpath:hover{color:var(--accent-bright)}.htime{margin-left:auto;color:var(--text-faint);font-size:12px;font-variant-numeric:tabular-nums}.hmeta{display:flex;align-items:center;gap:14px;margin-top:4px;padding-left:23px;font-size:12px;color:var(--text-dim)}.hdev,.hsize{color:var(--text-faint)}.hsize{font-variant-numeric:tabular-nums;white-space:nowrap;flex:none}.hnote{margin-top:4px;padding-left:23px;font-size:12px;color:var(--text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.hnote:hover{color:var(--text)}.hnote.open{white-space:normal;overflow-wrap:anywhere}.hnote:before{content:"› ";color:var(--text-ghost)}.hnote a{color:var(--accent-bright);text-decoration:none}.hnote a:hover{text-decoration:underline}#palette-overlay{position:fixed;inset:0;background:#0607099e;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);display:flex;justify-content:center;align-items:flex-start;padding-top:12vh;z-index:100}#palette{width:min(560px,92vw);background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);box-shadow:0 24px 70px -18px #000c;overflow:hidden}#palette-inputwrap{display:flex;align-items:center;gap:11px;padding:14px 16px;border-bottom:1px solid var(--border)}#palette-inputwrap .ico{width:17px;height:17px;color:var(--text-faint)}#palette-input{flex:1;width:100%;border:none;background:transparent;color:var(--text);font:inherit;font-size:15px;letter-spacing:-.01em;outline:none;padding:0}#palette-input::placeholder{color:var(--text-ghost)}#palette-results{list-style:none;margin:0;padding:8px;max-height:46vh;overflow-y:auto}#palette-results li{display:flex;align-items:center;gap:11px;height:38px;padding:0 10px;border-radius:9px;cursor:pointer;color:var(--text-dim);font-size:13.5px}#palette-results li.selected{background:var(--glow)}#palette-results li.selected .picon{color:var(--accent)}#palette-results li.selected .plabel,#palette-results li.selected .plabel b{color:var(--accent-bright)}#palette-results li .picon{width:18px;flex:none;display:flex;justify-content:center;color:var(--text-faint)}#palette-results li .picon .ico{width:15px;height:15px}#palette-results li .plabel{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}#palette-results li .plabel b{color:var(--accent-bright);font-weight:600}#palette-results li .pkind{flex:none;font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-ghost)}#palette-results .pempty{color:var(--text-faint);cursor:default;justify-content:center;height:auto;padding:14px}#palette-hint{padding:9px 16px;border-top:1px solid var(--border);font-size:11px;color:var(--text-ghost)}.modal-back{position:fixed;inset:0;background:#06070999;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;z-index:150;padding:20px}.modal{background:var(--bg-raise);border:1px solid var(--border-2);border-radius:var(--r-over);padding:22px 24px;width:min(460px,100%);box-shadow:0 24px 70px -18px #000c}.modal h3{margin:0 0 10px;font-size:16px;font-weight:620;letter-spacing:-.01em}.modal p{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal p b{color:var(--text)}.modal-url{font:12px var(--mono);background:var(--surface);border:1px solid var(--border);border-radius:var(--r-ctl);padding:9px 11px;color:var(--text-dim);word-break:break-all;margin-bottom:16px}.modal-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.modal-label{display:block;font-size:12.5px;color:var(--text-dim);margin:0 0 6px}.modal-msg{margin:0 0 16px;font-size:13.5px;color:var(--text-dim);line-height:1.55}.modal-input{width:100%;height:36px;padding:0 12px;border-radius:var(--r-ctl);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:14px;margin-bottom:16px;outline:none}.modal-input:focus{border-color:var(--accent);background:var(--hover)}#toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%) translateY(20px);background:var(--bg-raise);color:var(--text);border:1px solid var(--border-2);border-radius:10px;padding:11px 18px;font-size:13.5px;box-shadow:0 18px 44px -12px #000000b3;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:200}#toast.show{opacity:1;transform:translate(-50%) translateY(0)}#toast.err{border-color:#f26d6d80;color:#ffb0aa}#sb-backdrop{display:none}@media(max-width:900px){#sidebar{position:fixed;z-index:60;top:0;left:0;height:100%;transform:translate(-100%);transition:transform .2s ease;box-shadow:0 0 40px #0009}body.sb-open #sidebar{transform:translate(0)}body.sb-open #sb-backdrop{display:block;position:fixed;inset:0;background:#0000008c;z-index:50}.icon-btn{display:inline-flex;width:44px;height:44px}#content{padding:24px 18px 70px}#topbar{padding:0 8px;gap:4px}#search-btn{position:static;transform:none;width:auto;justify-content:center}#search-btn kbd,.btn .lbl{display:none}#topbar .btn{min-width:44px;min-height:44px;padding:0;justify-content:center;gap:0}#topbar .btn .ico{width:18px;height:18px}#more-btn:not([hidden]){display:inline-flex}#history-btn,#upload-btn,#download{display:none!important}#meta{display:none}#crumb{flex:1}#vault{padding:0 8px 0 12px}.icon-btn2,#signout,#tree li>.row,#projects .row{height:44px}#account-btn,#project-select{min-height:44px}.nav-add{min-width:44px;min-height:44px}.markdown,.admin,.onboard,.history,.dirlist{max-width:100%}.markdown table,pre.plain{display:block;overflow-x:auto;max-width:100%}.ob-row{flex-direction:column}.ob-row input{flex:none;min-height:44px}.admin-item{flex-wrap:wrap;row-gap:8px;padding:12px 14px}.admin-item select{height:44px}.ai-btn,.ai-del{height:auto;min-height:44px;padding:0 12px}.admin-item .ai-main{flex:1 1 100%;white-space:normal;overflow-wrap:break-word}.gd-code{min-height:62px;padding-top:12px;padding-bottom:12px}.gd-copy{min-height:44px;padding:0 14px}.gd-tab{min-height:44px}.in-lens-btn{min-height:44px;padding:0 14px}.modal-input{height:44px}.modal-actions button,.pbtn,#palette-results li{height:auto;min-height:44px}.more-item{min-height:44px}}.modal-actions .ai-del{margin-right:auto}@media(max-width:430px){.dl-meta{display:none}.ai-tag{font-size:11px}.htime{white-space:nowrap;font-size:12px}.hline{flex-wrap:wrap}.modal-actions .ai-del{flex:0 0 100%}}.markdown{max-width:704px;width:100%;margin:0 auto}.markdown h1,.markdown h2,.markdown h3,.markdown h4{color:#f4f6f9;line-height:1.25;letter-spacing:-.018em;margin:1.5em 0 .5em;text-wrap:balance}.markdown h1:first-child{margin-top:0}.markdown h1{font-size:1.85em;font-weight:660;letter-spacing:-.024em}.markdown h2{font-size:1.32em;font-weight:620;margin-top:1.7em}.markdown h3{font-size:1.08em;font-weight:620}.markdown p,.markdown li{color:#c6cbd3;font-size:14.5px;line-height:1.72}.markdown p{margin:0 0 1em}.markdown strong{color:var(--text);font-weight:620}.markdown a{color:var(--accent-bright);text-decoration:none;border-bottom:1px solid rgba(245,166,35,.28)}.markdown a:hover{border-bottom-color:var(--accent)}.markdown ul,.markdown ol{margin:0 0 1em;padding-left:1.4em}.markdown li{margin-bottom:.4em}.markdown li::marker{color:var(--text-ghost)}.markdown code{background:var(--hover);border:1px solid var(--border);padding:.1em .4em;border-radius:5px;font:12.5px/1.5 var(--mono);color:#e4d9c4}.markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;margin:1.3em 0}.markdown pre code{background:none;border:none;padding:0;color:#c6cbd3}.markdown blockquote{margin:1.3em 0;padding:.3em 1em;border-left:2px solid var(--accent);background:linear-gradient(90deg,var(--glow),transparent);border-radius:0 8px 8px 0;color:#d8cdb6}.markdown blockquote p{margin:.3em 0;color:#d8cdb6}.markdown table{border-collapse:collapse;margin:1.3em 0;font-size:13.5px}.markdown th,.markdown td{border-bottom:1px solid var(--border);padding:9px 13px;text-align:left}.markdown th{color:var(--text-faint);font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;border-bottom-color:var(--border-2)}.markdown tr:hover td{background:#ffffff05}.markdown img{max-width:100%;border-radius:8px;border:1px solid var(--border)}.markdown hr{border:none;border-top:1px solid var(--border);margin:2.2em 0}.markdown table.frontmatter{margin:0 0 1.8em;font-size:12px;background:var(--surface);border:1px solid var(--border);border-radius:8px;border-collapse:separate;border-spacing:0}.markdown table.frontmatter th{text-transform:none;letter-spacing:0;font-size:11.5px;color:var(--text-faint);font-weight:600;text-align:left;white-space:nowrap;vertical-align:top;padding:6px 14px 6px 12px;border-bottom:1px solid var(--border)}.markdown table.frontmatter td{color:var(--text-dim);padding:6px 12px 6px 0;border-bottom:1px solid var(--border)}.markdown table.frontmatter tr:last-child th,.markdown table.frontmatter tr:last-child td{border-bottom:none}.markdown table.frontmatter code{white-space:pre-wrap;font-size:11px}.markdown input[type=checkbox]{accent-color:var(--accent)}.htmlview{display:block;width:100%;height:calc(100vh - 150px);border:1px solid var(--border);border-radius:var(--r-card);background:#fff}.notfound{margin-top:12vh;text-align:center;color:var(--text-dim)}.notfound h1{color:var(--text);font-size:1.4em;margin-bottom:.5em}.notfound code{background:var(--hover);border:1px solid var(--border);padding:.15em .5em;border-radius:6px}.notfound .nf-sub{max-width:440px;margin:12px auto 20px;font-size:13px;color:var(--text-faint);line-height:1.6}pre.plain{background:var(--code-bg);border:1px solid var(--border);border-radius:var(--r-card);padding:14px 16px;overflow-x:auto;font:12.5px/1.6 var(--mono);color:#c6cbd3;white-space:pre-wrap;overflow-wrap:anywhere;max-width:900px}#content.markdown{min-width:0}.filecard{margin-top:15vh;text-align:center;color:var(--text-dim)}.filecard .name{font-size:1.2em;color:var(--text);margin-bottom:.3em}.filecard .btn{margin-top:14px} diff --git a/internal/webapp/static/assets/index-XRsupwXA.js b/internal/webapp/static/assets/index-Ce0U9QAi.js similarity index 68% rename from internal/webapp/static/assets/index-XRsupwXA.js rename to internal/webapp/static/assets/index-Ce0U9QAi.js index 02e68b2..23e8699 100644 --- a/internal/webapp/static/assets/index-XRsupwXA.js +++ b/internal/webapp/static/assets/index-Ce0U9QAi.js @@ -1,11 +1,11 @@ -(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))f(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const g of m.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&f(g)}).observe(document,{childList:!0,subtree:!0});function r(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function f(d){if(d.ep)return;d.ep=!0;const m=r(d);fetch(d.href,m)}})();var Gs={exports:{}},Kn={};var yh;function Bv(){if(yh)return Kn;yh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function r(f,d,m){var g=null;if(m!==void 0&&(g=""+m),d.key!==void 0&&(g=""+d.key),"key"in d){m={};for(var A in d)A!=="key"&&(m[A]=d[A])}else m=d;return d=m.ref,{$$typeof:i,type:f,key:g,ref:d!==void 0?d:null,props:m}}return Kn.Fragment=c,Kn.jsx=r,Kn.jsxs=r,Kn}var vh;function Lv(){return vh||(vh=1,Gs.exports=Bv()),Gs.exports}var o=Lv(),Xs={exports:{}},W={};var ph;function Yv(){if(ph)return W;ph=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),g=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),x=Symbol.iterator;function q(S){return S===null||typeof S!="object"?null:(S=x&&S[x]||S["@@iterator"],typeof S=="function"?S:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,Y={};function $(S,H,L){this.props=S,this.context=H,this.refs=Y,this.updater=L||z}$.prototype.isReactComponent={},$.prototype.setState=function(S,H){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,H,"setState")},$.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function yt(){}yt.prototype=$.prototype;function ot(S,H,L){this.props=S,this.context=H,this.refs=Y,this.updater=L||z}var Ct=ot.prototype=new yt;Ct.constructor=ot,w(Ct,$.prototype),Ct.isPureReactComponent=!0;var Rt=Array.isArray;function et(){}var k={H:null,A:null,T:null,S:null},gt=Object.prototype.hasOwnProperty;function wt(S,H,L){var G=L.ref;return{$$typeof:i,type:S,key:H,ref:G!==void 0?G:null,props:L}}function ue(S,H){return wt(S.type,H,S.props)}function le(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function _t(S){var H={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(L){return H[L]})}var ce=/\/+/g;function Ut(S,H){return typeof S=="object"&&S!==null&&S.key!=null?_t(""+S.key):H.toString(36)}function kt(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(et,et):(S.status="pending",S.then(function(H){S.status==="pending"&&(S.status="fulfilled",S.value=H)},function(H){S.status==="pending"&&(S.status="rejected",S.reason=H)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function D(S,H,L,G,J){var lt=typeof S;(lt==="undefined"||lt==="boolean")&&(S=null);var rt=!1;if(S===null)rt=!0;else switch(lt){case"bigint":case"string":case"number":rt=!0;break;case"object":switch(S.$$typeof){case i:case c:rt=!0;break;case M:return rt=S._init,D(rt(S._payload),H,L,G,J)}}if(rt)return J=J(S),rt=G===""?"."+Ut(S,0):G,Rt(J)?(L="",rt!=null&&(L=rt.replace(ce,"$&/")+"/"),D(J,H,L,"",function(Xl){return Xl})):J!=null&&(le(J)&&(J=ue(J,L+(J.key==null||S&&S.key===J.key?"":(""+J.key).replace(ce,"$&/")+"/")+rt)),H.push(J)),1;rt=0;var Vt=G===""?".":G+":";if(Rt(S))for(var Dt=0;Dt>>1,dt=D[vt];if(0>>1;vtd(L,V))Gd(J,L)?(D[vt]=J,D[G]=V,vt=G):(D[vt]=L,D[H]=V,vt=H);else if(Gd(J,V))D[vt]=J,D[G]=V,vt=G;else break t}}return B}function d(D,B){var V=D.sortIndex-B.sortIndex;return V!==0?V:D.id-B.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var g=Date,A=g.now();i.unstable_now=function(){return g.now()-A}}var p=[],y=[],M=1,E=null,x=3,q=!1,z=!1,w=!1,Y=!1,$=typeof setTimeout=="function"?setTimeout:null,yt=typeof clearTimeout=="function"?clearTimeout:null,ot=typeof setImmediate<"u"?setImmediate:null;function Ct(D){for(var B=r(y);B!==null;){if(B.callback===null)f(y);else if(B.startTime<=D)f(y),B.sortIndex=B.expirationTime,c(p,B);else break;B=r(y)}}function Rt(D){if(w=!1,Ct(D),!z)if(r(p)!==null)z=!0,et||(et=!0,_t());else{var B=r(y);B!==null&&kt(Rt,B.startTime-D)}}var et=!1,k=-1,gt=5,wt=-1;function ue(){return Y?!0:!(i.unstable_now()-wtD&&ue());){var vt=E.callback;if(typeof vt=="function"){E.callback=null,x=E.priorityLevel;var dt=vt(E.expirationTime<=D);if(D=i.unstable_now(),typeof dt=="function"){E.callback=dt,Ct(D),B=!0;break e}E===r(p)&&f(p),Ct(D)}else f(p);E=r(p)}if(E!==null)B=!0;else{var S=r(y);S!==null&&kt(Rt,S.startTime-D),B=!1}}break t}finally{E=null,x=V,q=!1}B=void 0}}finally{B?_t():et=!1}}}var _t;if(typeof ot=="function")_t=function(){ot(le)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Ut=ce.port2;ce.port1.onmessage=le,_t=function(){Ut.postMessage(null)}}else _t=function(){$(le,0)};function kt(D,B){k=$(function(){D(i.unstable_now())},B)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(D){D.callback=null},i.unstable_forceFrameRate=function(D){0>D||125vt?(D.sortIndex=V,c(y,D),r(p)===null&&D===r(y)&&(w?(yt(k),k=-1):w=!0,kt(Rt,V-vt))):(D.sortIndex=dt,c(p,D),z||q||(z=!0,et||(et=!0,_t()))),D},i.unstable_shouldYield=ue,i.unstable_wrapCallback=function(D){var B=x;return function(){var V=x;x=B;try{return D.apply(this,arguments)}finally{x=V}}}})(ks)),ks}var Sh;function Xv(){return Sh||(Sh=1,Zs.exports=Gv()),Zs.exports}var Vs={exports:{}},ae={};var xh;function Kv(){if(xh)return ae;xh=1;var i=ir();function c(p){var y="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Vs.exports=Kv(),Vs.exports}var Eh;function kv(){if(Eh)return Zn;Eh=1;var i=Xv(),c=ir(),r=Zv();function f(t){var e="https://react.dev/errors/"+t;if(1dt||(t.current=vt[dt],vt[dt]=null,dt--)}function L(t,e){dt++,vt[dt]=t.current,t.current=e}var G=S(null),J=S(null),lt=S(null),rt=S(null);function Vt(t,e){switch(L(lt,e),L(J,t),L(G,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Qd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Qd(e),t=Bd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(G),L(G,t)}function Dt(){H(G),H(J),H(lt)}function Xl(t){t.memoizedState!==null&&L(rt,t);var e=G.current,l=Bd(e,t.type);e!==l&&(L(J,t),L(G,l))}function ml(t){J.current===t&&(H(G),H(J)),rt.current===t&&(H(rt),Ln._currentValue=V)}var yl,li;function ze(t){if(yl===void 0)try{throw Error()}catch(l){var e=l.stack.trim().match(/\n( *(at )?)/);yl=e&&e[1]||"",li=-1{for(const m of d)if(m.type==="childList")for(const g of m.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&f(g)}).observe(document,{childList:!0,subtree:!0});function r(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function f(d){if(d.ep)return;d.ep=!0;const m=r(d);fetch(d.href,m)}})();var Gs={exports:{}},Kn={};var vh;function Lv(){if(vh)return Kn;vh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function r(f,d,m){var g=null;if(m!==void 0&&(g=""+m),d.key!==void 0&&(g=""+d.key),"key"in d){m={};for(var A in d)A!=="key"&&(m[A]=d[A])}else m=d;return d=m.ref,{$$typeof:i,type:f,key:g,ref:d!==void 0?d:null,props:m}}return Kn.Fragment=c,Kn.jsx=r,Kn.jsxs=r,Kn}var ph;function Yv(){return ph||(ph=1,Gs.exports=Lv()),Gs.exports}var o=Yv(),Xs={exports:{}},W={};var gh;function Gv(){if(gh)return W;gh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),g=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),x=Symbol.iterator;function q(S){return S===null||typeof S!="object"?null:(S=x&&S[x]||S["@@iterator"],typeof S=="function"?S:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,Y={};function $(S,H,L){this.props=S,this.context=H,this.refs=Y,this.updater=L||z}$.prototype.isReactComponent={},$.prototype.setState=function(S,H){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,H,"setState")},$.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function yt(){}yt.prototype=$.prototype;function ot(S,H,L){this.props=S,this.context=H,this.refs=Y,this.updater=L||z}var Ct=ot.prototype=new yt;Ct.constructor=ot,w(Ct,$.prototype),Ct.isPureReactComponent=!0;var Rt=Array.isArray;function et(){}var k={H:null,A:null,T:null,S:null},gt=Object.prototype.hasOwnProperty;function wt(S,H,L){var G=L.ref;return{$$typeof:i,type:S,key:H,ref:G!==void 0?G:null,props:L}}function ue(S,H){return wt(S.type,H,S.props)}function le(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function _t(S){var H={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(L){return H[L]})}var ce=/\/+/g;function Ut(S,H){return typeof S=="object"&&S!==null&&S.key!=null?_t(""+S.key):H.toString(36)}function kt(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(et,et):(S.status="pending",S.then(function(H){S.status==="pending"&&(S.status="fulfilled",S.value=H)},function(H){S.status==="pending"&&(S.status="rejected",S.reason=H)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function D(S,H,L,G,J){var lt=typeof S;(lt==="undefined"||lt==="boolean")&&(S=null);var rt=!1;if(S===null)rt=!0;else switch(lt){case"bigint":case"string":case"number":rt=!0;break;case"object":switch(S.$$typeof){case i:case c:rt=!0;break;case M:return rt=S._init,D(rt(S._payload),H,L,G,J)}}if(rt)return J=J(S),rt=G===""?"."+Ut(S,0):G,Rt(J)?(L="",rt!=null&&(L=rt.replace(ce,"$&/")+"/"),D(J,H,L,"",function(Xl){return Xl})):J!=null&&(le(J)&&(J=ue(J,L+(J.key==null||S&&S.key===J.key?"":(""+J.key).replace(ce,"$&/")+"/")+rt)),H.push(J)),1;rt=0;var Vt=G===""?".":G+":";if(Rt(S))for(var Dt=0;Dt>>1,dt=D[vt];if(0>>1;vtd(L,V))Gd(J,L)?(D[vt]=J,D[G]=V,vt=G):(D[vt]=L,D[H]=V,vt=H);else if(Gd(J,V))D[vt]=J,D[G]=V,vt=G;else break t}}return B}function d(D,B){var V=D.sortIndex-B.sortIndex;return V!==0?V:D.id-B.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var g=Date,A=g.now();i.unstable_now=function(){return g.now()-A}}var p=[],y=[],M=1,E=null,x=3,q=!1,z=!1,w=!1,Y=!1,$=typeof setTimeout=="function"?setTimeout:null,yt=typeof clearTimeout=="function"?clearTimeout:null,ot=typeof setImmediate<"u"?setImmediate:null;function Ct(D){for(var B=r(y);B!==null;){if(B.callback===null)f(y);else if(B.startTime<=D)f(y),B.sortIndex=B.expirationTime,c(p,B);else break;B=r(y)}}function Rt(D){if(w=!1,Ct(D),!z)if(r(p)!==null)z=!0,et||(et=!0,_t());else{var B=r(y);B!==null&&kt(Rt,B.startTime-D)}}var et=!1,k=-1,gt=5,wt=-1;function ue(){return Y?!0:!(i.unstable_now()-wtD&&ue());){var vt=E.callback;if(typeof vt=="function"){E.callback=null,x=E.priorityLevel;var dt=vt(E.expirationTime<=D);if(D=i.unstable_now(),typeof dt=="function"){E.callback=dt,Ct(D),B=!0;break e}E===r(p)&&f(p),Ct(D)}else f(p);E=r(p)}if(E!==null)B=!0;else{var S=r(y);S!==null&&kt(Rt,S.startTime-D),B=!1}}break t}finally{E=null,x=V,q=!1}B=void 0}}finally{B?_t():et=!1}}}var _t;if(typeof ot=="function")_t=function(){ot(le)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Ut=ce.port2;ce.port1.onmessage=le,_t=function(){Ut.postMessage(null)}}else _t=function(){$(le,0)};function kt(D,B){k=$(function(){D(i.unstable_now())},B)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(D){D.callback=null},i.unstable_forceFrameRate=function(D){0>D||125vt?(D.sortIndex=V,c(y,D),r(p)===null&&D===r(y)&&(w?(yt(k),k=-1):w=!0,kt(Rt,V-vt))):(D.sortIndex=dt,c(p,D),z||q||(z=!0,et||(et=!0,_t()))),D},i.unstable_shouldYield=ue,i.unstable_wrapCallback=function(D){var B=x;return function(){var V=x;x=B;try{return D.apply(this,arguments)}finally{x=V}}}})(ks)),ks}var xh;function Kv(){return xh||(xh=1,Zs.exports=Xv()),Zs.exports}var Vs={exports:{}},ae={};var jh;function Zv(){if(jh)return ae;jh=1;var i=ur();function c(p){var y="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Vs.exports=Zv(),Vs.exports}var Th;function Vv(){if(Th)return Zn;Th=1;var i=Kv(),c=ur(),r=kv();function f(t){var e="https://react.dev/errors/"+t;if(1dt||(t.current=vt[dt],vt[dt]=null,dt--)}function L(t,e){dt++,vt[dt]=t.current,t.current=e}var G=S(null),J=S(null),lt=S(null),rt=S(null);function Vt(t,e){switch(L(lt,e),L(J,t),L(G,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Bd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Bd(e),t=Ld(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(G),L(G,t)}function Dt(){H(G),H(J),H(lt)}function Xl(t){t.memoizedState!==null&&L(rt,t);var e=G.current,l=Ld(e,t.type);e!==l&&(L(J,t),L(G,l))}function ml(t){J.current===t&&(H(G),H(J)),rt.current===t&&(H(rt),Ln._currentValue=V)}var yl,li;function ze(t){if(yl===void 0)try{throw Error()}catch(l){var e=l.stack.trim().match(/\n( *(at )?)/);yl=e&&e[1]||"",li=-1)":-1n||v[a]!==N[n]){var _=` `+v[a].replace(" at new "," at ");return t.displayName&&_.includes("")&&(_=_.replace("",t.displayName)),_}while(1<=a&&0<=n);break}}}finally{Ye=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?ze(l):""}function Au(t,e){switch(t.tag){case 26:case 27:case 5:return ze(t.type);case 16:return ze("Lazy");case 13:return t.child!==e&&e!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return se(t.type,!1);case 11:return se(t.type.render,!1);case 1:return se(t.type,!0);case 31:return ze("Activity");default:return""}}function ai(t){try{var e="",l=null;do e+=Au(t,l),l=t,t=t.return;while(t);return e}catch(a){return` Error generating stack: `+a.message+` -`+a.stack}}var P=Object.prototype.hasOwnProperty,ft=i.unstable_scheduleCallback,xt=i.unstable_cancelCallback,$a=i.unstable_shouldYield,Cu=i.unstable_requestPaint,ne=i.unstable_now,bm=i.unstable_getCurrentPriorityLevel,mr=i.unstable_ImmediatePriority,yr=i.unstable_UserBlockingPriority,ni=i.unstable_NormalPriority,Sm=i.unstable_LowPriority,vr=i.unstable_IdlePriority,xm=i.log,jm=i.unstable_setDisableYieldValue,Wa=null,be=null;function vl(t){if(typeof xm=="function"&&jm(t),be&&typeof be.setStrictMode=="function")try{be.setStrictMode(Wa,t)}catch{}}var Se=Math.clz32?Math.clz32:Nm,Em=Math.log,Tm=Math.LN2;function Nm(t){return t>>>=0,t===0?32:31-(Em(t)/Tm|0)|0}var ii=256,ui=262144,ci=4194304;function Kl(t){var e=t&42;if(e!==0)return e;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function si(t,e,l){var a=t.pendingLanes;if(a===0)return 0;var n=0,u=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var h=a&134217727;return h!==0?(a=h&~u,a!==0?n=Kl(a):(s&=h,s!==0?n=Kl(s):l||(l=h&~t,l!==0&&(n=Kl(l))))):(h=a&~u,h!==0?n=Kl(h):s!==0?n=Kl(s):l||(l=a&~t,l!==0&&(n=Kl(l)))),n===0?0:e!==0&&e!==n&&(e&u)===0&&(u=n&-n,l=e&-e,u>=l||u===32&&(l&4194048)!==0)?e:n}function Ia(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Om(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 pr(){var t=ci;return ci<<=1,(ci&62914560)===0&&(ci=4194304),t}function zu(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function Pa(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Mm(t,e,l,a,n,u){var s=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var h=t.entanglements,v=t.expirationTimes,N=t.hiddenUpdates;for(l=s&~l;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Rm=/[\n"\\]/g;function De(t){return t.replace(Rm,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function qu(t,e,l,a,n,u,s,h){t.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.type=s:t.removeAttribute("type"),e!=null?s==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+_e(e)):t.value!==""+_e(e)&&(t.value=""+_e(e)):s!=="submit"&&s!=="reset"||t.removeAttribute("value"),e!=null?wu(t,s,_e(e)):l!=null?wu(t,s,_e(l)):a!=null&&t.removeAttribute("value"),n==null&&u!=null&&(t.defaultChecked=!!u),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+_e(h):t.removeAttribute("name")}function zr(t,e,l,a,n,u,s,h){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),e!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||e!=null)){Hu(t);return}l=l!=null?""+_e(l):"",e=e!=null?""+_e(e):l,h||e===t.value||(t.value=e),t.defaultValue=e}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=h?t.checked:!!a,t.defaultChecked=!!a,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.name=s),Hu(t)}function wu(t,e,l){e==="number"&&oi(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function ma(t,e,l,a){if(t=t.options,e){e={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=!1;if(Ie)try{var an={};Object.defineProperty(an,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",an,an),window.removeEventListener("test",an,an)}catch{Gu=!1}var gl=null,Xu=null,hi=null;function wr(){if(hi)return hi;var t,e=Xu,l=e.length,a,n="value"in gl?gl.value:gl.textContent,u=n.length;for(t=0;t=cn),Xr=" ",Kr=!1;function Zr(t,e){switch(t){case"keyup":return cy.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kr(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function ry(t,e){switch(t){case"compositionend":return kr(e);case"keypress":return e.which!==32?null:(Kr=!0,Xr);case"textInput":return t=e.data,t===Xr&&Kr?null:t;default:return null}}function fy(t,e){if(ga)return t==="compositionend"||!Ju&&Zr(t,e)?(t=wr(),hi=Xu=gl=null,ga=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:l,offset:e-t};t=a}t:{for(;l;){if(l.nextSibling){l=l.nextSibling;break t}l=l.parentNode}l=void 0}l=tf(l)}}function lf(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?lf(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function af(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=oi(t.document);e instanceof t.HTMLIFrameElement;){try{var l=typeof e.contentWindow.location.href=="string"}catch{l=!1}if(l)t=e.contentWindow;else break;e=oi(t.document)}return e}function Wu(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var gy=Ie&&"documentMode"in document&&11>=document.documentMode,ba=null,Iu=null,on=null,Pu=!1;function nf(t,e,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pu||ba==null||ba!==oi(a)||(a=ba,"selectionStart"in a&&Wu(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),on&&fn(on,a)||(on=a,a=uu(Iu,"onSelect"),0>=s,n-=s,Ze=1<<32-Se(e)+n|l<tt?(ut=K,K=null):ut=K.sibling;var mt=O(j,K,T[tt],R);if(mt===null){K===null&&(K=ut);break}t&&K&&mt.alternate===null&&e(j,K),b=u(mt,b,tt),ht===null?Z=mt:ht.sibling=mt,ht=mt,K=ut}if(tt===T.length)return l(j,K),ct&&tl(j,tt),Z;if(K===null){for(;tttt?(ut=K,K=null):ut=K.sibling;var Ll=O(j,K,mt.value,R);if(Ll===null){K===null&&(K=ut);break}t&&K&&Ll.alternate===null&&e(j,K),b=u(Ll,b,tt),ht===null?Z=Ll:ht.sibling=Ll,ht=Ll,K=ut}if(mt.done)return l(j,K),ct&&tl(j,tt),Z;if(K===null){for(;!mt.done;tt++,mt=T.next())mt=U(j,mt.value,R),mt!==null&&(b=u(mt,b,tt),ht===null?Z=mt:ht.sibling=mt,ht=mt);return ct&&tl(j,tt),Z}for(K=a(K);!mt.done;tt++,mt=T.next())mt=C(K,j,tt,mt.value,R),mt!==null&&(t&&mt.alternate!==null&&K.delete(mt.key===null?tt:mt.key),b=u(mt,b,tt),ht===null?Z=mt:ht.sibling=mt,ht=mt);return t&&K.forEach(function(Qv){return e(j,Qv)}),ct&&tl(j,tt),Z}function Tt(j,b,T,R){if(typeof T=="object"&&T!==null&&T.type===w&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case q:t:{for(var Z=T.key;b!==null;){if(b.key===Z){if(Z=T.type,Z===w){if(b.tag===7){l(j,b.sibling),R=n(b,T.props.children),R.return=j,j=R;break t}}else if(b.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===gt&&ea(Z)===b.type){l(j,b.sibling),R=n(b,T.props),pn(R,T),R.return=j,j=R;break t}l(j,b);break}else e(j,b);b=b.sibling}T.type===w?(R=$l(T.props.children,j.mode,R,T.key),R.return=j,j=R):(R=Ei(T.type,T.key,T.props,null,j.mode,R),pn(R,T),R.return=j,j=R)}return s(j);case z:t:{for(Z=T.key;b!==null;){if(b.key===Z)if(b.tag===4&&b.stateNode.containerInfo===T.containerInfo&&b.stateNode.implementation===T.implementation){l(j,b.sibling),R=n(b,T.children||[]),R.return=j,j=R;break t}else{l(j,b);break}else e(j,b);b=b.sibling}R=uc(T,j.mode,R),R.return=j,j=R}return s(j);case gt:return T=ea(T),Tt(j,b,T,R)}if(kt(T))return X(j,b,T,R);if(_t(T)){if(Z=_t(T),typeof Z!="function")throw Error(f(150));return T=Z.call(T),F(j,b,T,R)}if(typeof T.then=="function")return Tt(j,b,zi(T),R);if(T.$$typeof===ot)return Tt(j,b,Oi(j,T),R);_i(j,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,b!==null&&b.tag===6?(l(j,b.sibling),R=n(b,T),R.return=j,j=R):(l(j,b),R=ic(T,j.mode,R),R.return=j,j=R),s(j)):l(j,b)}return function(j,b,T,R){try{vn=0;var Z=Tt(j,b,T,R);return za=null,Z}catch(K){if(K===Ca||K===Ai)throw K;var ht=je(29,K,null,j.mode);return ht.lanes=R,ht.return=j,ht}}}var aa=Af(!0),Cf=Af(!1),El=!1;function gc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bc(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Tl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Nl(t,e,l){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(pt&2)!==0){var n=a.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),a.pending=e,e=ji(t),df(t,null,l),e}return xi(t,a,e,l),ji(t)}function gn(t,e,l){if(e=e.updateQueue,e!==null&&(e=e.shared,(l&4194048)!==0)){var a=e.lanes;a&=t.pendingLanes,l|=a,e.lanes=l,br(t,l)}}function Sc(t,e){var l=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var s={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=s:u=u.next=s,l=l.next}while(l!==null);u===null?n=u=e:u=u.next=e}else n=u=e;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=e:t.next=e,l.lastBaseUpdate=e}var xc=!1;function bn(){if(xc){var t=Aa;if(t!==null)throw t}}function Sn(t,e,l,a){xc=!1;var n=t.updateQueue;El=!1;var u=n.firstBaseUpdate,s=n.lastBaseUpdate,h=n.shared.pending;if(h!==null){n.shared.pending=null;var v=h,N=v.next;v.next=null,s===null?u=N:s.next=N,s=v;var _=t.alternate;_!==null&&(_=_.updateQueue,h=_.lastBaseUpdate,h!==s&&(h===null?_.firstBaseUpdate=N:h.next=N,_.lastBaseUpdate=v))}if(u!==null){var U=n.baseState;s=0,_=N=v=null,h=u;do{var O=h.lane&-536870913,C=O!==h.lane;if(C?(it&O)===O:(a&O)===O){O!==0&&O===Ma&&(xc=!0),_!==null&&(_=_.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var X=t,F=h;O=e;var Tt=l;switch(F.tag){case 1:if(X=F.payload,typeof X=="function"){U=X.call(Tt,U,O);break t}U=X;break t;case 3:X.flags=X.flags&-65537|128;case 0:if(X=F.payload,O=typeof X=="function"?X.call(Tt,U,O):X,O==null)break t;U=E({},U,O);break t;case 2:El=!0}}O=h.callback,O!==null&&(t.flags|=64,C&&(t.flags|=8192),C=n.callbacks,C===null?n.callbacks=[O]:C.push(O))}else C={lane:O,tag:h.tag,payload:h.payload,callback:h.callback,next:null},_===null?(N=_=C,v=U):_=_.next=C,s|=O;if(h=h.next,h===null){if(h=n.shared.pending,h===null)break;C=h,h=C.next,C.next=null,n.lastBaseUpdate=C,n.shared.pending=null}}while(!0);_===null&&(v=U),n.baseState=v,n.firstBaseUpdate=N,n.lastBaseUpdate=_,u===null&&(n.shared.lanes=0),zl|=s,t.lanes=s,t.memoizedState=U}}function zf(t,e){if(typeof t!="function")throw Error(f(191,t));t.call(e)}function _f(t,e){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;tu?u:8;var s=D.T,h={};D.T=h,Lc(t,!1,e,l);try{var v=n(),N=D.S;if(N!==null&&N(h,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var _=My(v,a);En(t,e,_,Me(t))}else En(t,e,a,Me(t))}catch(U){En(t,e,{then:function(){},status:"rejected",reason:U},Me())}finally{B.p=u,s!==null&&h.types!==null&&(s.types=h.types),D.T=s}}function Ry(){}function Qc(t,e,l,a){if(t.tag!==5)throw Error(f(476));var n=ro(t).queue;so(t,n,e,V,l===null?Ry:function(){return fo(t),l(a)})}function ro(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nl,lastRenderedState:V},next:null};var l={};return e.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nl,lastRenderedState:l},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function fo(t){var e=ro(t);e.next===null&&(e=t.alternate.memoizedState),En(t,e.next.queue,{},Me())}function Bc(){return It(Ln)}function oo(){return Bt().memoizedState}function ho(){return Bt().memoizedState}function Uy(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var l=Me();t=Tl(l);var a=Nl(e,t,l);a!==null&&(ye(a,e,l),gn(a,e,l)),e={cache:mc()},t.payload=e;return}e=e.return}}function Hy(t,e,l){var a=Me();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Yi(t)?yo(e,l):(l=ac(t,e,l,a),l!==null&&(ye(l,t,a),vo(l,e,a)))}function mo(t,e,l){var a=Me();En(t,e,l,a)}function En(t,e,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Yi(t))yo(e,n);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=e.lastRenderedReducer,u!==null))try{var s=e.lastRenderedState,h=u(s,l);if(n.hasEagerState=!0,n.eagerState=h,xe(h,s))return xi(t,e,n,0),Nt===null&&Si(),!1}catch{}if(l=ac(t,e,n,a),l!==null)return ye(l,t,a),vo(l,e,a),!0}return!1}function Lc(t,e,l,a){if(a={lane:2,revertLane:gs(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Yi(t)){if(e)throw Error(f(479))}else e=ac(t,l,a,2),e!==null&&ye(e,t,2)}function Yi(t){var e=t.alternate;return t===I||e!==null&&e===I}function yo(t,e){Da=Ui=!0;var l=t.pending;l===null?e.next=e:(e.next=l.next,l.next=e),t.pending=e}function vo(t,e,l){if((l&4194048)!==0){var a=e.lanes;a&=t.pendingLanes,l|=a,e.lanes=l,br(t,l)}}var Tn={readContext:It,use:wi,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};Tn.useEffectEvent=Ht;var po={readContext:It,use:wi,useCallback:function(t,e){return ie().memoizedState=[t,e===void 0?null:e],t},useContext:It,useEffect:Pf,useImperativeHandle:function(t,e,l){l=l!=null?l.concat([t]):null,Bi(4194308,4,ao.bind(null,e,t),l)},useLayoutEffect:function(t,e){return Bi(4194308,4,t,e)},useInsertionEffect:function(t,e){Bi(4,2,t,e)},useMemo:function(t,e){var l=ie();e=e===void 0?null:e;var a=t();if(na){vl(!0);try{t()}finally{vl(!1)}}return l.memoizedState=[a,e],a},useReducer:function(t,e,l){var a=ie();if(l!==void 0){var n=l(e);if(na){vl(!0);try{l(e)}finally{vl(!1)}}}else n=e;return a.memoizedState=a.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},a.queue=t,t=t.dispatch=Hy.bind(null,I,t),[a.memoizedState,t]},useRef:function(t){var e=ie();return t={current:t},e.memoizedState=t},useState:function(t){t=Rc(t);var e=t.queue,l=mo.bind(null,I,e);return e.dispatch=l,[t.memoizedState,l]},useDebugValue:qc,useDeferredValue:function(t,e){var l=ie();return wc(l,t,e)},useTransition:function(){var t=Rc(!1);return t=so.bind(null,I,t.queue,!0,!1),ie().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,l){var a=I,n=ie();if(ct){if(l===void 0)throw Error(f(407));l=l()}else{if(l=e(),Nt===null)throw Error(f(349));(it&127)!==0||wf(a,e,l)}n.memoizedState=l;var u={value:l,getSnapshot:e};return n.queue=u,Pf(Bf.bind(null,a,u,t),[t]),a.flags|=2048,Ua(9,{destroy:void 0},Qf.bind(null,a,u,l,e),null),l},useId:function(){var t=ie(),e=Nt.identifierPrefix;if(ct){var l=ke,a=Ze;l=(a&~(1<<32-Se(a)-1)).toString(32)+l,e="_"+e+"R_"+l,l=Hi++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?s.createElement("select",{is:a.is}):s.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?s.createElement(n,{is:a.is}):s.createElement(n)}}u[$t]=e,u[re]=a;t:for(s=e.child;s!==null;){if(s.tag===5||s.tag===6)u.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break t;for(;s.sibling===null;){if(s.return===null||s.return===e)break t;s=s.return}s.sibling.return=s.return,s=s.sibling}e.stateNode=u;t:switch(te(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&ul(e)}}return At(e),ts(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,l),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==a&&ul(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(f(166));if(t=lt.current,Na(e)){if(t=e.stateNode,l=e.memoizedProps,a=null,n=Wt,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}t[$t]=e,t=!!(t.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||qd(t.nodeValue,l)),t||xl(e,!0)}else t=cu(t).createTextNode(a),t[$t]=e,e.stateNode=t}return At(e),null;case 31:if(l=e.memoizedState,t===null||t.memoizedState!==null){if(a=Na(e),l!==null){if(t===null){if(!a)throw Error(f(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(f(557));t[$t]=e}else Wl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;At(e),t=!1}else l=fc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return e.flags&256?(Te(e),e):(Te(e),null);if((e.flags&128)!==0)throw Error(f(558))}return At(e),null;case 13:if(a=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=Na(e),a!==null&&a.dehydrated!==null){if(t===null){if(!n)throw Error(f(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(f(317));n[$t]=e}else Wl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;At(e),n=!1}else n=fc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(Te(e),e):(Te(e),null)}return Te(e),(e.flags&128)!==0?(e.lanes=l,e):(l=a!==null,t=t!==null&&t.memoizedState!==null,l&&(a=e.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==t&&l&&(e.child.flags|=8192),ki(e,e.updateQueue),At(e),null);case 4:return Dt(),t===null&&js(e.stateNode.containerInfo),At(e),null;case 10:return ll(e.type),At(e),null;case 19:if(H(Qt),a=e.memoizedState,a===null)return At(e),null;if(n=(e.flags&128)!==0,u=a.rendering,u===null)if(n)On(a,!1);else{if(qt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(u=Ri(t),u!==null){for(e.flags|=128,On(a,!1),t=u.updateQueue,e.updateQueue=t,ki(e,t),e.subtreeFlags=0,t=l,l=e.child;l!==null;)hf(l,t),l=l.sibling;return L(Qt,Qt.current&1|2),ct&&tl(e,a.treeForkCount),e.child}t=t.sibling}a.tail!==null&&ne()>Wi&&(e.flags|=128,n=!0,On(a,!1),e.lanes=4194304)}else{if(!n)if(t=Ri(u),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,ki(e,t),On(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!ct)return At(e),null}else 2*ne()-a.renderingStartTime>Wi&&l!==536870912&&(e.flags|=128,n=!0,On(a,!1),e.lanes=4194304);a.isBackwards?(u.sibling=e.child,e.child=u):(t=a.last,t!==null?t.sibling=u:e.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=ne(),t.sibling=null,l=Qt.current,L(Qt,n?l&1|2:l&1),ct&&tl(e,a.treeForkCount),t):(At(e),null);case 22:case 23:return Te(e),Ec(),a=e.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?(l&536870912)!==0&&(e.flags&128)===0&&(At(e),e.subtreeFlags&6&&(e.flags|=8192)):At(e),l=e.updateQueue,l!==null&&ki(e,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==l&&(e.flags|=2048),t!==null&&H(ta),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),e.memoizedState.cache!==l&&(e.flags|=2048),ll(Lt),At(e),null;case 25:return null;case 30:return null}throw Error(f(156,e.tag))}function Ly(t,e){switch(sc(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ll(Lt),Dt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ml(e),null;case 31:if(e.memoizedState!==null){if(Te(e),e.alternate===null)throw Error(f(340));Wl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Te(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(f(340));Wl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return H(Qt),null;case 4:return Dt(),null;case 10:return ll(e.type),null;case 22:case 23:return Te(e),Ec(),t!==null&&H(ta),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return ll(Lt),null;case 25:return null;default:return null}}function Yo(t,e){switch(sc(e),e.tag){case 3:ll(Lt),Dt();break;case 26:case 27:case 5:ml(e);break;case 4:Dt();break;case 31:e.memoizedState!==null&&Te(e);break;case 13:Te(e);break;case 19:H(Qt);break;case 10:ll(e.type);break;case 22:case 23:Te(e),Ec(),t!==null&&H(ta);break;case 24:ll(Lt)}}function Mn(t,e){try{var l=e.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&t)===t){a=void 0;var u=l.create,s=l.inst;a=u(),s.destroy=a}l=l.next}while(l!==n)}}catch(h){St(e,e.return,h)}}function Al(t,e,l){try{var a=e.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&t)===t){var s=a.inst,h=s.destroy;if(h!==void 0){s.destroy=void 0,n=e;var v=l,N=h;try{N()}catch(_){St(n,v,_)}}}a=a.next}while(a!==u)}}catch(_){St(e,e.return,_)}}function Go(t){var e=t.updateQueue;if(e!==null){var l=t.stateNode;try{_f(e,l)}catch(a){St(t,t.return,a)}}}function Xo(t,e,l){l.props=ia(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(a){St(t,e,a)}}function An(t,e){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof l=="function"?t.refCleanup=l(a):l.current=a}}catch(n){St(t,e,n)}}function Ve(t,e){var l=t.ref,a=t.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){St(t,e,n)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){St(t,e,n)}else l.current=null}function Ko(t){var e=t.type,l=t.memoizedProps,a=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break t;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){St(t,t.return,n)}}function es(t,e,l){try{var a=t.stateNode;sv(a,t.type,l,e),a[re]=e}catch(n){St(t,t.return,n)}}function Zo(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Hl(t.type)||t.tag===4}function ls(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Zo(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Hl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function as(t,e,l){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,e):(e=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,e.appendChild(t),l=l._reactRootContainer,l!=null||e.onclick!==null||(e.onclick=We));else if(a!==4&&(a===27&&Hl(t.type)&&(l=t.stateNode,e=null),t=t.child,t!==null))for(as(t,e,l),t=t.sibling;t!==null;)as(t,e,l),t=t.sibling}function Vi(t,e,l){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?l.insertBefore(t,e):l.appendChild(t);else if(a!==4&&(a===27&&Hl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Vi(t,e,l),t=t.sibling;t!==null;)Vi(t,e,l),t=t.sibling}function ko(t){var e=t.stateNode,l=t.memoizedProps;try{for(var a=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);te(e,a,l),e[$t]=t,e[re]=l}catch(u){St(t,t.return,u)}}var cl=!1,Xt=!1,ns=!1,Vo=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function Yy(t,e){if(t=t.containerInfo,Ns=mu,t=af(t),Wu(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else t:{l=(l=t.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break t}var s=0,h=-1,v=-1,N=0,_=0,U=t,O=null;e:for(;;){for(var C;U!==l||n!==0&&U.nodeType!==3||(h=s+n),U!==u||a!==0&&U.nodeType!==3||(v=s+a),U.nodeType===3&&(s+=U.nodeValue.length),(C=U.firstChild)!==null;)O=U,U=C;for(;;){if(U===t)break e;if(O===l&&++N===n&&(h=s),O===u&&++_===a&&(v=s),(C=U.nextSibling)!==null)break;U=O,O=U.parentNode}U=C}l=h===-1||v===-1?null:{start:h,end:v}}else l=null}l=l||{start:0,end:0}}else l=null;for(Os={focusedElem:t,selectionRange:l},mu=!1,Ft=e;Ft!==null;)if(e=Ft,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ft=t;else for(;Ft!==null;){switch(e=Ft,u=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l title"))),te(u,a,l),u[$t]=t,Jt(u),a=u;break t;case"link":var s=Pd("link","href",n).get(a+(l.href||""));if(s){for(var h=0;hTt&&(s=Tt,Tt=F,F=s);var j=ef(h,F),b=ef(h,Tt);if(j&&b&&(C.rangeCount!==1||C.anchorNode!==j.node||C.anchorOffset!==j.offset||C.focusNode!==b.node||C.focusOffset!==b.offset)){var T=U.createRange();T.setStart(j.node,j.offset),C.removeAllRanges(),F>Tt?(C.addRange(T),C.extend(b.node,b.offset)):(T.setEnd(b.node,b.offset),C.addRange(T))}}}}for(U=[],C=h;C=C.parentNode;)C.nodeType===1&&U.push({element:C,left:C.scrollLeft,top:C.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hl?32:l,D.T=null,l=os,os=null;var u=Dl,s=dl;if(Kt=0,Ba=Dl=null,dl=0,(pt&6)!==0)throw Error(f(331));var h=pt;if(pt|=4,nd(u.current),ed(u,u.current,s,l),pt=h,Un(0,!1),be&&typeof be.onPostCommitFiberRoot=="function")try{be.onPostCommitFiberRoot(Wa,u)}catch{}return!0}finally{B.p=n,D.T=a,jd(t,e)}}function Td(t,e,l){e=Ue(l,e),e=Kc(t.stateNode,e,2),t=Nl(t,e,2),t!==null&&(Pa(t,2),Je(t))}function St(t,e,l){if(t.tag===3)Td(t,t,l);else for(;e!==null;){if(e.tag===3){Td(e,t,l);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(_l===null||!_l.has(a))){t=Ue(l,t),l=No(2),a=Nl(e,l,2),a!==null&&(Oo(l,a,e,t),Pa(a,2),Je(a));break}}e=e.return}}function ys(t,e,l){var a=t.pingCache;if(a===null){a=t.pingCache=new Ky;var n=new Set;a.set(e,n)}else n=a.get(e),n===void 0&&(n=new Set,a.set(e,n));n.has(l)||(cs=!0,n.add(l),t=Fy.bind(null,t,e,l),e.then(t,t))}function Fy(t,e,l){var a=t.pingCache;a!==null&&a.delete(e),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Nt===t&&(it&l)===l&&(qt===4||qt===3&&(it&62914560)===it&&300>ne()-$i?(pt&2)===0&&La(t,0):ss|=l,Qa===it&&(Qa=0)),Je(t)}function Nd(t,e){e===0&&(e=pr()),t=Fl(t,e),t!==null&&(Pa(t,e),Je(t))}function $y(t){var e=t.memoizedState,l=0;e!==null&&(l=e.retryLane),Nd(t,l)}function Wy(t,e){var l=0;switch(t.tag){case 31:case 13:var a=t.stateNode,n=t.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(f(314))}a!==null&&a.delete(e),Nd(t,l)}function Iy(t,e){return ft(t,e)}var au=null,Ga=null,vs=!1,nu=!1,ps=!1,Ul=0;function Je(t){t!==Ga&&t.next===null&&(Ga===null?au=Ga=t:Ga=Ga.next=t),nu=!0,vs||(vs=!0,tv())}function Un(t,e){if(!ps&&nu){ps=!0;do for(var l=!1,a=au;a!==null;){if(t!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var s=a.suspendedLanes,h=a.pingedLanes;u=(1<<31-Se(42|t)+1)-1,u&=n&~(s&~h),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Cd(a,u))}else u=it,u=si(a,a===Nt?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Ia(a,u)||(l=!0,Cd(a,u));a=a.next}while(l);ps=!1}}function Py(){Od()}function Od(){nu=vs=!1;var t=0;Ul!==0&&fv()&&(t=Ul);for(var e=ne(),l=null,a=au;a!==null;){var n=a.next,u=Md(a,e);u===0?(a.next=null,l===null?au=n:l.next=n,n===null&&(Ga=l)):(l=a,(t!==0||(u&3)!==0)&&(nu=!0)),a=n}Kt!==0&&Kt!==5||Un(t),Ul!==0&&(Ul=0)}function Md(t,e){for(var l=t.suspendedLanes,a=t.pingedLanes,n=t.expirationTimes,u=t.pendingLanes&-62914561;0h)break;var _=v.transferSize,U=v.initiatorType;_&&wd(U)&&(v=v.responseEnd,s+=_*(v"u"?null:document;function Fd(t,e,l){var a=Xa;if(a&&typeof e=="string"&&e){var n=De(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),Jd.has(n)||(Jd.add(n),t={rel:t,crossOrigin:l,href:e},a.querySelector(n)===null&&(e=a.createElement("link"),te(e,"link",t),Jt(e),a.head.appendChild(e)))}}function bv(t){hl.D(t),Fd("dns-prefetch",t,null)}function Sv(t,e){hl.C(t,e),Fd("preconnect",t,e)}function xv(t,e,l){hl.L(t,e,l);var a=Xa;if(a&&t&&e){var n='link[rel="preload"][as="'+De(e)+'"]';e==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+De(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+De(l.imageSizes)+'"]')):n+='[href="'+De(t)+'"]';var u=n;switch(e){case"style":u=Ka(t);break;case"script":u=Za(t)}Le.has(u)||(t=E({rel:"preload",href:e==="image"&&l&&l.imageSrcSet?void 0:t,as:e},l),Le.set(u,t),a.querySelector(n)!==null||e==="style"&&a.querySelector(Qn(u))||e==="script"&&a.querySelector(Bn(u))||(e=a.createElement("link"),te(e,"link",t),Jt(e),a.head.appendChild(e)))}}function jv(t,e){hl.m(t,e);var l=Xa;if(l&&t){var a=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+De(a)+'"][href="'+De(t)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Za(t)}if(!Le.has(u)&&(t=E({rel:"modulepreload",href:t},e),Le.set(u,t),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Bn(u)))return}a=l.createElement("link"),te(a,"link",t),Jt(a),l.head.appendChild(a)}}}function Ev(t,e,l){hl.S(t,e,l);var a=Xa;if(a&&t){var n=da(a).hoistableStyles,u=Ka(t);e=e||"default";var s=n.get(u);if(!s){var h={loading:0,preload:null};if(s=a.querySelector(Qn(u)))h.loading=5;else{t=E({rel:"stylesheet",href:t,"data-precedence":e},l),(l=Le.get(u))&&Rs(t,l);var v=s=a.createElement("link");Jt(v),te(v,"link",t),v._p=new Promise(function(N,_){v.onload=N,v.onerror=_}),v.addEventListener("load",function(){h.loading|=1}),v.addEventListener("error",function(){h.loading|=2}),h.loading|=4,ru(s,e,a)}s={type:"stylesheet",instance:s,count:1,state:h},n.set(u,s)}}}function Tv(t,e){hl.X(t,e);var l=Xa;if(l&&t){var a=da(l).hoistableScripts,n=Za(t),u=a.get(n);u||(u=l.querySelector(Bn(n)),u||(t=E({src:t,async:!0},e),(e=Le.get(n))&&Us(t,e),u=l.createElement("script"),Jt(u),te(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function Nv(t,e){hl.M(t,e);var l=Xa;if(l&&t){var a=da(l).hoistableScripts,n=Za(t),u=a.get(n);u||(u=l.querySelector(Bn(n)),u||(t=E({src:t,async:!0,type:"module"},e),(e=Le.get(n))&&Us(t,e),u=l.createElement("script"),Jt(u),te(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function $d(t,e,l,a){var n=(n=lt.current)?su(n):null;if(!n)throw Error(f(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(e=Ka(l.href),l=da(n).hoistableStyles,a=l.get(e),a||(a={type:"style",instance:null,count:0,state:null},l.set(e,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Ka(l.href);var u=da(n).hoistableStyles,s=u.get(t);if(s||(n=n.ownerDocument||n,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,s),(u=n.querySelector(Qn(t)))&&!u._p&&(s.instance=u,s.state.loading=5),Le.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Le.set(t,l),u||Ov(n,t,l,s.state))),e&&a===null)throw Error(f(528,""));return s}if(e&&a!==null)throw Error(f(529,""));return null;case"script":return e=l.async,l=l.src,typeof l=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Za(l),l=da(n).hoistableScripts,a=l.get(e),a||(a={type:"script",instance:null,count:0,state:null},l.set(e,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,t))}}function Ka(t){return'href="'+De(t)+'"'}function Qn(t){return'link[rel="stylesheet"]['+t+"]"}function Wd(t){return E({},t,{"data-precedence":t.precedence,precedence:null})}function Ov(t,e,l,a){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=t.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),te(e,"link",l),Jt(e),t.head.appendChild(e))}function Za(t){return'[src="'+De(t)+'"]'}function Bn(t){return"script[async]"+t}function Id(t,e,l){if(e.count++,e.instance===null)switch(e.type){case"style":var a=t.querySelector('style[data-href~="'+De(l.href)+'"]');if(a)return e.instance=a,Jt(a),a;var n=E({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),Jt(a),te(a,"style",n),ru(a,l.precedence,t),e.instance=a;case"stylesheet":n=Ka(l.href);var u=t.querySelector(Qn(n));if(u)return e.state.loading|=4,e.instance=u,Jt(u),u;a=Wd(l),(n=Le.get(n))&&Rs(a,n),u=(t.ownerDocument||t).createElement("link"),Jt(u);var s=u;return s._p=new Promise(function(h,v){s.onload=h,s.onerror=v}),te(u,"link",a),e.state.loading|=4,ru(u,l.precedence,t),e.instance=u;case"script":return u=Za(l.src),(n=t.querySelector(Bn(u)))?(e.instance=n,Jt(n),n):(a=l,(n=Le.get(u))&&(a=E({},l),Us(a,n)),t=t.ownerDocument||t,n=t.createElement("script"),Jt(n),te(n,"link",a),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(f(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(a=e.instance,e.state.loading|=4,ru(a,l.precedence,t));return e.instance}function ru(t,e,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,s=0;s title"):null)}function Mv(t,e,l){if(l===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function eh(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Av(t,e,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Ka(a.href),u=e.querySelector(Qn(n));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=ou.bind(t),e.then(t,t)),l.state.loading|=4,l.instance=u,Jt(u);return}u=e.ownerDocument||e,a=Wd(a),(n=Le.get(n))&&Rs(a,n),u=u.createElement("link"),Jt(u);var s=u;s._p=new Promise(function(h,v){s.onload=h,s.onerror=v}),te(u,"link",a),l.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,e),(e=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=ou.bind(t),e.addEventListener("load",l),e.addEventListener("error",l))}}var Hs=0;function Cv(t,e){return t.stylesheets&&t.count===0&&hu(t,t.stylesheets),0Hs?50:800)+e);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var du=null;function hu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,du=new Map,e.forEach(zv,t),du=null,ou.call(t))}function zv(t,e){if(!(e.state.loading&4)){var l=du.get(t);if(l)var a=l.get(null);else{l=new Map,du.set(t,l);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Ks.exports=kv(),Ks.exports}var Jv=Vv(),ti=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(i){return this.listeners.add(i),this.onSubscribe(),()=>{this.listeners.delete(i),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fv=class extends ti{#t;#e;#l;constructor(){super(),this.#l=i=>{if(typeof window<"u"&&window.addEventListener){const c=()=>i();return window.addEventListener("visibilitychange",c,!1),()=>{window.removeEventListener("visibilitychange",c)}}}}onSubscribe(){this.#e||this.setEventListener(this.#l)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(i){this.#l=i,this.#e?.(),this.#e=i(c=>{typeof c=="boolean"?this.setFocused(c):this.onFocus()})}setFocused(i){this.#t!==i&&(this.#t=i,this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(c=>{c(i)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},ur=new Fv,$v={setTimeout:(i,c)=>setTimeout(i,c),clearTimeout:i=>clearTimeout(i),setInterval:(i,c)=>setInterval(i,c),clearInterval:i=>clearInterval(i)},Wv=class{#t=$v;#e=!1;setTimeoutProvider(i){this.#t=i}setTimeout(i,c){return this.#t.setTimeout(i,c)}clearTimeout(i){this.#t.clearTimeout(i)}setInterval(i,c){return this.#t.setInterval(i,c)}clearInterval(i){this.#t.clearInterval(i)}},sa=new Wv;function Iv(i){setTimeout(i,0)}var Pv=typeof window>"u"||"Deno"in globalThis;function ve(){}function t0(i,c){return typeof i=="function"?i(c):i}function Ws(i){return typeof i=="number"&&i>=0&&i!==1/0}function kh(i,c){return Math.max(i+(c||0)-Date.now(),0)}function Gl(i,c){return typeof i=="function"?i(c):i}function Ae(i,c){return typeof i=="function"?i(c):i}function Nh(i,c){const{type:r="all",exact:f,fetchStatus:d,predicate:m,queryKey:g,stale:A}=i;if(g){if(f){if(c.queryHash!==cr(g,c.options))return!1}else if(!Jn(c.queryKey,g))return!1}if(r!=="all"){const p=c.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof A=="boolean"&&c.isStale()!==A||d&&d!==c.state.fetchStatus||m&&!m(c))}function Oh(i,c){const{exact:r,status:f,predicate:d,mutationKey:m}=i;if(m){if(!c.options.mutationKey)return!1;if(r){if(Vn(c.options.mutationKey)!==Vn(m))return!1}else if(!Jn(c.options.mutationKey,m))return!1}return!(f&&c.state.status!==f||d&&!d(c))}function cr(i,c){return(c?.queryKeyHashFn||Vn)(i)}function Vn(i){return JSON.stringify(i,(c,r)=>Ps(r)?Object.keys(r).sort().reduce((f,d)=>(f[d]=r[d],f),{}):r)}function Jn(i,c){return i===c?!0:typeof i!=typeof c?!1:i&&c&&typeof i=="object"&&typeof c=="object"?Object.keys(c).every(r=>Jn(i[r],c[r])):!1}var e0=Object.prototype.hasOwnProperty;function Vh(i,c,r=0){if(i===c)return i;if(r>500)return c;const f=Mh(i)&&Mh(c);if(!f&&!(Ps(i)&&Ps(c)))return c;const m=(f?i:Object.keys(i)).length,g=f?c:Object.keys(c),A=g.length,p=f?new Array(A):{};let y=0;for(let M=0;M{sa.setTimeout(c,i)})}function tr(i,c,r){return typeof r.structuralSharing=="function"?r.structuralSharing(i,c):r.structuralSharing!==!1?Vh(i,c):c}function a0(i,c,r=0){const f=[...i,c];return r&&f.length>r?f.slice(1):f}function n0(i,c,r=0){const f=[c,...i];return r&&f.length>r?f.slice(0,-1):f}var sr=Symbol();function Jh(i,c){return!i.queryFn&&c?.initialPromise?()=>c.initialPromise:!i.queryFn||i.queryFn===sr?()=>Promise.reject(new Error(`Missing queryFn: '${i.queryHash}'`)):i.queryFn}function Fh(i,c){return typeof i=="function"?i(...c):!!i}function i0(i,c,r){let f=!1,d;return Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(d??=c(),f||(f=!0,d.aborted?r():d.addEventListener("abort",r,{once:!0})),d)}),i}var Fn=(()=>{let i=()=>Pv;return{isServer(){return i()},setIsServer(c){i=c}}})();function er(){let i,c;const r=new Promise((d,m)=>{i=d,c=m});r.status="pending",r.catch(()=>{});function f(d){Object.assign(r,d),delete r.resolve,delete r.reject}return r.resolve=d=>{f({status:"fulfilled",value:d}),i(d)},r.reject=d=>{f({status:"rejected",reason:d}),c(d)},r}var u0=Iv;function c0(){let i=[],c=0,r=A=>{A()},f=A=>{A()},d=u0;const m=A=>{c?i.push(A):d(()=>{r(A)})},g=()=>{const A=i;i=[],A.length&&d(()=>{f(()=>{A.forEach(p=>{r(p)})})})};return{batch:A=>{let p;c++;try{p=A()}finally{c--,c||g()}return p},batchCalls:A=>(...p)=>{m(()=>{A(...p)})},schedule:m,setNotifyFunction:A=>{r=A},setBatchNotifyFunction:A=>{f=A},setScheduler:A=>{d=A}}}var ee=c0(),s0=class extends ti{#t=!0;#e;#l;constructor(){super(),this.#l=i=>{if(typeof window<"u"&&window.addEventListener){const c=()=>i(!0),r=()=>i(!1);return window.addEventListener("online",c,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#l)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(i){this.#l=i,this.#e?.(),this.#e=i(this.setOnline.bind(this))}setOnline(i){this.#t!==i&&(this.#t=i,this.listeners.forEach(r=>{r(i)}))}isOnline(){return this.#t}},Ou=new s0;function r0(i){return Math.min(1e3*2**i,3e4)}function $h(i){return(i??"online")==="online"?Ou.isOnline():!0}var lr=class extends Error{constructor(i){super("CancelledError"),this.revert=i?.revert,this.silent=i?.silent}};function Wh(i){let c=!1,r=0,f;const d=er(),m=()=>d.status!=="pending",g=w=>{if(!m()){const Y=new lr(w);x(Y),i.onCancel?.(Y)}},A=()=>{c=!0},p=()=>{c=!1},y=()=>ur.isFocused()&&(i.networkMode==="always"||Ou.isOnline())&&i.canRun(),M=()=>$h(i.networkMode)&&i.canRun(),E=w=>{m()||(f?.(),d.resolve(w))},x=w=>{m()||(f?.(),d.reject(w))},q=()=>new Promise(w=>{f=Y=>{(m()||y())&&w(Y)},i.onPause?.()}).then(()=>{f=void 0,m()||i.onContinue?.()}),z=()=>{if(m())return;let w;const Y=r===0?i.initialPromise:void 0;try{w=Y??i.fn()}catch($){w=Promise.reject($)}Promise.resolve(w).then(E).catch($=>{if(m())return;const yt=i.retry??(Fn.isServer()?0:3),ot=i.retryDelay??r0,Ct=typeof ot=="function"?ot(r,$):ot,Rt=yt===!0||typeof yt=="number"&&ry()?void 0:q()).then(()=>{c?x($):z()})})};return{promise:d,status:()=>d.status,cancel:g,continue:()=>(f?.(),d),cancelRetry:A,continueRetry:p,canStart:M,start:()=>(M()?z():q().then(z),d)}}var Ih=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ws(this.gcTime)&&(this.#t=sa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(i){this.gcTime=Math.max(this.gcTime||0,i??(Fn.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(sa.clearTimeout(this.#t),this.#t=void 0)}};function f0(i){return{onFetch:(c,r)=>{const f=c.options,d=c.fetchOptions?.meta?.fetchMore?.direction,m=c.state.data?.pages||[],g=c.state.data?.pageParams||[];let A={pages:[],pageParams:[]},p=0;const y=async()=>{let M=!1;const E=z=>{i0(z,()=>c.signal,()=>M=!0)},x=Jh(c.options,c.fetchOptions),q=async(z,w,Y)=>{if(M)return Promise.reject(c.signal.reason);if(w==null&&z.pages.length)return Promise.resolve(z);const yt=(()=>{const et={client:c.client,queryKey:c.queryKey,pageParam:w,direction:Y?"backward":"forward",meta:c.options.meta};return E(et),et})(),ot=await x(yt),{maxPages:Ct}=c.options,Rt=Y?n0:a0;return{pages:Rt(z.pages,ot,Ct),pageParams:Rt(z.pageParams,w,Ct)}};if(d&&m.length){const z=d==="backward",w=z?o0:Ch,Y={pages:m,pageParams:g},$=w(f,Y);A=await q(Y,$,z)}else{const z=i??m.length;do{const w=p===0?g[0]??f.initialPageParam:Ch(f,A);if(p>0&&w==null)break;A=await q(A,w),p++}while(pc.options.persister?.(y,{client:c.client,queryKey:c.queryKey,meta:c.options.meta,signal:c.signal},r):c.fetchFn=y}}}function Ch(i,{pages:c,pageParams:r}){const f=c.length-1;return c.length>0?i.getNextPageParam(c[f],c,r[f],r):void 0}function o0(i,{pages:c,pageParams:r}){return c.length>0?i.getPreviousPageParam?.(c[0],c,r[0],r):void 0}var d0=class extends Ih{#t;#e;#l;#a;#i;#n;#c;#u;constructor(i){super(),this.#u=!1,this.#c=i.defaultOptions,this.setOptions(i.options),this.observers=[],this.#i=i.client,this.#a=this.#i.getQueryCache(),this.queryKey=i.queryKey,this.queryHash=i.queryHash,this.#e=_h(this.options),this.state=i.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#n?.promise}setOptions(i){if(this.options={...this.#c,...i},i?._type&&(this.#t=i._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const c=_h(this.options);c.data!==void 0&&(this.setState(zh(c.data,c.dataUpdatedAt)),this.#e=c)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(i,c){const r=tr(this.state.data,i,this.options);return this.#s({data:r,type:"success",dataUpdatedAt:c?.updatedAt,manual:c?.manual}),r}setState(i){this.#s({type:"setState",state:i})}cancel(i){const c=this.#n?.promise;return this.#n?.cancel(i),c?c.then(ve).catch(ve):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(i=>Ae(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>Gl(i.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(i=>i.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(i=0){return this.state.data===void 0?!0:i==="static"?!1:this.state.isInvalidated?!0:!kh(this.state.dataUpdatedAt,i)}onFocus(){this.observers.find(c=>c.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(c=>c.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){this.observers.includes(i)&&(this.observers=this.observers.filter(c=>c!==i),this.observers.length||(this.#n&&(this.#u||this.#f()?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}#f(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(i,c){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&c?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(i&&this.setOptions(i),!this.options.queryFn){const p=this.observers.find(y=>y.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,f=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(this.#u=!0,r.signal)})},d=()=>{const p=Jh(this.options,c),M=(()=>{const E={client:this.#i,queryKey:this.queryKey,meta:this.meta};return f(E),E})();return this.#u=!1,this.options.persister?this.options.persister(p,M,this):p(M)},g=(()=>{const p={fetchOptions:c,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:d};return f(p),p})();(this.#t==="infinite"?f0(this.options.pages):this.options.behavior)?.onFetch(g,this),this.#l=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==g.fetchOptions?.meta)&&this.#s({type:"fetch",meta:g.fetchOptions?.meta}),this.#n=Wh({initialPromise:c?.initialPromise,fn:g.fetchFn,onCancel:p=>{p instanceof lr&&p.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(p,y)=>{this.#s({type:"failed",failureCount:p,error:y})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:g.options.retry,retryDelay:g.options.retryDelay,networkMode:g.options.networkMode,canRun:()=>!0});try{const p=await this.#n.start();if(p===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(p),this.#a.config.onSuccess?.(p,this),this.#a.config.onSettled?.(p,this.state.error,this),p}catch(p){if(p instanceof lr){if(p.silent)return this.#n.promise;if(p.revert){if(this.state.data===void 0)throw p;return this.state.data}}throw this.#s({type:"error",error:p}),this.#a.config.onError?.(p,this),this.#a.config.onSettled?.(this.state.data,p,this),p}finally{this.scheduleGc()}}#s(i){const c=r=>{switch(i.type){case"failed":return{...r,fetchFailureCount:i.failureCount,fetchFailureReason:i.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ph(r.data,this.options),fetchMeta:i.meta??null};case"success":const f={...r,...zh(i.data,i.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=i.manual?f:void 0,f;case"error":const d=i.error;return{...r,error:d,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...i.state}}};this.state=c(this.state),ee.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:i})})}};function Ph(i,c){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$h(c.networkMode)?"fetching":"paused",...i===void 0&&{error:null,status:"pending"}}}function zh(i,c){return{data:i,dataUpdatedAt:c??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _h(i){const c=typeof i.initialData=="function"?i.initialData():i.initialData,r=c!==void 0,f=r?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0;return{data:c,dataUpdateCount:0,dataUpdatedAt:r?f??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var h0=class extends ti{constructor(i,c){super(),this.options=c,this.#t=i,this.#u=null,this.#c=er(),this.bindMethods(),this.setOptions(c)}#t;#e=void 0;#l=void 0;#a=void 0;#i;#n;#c;#u;#f;#s;#m;#o;#d;#r;#y=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Dh(this.#e,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ar(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ar(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#e.removeObserver(this)}setOptions(i){const c=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ae(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),c._defaulted&&!Is(this.options,c)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const f=this.hasListeners();f&&Rh(this.#e,r,this.options,c)&&this.#h(),this.updateResult(),f&&(this.#e!==r||Ae(this.options.enabled,this.#e)!==Ae(c.enabled,this.#e)||Gl(this.options.staleTime,this.#e)!==Gl(c.staleTime,this.#e))&&this.#v();const d=this.#p();f&&(this.#e!==r||Ae(this.options.enabled,this.#e)!==Ae(c.enabled,this.#e)||d!==this.#r)&&this.#g(d)}getOptimisticResult(i){const c=this.#t.getQueryCache().build(this.#t,i),r=this.createResult(c,i);return y0(this,r)&&(this.#a=r,this.#n=this.options,this.#i=this.#e.state),r}getCurrentResult(){return this.#a}trackResult(i,c){return new Proxy(i,{get:(r,f)=>(this.trackProp(f),c?.(f),f==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#c.status==="pending"&&this.#c.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,f))})}trackProp(i){this.#y.add(i)}getCurrentQuery(){return this.#e}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const c=this.#t.defaultQueryOptions(i),r=this.#t.getQueryCache().build(this.#t,c);return r.fetch().then(()=>this.createResult(r,c))}fetch(i){return this.#h({...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#h(i){this.#j();let c=this.#e.fetch(this.options,i);return i?.throwOnError||(c=c.catch(ve)),c}#v(){this.#S();const i=Gl(this.options.staleTime,this.#e);if(Fn.isServer()||this.#a.isStale||!Ws(i))return;const r=kh(this.#a.dataUpdatedAt,i)+1;this.#o=sa.setTimeout(()=>{this.#a.isStale||this.updateResult()},r)}#p(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#g(i){this.#x(),this.#r=i,!(Fn.isServer()||Ae(this.options.enabled,this.#e)===!1||!Ws(this.#r)||this.#r===0)&&(this.#d=sa.setInterval(()=>{(this.options.refetchIntervalInBackground||ur.isFocused())&&this.#h()},this.#r))}#b(){this.#v(),this.#g(this.#p())}#S(){this.#o!==void 0&&(sa.clearTimeout(this.#o),this.#o=void 0)}#x(){this.#d!==void 0&&(sa.clearInterval(this.#d),this.#d=void 0)}createResult(i,c){const r=this.#e,f=this.options,d=this.#a,m=this.#i,g=this.#n,p=i!==r?i.state:this.#l,{state:y}=i;let M={...y},E=!1,x;if(c._optimisticResults){const gt=this.hasListeners(),wt=!gt&&Dh(i,c),ue=gt&&Rh(i,r,c,f);(wt||ue)&&(M={...M,...Ph(y.data,i.options)}),c._optimisticResults==="isRestoring"&&(M.fetchStatus="idle")}let{error:q,errorUpdatedAt:z,status:w}=M;x=M.data;let Y=!1;if(c.placeholderData!==void 0&&x===void 0&&w==="pending"){let gt;d?.isPlaceholderData&&c.placeholderData===g?.placeholderData?(gt=d.data,Y=!0):gt=typeof c.placeholderData=="function"?c.placeholderData(this.#m?.state.data,this.#m):c.placeholderData,gt!==void 0&&(w="success",x=tr(d?.data,gt,c),E=!0)}if(c.select&&x!==void 0&&!Y)if(d&&x===m?.data&&c.select===this.#f)x=this.#s;else try{this.#f=c.select,x=c.select(x),x=tr(d?.data,x,c),this.#s=x,this.#u=null}catch(gt){this.#u=gt}this.#u&&(q=this.#u,x=this.#s,z=Date.now(),w="error");const $=M.fetchStatus==="fetching",yt=w==="pending",ot=w==="error",Ct=yt&&$,Rt=x!==void 0,k={status:w,fetchStatus:M.fetchStatus,isPending:yt,isSuccess:w==="success",isError:ot,isInitialLoading:Ct,isLoading:Ct,data:x,dataUpdatedAt:M.dataUpdatedAt,error:q,errorUpdatedAt:z,failureCount:M.fetchFailureCount,failureReason:M.fetchFailureReason,errorUpdateCount:M.errorUpdateCount,isFetched:i.isFetched(),isFetchedAfterMount:M.dataUpdateCount>p.dataUpdateCount||M.errorUpdateCount>p.errorUpdateCount,isFetching:$,isRefetching:$&&!yt,isLoadingError:ot&&!Rt,isPaused:M.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:ot&&Rt,isStale:rr(i,c),refetch:this.refetch,promise:this.#c,isEnabled:Ae(c.enabled,i)!==!1};if(this.options.experimental_prefetchInRender){const gt=k.data!==void 0,wt=k.status==="error"&&!gt,ue=ce=>{wt?ce.reject(k.error):gt&&ce.resolve(k.data)},le=()=>{const ce=this.#c=k.promise=er();ue(ce)},_t=this.#c;switch(_t.status){case"pending":i.queryHash===r.queryHash&&ue(_t);break;case"fulfilled":(wt||k.data!==_t.value)&&le();break;case"rejected":(!wt||k.error!==_t.reason)&&le();break}}return k}updateResult(){const i=this.#a,c=this.createResult(this.#e,this.options);if(this.#i=this.#e.state,this.#n=this.options,this.#i.data!==void 0&&(this.#m=this.#e),Is(c,i))return;this.#a=c;const r=()=>{if(!i)return!0;const{notifyOnChangeProps:f}=this.options,d=typeof f=="function"?f():f;if(d==="all"||!d&&!this.#y.size)return!0;const m=new Set(d??this.#y);return this.options.throwOnError&&m.add("error"),Object.keys(this.#a).some(g=>{const A=g;return this.#a[A]!==i[A]&&m.has(A)})};this.#E({listeners:r()})}#j(){const i=this.#t.getQueryCache().build(this.#t,this.options);if(i===this.#e)return;const c=this.#e;this.#e=i,this.#l=i.state,this.hasListeners()&&(c?.removeObserver(this),i.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(i){ee.batch(()=>{i.listeners&&this.listeners.forEach(c=>{c(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function m0(i,c){return Ae(c.enabled,i)!==!1&&i.state.data===void 0&&!(i.state.status==="error"&&Ae(c.retryOnMount,i)===!1)}function Dh(i,c){return m0(i,c)||i.state.data!==void 0&&ar(i,c,c.refetchOnMount)}function ar(i,c,r){if(Ae(c.enabled,i)!==!1&&Gl(c.staleTime,i)!=="static"){const f=typeof r=="function"?r(i):r;return f==="always"||f!==!1&&rr(i,c)}return!1}function Rh(i,c,r,f){return(i!==c||Ae(f.enabled,i)===!1)&&(!r.suspense||i.state.status!=="error")&&rr(i,r)}function rr(i,c){return Ae(c.enabled,i)!==!1&&i.isStaleByTime(Gl(c.staleTime,i))}function y0(i,c){return!Is(i.getCurrentResult(),c)}var v0=class extends Ih{#t;#e;#l;#a;constructor(i){super(),this.#t=i.client,this.mutationId=i.mutationId,this.#l=i.mutationCache,this.#e=[],this.state=i.state||p0(),this.setOptions(i.options),this.scheduleGc()}setOptions(i){this.options=i,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(i){this.#e.includes(i)||(this.#e.push(i),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){this.#e=this.#e.filter(c=>c!==i),this.scheduleGc(),this.#l.notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#l.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(i){const c=()=>{this.#i({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=Wh({fn:()=>this.options.mutationFn?this.options.mutationFn(i,r):Promise.reject(new Error("No mutationFn found")),onFail:(m,g)=>{this.#i({type:"failed",failureCount:m,error:g})},onPause:()=>{this.#i({type:"pause"})},onContinue:c,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#l.canRun(this)});const f=this.state.status==="pending",d=!this.#a.canStart();try{if(f)c();else{this.#i({type:"pending",variables:i,isPaused:d}),this.#l.config.onMutate&&await this.#l.config.onMutate(i,this,r);const g=await this.options.onMutate?.(i,r);g!==this.state.context&&this.#i({type:"pending",context:g,variables:i,isPaused:d})}const m=await this.#a.start();return await this.#l.config.onSuccess?.(m,i,this.state.context,this,r),await this.options.onSuccess?.(m,i,this.state.context,r),await this.#l.config.onSettled?.(m,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(m,null,i,this.state.context,r),this.#i({type:"success",data:m}),m}catch(m){try{await this.#l.config.onError?.(m,i,this.state.context,this,r)}catch(g){Promise.reject(g)}try{await this.options.onError?.(m,i,this.state.context,r)}catch(g){Promise.reject(g)}try{await this.#l.config.onSettled?.(void 0,m,this.state.variables,this.state.context,this,r)}catch(g){Promise.reject(g)}try{await this.options.onSettled?.(void 0,m,i,this.state.context,r)}catch(g){Promise.reject(g)}throw this.#i({type:"error",error:m}),m}finally{this.#l.runNext(this)}}#i(i){const c=r=>{switch(i.type){case"failed":return{...r,failureCount:i.failureCount,failureReason:i.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:i.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:i.isPaused,status:"pending",variables:i.variables,submittedAt:Date.now()};case"success":return{...r,data:i.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:i.error,failureCount:r.failureCount+1,failureReason:i.error,isPaused:!1,status:"error"}}};this.state=c(this.state),ee.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(i)}),this.#l.notify({mutation:this,type:"updated",action:i})})}};function p0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var g0=class extends ti{constructor(i={}){super(),this.config=i,this.#t=new Set,this.#e=new Map,this.#l=0}#t;#e;#l;build(i,c,r){const f=new v0({client:i,mutationCache:this,mutationId:++this.#l,options:i.defaultMutationOptions(c),state:r});return this.add(f),f}add(i){this.#t.add(i);const c=xu(i);if(typeof c=="string"){const r=this.#e.get(c);r?r.push(i):this.#e.set(c,[i])}this.notify({type:"added",mutation:i})}remove(i){if(this.#t.delete(i)){const c=xu(i);if(typeof c=="string"){const r=this.#e.get(c);if(r)if(r.length>1){const f=r.indexOf(i);f!==-1&&r.splice(f,1)}else r[0]===i&&this.#e.delete(c)}}this.notify({type:"removed",mutation:i})}canRun(i){const c=xu(i);if(typeof c=="string"){const f=this.#e.get(c)?.find(d=>d.state.status==="pending");return!f||f===i}else return!0}runNext(i){const c=xu(i);return typeof c=="string"?this.#e.get(c)?.find(f=>f!==i&&f.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ee.batch(()=>{this.#t.forEach(i=>{this.notify({type:"removed",mutation:i})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(i){const c={exact:!0,...i};return this.getAll().find(r=>Oh(c,r))}findAll(i={}){return this.getAll().filter(c=>Oh(i,c))}notify(i){ee.batch(()=>{this.listeners.forEach(c=>{c(i)})})}resumePausedMutations(){const i=this.getAll().filter(c=>c.state.isPaused);return ee.batch(()=>Promise.all(i.map(c=>c.continue().catch(ve))))}};function xu(i){return i.options.scope?.id}var b0=class extends ti{constructor(i={}){super(),this.config=i,this.#t=new Map}#t;build(i,c,r){const f=c.queryKey,d=c.queryHash??cr(f,c);let m=this.get(d);return m||(m=new d0({client:i,queryKey:f,queryHash:d,options:i.defaultQueryOptions(c),state:r,defaultOptions:i.getQueryDefaults(f)}),this.add(m)),m}add(i){this.#t.has(i.queryHash)||(this.#t.set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const c=this.#t.get(i.queryHash);c&&(i.destroy(),c===i&&this.#t.delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){ee.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return this.#t.get(i)}getAll(){return[...this.#t.values()]}find(i){const c={exact:!0,...i};return this.getAll().find(r=>Nh(c,r))}findAll(i={}){const c=this.getAll();return Object.keys(i).length>0?c.filter(r=>Nh(i,r)):c}notify(i){ee.batch(()=>{this.listeners.forEach(c=>{c(i)})})}onFocus(){ee.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){ee.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},S0=class{#t;#e;#l;#a;#i;#n;#c;#u;constructor(i={}){this.#t=i.queryCache||new b0,this.#e=i.mutationCache||new g0,this.#l=i.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#c=ur.subscribe(async i=>{i&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#u=Ou.subscribe(async i=>{i&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#c?.(),this.#c=void 0,this.#u?.(),this.#u=void 0)}isFetching(i){return this.#t.findAll({...i,fetchStatus:"fetching"}).length}isMutating(i){return this.#e.findAll({...i,status:"pending"}).length}getQueryData(i){const c=this.defaultQueryOptions({queryKey:i});return this.#t.get(c.queryHash)?.state.data}ensureQueryData(i){const c=this.defaultQueryOptions(i),r=this.#t.build(this,c),f=r.state.data;return f===void 0?this.fetchQuery(i):(i.revalidateIfStale&&r.isStaleByTime(Gl(c.staleTime,r))&&this.prefetchQuery(c),Promise.resolve(f))}getQueriesData(i){return this.#t.findAll(i).map(({queryKey:c,state:r})=>{const f=r.data;return[c,f]})}setQueryData(i,c,r){const f=this.defaultQueryOptions({queryKey:i}),m=this.#t.get(f.queryHash)?.state.data,g=t0(c,m);if(g!==void 0)return this.#t.build(this,f).setData(g,{...r,manual:!0})}setQueriesData(i,c,r){return ee.batch(()=>this.#t.findAll(i).map(({queryKey:f})=>[f,this.setQueryData(f,c,r)]))}getQueryState(i){const c=this.defaultQueryOptions({queryKey:i});return this.#t.get(c.queryHash)?.state}removeQueries(i){const c=this.#t;ee.batch(()=>{c.findAll(i).forEach(r=>{c.remove(r)})})}resetQueries(i,c){const r=this.#t;return ee.batch(()=>(r.findAll(i).forEach(f=>{f.reset()}),this.refetchQueries({type:"active",...i},c)))}cancelQueries(i,c={}){const r={revert:!0,...c},f=ee.batch(()=>this.#t.findAll(i).map(d=>d.cancel(r)));return Promise.all(f).then(ve).catch(ve)}invalidateQueries(i,c={}){return ee.batch(()=>(this.#t.findAll(i).forEach(r=>{r.invalidate()}),i?.refetchType==="none"?Promise.resolve():this.refetchQueries({...i,type:i?.refetchType??i?.type??"active"},c)))}refetchQueries(i,c={}){const r={...c,cancelRefetch:c.cancelRefetch??!0},f=ee.batch(()=>this.#t.findAll(i).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let m=d.fetch(void 0,r);return r.throwOnError||(m=m.catch(ve)),d.state.fetchStatus==="paused"?Promise.resolve():m}));return Promise.all(f).then(ve)}fetchQuery(i){const c=this.defaultQueryOptions(i);c.retry===void 0&&(c.retry=!1);const r=this.#t.build(this,c);return r.isStaleByTime(Gl(c.staleTime,r))?r.fetch(c):Promise.resolve(r.state.data)}prefetchQuery(i){return this.fetchQuery(i).then(ve).catch(ve)}fetchInfiniteQuery(i){return i._type="infinite",this.fetchQuery(i)}prefetchInfiniteQuery(i){return this.fetchInfiniteQuery(i).then(ve).catch(ve)}ensureInfiniteQueryData(i){return i._type="infinite",this.ensureQueryData(i)}resumePausedMutations(){return Ou.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#l}setDefaultOptions(i){this.#l=i}setQueryDefaults(i,c){this.#a.set(Vn(i),{queryKey:i,defaultOptions:c})}getQueryDefaults(i){const c=[...this.#a.values()],r={};return c.forEach(f=>{Jn(i,f.queryKey)&&Object.assign(r,f.defaultOptions)}),r}setMutationDefaults(i,c){this.#i.set(Vn(i),{mutationKey:i,defaultOptions:c})}getMutationDefaults(i){const c=[...this.#i.values()],r={};return c.forEach(f=>{Jn(i,f.mutationKey)&&Object.assign(r,f.defaultOptions)}),r}defaultQueryOptions(i){if(i._defaulted)return i;const c={...this.#l.queries,...this.getQueryDefaults(i.queryKey),...i,_defaulted:!0};return c.queryHash||(c.queryHash=cr(c.queryKey,c)),c.refetchOnReconnect===void 0&&(c.refetchOnReconnect=c.networkMode!=="always"),c.throwOnError===void 0&&(c.throwOnError=!!c.suspense),!c.networkMode&&c.persister&&(c.networkMode="offlineFirst"),c.queryFn===sr&&(c.enabled=!1),c}defaultMutationOptions(i){return i?._defaulted?i:{...this.#l.mutations,...i?.mutationKey&&this.getMutationDefaults(i.mutationKey),...i,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},tm=Q.createContext(void 0),ei=i=>{const c=Q.useContext(tm);if(!c)throw new Error("No QueryClient set, use QueryClientProvider to set one");return c},x0=({client:i,children:c})=>(Q.useEffect(()=>(i.mount(),()=>{i.unmount()}),[i]),o.jsx(tm.Provider,{value:i,children:c})),em=Q.createContext(!1),j0=()=>Q.useContext(em);em.Provider;function E0(){let i=!1;return{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i}}var T0=Q.createContext(E0()),N0=()=>Q.useContext(T0),O0=(i,c,r)=>{const f=r?.state.error&&typeof i.throwOnError=="function"?Fh(i.throwOnError,[r.state.error,r]):i.throwOnError;(i.suspense||i.experimental_prefetchInRender||f)&&(c.isReset()||(i.retryOnMount=!1))},M0=i=>{Q.useEffect(()=>{i.clearReset()},[i])},A0=({result:i,errorResetBoundary:c,throwOnError:r,query:f,suspense:d})=>i.isError&&!c.isReset()&&!i.isFetching&&f&&(d&&i.data===void 0||Fh(r,[i.error,f])),C0=i=>{if(i.suspense){const r=d=>d==="static"?d:Math.max(d??1e3,1e3),f=i.staleTime;i.staleTime=typeof f=="function"?(...d)=>r(f(...d)):r(f),typeof i.gcTime=="number"&&(i.gcTime=Math.max(i.gcTime,1e3))}},z0=(i,c)=>i.isLoading&&i.isFetching&&!c,_0=(i,c)=>i?.suspense&&c.isPending,Uh=(i,c,r)=>c.fetchOptimistic(i).catch(()=>{r.clearReset()});function D0(i,c,r){const f=j0(),d=N0(),m=ei(),g=m.defaultQueryOptions(i);m.getDefaultOptions().queries?._experimental_beforeQuery?.(g);const A=m.getQueryCache().get(g.queryHash),p=i.subscribed!==!1;g._optimisticResults=f?"isRestoring":p?"optimistic":void 0,C0(g),O0(g,d,A),M0(d);const y=!m.getQueryCache().get(g.queryHash),[M]=Q.useState(()=>new c(m,g)),E=M.getOptimisticResult(g),x=!f&&p;if(Q.useSyncExternalStore(Q.useCallback(q=>{const z=x?M.subscribe(ee.batchCalls(q)):ve;return M.updateResult(),z},[M,x]),()=>M.getCurrentResult(),()=>M.getCurrentResult()),Q.useEffect(()=>{M.setOptions(g)},[g,M]),_0(g,E))throw Uh(g,M,d);if(A0({result:E,errorResetBoundary:d,throwOnError:g.throwOnError,query:A,suspense:g.suspense}))throw E.error;return m.getDefaultOptions().queries?._experimental_afterQuery?.(g,E),g.experimental_prefetchInRender&&!Fn.isServer()&&z0(E,f)&&(y?Uh(g,M,d):A?.promise)?.catch(ve).finally(()=>{M.updateResult()}),g.notifyOnChangeProps?E:M.trackResult(E)}function ge(i,c){return D0(i,h0)}function lm(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}async function Ce(i){const c=await fetch(i);if(c.status===401&&lm(),!c.ok)throw new Error(await c.text());return c.json()}async function Yl(i,c,r){const f={method:i};r!==void 0&&(f.headers={"Content-Type":"application/json"},f.body=JSON.stringify(r));const d=await fetch(c,f);if(!d.ok)throw new Error(await d.text());return d.status===204?{}:d.json()}async function Fa(i,c){const r=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c||{})});if(r.status===401&&lm(),!r.ok)throw new Error(await r.text());return r.json()}function R0(){return ge({queryKey:["config"],queryFn:async()=>{const i=await Ce("/api/config");return i.auth.enabled&&!i.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),i},staleTime:1/0})}const am=(...i)=>i.filter((c,r,f)=>!!c&&c.trim()!==""&&f.indexOf(c)===r).join(" ").trim();const U0=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const H0=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(c,r,f)=>f?f.toUpperCase():r.toLowerCase());const Hh=i=>{const c=H0(i);return c.charAt(0).toUpperCase()+c.slice(1)};var Js={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 q0=i=>{for(const c in i)if(c.startsWith("aria-")||c==="role"||c==="title")return!0;return!1},w0=Q.createContext({}),Q0=()=>Q.useContext(w0),B0=Q.forwardRef(({color:i,size:c,strokeWidth:r,absoluteStrokeWidth:f,className:d="",children:m,iconNode:g,...A},p)=>{const{size:y=24,strokeWidth:M=2,absoluteStrokeWidth:E=!1,color:x="currentColor",className:q=""}=Q0()??{},z=f??E?Number(r??M)*24/Number(c??y):r??M;return Q.createElement("svg",{ref:p,...Js,width:c??y??Js.width,height:c??y??Js.height,stroke:i??x,strokeWidth:z,className:am("lucide",q,d),...!m&&!q0(A)&&{"aria-hidden":"true"},...A},[...g.map(([w,Y])=>Q.createElement(w,Y)),...Array.isArray(m)?m:[m]])});const Ot=(i,c)=>{const r=Q.forwardRef(({className:f,...d},m)=>Q.createElement(B0,{ref:m,iconNode:c,className:am(`lucide-${U0(Hh(i))}`,`lucide-${i}`,f),...d}));return r.displayName=Hh(i),r};const L0=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Y0=Ot("check",L0);const G0=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],X0=Ot("chevron-down",G0);const K0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Z0=Ot("chevron-right",K0);const k0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],V0=Ot("clock",k0);const J0=[["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"}]],F0=Ot("copy",J0);const $0=[["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"}]],W0=Ot("download",$0);const I0=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],P0=Ot("ellipsis",I0);const tp=[["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"}]],ep=Ot("file-text",tp);const lp=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ap=Ot("folder",lp);const np=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ip=Ot("globe",np);const up=[["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"}]],cp=Ot("history",up);const sp=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],rp=Ot("layout-dashboard",sp);const fp=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],op=Ot("link",fp);const dp=[["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"}]],hp=Ot("lock",dp);const mp=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],yp=Ot("log-out",mp);const vp=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],pp=Ot("menu",vp);const gp=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bp=Ot("plus",gp);const Sp=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],xp=Ot("search",Sp);const jp=[["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"}]],Ep=Ot("settings",jp);const Tp=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Np=Ot("share-2",Tp);const Op=[["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"}]],Mp=Ot("shield",Op);const Ap=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Cp=Ot("square-terminal",Ap);const zp=[["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"}]],_p=Ot("trash-2",zp);const Dp=[["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"}]],Rp=Ot("triangle-alert",Dp);const Up=[["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"}]],Hp=Ot("upload",Up);const qp=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],wp=Ot("users",qp);const Qp=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bp=Ot("x",Qp);function Lp(){document.body.classList.toggle("sb-open")}function Fe(){document.body.classList.remove("sb-open")}const Yp={alert:Rp,check:Y0,chev:Z0,chevd:X0,clock:V0,copy:F0,doc:ep,dots:P0,download:W0,folder:ap,dashboard:rp,gear:Ep,globe:ip,hist:cp,link:op,lock:hp,menu:pp,plus:bp,power:yp,search:xp,share:Np,shield:Mp,terminal:Cp,trash:_p,upload:Hp,users:wp,x:Bp};function Zt({name:i}){const c=Yp[i];return c?o.jsx(c,{className:"ico","aria-hidden":"true"}):null}function $n(i){return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:"sb-backdrop",onClick:Fe}),o.jsxs("aside",{id:"sidebar",children:[i.vault,i.projectsNav,i.tree??o.jsx("nav",{id:"tree","aria-label":"Files"}),i.orgBar]}),o.jsxs("main",{id:"main",children:[i.topbar,o.jsx("article",{id:"content",className:i.contentClass??"markdown",ref:i.contentRef,onScroll:i.onContentScroll,children:i.children})]})]})}function Mu(i){const{name:c,onHome:r,showSignout:f}=i;return o.jsxs("header",{id:"vault",children:[o.jsx("span",{id:"vault-badge","aria-hidden":"true",children:"🐻"}),o.jsx("span",{id:"vault-name",className:r?"vault-link":void 0,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:d=>{r&&(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())},children:c}),o.jsx("div",{className:"vault-actions",children:f&&o.jsx("a",{id:"signout",href:"/auth/logout",title:"Sign out","aria-label":"Sign out",children:o.jsx(Zt,{name:"power"})})})]})}function Wn(i){return o.jsxs("header",{id:"topbar",children:[o.jsx("button",{id:"menu-btn",className:"icon-btn",title:"Menu","aria-label":"Menu",onClick:Lp,children:o.jsx(Zt,{name:"menu"})}),o.jsx("span",{id:"crumb",children:i.crumb}),o.jsx("span",{id:"meta",children:i.meta}),i.actions]})}let fr={msg:"",err:!1,shown:!1},Eu=[],qh;function wh(i){fr=i,Eu.forEach(c=>c())}function st(i,c=!1){wh({msg:i,err:c,shown:!0}),clearTimeout(qh),qh=setTimeout(()=>wh({...fr,shown:!1}),3200)}function Gp(){const i=Q.useSyncExternalStore(c=>(Eu.push(c),()=>{Eu=Eu.filter(r=>r!==c)}),()=>fr);return o.jsx("div",{id:"toast",className:i.shown?"show"+(i.err?" err":""):"",children:i.msg})}let nm=null,Tu=[];function or(i){nm=i,Tu.forEach(c=>c())}function im(i,c,r="",f="OK"){return new Promise(d=>or({kind:"prompt",title:i,label:c,value:r,okLabel:f,resolve:d}))}function ju(i,c,r="Confirm",f=!1){return new Promise(d=>or({kind:"confirm",title:i,message:c,confirmLabel:r,danger:f,resolve:d}))}function Xp(){const i=Q.useSyncExternalStore(c=>(Tu.push(c),()=>{Tu=Tu.filter(r=>r!==c)}),()=>nm);return i?i.kind==="prompt"?o.jsx(Kp,{m:i}):o.jsx(Zp,{m:i}):null}function um(){or(null)}function Kp({m:i}){const c=Q.useRef(null),r=d=>{um(),i.resolve(d)},f=()=>r(c.current.value.trim()||null);return Q.useEffect(()=>{c.current.focus(),c.current.select();const d=m=>{m.key==="Escape"&&r(null),m.key==="Enter"&&f()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),o.jsx("div",{className:"modal-back",onClick:d=>d.target===d.currentTarget&&r(null),children:o.jsxs("div",{className:"modal",children:[o.jsx("h3",{children:i.title}),o.jsx("label",{className:"modal-label",children:i.label}),o.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",defaultValue:i.value,ref:c}),o.jsxs("div",{className:"modal-actions",children:[o.jsx("button",{className:"ai-btn",onClick:()=>r(null),children:"Cancel"}),o.jsx("button",{className:"pbtn",onClick:f,children:i.okLabel})]})]})})}function Zp({m:i}){const c=Q.useRef(null),r=f=>{um(),i.resolve(f)};return Q.useEffect(()=>{c.current.focus();const f=d=>{d.key==="Escape"&&r(!1),d.key==="Enter"&&r(!0)};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[]),o.jsx("div",{className:"modal-back",onClick:f=>f.target===f.currentTarget&&r(!1),children:o.jsxs("div",{className:"modal",children:[o.jsx("h3",{children:i.title}),o.jsx("p",{className:"modal-msg",children:i.message}),o.jsxs("div",{className:"modal-actions",children:[o.jsx("button",{className:"ai-btn",onClick:()=>r(!1),children:"Cancel"}),o.jsx("button",{className:i.danger?"danger-btn":"pbtn",onClick:()=>r(!0),ref:c,children:i.confirmLabel})]})]})})}function kp(i){return ge({queryKey:["projects"],queryFn:()=>Ce("/api/projects"),enabled:i,refetchInterval:3e4,select:c=>c.projects||[]})}function Vp(i){return ge({queryKey:["orgs"],queryFn:()=>Ce("/api/orgs"),enabled:i,select:c=>c.orgs||[]})}function cm(i){return ge({queryKey:["admin","pending"],queryFn:()=>Ce("/api/admin/pending"),enabled:i,select:c=>c.pending||[]})}function sm(){const i=ei();return()=>Promise.all([i.invalidateQueries({queryKey:["projects"]}),i.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function rm(i){return i.split("/").map(encodeURIComponent).join("/")}function Qh(i){return i.split("/").map(decodeURIComponent).join("/")}const Jp=new Set(["insights","history","install","settings"]);function fm(i,c){const r=i.replace(/^\/+/,"");if(c!=="hub")return{path:r?Qh(r):""};const f=r.indexOf("/");if(f===-1)return{project:r,path:""};const d={project:r.slice(0,f),path:Qh(r.slice(f+1))},m=d.path.indexOf("/"),g=m===-1?d.path:d.path.slice(0,m);return Jp.has(g)&&(d.view=g,d.viewTarget=m===-1?"":d.path.slice(m+1).replace(/\/+$/,""),d.path=""),d}function Fp(i,c){const r=rm(i);return c?"/"+c+(r?"/"+r:""):"/"+r}function Ja(i,c,r){let f=(c?"/"+c:"")+"/"+i;return r&&(f+="/"+rm(r.replace(/\/+$/,""))),f}let dr="POP";const nr=new Set;function om(){for(const i of nr)i()}window.addEventListener("popstate",()=>{dr="POP",om()});function pe(i,c){const r=location.pathname+location.search;!c?.replace&&r===i||(history[c?.replace?"replaceState":"pushState"](null,"",i),dr=c?.replace?"REPLACE":"PUSH",om())}function hr(){return Q.useSyncExternalStore(i=>(nr.add(i),()=>{nr.delete(i)}),()=>location.pathname)}function $p(){return dr}function Wp({to:i}){return Q.useEffect(()=>{pe(i,{replace:!0})},[i]),null}const Ip=/\.(md|markdown)$/i,Pp=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,tg=/\.html?$/i,eg=/\.(txt|log|json|ya?ml|toml|csv|go|py|js|ts|jsx|tsx|sh|bash|zsh|rb|rs|c|h|cpp|java|kt|swift|sql|css|xml|ini|conf|env|mod|sum|jsonl)$/i;function dm(i){if(i<1024)return i+" B";const c=["KB","MB","GB","TB"];let r=-1;do i/=1024,r++;while(i>=1024&&rd.invalidateQueries({queryKey:["orgs"]}),y=()=>d.invalidateQueries({queryKey:["invites",i.id]}),M=()=>d.invalidateQueries({queryKey:["orgShares",i.id]}),{data:E}=ge({queryKey:["invites",i.id],queryFn:()=>Ce(`/api/orgs/${i.id}/invites`),enabled:m,select:z=>z.invites||[]}),{data:x}=ge({queryKey:["orgShares",i.id],queryFn:()=>Ce(`/api/orgs/${i.id}/shares`),enabled:m,select:z=>z.shares||[]}),q=c.filter(z=>z.org===i.id);return o.jsxs("div",{className:"admin",children:[o.jsx("h1",{id:"org-title",children:i.name+(m?"":" · member")}),m&&o.jsxs("div",{className:"admin-row",children:[o.jsx("input",{id:"org-rename",type:"text",value:g,onChange:z=>A(z.target.value)}),o.jsx("button",{className:"pbtn",id:"org-rename-btn",onClick:async()=>{try{await Yl("PATCH","/api/orgs/"+i.id,{name:g.trim()}),st("Renamed."),p()}catch(z){st(z.message,!0)}},children:"Rename org"})]}),o.jsx("h3",{children:"Members"}),o.jsx("div",{className:"admin-list",children:i.members.map(z=>{const w=!!r&&z.email.toLowerCase()===r.toLowerCase();return o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:z.email+(w?" (you)":"")}),m&&!w?o.jsxs(o.Fragment,{children:[o.jsxs("select",{value:z.role,onChange:async Y=>{try{await Yl("PATCH",`/api/orgs/${i.id}/members/${encodeURIComponent(z.email)}`,{role:Y.target.value}),st("Role updated.")}catch($){st($.message,!0)}p()},children:[o.jsx("option",{value:"owner",children:"owner"}),o.jsx("option",{value:"member",children:"member"})]}),o.jsx("button",{className:"ai-del",onClick:async()=>{if(await ju("Remove member",`Remove ${z.email} from ${i.name}?`,"Remove",!0))try{await Yl("DELETE",`/api/orgs/${i.id}/members/${encodeURIComponent(z.email)}`),st("Removed."),p()}catch(Y){st(Y.message,!0)}},children:"Remove"})]}):o.jsx("span",{className:"ai-tag",children:z.role})]},z.email)})}),m&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{children:"Projects"}),o.jsxs("div",{className:"admin-list",children:[q.length===0&&o.jsx("div",{className:"admin-empty",children:"No projects yet."}),q.map(z=>o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:z.name}),o.jsx("button",{className:"ai-btn",onClick:async()=>{const w=await im("Rename project","New name",z.name,"Rename");if(!(!w||w===z.name))try{await Yl("PATCH","/api/projects/"+z.id,{name:w}),st("Renamed."),await f()}catch(Y){st(Y.message,!0)}},children:"Rename"}),o.jsx("button",{className:"ai-del",onClick:async()=>{if(await ju("Delete project",`Delete “${z.name}”? Its files stay in storage, but it's removed from the hub.`,"Delete",!0))try{await Yl("DELETE","/api/projects/"+z.id),st(`Deleted “${z.name}”.`),await f()}catch(w){st(w.message,!0)}},children:"Delete"})]},z.id))]}),o.jsxs("div",{className:"admin-h",children:[o.jsx("h3",{children:"Invite links"}),o.jsx("button",{className:"pbtn",onClick:async()=>{try{const z=await Fa(`/api/orgs/${i.id}/invites`),w=await In(z.url);st(w?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),y()}catch(z){st(z.message,!0)}},children:"New invite"})]}),o.jsxs("div",{className:"admin-list",children:[E&&E.length===0&&o.jsx("div",{className:"admin-empty",children:"No active invite links."}),(E||[]).map(z=>o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main mono",style:{cursor:"pointer"},title:"Copy",onClick:()=>In(z.url).then(w=>st(w?"Copied.":"Select and copy the link.")),children:z.url}),o.jsx("span",{className:"ai-tag",children:(z.creator?"by "+z.creator+" · ":"")+(z.uses?z.uses+" joined · ":"unused · ")+"expires "+new Date(z.expires).toLocaleDateString()}),o.jsx("button",{className:"ai-del",onClick:async()=>{if(await ju("Revoke invite","Revoke this invite link? Anyone still holding it won't be able to join.","Revoke",!0))try{await Yl("DELETE",`/api/orgs/${i.id}/invites/${z.token}`),st("Revoked."),y()}catch(w){st(w.message,!0)}},children:"Revoke"})]},z.token))]}),o.jsx("h3",{children:"Public share links"}),o.jsxs("div",{className:"admin-list",children:[x&&x.length===0&&o.jsx("div",{className:"admin-empty",children:"No public shares."}),(x||[]).map(z=>o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main mono",style:{cursor:"pointer"},title:z.url,onClick:()=>window.open(z.url,"_blank"),children:z.path}),o.jsx("span",{className:"ai-tag",children:(z.project_name||"")+(z.creator?" · by "+z.creator:"")+(z.created?" · "+new Date(z.created).toLocaleDateString():"")}),o.jsx("button",{className:"ai-del",onClick:async()=>{if(await ju("Revoke share link",`Revoke the public link to “${z.path}”? Anyone with the URL will lose access.`,"Revoke",!0))try{await Yl("DELETE","/api/shares/"+z.token),st("Share revoked."),M()}catch(w){st(w.message,!0)}},children:"Revoke"})]},z.token))]})]})]})}function ag(){const i=ei(),{data:c,error:r}=ge({queryKey:["admin","policy"],queryFn:()=>Ce("/api/admin/policy")}),{data:f}=cm(!0),[d,m]=Q.useState(!1),[g,A]=Q.useState(!1);if(Q.useEffect(()=>{c&&(m(c.require_verification&&c.mailer),A(c.require_approval))},[c]),Q.useEffect(()=>{r&&st(r.message,!0)},[r]),!c)return null;const p=async(y,M,E)=>{try{await Fa(`/api/admin/pending/${y}/${M}`),st((M==="approve"?"Approved ":"Denied ")+E),i.invalidateQueries({queryKey:["admin","pending"]})}catch(x){st(x.message,!0)}};return o.jsxs("div",{className:"admin",children:[o.jsx("h1",{children:"Signup & access"}),o.jsx("p",{className:"admin-sub",children:"Who can create an account on this hub, and how new accounts are vetted."}),o.jsx("h3",{children:"New-account vetting"}),o.jsxs("div",{className:"admin-list",children:[o.jsx(Bh,{label:"Require email verification",desc:c.mailer?"New accounts must click an emailed link before they can sign in — proves they control the address.":"Configure SMTP on the server (auth.smtp) to enable email verification.",checked:d,disabled:!c.mailer,onChange:m}),o.jsx(Bh,{label:"Require admin approval",desc:"New accounts wait for a hub admin to approve them before they gain access.",checked:g,onChange:A})]}),o.jsx("button",{className:"pbtn",style:{marginTop:14},onClick:async()=>{try{await Fa("/api/admin/policy",{require_verification:d,require_approval:g}),st("Signup policy saved."),i.invalidateQueries({queryKey:["admin","policy"]})}catch(y){st(y.message,!0)}},children:"Save policy"}),o.jsx("h3",{children:"Who can sign up"}),o.jsxs("div",{className:"admin-list",children:[o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:"Allowed email domains"}),o.jsx("span",{className:"ai-tag",children:c.allowed_domains&&c.allowed_domains.length?c.allowed_domains.map(y=>"@"+y).join(", "):"any"})]}),o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:"Self-signup"}),o.jsx("span",{className:"ai-tag",children:c.allow_signup?"open":"invite-only"})]}),o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:"Hub admins"}),o.jsx("span",{className:"ai-tag",children:c.admins&&c.admins.length?c.admins.join(", "):"none"})]})]}),o.jsx("p",{className:"admin-sub",children:"Domains and admins are set in the server config file (they can't be widened from the browser)."}),o.jsx("h3",{children:"Pending signups"}),o.jsxs("div",{className:"admin-list",children:[(!f||f.length===0)&&o.jsx("div",{className:"admin-empty",children:"No one is waiting for approval."}),(f||[]).map(y=>o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:(y.name?y.name+" · ":"")+y.email}),o.jsx("button",{className:"pbtn",onClick:()=>p(y.id,"approve",y.email),children:"Approve"}),o.jsx("button",{className:"ai-del",onClick:()=>p(y.id,"deny",y.email),children:"Deny"})]},y.id))]})]})}function Bh({label:i,desc:c,checked:r,disabled:f,onChange:d}){return o.jsxs("label",{className:"admin-item toggle",style:f?{opacity:.55}:void 0,children:[o.jsxs("span",{className:"ai-main",children:[o.jsx("div",{className:"tg-label",children:i}),o.jsx("div",{className:"tg-desc",children:c})]}),o.jsx("input",{type:"checkbox",checked:r,disabled:f,onChange:m=>d(m.target.checked)})]})}const Lh=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function mm(i){let c=0;for(const r of i)c=c*31+r.charCodeAt(0)>>>0;return Lh[c%Lh.length]}function Yh({projects:i,currentId:c,menu:r}){const f=sm(),d=async()=>{const m=await im("New project","Project name","","Create");if(m)try{const g=await Fa("/api/projects",{name:m});await f(),pe("/"+g.project.id),st(`Created “${g.project.name}”.`)}catch(g){st("Could not create the project: "+g.message,!0)}};return o.jsxs("nav",{id:"projects","aria-label":"Projects",children:[o.jsxs("div",{className:"nav-head",children:[o.jsx("span",{children:"Projects"}),o.jsx("button",{className:"nav-add",title:"New project",onClick:d,children:"+"})]}),o.jsx("div",{className:"proj-row",children:o.jsxs("span",{className:"proj-select-wrap",children:[c&&o.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:mm(i.find(m=>m.id===c)?.name||"")}}),o.jsxs("select",{id:"project-select","aria-label":"Switch project",value:c||"",onChange:m=>{m.target.value&&(pe("/"+m.target.value),Fe())},children:[!c&&o.jsx("option",{value:"",disabled:!0}),i.map(m=>o.jsx("option",{value:m.id,children:m.name},m.id))]}),o.jsx(Zt,{name:"chevd"})]})}),r&&o.jsx("ul",{className:"nav-menu","aria-label":"Project pages",children:[["dashboard","Dashboard","dashboard",r.onDashboard],["install","Installation","terminal",r.onInstall],["history","History","hist",r.onHistory],["settings","Settings","gear",r.onSettings]].map(([m,g,A,p])=>o.jsx("li",{children:o.jsxs("div",{id:"nav-"+m,className:"row"+(r.active===m?" active":""),role:"button",tabIndex:0,onClick:p,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),p())},children:[o.jsx(Zt,{name:A}),o.jsx("span",{className:"label",children:g})]})},m))})]})}function ng({me:i,org:c,admin:r,onOrgSettings:f}){const[d,m]=Q.useState(!1),g=Q.useRef(null);Q.useEffect(()=>{if(!d)return;const p=M=>{g.current&&!g.current.contains(M.target)&&m(!1)},y=M=>{M.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",p),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",y)}},[d]);const A=i.name||i.email;return o.jsxs("footer",{id:"accountbar",ref:g,children:[d&&o.jsxs("div",{id:"account-menu",role:"menu","aria-label":"Account menu",children:[c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-sec",children:"Organization"}),o.jsxs("button",{id:"menu-org-settings",role:"menuitem",onClick:()=>{m(!1),f(c)},children:[o.jsx(Zt,{name:"gear"}),o.jsxs("span",{children:[o.jsx("b",{children:c.name})," Settings"]})]})]}),r&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-sec",children:"Hub"}),o.jsxs("button",{id:"menu-hub-admin",role:"menuitem",onClick:()=>{m(!1),r.onClick()},children:[o.jsx(Zt,{name:"shield"}),o.jsxs("span",{children:["Signup & access",r.pending?` · ${r.pending}`:""]})]})]}),o.jsx("div",{className:"menu-sec",children:"Account"}),o.jsxs("a",{id:"signout",role:"menuitem",href:"/auth/logout",children:[o.jsx(Zt,{name:"power"}),o.jsx("span",{children:"Log out"})]})]}),o.jsxs("button",{id:"account-btn","aria-haspopup":"menu","aria-expanded":d,onClick:()=>m(p=>!p),children:[o.jsx("span",{className:"avatar",style:{background:mm(i.email)},"aria-hidden":"true",children:(A.trim()[0]||"?").toUpperCase()}),o.jsxs("span",{className:"acct",children:[o.jsx("b",{children:A}),i.name&&o.jsx("small",{children:i.email})]}),o.jsx(Zt,{name:"chev"})]})]})}function ig({project:i,org:c}){return o.jsxs("div",{className:"project-settings",children:[o.jsx("h2",{children:i.name}),o.jsxs("dl",{className:"ps-facts",children:[o.jsx("dt",{children:"Project id"}),o.jsx("dd",{children:o.jsx("code",{children:i.id})}),c&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"Workspace"}),o.jsx("dd",{children:c.name})]}),i.created&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"Created"}),o.jsx("dd",{children:new Date(i.created).toLocaleDateString()})]})]})]})}const Fs=[{key:"claude",label:"Claude Code & Cowork"},{key:"hermes",label:"Hermes",hook:"hermes",note:"Registers BearDrive's hooks in Hermes's config: pull before every turn, push after edits with a session note, and report file reads to Insights."},{key:"codex",label:"Codex",hook:"codex",note:"Registers hooks in .codex/hooks.json.",extra:"Run /hooks inside Codex once to trust the project's .codex layer — after that every turn pulls, edits push automatically, and reads are reported to Insights."}];function ug(i,c){const r=window.location.origin,f=c.id;if(i.key==="claude")return[{title:"Add the BearDrive plugin",desc:"One time, in any Claude Code session. The plugin ships the beardrive skill, the /beardrive commands, and turn-boundary sync hooks — and Claude Cowork shares the same plugins, so installing it once covers both.",code:`/plugin marketplace add runbear-io/beardrive +`+a.stack}}var P=Object.prototype.hasOwnProperty,ft=i.unstable_scheduleCallback,xt=i.unstable_cancelCallback,$a=i.unstable_shouldYield,Cu=i.unstable_requestPaint,ne=i.unstable_now,Sm=i.unstable_getCurrentPriorityLevel,yr=i.unstable_ImmediatePriority,vr=i.unstable_UserBlockingPriority,ni=i.unstable_NormalPriority,xm=i.unstable_LowPriority,pr=i.unstable_IdlePriority,jm=i.log,Em=i.unstable_setDisableYieldValue,Wa=null,be=null;function vl(t){if(typeof jm=="function"&&Em(t),be&&typeof be.setStrictMode=="function")try{be.setStrictMode(Wa,t)}catch{}}var Se=Math.clz32?Math.clz32:Om,Tm=Math.log,Nm=Math.LN2;function Om(t){return t>>>=0,t===0?32:31-(Tm(t)/Nm|0)|0}var ii=256,ui=262144,ci=4194304;function Kl(t){var e=t&42;if(e!==0)return e;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function si(t,e,l){var a=t.pendingLanes;if(a===0)return 0;var n=0,u=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var h=a&134217727;return h!==0?(a=h&~u,a!==0?n=Kl(a):(s&=h,s!==0?n=Kl(s):l||(l=h&~t,l!==0&&(n=Kl(l))))):(h=a&~u,h!==0?n=Kl(h):s!==0?n=Kl(s):l||(l=a&~t,l!==0&&(n=Kl(l)))),n===0?0:e!==0&&e!==n&&(e&u)===0&&(u=n&-n,l=e&-e,u>=l||u===32&&(l&4194048)!==0)?e:n}function Ia(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Mm(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 gr(){var t=ci;return ci<<=1,(ci&62914560)===0&&(ci=4194304),t}function zu(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function Pa(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Am(t,e,l,a,n,u){var s=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var h=t.entanglements,v=t.expirationTimes,N=t.hiddenUpdates;for(l=s&~l;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Um=/[\n"\\]/g;function De(t){return t.replace(Um,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function qu(t,e,l,a,n,u,s,h){t.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.type=s:t.removeAttribute("type"),e!=null?s==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+_e(e)):t.value!==""+_e(e)&&(t.value=""+_e(e)):s!=="submit"&&s!=="reset"||t.removeAttribute("value"),e!=null?wu(t,s,_e(e)):l!=null?wu(t,s,_e(l)):a!=null&&t.removeAttribute("value"),n==null&&u!=null&&(t.defaultChecked=!!u),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?t.name=""+_e(h):t.removeAttribute("name")}function _r(t,e,l,a,n,u,s,h){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),e!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||e!=null)){Hu(t);return}l=l!=null?""+_e(l):"",e=e!=null?""+_e(e):l,h||e===t.value||(t.value=e),t.defaultValue=e}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=h?t.checked:!!a,t.defaultChecked=!!a,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.name=s),Hu(t)}function wu(t,e,l){e==="number"&&oi(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function ma(t,e,l,a){if(t=t.options,e){e={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=!1;if(Ie)try{var an={};Object.defineProperty(an,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",an,an),window.removeEventListener("test",an,an)}catch{Gu=!1}var gl=null,Xu=null,hi=null;function Qr(){if(hi)return hi;var t,e=Xu,l=e.length,a,n="value"in gl?gl.value:gl.textContent,u=n.length;for(t=0;t=cn),Kr=" ",Zr=!1;function kr(t,e){switch(t){case"keyup":return sy.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vr(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function fy(t,e){switch(t){case"compositionend":return Vr(e);case"keypress":return e.which!==32?null:(Zr=!0,Kr);case"textInput":return t=e.data,t===Kr&&Zr?null:t;default:return null}}function oy(t,e){if(ga)return t==="compositionend"||!Ju&&kr(t,e)?(t=Qr(),hi=Xu=gl=null,ga=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:l,offset:e-t};t=a}t:{for(;l;){if(l.nextSibling){l=l.nextSibling;break t}l=l.parentNode}l=void 0}l=ef(l)}}function af(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?af(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function nf(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=oi(t.document);e instanceof t.HTMLIFrameElement;){try{var l=typeof e.contentWindow.location.href=="string"}catch{l=!1}if(l)t=e.contentWindow;else break;e=oi(t.document)}return e}function Wu(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var by=Ie&&"documentMode"in document&&11>=document.documentMode,ba=null,Iu=null,on=null,Pu=!1;function uf(t,e,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pu||ba==null||ba!==oi(a)||(a=ba,"selectionStart"in a&&Wu(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),on&&fn(on,a)||(on=a,a=uu(Iu,"onSelect"),0>=s,n-=s,ke=1<<32-Se(e)+n|l<tt?(ut=K,K=null):ut=K.sibling;var mt=O(j,K,T[tt],R);if(mt===null){K===null&&(K=ut);break}t&&K&&mt.alternate===null&&e(j,K),b=u(mt,b,tt),ht===null?Z=mt:ht.sibling=mt,ht=mt,K=ut}if(tt===T.length)return l(j,K),ct&&tl(j,tt),Z;if(K===null){for(;tttt?(ut=K,K=null):ut=K.sibling;var Ll=O(j,K,mt.value,R);if(Ll===null){K===null&&(K=ut);break}t&&K&&Ll.alternate===null&&e(j,K),b=u(Ll,b,tt),ht===null?Z=Ll:ht.sibling=Ll,ht=Ll,K=ut}if(mt.done)return l(j,K),ct&&tl(j,tt),Z;if(K===null){for(;!mt.done;tt++,mt=T.next())mt=U(j,mt.value,R),mt!==null&&(b=u(mt,b,tt),ht===null?Z=mt:ht.sibling=mt,ht=mt);return ct&&tl(j,tt),Z}for(K=a(K);!mt.done;tt++,mt=T.next())mt=C(K,j,tt,mt.value,R),mt!==null&&(t&&mt.alternate!==null&&K.delete(mt.key===null?tt:mt.key),b=u(mt,b,tt),ht===null?Z=mt:ht.sibling=mt,ht=mt);return t&&K.forEach(function(Bv){return e(j,Bv)}),ct&&tl(j,tt),Z}function Tt(j,b,T,R){if(typeof T=="object"&&T!==null&&T.type===w&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case q:t:{for(var Z=T.key;b!==null;){if(b.key===Z){if(Z=T.type,Z===w){if(b.tag===7){l(j,b.sibling),R=n(b,T.props.children),R.return=j,j=R;break t}}else if(b.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===gt&&ea(Z)===b.type){l(j,b.sibling),R=n(b,T.props),pn(R,T),R.return=j,j=R;break t}l(j,b);break}else e(j,b);b=b.sibling}T.type===w?(R=$l(T.props.children,j.mode,R,T.key),R.return=j,j=R):(R=Ei(T.type,T.key,T.props,null,j.mode,R),pn(R,T),R.return=j,j=R)}return s(j);case z:t:{for(Z=T.key;b!==null;){if(b.key===Z)if(b.tag===4&&b.stateNode.containerInfo===T.containerInfo&&b.stateNode.implementation===T.implementation){l(j,b.sibling),R=n(b,T.children||[]),R.return=j,j=R;break t}else{l(j,b);break}else e(j,b);b=b.sibling}R=uc(T,j.mode,R),R.return=j,j=R}return s(j);case gt:return T=ea(T),Tt(j,b,T,R)}if(kt(T))return X(j,b,T,R);if(_t(T)){if(Z=_t(T),typeof Z!="function")throw Error(f(150));return T=Z.call(T),F(j,b,T,R)}if(typeof T.then=="function")return Tt(j,b,zi(T),R);if(T.$$typeof===ot)return Tt(j,b,Oi(j,T),R);_i(j,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,b!==null&&b.tag===6?(l(j,b.sibling),R=n(b,T),R.return=j,j=R):(l(j,b),R=ic(T,j.mode,R),R.return=j,j=R),s(j)):l(j,b)}return function(j,b,T,R){try{vn=0;var Z=Tt(j,b,T,R);return za=null,Z}catch(K){if(K===Ca||K===Ai)throw K;var ht=je(29,K,null,j.mode);return ht.lanes=R,ht.return=j,ht}}}var aa=Cf(!0),zf=Cf(!1),El=!1;function gc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bc(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Tl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Nl(t,e,l){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(pt&2)!==0){var n=a.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),a.pending=e,e=ji(t),hf(t,null,l),e}return xi(t,a,e,l),ji(t)}function gn(t,e,l){if(e=e.updateQueue,e!==null&&(e=e.shared,(l&4194048)!==0)){var a=e.lanes;a&=t.pendingLanes,l|=a,e.lanes=l,Sr(t,l)}}function Sc(t,e){var l=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var s={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=s:u=u.next=s,l=l.next}while(l!==null);u===null?n=u=e:u=u.next=e}else n=u=e;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=e:t.next=e,l.lastBaseUpdate=e}var xc=!1;function bn(){if(xc){var t=Aa;if(t!==null)throw t}}function Sn(t,e,l,a){xc=!1;var n=t.updateQueue;El=!1;var u=n.firstBaseUpdate,s=n.lastBaseUpdate,h=n.shared.pending;if(h!==null){n.shared.pending=null;var v=h,N=v.next;v.next=null,s===null?u=N:s.next=N,s=v;var _=t.alternate;_!==null&&(_=_.updateQueue,h=_.lastBaseUpdate,h!==s&&(h===null?_.firstBaseUpdate=N:h.next=N,_.lastBaseUpdate=v))}if(u!==null){var U=n.baseState;s=0,_=N=v=null,h=u;do{var O=h.lane&-536870913,C=O!==h.lane;if(C?(it&O)===O:(a&O)===O){O!==0&&O===Ma&&(xc=!0),_!==null&&(_=_.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});t:{var X=t,F=h;O=e;var Tt=l;switch(F.tag){case 1:if(X=F.payload,typeof X=="function"){U=X.call(Tt,U,O);break t}U=X;break t;case 3:X.flags=X.flags&-65537|128;case 0:if(X=F.payload,O=typeof X=="function"?X.call(Tt,U,O):X,O==null)break t;U=E({},U,O);break t;case 2:El=!0}}O=h.callback,O!==null&&(t.flags|=64,C&&(t.flags|=8192),C=n.callbacks,C===null?n.callbacks=[O]:C.push(O))}else C={lane:O,tag:h.tag,payload:h.payload,callback:h.callback,next:null},_===null?(N=_=C,v=U):_=_.next=C,s|=O;if(h=h.next,h===null){if(h=n.shared.pending,h===null)break;C=h,h=C.next,C.next=null,n.lastBaseUpdate=C,n.shared.pending=null}}while(!0);_===null&&(v=U),n.baseState=v,n.firstBaseUpdate=N,n.lastBaseUpdate=_,u===null&&(n.shared.lanes=0),zl|=s,t.lanes=s,t.memoizedState=U}}function _f(t,e){if(typeof t!="function")throw Error(f(191,t));t.call(e)}function Df(t,e){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;tu?u:8;var s=D.T,h={};D.T=h,Lc(t,!1,e,l);try{var v=n(),N=D.S;if(N!==null&&N(h,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var _=Ay(v,a);En(t,e,_,Me(t))}else En(t,e,a,Me(t))}catch(U){En(t,e,{then:function(){},status:"rejected",reason:U},Me())}finally{B.p=u,s!==null&&h.types!==null&&(s.types=h.types),D.T=s}}function Uy(){}function Qc(t,e,l,a){if(t.tag!==5)throw Error(f(476));var n=fo(t).queue;ro(t,n,e,V,l===null?Uy:function(){return oo(t),l(a)})}function fo(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nl,lastRenderedState:V},next:null};var l={};return e.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nl,lastRenderedState:l},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function oo(t){var e=fo(t);e.next===null&&(e=t.alternate.memoizedState),En(t,e.next.queue,{},Me())}function Bc(){return It(Ln)}function ho(){return Bt().memoizedState}function mo(){return Bt().memoizedState}function Hy(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var l=Me();t=Tl(l);var a=Nl(e,t,l);a!==null&&(ye(a,e,l),gn(a,e,l)),e={cache:mc()},t.payload=e;return}e=e.return}}function qy(t,e,l){var a=Me();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Yi(t)?vo(e,l):(l=ac(t,e,l,a),l!==null&&(ye(l,t,a),po(l,e,a)))}function yo(t,e,l){var a=Me();En(t,e,l,a)}function En(t,e,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Yi(t))vo(e,n);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=e.lastRenderedReducer,u!==null))try{var s=e.lastRenderedState,h=u(s,l);if(n.hasEagerState=!0,n.eagerState=h,xe(h,s))return xi(t,e,n,0),Nt===null&&Si(),!1}catch{}if(l=ac(t,e,n,a),l!==null)return ye(l,t,a),po(l,e,a),!0}return!1}function Lc(t,e,l,a){if(a={lane:2,revertLane:gs(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Yi(t)){if(e)throw Error(f(479))}else e=ac(t,l,a,2),e!==null&&ye(e,t,2)}function Yi(t){var e=t.alternate;return t===I||e!==null&&e===I}function vo(t,e){Da=Ui=!0;var l=t.pending;l===null?e.next=e:(e.next=l.next,l.next=e),t.pending=e}function po(t,e,l){if((l&4194048)!==0){var a=e.lanes;a&=t.pendingLanes,l|=a,e.lanes=l,Sr(t,l)}}var Tn={readContext:It,use:wi,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};Tn.useEffectEvent=Ht;var go={readContext:It,use:wi,useCallback:function(t,e){return ie().memoizedState=[t,e===void 0?null:e],t},useContext:It,useEffect:to,useImperativeHandle:function(t,e,l){l=l!=null?l.concat([t]):null,Bi(4194308,4,no.bind(null,e,t),l)},useLayoutEffect:function(t,e){return Bi(4194308,4,t,e)},useInsertionEffect:function(t,e){Bi(4,2,t,e)},useMemo:function(t,e){var l=ie();e=e===void 0?null:e;var a=t();if(na){vl(!0);try{t()}finally{vl(!1)}}return l.memoizedState=[a,e],a},useReducer:function(t,e,l){var a=ie();if(l!==void 0){var n=l(e);if(na){vl(!0);try{l(e)}finally{vl(!1)}}}else n=e;return a.memoizedState=a.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},a.queue=t,t=t.dispatch=qy.bind(null,I,t),[a.memoizedState,t]},useRef:function(t){var e=ie();return t={current:t},e.memoizedState=t},useState:function(t){t=Rc(t);var e=t.queue,l=yo.bind(null,I,e);return e.dispatch=l,[t.memoizedState,l]},useDebugValue:qc,useDeferredValue:function(t,e){var l=ie();return wc(l,t,e)},useTransition:function(){var t=Rc(!1);return t=ro.bind(null,I,t.queue,!0,!1),ie().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,l){var a=I,n=ie();if(ct){if(l===void 0)throw Error(f(407));l=l()}else{if(l=e(),Nt===null)throw Error(f(349));(it&127)!==0||Qf(a,e,l)}n.memoizedState=l;var u={value:l,getSnapshot:e};return n.queue=u,to(Lf.bind(null,a,u,t),[t]),a.flags|=2048,Ua(9,{destroy:void 0},Bf.bind(null,a,u,l,e),null),l},useId:function(){var t=ie(),e=Nt.identifierPrefix;if(ct){var l=Ve,a=ke;l=(a&~(1<<32-Se(a)-1)).toString(32)+l,e="_"+e+"R_"+l,l=Hi++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?s.createElement("select",{is:a.is}):s.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?s.createElement(n,{is:a.is}):s.createElement(n)}}u[$t]=e,u[re]=a;t:for(s=e.child;s!==null;){if(s.tag===5||s.tag===6)u.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break t;for(;s.sibling===null;){if(s.return===null||s.return===e)break t;s=s.return}s.sibling.return=s.return,s=s.sibling}e.stateNode=u;t:switch(te(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&ul(e)}}return At(e),ts(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,l),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==a&&ul(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(f(166));if(t=lt.current,Na(e)){if(t=e.stateNode,l=e.memoizedProps,a=null,n=Wt,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}t[$t]=e,t=!!(t.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||wd(t.nodeValue,l)),t||xl(e,!0)}else t=cu(t).createTextNode(a),t[$t]=e,e.stateNode=t}return At(e),null;case 31:if(l=e.memoizedState,t===null||t.memoizedState!==null){if(a=Na(e),l!==null){if(t===null){if(!a)throw Error(f(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(f(557));t[$t]=e}else Wl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;At(e),t=!1}else l=fc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return e.flags&256?(Te(e),e):(Te(e),null);if((e.flags&128)!==0)throw Error(f(558))}return At(e),null;case 13:if(a=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=Na(e),a!==null&&a.dehydrated!==null){if(t===null){if(!n)throw Error(f(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(f(317));n[$t]=e}else Wl(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;At(e),n=!1}else n=fc(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),n=!0;if(!n)return e.flags&256?(Te(e),e):(Te(e),null)}return Te(e),(e.flags&128)!==0?(e.lanes=l,e):(l=a!==null,t=t!==null&&t.memoizedState!==null,l&&(a=e.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==t&&l&&(e.child.flags|=8192),ki(e,e.updateQueue),At(e),null);case 4:return Dt(),t===null&&js(e.stateNode.containerInfo),At(e),null;case 10:return ll(e.type),At(e),null;case 19:if(H(Qt),a=e.memoizedState,a===null)return At(e),null;if(n=(e.flags&128)!==0,u=a.rendering,u===null)if(n)On(a,!1);else{if(qt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(u=Ri(t),u!==null){for(e.flags|=128,On(a,!1),t=u.updateQueue,e.updateQueue=t,ki(e,t),e.subtreeFlags=0,t=l,l=e.child;l!==null;)mf(l,t),l=l.sibling;return L(Qt,Qt.current&1|2),ct&&tl(e,a.treeForkCount),e.child}t=t.sibling}a.tail!==null&&ne()>Wi&&(e.flags|=128,n=!0,On(a,!1),e.lanes=4194304)}else{if(!n)if(t=Ri(u),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,ki(e,t),On(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!ct)return At(e),null}else 2*ne()-a.renderingStartTime>Wi&&l!==536870912&&(e.flags|=128,n=!0,On(a,!1),e.lanes=4194304);a.isBackwards?(u.sibling=e.child,e.child=u):(t=a.last,t!==null?t.sibling=u:e.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=ne(),t.sibling=null,l=Qt.current,L(Qt,n?l&1|2:l&1),ct&&tl(e,a.treeForkCount),t):(At(e),null);case 22:case 23:return Te(e),Ec(),a=e.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?(l&536870912)!==0&&(e.flags&128)===0&&(At(e),e.subtreeFlags&6&&(e.flags|=8192)):At(e),l=e.updateQueue,l!==null&&ki(e,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==l&&(e.flags|=2048),t!==null&&H(ta),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),e.memoizedState.cache!==l&&(e.flags|=2048),ll(Lt),At(e),null;case 25:return null;case 30:return null}throw Error(f(156,e.tag))}function Yy(t,e){switch(sc(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ll(Lt),Dt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ml(e),null;case 31:if(e.memoizedState!==null){if(Te(e),e.alternate===null)throw Error(f(340));Wl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Te(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(f(340));Wl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return H(Qt),null;case 4:return Dt(),null;case 10:return ll(e.type),null;case 22:case 23:return Te(e),Ec(),t!==null&&H(ta),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return ll(Lt),null;case 25:return null;default:return null}}function Go(t,e){switch(sc(e),e.tag){case 3:ll(Lt),Dt();break;case 26:case 27:case 5:ml(e);break;case 4:Dt();break;case 31:e.memoizedState!==null&&Te(e);break;case 13:Te(e);break;case 19:H(Qt);break;case 10:ll(e.type);break;case 22:case 23:Te(e),Ec(),t!==null&&H(ta);break;case 24:ll(Lt)}}function Mn(t,e){try{var l=e.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&t)===t){a=void 0;var u=l.create,s=l.inst;a=u(),s.destroy=a}l=l.next}while(l!==n)}}catch(h){St(e,e.return,h)}}function Al(t,e,l){try{var a=e.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&t)===t){var s=a.inst,h=s.destroy;if(h!==void 0){s.destroy=void 0,n=e;var v=l,N=h;try{N()}catch(_){St(n,v,_)}}}a=a.next}while(a!==u)}}catch(_){St(e,e.return,_)}}function Xo(t){var e=t.updateQueue;if(e!==null){var l=t.stateNode;try{Df(e,l)}catch(a){St(t,t.return,a)}}}function Ko(t,e,l){l.props=ia(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(a){St(t,e,a)}}function An(t,e){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof l=="function"?t.refCleanup=l(a):l.current=a}}catch(n){St(t,e,n)}}function Je(t,e){var l=t.ref,a=t.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){St(t,e,n)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){St(t,e,n)}else l.current=null}function Zo(t){var e=t.type,l=t.memoizedProps,a=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break t;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){St(t,t.return,n)}}function es(t,e,l){try{var a=t.stateNode;rv(a,t.type,l,e),a[re]=e}catch(n){St(t,t.return,n)}}function ko(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Hl(t.type)||t.tag===4}function ls(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||ko(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Hl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function as(t,e,l){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,e):(e=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,e.appendChild(t),l=l._reactRootContainer,l!=null||e.onclick!==null||(e.onclick=We));else if(a!==4&&(a===27&&Hl(t.type)&&(l=t.stateNode,e=null),t=t.child,t!==null))for(as(t,e,l),t=t.sibling;t!==null;)as(t,e,l),t=t.sibling}function Vi(t,e,l){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?l.insertBefore(t,e):l.appendChild(t);else if(a!==4&&(a===27&&Hl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Vi(t,e,l),t=t.sibling;t!==null;)Vi(t,e,l),t=t.sibling}function Vo(t){var e=t.stateNode,l=t.memoizedProps;try{for(var a=t.type,n=e.attributes;n.length;)e.removeAttributeNode(n[0]);te(e,a,l),e[$t]=t,e[re]=l}catch(u){St(t,t.return,u)}}var cl=!1,Xt=!1,ns=!1,Jo=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function Gy(t,e){if(t=t.containerInfo,Ns=mu,t=nf(t),Wu(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else t:{l=(l=t.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break t}var s=0,h=-1,v=-1,N=0,_=0,U=t,O=null;e:for(;;){for(var C;U!==l||n!==0&&U.nodeType!==3||(h=s+n),U!==u||a!==0&&U.nodeType!==3||(v=s+a),U.nodeType===3&&(s+=U.nodeValue.length),(C=U.firstChild)!==null;)O=U,U=C;for(;;){if(U===t)break e;if(O===l&&++N===n&&(h=s),O===u&&++_===a&&(v=s),(C=U.nextSibling)!==null)break;U=O,O=U.parentNode}U=C}l=h===-1||v===-1?null:{start:h,end:v}}else l=null}l=l||{start:0,end:0}}else l=null;for(Os={focusedElem:t,selectionRange:l},mu=!1,Ft=e;Ft!==null;)if(e=Ft,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ft=t;else for(;Ft!==null;){switch(e=Ft,u=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l title"))),te(u,a,l),u[$t]=t,Jt(u),a=u;break t;case"link":var s=th("link","href",n).get(a+(l.href||""));if(s){for(var h=0;hTt&&(s=Tt,Tt=F,F=s);var j=lf(h,F),b=lf(h,Tt);if(j&&b&&(C.rangeCount!==1||C.anchorNode!==j.node||C.anchorOffset!==j.offset||C.focusNode!==b.node||C.focusOffset!==b.offset)){var T=U.createRange();T.setStart(j.node,j.offset),C.removeAllRanges(),F>Tt?(C.addRange(T),C.extend(b.node,b.offset)):(T.setEnd(b.node,b.offset),C.addRange(T))}}}}for(U=[],C=h;C=C.parentNode;)C.nodeType===1&&U.push({element:C,left:C.scrollLeft,top:C.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;hl?32:l,D.T=null,l=os,os=null;var u=Dl,s=dl;if(Kt=0,Ba=Dl=null,dl=0,(pt&6)!==0)throw Error(f(331));var h=pt;if(pt|=4,id(u.current),ld(u,u.current,s,l),pt=h,Un(0,!1),be&&typeof be.onPostCommitFiberRoot=="function")try{be.onPostCommitFiberRoot(Wa,u)}catch{}return!0}finally{B.p=n,D.T=a,Ed(t,e)}}function Nd(t,e,l){e=Ue(l,e),e=Kc(t.stateNode,e,2),t=Nl(t,e,2),t!==null&&(Pa(t,2),Fe(t))}function St(t,e,l){if(t.tag===3)Nd(t,t,l);else for(;e!==null;){if(e.tag===3){Nd(e,t,l);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(_l===null||!_l.has(a))){t=Ue(l,t),l=Oo(2),a=Nl(e,l,2),a!==null&&(Mo(l,a,e,t),Pa(a,2),Fe(a));break}}e=e.return}}function ys(t,e,l){var a=t.pingCache;if(a===null){a=t.pingCache=new Zy;var n=new Set;a.set(e,n)}else n=a.get(e),n===void 0&&(n=new Set,a.set(e,n));n.has(l)||(cs=!0,n.add(l),t=$y.bind(null,t,e,l),e.then(t,t))}function $y(t,e,l){var a=t.pingCache;a!==null&&a.delete(e),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Nt===t&&(it&l)===l&&(qt===4||qt===3&&(it&62914560)===it&&300>ne()-$i?(pt&2)===0&&La(t,0):ss|=l,Qa===it&&(Qa=0)),Fe(t)}function Od(t,e){e===0&&(e=gr()),t=Fl(t,e),t!==null&&(Pa(t,e),Fe(t))}function Wy(t){var e=t.memoizedState,l=0;e!==null&&(l=e.retryLane),Od(t,l)}function Iy(t,e){var l=0;switch(t.tag){case 31:case 13:var a=t.stateNode,n=t.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(f(314))}a!==null&&a.delete(e),Od(t,l)}function Py(t,e){return ft(t,e)}var au=null,Ga=null,vs=!1,nu=!1,ps=!1,Ul=0;function Fe(t){t!==Ga&&t.next===null&&(Ga===null?au=Ga=t:Ga=Ga.next=t),nu=!0,vs||(vs=!0,ev())}function Un(t,e){if(!ps&&nu){ps=!0;do for(var l=!1,a=au;a!==null;){if(t!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var s=a.suspendedLanes,h=a.pingedLanes;u=(1<<31-Se(42|t)+1)-1,u&=n&~(s&~h),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,zd(a,u))}else u=it,u=si(a,a===Nt?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Ia(a,u)||(l=!0,zd(a,u));a=a.next}while(l);ps=!1}}function tv(){Md()}function Md(){nu=vs=!1;var t=0;Ul!==0&&ov()&&(t=Ul);for(var e=ne(),l=null,a=au;a!==null;){var n=a.next,u=Ad(a,e);u===0?(a.next=null,l===null?au=n:l.next=n,n===null&&(Ga=l)):(l=a,(t!==0||(u&3)!==0)&&(nu=!0)),a=n}Kt!==0&&Kt!==5||Un(t),Ul!==0&&(Ul=0)}function Ad(t,e){for(var l=t.suspendedLanes,a=t.pingedLanes,n=t.expirationTimes,u=t.pendingLanes&-62914561;0h)break;var _=v.transferSize,U=v.initiatorType;_&&Qd(U)&&(v=v.responseEnd,s+=_*(v"u"?null:document;function $d(t,e,l){var a=Xa;if(a&&typeof e=="string"&&e){var n=De(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),Fd.has(n)||(Fd.add(n),t={rel:t,crossOrigin:l,href:e},a.querySelector(n)===null&&(e=a.createElement("link"),te(e,"link",t),Jt(e),a.head.appendChild(e)))}}function Sv(t){hl.D(t),$d("dns-prefetch",t,null)}function xv(t,e){hl.C(t,e),$d("preconnect",t,e)}function jv(t,e,l){hl.L(t,e,l);var a=Xa;if(a&&t&&e){var n='link[rel="preload"][as="'+De(e)+'"]';e==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+De(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+De(l.imageSizes)+'"]')):n+='[href="'+De(t)+'"]';var u=n;switch(e){case"style":u=Ka(t);break;case"script":u=Za(t)}Le.has(u)||(t=E({rel:"preload",href:e==="image"&&l&&l.imageSrcSet?void 0:t,as:e},l),Le.set(u,t),a.querySelector(n)!==null||e==="style"&&a.querySelector(Qn(u))||e==="script"&&a.querySelector(Bn(u))||(e=a.createElement("link"),te(e,"link",t),Jt(e),a.head.appendChild(e)))}}function Ev(t,e){hl.m(t,e);var l=Xa;if(l&&t){var a=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+De(a)+'"][href="'+De(t)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Za(t)}if(!Le.has(u)&&(t=E({rel:"modulepreload",href:t},e),Le.set(u,t),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Bn(u)))return}a=l.createElement("link"),te(a,"link",t),Jt(a),l.head.appendChild(a)}}}function Tv(t,e,l){hl.S(t,e,l);var a=Xa;if(a&&t){var n=da(a).hoistableStyles,u=Ka(t);e=e||"default";var s=n.get(u);if(!s){var h={loading:0,preload:null};if(s=a.querySelector(Qn(u)))h.loading=5;else{t=E({rel:"stylesheet",href:t,"data-precedence":e},l),(l=Le.get(u))&&Rs(t,l);var v=s=a.createElement("link");Jt(v),te(v,"link",t),v._p=new Promise(function(N,_){v.onload=N,v.onerror=_}),v.addEventListener("load",function(){h.loading|=1}),v.addEventListener("error",function(){h.loading|=2}),h.loading|=4,ru(s,e,a)}s={type:"stylesheet",instance:s,count:1,state:h},n.set(u,s)}}}function Nv(t,e){hl.X(t,e);var l=Xa;if(l&&t){var a=da(l).hoistableScripts,n=Za(t),u=a.get(n);u||(u=l.querySelector(Bn(n)),u||(t=E({src:t,async:!0},e),(e=Le.get(n))&&Us(t,e),u=l.createElement("script"),Jt(u),te(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function Ov(t,e){hl.M(t,e);var l=Xa;if(l&&t){var a=da(l).hoistableScripts,n=Za(t),u=a.get(n);u||(u=l.querySelector(Bn(n)),u||(t=E({src:t,async:!0,type:"module"},e),(e=Le.get(n))&&Us(t,e),u=l.createElement("script"),Jt(u),te(u,"link",t),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function Wd(t,e,l,a){var n=(n=lt.current)?su(n):null;if(!n)throw Error(f(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(e=Ka(l.href),l=da(n).hoistableStyles,a=l.get(e),a||(a={type:"style",instance:null,count:0,state:null},l.set(e,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Ka(l.href);var u=da(n).hoistableStyles,s=u.get(t);if(s||(n=n.ownerDocument||n,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,s),(u=n.querySelector(Qn(t)))&&!u._p&&(s.instance=u,s.state.loading=5),Le.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Le.set(t,l),u||Mv(n,t,l,s.state))),e&&a===null)throw Error(f(528,""));return s}if(e&&a!==null)throw Error(f(529,""));return null;case"script":return e=l.async,l=l.src,typeof l=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Za(l),l=da(n).hoistableScripts,a=l.get(e),a||(a={type:"script",instance:null,count:0,state:null},l.set(e,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,t))}}function Ka(t){return'href="'+De(t)+'"'}function Qn(t){return'link[rel="stylesheet"]['+t+"]"}function Id(t){return E({},t,{"data-precedence":t.precedence,precedence:null})}function Mv(t,e,l,a){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=t.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),te(e,"link",l),Jt(e),t.head.appendChild(e))}function Za(t){return'[src="'+De(t)+'"]'}function Bn(t){return"script[async]"+t}function Pd(t,e,l){if(e.count++,e.instance===null)switch(e.type){case"style":var a=t.querySelector('style[data-href~="'+De(l.href)+'"]');if(a)return e.instance=a,Jt(a),a;var n=E({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),Jt(a),te(a,"style",n),ru(a,l.precedence,t),e.instance=a;case"stylesheet":n=Ka(l.href);var u=t.querySelector(Qn(n));if(u)return e.state.loading|=4,e.instance=u,Jt(u),u;a=Id(l),(n=Le.get(n))&&Rs(a,n),u=(t.ownerDocument||t).createElement("link"),Jt(u);var s=u;return s._p=new Promise(function(h,v){s.onload=h,s.onerror=v}),te(u,"link",a),e.state.loading|=4,ru(u,l.precedence,t),e.instance=u;case"script":return u=Za(l.src),(n=t.querySelector(Bn(u)))?(e.instance=n,Jt(n),n):(a=l,(n=Le.get(u))&&(a=E({},l),Us(a,n)),t=t.ownerDocument||t,n=t.createElement("script"),Jt(n),te(n,"link",a),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(f(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(a=e.instance,e.state.loading|=4,ru(a,l.precedence,t));return e.instance}function ru(t,e,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,s=0;s title"):null)}function Av(t,e,l){if(l===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function lh(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Cv(t,e,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Ka(a.href),u=e.querySelector(Qn(n));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=ou.bind(t),e.then(t,t)),l.state.loading|=4,l.instance=u,Jt(u);return}u=e.ownerDocument||e,a=Id(a),(n=Le.get(n))&&Rs(a,n),u=u.createElement("link"),Jt(u);var s=u;s._p=new Promise(function(h,v){s.onload=h,s.onerror=v}),te(u,"link",a),l.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,e),(e=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=ou.bind(t),e.addEventListener("load",l),e.addEventListener("error",l))}}var Hs=0;function zv(t,e){return t.stylesheets&&t.count===0&&hu(t,t.stylesheets),0Hs?50:800)+e);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var du=null;function hu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,du=new Map,e.forEach(_v,t),du=null,ou.call(t))}function _v(t,e){if(!(e.state.loading&4)){var l=du.get(t);if(l)var a=l.get(null);else{l=new Map,du.set(t,l);for(var n=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Ks.exports=Vv(),Ks.exports}var Fv=Jv(),ti=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(i){return this.listeners.add(i),this.onSubscribe(),()=>{this.listeners.delete(i),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$v=class extends ti{#t;#e;#l;constructor(){super(),this.#l=i=>{if(typeof window<"u"&&window.addEventListener){const c=()=>i();return window.addEventListener("visibilitychange",c,!1),()=>{window.removeEventListener("visibilitychange",c)}}}}onSubscribe(){this.#e||this.setEventListener(this.#l)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(i){this.#l=i,this.#e?.(),this.#e=i(c=>{typeof c=="boolean"?this.setFocused(c):this.onFocus()})}setFocused(i){this.#t!==i&&(this.#t=i,this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(c=>{c(i)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},cr=new $v,Wv={setTimeout:(i,c)=>setTimeout(i,c),clearTimeout:i=>clearTimeout(i),setInterval:(i,c)=>setInterval(i,c),clearInterval:i=>clearInterval(i)},Iv=class{#t=Wv;#e=!1;setTimeoutProvider(i){this.#t=i}setTimeout(i,c){return this.#t.setTimeout(i,c)}clearTimeout(i){this.#t.clearTimeout(i)}setInterval(i,c){return this.#t.setInterval(i,c)}clearInterval(i){this.#t.clearInterval(i)}},sa=new Iv;function Pv(i){setTimeout(i,0)}var t0=typeof window>"u"||"Deno"in globalThis;function ve(){}function e0(i,c){return typeof i=="function"?i(c):i}function Ws(i){return typeof i=="number"&&i>=0&&i!==1/0}function Vh(i,c){return Math.max(i+(c||0)-Date.now(),0)}function Gl(i,c){return typeof i=="function"?i(c):i}function Ae(i,c){return typeof i=="function"?i(c):i}function Oh(i,c){const{type:r="all",exact:f,fetchStatus:d,predicate:m,queryKey:g,stale:A}=i;if(g){if(f){if(c.queryHash!==sr(g,c.options))return!1}else if(!Jn(c.queryKey,g))return!1}if(r!=="all"){const p=c.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof A=="boolean"&&c.isStale()!==A||d&&d!==c.state.fetchStatus||m&&!m(c))}function Mh(i,c){const{exact:r,status:f,predicate:d,mutationKey:m}=i;if(m){if(!c.options.mutationKey)return!1;if(r){if(Vn(c.options.mutationKey)!==Vn(m))return!1}else if(!Jn(c.options.mutationKey,m))return!1}return!(f&&c.state.status!==f||d&&!d(c))}function sr(i,c){return(c?.queryKeyHashFn||Vn)(i)}function Vn(i){return JSON.stringify(i,(c,r)=>Ps(r)?Object.keys(r).sort().reduce((f,d)=>(f[d]=r[d],f),{}):r)}function Jn(i,c){return i===c?!0:typeof i!=typeof c?!1:i&&c&&typeof i=="object"&&typeof c=="object"?Object.keys(c).every(r=>Jn(i[r],c[r])):!1}var l0=Object.prototype.hasOwnProperty;function Jh(i,c,r=0){if(i===c)return i;if(r>500)return c;const f=Ah(i)&&Ah(c);if(!f&&!(Ps(i)&&Ps(c)))return c;const m=(f?i:Object.keys(i)).length,g=f?c:Object.keys(c),A=g.length,p=f?new Array(A):{};let y=0;for(let M=0;M{sa.setTimeout(c,i)})}function tr(i,c,r){return typeof r.structuralSharing=="function"?r.structuralSharing(i,c):r.structuralSharing!==!1?Jh(i,c):c}function n0(i,c,r=0){const f=[...i,c];return r&&f.length>r?f.slice(1):f}function i0(i,c,r=0){const f=[c,...i];return r&&f.length>r?f.slice(0,-1):f}var rr=Symbol();function Fh(i,c){return!i.queryFn&&c?.initialPromise?()=>c.initialPromise:!i.queryFn||i.queryFn===rr?()=>Promise.reject(new Error(`Missing queryFn: '${i.queryHash}'`)):i.queryFn}function $h(i,c){return typeof i=="function"?i(...c):!!i}function u0(i,c,r){let f=!1,d;return Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(d??=c(),f||(f=!0,d.aborted?r():d.addEventListener("abort",r,{once:!0})),d)}),i}var Fn=(()=>{let i=()=>t0;return{isServer(){return i()},setIsServer(c){i=c}}})();function er(){let i,c;const r=new Promise((d,m)=>{i=d,c=m});r.status="pending",r.catch(()=>{});function f(d){Object.assign(r,d),delete r.resolve,delete r.reject}return r.resolve=d=>{f({status:"fulfilled",value:d}),i(d)},r.reject=d=>{f({status:"rejected",reason:d}),c(d)},r}var c0=Pv;function s0(){let i=[],c=0,r=A=>{A()},f=A=>{A()},d=c0;const m=A=>{c?i.push(A):d(()=>{r(A)})},g=()=>{const A=i;i=[],A.length&&d(()=>{f(()=>{A.forEach(p=>{r(p)})})})};return{batch:A=>{let p;c++;try{p=A()}finally{c--,c||g()}return p},batchCalls:A=>(...p)=>{m(()=>{A(...p)})},schedule:m,setNotifyFunction:A=>{r=A},setBatchNotifyFunction:A=>{f=A},setScheduler:A=>{d=A}}}var ee=s0(),r0=class extends ti{#t=!0;#e;#l;constructor(){super(),this.#l=i=>{if(typeof window<"u"&&window.addEventListener){const c=()=>i(!0),r=()=>i(!1);return window.addEventListener("online",c,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#l)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(i){this.#l=i,this.#e?.(),this.#e=i(this.setOnline.bind(this))}setOnline(i){this.#t!==i&&(this.#t=i,this.listeners.forEach(r=>{r(i)}))}isOnline(){return this.#t}},Ou=new r0;function f0(i){return Math.min(1e3*2**i,3e4)}function Wh(i){return(i??"online")==="online"?Ou.isOnline():!0}var lr=class extends Error{constructor(i){super("CancelledError"),this.revert=i?.revert,this.silent=i?.silent}};function Ih(i){let c=!1,r=0,f;const d=er(),m=()=>d.status!=="pending",g=w=>{if(!m()){const Y=new lr(w);x(Y),i.onCancel?.(Y)}},A=()=>{c=!0},p=()=>{c=!1},y=()=>cr.isFocused()&&(i.networkMode==="always"||Ou.isOnline())&&i.canRun(),M=()=>Wh(i.networkMode)&&i.canRun(),E=w=>{m()||(f?.(),d.resolve(w))},x=w=>{m()||(f?.(),d.reject(w))},q=()=>new Promise(w=>{f=Y=>{(m()||y())&&w(Y)},i.onPause?.()}).then(()=>{f=void 0,m()||i.onContinue?.()}),z=()=>{if(m())return;let w;const Y=r===0?i.initialPromise:void 0;try{w=Y??i.fn()}catch($){w=Promise.reject($)}Promise.resolve(w).then(E).catch($=>{if(m())return;const yt=i.retry??(Fn.isServer()?0:3),ot=i.retryDelay??f0,Ct=typeof ot=="function"?ot(r,$):ot,Rt=yt===!0||typeof yt=="number"&&ry()?void 0:q()).then(()=>{c?x($):z()})})};return{promise:d,status:()=>d.status,cancel:g,continue:()=>(f?.(),d),cancelRetry:A,continueRetry:p,canStart:M,start:()=>(M()?z():q().then(z),d)}}var Ph=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ws(this.gcTime)&&(this.#t=sa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(i){this.gcTime=Math.max(this.gcTime||0,i??(Fn.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(sa.clearTimeout(this.#t),this.#t=void 0)}};function o0(i){return{onFetch:(c,r)=>{const f=c.options,d=c.fetchOptions?.meta?.fetchMore?.direction,m=c.state.data?.pages||[],g=c.state.data?.pageParams||[];let A={pages:[],pageParams:[]},p=0;const y=async()=>{let M=!1;const E=z=>{u0(z,()=>c.signal,()=>M=!0)},x=Fh(c.options,c.fetchOptions),q=async(z,w,Y)=>{if(M)return Promise.reject(c.signal.reason);if(w==null&&z.pages.length)return Promise.resolve(z);const yt=(()=>{const et={client:c.client,queryKey:c.queryKey,pageParam:w,direction:Y?"backward":"forward",meta:c.options.meta};return E(et),et})(),ot=await x(yt),{maxPages:Ct}=c.options,Rt=Y?i0:n0;return{pages:Rt(z.pages,ot,Ct),pageParams:Rt(z.pageParams,w,Ct)}};if(d&&m.length){const z=d==="backward",w=z?d0:zh,Y={pages:m,pageParams:g},$=w(f,Y);A=await q(Y,$,z)}else{const z=i??m.length;do{const w=p===0?g[0]??f.initialPageParam:zh(f,A);if(p>0&&w==null)break;A=await q(A,w),p++}while(pc.options.persister?.(y,{client:c.client,queryKey:c.queryKey,meta:c.options.meta,signal:c.signal},r):c.fetchFn=y}}}function zh(i,{pages:c,pageParams:r}){const f=c.length-1;return c.length>0?i.getNextPageParam(c[f],c,r[f],r):void 0}function d0(i,{pages:c,pageParams:r}){return c.length>0?i.getPreviousPageParam?.(c[0],c,r[0],r):void 0}var h0=class extends Ph{#t;#e;#l;#a;#i;#n;#c;#u;constructor(i){super(),this.#u=!1,this.#c=i.defaultOptions,this.setOptions(i.options),this.observers=[],this.#i=i.client,this.#a=this.#i.getQueryCache(),this.queryKey=i.queryKey,this.queryHash=i.queryHash,this.#e=Dh(this.options),this.state=i.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#n?.promise}setOptions(i){if(this.options={...this.#c,...i},i?._type&&(this.#t=i._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const c=Dh(this.options);c.data!==void 0&&(this.setState(_h(c.data,c.dataUpdatedAt)),this.#e=c)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(i,c){const r=tr(this.state.data,i,this.options);return this.#s({data:r,type:"success",dataUpdatedAt:c?.updatedAt,manual:c?.manual}),r}setState(i){this.#s({type:"setState",state:i})}cancel(i){const c=this.#n?.promise;return this.#n?.cancel(i),c?c.then(ve).catch(ve):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(i=>Ae(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>Gl(i.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(i=>i.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(i=0){return this.state.data===void 0?!0:i==="static"?!1:this.state.isInvalidated?!0:!Vh(this.state.dataUpdatedAt,i)}onFocus(){this.observers.find(c=>c.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(c=>c.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){this.observers.includes(i)&&(this.observers=this.observers.filter(c=>c!==i),this.observers.length||(this.#n&&(this.#u||this.#f()?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}#f(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(i,c){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&c?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(i&&this.setOptions(i),!this.options.queryFn){const p=this.observers.find(y=>y.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,f=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(this.#u=!0,r.signal)})},d=()=>{const p=Fh(this.options,c),M=(()=>{const E={client:this.#i,queryKey:this.queryKey,meta:this.meta};return f(E),E})();return this.#u=!1,this.options.persister?this.options.persister(p,M,this):p(M)},g=(()=>{const p={fetchOptions:c,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:d};return f(p),p})();(this.#t==="infinite"?o0(this.options.pages):this.options.behavior)?.onFetch(g,this),this.#l=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==g.fetchOptions?.meta)&&this.#s({type:"fetch",meta:g.fetchOptions?.meta}),this.#n=Ih({initialPromise:c?.initialPromise,fn:g.fetchFn,onCancel:p=>{p instanceof lr&&p.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(p,y)=>{this.#s({type:"failed",failureCount:p,error:y})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:g.options.retry,retryDelay:g.options.retryDelay,networkMode:g.options.networkMode,canRun:()=>!0});try{const p=await this.#n.start();if(p===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(p),this.#a.config.onSuccess?.(p,this),this.#a.config.onSettled?.(p,this.state.error,this),p}catch(p){if(p instanceof lr){if(p.silent)return this.#n.promise;if(p.revert){if(this.state.data===void 0)throw p;return this.state.data}}throw this.#s({type:"error",error:p}),this.#a.config.onError?.(p,this),this.#a.config.onSettled?.(this.state.data,p,this),p}finally{this.scheduleGc()}}#s(i){const c=r=>{switch(i.type){case"failed":return{...r,fetchFailureCount:i.failureCount,fetchFailureReason:i.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...tm(r.data,this.options),fetchMeta:i.meta??null};case"success":const f={...r,..._h(i.data,i.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=i.manual?f:void 0,f;case"error":const d=i.error;return{...r,error:d,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...i.state}}};this.state=c(this.state),ee.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:i})})}};function tm(i,c){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wh(c.networkMode)?"fetching":"paused",...i===void 0&&{error:null,status:"pending"}}}function _h(i,c){return{data:i,dataUpdatedAt:c??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Dh(i){const c=typeof i.initialData=="function"?i.initialData():i.initialData,r=c!==void 0,f=r?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0;return{data:c,dataUpdateCount:0,dataUpdatedAt:r?f??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var m0=class extends ti{constructor(i,c){super(),this.options=c,this.#t=i,this.#u=null,this.#c=er(),this.bindMethods(),this.setOptions(c)}#t;#e=void 0;#l=void 0;#a=void 0;#i;#n;#c;#u;#f;#s;#m;#o;#d;#r;#y=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Rh(this.#e,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ar(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ar(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#e.removeObserver(this)}setOptions(i){const c=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ae(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),c._defaulted&&!Is(this.options,c)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const f=this.hasListeners();f&&Uh(this.#e,r,this.options,c)&&this.#h(),this.updateResult(),f&&(this.#e!==r||Ae(this.options.enabled,this.#e)!==Ae(c.enabled,this.#e)||Gl(this.options.staleTime,this.#e)!==Gl(c.staleTime,this.#e))&&this.#v();const d=this.#p();f&&(this.#e!==r||Ae(this.options.enabled,this.#e)!==Ae(c.enabled,this.#e)||d!==this.#r)&&this.#g(d)}getOptimisticResult(i){const c=this.#t.getQueryCache().build(this.#t,i),r=this.createResult(c,i);return v0(this,r)&&(this.#a=r,this.#n=this.options,this.#i=this.#e.state),r}getCurrentResult(){return this.#a}trackResult(i,c){return new Proxy(i,{get:(r,f)=>(this.trackProp(f),c?.(f),f==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#c.status==="pending"&&this.#c.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,f))})}trackProp(i){this.#y.add(i)}getCurrentQuery(){return this.#e}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const c=this.#t.defaultQueryOptions(i),r=this.#t.getQueryCache().build(this.#t,c);return r.fetch().then(()=>this.createResult(r,c))}fetch(i){return this.#h({...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#h(i){this.#j();let c=this.#e.fetch(this.options,i);return i?.throwOnError||(c=c.catch(ve)),c}#v(){this.#S();const i=Gl(this.options.staleTime,this.#e);if(Fn.isServer()||this.#a.isStale||!Ws(i))return;const r=Vh(this.#a.dataUpdatedAt,i)+1;this.#o=sa.setTimeout(()=>{this.#a.isStale||this.updateResult()},r)}#p(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#g(i){this.#x(),this.#r=i,!(Fn.isServer()||Ae(this.options.enabled,this.#e)===!1||!Ws(this.#r)||this.#r===0)&&(this.#d=sa.setInterval(()=>{(this.options.refetchIntervalInBackground||cr.isFocused())&&this.#h()},this.#r))}#b(){this.#v(),this.#g(this.#p())}#S(){this.#o!==void 0&&(sa.clearTimeout(this.#o),this.#o=void 0)}#x(){this.#d!==void 0&&(sa.clearInterval(this.#d),this.#d=void 0)}createResult(i,c){const r=this.#e,f=this.options,d=this.#a,m=this.#i,g=this.#n,p=i!==r?i.state:this.#l,{state:y}=i;let M={...y},E=!1,x;if(c._optimisticResults){const gt=this.hasListeners(),wt=!gt&&Rh(i,c),ue=gt&&Uh(i,r,c,f);(wt||ue)&&(M={...M,...tm(y.data,i.options)}),c._optimisticResults==="isRestoring"&&(M.fetchStatus="idle")}let{error:q,errorUpdatedAt:z,status:w}=M;x=M.data;let Y=!1;if(c.placeholderData!==void 0&&x===void 0&&w==="pending"){let gt;d?.isPlaceholderData&&c.placeholderData===g?.placeholderData?(gt=d.data,Y=!0):gt=typeof c.placeholderData=="function"?c.placeholderData(this.#m?.state.data,this.#m):c.placeholderData,gt!==void 0&&(w="success",x=tr(d?.data,gt,c),E=!0)}if(c.select&&x!==void 0&&!Y)if(d&&x===m?.data&&c.select===this.#f)x=this.#s;else try{this.#f=c.select,x=c.select(x),x=tr(d?.data,x,c),this.#s=x,this.#u=null}catch(gt){this.#u=gt}this.#u&&(q=this.#u,x=this.#s,z=Date.now(),w="error");const $=M.fetchStatus==="fetching",yt=w==="pending",ot=w==="error",Ct=yt&&$,Rt=x!==void 0,k={status:w,fetchStatus:M.fetchStatus,isPending:yt,isSuccess:w==="success",isError:ot,isInitialLoading:Ct,isLoading:Ct,data:x,dataUpdatedAt:M.dataUpdatedAt,error:q,errorUpdatedAt:z,failureCount:M.fetchFailureCount,failureReason:M.fetchFailureReason,errorUpdateCount:M.errorUpdateCount,isFetched:i.isFetched(),isFetchedAfterMount:M.dataUpdateCount>p.dataUpdateCount||M.errorUpdateCount>p.errorUpdateCount,isFetching:$,isRefetching:$&&!yt,isLoadingError:ot&&!Rt,isPaused:M.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:ot&&Rt,isStale:fr(i,c),refetch:this.refetch,promise:this.#c,isEnabled:Ae(c.enabled,i)!==!1};if(this.options.experimental_prefetchInRender){const gt=k.data!==void 0,wt=k.status==="error"&&!gt,ue=ce=>{wt?ce.reject(k.error):gt&&ce.resolve(k.data)},le=()=>{const ce=this.#c=k.promise=er();ue(ce)},_t=this.#c;switch(_t.status){case"pending":i.queryHash===r.queryHash&&ue(_t);break;case"fulfilled":(wt||k.data!==_t.value)&&le();break;case"rejected":(!wt||k.error!==_t.reason)&&le();break}}return k}updateResult(){const i=this.#a,c=this.createResult(this.#e,this.options);if(this.#i=this.#e.state,this.#n=this.options,this.#i.data!==void 0&&(this.#m=this.#e),Is(c,i))return;this.#a=c;const r=()=>{if(!i)return!0;const{notifyOnChangeProps:f}=this.options,d=typeof f=="function"?f():f;if(d==="all"||!d&&!this.#y.size)return!0;const m=new Set(d??this.#y);return this.options.throwOnError&&m.add("error"),Object.keys(this.#a).some(g=>{const A=g;return this.#a[A]!==i[A]&&m.has(A)})};this.#E({listeners:r()})}#j(){const i=this.#t.getQueryCache().build(this.#t,this.options);if(i===this.#e)return;const c=this.#e;this.#e=i,this.#l=i.state,this.hasListeners()&&(c?.removeObserver(this),i.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(i){ee.batch(()=>{i.listeners&&this.listeners.forEach(c=>{c(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function y0(i,c){return Ae(c.enabled,i)!==!1&&i.state.data===void 0&&!(i.state.status==="error"&&Ae(c.retryOnMount,i)===!1)}function Rh(i,c){return y0(i,c)||i.state.data!==void 0&&ar(i,c,c.refetchOnMount)}function ar(i,c,r){if(Ae(c.enabled,i)!==!1&&Gl(c.staleTime,i)!=="static"){const f=typeof r=="function"?r(i):r;return f==="always"||f!==!1&&fr(i,c)}return!1}function Uh(i,c,r,f){return(i!==c||Ae(f.enabled,i)===!1)&&(!r.suspense||i.state.status!=="error")&&fr(i,r)}function fr(i,c){return Ae(c.enabled,i)!==!1&&i.isStaleByTime(Gl(c.staleTime,i))}function v0(i,c){return!Is(i.getCurrentResult(),c)}var p0=class extends Ph{#t;#e;#l;#a;constructor(i){super(),this.#t=i.client,this.mutationId=i.mutationId,this.#l=i.mutationCache,this.#e=[],this.state=i.state||g0(),this.setOptions(i.options),this.scheduleGc()}setOptions(i){this.options=i,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(i){this.#e.includes(i)||(this.#e.push(i),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){this.#e=this.#e.filter(c=>c!==i),this.scheduleGc(),this.#l.notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#l.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(i){const c=()=>{this.#i({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=Ih({fn:()=>this.options.mutationFn?this.options.mutationFn(i,r):Promise.reject(new Error("No mutationFn found")),onFail:(m,g)=>{this.#i({type:"failed",failureCount:m,error:g})},onPause:()=>{this.#i({type:"pause"})},onContinue:c,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#l.canRun(this)});const f=this.state.status==="pending",d=!this.#a.canStart();try{if(f)c();else{this.#i({type:"pending",variables:i,isPaused:d}),this.#l.config.onMutate&&await this.#l.config.onMutate(i,this,r);const g=await this.options.onMutate?.(i,r);g!==this.state.context&&this.#i({type:"pending",context:g,variables:i,isPaused:d})}const m=await this.#a.start();return await this.#l.config.onSuccess?.(m,i,this.state.context,this,r),await this.options.onSuccess?.(m,i,this.state.context,r),await this.#l.config.onSettled?.(m,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(m,null,i,this.state.context,r),this.#i({type:"success",data:m}),m}catch(m){try{await this.#l.config.onError?.(m,i,this.state.context,this,r)}catch(g){Promise.reject(g)}try{await this.options.onError?.(m,i,this.state.context,r)}catch(g){Promise.reject(g)}try{await this.#l.config.onSettled?.(void 0,m,this.state.variables,this.state.context,this,r)}catch(g){Promise.reject(g)}try{await this.options.onSettled?.(void 0,m,i,this.state.context,r)}catch(g){Promise.reject(g)}throw this.#i({type:"error",error:m}),m}finally{this.#l.runNext(this)}}#i(i){const c=r=>{switch(i.type){case"failed":return{...r,failureCount:i.failureCount,failureReason:i.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:i.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:i.isPaused,status:"pending",variables:i.variables,submittedAt:Date.now()};case"success":return{...r,data:i.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:i.error,failureCount:r.failureCount+1,failureReason:i.error,isPaused:!1,status:"error"}}};this.state=c(this.state),ee.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(i)}),this.#l.notify({mutation:this,type:"updated",action:i})})}};function g0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var b0=class extends ti{constructor(i={}){super(),this.config=i,this.#t=new Set,this.#e=new Map,this.#l=0}#t;#e;#l;build(i,c,r){const f=new p0({client:i,mutationCache:this,mutationId:++this.#l,options:i.defaultMutationOptions(c),state:r});return this.add(f),f}add(i){this.#t.add(i);const c=xu(i);if(typeof c=="string"){const r=this.#e.get(c);r?r.push(i):this.#e.set(c,[i])}this.notify({type:"added",mutation:i})}remove(i){if(this.#t.delete(i)){const c=xu(i);if(typeof c=="string"){const r=this.#e.get(c);if(r)if(r.length>1){const f=r.indexOf(i);f!==-1&&r.splice(f,1)}else r[0]===i&&this.#e.delete(c)}}this.notify({type:"removed",mutation:i})}canRun(i){const c=xu(i);if(typeof c=="string"){const f=this.#e.get(c)?.find(d=>d.state.status==="pending");return!f||f===i}else return!0}runNext(i){const c=xu(i);return typeof c=="string"?this.#e.get(c)?.find(f=>f!==i&&f.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ee.batch(()=>{this.#t.forEach(i=>{this.notify({type:"removed",mutation:i})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(i){const c={exact:!0,...i};return this.getAll().find(r=>Mh(c,r))}findAll(i={}){return this.getAll().filter(c=>Mh(i,c))}notify(i){ee.batch(()=>{this.listeners.forEach(c=>{c(i)})})}resumePausedMutations(){const i=this.getAll().filter(c=>c.state.isPaused);return ee.batch(()=>Promise.all(i.map(c=>c.continue().catch(ve))))}};function xu(i){return i.options.scope?.id}var S0=class extends ti{constructor(i={}){super(),this.config=i,this.#t=new Map}#t;build(i,c,r){const f=c.queryKey,d=c.queryHash??sr(f,c);let m=this.get(d);return m||(m=new h0({client:i,queryKey:f,queryHash:d,options:i.defaultQueryOptions(c),state:r,defaultOptions:i.getQueryDefaults(f)}),this.add(m)),m}add(i){this.#t.has(i.queryHash)||(this.#t.set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const c=this.#t.get(i.queryHash);c&&(i.destroy(),c===i&&this.#t.delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){ee.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return this.#t.get(i)}getAll(){return[...this.#t.values()]}find(i){const c={exact:!0,...i};return this.getAll().find(r=>Oh(c,r))}findAll(i={}){const c=this.getAll();return Object.keys(i).length>0?c.filter(r=>Oh(i,r)):c}notify(i){ee.batch(()=>{this.listeners.forEach(c=>{c(i)})})}onFocus(){ee.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){ee.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},x0=class{#t;#e;#l;#a;#i;#n;#c;#u;constructor(i={}){this.#t=i.queryCache||new S0,this.#e=i.mutationCache||new b0,this.#l=i.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#c=cr.subscribe(async i=>{i&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#u=Ou.subscribe(async i=>{i&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#c?.(),this.#c=void 0,this.#u?.(),this.#u=void 0)}isFetching(i){return this.#t.findAll({...i,fetchStatus:"fetching"}).length}isMutating(i){return this.#e.findAll({...i,status:"pending"}).length}getQueryData(i){const c=this.defaultQueryOptions({queryKey:i});return this.#t.get(c.queryHash)?.state.data}ensureQueryData(i){const c=this.defaultQueryOptions(i),r=this.#t.build(this,c),f=r.state.data;return f===void 0?this.fetchQuery(i):(i.revalidateIfStale&&r.isStaleByTime(Gl(c.staleTime,r))&&this.prefetchQuery(c),Promise.resolve(f))}getQueriesData(i){return this.#t.findAll(i).map(({queryKey:c,state:r})=>{const f=r.data;return[c,f]})}setQueryData(i,c,r){const f=this.defaultQueryOptions({queryKey:i}),m=this.#t.get(f.queryHash)?.state.data,g=e0(c,m);if(g!==void 0)return this.#t.build(this,f).setData(g,{...r,manual:!0})}setQueriesData(i,c,r){return ee.batch(()=>this.#t.findAll(i).map(({queryKey:f})=>[f,this.setQueryData(f,c,r)]))}getQueryState(i){const c=this.defaultQueryOptions({queryKey:i});return this.#t.get(c.queryHash)?.state}removeQueries(i){const c=this.#t;ee.batch(()=>{c.findAll(i).forEach(r=>{c.remove(r)})})}resetQueries(i,c){const r=this.#t;return ee.batch(()=>(r.findAll(i).forEach(f=>{f.reset()}),this.refetchQueries({type:"active",...i},c)))}cancelQueries(i,c={}){const r={revert:!0,...c},f=ee.batch(()=>this.#t.findAll(i).map(d=>d.cancel(r)));return Promise.all(f).then(ve).catch(ve)}invalidateQueries(i,c={}){return ee.batch(()=>(this.#t.findAll(i).forEach(r=>{r.invalidate()}),i?.refetchType==="none"?Promise.resolve():this.refetchQueries({...i,type:i?.refetchType??i?.type??"active"},c)))}refetchQueries(i,c={}){const r={...c,cancelRefetch:c.cancelRefetch??!0},f=ee.batch(()=>this.#t.findAll(i).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let m=d.fetch(void 0,r);return r.throwOnError||(m=m.catch(ve)),d.state.fetchStatus==="paused"?Promise.resolve():m}));return Promise.all(f).then(ve)}fetchQuery(i){const c=this.defaultQueryOptions(i);c.retry===void 0&&(c.retry=!1);const r=this.#t.build(this,c);return r.isStaleByTime(Gl(c.staleTime,r))?r.fetch(c):Promise.resolve(r.state.data)}prefetchQuery(i){return this.fetchQuery(i).then(ve).catch(ve)}fetchInfiniteQuery(i){return i._type="infinite",this.fetchQuery(i)}prefetchInfiniteQuery(i){return this.fetchInfiniteQuery(i).then(ve).catch(ve)}ensureInfiniteQueryData(i){return i._type="infinite",this.ensureQueryData(i)}resumePausedMutations(){return Ou.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#l}setDefaultOptions(i){this.#l=i}setQueryDefaults(i,c){this.#a.set(Vn(i),{queryKey:i,defaultOptions:c})}getQueryDefaults(i){const c=[...this.#a.values()],r={};return c.forEach(f=>{Jn(i,f.queryKey)&&Object.assign(r,f.defaultOptions)}),r}setMutationDefaults(i,c){this.#i.set(Vn(i),{mutationKey:i,defaultOptions:c})}getMutationDefaults(i){const c=[...this.#i.values()],r={};return c.forEach(f=>{Jn(i,f.mutationKey)&&Object.assign(r,f.defaultOptions)}),r}defaultQueryOptions(i){if(i._defaulted)return i;const c={...this.#l.queries,...this.getQueryDefaults(i.queryKey),...i,_defaulted:!0};return c.queryHash||(c.queryHash=sr(c.queryKey,c)),c.refetchOnReconnect===void 0&&(c.refetchOnReconnect=c.networkMode!=="always"),c.throwOnError===void 0&&(c.throwOnError=!!c.suspense),!c.networkMode&&c.persister&&(c.networkMode="offlineFirst"),c.queryFn===rr&&(c.enabled=!1),c}defaultMutationOptions(i){return i?._defaulted?i:{...this.#l.mutations,...i?.mutationKey&&this.getMutationDefaults(i.mutationKey),...i,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},em=Q.createContext(void 0),ei=i=>{const c=Q.useContext(em);if(!c)throw new Error("No QueryClient set, use QueryClientProvider to set one");return c},j0=({client:i,children:c})=>(Q.useEffect(()=>(i.mount(),()=>{i.unmount()}),[i]),o.jsx(em.Provider,{value:i,children:c})),lm=Q.createContext(!1),E0=()=>Q.useContext(lm);lm.Provider;function T0(){let i=!1;return{clearReset:()=>{i=!1},reset:()=>{i=!0},isReset:()=>i}}var N0=Q.createContext(T0()),O0=()=>Q.useContext(N0),M0=(i,c,r)=>{const f=r?.state.error&&typeof i.throwOnError=="function"?$h(i.throwOnError,[r.state.error,r]):i.throwOnError;(i.suspense||i.experimental_prefetchInRender||f)&&(c.isReset()||(i.retryOnMount=!1))},A0=i=>{Q.useEffect(()=>{i.clearReset()},[i])},C0=({result:i,errorResetBoundary:c,throwOnError:r,query:f,suspense:d})=>i.isError&&!c.isReset()&&!i.isFetching&&f&&(d&&i.data===void 0||$h(r,[i.error,f])),z0=i=>{if(i.suspense){const r=d=>d==="static"?d:Math.max(d??1e3,1e3),f=i.staleTime;i.staleTime=typeof f=="function"?(...d)=>r(f(...d)):r(f),typeof i.gcTime=="number"&&(i.gcTime=Math.max(i.gcTime,1e3))}},_0=(i,c)=>i.isLoading&&i.isFetching&&!c,D0=(i,c)=>i?.suspense&&c.isPending,Hh=(i,c,r)=>c.fetchOptimistic(i).catch(()=>{r.clearReset()});function R0(i,c,r){const f=E0(),d=O0(),m=ei(),g=m.defaultQueryOptions(i);m.getDefaultOptions().queries?._experimental_beforeQuery?.(g);const A=m.getQueryCache().get(g.queryHash),p=i.subscribed!==!1;g._optimisticResults=f?"isRestoring":p?"optimistic":void 0,z0(g),M0(g,d,A),A0(d);const y=!m.getQueryCache().get(g.queryHash),[M]=Q.useState(()=>new c(m,g)),E=M.getOptimisticResult(g),x=!f&&p;if(Q.useSyncExternalStore(Q.useCallback(q=>{const z=x?M.subscribe(ee.batchCalls(q)):ve;return M.updateResult(),z},[M,x]),()=>M.getCurrentResult(),()=>M.getCurrentResult()),Q.useEffect(()=>{M.setOptions(g)},[g,M]),D0(g,E))throw Hh(g,M,d);if(C0({result:E,errorResetBoundary:d,throwOnError:g.throwOnError,query:A,suspense:g.suspense}))throw E.error;return m.getDefaultOptions().queries?._experimental_afterQuery?.(g,E),g.experimental_prefetchInRender&&!Fn.isServer()&&_0(E,f)&&(y?Hh(g,M,d):A?.promise)?.catch(ve).finally(()=>{M.updateResult()}),g.notifyOnChangeProps?E:M.trackResult(E)}function ge(i,c){return R0(i,m0)}function am(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}async function Ce(i){const c=await fetch(i);if(c.status===401&&am(),!c.ok)throw new Error(await c.text());return c.json()}async function Yl(i,c,r){const f={method:i};r!==void 0&&(f.headers={"Content-Type":"application/json"},f.body=JSON.stringify(r));const d=await fetch(c,f);if(!d.ok)throw new Error(await d.text());return d.status===204?{}:d.json()}async function Fa(i,c){const r=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c||{})});if(r.status===401&&am(),!r.ok)throw new Error(await r.text());return r.json()}function U0(){return ge({queryKey:["config"],queryFn:async()=>{const i=await Ce("/api/config");return i.auth.enabled&&!i.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),i},staleTime:1/0})}const nr=new Set;function H0(i){return nr.add(i),()=>nr.delete(i)}function q0(){for(const i of nr)i()}const nm=(...i)=>i.filter((c,r,f)=>!!c&&c.trim()!==""&&f.indexOf(c)===r).join(" ").trim();const w0=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Q0=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(c,r,f)=>f?f.toUpperCase():r.toLowerCase());const qh=i=>{const c=Q0(i);return c.charAt(0).toUpperCase()+c.slice(1)};var Js={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 B0=i=>{for(const c in i)if(c.startsWith("aria-")||c==="role"||c==="title")return!0;return!1},L0=Q.createContext({}),Y0=()=>Q.useContext(L0),G0=Q.forwardRef(({color:i,size:c,strokeWidth:r,absoluteStrokeWidth:f,className:d="",children:m,iconNode:g,...A},p)=>{const{size:y=24,strokeWidth:M=2,absoluteStrokeWidth:E=!1,color:x="currentColor",className:q=""}=Y0()??{},z=f??E?Number(r??M)*24/Number(c??y):r??M;return Q.createElement("svg",{ref:p,...Js,width:c??y??Js.width,height:c??y??Js.height,stroke:i??x,strokeWidth:z,className:nm("lucide",q,d),...!m&&!B0(A)&&{"aria-hidden":"true"},...A},[...g.map(([w,Y])=>Q.createElement(w,Y)),...Array.isArray(m)?m:[m]])});const Ot=(i,c)=>{const r=Q.forwardRef(({className:f,...d},m)=>Q.createElement(G0,{ref:m,iconNode:c,className:nm(`lucide-${w0(qh(i))}`,`lucide-${i}`,f),...d}));return r.displayName=qh(i),r};const X0=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],K0=Ot("check",X0);const Z0=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],k0=Ot("chevron-down",Z0);const V0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],J0=Ot("chevron-right",V0);const F0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],$0=Ot("clock",F0);const W0=[["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"}]],I0=Ot("copy",W0);const P0=[["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"}]],tp=Ot("download",P0);const ep=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],lp=Ot("ellipsis",ep);const ap=[["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"}]],np=Ot("file-text",ap);const ip=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],up=Ot("folder",ip);const cp=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],sp=Ot("globe",cp);const rp=[["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"}]],fp=Ot("history",rp);const op=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],dp=Ot("layout-dashboard",op);const hp=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],mp=Ot("link",hp);const yp=[["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"}]],vp=Ot("lock",yp);const pp=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],gp=Ot("log-out",pp);const bp=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Sp=Ot("menu",bp);const xp=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jp=Ot("plus",xp);const Ep=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Tp=Ot("search",Ep);const Np=[["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"}]],Op=Ot("settings",Np);const Mp=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],Ap=Ot("share-2",Mp);const Cp=[["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"}]],zp=Ot("shield",Cp);const _p=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Dp=Ot("square-terminal",_p);const Rp=[["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"}]],Up=Ot("trash-2",Rp);const Hp=[["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"}]],qp=Ot("triangle-alert",Hp);const wp=[["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"}]],Qp=Ot("upload",wp);const Bp=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Lp=Ot("users",Bp);const Yp=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gp=Ot("x",Yp);function Xp(){document.body.classList.toggle("sb-open")}function Ze(){document.body.classList.remove("sb-open")}const Kp={alert:qp,check:K0,chev:J0,chevd:k0,clock:$0,copy:I0,doc:np,dots:lp,download:tp,folder:up,dashboard:dp,gear:Op,globe:sp,hist:fp,link:mp,lock:vp,menu:Sp,plus:jp,power:gp,search:Tp,share:Ap,shield:zp,terminal:Dp,trash:Up,upload:Qp,users:Lp,x:Gp};function Zt({name:i}){const c=Kp[i];return c?o.jsx(c,{className:"ico","aria-hidden":"true"}):null}function $n(i){return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:"sb-backdrop",onClick:Ze}),o.jsxs("aside",{id:"sidebar",children:[i.vault,i.projectsNav,i.tree??o.jsx("nav",{id:"tree","aria-label":"Files"}),i.orgBar]}),o.jsxs("main",{id:"main",children:[i.topbar,o.jsx("article",{id:"content",className:i.contentClass??"markdown",ref:i.contentRef,onScroll:i.onContentScroll,children:i.children})]})]})}function Mu(i){const{name:c,onHome:r,showSignout:f,search:d}=i;return o.jsxs("header",{id:"vault",children:[o.jsx("span",{id:"vault-badge","aria-hidden":"true",children:"🐻"}),o.jsx("span",{id:"vault-name",className:r?"vault-link":void 0,onClick:r,role:r?"button":void 0,tabIndex:r?0:void 0,onKeyDown:m=>{r&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),r())},children:c}),o.jsxs("div",{className:"vault-actions",children:[d&&o.jsxs("button",{id:"search-btn",className:"icon-btn2 has-tip","aria-label":"Search",onClick:()=>{q0(),Ze()},children:[o.jsx(Zt,{name:"search"}),o.jsxs("span",{className:"tip",role:"tooltip",children:["Search ",o.jsx("kbd",{children:"⌘K"})]})]}),f&&o.jsx("a",{id:"signout",href:"/auth/logout",title:"Sign out","aria-label":"Sign out",children:o.jsx(Zt,{name:"power"})})]})]})}function Wn(i){return o.jsxs("header",{id:"topbar",children:[o.jsx("button",{id:"menu-btn",className:"icon-btn",title:"Menu","aria-label":"Menu",onClick:Xp,children:o.jsx(Zt,{name:"menu"})}),o.jsx("span",{id:"crumb",children:i.crumb}),o.jsx("span",{id:"meta",children:i.meta}),i.actions]})}let or={msg:"",err:!1,shown:!1},Eu=[],wh;function Qh(i){or=i,Eu.forEach(c=>c())}function st(i,c=!1){Qh({msg:i,err:c,shown:!0}),clearTimeout(wh),wh=setTimeout(()=>Qh({...or,shown:!1}),3200)}function Zp(){const i=Q.useSyncExternalStore(c=>(Eu.push(c),()=>{Eu=Eu.filter(r=>r!==c)}),()=>or);return o.jsx("div",{id:"toast",className:i.shown?"show"+(i.err?" err":""):"",children:i.msg})}let im=null,Tu=[];function dr(i){im=i,Tu.forEach(c=>c())}function um(i,c,r="",f="OK"){return new Promise(d=>dr({kind:"prompt",title:i,label:c,value:r,okLabel:f,resolve:d}))}function ju(i,c,r="Confirm",f=!1){return new Promise(d=>dr({kind:"confirm",title:i,message:c,confirmLabel:r,danger:f,resolve:d}))}function kp(){const i=Q.useSyncExternalStore(c=>(Tu.push(c),()=>{Tu=Tu.filter(r=>r!==c)}),()=>im);return i?i.kind==="prompt"?o.jsx(Vp,{m:i}):o.jsx(Jp,{m:i}):null}function cm(){dr(null)}function Vp({m:i}){const c=Q.useRef(null),r=d=>{cm(),i.resolve(d)},f=()=>r(c.current.value.trim()||null);return Q.useEffect(()=>{c.current.focus(),c.current.select();const d=m=>{m.key==="Escape"&&r(null),m.key==="Enter"&&f()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),o.jsx("div",{className:"modal-back",onClick:d=>d.target===d.currentTarget&&r(null),children:o.jsxs("div",{className:"modal",children:[o.jsx("h3",{children:i.title}),o.jsx("label",{className:"modal-label",children:i.label}),o.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",defaultValue:i.value,ref:c}),o.jsxs("div",{className:"modal-actions",children:[o.jsx("button",{className:"ai-btn",onClick:()=>r(null),children:"Cancel"}),o.jsx("button",{className:"pbtn",onClick:f,children:i.okLabel})]})]})})}function Jp({m:i}){const c=Q.useRef(null),r=f=>{cm(),i.resolve(f)};return Q.useEffect(()=>{c.current.focus();const f=d=>{d.key==="Escape"&&r(!1),d.key==="Enter"&&r(!0)};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[]),o.jsx("div",{className:"modal-back",onClick:f=>f.target===f.currentTarget&&r(!1),children:o.jsxs("div",{className:"modal",children:[o.jsx("h3",{children:i.title}),o.jsx("p",{className:"modal-msg",children:i.message}),o.jsxs("div",{className:"modal-actions",children:[o.jsx("button",{className:"ai-btn",onClick:()=>r(!1),children:"Cancel"}),o.jsx("button",{className:i.danger?"danger-btn":"pbtn",onClick:()=>r(!0),ref:c,children:i.confirmLabel})]})]})})}function Fp(i){return ge({queryKey:["projects"],queryFn:()=>Ce("/api/projects"),enabled:i,refetchInterval:3e4,select:c=>c.projects||[]})}function $p(i){return ge({queryKey:["orgs"],queryFn:()=>Ce("/api/orgs"),enabled:i,select:c=>c.orgs||[]})}function sm(i){return ge({queryKey:["admin","pending"],queryFn:()=>Ce("/api/admin/pending"),enabled:i,select:c=>c.pending||[]})}function rm(){const i=ei();return()=>Promise.all([i.invalidateQueries({queryKey:["projects"]}),i.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function fm(i){return i.split("/").map(encodeURIComponent).join("/")}function Bh(i){return i.split("/").map(decodeURIComponent).join("/")}const Wp=new Set(["insights","history","install","settings"]);function om(i,c){const r=i.replace(/^\/+/,"");if(c!=="hub")return{path:r?Bh(r):""};const f=r.indexOf("/");if(f===-1)return{project:r,path:""};const d={project:r.slice(0,f),path:Bh(r.slice(f+1))},m=d.path.indexOf("/"),g=m===-1?d.path:d.path.slice(0,m);return Wp.has(g)&&(d.view=g,d.viewTarget=m===-1?"":d.path.slice(m+1).replace(/\/+$/,""),d.path=""),d}function Ip(i,c){const r=fm(i);return c?"/"+c+(r?"/"+r:""):"/"+r}function Ja(i,c,r){let f=(c?"/"+c:"")+"/"+i;return r&&(f+="/"+fm(r.replace(/\/+$/,""))),f}let hr="POP";const ir=new Set;function dm(){for(const i of ir)i()}window.addEventListener("popstate",()=>{hr="POP",dm()});function pe(i,c){const r=location.pathname+location.search;!c?.replace&&r===i||(history[c?.replace?"replaceState":"pushState"](null,"",i),hr=c?.replace?"REPLACE":"PUSH",dm())}function mr(){return Q.useSyncExternalStore(i=>(ir.add(i),()=>{ir.delete(i)}),()=>location.pathname)}function Pp(){return hr}function tg({to:i}){return Q.useEffect(()=>{pe(i,{replace:!0})},[i]),null}const eg=/\.(md|markdown)$/i,lg=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,ag=/\.html?$/i,ng=/\.(txt|log|json|ya?ml|toml|csv|go|py|js|ts|jsx|tsx|sh|bash|zsh|rb|rs|c|h|cpp|java|kt|swift|sql|css|xml|ini|conf|env|mod|sum|jsonl)$/i;function hm(i){if(i<1024)return i+" B";const c=["KB","MB","GB","TB"];let r=-1;do i/=1024,r++;while(i>=1024&&rd.invalidateQueries({queryKey:["orgs"]}),y=()=>d.invalidateQueries({queryKey:["invites",i.id]}),M=()=>d.invalidateQueries({queryKey:["orgShares",i.id]}),{data:E}=ge({queryKey:["invites",i.id],queryFn:()=>Ce(`/api/orgs/${i.id}/invites`),enabled:m,select:z=>z.invites||[]}),{data:x}=ge({queryKey:["orgShares",i.id],queryFn:()=>Ce(`/api/orgs/${i.id}/shares`),enabled:m,select:z=>z.shares||[]}),q=c.filter(z=>z.org===i.id);return o.jsxs("div",{className:"admin",children:[o.jsx("h1",{id:"org-title",children:i.name+(m?"":" · member")}),m&&o.jsxs("div",{className:"admin-row",children:[o.jsx("input",{id:"org-rename",type:"text",value:g,onChange:z=>A(z.target.value)}),o.jsx("button",{className:"pbtn",id:"org-rename-btn",onClick:async()=>{try{await Yl("PATCH","/api/orgs/"+i.id,{name:g.trim()}),st("Renamed."),p()}catch(z){st(z.message,!0)}},children:"Rename org"})]}),o.jsx("h3",{children:"Members"}),o.jsx("div",{className:"admin-list",children:i.members.map(z=>{const w=!!r&&z.email.toLowerCase()===r.toLowerCase();return o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:z.email+(w?" (you)":"")}),m&&!w?o.jsxs(o.Fragment,{children:[o.jsxs("select",{value:z.role,onChange:async Y=>{try{await Yl("PATCH",`/api/orgs/${i.id}/members/${encodeURIComponent(z.email)}`,{role:Y.target.value}),st("Role updated.")}catch($){st($.message,!0)}p()},children:[o.jsx("option",{value:"owner",children:"owner"}),o.jsx("option",{value:"member",children:"member"})]}),o.jsx("button",{className:"ai-del",onClick:async()=>{if(await ju("Remove member",`Remove ${z.email} from ${i.name}?`,"Remove",!0))try{await Yl("DELETE",`/api/orgs/${i.id}/members/${encodeURIComponent(z.email)}`),st("Removed."),p()}catch(Y){st(Y.message,!0)}},children:"Remove"})]}):o.jsx("span",{className:"ai-tag",children:z.role})]},z.email)})}),m&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{children:"Projects"}),o.jsxs("div",{className:"admin-list",children:[q.length===0&&o.jsx("div",{className:"admin-empty",children:"No projects yet."}),q.map(z=>o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:z.name}),o.jsx("button",{className:"ai-btn",onClick:async()=>{const w=await um("Rename project","New name",z.name,"Rename");if(!(!w||w===z.name))try{await Yl("PATCH","/api/projects/"+z.id,{name:w}),st("Renamed."),await f()}catch(Y){st(Y.message,!0)}},children:"Rename"}),o.jsx("button",{className:"ai-del",onClick:async()=>{if(await ju("Delete project",`Delete “${z.name}”? Its files stay in storage, but it's removed from the hub.`,"Delete",!0))try{await Yl("DELETE","/api/projects/"+z.id),st(`Deleted “${z.name}”.`),await f()}catch(w){st(w.message,!0)}},children:"Delete"})]},z.id))]}),o.jsxs("div",{className:"admin-h",children:[o.jsx("h3",{children:"Invite links"}),o.jsx("button",{className:"pbtn",onClick:async()=>{try{const z=await Fa(`/api/orgs/${i.id}/invites`),w=await In(z.url);st(w?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),y()}catch(z){st(z.message,!0)}},children:"New invite"})]}),o.jsxs("div",{className:"admin-list",children:[E&&E.length===0&&o.jsx("div",{className:"admin-empty",children:"No active invite links."}),(E||[]).map(z=>o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main mono",style:{cursor:"pointer"},title:"Copy",onClick:()=>In(z.url).then(w=>st(w?"Copied.":"Select and copy the link.")),children:z.url}),o.jsx("span",{className:"ai-tag",children:(z.creator?"by "+z.creator+" · ":"")+(z.uses?z.uses+" joined · ":"unused · ")+"expires "+new Date(z.expires).toLocaleDateString()}),o.jsx("button",{className:"ai-del",onClick:async()=>{if(await ju("Revoke invite","Revoke this invite link? Anyone still holding it won't be able to join.","Revoke",!0))try{await Yl("DELETE",`/api/orgs/${i.id}/invites/${z.token}`),st("Revoked."),y()}catch(w){st(w.message,!0)}},children:"Revoke"})]},z.token))]}),o.jsx("h3",{children:"Public share links"}),o.jsxs("div",{className:"admin-list",children:[x&&x.length===0&&o.jsx("div",{className:"admin-empty",children:"No public shares."}),(x||[]).map(z=>o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main mono",style:{cursor:"pointer"},title:z.url,onClick:()=>window.open(z.url,"_blank"),children:z.path}),o.jsx("span",{className:"ai-tag",children:(z.project_name||"")+(z.creator?" · by "+z.creator:"")+(z.created?" · "+new Date(z.created).toLocaleDateString():"")}),o.jsx("button",{className:"ai-del",onClick:async()=>{if(await ju("Revoke share link",`Revoke the public link to “${z.path}”? Anyone with the URL will lose access.`,"Revoke",!0))try{await Yl("DELETE","/api/shares/"+z.token),st("Share revoked."),M()}catch(w){st(w.message,!0)}},children:"Revoke"})]},z.token))]})]})]})}function ug(){const i=ei(),{data:c,error:r}=ge({queryKey:["admin","policy"],queryFn:()=>Ce("/api/admin/policy")}),{data:f}=sm(!0),[d,m]=Q.useState(!1),[g,A]=Q.useState(!1);if(Q.useEffect(()=>{c&&(m(c.require_verification&&c.mailer),A(c.require_approval))},[c]),Q.useEffect(()=>{r&&st(r.message,!0)},[r]),!c)return null;const p=async(y,M,E)=>{try{await Fa(`/api/admin/pending/${y}/${M}`),st((M==="approve"?"Approved ":"Denied ")+E),i.invalidateQueries({queryKey:["admin","pending"]})}catch(x){st(x.message,!0)}};return o.jsxs("div",{className:"admin",children:[o.jsx("h1",{children:"Signup & access"}),o.jsx("p",{className:"admin-sub",children:"Who can create an account on this hub, and how new accounts are vetted."}),o.jsx("h3",{children:"New-account vetting"}),o.jsxs("div",{className:"admin-list",children:[o.jsx(Lh,{label:"Require email verification",desc:c.mailer?"New accounts must click an emailed link before they can sign in — proves they control the address.":"Configure SMTP on the server (auth.smtp) to enable email verification.",checked:d,disabled:!c.mailer,onChange:m}),o.jsx(Lh,{label:"Require admin approval",desc:"New accounts wait for a hub admin to approve them before they gain access.",checked:g,onChange:A})]}),o.jsx("button",{className:"pbtn",style:{marginTop:14},onClick:async()=>{try{await Fa("/api/admin/policy",{require_verification:d,require_approval:g}),st("Signup policy saved."),i.invalidateQueries({queryKey:["admin","policy"]})}catch(y){st(y.message,!0)}},children:"Save policy"}),o.jsx("h3",{children:"Who can sign up"}),o.jsxs("div",{className:"admin-list",children:[o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:"Allowed email domains"}),o.jsx("span",{className:"ai-tag",children:c.allowed_domains&&c.allowed_domains.length?c.allowed_domains.map(y=>"@"+y).join(", "):"any"})]}),o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:"Self-signup"}),o.jsx("span",{className:"ai-tag",children:c.allow_signup?"open":"invite-only"})]}),o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:"Hub admins"}),o.jsx("span",{className:"ai-tag",children:c.admins&&c.admins.length?c.admins.join(", "):"none"})]})]}),o.jsx("p",{className:"admin-sub",children:"Domains and admins are set in the server config file (they can't be widened from the browser)."}),o.jsx("h3",{children:"Pending signups"}),o.jsxs("div",{className:"admin-list",children:[(!f||f.length===0)&&o.jsx("div",{className:"admin-empty",children:"No one is waiting for approval."}),(f||[]).map(y=>o.jsxs("div",{className:"admin-item",children:[o.jsx("span",{className:"ai-main",children:(y.name?y.name+" · ":"")+y.email}),o.jsx("button",{className:"pbtn",onClick:()=>p(y.id,"approve",y.email),children:"Approve"}),o.jsx("button",{className:"ai-del",onClick:()=>p(y.id,"deny",y.email),children:"Deny"})]},y.id))]})]})}function Lh({label:i,desc:c,checked:r,disabled:f,onChange:d}){return o.jsxs("label",{className:"admin-item toggle",style:f?{opacity:.55}:void 0,children:[o.jsxs("span",{className:"ai-main",children:[o.jsx("div",{className:"tg-label",children:i}),o.jsx("div",{className:"tg-desc",children:c})]}),o.jsx("input",{type:"checkbox",checked:r,disabled:f,onChange:m=>d(m.target.checked)})]})}const Yh=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function ym(i){let c=0;for(const r of i)c=c*31+r.charCodeAt(0)>>>0;return Yh[c%Yh.length]}function Gh({projects:i,currentId:c,menu:r}){const f=rm(),d=async()=>{const m=await um("New project","Project name","","Create");if(m)try{const g=await Fa("/api/projects",{name:m});await f(),pe("/"+g.project.id),st(`Created “${g.project.name}”.`)}catch(g){st("Could not create the project: "+g.message,!0)}};return o.jsxs("nav",{id:"projects","aria-label":"Projects",children:[o.jsxs("div",{className:"nav-head",children:[o.jsx("span",{children:"Projects"}),o.jsx("button",{className:"nav-add",title:"New project",onClick:d,children:"+"})]}),o.jsx("div",{className:"proj-row",children:o.jsxs("span",{className:"proj-select-wrap",children:[c&&o.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:ym(i.find(m=>m.id===c)?.name||"")}}),o.jsxs("select",{id:"project-select","aria-label":"Switch project",value:c||"",onChange:m=>{m.target.value&&(pe("/"+m.target.value),Ze())},children:[!c&&o.jsx("option",{value:"",disabled:!0}),i.map(m=>o.jsx("option",{value:m.id,children:m.name},m.id))]}),o.jsx(Zt,{name:"chevd"})]})}),r&&o.jsx("ul",{className:"nav-menu","aria-label":"Project pages",children:[["dashboard","Dashboard","dashboard",r.onDashboard],["install","Installation","terminal",r.onInstall],["history","History","hist",r.onHistory],["settings","Settings","gear",r.onSettings]].map(([m,g,A,p])=>o.jsx("li",{children:o.jsxs("div",{id:"nav-"+m,className:"row"+(r.active===m?" active":""),role:"button",tabIndex:0,onClick:p,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),p())},children:[o.jsx(Zt,{name:A}),o.jsx("span",{className:"label",children:g})]})},m))})]})}function cg({me:i,org:c,admin:r,onOrgSettings:f}){const[d,m]=Q.useState(!1),g=Q.useRef(null);Q.useEffect(()=>{if(!d)return;const p=M=>{g.current&&!g.current.contains(M.target)&&m(!1)},y=M=>{M.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",p),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",y)}},[d]);const A=i.name||i.email;return o.jsxs("footer",{id:"accountbar",ref:g,children:[d&&o.jsxs("div",{id:"account-menu",role:"menu","aria-label":"Account menu",children:[c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-sec",children:"Organization"}),o.jsxs("button",{id:"menu-org-settings",role:"menuitem",onClick:()=>{m(!1),f(c)},children:[o.jsx(Zt,{name:"gear"}),o.jsxs("span",{children:[o.jsx("b",{children:c.name})," Settings"]})]})]}),r&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-sec",children:"Hub"}),o.jsxs("button",{id:"menu-hub-admin",role:"menuitem",onClick:()=>{m(!1),r.onClick()},children:[o.jsx(Zt,{name:"shield"}),o.jsxs("span",{children:["Signup & access",r.pending?` · ${r.pending}`:""]})]})]}),o.jsx("div",{className:"menu-sec",children:"Account"}),o.jsxs("a",{id:"signout",role:"menuitem",href:"/auth/logout",children:[o.jsx(Zt,{name:"power"}),o.jsx("span",{children:"Log out"})]})]}),o.jsxs("button",{id:"account-btn","aria-haspopup":"menu","aria-expanded":d,onClick:()=>m(p=>!p),children:[o.jsx("span",{className:"avatar",style:{background:ym(i.email)},"aria-hidden":"true",children:(A.trim()[0]||"?").toUpperCase()}),o.jsxs("span",{className:"acct",children:[o.jsx("b",{children:A}),i.name&&o.jsx("small",{children:i.email})]}),o.jsx(Zt,{name:"chev"})]})]})}function sg({project:i,org:c}){return o.jsxs("div",{className:"project-settings",children:[o.jsx("h2",{children:i.name}),o.jsxs("dl",{className:"ps-facts",children:[o.jsx("dt",{children:"Project id"}),o.jsx("dd",{children:o.jsx("code",{children:i.id})}),c&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"Workspace"}),o.jsx("dd",{children:c.name})]}),i.created&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:"Created"}),o.jsx("dd",{children:new Date(i.created).toLocaleDateString()})]})]})]})}const Fs=[{key:"claude",label:"Claude Code & Cowork"},{key:"hermes",label:"Hermes",hook:"hermes",note:"Registers BearDrive's hooks in Hermes's config: pull before every turn, push after edits with a session note, and report file reads to Insights."},{key:"codex",label:"Codex",hook:"codex",note:"Registers hooks in .codex/hooks.json.",extra:"Run /hooks inside Codex once to trust the project's .codex layer — after that every turn pulls, edits push automatically, and reads are reported to Insights."}];function rg(i,c){const r=window.location.origin,f=c.id;if(i.key==="claude")return[{title:"Add the BearDrive plugin",desc:"One time, in any Claude Code session. The plugin ships the beardrive skill, the /beardrive commands, and turn-boundary sync hooks — and Claude Cowork shares the same plugins, so installing it once covers both.",code:`/plugin marketplace add runbear-io/beardrive /plugin install beardrive@beardrive`},{title:"Set up this project conversationally",desc:"In a Claude Code or Cowork session in the folder where you want the files, run:",code:"/beardrive:install connect to "+r+", project "+f,extra:"Claude installs the CLI, signs this machine in, mounts the project, and registers the sync hooks — pull the latest before every turn, push after edits (stamped with the session that made them), and report file reads to Insights. It asks before anything it changes."}];const d=(c.name||"project").toLowerCase().replace(/[^a-z0-9._-]+/g,"-")||"project";return[{title:"Install the BearDrive CLI",desc:"One static binary. Homebrew on macOS and Linux; releases and `go install` also work.",code:"brew install runbear-io/tap/beardrive"},{title:"Sign in to this hub",desc:"Opens the browser once and stores a device token on this machine — the synced folder itself never holds credentials.",code:"bdrive login "+r},{title:"Mount the project into a local folder",desc:"Run it where you want the files. An existing folder works too — contents merge, and re-running init later (or after moving the folder) just resumes.",code:"mkdir -p ~/"+d+" && cd ~/"+d+` -bdrive init --project `+f},{title:"Connect "+i.label,desc:i.note,code:"bdrive hooks install --agent "+i.hook,extra:i.extra}]}function cg(){try{return localStorage.getItem("bdrive-guide-agent")||"claude"}catch{return"claude"}}function ym({project:i}){const[c,r]=Q.useState(cg),f=Fs.find(d=>d.key===c)||Fs[0];return o.jsxs("div",{className:"guide",children:[o.jsx("h1",{className:"in-title",children:i.name}),o.jsx("p",{className:"dl-sub",children:"Mount this project as a folder on any machine and connect your coding agent: files sync both ways in the background, every change is journaled with who made it, and agent reads feed Insights."}),o.jsx("div",{className:"gd-tabs",children:Fs.map(d=>o.jsx("button",{className:"gd-tab"+(d.key===f.key?" active":""),"data-key":d.key,onClick:()=>{r(d.key);try{localStorage.setItem("bdrive-guide-agent",d.key)}catch{}},children:d.label},d.key))}),o.jsxs("div",{className:"gd-body",children:[ug(f,i).map((d,m)=>o.jsxs("div",{className:"gd-step",children:[o.jsxs("div",{className:"gd-step-head",children:[o.jsx("span",{className:"gd-num",children:m+1}),o.jsx("span",{className:"gd-step-title",children:d.title})]}),d.desc&&o.jsx("p",{className:"gd-desc",children:d.desc}),d.code&&o.jsx(sg,{code:d.code}),d.extra&&o.jsx("p",{className:"gd-desc gd-extra",children:d.extra})]},m)),o.jsx("p",{className:"gd-done",children:"That's it — the folder now syncs on its own. Every agent turn starts from the latest state, edits appear here (and on every teammate's mount) within seconds, and what your agents read shows up in Insights."})]})]})}function sg({code:i}){const[c,r]=Q.useState("Copy");return o.jsxs("pre",{className:"gd-code",children:[o.jsx("code",{children:i}),o.jsx("button",{className:"gd-copy",onClick:async()=>{r(await In(i)?"Copied":"Copy failed"),setTimeout(()=>r("Copy"),1400)},children:c})]})}function rg({authEnabled:i,onCreate:c}){const r=Q.useRef(null),f=Q.useRef(null),d=()=>{const m=r.current.value.trim(),g=m.match(/join\/([0-9a-f]+)/)||m.match(/^([0-9a-f]{8,})$/);if(!g){st("That doesn't look like an invite link.",!0);return}location.href="/join/"+g[1]};return o.jsxs("div",{className:"onboard",children:[o.jsx("h1",{children:"Welcome to BearDrive"}),o.jsx("p",{children:"You're signed in, but you're not part of any project yet."}),i&&o.jsxs("div",{className:"ob-card",children:[o.jsx("h3",{children:"Have an invite link?"}),o.jsx("p",{children:"A teammate can send you a join link. Paste it here:"}),o.jsxs("div",{className:"ob-row",children:[o.jsx("input",{id:"ob-invite",type:"text",placeholder:"https://…/join/…",autoComplete:"off",ref:r}),o.jsx("button",{id:"ob-join",className:"pbtn",onClick:d,children:"Join"})]})]}),o.jsxs("div",{className:"ob-card",children:[o.jsx("h3",{children:"Or start a new project"}),o.jsx("p",{children:"Create a shared space for your team's files."}),o.jsxs("div",{className:"ob-row",children:[o.jsx("input",{id:"ob-name",type:"text",placeholder:"Project name, e.g. wiki",autoComplete:"off",ref:f}),o.jsx("button",{id:"ob-create",className:"pbtn",onClick:()=>c(f.current.value.trim()),children:"Create"})]})]})]})}function fg(i,c=!0){const r=ge({queryKey:["tree",i],queryFn:()=>Ce(i+"tree"),enabled:c,refetchInterval:15e3}),f=Q.useMemo(()=>{const d=[],m=new Map,g=A=>{for(const p of A.children||[])p.dir?(m.set(p.path,p),g(p)):d.push(p)};return r.data&&g(r.data),{flatFiles:d,dirIndex:m}},[r.data]);return{tree:r.data,...f,loaded:!!r.data}}function og(i,c){return ge({queryKey:["heat",i],queryFn:()=>Ce(i+"heat?days=30"),enabled:c,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function dg(i,c,r){return ge({queryKey:["history",i,"prefix",c,20],queryFn:()=>Ce(i+"history?prefix="+encodeURIComponent(c)+"&n=20"),enabled:r,staleTime:15e3}).data?.entries??null}function Gh(i,c,r){if(!i)return null;if(!r)return i[c]||null;const f={human:0,agent:0,share:0};for(const[d,m]of Object.entries(i))d.startsWith(c+"/")&&(f.human+=m.human||0,f.agent+=m.agent||0,f.share+=m.share||0);return f.human||f.agent||f.share?f:null}function Pn(i){return(i.human||0)+(i.agent||0)+(i.share||0)}function Nu(i){const c=Pn(i);if(!c)return"";let r=c+(c===1?" read":" reads");return i.agent&&(r+=" ("+i.agent+" agent)"),r}function hg(i){const c=Pn(i);return c?c<3?1:c<10?2:c<30?3:4:0}function mg(i){return o.jsx("nav",{id:"tree","aria-label":"Files",children:i.root&&o.jsx(vm,{nodes:i.root.children||[],...i})})}function vm({nodes:i,...c}){return o.jsx("ul",{children:i.map(r=>o.jsx(yg,{node:r,...c},r.path))})}function yg({node:i,...c}){const{expanded:r,onToggle:f,currentPath:d,listingShowing:m,onOpen:g}=c,A=i.dir?r.has(i.path):!1,p=()=>{if(i.dir&&d===i.path&&m){f(i.path);return}g(i.path),i.dir||Fe()};return o.jsxs("li",{className:(i.dir?"dir":"file")+(i.dir&&!A?" collapsed":""),children:[o.jsxs("div",{className:"row"+(d===i.path?" active":""),"data-path":i.path,tabIndex:0,role:"button",title:i.name,"aria-expanded":i.dir?A:void 0,onClick:p,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),p())},children:[o.jsx("span",{className:"chev",onClick:y=>{i.dir&&(y.stopPropagation(),f(i.path))},children:o.jsx(Zt,{name:"chevd"})}),o.jsx("span",{className:"ticon",children:o.jsx(Zt,{name:i.dir?"folder":"doc"})}),o.jsx("span",{className:"label",children:i.name})]}),i.dir&&o.jsx(vm,{nodes:i.children||[],...c})]})}function vg(i){const c=i.split("/"),r=[];let f="";for(let d=0;d{f=f?f+"/"+d:d;const g=f,A=m===r.length-1;return o.jsxs("span",{children:[m>0&&o.jsx("span",{className:"crumb-sep",children:"/"}),A?o.jsx("span",{children:d}):o.jsx("span",{className:"crumb-seg",title:g,onClick:()=>c(g),children:d})]},g)})})}const gg={add:"plus",edit:"edit",delete:"x"},bg={add:"added",edit:"edited",delete:"deleted"};function pm({entry:i,onOpen:c}){const[r,f]=Q.useState(!1),d=i.kind==="put"?"edit":i.kind,m=i.user_name?`${i.user_name} <${i.user}>`:i.user||i.author||"unknown",g=[i.device.name||i.device.id,i.device.os,i.device.ip].filter(Boolean).join(" · "),A=d!=="delete",p=y=>{y.target.tagName!=="A"&&A&&c(i.path)};return o.jsxs("div",{className:"hentry "+d+(A?" clickable":""),tabIndex:A?0:void 0,role:A?"button":void 0,onClick:p,onKeyDown:y=>{A&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),c(i.path))},children:[o.jsxs("div",{className:"hline",children:[o.jsx("span",{className:"hkind",children:o.jsx(Zt,{name:gg[d]||"dot"})}),o.jsx("span",{className:"hpath",children:i.path}),o.jsx("span",{className:"htag",children:bg[d]||d}),o.jsx("span",{className:"htime",children:new Date(i.time).toLocaleString()})]}),o.jsxs("div",{className:"hmeta",children:[o.jsx("span",{className:"hwho",children:m}),o.jsx("span",{className:"hdev",children:g}),o.jsx("span",{className:"hsize",children:i.size?dm(i.size):""})]}),i.note&&o.jsx("div",{className:"hnote"+(r?" open":""),tabIndex:0,role:"button",title:r?"Collapse note":"Show full note","aria-expanded":r,onClick:y=>{y.stopPropagation(),y.target.tagName!=="A"&&f(!r)},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.stopPropagation(),f(!r))},children:i.note.split(/(https?:\/\/\S+)/).map((y,M)=>/^https?:\/\//.test(y)?o.jsx("a",{href:y,target:"_blank",rel:"noopener",children:y},M):y)})]})}function Sg(i){const{node:c,heatMap:r,onOpen:f}=i,d=(c.children||[]).slice().sort((y,M)=>Number(M.dir||!1)-Number(y.dir||!1)||y.name.localeCompare(M.name)),m=d.filter(y=>y.dir).length,g=d.length-m,A=[];m&&A.push(m+(m===1?" folder":" folders")),g&&A.push(g+(g===1?" file":" files"));const p=Gh(r,c.path,!0);return p&&A.push(Nu(p)+" in 30 days"),o.jsxs("div",{className:"dirlist",children:[o.jsxs("h1",{className:"dl-title",children:[o.jsx("span",{className:"dl-title-icon",children:o.jsx(Zt,{name:"folder"})}),o.jsx("span",{children:c.name})]}),o.jsx("p",{className:"dl-sub",children:A.join(" · ")||"Empty folder"}),d.length===0?o.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):o.jsx("div",{className:"dl-items",children:d.map(y=>{let M="";if(y.dir){const x=(y.children||[]).length;M=x+(x===1?" item":" items")}else M=[y.size?dm(y.size):"",y.time?new Date(y.time).toLocaleDateString():""].filter(Boolean).join(" · ");const E=Gh(r,y.path,!!y.dir);return E&&(M=Nu(E)+(M?" · "+M:"")),o.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:y.path,onClick:()=>f(y.path),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(y.path))},children:[o.jsx("span",{className:"ticon",children:o.jsx(Zt,{name:y.dir?"folder":"doc"})}),o.jsx("span",{className:"dl-name",children:y.name}),E&&o.jsx("span",{className:"heatdot lvl"+hg(E),title:Nu(E)+" in 30 days"}),o.jsx("span",{className:"dl-meta",children:M})]},y.path)})}),i.hub&&o.jsx(xg,{apiBase:i.apiBase,prefix:c.path+"/",onOpen:f,onFullHistory:()=>i.onFullHistory(c.path+"/"),onRendered:i.onRendered})]})}function xg(i){const c=dg(i.apiBase,i.prefix,!0),{onRendered:r}=i;return Q.useEffect(()=>{c&&c.length&&r&&r()},[c,r]),!c||c.length===0?null:o.jsxs("div",{className:"dl-history",children:[o.jsx("h3",{className:"dl-h3",children:"Recent changes"}),o.jsx("div",{className:"history dl-hlist",children:c.map((f,d)=>o.jsx(pm,{entry:f,onOpen:i.onOpen},d))}),o.jsx("button",{className:"ai-btn dl-more",onClick:i.onFullHistory,children:"Full history"})]})}function jg(i){const{apiBase:c,path:r,onMeta:f}=i,d=c+"file?path="+encodeURIComponent(r);return Q.useEffect(()=>()=>f(""),[r,f]),Ip.test(r)?o.jsx(Eg,{...i}):tg.test(r)?o.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:d,title:r,onLoad:i.onRendered}):Pp.test(r)?o.jsx(Og,{src:d,alt:r,onRendered:i.onRendered}):eg.test(r)?o.jsx(Mg,{...i,fileURL:d}):o.jsxs("div",{className:"filecard",children:[o.jsx("div",{className:"name",children:r.split("/").pop()}),o.jsx("p",{children:"No preview for this file type."}),o.jsx("a",{className:"btn",download:!0,href:c+"download?path="+encodeURIComponent(r),children:"Download"})]})}function Eg(i){const{apiBase:c,path:r,heatMap:f,flatFiles:d,onOpenFile:m,onMeta:g,onRendered:A}=i,{data:p,error:y}=ge({queryKey:["render",c,r],queryFn:()=>Ce(c+"render?path="+encodeURIComponent(r))}),M=Q.useMemo(()=>p?Ng(p.html,r,c):"",[p,r,c]);return Q.useEffect(()=>{if(!p)return;const E=[];p.author&&E.push(p.author+(p.device?" on "+p.device:"")),p.time&&E.push(new Date(p.time).toLocaleString());const x=f&&f[p.path];x&&Pn(x)&&E.push(Nu(x)+" / 30d"),g(E.join(" · ")),A?.()},[p,f,g,A]),y?o.jsxs("div",{className:"empty",children:["Could not load file: ",y.message]}):p?o.jsx("div",{dangerouslySetInnerHTML:{__html:M},onClick:E=>Tg(E,r,d,m)}):null}function Tg(i,c,r,f){const d=i.target.closest("a");if(!d||!i.currentTarget.contains(d))return;const m=d.getAttribute("href")||"",g=c.includes("/")?c.slice(0,c.lastIndexOf("/")):"";m.startsWith("wiki:")?(i.preventDefault(),Ag(decodeURIComponent(m.slice(5)),r,f)):/^([a-z]+:|\/|#)/i.test(m)||(i.preventDefault(),f(hm(g,decodeURIComponent(m))))}function Ng(i,c,r){const f=c.includes("/")?c.slice(0,c.lastIndexOf("/")):"",d=g=>r+"file?path="+encodeURIComponent(g),m=new DOMParser().parseFromString(i,"text/html");for(const g of m.querySelectorAll("img")){const A=g.getAttribute("src")||"";/^([a-z]+:|\/)/i.test(A)||g.setAttribute("src",d(hm(f,A)))}for(const g of m.querySelectorAll("a")){const A=g.getAttribute("href")||"";/^https?:/i.test(A)&&(g.setAttribute("target","_blank"),g.setAttribute("rel","noopener"))}return m.body.innerHTML}function Og({src:i,alt:c,onRendered:r}){return o.jsx("img",{src:i,alt:c,onLoad:r})}function Mg(i){const{path:c,fileURL:r,onRendered:f}=i,{data:d,error:m}=ge({queryKey:["text",r],queryFn:async()=>{const g=await fetch(r);if(!g.ok)throw new Error(await g.text());return g.text()}});return Q.useEffect(()=>{d!=null&&f?.()},[d,f]),m?o.jsxs("div",{className:"empty",children:["Could not load file: ",m.message]}):d==null?null:o.jsx("pre",{className:"plain",children:d},c)}function Ag(i,c,r){const f=i.toLowerCase(),d=c.find(m=>m.path.toLowerCase()===f||m.path.toLowerCase()===f+".md")||c.find(m=>{const g=m.name.toLowerCase();return g===f||g===f+".md"});d&&r(d.path)}function Cg({url:i,copied:c,onClose:r}){const f=i.split("/s/")[1];return Q.useEffect(()=>{const d=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[r]),o.jsx("div",{className:"modal-back",onClick:d=>d.target===d.currentTarget&&r(),children:o.jsxs("div",{className:"modal",children:[o.jsx("h3",{children:"Public link created"}),o.jsxs("p",{children:[o.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until you revoke it."]}),o.jsx("div",{className:"modal-url",children:i}),o.jsxs("div",{className:"modal-actions",children:[o.jsx("button",{className:"pbtn",onClick:()=>In(i).then(d=>st(d?"Copied.":"Select and copy the link above.")),children:c?"Copied ✓":"Copy link"}),o.jsx("button",{className:"ai-btn",onClick:()=>window.open(i,"_blank"),children:"Open"}),o.jsx("button",{className:"ai-del",onClick:async()=>{try{await Yl("DELETE","/api/shares/"+f),st("Link revoked — it no longer works."),r()}catch(d){st(d.message,!0)}},children:"Revoke"}),o.jsx("button",{className:"ai-btn",onClick:r,children:"Done"})]})]})})}function Xh(i,c){if(!i)return{score:0,hits:[]};const r=i.toLowerCase(),f=c.toLowerCase();let d=0,m=0,g=0;const A=[];for(let p=0;p3&&f.endsWith("ies")?d=f.slice(0,-3)+"y":f.length>3&&f.endsWith("es")?d=f.slice(0,-2):f.length>2&&f.endsWith("s")&&(d=f.slice(0,-1)),d?Xh(d,c):null}function _g({text:i,hits:c}){const r=[];let f=0;return c.forEach((d,m)=>{d>f&&r.push(i.slice(f,d)),r.push(o.jsx("b",{children:i[d]},m)),f=d+1}),r.push(i.slice(f)),o.jsx("span",{className:"plabel",children:r})}function Dg({open:i,onClose:c,candidates:r}){const[f,d]=Q.useState(""),[m,g]=Q.useState(0),A=Q.useRef(null),p=Q.useRef(null),y=Q.useMemo(()=>{if(!i)return[];const E=[];for(const x of r()){const q=zg(f,x.label);q&&E.push({...x,score:q.score,hits:q.hits})}return E.sort((x,q)=>q.score-x.score),E.slice(0,40)},[i,f,r]);Q.useEffect(()=>{i&&(d(""),g(0),A.current?.focus())},[i]),Q.useEffect(()=>g(0),[f]),Q.useEffect(()=>{p.current?.children[m]?.scrollIntoView({block:"nearest"})},[m,y]);const M=E=>{c(),E.run()};return Q.useEffect(()=>{if(!i)return;const E=x=>{if(x.key==="Escape")x.preventDefault(),c();else if(x.key==="ArrowDown"||x.key==="ArrowUp"){x.preventDefault();const q=y.length;q&&g(z=>(z+(x.key==="ArrowDown"?1:q-1))%q)}else x.key==="Enter"&&(x.preventDefault(),y[m]&&M(y[m]))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[i,y,m]),i?o.jsx("div",{id:"palette-overlay",onClick:E=>E.target===E.currentTarget&&c(),children:o.jsxs("div",{id:"palette",role:"dialog","aria-label":"Search and quick actions",children:[o.jsxs("div",{id:"palette-inputwrap",children:[o.jsx(Zt,{name:"search"}),o.jsx("input",{id:"palette-input",type:"text",placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,ref:A,value:f,onChange:E=>d(E.target.value)})]}),o.jsx("ul",{id:"palette-results",ref:p,children:y.length===0?o.jsx("li",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):y.map((E,x)=>o.jsxs("li",{className:x===m?"selected":void 0,onClick:()=>M(E),onMouseMove:()=>m!==x&&g(x),children:[o.jsx("span",{className:"picon",children:o.jsx(Zt,{name:E.icon})}),o.jsx(_g,{text:E.label,hits:E.hits}),o.jsx("span",{className:"pkind",children:E.kind})]},E.kind+":"+E.label))}),o.jsx("footer",{id:"palette-hint",children:"↑↓ navigate · ⏎ select · esc close"})]})}):null}const kn=3,Va=30;function Rg(i,c){return ge({queryKey:["heatDevices",i],queryFn:()=>Ce(i+"heat?by=device&days=30"),enabled:c,retry:!1,staleTime:6e4}).data?.devices??null}function Kh(i){const[c,r]=Q.useState("all"),{flatFiles:f,heatMap:d,devices:m,scope:g}=i,A=x=>!g||x===g||x.startsWith(g+"/"),p=g?f.filter(x=>A(x.path)):f,y=m&&g?m.map(x=>{const q={};for(const[z,w]of Object.entries(x.folders||{}))A(z)&&(q[z]=w);return{...x,folders:q}}).filter(x=>Object.keys(x.folders).length>0):m,M=Date.now(),E=p.map(x=>{const q=d&&d[x.path]||{},z=x.time?Math.max(0,(M-new Date(x.time).getTime())/864e5):0,w=c==="all"?Pn(q):q[c]||0;return{path:x.path,reads:w,agent:q.agent||0,total:Pn(q),days:z,danger:w>=kn&&z>=Va}});return o.jsxs("div",{className:"insights",children:[o.jsxs("h1",{className:"in-title",children:["Knowledge insights",g?o.jsxs("span",{className:"in-scope",children:[" · ",g]}):null]}),o.jsx("p",{className:"dl-sub",children:g?`Reads over the last 30 days × freshness, for ${g} and everything in it.`:"Reads over the last 30 days × how long since each file changed. Hot but stale knowledge — read a lot, maintained by nobody — is the danger zone."}),o.jsx("div",{className:"in-lens",children:["all","human","agent"].map(x=>o.jsx("button",{className:"in-lens-btn"+(x===c?" active":""),onClick:()=>r(x),children:x==="all"?"All reads":x==="human"?"Human reads":"Agent reads"},x))}),o.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness"}),o.jsx(Hg,{pts:E,onOpenFile:i.onOpenFile,onOpenFolder:i.onOpenFolder,isFolder:i.isFolder}),o.jsx("h3",{className:"dl-h3",children:"Reads × freshness"}),o.jsx(qg,{pts:E,onOpenFile:i.onOpenFile}),o.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),o.jsx(wg,{pts:E,lens:c,onOpenFile:i.onOpenFile}),y&&y.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),o.jsx(Qg,{devices:y})]})]})}function Ug(i){const c=[[76,195,138],[232,196,84],[224,93,93]],r=Math.min(1,Math.max(0,i/300))*(c.length-1),f=Math.min(c.length-2,Math.floor(r)),d=r-f,m=c[f].map((g,A)=>Math.round(g+(c[f+1][A]-g)*d));return`rgb(${m[0]},${m[1]},${m[2]})`}function Zh(i,c,r,f,d){const m=i.reduce((y,M)=>y+M.value,0);if(!m||f<=0||d<=0)return[];const g=i.slice().sort((y,M)=>M.value-y.value).map(y=>({it:y,a:y.value/m*f*d})),A=(y,M)=>{const x=y.reduce((z,w)=>z+w.a,0)/M;let q=0;for(const z of y){const w=z.a/x;q=Math.max(q,w/x,x/w)}return q},p=[];for(;g.length;){const y=f>=d,M=y?d:f,E=[g.shift()];for(;g.length&&A(E.concat(g[0]),M)<=A(E,M);)E.push(g.shift());const x=E.reduce((z,w)=>z+w.a,0)/M;let q=0;for(const z of E){const w=z.a/x;y?p.push({item:z.it,x:c,y:r+q,w:x,h:w}):p.push({item:z.it,x:c+q,y:r,w,h:x}),q+=w}y?(c+=x,f-=x):(r+=x,d-=x)}return p}const $s=15;function Hg({pts:i,onOpenFile:c,onOpenFolder:r,isFolder:f}){const g=new Map;for(const p of i){const y=p.path.includes("/")?p.path.split("/")[0]:"/";let M=g.get(y);M||g.set(y,M={name:y,files:[],value:0}),M.files.push(p),M.value+=p.reads+1}const A=[];for(const p of Zh([...g.values()],0,0,720,480)){const y=p.item,M=y.name==="/"?"":y.name;if(A.push(o.jsx("rect",{x:p.x+1,y:p.y+1,width:Math.max(0,p.w-2),height:Math.max(0,p.h-2),rx:3,className:"in-tm-group","data-dir":M},"g"+y.name)),p.w>46&&p.h>$s+10){let x=y.name==="/"?"(root)":y.name;const q=Math.floor((p.w-8)/6);x.length>q&&(x=x.slice(0,Math.max(1,q-1))+"…"),A.push(o.jsx("text",{x:p.x+5,y:p.y+12,className:"in-tm-glabel","data-dir":M,children:x},"gl"+y.name))}const E=Zh(y.files.map(x=>({...x,name:x.path.split("/").pop(),value:x.reads+1})),p.x+2,p.y+$s,Math.max(0,p.w-4),Math.max(0,p.h-$s-2));for(const x of E)if(A.push(o.jsx("rect",{x:x.x+.6,y:x.y+.6,width:Math.max(.4,x.w-1.2),height:Math.max(.4,x.h-1.2),rx:1.5,fill:Ug(x.item.days),className:"in-tm-cell","data-path":x.item.path,children:o.jsx("title",{children:`${x.item.path} — ${x.item.reads} read${x.item.reads===1?"":"s"}/30d · changed ${Math.round(x.item.days)}d ago`})},x.item.path)),x.w>54&&x.h>16){const q=Math.floor((x.w-8)/6);let z=(x.item.danger?"⚠ ":"")+x.item.name;z.length>q&&(z=z.slice(0,Math.max(1,q-1))+"…"),q>=5&&A.push(o.jsx("text",{x:x.x+4.5,y:x.y+12.5,className:"in-tm-label","data-path":x.item.path,children:z},"l"+x.item.path))}}return o.jsx("svg",{viewBox:"0 0 720 480",className:"in-chart in-treemap",onClick:p=>{const y=p.target.closest("[data-path], [data-dir]");if(!y)return;const M=y.getAttribute("data-path");if(M)return c(M);const E=y.getAttribute("data-dir");E&&f(E)&&r(E)},children:A})}function qg({pts:i,onOpenFile:c}){const d={l:44,r:16,t:20,b:34},m=Math.max(Va*2,...i.map(E=>E.days)),g=Math.max(kn*2,...i.map(E=>E.reads)),A=E=>Math.log10(E+1)/Math.log10(m+1),p=E=>Math.log10(E+1)/Math.log10(g+1),y=E=>d.l+A(E)*(720-d.l-d.r),M=E=>360-d.b-p(E)*(360-d.t-d.b);return o.jsxs("svg",{viewBox:"0 0 720 360",className:"in-chart",children:[o.jsx("rect",{x:y(Va),y:d.t,width:720-d.r-y(Va),height:M(kn)-d.t,className:"in-danger-zone"}),o.jsx("line",{x1:y(Va),y1:d.t,x2:y(Va),y2:360-d.b,className:"in-threshold"}),o.jsx("line",{x1:d.l,y1:M(kn),x2:720-d.r,y2:M(kn),className:"in-threshold"}),o.jsx("line",{x1:d.l,y1:360-d.b,x2:720-d.r,y2:360-d.b,className:"in-axis"}),o.jsx("line",{x1:d.l,y1:d.t,x2:d.l,y2:360-d.b,className:"in-axis"}),o.jsx("text",{x:(d.l+720-d.r)/2,y:352,className:"in-label",children:"days since last change →"}),o.jsx("text",{x:12,y:(d.t+360-d.b)/2,className:"in-label",transform:`rotate(-90 12 ${(d.t+360-d.b)/2})`,children:"reads / 30d →"}),o.jsx("text",{x:720-d.r-6,y:d.t+14,className:"in-quad in-quad-danger",textAnchor:"end",children:"hot + stale"}),o.jsx("text",{x:d.l+6,y:d.t+14,className:"in-quad",children:"hot + fresh"}),o.jsx("text",{x:720-d.r-6,y:360-d.b-8,className:"in-quad",textAnchor:"end",children:"cold + stale"}),o.jsx("text",{x:720-d.r-6,y:d.t+28,className:"in-label",textAnchor:"end",children:"dot size = agent share of reads"}),i.map(E=>{const x=E.total?(E.agent||0)/E.total:0;return o.jsx("circle",{cx:Number(y(E.days).toFixed(1)),cy:Number(M(E.reads).toFixed(1)),r:Number((3+4*x).toFixed(1)),className:"in-pt"+(E.danger?" danger":E.reads?"":" cold"),onClick:()=>c(E.path),children:o.jsx("title",{children:`${E.path} — ${E.reads} read${E.reads===1?"":"s"} / 30d · changed ${Math.round(E.days)}d ago`})},E.path)})]})}function wg({pts:i,lens:c,onOpenFile:r}){const f=i.filter(m=>m.reads>0).sort((m,g)=>g.reads-m.reads||g.days-m.days).slice(0,20);if(!f.length)return o.jsx("div",{className:"dl-empty",children:"No reads in the window yet."});const d=f[0].reads;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"in-hotpath",children:f.map(m=>{const g=c==="agent"?1:c==="human"?0:m.total?m.agent/m.total:0,A=m.reads/d*100;return o.jsxs("div",{className:"in-hp-row",tabIndex:0,role:"button",title:m.danger?`${m.reads} read${m.reads===1?"":"s"}/30d · unchanged ${Math.round(m.days)}d — review this file`:m.path,onClick:()=>r(m.path),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),r(m.path))},children:[o.jsx("span",{className:"in-hp-name"+(m.danger?" danger":""),children:m.path+(m.danger?" ⚠":"")}),o.jsxs("span",{className:"in-hp-bar",children:[o.jsx("span",{className:"in-hp-agent",style:{width:(A*g).toFixed(1)+"%"}}),o.jsx("span",{className:"in-hp-human",style:{width:(A*(1-g)).toFixed(1)+"%"}})]}),o.jsx("span",{className:"in-hp-count",children:m.reads})]},m.path)})}),o.jsxs("p",{className:"in-legend",children:[o.jsx("span",{className:"in-sw agent"})," agent reads ",o.jsx("span",{className:"in-sw human"})," human reads"]})]})}function Qg({devices:i}){const c=new Map;for(const x of i)for(const[q,z]of Object.entries(x.folders||{}))c.set(q,(c.get(q)||0)+z);const r=[...c.entries()].sort((x,q)=>q[1]-x[1]).slice(0,12).map(x=>x[0]),f=i.slice(0,12),d=140,m=6,g=Math.min(76,Math.max(34,(720-d-8)/r.length)),A=26,p=720,y=m+f.length*A+58,M=Math.max(1,...f.flatMap(x=>r.map(q=>(x.folders||{})[q]||0))),E=x=>{const q=[23,25,31],z=[245,166,35],w=q.map((Y,$)=>Math.round(Y+(z[$]-Y)*x));return`rgb(${w[0]},${w[1]},${w[2]})`};return o.jsxs("svg",{viewBox:`0 0 ${p} ${y}`,className:"in-chart in-matrix",children:[f.map((x,q)=>{let z=x.name||x.id||"";return z.length>20&&(z=z.slice(0,19)+"…"),o.jsxs("g",{children:[o.jsx("text",{x:d-8,y:m+q*A+17,textAnchor:"end",className:"in-label",children:z}),r.map((w,Y)=>{const $=(x.folders||{})[w]||0;return o.jsx("rect",{x:d+Y*g,y:m+q*A,width:g-4,height:A-4,rx:3,fill:E(Math.sqrt($/M)),children:o.jsx("title",{children:`${x.name||x.id} × ${w||"(root)"}: ${$} read${$===1?"":"s"}/30d`})},w)})]},x.id||q)}),r.map((x,q)=>{const z=d+q*g+(g-4)/2,w=m+f.length*A+14;return o.jsx("text",{x:z,y:w,className:"in-label",textAnchor:"end",transform:`rotate(-28 ${z} ${w})`,children:x||"(root)"},x)})]})}function Bg(i){const{apiBase:c,target:r,isFolder:f,onMeta:d,onRendered:m}=i,g=r?f(r)?{prefix:r+"/"}:{path:r}:{prefix:""},A="path"in g&&g.path!==void 0?"path="+encodeURIComponent(g.path):"prefix="+encodeURIComponent(g.prefix??""),{data:p,error:y}=ge({queryKey:["history",c,A,200],queryFn:()=>Ce(c+"history?"+A+"&n=200"),staleTime:15e3});if(Q.useEffect(()=>{y&&d("History unavailable: "+y.message)},[y,d]),Q.useEffect(()=>{p&&m?.()},[p,m]),!p)return null;const M=p.entries||[];return o.jsxs("div",{className:"history",children:[M.length===0&&o.jsx("div",{className:"empty",children:"No history yet."}),M.map((E,x)=>o.jsx(pm,{entry:E,onOpen:i.onOpen},x))]})}function Lg(i,c){return i?c(i)?i+"/ (folder)":i:"all changes"}function gm(i){const{config:c,apiBase:r,route:f,hub:d,project:m}=i,g=hr(),A=ei(),{tree:p,flatFiles:y,dirIndex:M,loaded:E}=fg(r,!d||!!m),x=og(r,d&&!!m&&!!c.reads?.enabled),q=d&&!!m&&!f.path&&!f.view,z=!!i.canInsights&&(f.view==="insights"||q),w=Rg(r,z);Q.useEffect(()=>{z&&A.invalidateQueries({queryKey:["heat",r]})},[z,r,A]);const Y=f.path,$=!!Y&&M.has(Y),yt=!!Y&&E&&!$&&y.some(P=>P.path===Y),ot=!!Y&&E&&!$&&!yt,Ct=$&&!f.view,[Rt,et]=Q.useState(()=>new Set),k=Q.useRef(!0);Q.useEffect(()=>{if(!p||!k.current)return;k.current=!1;const P=(p.children||[]).filter(ft=>ft.dir);P.length===1&&et(ft=>new Set(ft).add(P[0].path))},[p]),Q.useEffect(()=>{if(!Y||!E)return;et(ft=>{const xt=new Set(ft);for(const $a of vg(Y))xt.add($a);return M.has(Y)&&xt.add(Y),xt});const P=document.querySelector(`#tree .row[data-path="${CSS.escape(Y)}"]`);P&&P.scrollIntoView({block:"nearest"})},[Y,E,M]);const gt=Q.useCallback(P=>{et(ft=>{const xt=new Set(ft);return xt.has(P)?xt.delete(P):xt.add(P),xt})},[]),wt=Q.useRef(null),ue=Q.useRef(new Map),le=Q.useRef({key:"",want:0,attempts:0});Q.useEffect(()=>{le.current={key:g,want:$p()==="POP"?ue.current.get(g)??0:0,attempts:0}},[g]);const _t=Q.useCallback(()=>{const P=wt.current,ft=le.current;!P||ft.key!==g||ft.attempts>=3||(ft.attempts++,P.scrollTo({top:ft.want,behavior:"instant"}))},[g]),ce=Q.useCallback(()=>{wt.current&&ue.current.set(g,wt.current.scrollTop)},[g]),Ut=Q.useCallback(P=>{pe(Fp(P,m?.id)),Fe()},[m?.id]),kt=Q.useCallback(P=>pe(Ja("history",m?.id,P)),[m?.id]),[D,B]=Q.useState(""),[V,vt]=Q.useState(null),[dt,S]=Q.useState(!1),[H,L]=Q.useState(!1),G=Q.useRef(null),J=i.panel??null,lt=!J&&d&&!!m&&yt,rt=!J&&d&&!!m,Vt=!J&&yt,Dt=!J&&(yt||d&&!!m&&$),Xl=r+"download?path="+encodeURIComponent(Y),ml=Q.useCallback(async()=>{try{const P=await fetch(r+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:Y})});if(!P.ok)throw new Error(await P.text());const ft=await P.json(),xt=await In(ft.url);vt({url:ft.url,copied:xt})}catch(P){st("Share failed: "+P.message,!0)}},[r,Y]),yl=Q.useCallback(()=>{if(!Y)return kt("");kt($?Y+"/":Y)},[Y,$,kt]);Q.useEffect(()=>{const P=ft=>{(ft.metaKey||ft.ctrlKey)&&ft.key.toLowerCase()==="k"&&(ft.preventDefault(),L(xt=>!xt))};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[]);const li=Q.useCallback(()=>{const P=[],ft=(xt,$a,Cu,ne)=>P.push({icon:xt,label:$a,kind:Cu,run:ne});if(d&&m&&Y&&(yt&&ft("share","Share: "+Y,"action",ml),ft("hist","History: "+Y,"action",yl),yt&&ft("download","Download: "+Y,"action",()=>G.current?.click())),d&&m&&ft("hist","History: whole project","action",()=>kt("")),d)for(const xt of i.projects||[])(!m||xt.id!==m.id)&&ft("folder","Switch to project: "+xt.name,"project",()=>pe("/"+xt.id));c.auth?.enabled&&ft("power","Sign out","action",()=>window.location.href="/auth/logout");for(const xt of M.keys())ft("folder",xt,"folder",()=>Ut(xt));for(const xt of y)ft("doc",xt.path,"file",()=>Ut(xt.path));return P},[d,m,Y,yt,c.auth?.enabled,M,y,i.projects,ml,yl,kt,Ut]);Q.useEffect(()=>{if(!dt)return;const P=()=>S(!1);return document.addEventListener("click",P),()=>document.removeEventListener("click",P)},[dt]);const ze=Q.useCallback(P=>M.has(P),[M]);let Ye="markdown",se;J?(Ye="view",se=J.body):f.view==="insights"?(Ye="view",se=i.canInsights?o.jsx(Kh,{flatFiles:y,heatMap:x,devices:w,scope:f.viewTarget||"",onOpenFile:Ut,onOpenFolder:Ut,isFolder:ze}):o.jsx("div",{className:"empty",children:"Insights is for hub admins and org owners."})):f.view==="history"?(Ye="view",se=o.jsx(Bg,{apiBase:r,target:f.viewTarget||"",isFolder:ze,onOpen:Ut,onMeta:B,onRendered:_t})):Y?E?ot?(Ye="view",se=o.jsxs("div",{className:"notfound",children:[o.jsx("h1",{children:"Couldn't find that"}),o.jsxs("p",{children:[o.jsx("code",{children:Y})," isn't in this project right now."]}),o.jsx("p",{className:"nf-sub",children:"If it was just created, it may still be uploading or syncing from a teammate's device — this page checks again automatically every few seconds, so refresh or come back in a moment."}),o.jsx("button",{className:"pbtn",onClick:()=>A.invalidateQueries({queryKey:["tree",r]}),children:"Check again"})]})):$?(Ye="view",se=o.jsx(Sg,{node:M.get(Y),heatMap:x,hub:d&&!!m,apiBase:r,onOpen:Ut,onFullHistory:kt,onRendered:_t})):se=o.jsx(jg,{apiBase:r,path:Y,heatMap:x,flatFiles:y,onOpenFile:Ut,onMeta:B,onRendered:_t}):se=o.jsx("div",{className:"empty",children:"Loading…"}):q?(Ye="view",se=o.jsxs(o.Fragment,{children:[o.jsx(ym,{project:m}),i.canInsights&&o.jsx("div",{className:"home-insights",children:o.jsx(Kh,{flatFiles:y,heatMap:x,devices:w,onOpenFile:Ut,onOpenFolder:Ut,isFolder:ze})})]})):se=o.jsx("div",{className:"empty",children:"Select a file to read it."});const Au=J?J.crumb:Y?o.jsx(pg,{path:Y,onOpenFolder:Ut}):f.view==="insights"?"Insights — "+(f.viewTarget||m?.name||""):f.view==="history"?"History — "+Lg(f.viewTarget||"",ze):q?m.name:null,ai=o.jsx(Wn,{crumb:Au,meta:D,actions:o.jsxs(o.Fragment,{children:[o.jsxs("button",{id:"search-btn",className:"btn ghost",title:"Search (⌘K)",onClick:()=>L(!0),children:[o.jsx(Zt,{name:"search"})," ",o.jsx("span",{className:"lbl",children:"Search"})," ",o.jsx("kbd",{children:"⌘K"})]}),lt&&o.jsx("button",{id:"share-btn",className:"btn icon-only",title:"Share","aria-label":"Share",onClick:ml,children:o.jsx(Zt,{name:"share"})}),rt&&!Y&&!f.view&&o.jsxs("button",{id:"history-btn",className:"btn",onClick:yl,children:[o.jsx(Zt,{name:"hist"})," ",o.jsx("span",{className:"lbl",children:"History"})]}),Vt&&o.jsx("a",{id:"download",hidden:!0,download:!0,href:Xl,ref:G,children:"Download"}),Dt&&o.jsx("button",{id:"more-btn",className:"btn icon-only",title:"More actions","aria-label":"More actions",onClick:P=>{P.stopPropagation(),S(!dt)},children:o.jsx(Zt,{name:"dots"})}),dt&&o.jsxs("div",{id:"more-menu",role:"menu",children:[rt&&o.jsx("button",{className:"more-item",onClick:yl,children:"History"}),Vt&&o.jsx("button",{className:"more-item",onClick:()=>G.current?.click(),children:"Download"}),i.canInsights&&o.jsx("button",{className:"more-item",onClick:()=>{i.onClosePanel?.(),pe(Ja("insights",m?.id,Y))},children:"Insights"})]})]})});return o.jsxs(o.Fragment,{children:[o.jsx($n,{vault:i.sidebar.vault,projectsNav:i.sidebar.projectsNav,orgBar:i.sidebar.orgBar,tree:o.jsx(mg,{root:p,expanded:Rt,onToggle:gt,currentPath:Y,listingShowing:Ct,onOpen:Ut}),topbar:ai,contentClass:Ye,contentRef:wt,onContentScroll:ce,children:se}),V&&o.jsx(Cg,{url:V.url,copied:V.copied,onClose:()=>vt(null)}),o.jsx(Dg,{open:H,onClose:()=>L(!1),candidates:li})]})}function Yg({config:i}){const c=hr(),r=sm(),[f,d]=Q.useState(null),[m,g]=Q.useState(null);Q.useEffect(()=>g(null),[c]);const A=Q.useMemo(()=>{const et=c.match(/^\/join\/([0-9a-f]+)\/?$/);return et?et[1]:null},[c]),{data:p}=kp(!A),{data:y}=Vp(!A),M=!!i.auth.admin,{data:E}=cm(M),x=Q.useMemo(()=>fm(c,"hub"),[c]),q=Q.useMemo(()=>p&&(p.find(et=>et.id===x.project)||f&&p.find(et=>et.org===f)||p[0])||null,[p,x.project,f]);if(Q.useEffect(()=>{document.title=q?q.name+" — BearDrive":i.brand||i.volume||"BearDrive"},[q,i]),A)return o.jsx(Gg,{token:A,onDone:async et=>{d(et),await r(),pe("/",{replace:!0})}});const z=i.brand||i.volume||"BearDrive",w=q&&y?.find(et=>et.id===q.org)||null,Y=M||(w?w.role==="owner":!1),$=o.jsx(Mu,{name:z,onHome:()=>pe("/")}),yt=i.me?o.jsx(ng,{me:i.me,org:w,admin:M?{pending:E?.length||0,onClick:()=>{g({kind:"hub"}),Fe()}}:void 0,onOrgSettings:et=>{g({kind:"org",orgId:et.id}),Fe()}}):void 0;if(!p||!y)return o.jsx($n,{vault:$,topbar:o.jsx(Wn,{}),children:o.jsx("div",{className:"empty",children:"Loading…"})});if(!q)return o.jsx($n,{vault:$,projectsNav:o.jsx(Yh,{projects:p}),orgBar:yt,topbar:o.jsx(Wn,{}),contentClass:"view",children:o.jsx(rg,{authEnabled:i.auth.enabled,onCreate:async et=>{if(!et){st("Give the project a name.",!0);return}try{const k=await Fa("/api/projects",{name:et});await r(),pe("/"+k.project.id),st(`Created “${k.project.name}”.`)}catch(k){st("Could not create the project: "+k.message,!0)}}})});const ot=m?.kind==="org"?y.find(et=>et.id===m.orgId):null,Ct=m?.kind==="hub"?{crumb:"Signup & access",body:o.jsx(ag,{})}:ot?{crumb:ot.name,body:o.jsx(lg,{org:ot,projects:p,myEmail:i.me?.email||"",onProjectsChanged:r})}:null,Rt=x.view==="settings"?{crumb:"Project settings",body:o.jsx(ig,{project:q,org:w})}:x.view==="install"?{crumb:"Installation",body:o.jsx("div",{className:"onboard",children:o.jsx(ym,{project:q})})}:null;return x.project!==q.id?o.jsx(Wp,{to:"/"+q.id}):o.jsx(gm,{config:i,apiBase:"/api/p/"+q.id+"/",route:x,hub:!0,project:q,projects:p,canInsights:Y,sidebar:{vault:$,projectsNav:o.jsx(Yh,{projects:p,currentId:q.id,menu:{active:m?null:x.view==="insights"?"dashboard":x.view==="install"?"install":x.view==="history"?"history":x.view==="settings"?"settings":null,onDashboard:()=>{g(null),pe(Ja("insights",q.id)),Fe()},onInstall:()=>{g(null),pe(Ja("install",q.id)),Fe()},onHistory:()=>{g(null),pe(Ja("history",q.id)),Fe()},onSettings:()=>{g(null),pe(Ja("settings",q.id)),Fe()}}}),orgBar:yt},panel:Ct||Rt,onClosePanel:()=>g(null)},q.id)}function Gg({token:i,onDone:c}){return Q.useEffect(()=>{let r=!1;return Fa("/api/invites/"+i).then(f=>{r||(st(`Welcome — you joined the “${f.org.name}” team. Opening its projects…`),c(f.org.id))}).catch(f=>{r||String(f.message).includes("signing in")||(st("Could not accept the invite: "+f.message,!0),c(null))}),()=>{r=!0}},[i]),o.jsx($n,{vault:o.jsx(Mu,{name:"BearDrive"}),topbar:o.jsx(Wn,{}),children:o.jsx("div",{className:"empty",children:"Joining…"})})}function Xg({config:i}){const c=hr(),r=i.volume||"BearDrive";Q.useEffect(()=>{document.title=i.brand||r},[i,r]);const f=Q.useMemo(()=>fm(c,"volume"),[c]);return o.jsx(gm,{config:i,apiBase:"/api/",route:f,hub:!1,sidebar:{vault:o.jsx(Mu,{name:r,showSignout:i.auth.enabled})}})}function Kg(){const{data:i}=R0();return o.jsxs(o.Fragment,{children:[i?i.mode==="hub"?o.jsx(Yg,{config:i}):o.jsx(Xg,{config:i}):o.jsx($n,{vault:o.jsx(Mu,{name:"…",showSignout:!1}),topbar:o.jsx(Wn,{}),children:o.jsx("div",{className:"empty",children:"Loading…"})}),o.jsx(Gp,{}),o.jsx(Xp,{})]})}const Zg=new S0({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});Jv.createRoot(document.getElementById("root")).render(o.jsx(Q.StrictMode,{children:o.jsx(x0,{client:Zg,children:o.jsx(Kg,{})})})); +bdrive init --project `+f},{title:"Connect "+i.label,desc:i.note,code:"bdrive hooks install --agent "+i.hook,extra:i.extra}]}function fg(){try{return localStorage.getItem("bdrive-guide-agent")||"claude"}catch{return"claude"}}function vm({project:i}){const[c,r]=Q.useState(fg),f=Fs.find(d=>d.key===c)||Fs[0];return o.jsxs("div",{className:"guide",children:[o.jsx("h1",{className:"in-title",children:i.name}),o.jsx("p",{className:"dl-sub",children:"Mount this project as a folder on any machine and connect your coding agent: files sync both ways in the background, every change is journaled with who made it, and agent reads feed Insights."}),o.jsx("div",{className:"gd-tabs",children:Fs.map(d=>o.jsx("button",{className:"gd-tab"+(d.key===f.key?" active":""),"data-key":d.key,onClick:()=>{r(d.key);try{localStorage.setItem("bdrive-guide-agent",d.key)}catch{}},children:d.label},d.key))}),o.jsxs("div",{className:"gd-body",children:[rg(f,i).map((d,m)=>o.jsxs("div",{className:"gd-step",children:[o.jsxs("div",{className:"gd-step-head",children:[o.jsx("span",{className:"gd-num",children:m+1}),o.jsx("span",{className:"gd-step-title",children:d.title})]}),d.desc&&o.jsx("p",{className:"gd-desc",children:d.desc}),d.code&&o.jsx(og,{code:d.code}),d.extra&&o.jsx("p",{className:"gd-desc gd-extra",children:d.extra})]},m)),o.jsx("p",{className:"gd-done",children:"That's it — the folder now syncs on its own. Every agent turn starts from the latest state, edits appear here (and on every teammate's mount) within seconds, and what your agents read shows up in Insights."})]})]})}function og({code:i}){const[c,r]=Q.useState("Copy");return o.jsxs("pre",{className:"gd-code",children:[o.jsx("code",{children:i}),o.jsx("button",{className:"gd-copy",onClick:async()=>{r(await In(i)?"Copied":"Copy failed"),setTimeout(()=>r("Copy"),1400)},children:c})]})}function dg({authEnabled:i,onCreate:c}){const r=Q.useRef(null),f=Q.useRef(null),d=()=>{const m=r.current.value.trim(),g=m.match(/join\/([0-9a-f]+)/)||m.match(/^([0-9a-f]{8,})$/);if(!g){st("That doesn't look like an invite link.",!0);return}location.href="/join/"+g[1]};return o.jsxs("div",{className:"onboard",children:[o.jsx("h1",{children:"Welcome to BearDrive"}),o.jsx("p",{children:"You're signed in, but you're not part of any project yet."}),i&&o.jsxs("div",{className:"ob-card",children:[o.jsx("h3",{children:"Have an invite link?"}),o.jsx("p",{children:"A teammate can send you a join link. Paste it here:"}),o.jsxs("div",{className:"ob-row",children:[o.jsx("input",{id:"ob-invite",type:"text",placeholder:"https://…/join/…",autoComplete:"off",ref:r}),o.jsx("button",{id:"ob-join",className:"pbtn",onClick:d,children:"Join"})]})]}),o.jsxs("div",{className:"ob-card",children:[o.jsx("h3",{children:"Or start a new project"}),o.jsx("p",{children:"Create a shared space for your team's files."}),o.jsxs("div",{className:"ob-row",children:[o.jsx("input",{id:"ob-name",type:"text",placeholder:"Project name, e.g. wiki",autoComplete:"off",ref:f}),o.jsx("button",{id:"ob-create",className:"pbtn",onClick:()=>c(f.current.value.trim()),children:"Create"})]})]})]})}function hg(i,c=!0){const r=ge({queryKey:["tree",i],queryFn:()=>Ce(i+"tree"),enabled:c,refetchInterval:15e3}),f=Q.useMemo(()=>{const d=[],m=new Map,g=A=>{for(const p of A.children||[])p.dir?(m.set(p.path,p),g(p)):d.push(p)};return r.data&&g(r.data),{flatFiles:d,dirIndex:m}},[r.data]);return{tree:r.data,...f,loaded:!!r.data}}function mg(i,c){return ge({queryKey:["heat",i],queryFn:()=>Ce(i+"heat?days=30"),enabled:c,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function yg(i,c,r){return ge({queryKey:["history",i,"prefix",c,20],queryFn:()=>Ce(i+"history?prefix="+encodeURIComponent(c)+"&n=20"),enabled:r,staleTime:15e3}).data?.entries??null}function Xh(i,c,r){if(!i)return null;if(!r)return i[c]||null;const f={human:0,agent:0,share:0};for(const[d,m]of Object.entries(i))d.startsWith(c+"/")&&(f.human+=m.human||0,f.agent+=m.agent||0,f.share+=m.share||0);return f.human||f.agent||f.share?f:null}function Pn(i){return(i.human||0)+(i.agent||0)+(i.share||0)}function Nu(i){const c=Pn(i);if(!c)return"";let r=c+(c===1?" read":" reads");return i.agent&&(r+=" ("+i.agent+" agent)"),r}function vg(i){const c=Pn(i);return c?c<3?1:c<10?2:c<30?3:4:0}function pg(i){return o.jsx("nav",{id:"tree","aria-label":"Files",children:i.root&&o.jsx(pm,{nodes:i.root.children||[],...i})})}function pm({nodes:i,...c}){return o.jsx("ul",{children:i.map(r=>o.jsx(gg,{node:r,...c},r.path))})}function gg({node:i,...c}){const{expanded:r,onToggle:f,currentPath:d,listingShowing:m,onOpen:g}=c,A=i.dir?r.has(i.path):!1,p=()=>{if(i.dir&&d===i.path&&m){f(i.path);return}g(i.path),i.dir||Ze()};return o.jsxs("li",{className:(i.dir?"dir":"file")+(i.dir&&!A?" collapsed":""),children:[o.jsxs("div",{className:"row"+(d===i.path?" active":""),"data-path":i.path,tabIndex:0,role:"button",title:i.name,"aria-expanded":i.dir?A:void 0,onClick:p,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),p())},children:[o.jsx("span",{className:"chev",onClick:y=>{i.dir&&(y.stopPropagation(),f(i.path))},children:o.jsx(Zt,{name:"chevd"})}),o.jsx("span",{className:"ticon",children:o.jsx(Zt,{name:i.dir?"folder":"doc"})}),o.jsx("span",{className:"label",children:i.name})]}),i.dir&&o.jsx(pm,{nodes:i.children||[],...c})]})}function bg(i){const c=i.split("/"),r=[];let f="";for(let d=0;d{f=f?f+"/"+d:d;const g=f,A=m===r.length-1;return o.jsxs("span",{children:[m>0&&o.jsx("span",{className:"crumb-sep",children:"/"}),A?o.jsx("span",{children:d}):o.jsx("span",{className:"crumb-seg",title:g,onClick:()=>c(g),children:d})]},g)})})}const xg={add:"plus",edit:"edit",delete:"x"},jg={add:"added",edit:"edited",delete:"deleted"};function gm({entry:i,onOpen:c}){const[r,f]=Q.useState(!1),d=i.kind==="put"?"edit":i.kind,m=i.user_name?`${i.user_name} <${i.user}>`:i.user||i.author||"unknown",g=[i.device.name||i.device.id,i.device.os,i.device.ip].filter(Boolean).join(" · "),A=d!=="delete",p=y=>{y.target.tagName!=="A"&&A&&c(i.path)};return o.jsxs("div",{className:"hentry "+d+(A?" clickable":""),tabIndex:A?0:void 0,role:A?"button":void 0,onClick:p,onKeyDown:y=>{A&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),c(i.path))},children:[o.jsxs("div",{className:"hline",children:[o.jsx("span",{className:"hkind",children:o.jsx(Zt,{name:xg[d]||"dot"})}),o.jsx("span",{className:"hpath",children:i.path}),o.jsx("span",{className:"htag",children:jg[d]||d}),o.jsx("span",{className:"htime",children:new Date(i.time).toLocaleString()})]}),o.jsxs("div",{className:"hmeta",children:[o.jsx("span",{className:"hwho",children:m}),o.jsx("span",{className:"hdev",children:g}),o.jsx("span",{className:"hsize",children:i.size?hm(i.size):""})]}),i.note&&o.jsx("div",{className:"hnote"+(r?" open":""),tabIndex:0,role:"button",title:r?"Collapse note":"Show full note","aria-expanded":r,onClick:y=>{y.stopPropagation(),y.target.tagName!=="A"&&f(!r)},onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),y.stopPropagation(),f(!r))},children:i.note.split(/(https?:\/\/\S+)/).map((y,M)=>/^https?:\/\//.test(y)?o.jsx("a",{href:y,target:"_blank",rel:"noopener",children:y},M):y)})]})}function Eg(i){const{node:c,heatMap:r,onOpen:f}=i,d=(c.children||[]).slice().sort((y,M)=>Number(M.dir||!1)-Number(y.dir||!1)||y.name.localeCompare(M.name)),m=d.filter(y=>y.dir).length,g=d.length-m,A=[];m&&A.push(m+(m===1?" folder":" folders")),g&&A.push(g+(g===1?" file":" files"));const p=Xh(r,c.path,!0);return p&&A.push(Nu(p)+" in 30 days"),o.jsxs("div",{className:"dirlist",children:[o.jsxs("h1",{className:"dl-title",children:[o.jsx("span",{className:"dl-title-icon",children:o.jsx(Zt,{name:"folder"})}),o.jsx("span",{children:c.name})]}),o.jsx("p",{className:"dl-sub",children:A.join(" · ")||"Empty folder"}),d.length===0?o.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):o.jsx("div",{className:"dl-items",children:d.map(y=>{let M="";if(y.dir){const x=(y.children||[]).length;M=x+(x===1?" item":" items")}else M=[y.size?hm(y.size):"",y.time?new Date(y.time).toLocaleDateString():""].filter(Boolean).join(" · ");const E=Xh(r,y.path,!!y.dir);return E&&(M=Nu(E)+(M?" · "+M:"")),o.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:y.path,onClick:()=>f(y.path),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f(y.path))},children:[o.jsx("span",{className:"ticon",children:o.jsx(Zt,{name:y.dir?"folder":"doc"})}),o.jsx("span",{className:"dl-name",children:y.name}),E&&o.jsx("span",{className:"heatdot lvl"+vg(E),title:Nu(E)+" in 30 days"}),o.jsx("span",{className:"dl-meta",children:M})]},y.path)})}),i.hub&&o.jsx(Tg,{apiBase:i.apiBase,prefix:c.path+"/",onOpen:f,onFullHistory:()=>i.onFullHistory(c.path+"/"),onRendered:i.onRendered})]})}function Tg(i){const c=yg(i.apiBase,i.prefix,!0),{onRendered:r}=i;return Q.useEffect(()=>{c&&c.length&&r&&r()},[c,r]),!c||c.length===0?null:o.jsxs("div",{className:"dl-history",children:[o.jsx("h3",{className:"dl-h3",children:"Recent changes"}),o.jsx("div",{className:"history dl-hlist",children:c.map((f,d)=>o.jsx(gm,{entry:f,onOpen:i.onOpen},d))}),o.jsx("button",{className:"ai-btn dl-more",onClick:i.onFullHistory,children:"Full history"})]})}function Ng(i){const{apiBase:c,path:r,onMeta:f}=i,d=c+"file?path="+encodeURIComponent(r);return Q.useEffect(()=>()=>f(""),[r,f]),eg.test(r)?o.jsx(Og,{...i}):ag.test(r)?o.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:d,title:r,onLoad:i.onRendered}):lg.test(r)?o.jsx(Cg,{src:d,alt:r,onRendered:i.onRendered}):ng.test(r)?o.jsx(zg,{...i,fileURL:d}):o.jsxs("div",{className:"filecard",children:[o.jsx("div",{className:"name",children:r.split("/").pop()}),o.jsx("p",{children:"No preview for this file type."}),o.jsx("a",{className:"btn",download:!0,href:c+"download?path="+encodeURIComponent(r),children:"Download"})]})}function Og(i){const{apiBase:c,path:r,heatMap:f,flatFiles:d,onOpenFile:m,onMeta:g,onRendered:A}=i,{data:p,error:y}=ge({queryKey:["render",c,r],queryFn:()=>Ce(c+"render?path="+encodeURIComponent(r))}),M=Q.useMemo(()=>p?Ag(p.html,r,c):"",[p,r,c]);return Q.useEffect(()=>{if(!p)return;const E=[];p.author&&E.push(p.author+(p.device?" on "+p.device:"")),p.time&&E.push(new Date(p.time).toLocaleString());const x=f&&f[p.path];x&&Pn(x)&&E.push(Nu(x)+" / 30d"),g(E.join(" · ")),A?.()},[p,f,g,A]),y?o.jsxs("div",{className:"empty",children:["Could not load file: ",y.message]}):p?o.jsx("div",{dangerouslySetInnerHTML:{__html:M},onClick:E=>Mg(E,r,d,m)}):null}function Mg(i,c,r,f){const d=i.target.closest("a");if(!d||!i.currentTarget.contains(d))return;const m=d.getAttribute("href")||"",g=c.includes("/")?c.slice(0,c.lastIndexOf("/")):"";m.startsWith("wiki:")?(i.preventDefault(),_g(decodeURIComponent(m.slice(5)),r,f)):/^([a-z]+:|\/|#)/i.test(m)||(i.preventDefault(),f(mm(g,decodeURIComponent(m))))}function Ag(i,c,r){const f=c.includes("/")?c.slice(0,c.lastIndexOf("/")):"",d=g=>r+"file?path="+encodeURIComponent(g),m=new DOMParser().parseFromString(i,"text/html");for(const g of m.querySelectorAll("img")){const A=g.getAttribute("src")||"";/^([a-z]+:|\/)/i.test(A)||g.setAttribute("src",d(mm(f,A)))}for(const g of m.querySelectorAll("a")){const A=g.getAttribute("href")||"";/^https?:/i.test(A)&&(g.setAttribute("target","_blank"),g.setAttribute("rel","noopener"))}return m.body.innerHTML}function Cg({src:i,alt:c,onRendered:r}){return o.jsx("img",{src:i,alt:c,onLoad:r})}function zg(i){const{path:c,fileURL:r,onRendered:f}=i,{data:d,error:m}=ge({queryKey:["text",r],queryFn:async()=>{const g=await fetch(r);if(!g.ok)throw new Error(await g.text());return g.text()}});return Q.useEffect(()=>{d!=null&&f?.()},[d,f]),m?o.jsxs("div",{className:"empty",children:["Could not load file: ",m.message]}):d==null?null:o.jsx("pre",{className:"plain",children:d},c)}function _g(i,c,r){const f=i.toLowerCase(),d=c.find(m=>m.path.toLowerCase()===f||m.path.toLowerCase()===f+".md")||c.find(m=>{const g=m.name.toLowerCase();return g===f||g===f+".md"});d&&r(d.path)}function Dg({url:i,copied:c,onClose:r}){const f=i.split("/s/")[1];return Q.useEffect(()=>{const d=m=>{m.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[r]),o.jsx("div",{className:"modal-back",onClick:d=>d.target===d.currentTarget&&r(),children:o.jsxs("div",{className:"modal",children:[o.jsx("h3",{children:"Public link created"}),o.jsxs("p",{children:[o.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until you revoke it."]}),o.jsx("div",{className:"modal-url",children:i}),o.jsxs("div",{className:"modal-actions",children:[o.jsx("button",{className:"pbtn",onClick:()=>In(i).then(d=>st(d?"Copied.":"Select and copy the link above.")),children:c?"Copied ✓":"Copy link"}),o.jsx("button",{className:"ai-btn",onClick:()=>window.open(i,"_blank"),children:"Open"}),o.jsx("button",{className:"ai-del",onClick:async()=>{try{await Yl("DELETE","/api/shares/"+f),st("Link revoked — it no longer works."),r()}catch(d){st(d.message,!0)}},children:"Revoke"}),o.jsx("button",{className:"ai-btn",onClick:r,children:"Done"})]})]})})}function Kh(i,c){if(!i)return{score:0,hits:[]};const r=i.toLowerCase(),f=c.toLowerCase();let d=0,m=0,g=0;const A=[];for(let p=0;p3&&f.endsWith("ies")?d=f.slice(0,-3)+"y":f.length>3&&f.endsWith("es")?d=f.slice(0,-2):f.length>2&&f.endsWith("s")&&(d=f.slice(0,-1)),d?Kh(d,c):null}function Ug({text:i,hits:c}){const r=[];let f=0;return c.forEach((d,m)=>{d>f&&r.push(i.slice(f,d)),r.push(o.jsx("b",{children:i[d]},m)),f=d+1}),r.push(i.slice(f)),o.jsx("span",{className:"plabel",children:r})}function Hg({open:i,onClose:c,candidates:r}){const[f,d]=Q.useState(""),[m,g]=Q.useState(0),A=Q.useRef(null),p=Q.useRef(null),y=Q.useMemo(()=>{if(!i)return[];const E=[];for(const x of r()){const q=Rg(f,x.label);q&&E.push({...x,score:q.score,hits:q.hits})}return E.sort((x,q)=>q.score-x.score),E.slice(0,40)},[i,f,r]);Q.useEffect(()=>{i&&(d(""),g(0),A.current?.focus())},[i]),Q.useEffect(()=>g(0),[f]),Q.useEffect(()=>{p.current?.children[m]?.scrollIntoView({block:"nearest"})},[m,y]);const M=E=>{c(),E.run()};return Q.useEffect(()=>{if(!i)return;const E=x=>{if(x.key==="Escape")x.preventDefault(),c();else if(x.key==="ArrowDown"||x.key==="ArrowUp"){x.preventDefault();const q=y.length;q&&g(z=>(z+(x.key==="ArrowDown"?1:q-1))%q)}else x.key==="Enter"&&(x.preventDefault(),y[m]&&M(y[m]))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[i,y,m]),i?o.jsx("div",{id:"palette-overlay",onClick:E=>E.target===E.currentTarget&&c(),children:o.jsxs("div",{id:"palette",role:"dialog","aria-label":"Search and quick actions",children:[o.jsxs("div",{id:"palette-inputwrap",children:[o.jsx(Zt,{name:"search"}),o.jsx("input",{id:"palette-input",type:"text",placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,ref:A,value:f,onChange:E=>d(E.target.value)})]}),o.jsx("ul",{id:"palette-results",ref:p,children:y.length===0?o.jsx("li",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):y.map((E,x)=>o.jsxs("li",{className:x===m?"selected":void 0,onClick:()=>M(E),onMouseMove:()=>m!==x&&g(x),children:[o.jsx("span",{className:"picon",children:o.jsx(Zt,{name:E.icon})}),o.jsx(Ug,{text:E.label,hits:E.hits}),o.jsx("span",{className:"pkind",children:E.kind})]},E.kind+":"+E.label))}),o.jsx("footer",{id:"palette-hint",children:"↑↓ navigate · ⏎ select · esc close"})]})}):null}const kn=3,Va=30;function qg(i,c){return ge({queryKey:["heatDevices",i],queryFn:()=>Ce(i+"heat?by=device&days=30"),enabled:c,retry:!1,staleTime:6e4}).data?.devices??null}function Zh(i){const[c,r]=Q.useState("all"),{flatFiles:f,heatMap:d,devices:m,scope:g}=i,A=x=>!g||x===g||x.startsWith(g+"/"),p=g?f.filter(x=>A(x.path)):f,y=m&&g?m.map(x=>{const q={};for(const[z,w]of Object.entries(x.folders||{}))A(z)&&(q[z]=w);return{...x,folders:q}}).filter(x=>Object.keys(x.folders).length>0):m,M=Date.now(),E=p.map(x=>{const q=d&&d[x.path]||{},z=x.time?Math.max(0,(M-new Date(x.time).getTime())/864e5):0,w=c==="all"?Pn(q):q[c]||0;return{path:x.path,reads:w,agent:q.agent||0,total:Pn(q),days:z,danger:w>=kn&&z>=Va}});return o.jsxs("div",{className:"insights",children:[o.jsxs("h1",{className:"in-title",children:["Knowledge insights",g?o.jsxs("span",{className:"in-scope",children:[" · ",g]}):null]}),o.jsx("p",{className:"dl-sub",children:g?`Reads over the last 30 days × freshness, for ${g} and everything in it.`:"Reads over the last 30 days × how long since each file changed. Hot but stale knowledge — read a lot, maintained by nobody — is the danger zone."}),o.jsx("div",{className:"in-lens",children:["all","human","agent"].map(x=>o.jsx("button",{className:"in-lens-btn"+(x===c?" active":""),onClick:()=>r(x),children:x==="all"?"All reads":x==="human"?"Human reads":"Agent reads"},x))}),o.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness"}),o.jsx(Qg,{pts:E,onOpenFile:i.onOpenFile,onOpenFolder:i.onOpenFolder,isFolder:i.isFolder}),o.jsx("h3",{className:"dl-h3",children:"Reads × freshness"}),o.jsx(Bg,{pts:E,onOpenFile:i.onOpenFile}),o.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),o.jsx(Lg,{pts:E,lens:c,onOpenFile:i.onOpenFile}),y&&y.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),o.jsx(Yg,{devices:y})]})]})}function wg(i){const c=[[76,195,138],[232,196,84],[224,93,93]],r=Math.min(1,Math.max(0,i/300))*(c.length-1),f=Math.min(c.length-2,Math.floor(r)),d=r-f,m=c[f].map((g,A)=>Math.round(g+(c[f+1][A]-g)*d));return`rgb(${m[0]},${m[1]},${m[2]})`}function kh(i,c,r,f,d){const m=i.reduce((y,M)=>y+M.value,0);if(!m||f<=0||d<=0)return[];const g=i.slice().sort((y,M)=>M.value-y.value).map(y=>({it:y,a:y.value/m*f*d})),A=(y,M)=>{const x=y.reduce((z,w)=>z+w.a,0)/M;let q=0;for(const z of y){const w=z.a/x;q=Math.max(q,w/x,x/w)}return q},p=[];for(;g.length;){const y=f>=d,M=y?d:f,E=[g.shift()];for(;g.length&&A(E.concat(g[0]),M)<=A(E,M);)E.push(g.shift());const x=E.reduce((z,w)=>z+w.a,0)/M;let q=0;for(const z of E){const w=z.a/x;y?p.push({item:z.it,x:c,y:r+q,w:x,h:w}):p.push({item:z.it,x:c+q,y:r,w,h:x}),q+=w}y?(c+=x,f-=x):(r+=x,d-=x)}return p}const $s=15;function Qg({pts:i,onOpenFile:c,onOpenFolder:r,isFolder:f}){const g=new Map;for(const p of i){const y=p.path.includes("/")?p.path.split("/")[0]:"/";let M=g.get(y);M||g.set(y,M={name:y,files:[],value:0}),M.files.push(p),M.value+=p.reads+1}const A=[];for(const p of kh([...g.values()],0,0,720,480)){const y=p.item,M=y.name==="/"?"":y.name;if(A.push(o.jsx("rect",{x:p.x+1,y:p.y+1,width:Math.max(0,p.w-2),height:Math.max(0,p.h-2),rx:3,className:"in-tm-group","data-dir":M},"g"+y.name)),p.w>46&&p.h>$s+10){let x=y.name==="/"?"(root)":y.name;const q=Math.floor((p.w-8)/6);x.length>q&&(x=x.slice(0,Math.max(1,q-1))+"…"),A.push(o.jsx("text",{x:p.x+5,y:p.y+12,className:"in-tm-glabel","data-dir":M,children:x},"gl"+y.name))}const E=kh(y.files.map(x=>({...x,name:x.path.split("/").pop(),value:x.reads+1})),p.x+2,p.y+$s,Math.max(0,p.w-4),Math.max(0,p.h-$s-2));for(const x of E)if(A.push(o.jsx("rect",{x:x.x+.6,y:x.y+.6,width:Math.max(.4,x.w-1.2),height:Math.max(.4,x.h-1.2),rx:1.5,fill:wg(x.item.days),className:"in-tm-cell","data-path":x.item.path,children:o.jsx("title",{children:`${x.item.path} — ${x.item.reads} read${x.item.reads===1?"":"s"}/30d · changed ${Math.round(x.item.days)}d ago`})},x.item.path)),x.w>54&&x.h>16){const q=Math.floor((x.w-8)/6);let z=(x.item.danger?"⚠ ":"")+x.item.name;z.length>q&&(z=z.slice(0,Math.max(1,q-1))+"…"),q>=5&&A.push(o.jsx("text",{x:x.x+4.5,y:x.y+12.5,className:"in-tm-label","data-path":x.item.path,children:z},"l"+x.item.path))}}return o.jsx("svg",{viewBox:"0 0 720 480",className:"in-chart in-treemap",onClick:p=>{const y=p.target.closest("[data-path], [data-dir]");if(!y)return;const M=y.getAttribute("data-path");if(M)return c(M);const E=y.getAttribute("data-dir");E&&f(E)&&r(E)},children:A})}function Bg({pts:i,onOpenFile:c}){const d={l:44,r:16,t:20,b:34},m=Math.max(Va*2,...i.map(E=>E.days)),g=Math.max(kn*2,...i.map(E=>E.reads)),A=E=>Math.log10(E+1)/Math.log10(m+1),p=E=>Math.log10(E+1)/Math.log10(g+1),y=E=>d.l+A(E)*(720-d.l-d.r),M=E=>360-d.b-p(E)*(360-d.t-d.b);return o.jsxs("svg",{viewBox:"0 0 720 360",className:"in-chart",children:[o.jsx("rect",{x:y(Va),y:d.t,width:720-d.r-y(Va),height:M(kn)-d.t,className:"in-danger-zone"}),o.jsx("line",{x1:y(Va),y1:d.t,x2:y(Va),y2:360-d.b,className:"in-threshold"}),o.jsx("line",{x1:d.l,y1:M(kn),x2:720-d.r,y2:M(kn),className:"in-threshold"}),o.jsx("line",{x1:d.l,y1:360-d.b,x2:720-d.r,y2:360-d.b,className:"in-axis"}),o.jsx("line",{x1:d.l,y1:d.t,x2:d.l,y2:360-d.b,className:"in-axis"}),o.jsx("text",{x:(d.l+720-d.r)/2,y:352,className:"in-label",children:"days since last change →"}),o.jsx("text",{x:12,y:(d.t+360-d.b)/2,className:"in-label",transform:`rotate(-90 12 ${(d.t+360-d.b)/2})`,children:"reads / 30d →"}),o.jsx("text",{x:720-d.r-6,y:d.t+14,className:"in-quad in-quad-danger",textAnchor:"end",children:"hot + stale"}),o.jsx("text",{x:d.l+6,y:d.t+14,className:"in-quad",children:"hot + fresh"}),o.jsx("text",{x:720-d.r-6,y:360-d.b-8,className:"in-quad",textAnchor:"end",children:"cold + stale"}),o.jsx("text",{x:720-d.r-6,y:d.t+28,className:"in-label",textAnchor:"end",children:"dot size = agent share of reads"}),i.map(E=>{const x=E.total?(E.agent||0)/E.total:0;return o.jsx("circle",{cx:Number(y(E.days).toFixed(1)),cy:Number(M(E.reads).toFixed(1)),r:Number((3+4*x).toFixed(1)),className:"in-pt"+(E.danger?" danger":E.reads?"":" cold"),onClick:()=>c(E.path),children:o.jsx("title",{children:`${E.path} — ${E.reads} read${E.reads===1?"":"s"} / 30d · changed ${Math.round(E.days)}d ago`})},E.path)})]})}function Lg({pts:i,lens:c,onOpenFile:r}){const f=i.filter(m=>m.reads>0).sort((m,g)=>g.reads-m.reads||g.days-m.days).slice(0,20);if(!f.length)return o.jsx("div",{className:"dl-empty",children:"No reads in the window yet."});const d=f[0].reads;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"in-hotpath",children:f.map(m=>{const g=c==="agent"?1:c==="human"?0:m.total?m.agent/m.total:0,A=m.reads/d*100;return o.jsxs("div",{className:"in-hp-row",tabIndex:0,role:"button",title:m.danger?`${m.reads} read${m.reads===1?"":"s"}/30d · unchanged ${Math.round(m.days)}d — review this file`:m.path,onClick:()=>r(m.path),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),r(m.path))},children:[o.jsx("span",{className:"in-hp-name"+(m.danger?" danger":""),children:m.path+(m.danger?" ⚠":"")}),o.jsxs("span",{className:"in-hp-bar",children:[o.jsx("span",{className:"in-hp-agent",style:{width:(A*g).toFixed(1)+"%"}}),o.jsx("span",{className:"in-hp-human",style:{width:(A*(1-g)).toFixed(1)+"%"}})]}),o.jsx("span",{className:"in-hp-count",children:m.reads})]},m.path)})}),o.jsxs("p",{className:"in-legend",children:[o.jsx("span",{className:"in-sw agent"})," agent reads ",o.jsx("span",{className:"in-sw human"})," human reads"]})]})}function Yg({devices:i}){const c=new Map;for(const x of i)for(const[q,z]of Object.entries(x.folders||{}))c.set(q,(c.get(q)||0)+z);const r=[...c.entries()].sort((x,q)=>q[1]-x[1]).slice(0,12).map(x=>x[0]),f=i.slice(0,12),d=140,m=6,g=Math.min(76,Math.max(34,(720-d-8)/r.length)),A=26,p=720,y=m+f.length*A+58,M=Math.max(1,...f.flatMap(x=>r.map(q=>(x.folders||{})[q]||0))),E=x=>{const q=[23,25,31],z=[245,166,35],w=q.map((Y,$)=>Math.round(Y+(z[$]-Y)*x));return`rgb(${w[0]},${w[1]},${w[2]})`};return o.jsxs("svg",{viewBox:`0 0 ${p} ${y}`,className:"in-chart in-matrix",children:[f.map((x,q)=>{let z=x.name||x.id||"";return z.length>20&&(z=z.slice(0,19)+"…"),o.jsxs("g",{children:[o.jsx("text",{x:d-8,y:m+q*A+17,textAnchor:"end",className:"in-label",children:z}),r.map((w,Y)=>{const $=(x.folders||{})[w]||0;return o.jsx("rect",{x:d+Y*g,y:m+q*A,width:g-4,height:A-4,rx:3,fill:E(Math.sqrt($/M)),children:o.jsx("title",{children:`${x.name||x.id} × ${w||"(root)"}: ${$} read${$===1?"":"s"}/30d`})},w)})]},x.id||q)}),r.map((x,q)=>{const z=d+q*g+(g-4)/2,w=m+f.length*A+14;return o.jsx("text",{x:z,y:w,className:"in-label",textAnchor:"end",transform:`rotate(-28 ${z} ${w})`,children:x||"(root)"},x)})]})}function Gg(i){const{apiBase:c,target:r,isFolder:f,onMeta:d,onRendered:m}=i,g=r?f(r)?{prefix:r+"/"}:{path:r}:{prefix:""},A="path"in g&&g.path!==void 0?"path="+encodeURIComponent(g.path):"prefix="+encodeURIComponent(g.prefix??""),{data:p,error:y}=ge({queryKey:["history",c,A,200],queryFn:()=>Ce(c+"history?"+A+"&n=200"),staleTime:15e3});if(Q.useEffect(()=>{y&&d("History unavailable: "+y.message)},[y,d]),Q.useEffect(()=>{p&&m?.()},[p,m]),!p)return null;const M=p.entries||[];return o.jsxs("div",{className:"history",children:[M.length===0&&o.jsx("div",{className:"empty",children:"No history yet."}),M.map((E,x)=>o.jsx(gm,{entry:E,onOpen:i.onOpen},x))]})}function Xg(i,c){return i?c(i)?i+"/ (folder)":i:"all changes"}function bm(i){const{config:c,apiBase:r,route:f,hub:d,project:m}=i,g=mr(),A=ei(),{tree:p,flatFiles:y,dirIndex:M,loaded:E}=hg(r,!d||!!m),x=mg(r,d&&!!m&&!!c.reads?.enabled),q=d&&!!m&&!f.path&&!f.view,z=!!i.canInsights&&(f.view==="insights"||q),w=qg(r,z);Q.useEffect(()=>{z&&A.invalidateQueries({queryKey:["heat",r]})},[z,r,A]);const Y=f.path,$=!!Y&&M.has(Y),yt=!!Y&&E&&!$&&y.some(P=>P.path===Y),ot=!!Y&&E&&!$&&!yt,Ct=$&&!f.view,[Rt,et]=Q.useState(()=>new Set),k=Q.useRef(!0);Q.useEffect(()=>{if(!p||!k.current)return;k.current=!1;const P=(p.children||[]).filter(ft=>ft.dir);P.length===1&&et(ft=>new Set(ft).add(P[0].path))},[p]),Q.useEffect(()=>{if(!Y||!E)return;et(ft=>{const xt=new Set(ft);for(const $a of bg(Y))xt.add($a);return M.has(Y)&&xt.add(Y),xt});const P=document.querySelector(`#tree .row[data-path="${CSS.escape(Y)}"]`);P&&P.scrollIntoView({block:"nearest"})},[Y,E,M]);const gt=Q.useCallback(P=>{et(ft=>{const xt=new Set(ft);return xt.has(P)?xt.delete(P):xt.add(P),xt})},[]),wt=Q.useRef(null),ue=Q.useRef(new Map),le=Q.useRef({key:"",want:0,attempts:0});Q.useEffect(()=>{le.current={key:g,want:Pp()==="POP"?ue.current.get(g)??0:0,attempts:0}},[g]);const _t=Q.useCallback(()=>{const P=wt.current,ft=le.current;!P||ft.key!==g||ft.attempts>=3||(ft.attempts++,P.scrollTo({top:ft.want,behavior:"instant"}))},[g]),ce=Q.useCallback(()=>{wt.current&&ue.current.set(g,wt.current.scrollTop)},[g]),Ut=Q.useCallback(P=>{pe(Ip(P,m?.id)),Ze()},[m?.id]),kt=Q.useCallback(P=>pe(Ja("history",m?.id,P)),[m?.id]),[D,B]=Q.useState(""),[V,vt]=Q.useState(null),[dt,S]=Q.useState(!1),[H,L]=Q.useState(!1);Q.useEffect(()=>H0(()=>L(!0)),[]);const G=Q.useRef(null),J=i.panel??null,lt=!J&&d&&!!m&&yt,rt=!J&&d&&!!m,Vt=!J&&yt,Dt=!J&&(yt||d&&!!m&&$),Xl=r+"download?path="+encodeURIComponent(Y),ml=Q.useCallback(async()=>{try{const P=await fetch(r+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:Y})});if(!P.ok)throw new Error(await P.text());const ft=await P.json(),xt=await In(ft.url);vt({url:ft.url,copied:xt})}catch(P){st("Share failed: "+P.message,!0)}},[r,Y]),yl=Q.useCallback(()=>{if(!Y)return kt("");kt($?Y+"/":Y)},[Y,$,kt]);Q.useEffect(()=>{const P=ft=>{(ft.metaKey||ft.ctrlKey)&&ft.key.toLowerCase()==="k"&&(ft.preventDefault(),L(xt=>!xt))};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[]);const li=Q.useCallback(()=>{const P=[],ft=(xt,$a,Cu,ne)=>P.push({icon:xt,label:$a,kind:Cu,run:ne});if(d&&m&&Y&&(yt&&ft("share","Share: "+Y,"action",ml),ft("hist","History: "+Y,"action",yl),yt&&ft("download","Download: "+Y,"action",()=>G.current?.click())),d&&m&&ft("hist","History: whole project","action",()=>kt("")),d)for(const xt of i.projects||[])(!m||xt.id!==m.id)&&ft("folder","Switch to project: "+xt.name,"project",()=>pe("/"+xt.id));c.auth?.enabled&&ft("power","Sign out","action",()=>window.location.href="/auth/logout");for(const xt of M.keys())ft("folder",xt,"folder",()=>Ut(xt));for(const xt of y)ft("doc",xt.path,"file",()=>Ut(xt.path));return P},[d,m,Y,yt,c.auth?.enabled,M,y,i.projects,ml,yl,kt,Ut]);Q.useEffect(()=>{if(!dt)return;const P=()=>S(!1);return document.addEventListener("click",P),()=>document.removeEventListener("click",P)},[dt]);const ze=Q.useCallback(P=>M.has(P),[M]);let Ye="markdown",se;J?(Ye="view",se=J.body):f.view==="insights"?(Ye="view",se=i.canInsights?o.jsx(Zh,{flatFiles:y,heatMap:x,devices:w,scope:f.viewTarget||"",onOpenFile:Ut,onOpenFolder:Ut,isFolder:ze}):o.jsx("div",{className:"empty",children:"Insights is for hub admins and org owners."})):f.view==="history"?(Ye="view",se=o.jsx(Gg,{apiBase:r,target:f.viewTarget||"",isFolder:ze,onOpen:Ut,onMeta:B,onRendered:_t})):Y?E?ot?(Ye="view",se=o.jsxs("div",{className:"notfound",children:[o.jsx("h1",{children:"Couldn't find that"}),o.jsxs("p",{children:[o.jsx("code",{children:Y})," isn't in this project right now."]}),o.jsx("p",{className:"nf-sub",children:"If it was just created, it may still be uploading or syncing from a teammate's device — this page checks again automatically every few seconds, so refresh or come back in a moment."}),o.jsx("button",{className:"pbtn",onClick:()=>A.invalidateQueries({queryKey:["tree",r]}),children:"Check again"})]})):$?(Ye="view",se=o.jsx(Eg,{node:M.get(Y),heatMap:x,hub:d&&!!m,apiBase:r,onOpen:Ut,onFullHistory:kt,onRendered:_t})):se=o.jsx(Ng,{apiBase:r,path:Y,heatMap:x,flatFiles:y,onOpenFile:Ut,onMeta:B,onRendered:_t}):se=o.jsx("div",{className:"empty",children:"Loading…"}):q?(Ye="view",se=o.jsxs(o.Fragment,{children:[o.jsx(vm,{project:m}),i.canInsights&&o.jsx("div",{className:"home-insights",children:o.jsx(Zh,{flatFiles:y,heatMap:x,devices:w,onOpenFile:Ut,onOpenFolder:Ut,isFolder:ze})})]})):se=o.jsx("div",{className:"empty",children:"Select a file to read it."});const Au=J?J.crumb:Y?o.jsx(Sg,{path:Y,onOpenFolder:Ut}):f.view==="insights"?"Insights — "+(f.viewTarget||m?.name||""):f.view==="history"?"History — "+Xg(f.viewTarget||"",ze):q?m.name:null,ai=o.jsx(Wn,{crumb:Au,meta:D,actions:o.jsxs(o.Fragment,{children:[lt&&o.jsx("button",{id:"share-btn",className:"btn icon-only",title:"Share","aria-label":"Share",onClick:ml,children:o.jsx(Zt,{name:"share"})}),rt&&!Y&&!f.view&&o.jsxs("button",{id:"history-btn",className:"btn",onClick:yl,children:[o.jsx(Zt,{name:"hist"})," ",o.jsx("span",{className:"lbl",children:"History"})]}),Vt&&o.jsx("a",{id:"download",hidden:!0,download:!0,href:Xl,ref:G,children:"Download"}),Dt&&o.jsx("button",{id:"more-btn",className:"btn icon-only",title:"More actions","aria-label":"More actions",onClick:P=>{P.stopPropagation(),S(!dt)},children:o.jsx(Zt,{name:"dots"})}),dt&&o.jsxs("div",{id:"more-menu",role:"menu",children:[rt&&o.jsx("button",{className:"more-item",onClick:yl,children:"History"}),Vt&&o.jsx("button",{className:"more-item",onClick:()=>G.current?.click(),children:"Download"}),i.canInsights&&o.jsx("button",{className:"more-item",onClick:()=>{i.onClosePanel?.(),pe(Ja("insights",m?.id,Y))},children:"Insights"})]})]})});return o.jsxs(o.Fragment,{children:[o.jsx($n,{vault:i.sidebar.vault,projectsNav:i.sidebar.projectsNav,orgBar:i.sidebar.orgBar,tree:o.jsx(pg,{root:p,expanded:Rt,onToggle:gt,currentPath:Y,listingShowing:Ct,onOpen:Ut}),topbar:ai,contentClass:Ye,contentRef:wt,onContentScroll:ce,children:se}),V&&o.jsx(Dg,{url:V.url,copied:V.copied,onClose:()=>vt(null)}),o.jsx(Hg,{open:H,onClose:()=>L(!1),candidates:li})]})}function Kg({config:i}){const c=mr(),r=rm(),[f,d]=Q.useState(null),[m,g]=Q.useState(null);Q.useEffect(()=>g(null),[c]);const A=Q.useMemo(()=>{const et=c.match(/^\/join\/([0-9a-f]+)\/?$/);return et?et[1]:null},[c]),{data:p}=Fp(!A),{data:y}=$p(!A),M=!!i.auth.admin,{data:E}=sm(M),x=Q.useMemo(()=>om(c,"hub"),[c]),q=Q.useMemo(()=>p&&(p.find(et=>et.id===x.project)||f&&p.find(et=>et.org===f)||p[0])||null,[p,x.project,f]);if(Q.useEffect(()=>{document.title=q?q.name+" — BearDrive":i.brand||i.volume||"BearDrive"},[q,i]),A)return o.jsx(Zg,{token:A,onDone:async et=>{d(et),await r(),pe("/",{replace:!0})}});const z=i.brand||i.volume||"BearDrive",w=q&&y?.find(et=>et.id===q.org)||null,Y=M||(w?w.role==="owner":!1),$=o.jsx(Mu,{name:z,onHome:()=>pe("/"),search:!!q}),yt=i.me?o.jsx(cg,{me:i.me,org:w,admin:M?{pending:E?.length||0,onClick:()=>{g({kind:"hub"}),Ze()}}:void 0,onOrgSettings:et=>{g({kind:"org",orgId:et.id}),Ze()}}):void 0;if(!p||!y)return o.jsx($n,{vault:$,topbar:o.jsx(Wn,{}),children:o.jsx("div",{className:"empty",children:"Loading…"})});if(!q)return o.jsx($n,{vault:$,projectsNav:o.jsx(Gh,{projects:p}),orgBar:yt,topbar:o.jsx(Wn,{}),contentClass:"view",children:o.jsx(dg,{authEnabled:i.auth.enabled,onCreate:async et=>{if(!et){st("Give the project a name.",!0);return}try{const k=await Fa("/api/projects",{name:et});await r(),pe("/"+k.project.id),st(`Created “${k.project.name}”.`)}catch(k){st("Could not create the project: "+k.message,!0)}}})});const ot=m?.kind==="org"?y.find(et=>et.id===m.orgId):null,Ct=m?.kind==="hub"?{crumb:"Signup & access",body:o.jsx(ug,{})}:ot?{crumb:ot.name,body:o.jsx(ig,{org:ot,projects:p,myEmail:i.me?.email||"",onProjectsChanged:r})}:null,Rt=x.view==="settings"?{crumb:"Project settings",body:o.jsx(sg,{project:q,org:w})}:x.view==="install"?{crumb:"Installation",body:o.jsx("div",{className:"onboard",children:o.jsx(vm,{project:q})})}:null;return x.project!==q.id?o.jsx(tg,{to:"/"+q.id}):o.jsx(bm,{config:i,apiBase:"/api/p/"+q.id+"/",route:x,hub:!0,project:q,projects:p,canInsights:Y,sidebar:{vault:$,projectsNav:o.jsx(Gh,{projects:p,currentId:q.id,menu:{active:m?null:x.view==="insights"?"dashboard":x.view==="install"?"install":x.view==="history"?"history":x.view==="settings"?"settings":null,onDashboard:()=>{g(null),pe(Ja("insights",q.id)),Ze()},onInstall:()=>{g(null),pe(Ja("install",q.id)),Ze()},onHistory:()=>{g(null),pe(Ja("history",q.id)),Ze()},onSettings:()=>{g(null),pe(Ja("settings",q.id)),Ze()}}}),orgBar:yt},panel:Ct||Rt,onClosePanel:()=>g(null)},q.id)}function Zg({token:i,onDone:c}){return Q.useEffect(()=>{let r=!1;return Fa("/api/invites/"+i).then(f=>{r||(st(`Welcome — you joined the “${f.org.name}” team. Opening its projects…`),c(f.org.id))}).catch(f=>{r||String(f.message).includes("signing in")||(st("Could not accept the invite: "+f.message,!0),c(null))}),()=>{r=!0}},[i]),o.jsx($n,{vault:o.jsx(Mu,{name:"BearDrive"}),topbar:o.jsx(Wn,{}),children:o.jsx("div",{className:"empty",children:"Joining…"})})}function kg({config:i}){const c=mr(),r=i.volume||"BearDrive";Q.useEffect(()=>{document.title=i.brand||r},[i,r]);const f=Q.useMemo(()=>om(c,"volume"),[c]);return o.jsx(bm,{config:i,apiBase:"/api/",route:f,hub:!1,sidebar:{vault:o.jsx(Mu,{name:r,showSignout:i.auth.enabled,search:!0})}})}function Vg(){const{data:i}=U0();return o.jsxs(o.Fragment,{children:[i?i.mode==="hub"?o.jsx(Kg,{config:i}):o.jsx(kg,{config:i}):o.jsx($n,{vault:o.jsx(Mu,{name:"…",showSignout:!1}),topbar:o.jsx(Wn,{}),children:o.jsx("div",{className:"empty",children:"Loading…"})}),o.jsx(Zp,{}),o.jsx(kp,{})]})}const Jg=new x0({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});Fv.createRoot(document.getElementById("root")).render(o.jsx(Q.StrictMode,{children:o.jsx(j0,{client:Jg,children:o.jsx(Vg,{})})})); diff --git a/internal/webapp/static/index.html b/internal/webapp/static/index.html index 1fa670a..5fd1c48 100644 --- a/internal/webapp/static/index.html +++ b/internal/webapp/static/index.html @@ -5,8 +5,8 @@ BearDrive - - + +
diff --git a/website/index.html b/website/index.html index 5f064d1..2de06af 100644 --- a/website/index.html +++ b/website/index.html @@ -220,6 +220,35 @@ h2 { font-size: clamp(26px, 3.2vw, 34px); margin: 0 0 12px; letter-spacing: -.02 .claude ul li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 600; } .claude ul b { color: var(--text); font-weight: 600; } +/* auto-share reply mock */ +.autoshare { text-align: center; } +.autoshare .lede { margin-left: auto; margin-right: auto; } +.reply { + max-width: 660px; margin: 6px auto 0; text-align: left; + background: #101010; border: 1px solid var(--border); border-radius: 10px; + box-shadow: 0 0 0 1px rgba(245,166,35,.05), 0 24px 64px rgba(0,0,0,.55); + overflow: hidden; +} +.reply-line { + padding: 24px 26px; font: 15px/1.7 var(--mono); color: var(--text); + display: flex; gap: 13px; align-items: baseline; +} +.reply-dot { color: var(--brand); font-size: 11px; line-height: 1.7; } +.reply-path { color: #6fbfff; word-break: break-all; } +.reply-link { + color: var(--brand); text-decoration: none; cursor: pointer; + padding: 1px 4px; border-radius: 5px; transition: background .15s; +} +.reply-link:hover { background: rgba(245,166,35,.16); } +.reply-cap { + border-top: 1px solid #1e1e1e; background: #0c0c0c; + padding: 13px 26px; font: 12.5px/1.6 var(--mono); color: var(--text-faint); +} +.reply-cap code { + font: 11.5px var(--mono); background: var(--card); + border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text-dim); +} + /* open source / cloud */ .oss { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; } .oss-card { @@ -345,6 +374,25 @@ every tool works content-addressed blobs append-only, no locks, offl +
+
+

SHARE WITHOUT A SHARE STEP

+

The link is born with the file.

+

The moment your agent writes a file, the path in its reply is + already a clickable, members-only hub link. You didn't run a command, you didn't + copy a path — any teammate who's signed in opens it in one click, rendered and at + the latest version. It's gated to your project, so it's safe to paste in any + internal channel.

+
+
+ + Deal page written to shared/wiki/deals/motive.md 🔗 +
+
↑ your agent's own reply — the 🔗 is a live hub link it added automatically. No bdrive share, no copy-paste, nobody asking you to resend it.
+
+
+
+

WHY BEARDRIVE