portable-agent-layer 0.77.0 → 0.78.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -63,7 +63,7 @@ alias pal="bun run ~/path/to/portable-agent-layer/src/cli/index.ts"
63
63
 
64
64
  ```bash
65
65
  pal cli init # scaffold home, install hooks for all targets
66
- pal # start a Claude session (with session summary on exit)
66
+ pal # start the first installed agent in the terminal
67
67
  pal cli status # check your setup
68
68
  ```
69
69
 
@@ -73,11 +73,11 @@ pal cli status # check your setup
73
73
 
74
74
  | Command | Description |
75
75
  |---------|-------------|
76
- | `pal` | Start a Claude session with session summary on exit |
76
+ | `pal` | Start the first installed agent, in order: Claude Code, Codex, Cursor CLI, Copilot CLI, opencode. Claude sessions print a summary on exit |
77
77
  | `pal cli init` | Scaffold PAL home directory and install hooks |
78
78
  | `pal cli install` | Register hooks/skills for targets |
79
79
  | `pal cli uninstall` | Remove hooks/skills for targets |
80
- | `pal cli update` | Update PAL (git pull or npm update) and reinstall hooks. Install asks once whether to do this daily on its own; the switch lives in the control room under Settings → Updates. On a repo install a daily run waits while the clone has uncommitted changes |
80
+ | `pal cli update` | Update PAL (git pull or npm update) and reinstall hooks. Install asks once whether to do this daily on its own, applied when a session closes so opening PAL is never slowed; the switch lives in the control room under Settings → Updates. On a repo install a daily run waits while the clone has uncommitted changes |
81
81
  | `pal cli export` | Export user state (telos, memory) to a zip |
82
82
  | `pal cli import` | Import user state from a zip |
83
83
  | `pal cli status` | Show current PAL configuration |
@@ -167,7 +167,14 @@ if (Test-Path $updateCache) {
167
167
  $uc = Get-Content $updateCache -Raw -ErrorAction SilentlyContinue | ConvertFrom-Json
168
168
  if ($uc.available -eq $true) {
169
169
  $versionStr = if ($uc.current -ne $uc.latest) { "$($uc.current) -> $($uc.latest)" } else { $uc.current + " (new commits)" }
170
- $UPDATE_LINE = "[update] $versionStr run: pal cli update"
170
+ # With daily updates on, PAL applies this when the session closes — so the
171
+ # next step is to restart, not to run the command yourself.
172
+ $palSettings = Join-Path $env:USERPROFILE ".pal\memory\pal-settings.json"
173
+ $autoUpdate = $false
174
+ if (Test-Path $palSettings) {
175
+ try { $autoUpdate = (Get-Content $palSettings -Raw | ConvertFrom-Json).autoUpdate.enabled -eq $true } catch {}
176
+ }
177
+ $UPDATE_LINE = if ($autoUpdate) { "[update] $versionStr restart to apply" } else { "[update] $versionStr run: pal cli update" }
171
178
  }
172
179
  } catch {}
173
180
  }
@@ -212,7 +212,14 @@ if [ -f "$UPDATE_CACHE" ]; then
212
212
  else
213
213
  VERSION_STR="$UC_CURRENT (new commits)"
214
214
  fi
215
- UPDATE_LINE="📦 update: $VERSION_STR run: pal cli update"
215
+ # With daily updates on, PAL applies this when the session closes — so the
216
+ # next step is to restart, not to run the command yourself.
217
+ AUTO_UPDATE=$(jq -r '.autoUpdate.enabled // false' "$HOME/.pal/memory/pal-settings.json" 2>/dev/null)
218
+ if [ "$AUTO_UPDATE" = "true" ]; then
219
+ UPDATE_LINE="📦 update: $VERSION_STR restart to apply"
220
+ else
221
+ UPDATE_LINE="📦 update: $VERSION_STR run: pal cli update"
222
+ fi
216
223
  fi
217
224
  fi
218
225
 
@@ -53,6 +53,16 @@
53
53
  }
54
54
  ]
55
55
  }
56
+ ],
57
+ "SessionEnd": [
58
+ {
59
+ "hooks": [
60
+ {
61
+ "type": "command",
62
+ "command": "bun run {{PKG_ROOT}}/src/hooks/SessionClose.ts --agent=codex"
63
+ }
64
+ ]
65
+ }
56
66
  ]
57
67
  }
58
68
  }
@@ -57,6 +57,13 @@
57
57
  "bash": "bun run {{PKG_ROOT}}/src/hooks/StopOrchestrator.ts --agent=copilot",
58
58
  "powershell": "bun run {{PKG_ROOT}}/src/hooks/StopOrchestrator.ts --agent=copilot"
59
59
  }
60
+ ],
61
+ "sessionEnd": [
62
+ {
63
+ "type": "command",
64
+ "bash": "bun run {{PKG_ROOT}}/src/hooks/SessionClose.ts --agent=copilot",
65
+ "powershell": "bun run {{PKG_ROOT}}/src/hooks/SessionClose.ts --agent=copilot"
66
+ }
60
67
  ]
61
68
  }
62
69
  }
@@ -54,6 +54,12 @@
54
54
  "type": "command",
55
55
  "command": "bun run {{PKG_ROOT}}/src/hooks/StopOrchestrator.ts --agent=cursor"
56
56
  }
57
+ ],
58
+ "sessionEnd": [
59
+ {
60
+ "type": "command",
61
+ "command": "bun run {{PKG_ROOT}}/src/hooks/SessionClose.ts --agent=cursor"
62
+ }
57
63
  ]
58
64
  }
59
65
  }
@@ -196,6 +196,17 @@
196
196
  }
197
197
  ]
198
198
  }
199
+ ],
200
+ "SessionEnd": [
201
+ {
202
+ "matcher": "prompt_input_exit|logout|other",
203
+ "hooks": [
204
+ {
205
+ "type": "command",
206
+ "command": "bun run {{PKG_ROOT}}/src/hooks/SessionClose.ts --agent=claude"
207
+ }
208
+ ]
209
+ }
199
210
  ]
200
211
  },
201
212
  "autoMemoryEnabled": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portable-agent-layer",
3
- "version": "0.77.0",
3
+ "version": "0.78.1",
4
4
  "description": "PAL — Portable Agent Layer: persistent personal context for AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * PAL CLI — Portable Agent Layer
4
4
  *
5
5
  * Usage:
6
- * pal [claude-args...] Start a Claude session with session summary on exit
6
+ * pal [agent-args...] Start the first installed agent: claude, codex, cursor-agent, copilot, opencode
7
7
  * pal cli <command> [options] Admin commands
8
8
  *
9
9
  * Admin commands (pal cli ...):
@@ -56,6 +56,7 @@ import { findBinaryOnPath } from "../hooks/lib/which";
56
56
  import { log } from "../targets/lib";
57
57
  import { builtinToolVerbs, runBuiltinTool } from "./builtin-tools";
58
58
  import { checkPendingMigrations } from "./migrate";
59
+ import { findSessionAgent, NO_SESSION_AGENT_MESSAGE } from "./session-agent";
59
60
 
60
61
  const allArgs = process.argv.slice(2);
61
62
 
@@ -109,16 +110,10 @@ function checkCopilot(): ToolCheck {
109
110
  return cli;
110
111
  }
111
112
 
112
- function detectAgent(): string | null {
113
- if (checkTool("claude").available) return "claude";
114
- if (checkTool("opencode").available) return "opencode";
115
- return null;
116
- }
117
-
118
113
  async function session(sessionArgs: string[]) {
119
- const agent = detectAgent();
114
+ const agent = findSessionAgent();
120
115
  if (!agent) {
121
- log.error("No supported agent found. Install Claude Code or opencode.");
116
+ log.error(NO_SESSION_AGENT_MESSAGE);
122
117
  process.exit(1);
123
118
  }
124
119
 
@@ -178,6 +173,9 @@ async function session(sessionArgs: string[]) {
178
173
  await checkForUpdate();
179
174
  const notice = getUpdateNotice();
180
175
  if (notice) console.log(`\n${notice}`);
176
+ const { autoUpdateOnClose } = await import("../hooks/lib/auto-update");
177
+ const closing = autoUpdateOnClose();
178
+ if (closing) console.log(`\n${closing}`);
181
179
  } catch {
182
180
  // Non-critical
183
181
  }
@@ -325,7 +323,7 @@ function pointAtOnboarding(): void {
325
323
  function showHelp() {
326
324
  console.log(`
327
325
  Usage:
328
- pal [claude-args...] Start a Claude session
326
+ pal [agent-args...] Start the first installed agent
329
327
  pal cli <command> [options] Admin commands
330
328
 
331
329
  Admin commands:
@@ -1156,7 +1154,7 @@ function doctor(silent = false): DoctorResult {
1156
1154
 
1157
1155
  if (!hasAgent) {
1158
1156
  console.log("");
1159
- log.error("No supported agent found. Install Claude Code or opencode.");
1157
+ log.error(NO_SESSION_AGENT_MESSAGE);
1160
1158
  }
1161
1159
  console.log("");
1162
1160
  }
@@ -0,0 +1,20 @@
1
+ import { findBinaryOnPath } from "../hooks/lib/which";
2
+
3
+ const SESSION_AGENT_BINARIES = [
4
+ "claude",
5
+ "codex",
6
+ "cursor-agent",
7
+ "copilot",
8
+ "opencode",
9
+ ] as const;
10
+
11
+ export type SessionAgent = (typeof SESSION_AGENT_BINARIES)[number];
12
+
13
+ export function findSessionAgent(): SessionAgent | null {
14
+ return (
15
+ SESSION_AGENT_BINARIES.find((binary) => findBinaryOnPath(binary) !== null) ?? null
16
+ );
17
+ }
18
+
19
+ export const NO_SESSION_AGENT_MESSAGE =
20
+ "No supported agent found. Install Claude Code, Codex, Cursor CLI, Copilot CLI or opencode.";
@@ -14,7 +14,8 @@ import { raw as readSettings, write as writeSettings } from "../hooks/lib/settin
14
14
 
15
15
  /** Only a git clone can be mid-change; a global package install has no such state. */
16
16
  function whatItDoes(): string {
17
- const daily = "Once a day, at session start, PAL updates itself in the background.";
17
+ const daily =
18
+ "Once a day, when you close a session, PAL updates itself in the background.\nOpening PAL is never slowed down, and the statusline says when to restart.";
18
19
  return isRepoMode()
19
20
  ? `${daily}\nIt waits while this clone has uncommitted changes.`
20
21
  : daily;
@@ -11,7 +11,7 @@
11
11
  import { mkdirSync, writeFileSync } from "node:fs";
12
12
  import { resolve } from "node:path";
13
13
  import { getActiveAgent } from "./lib/agent";
14
- import { shouldAutoUpdate, spawnAutoUpdate } from "./lib/auto-update";
14
+ import { autoUpdateOnStart } from "./lib/auto-update";
15
15
  import { buildClaudeMd, regenerateIfNeeded } from "./lib/claude-md";
16
16
  import { type AgentTarget, buildSystemReminder } from "./lib/context";
17
17
  import { logContextSnapshot, logDebug, logError } from "./lib/log";
@@ -40,7 +40,7 @@ try {
40
40
  }
41
41
 
42
42
  try {
43
- if (shouldAutoUpdate()) spawnAutoUpdate();
43
+ if (autoUpdateOnStart()) logDebug("LoadContext", "close hook silent — updating now");
44
44
  } catch (err) {
45
45
  logError("LoadContext:auto-update", err);
46
46
  }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Hook: session end — the moment PAL updates itself.
3
+ *
4
+ * Every agent PAL targets fires one of these when a session is done: Claude's
5
+ * SessionEnd, Cursor's sessionEnd, Codex's SessionEnd, Copilot's sessionEnd.
6
+ * opencode has no session-end event and calls the same library function from its
7
+ * plugin when the server is disposed.
8
+ *
9
+ * Closing is the right moment because the work is over: the reinstall cannot
10
+ * rewrite the config of a session still in use, and opening PAL costs nothing.
11
+ */
12
+
13
+ import { autoUpdateOnClose } from "./lib/auto-update";
14
+ import { logError } from "./lib/log";
15
+ import { isPalSpawnedInference } from "./lib/spawn-guard";
16
+ import { readStdinJSON } from "./lib/stdin";
17
+
18
+ if (isPalSpawnedInference()) process.exit(0);
19
+
20
+ try {
21
+ const input = await readStdinJSON<{ reason?: string }>();
22
+ autoUpdateOnClose(input?.reason);
23
+ } catch (err) {
24
+ logError("SessionClose", err);
25
+ }
@@ -12,7 +12,7 @@
12
12
  */
13
13
 
14
14
  import { spawn, spawnSync } from "node:child_process";
15
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
15
+ import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
16
16
  import { resolve } from "node:path";
17
17
  import { cachedStatus, getInstalledVersion, isRepoMode } from "../handlers/update-check";
18
18
  import { logDebug, logError } from "./log";
@@ -42,8 +42,16 @@ export interface AutoUpdateStatus {
42
42
  }
43
43
 
44
44
  const DAY_MS = 24 * 60 * 60 * 1000;
45
+ const RESCUE_AFTER_MS = 3 * DAY_MS;
46
+ const LOCK_STALE_MS = 30 * 60 * 1000;
45
47
  const DIRTY_TREE = "uncommitted changes in the PAL repo";
46
48
 
49
+ /**
50
+ * Ending a session to clear or resume it leaves the agent running, so an update
51
+ * there would rewrite the config of a CLI the user is still sitting in front of.
52
+ */
53
+ const KEEPS_THE_AGENT_RUNNING = ["clear", "resume"];
54
+
47
55
  function ledgerPath(): string {
48
56
  return resolve(paths.state(), "auto-update.json");
49
57
  }
@@ -52,6 +60,10 @@ function logPath(): string {
52
60
  return resolve(paths.state(), "auto-update.log");
53
61
  }
54
62
 
63
+ function lockPath(): string {
64
+ return resolve(paths.state(), "auto-update.lock");
65
+ }
66
+
55
67
  export function readLedger(): AutoUpdateLedger | null {
56
68
  try {
57
69
  const fp = ledgerPath();
@@ -130,6 +142,93 @@ function updateCommand(): string[] {
130
142
  return [resolve(palPkg(), "src", "cli", "index.ts"), "cli", "update"];
131
143
  }
132
144
 
145
+ function heldRecently(): boolean {
146
+ try {
147
+ const held = JSON.parse(readFileSync(lockPath(), "utf-8")) as { at?: string };
148
+ return (
149
+ Boolean(held.at) && Date.now() - new Date(String(held.at)).getTime() < LOCK_STALE_MS
150
+ );
151
+ } catch {
152
+ return false;
153
+ }
154
+ }
155
+
156
+ /**
157
+ * Two agents can close at the same moment, and two `git pull`s into one clone is
158
+ * not a race worth having. An exclusive create is the whole mechanism; a lock
159
+ * older than the longest plausible update is treated as abandoned.
160
+ */
161
+ function takeLock(): boolean {
162
+ const note = JSON.stringify({ pid: process.pid, at: new Date().toISOString() });
163
+ try {
164
+ writeFileSync(lockPath(), note, { flag: "wx" });
165
+ return true;
166
+ } catch {
167
+ if (heldRecently()) return false;
168
+ writeFileSync(lockPath(), note, "utf-8");
169
+ return true;
170
+ }
171
+ }
172
+
173
+ function releaseLock(): void {
174
+ try {
175
+ rmSync(lockPath(), { force: true });
176
+ } catch (err) {
177
+ logError("auto-update:lock", err);
178
+ }
179
+ }
180
+
181
+ export function endsTheSession(reason: string | undefined): boolean {
182
+ return !reason || !KEEPS_THE_AGENT_RUNNING.includes(reason);
183
+ }
184
+
185
+ function updatingNotice(): string {
186
+ const cache = cachedStatus();
187
+ const versions =
188
+ cache?.latest && cache.latest !== cache.current
189
+ ? ` (${cache.current} → ${cache.latest})`
190
+ : "";
191
+ return `📦 Updating PAL in the background${versions} — nothing to wait for, it finishes on its own.`;
192
+ }
193
+
194
+ /**
195
+ * What every agent's close hook calls. Returns the line a terminal should print,
196
+ * or null when there is nothing a user would want to know. Comparing the skip
197
+ * stamp across the gate is how a skip recorded just now is told apart from one
198
+ * left over from yesterday.
199
+ */
200
+ export function autoUpdateOnClose(reason?: string): string | null {
201
+ if (!endsTheSession(reason)) return null;
202
+ const skippedBefore = readLedger()?.skippedAt;
203
+ if (!shouldAutoUpdate()) {
204
+ const ledger = readLedger();
205
+ const skippedNow = ledger?.skippedAt && ledger.skippedAt !== skippedBefore;
206
+ return skippedNow ? `📦 PAL update waiting — ${ledger?.skipped}.` : null;
207
+ }
208
+ spawnAutoUpdate();
209
+ return updatingNotice();
210
+ }
211
+
212
+ function closeHookIsNotDelivering(ledger: AutoUpdateLedger | null): boolean {
213
+ if (!ledger?.attemptedAt) return true;
214
+ return Date.now() - new Date(ledger.attemptedAt).getTime() > RESCUE_AFTER_MS;
215
+ }
216
+
217
+ /**
218
+ * The second chance, not the usual path. A session that is killed, or an agent
219
+ * whose close event never arrives, would otherwise leave an install pinned
220
+ * forever on a statusline telling it to restart — and restarting would not help.
221
+ * Two small file reads on a normal start; the rest is only reached when the
222
+ * close hook has been silent for days.
223
+ */
224
+ export function autoUpdateOnStart(): boolean {
225
+ if (!isAutoUpdateEnabled()) return false;
226
+ if (!closeHookIsNotDelivering(readLedger())) return false;
227
+ if (!shouldAutoUpdate()) return false;
228
+ spawnAutoUpdate();
229
+ return true;
230
+ }
231
+
133
232
  /**
134
233
  * Runs in the detached child, never in the hook that spawned it. The attempt is
135
234
  * stamped before the command starts so a run that dies mid-flight still counts
@@ -140,7 +239,18 @@ export function runAutoUpdate(): AutoUpdateLedger {
140
239
  recordSkip(DIRTY_TREE);
141
240
  return readLedger() ?? {};
142
241
  }
242
+ if (!takeLock()) {
243
+ logDebug("auto-update", "another update holds the lock");
244
+ return readLedger() ?? {};
245
+ }
246
+ try {
247
+ return update();
248
+ } finally {
249
+ releaseLock();
250
+ }
251
+ }
143
252
 
253
+ function update(): AutoUpdateLedger {
144
254
  const from = getInstalledVersion();
145
255
  writeLedger({ attemptedAt: new Date().toISOString(), from });
146
256
 
@@ -168,7 +278,7 @@ export function runAutoUpdate(): AutoUpdateLedger {
168
278
  });
169
279
  }
170
280
 
171
- /** Hands the update to its own process so session start never waits on it. */
281
+ /** Hands the update to its own process, which outlives the session that closed. */
172
282
  export function spawnAutoUpdate(): void {
173
283
  try {
174
284
  const child = spawn("bun", [resolve(assets.hooks(), "AutoUpdate.ts")], {
@@ -349,10 +349,11 @@ export function resolveProjectFromCwd(
349
349
 
350
350
  export function isStale(
351
351
  p: ProjectProgress,
352
- thresholdDays = PROJECT_STALE_DAYS_DEFAULT
352
+ thresholdDays = PROJECT_STALE_DAYS_DEFAULT,
353
+ now: Date = new Date()
353
354
  ): boolean {
354
355
  if (!p.updated) return false;
355
- const age = Date.now() - new Date(p.updated).getTime();
356
+ const age = now.getTime() - new Date(p.updated).getTime();
356
357
  if (!Number.isFinite(age) || age < 0) return false;
357
358
  return age > thresholdDays * 86_400_000;
358
359
  }
@@ -127,6 +127,12 @@ const PALPlugin: Plugin = async ({ directory, client }: PluginInput) => {
127
127
  if (isPalSpawnedInference()) return;
128
128
  logDebug("opencode:event", `Event: ${event.type}`);
129
129
 
130
+ if (event.type === "server.instance.disposed") {
131
+ const { autoUpdateOnClose } =
132
+ await lib<typeof import("../../hooks/lib/auto-update")>("auto-update.ts");
133
+ autoUpdateOnClose();
134
+ }
135
+
130
136
  if (event.type === "session.created" || event.type === "session.updated") {
131
137
  const { regenerateIfNeeded } =
132
138
  await lib<typeof import("../../hooks/lib/claude-md")>("claude-md.ts");
@@ -16,6 +16,7 @@ import { loadAnalyzeNudge } from "../../hooks/lib/analyze-nudge";
16
16
  import { paths } from "../../hooks/lib/paths";
17
17
  import {
18
18
  isStale,
19
+ PROJECT_STALE_DAYS_DEFAULT,
19
20
  type ProjectProgress,
20
21
  readAllProjects,
21
22
  type ServesAuthority,
@@ -188,7 +189,7 @@ function toCard(
188
189
  snoozes: Record<string, string>
189
190
  ): ProjectCard {
190
191
  const path = p.path ?? null;
191
- const stale = isStale(p);
192
+ const stale = isStale(p, PROJECT_STALE_DAYS_DEFAULT, now);
192
193
  const history = path ? readProjectHistory(path, 1) : [];
193
194
  const last = history.at(-1);
194
195
  return {
@@ -46,4 +46,4 @@ Error generating stack: `+e.message+`
46
46
  `},qa=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ja=function(){O.useEffect(function(){return document.body.setAttribute(Ga,(qa()+1).toString()),function(){var e=qa()-1;e<=0?document.body.removeAttribute(Ga):document.body.setAttribute(Ga,e.toString())}},[])},Ya=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ja();var a=O.useMemo(function(){return Ua(i)},[i]);return O.createElement(Wa,{styles:Ka(a,!t,i,n?``:`!important`)})},Xa=!1;if(typeof window<`u`)try{var Za=Object.defineProperty({},"passive",{get:function(){return Xa=!0,!0}});window.addEventListener(`test`,Za,Za),window.removeEventListener(`test`,Za,Za)}catch{Xa=!1}var Qa=Xa?{passive:!1}:!1,$a=function(e){return e.tagName===`TEXTAREA`},eo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!$a(e)&&n[t]===`visible`)},to=function(e){return eo(e,`overflowY`)},no=function(e){return eo(e,`overflowX`)},ro=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),oo(e,r)){var i=so(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},io=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ao=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},oo=function(e,t){return e===`v`?to(t):no(t)},so=function(e,t){return e===`v`?io(t):ao(t)},co=function(e,t){return e===`h`&&t===`rtl`?-1:1},lo=function(e,t,n,r,i){var a=co(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=so(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&oo(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},uo=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fo=function(e){return[e.deltaX,e.deltaY]},po=function(e){return e&&`current`in e?e.current:e},mo=function(e,t){return e[0]===t[0]&&e[1]===t[1]},z=function(e){return`
47
47
  .block-interactivity-${e} {pointer-events: none;}
48
48
  .allow-interactivity-${e} {pointer-events: all;}
49
- `},B=0,ho=[];function go(e){var t=O.useRef([]),n=O.useRef([0,0]),r=O.useRef(),i=O.useState(B++)[0],a=O.useState(za)[0],o=O.useRef(e);O.useEffect(function(){o.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ha([e.lockRef.current],(e.shards||[]).map(po),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=O.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=uo(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ro(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ro(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return lo(h,t,e,h===`h`?s:c,!0)},[]),c=O.useCallback(function(e){var n=e;if(ho.length&&ho[ho.length-1]===a){var r=`deltaY`in n?fo(n):uo(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&mo(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(po).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=O.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:_o(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=O.useCallback(function(e){n.current=uo(e),r.current=void 0},[]),d=O.useCallback(function(t){l(t.type,fo(t),t.target,s(t,e.lockRef.current))},[]),f=O.useCallback(function(t){l(t.type,uo(t),t.target,s(t,e.lockRef.current))},[]);O.useEffect(function(){return ho.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Qa),document.addEventListener(`touchmove`,c,Qa),document.addEventListener(`touchstart`,u,Qa),function(){ho=ho.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Qa),document.removeEventListener(`touchmove`,c,Qa),document.removeEventListener(`touchstart`,u,Qa)}},[]);var p=e.removeScrollBar,m=e.inert;return O.createElement(O.Fragment,null,m?O.createElement(a,{styles:z(i)}):null,p?O.createElement(Ya,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _o(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var vo=ka(Aa,go),yo=O.forwardRef(function(e,t){return O.createElement(Ma,pa({},e,{ref:t,sideCar:vo}))});yo.classNames=Ma.classNames;var bo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},xo=new WeakMap,So=new WeakMap,Co={},wo=0,To=function(e){return e&&(e.host||To(e.parentNode))},Eo=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=To(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Do=function(e,t,n,r){var i=Eo(t,Array.isArray(e)?e:[e]);Co[n]||(Co[n]=new WeakMap);var a=Co[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(xo.get(e)||0)+1,l=(a.get(e)||0)+1;xo.set(e,c),a.set(e,l),o.push(e),c===1&&i&&So.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),wo++,function(){o.forEach(function(e){var t=xo.get(e)-1,i=a.get(e)-1;xo.set(e,t),a.set(e,i),t||(So.has(e)||e.removeAttribute(r),So.delete(e)),i||e.removeAttribute(n)}),wo--,wo||(xo=new WeakMap,xo=new WeakMap,So=new WeakMap,Co={})}},Oo=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||bo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Do(r,i,n,`aria-hidden`)):function(){return null}},ko=Object.defineProperty,Ao=(e,t)=>ko(e,`name`,{value:t,configurable:!0});function jo(e){let[t,n]=O.useState(void 0);return Yr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Ao(jo,`useSize`);var Mo=[`top`,`right`,`bottom`,`left`],V=Math.min,No=Math.max,Po=Math.round,Fo=Math.floor,Io=e=>({x:e,y:e}),Lo={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ro(e,t,n){return No(e,V(t,n))}function zo(e,t){return typeof e==`function`?e(t):e}function Bo(e){return e.split(`-`)[0]}function Vo(e){return e.split(`-`)[1]}function Ho(e){return e===`x`?`y`:`x`}function Uo(e){return e===`y`?`height`:`width`}function Wo(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Go(e){return Ho(Wo(e))}function Ko(e,t,n){n===void 0&&(n=!1);let r=Vo(e),i=Go(e),a=Uo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ts(o)),[o,ts(o)]}function qo(e){let t=ts(e);return[Jo(e),t,Jo(t)]}function Jo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Yo=[`left`,`right`],Xo=[`right`,`left`],Zo=[`top`,`bottom`],Qo=[`bottom`,`top`];function $o(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xo:Yo:t?Yo:Xo;case`left`:case`right`:return t?Zo:Qo;default:return[]}}function es(e,t,n,r){let i=Vo(e),a=$o(Bo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Jo)))),a}function ts(e){let t=Bo(e);return Lo[t]+e.slice(t.length)}function ns(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function rs(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ns(e)}function is(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function as(e,t,n){let{reference:r,floating:i}=e,a=Wo(t),o=Go(t),s=Uo(o),c=Bo(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Vo(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function os(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=zo(t,e),p=rs(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=is(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=is(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ss=50,cs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:os},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=as(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ss&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=as(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ls=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=zo(e,t)||{};if(l==null)return{};let d=rs(u),f={x:n,y:r},p=Go(i),m=Uo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=V(d[_],T),te=V(d[v],T),E=C-h[m]-te,D=C/2-h[m]/2+w,ne=Ro(ee,D,E),re=!c.arrow&&Vo(i)!=null&&D!==ne&&a.reference[m]/2-(D<ee?ee:te)-h[m]/2<0,O=re?D<ee?D-ee:D-E:0;return{[p]:f[p]+O,data:{[p]:ne,centerOffset:D-ne-O,...re&&{alignmentOffset:O}},reset:re}}}),us=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=zo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Bo(r),_=Wo(o),v=Bo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ts(o)]:qo(o)),x=p!==`none`;!d&&x&&b.push(...es(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ko(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wo(t)||T.every(e=>Wo(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wo(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ds(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fs(e){return Mo.some(t=>e[t]>=0)}var ps=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=zo(e,t);switch(i){case`referenceHidden`:{let e=ds(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:fs(e)}}}case`escaped`:{let e=ds(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:fs(e)}}}default:return{}}}}},ms=new Set([`left`,`top`]);async function hs(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Bo(n),s=Vo(n),c=Wo(n)===`y`,l=ms.has(o)?-1:1,u=a&&c?-1:1,d=zo(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var gs=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await hs(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_s=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=zo(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wo(i),p=Ho(f),m=u[p],h=u[f],g=(e,t)=>Ro(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},vs=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=zo(e,t),u={x:n,y:r},d=Wo(i),f=Ho(d),p=u[f],m=u[d],h=zo(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ms.has(Bo(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ys=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=zo(e,t),c=await i.detectOverflow(t,s),l=Bo(n),u=Vo(n),d=Wo(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=V(p-c[m],g),y=V(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*No(c.left,c.right):S=p-2*No(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function bs(){return typeof window<`u`}function xs(e){return ws(e)?(e.nodeName||``).toLowerCase():`#document`}function Ss(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cs(e){return((ws(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ws(e){return bs()?e instanceof Node||e instanceof Ss(e).Node:!1}function Ts(e){return bs()?e instanceof Element||e instanceof Ss(e).Element:!1}function Es(e){return bs()?e instanceof HTMLElement||e instanceof Ss(e).HTMLElement:!1}function Ds(e){return!bs()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ss(e).ShadowRoot}function Os(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=zs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ks(e){return/^(table|td|th)$/.test(xs(e))}function As(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var js=/transform|translate|scale|rotate|perspective|filter/,Ms=/paint|layout|strict|content/,Ns=e=>!!e&&e!==`none`,Ps;function Fs(e){let t=Ts(e)?zs(e):e;return Ns(t.transform)||Ns(t.translate)||Ns(t.scale)||Ns(t.rotate)||Ns(t.perspective)||!Ls()&&(Ns(t.backdropFilter)||Ns(t.filter))||js.test(t.willChange||``)||Ms.test(t.contain||``)}function Is(e){let t=Vs(e);for(;Es(t)&&!Rs(t);){if(Fs(t))return t;if(As(t))return null;t=Vs(t)}return null}function Ls(){return Ps??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ps}function Rs(e){return/^(html|body|#document)$/.test(xs(e))}function zs(e){return Ss(e).getComputedStyle(e)}function Bs(e){return Ts(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vs(e){if(xs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ds(e)&&e.host||Cs(e);return Ds(t)?t.host:t}function Hs(e){let t=Vs(e);return Rs(t)?(e.ownerDocument||e).body:Es(t)&&Os(t)?t:Hs(t)}function Us(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Hs(e),i=r===e.ownerDocument?.body,a=Ss(r);if(i){let e=Ws(a);return t.concat(a,a.visualViewport||[],Os(r)?r:[],e&&n?Us(e):[])}return t.concat(r,Us(r,[],n))}function Ws(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gs(e){let t=zs(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Es(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Po(n)!==a||Po(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ks(e){return Ts(e)?e:e.contextElement}function qs(e){let t=Ks(e);if(!Es(t))return Io(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gs(t),o=(a?Po(n.width):n.width)/r,s=(a?Po(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Js=Io(0);function Ys(e){let t=Ss(e);return!Ls()||!t.visualViewport?Js:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ss(e)}function Zs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ks(e),o=Io(1);t&&(r?Ts(r)&&(o=qs(r)):o=qs(e));let s=Xs(a,n,r)?Ys(a):Io(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ss(a),t=Ts(r)?Ss(r):r,n=e,i=Ws(n);for(;i&&t!==n;){let e=qs(i),t=i.getBoundingClientRect(),r=zs(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ss(i),i=Ws(n)}}return is({width:u,height:d,x:c,y:l})}function Qs(e,t){let n=Bs(e).scrollLeft;return t?t.left+n:Zs(Cs(e)).left+n}function $s(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qs(e,n),y:n.top+t.scrollTop}}function ec(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Cs(r),s=t?As(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Io(1),u=Io(0),d=Es(r);if((d||!a)&&((xs(r)!==`body`||Os(o))&&(c=Bs(r)),d)){let e=Zs(r);l=qs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$s(o,c):Io(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function tc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function nc(e){let t=Bs(e),n=e.ownerDocument.body,r=No(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=No(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Qs(e),o=-t.scrollTop;return zs(n).direction===`rtl`&&(a+=No(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var rc=25;function ic(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ss(e),a=Cs(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ls()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Qs(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=rc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ac(e,t){let n=Zs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=qs(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function oc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ic(e,n,t);else if(t===`document`)r=nc(Cs(e));else if(Ts(t))r=ac(t,n);else{let n=Ys(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return is(r)}function sc(e,t){let n=t.get(e);if(n)return n;let r=Us(e,[],!1).filter(e=>Ts(e)&&xs(e)!==`body`),i=null,a=zs(e).position===`fixed`,o=a?Vs(e):e;for(;Ts(o)&&!Rs(o);){let e=zs(o),t=Fs(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Vs(o)}return t.set(e,r),r}function cc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?As(t)?[]:sc(t,this._c):[].concat(n),r],o=oc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=oc(t,a[e],i);s=No(n.top,s),c=V(n.right,c),l=V(n.bottom,l),u=No(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function lc(e){let{width:t,height:n}=Gs(e);return{width:t,height:n}}function uc(e,t,n){let r=Es(t),i=Cs(t),a=n===`fixed`,o=Zs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Io(0);if((r||!a)&&((xs(t)!==`body`||Os(i))&&(s=Bs(t)),r)){let e=Zs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Qs(i));let l=i&&!r&&!a?$s(i,s):Io(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function dc(e){return zs(e).position===`static`}function fc(e,t){if(!Es(e)||zs(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Cs(e)===n&&(n=n.ownerDocument.body),n}function pc(e,t){let n=Ss(e);if(As(e))return n;if(!Es(e)){let t=Vs(e);for(;t&&!Rs(t);){if(Ts(t)&&!dc(t))return t;t=Vs(t)}return n}let r=fc(e,t);for(;r&&ks(r)&&dc(r);)r=fc(r,t);return r&&Rs(r)&&dc(r)&&!Fs(r)?n:r||Is(e)||n}var mc=async function(e){let t=this.getOffsetParent||pc,n=this.getDimensions,r=await n(e.floating);return{reference:uc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hc(e){return zs(e).direction===`rtl`}var gc={convertOffsetParentRelativeRectToViewportRelativeRect:ec,getDocumentElement:Cs,getClippingRect:cc,getOffsetParent:pc,getElementRects:mc,getClientRects:tc,getDimensions:lc,getScale:qs,isElement:Ts,isRTL:hc};function _c(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vc(e,t,n){let r=null,i,a=Cs(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Fo(d),h=Fo(a.clientWidth-(u+f)),g=Fo(a.clientHeight-(d+p)),_=Fo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:No(0,V(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!_c(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ss(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function yc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ks(e),u=i||a?[...l?Us(l):[],...t?Us(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?vc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Zs(e):null;c&&g();function g(){let t=Zs(e);h&&!_c(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var bc=gs,xc=_s,Sc=us,Cc=ys,wc=ps,Tc=ls,Ec=vs,Dc=(e,t,n)=>{let r=new Map,i=n??{},a={...gc,...i.platform,_c:r};return cs(e,t,{...i,platform:a})},Oc=typeof document<`u`?O.useLayoutEffect:function(){};function kc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!kc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!kc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ac(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jc(e,t){let n=Ac(e);return Math.round(t*n)/n}function Mc(e){let t=O.useRef(e);return Oc(()=>{t.current=e}),t}function Nc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=O.useState(r);kc(f,r)||p(r);let[m,h]=O.useState(null),[g,_]=O.useState(null),v=O.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=O.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=O.useRef(null),C=O.useRef(null),w=O.useRef(u),T=c!=null,ee=Mc(c),te=Mc(i),E=Mc(l),D=O.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),Dc(S.current,C.current,e).then(e=>{let t={...e,isPositioned:E.current!==!1};ne.current&&!kc(w.current,t)&&(w.current=t,vr.flushSync(()=>{d(t)}))})},[f,t,n,te,E]);Oc(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ne=O.useRef(!1);Oc(()=>(ne.current=!0,()=>{ne.current=!1}),[]),Oc(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(ee.current)return ee.current(b,x,D);D()}},[b,x,D,ee,T]);let re=O.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),k=O.useMemo(()=>({reference:b,floating:x}),[b,x]),ie=O.useMemo(()=>{let e={position:n,left:0,top:0};if(!k.floating)return e;let t=jc(k.floating,u.x),r=jc(k.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ac(k.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,k.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:D,refs:re,elements:k,floatingStyles:ie}),[u,D,re,k,ie])}var Pc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Tc({element:r.current,padding:i}).fn(n):r?Tc({element:r,padding:i}).fn(n):{}}}},Fc=(e,t)=>{let n=bc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ic=(e,t)=>{let n=xc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lc=(e,t)=>({fn:Ec(e).fn,options:[e,t]}),Rc=(e,t)=>{let n=Sc(e);return{name:n.name,fn:n.fn,options:[e,t]}},zc=(e,t)=>{let n=Cc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bc=(e,t)=>{let n=wc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vc=(e,t)=>{let n=Pc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hc=Object.defineProperty,Uc=(e,t)=>Hc(e,`name`,{value:t,configurable:!0}),Wc=`Popper`,[Gc,Kc]=Er(Wc),[qc,Jc]=Gc(Wc),Yc=Uc(e=>{let{__scopePopper:t,children:n}=e,[r,i]=O.useState(null),[a,o]=O.useState(void 0);return(0,F.jsx)(qc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Xc=`PopperAnchor`,Zc=O.forwardRef(Uc(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Jc(Xc,n),o=O.useRef(null),s=a.onAnchorChange,c=$n(t,O.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=O.useRef(null);O.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&il(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,F.jsx)(xr.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Qc=`PopperContent`,[$c,el]=Gc(Qc),tl=O.forwardRef(Uc(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Jc(Qc,n),[_,v]=O.useState(null),y=$n(t,v),[b,x]=O.useState(null),S=jo(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),ee=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},te=Array.isArray(l)?l:[l],E=te.length>0,D={padding:ee,boundary:te.filter(nl),altBoundary:E},{refs:ne,floatingStyles:re,placement:k,isPositioned:ie,middlewareData:ae}=Nc({strategy:`fixed`,placement:T,whileElementsMounted:Uc((...e)=>yc(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Fc({mainAxis:i+w,alignmentAxis:o}),c&&Ic({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Lc():void 0,...D}),c&&Rc({...D}),zc({...D,apply:Uc(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&Vc({element:b,padding:s}),rl({arrowWidth:C,arrowHeight:w}),f&&Bc({strategy:`referenceHidden`,...D,boundary:E?D.boundary:void 0})]}),A=g.setPlacementState;Yr(()=>(A(k),()=>{A(void 0)}),[k,A]);let[j,oe]=il(k),se=ki(m);Yr(()=>{ie&&se?.()},[ie,se]);let ce=ae.arrow?.x,M=ae.arrow?.y,N=ae.arrow?.centerOffset!==0,[P,le]=O.useState();return Yr(()=>{_&&le(window.getComputedStyle(_).zIndex)},[_]),(0,F.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ie?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:P,"--radix-popper-transform-origin":[ae.transformOrigin?.x,ae.transformOrigin?.y].join(` `),...ae.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,F.jsx)($c,{scope:n,placedSide:j,placedAlign:oe,onArrowChange:x,arrowX:ce,arrowY:M,shouldHideArrow:N,children:(0,F.jsx)(xr.div,{"data-side":j,"data-align":oe,...h,ref:y,style:{...h.style,animation:ie?h.style?.animation:`none`}})})})},`PopperContent`));function nl(e){return e!==null}Uc(nl,`isNotNull`);var rl=Uc(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=il(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function il(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Uc(il,`getSideAndAlignFromPlacement`);var al=Yc,ol=Zc,sl=tl,cl=Object.defineProperty,ll=(e,t)=>cl(e,`name`,{value:t,configurable:!0}),ul=!1;function dl(){let[e,t]=O.useState(ul);return O.useEffect(()=>{ul||(ul=!0,t(!0))},[]),e}ll(dl,`useIsHydrated`);var fl=O.useSyncExternalStore;function pl(){return()=>{}}ll(pl,`subscribe`);function ml(){return fl(pl,()=>!0,()=>!1)}ll(ml,`useIsHydratedModern`);var hl=typeof fl==`function`?ml:dl,gl=Object.defineProperty,_l=(e,t)=>gl(e,`name`,{value:t,configurable:!0}),vl=`rovingFocusGroup.onEntryFocus`,yl={bubbles:!1,cancelable:!0},bl=`RovingFocusGroup`,[xl,Sl,Cl]=Ar(bl),[wl,Tl]=Er(bl,[Cl]),[El,Dl]=wl(bl),Ol=O.forwardRef(_l(function(e,t){return(0,F.jsx)(xl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(xl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(kl,{...e,ref:t})})})},`RovingFocusGroup`)),kl=O.forwardRef(_l(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=O.useRef(null),p=$n(t,f),m=Ei(a),[h,g]=ii({prop:o,defaultProp:s??null,onChange:c,caller:bl}),[_,v]=O.useState(!1),y=ki(l),b=Sl(n),x=O.useRef(!1),[S,C]=O.useState(0);return O.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(vl,y),()=>e.removeEventListener(vl,y)},[y]),(0,F.jsx)(El,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:O.useCallback(e=>g(e),[g]),onItemShiftTab:O.useCallback(()=>v(!0),[]),onFocusableItemAdd:O.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:O.useCallback(()=>C(e=>e-1),[]),children:(0,F.jsx)(xr.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Wr(e.onMouseDown,()=>{x.current=!0}),onFocus:Wr(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(vl,yl);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Fl([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:Wr(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),Al=`RovingFocusGroupItem`,jl=O.forwardRef(_l(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Si(),l=a||c,u=Dl(Al,n),d=u.currentTabStopId===l,f=Sl(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=hl();return Yr(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),O.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,F.jsx)(xl.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,F.jsx)(xr.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Wr(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Wr(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Wr(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Pl(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Il(n,r+1):n.slice(r+1)}setTimeout(()=>Fl(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Ml={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Nl(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}_l(Nl,`getDirectionAwareKey`);function Pl(e,t,n){let r=Nl(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ml[r]}_l(Pl,`getFocusIntent`);function Fl(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}_l(Fl,`focusFirst`);function Il(e,t){return e.map((n,r)=>e[(t+r)%e.length])}_l(Il,`wrapArray`);var Ll=Ol,Rl=jl,zl=Object.defineProperty,Bl=O.forwardRef(((e,t)=>zl(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,F.jsx)(xr.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Vl=Object.defineProperty,Hl=(e,t)=>Vl(e,`name`,{value:t,configurable:!0}),H=`Popover`,[U,W]=Er(H,[Kc]),G=Kc(),[K,Ul]=U(H),Wl=Hl(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=G(t),c=O.useRef(null),[l,u]=O.useState(!1),[d,f]=ii({prop:r,defaultProp:i??!1,onChange:a,caller:H});return(0,F.jsx)(al,{...s,children:(0,F.jsx)(K,{scope:t,contentId:Si(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:O.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:O.useCallback(()=>u(!0),[]),onCustomAnchorRemove:O.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Gl=`PopoverTrigger`,Kl=O.forwardRef(Hl(function(e,t){let{__scopePopover:n,...r}=e,i=Ul(Gl,n),a=G(n),o=$n(t,i.triggerRef),s=(0,F.jsx)(xr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":ru(i.open),...r,ref:o,onClick:Wr(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,F.jsx)(ol,{asChild:!0,...a,children:s})},`PopoverTrigger`)),ql=`PopoverPortal`,[Jl,Yl]=U(ql,{forceMount:void 0}),Xl=Hl(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Ul(ql,t);return(0,F.jsx)(Jl,{scope:t,forceMount:n,children:(0,F.jsx)(fi,{present:n||a.open,children:(0,F.jsx)(aa,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Zl=`PopoverContent`,Ql=O.forwardRef(Hl(function(e,t){let n=Yl(Zl,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Ul(Zl,e.__scopePopover);return(0,F.jsx)(fi,{present:r||a.open,children:a.modal?(0,F.jsx)(eu,{...i,ref:t}):(0,F.jsx)(tu,{...i,ref:t})})},`PopoverContent`)),$l=nr(`PopoverContent.RemoveScroll`),eu=O.forwardRef(Hl(function(e,t){let n=Ul(Zl,e.__scopePopover),r=O.useRef(null),i=$n(t,r),a=O.useRef(!1);return O.useEffect(()=>{let e=r.current;if(e)return Oo(e)},[]),(0,F.jsx)(yo,{as:$l,allowPinchZoom:!0,children:(0,F.jsx)(nu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Wr(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Wr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Wr(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),tu=O.forwardRef(Hl(function(e,t){let n=Ul(Zl,e.__scopePopover),r=O.useRef(!1),i=O.useRef(!1);return(0,F.jsx)(nu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),nu=O.forwardRef(Hl(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Ul(Zl,n),p=G(n);return da(),(0,F.jsx)(Ki,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(L,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,F.jsx)(sl,{"data-state":ru(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function ru(e){return e?`open`:`closed`}Hl(ru,`getState`);var iu=Wl,au=Kl,ou=Xl,su=Ql,cu=Object.defineProperty,lu=(e,t)=>cu(e,`name`,{value:t,configurable:!0}),uu=`horizontal`,du=[`horizontal`,`vertical`],fu=O.forwardRef(lu(function(e,t){let{decorative:n,orientation:r=uu,...i}=e,a=pu(r)?r:uu,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,F.jsx)(xr.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function pu(e){return du.includes(e)}lu(pu,`isValidOrientation`);var mu=fu,hu=Object.defineProperty,gu=(e,t)=>hu(e,`name`,{value:t,configurable:!0}),_u=`Switch`,[vu,yu]=Er(_u),[bu,xu]=vu(_u);function Su(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=ii({prop:n,defaultProp:i??!1,onChange:c,caller:_u}),[m,h]=O.useState(null),[g,_]=O.useState(null),v=O.useRef(!1),[y,b]=O.useReducer(e=>e+1,0),x={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,F.jsx)(bu,{scope:t,...x,children:Au(d)?d(x):r})}gu(Su,`SwitchProvider`);var Cu=`SwitchTrigger`,wu=O.forwardRef(gu(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=xu(Cu,e),g=$n(r,u),_=O.useRef(c);return O.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=gu(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,F.jsx)(xr.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":ju(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:g,onClick:Wr(t,e=>{p(),d(e=>!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),Tu=O.forwardRef(gu(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,F.jsx)(Su,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(wu,{...d,ref:t,__scopeSwitch:n}),e&&(0,F.jsx)(ku,{__scopeSwitch:n})]})})},`Switch`)),Eu=`SwitchThumb`,Du=O.forwardRef(gu(function(e,t){let{__scopeSwitch:n,...r}=e,i=xu(Eu,n);return(0,F.jsx)(xr.span,{"data-state":ju(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),Ou=`SwitchBubbleInput`,ku=O.forwardRef(gu(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=xu(Ou,e),g=$n(r,h),_=jo(i),v=O.useRef(!1),y=O.useRef(s),b=O.useRef(o);O.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==b.current;b.current=o;let i=y.current!==s;y.current=s;let c=!(r&&a.current);if(i&&n){v.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),v.current=!1}},[m,s,a,o]);let x=O.useRef(s);return(0,F.jsx)(xr.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??x.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:Wr(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function Au(e){return typeof e==`function`}gu(Au,`isFunction`);function ju(e){return e?`checked`:`unchecked`}gu(ju,`getState`);var Mu=Object.defineProperty,Nu=(e,t)=>Mu(e,`name`,{value:t,configurable:!0}),Pu=`Toggle`,Fu=O.forwardRef(Nu(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=ii({prop:n,onChange:i,defaultProp:r??!1,caller:Pu});return(0,F.jsx)(xr.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:Wr(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Iu=Object.defineProperty,Lu=(e,t)=>Iu(e,`name`,{value:t,configurable:!0}),Ru=`ToggleGroup`,[zu,Bu]=Er(Ru,[Tl]),Vu=Tl(),Hu=O.forwardRef(Lu(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,F.jsx)(Gu,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,F.jsx)(Ku,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Ru}\``)},`ToggleGroup`)),[Uu,Wu]=zu(Ru),Gu=O.forwardRef(Lu(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Lu(()=>{},`onValueChange`),...a}=e,[o,s]=ii({prop:n,defaultProp:r??``,onChange:i,caller:Ru});return(0,F.jsx)(Uu,{scope:e.__scopeToggleGroup,type:`single`,value:O.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:O.useCallback(()=>s(``),[s]),children:(0,F.jsx)(q,{...a,ref:t})})},`ToggleGroupImplSingle`)),Ku=O.forwardRef(Lu(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Lu(()=>{},`onValueChange`),...a}=e,[o,s]=ii({prop:n,defaultProp:r??[],onChange:i,caller:Ru}),c=O.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=O.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,F.jsx)(Uu,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,F.jsx)(q,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[qu,Ju]=zu(Ru),q=O.forwardRef(Lu(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=Vu(n),u=Ei(o),d={dir:u,...c};return(0,F.jsx)(qu,{scope:n,rovingFocus:i,disabled:r,children:i?(0,F.jsx)(Ll,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,F.jsx)(xr.div,{...d,ref:t})}):(0,F.jsx)(xr.div,{...d,ref:t})})},`ToggleGroupImpl`)),Yu=`ToggleGroupItem`,Xu=O.forwardRef(Lu(function(e,t){let n=Wu(Yu,e.__scopeToggleGroup),r=Ju(Yu,e.__scopeToggleGroup),i=Vu(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=O.useRef(null);return r.rovingFocus?(0,F.jsx)(Rl,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,F.jsx)(Zu,{...s,ref:t})}):(0,F.jsx)(Zu,{...s,ref:t})},`ToggleGroupItem`)),Zu=O.forwardRef(Lu(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=Wu(Yu,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===`single`?o:void 0;return(0,F.jsx)(Fu,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),Qu=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},$u=(e,t)=>({classGroupId:e,validator:t}),ed=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),td=`-`,nd=[],rd=`arbitrary..`,id=e=>{let t=sd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return od(e);let n=e.split(td);return ad(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Qu(i,t):t:i||nd}return n[e]||nd}}},ad=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ad(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(td):e.slice(t).join(td),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},od=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?rd+r:void 0})(),sd=e=>{let{theme:t,classGroups:n}=e;return cd(n,t)},cd=(e,t)=>{let n=ed();for(let r in e){let i=e[r];ld(i,n,r,t)}return n},ld=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ud(i,t,n,r)}},ud=(e,t,n,r)=>{if(typeof e==`string`){dd(e,t,n);return}if(typeof e==`function`){fd(e,t,n,r);return}pd(e,t,n,r)},dd=(e,t,n)=>{let r=e===``?t:md(t,e);r.classGroupId=n},fd=(e,t,n,r)=>{if(hd(e)){ld(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push($u(n,e))},pd=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ld(o,md(t,a),n,r)}},md=(e,t)=>{let n=e,r=t.split(td),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ed(),n.nextPart.set(t,i)),n=i}return n},hd=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,gd=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},_d=`!`,vd=`:`,yd=[],bd=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),xd=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===vd){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(_d)?(c=s.slice(0,-1),l=!0):s.startsWith(_d)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return bd(t,l,c,u)};if(t){let e=t+vd,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):bd(yd,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Sd=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Cd=e=>({cache:gd(e.cacheSize),parseClassName:xd(e),sortModifiers:Sd(e),postfixLookupClassGroupIds:J(e),...id(e)}),J=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},wd=/\s+/,Td=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(wd),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+_d:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ed=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Dd(n))&&(i&&(i+=` `),i+=r);return i},Dd=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Dd(e[r]))&&(n&&(n+=` `),n+=t);return n},Od=(e,...t)=>{let n,r,i,a,o=o=>(n=Cd(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Td(e,n);return i(e,a),a};return a=o,(...e)=>a(Ed(...e))},kd=[],Ad=e=>{let t=t=>t[e]||kd;return t.isThemeGetter=!0,t},jd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Md=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Nd=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Pd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Id=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Y=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ld=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rd=e=>Nd.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),zd=e=>!!e&&Number.isInteger(Number(e)),Bd=e=>e.endsWith(`%`)&&X(e.slice(0,-1)),Vd=e=>Pd.test(e),Hd=()=>!0,Ud=e=>Fd.test(e)&&!Id.test(e),Wd=()=>!1,Gd=e=>Y.test(e),Kd=e=>Ld.test(e),qd=e=>!Z(e)&&!Q(e),Jd=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Yd=e=>df(e,hf,Wd),Z=e=>jd.test(e),Xd=e=>df(e,gf,Ud),Zd=e=>df(e,_f,X),Qd=e=>df(e,yf,Hd),$d=e=>df(e,vf,Wd),ef=e=>df(e,pf,Wd),tf=e=>df(e,mf,Kd),nf=e=>df(e,bf,Gd),Q=e=>Md.test(e),rf=e=>ff(e,gf),af=e=>ff(e,vf),of=e=>ff(e,pf),sf=e=>ff(e,hf),cf=e=>ff(e,mf),lf=e=>ff(e,bf,!0),uf=e=>ff(e,yf,!0),df=(e,t,n)=>{let r=jd.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ff=(e,t,n=!1)=>{let r=Md.exec(e);return r?r[1]?t(r[1]):n:!1},pf=e=>e===`position`||e===`percentage`,mf=e=>e===`image`||e===`url`,hf=e=>e===`length`||e===`size`||e===`bg-size`,gf=e=>e===`length`,_f=e=>e===`number`,vf=e=>e===`family-name`,yf=e=>e===`number`||e===`weight`,bf=e=>e===`shadow`,xf=Od(()=>{let e=Ad(`color`),t=Ad(`font`),n=Ad(`text`),r=Ad(`font-weight`),i=Ad(`tracking`),a=Ad(`leading`),o=Ad(`breakpoint`),s=Ad(`container`),c=Ad(`spacing`),l=Ad(`radius`),u=Ad(`shadow`),d=Ad(`inset-shadow`),f=Ad(`text-shadow`),p=Ad(`drop-shadow`),m=Ad(`blur`),h=Ad(`perspective`),g=Ad(`aspect`),_=Ad(`ease`),v=Ad(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Q,Z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Q,Z,c],T=()=>[Rd,`full`,`auto`,...w()],ee=()=>[zd,`none`,`subgrid`,Q,Z],te=()=>[`auto`,{span:[`full`,zd,Q,Z]},zd,Q,Z],E=()=>[zd,`auto`,Q,Z],D=()=>[`auto`,`min`,`max`,`fr`,Q,Z],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],re=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],O=()=>[`auto`,...w()],k=()=>[Rd,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ie=()=>[Rd,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ae=()=>[Rd,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],A=()=>[e,Q,Z],j=()=>[...b(),of,ef,{position:[Q,Z]}],oe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],se=()=>[`auto`,`cover`,`contain`,sf,Yd,{size:[Q,Z]}],ce=()=>[Bd,rf,Xd],M=()=>[``,`none`,`full`,l,Q,Z],N=()=>[``,X,rf,Xd],P=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ue=()=>[X,Bd,of,ef],de=()=>[``,`none`,m,Q,Z],fe=()=>[`none`,X,Q,Z],pe=()=>[`none`,X,Q,Z],me=()=>[X,Q,Z],he=()=>[Rd,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Vd],breakpoint:[Vd],color:[Hd],container:[Vd],"drop-shadow":[Vd],ease:[`in`,`out`,`in-out`],font:[qd],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Vd],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Vd],shadow:[Vd],spacing:[`px`,X],text:[Vd],"text-shadow":[Vd],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Rd,Z,Q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Q,Z]}],"container-named":[Jd],columns:[{columns:[X,Z,Q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[zd,`auto`,Q,Z]}],basis:[{basis:[Rd,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[X,Rd,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,X,Q,Z]}],shrink:[{shrink:[``,X,Q,Z]}],order:[{order:[zd,`first`,`last`,`none`,Q,Z]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...re(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...re()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...re(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...re(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...re(),`baseline`]}],"place-self":[{"place-self":[`auto`,...re()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:k()}],"inline-size":[{inline:[`auto`,...ie()]}],"min-inline-size":[{"min-inline":[`auto`,...ie()]}],"max-inline-size":[{"max-inline":[`none`,...ie()]}],"block-size":[{block:[`auto`,...ae()]}],"min-block-size":[{"min-block":[`auto`,...ae()]}],"max-block-size":[{"max-block":[`none`,...ae()]}],w:[{w:[s,`screen`,...k()]}],"min-w":[{"min-w":[s,`screen`,`none`,...k()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...k()]}],h:[{h:[`screen`,`lh`,...k()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...k()]}],"max-h":[{"max-h":[`screen`,`lh`,...k()]}],"font-size":[{text:[`base`,n,rf,Xd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,uf,Qd]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Bd,Z]}],"font-family":[{font:[af,$d,t]}],"font-features":[{"font-features":[Z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Q,Z]}],"line-clamp":[{"line-clamp":[X,`none`,Q,Zd]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Q,Z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Q,Z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...P(),`wavy`]}],"text-decoration-thickness":[{decoration:[X,`from-font`,`auto`,Q,Xd]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[X,`auto`,Q,Z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[zd,Q,Z]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Q,Z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Q,Z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:se()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},zd,Q,Z],radial:[``,Q,Z],conic:[zd,Q,Z]},cf,tf]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-bs":[{"border-bs":N()}],"border-w-be":[{"border-be":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":N()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...P(),`hidden`,`none`]}],"divide-style":[{divide:[...P(),`hidden`,`none`]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...P(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[X,Q,Z]}],"outline-w":[{outline:[``,X,rf,Xd]}],"outline-color":[{outline:A()}],shadow:[{shadow:[``,`none`,u,lf,nf]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":[`none`,d,lf,nf]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:N()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[X,Xd]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":[`none`,f,lf,nf]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[X,Q,Z]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Q,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Q,Z]}],filter:[{filter:[``,`none`,Q,Z]}],blur:[{blur:de()}],brightness:[{brightness:[X,Q,Z]}],contrast:[{contrast:[X,Q,Z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,lf,nf]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:[``,X,Q,Z]}],"hue-rotate":[{"hue-rotate":[X,Q,Z]}],invert:[{invert:[``,X,Q,Z]}],saturate:[{saturate:[X,Q,Z]}],sepia:[{sepia:[``,X,Q,Z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Q,Z]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[X,Q,Z]}],"backdrop-contrast":[{"backdrop-contrast":[X,Q,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,X,Q,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,Q,Z]}],"backdrop-invert":[{"backdrop-invert":[``,X,Q,Z]}],"backdrop-opacity":[{"backdrop-opacity":[X,Q,Z]}],"backdrop-saturate":[{"backdrop-saturate":[X,Q,Z]}],"backdrop-sepia":[{"backdrop-sepia":[``,X,Q,Z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Q,Z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[X,`initial`,Q,Z]}],ease:[{ease:[`linear`,`initial`,_,Q,Z]}],delay:[{delay:[X,Q,Z]}],animate:[{animate:[`none`,v,Q,Z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Q,Z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":[`scale-3d`],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[Q,Z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":[`translate-none`],zoom:[{zoom:[zd,Q,Z]}],accent:[{accent:A()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Q,Z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Q,Z]}],fill:[{fill:[`none`,...A()]}],"stroke-w":[{stroke:[X,rf,Xd,Zd]}],stroke:[{stroke:[`none`,...A()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function $(...e){return xf(Gn(e))}var Sf=Jn(`inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-none border font-medium whitespace-nowrap transition-colors disabled:pointer-events-none disabled:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{primary:`border-accent bg-accent text-bg hover:bg-accent-600`,secondary:`border-divider bg-transparent text-ink hover:bg-neutral-200`,ghost:`border-transparent bg-transparent text-ink hover:bg-neutral-200`},size:{default:`h-8 px-4 text-[12px]`,sm:`h-6 px-2 text-[11px]`,icon:`size-8`}},defaultVariants:{variant:`secondary`,size:`default`}});function Cf({className:e,variant:t,size:n,asChild:r=!1,...i}){let a=r?rr:`button`;return(0,F.jsx)(a,{"data-slot":`button`,className:$(Sf({variant:t,size:n,className:e})),...i})}function wf({...e}){return(0,F.jsx)(iu,{"data-slot":`popover`,...e})}function Tf({...e}){return(0,F.jsx)(au,{"data-slot":`popover-trigger`,...e})}function Ef({className:e,align:t=`end`,sideOffset:n=8,...r}){return(0,F.jsx)(ou,{children:(0,F.jsx)(su,{"data-slot":`popover-content`,align:t,sideOffset:n,className:$(`z-50 w-[380px] rounded-none border border-divider bg-bg text-ink shadow-lg outline-none`,e),...r})})}function Df({className:e,...t}){return(0,F.jsx)(`section`,{"data-slot":`card`,className:$(`blueprint flex flex-col bg-bg p-4`,e),...t})}function Of({className:e,...t}){return(0,F.jsx)(`header`,{"data-slot":`card-header`,className:$(`mb-3 flex items-baseline justify-between gap-3`,e),...t})}function kf({className:e,...t}){return(0,F.jsx)(`h2`,{"data-slot":`card-title`,className:$(`eyebrow m-0`,e),...t})}function Af({className:e,...t}){return(0,F.jsx)(`span`,{"data-slot":`card-action`,className:$(`text-[11px] text-neutral-600`,e),...t})}function jf({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-content`,className:$(e),...t})}function Mf({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`skeleton`,className:$(`animate-pulse rounded-none bg-neutral-200`,e),...t})}function Nf({className:e,...t}){return(0,F.jsx)(Hu,{"data-slot":`toggle-group`,className:$(`flex items-stretch border border-divider text-[11px] leading-none`,e),...t})}function Pf({className:e,...t}){return(0,F.jsx)(Xu,{"data-slot":`toggle-group-item`,className:$(`cursor-pointer border-l border-divider bg-transparent px-3 py-2 text-ink transition-colors first:border-l-0 hover:bg-neutral-200 data-[state=on]:bg-accent data-[state=on]:text-bg`,e),...t})}function Ff({title:e,aside:t,className:n,children:r}){return(0,F.jsxs)(Df,{className:n,children:[e&&(0,F.jsxs)(Of,{children:[(0,F.jsx)(kf,{children:e}),t&&(0,F.jsx)(Af,{children:t})]}),(0,F.jsx)(jf,{children:r})]})}function If({options:e,value:t,onPick:n,label:r}){return(0,F.jsx)(Nf,{type:`single`,"aria-label":r,value:t,onValueChange:e=>e&&n(e),children:e.map(e=>(0,F.jsx)(Pf,{value:e.value,children:e.label},e.value))})}function Lf({title:e,aside:t,toolbar:n,children:r}){return(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-baseline justify-between gap-3`,children:[(0,F.jsx)(`h1`,{className:`m-0 text-[34px]`,children:e}),t]}),n,(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:r})]})}function Rf({className:e,children:t}){return(0,F.jsx)(`div`,{className:$(`min-h-0 flex-1 overflow-auto`,e),children:t})}function zf({value:e}){return e.state===`loading`?(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5 py-2`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:`reading`}),(0,F.jsx)(Mf,{className:`h-3 w-2/5`}),(0,F.jsx)(Mf,{className:`h-3 w-3/5`}),(0,F.jsx)(Mf,{className:`h-3 w-1/3`})]}):e.state===`error`?(0,F.jsx)(`div`,{className:`border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:e.message}):null}function Bf({children:e}){return(0,F.jsx)(`div`,{className:`py-2 text-[12px] text-neutral-500`,children:e})}async function Vf(e){let t=await fetch(e);if(!t.ok)throw Error(`${e} answered ${t.status}`);return await t.json()}function Hf(e){let[t,n]=(0,O.useState)({state:`loading`});return(0,O.useEffect)(()=>{let t=!0;return n({state:`loading`}),Vf(e).then(e=>t&&n({state:`ready`,data:e})).catch(e=>t&&n({state:`error`,message:e.message})),()=>{t=!1}},[e]),t}async function Uf(e,t){try{let n=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return n.ok?null:(await n.json().catch(()=>null))?.error??`${e} answered ${n.status}`}catch(e){return e instanceof Error?e.message:String(e)}}function Wf(e,t,n){return Uf(`/api/isc`,{project:e,id:t,status:n})}function Gf(e,t){return Uf(`/api/placement`,{project:e,quadrant:t})}function Kf(e,t){return Uf(`/api/serves`,{project:e,serves:t})}function qf(e){return Uf(`/api/settings`,e)}function Jf(e,t,n){return Uf(`/api/snooze`,{project:e,id:t,days:n})}function Yf(e){return Uf(`/api/prefs`,e)}function Xf(e){return Uf(`/api/update`,{enabled:e})}function Zf(){return Uf(`/api/update/run`,{})}var Qf={alarm:`bg-alarm`,waiting:`bg-accent`,note:`bg-neutral-400`};function $f(){return(0,F.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9`}),(0,F.jsx)(`path`,{d:`M10.3 21a1.94 1.94 0 0 0 3.4 0`})]})}function ep({item:e,onOpen:t}){return(0,F.jsxs)(`button`,{type:`button`,onClick:t,className:$(`grid w-full cursor-pointer grid-cols-[8px_1fr_auto] items-start gap-3 border-b border-divider px-4 py-3 text-left last:border-b-0 hover:bg-neutral-200`,e.read&&`opacity-55`),children:[(0,F.jsx)(`span`,{className:$(`mt-1.5 size-1.5`,Qf[e.severity])}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`block font-medium`,children:e.title}),(0,F.jsx)(`span`,{className:`block text-[12px] text-neutral-700`,children:e.detail})]}),(0,F.jsx)(`span`,{className:`text-[11px] whitespace-nowrap text-neutral-600`,children:e.at.slice(5,10)})]})}function tp(){let[e,t]=(0,O.useState)(0),[n,r]=(0,O.useState)(!1),i=Hf(`/api/attention?v=${e}`),a=pt(),o=()=>t(e=>e+1),s=i.state===`ready`?i.data.unread:0,c=e=>{Uf(`/api/attention/read`,{ids:[e.id]}).then(()=>{r(!1),o(),a(e.href)})};return(0,F.jsxs)(wf,{open:n,onOpenChange:r,children:[(0,F.jsx)(Tf,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-label":`${s} things need you`,className:`relative cursor-pointer border border-transparent p-1.5 text-ink hover:border-divider`,children:[(0,F.jsx)($f,{}),s>0&&(0,F.jsx)(`span`,{className:`absolute -top-1 -right-1 grid min-w-4 place-items-center bg-accent-900 px-1 text-[10px] font-semibold text-bg tabular-nums`,children:s})]})}),(0,F.jsxs)(Ef,{className:`max-h-[70vh] overflow-auto`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between border-b border-divider px-4 py-2.5`,children:[(0,F.jsx)(`h2`,{className:`font-heading m-0 text-[16px] font-semibold`,children:`Needs your attention`}),(0,F.jsx)(Cf,{variant:`ghost`,size:`sm`,onClick:()=>{Uf(`/api/attention/read`,{all:!0}).then(o)},children:`mark all read`})]}),i.state===`ready`&&i.data.items.length===0?(0,F.jsx)(`div`,{className:`px-4`,children:(0,F.jsx)(Bf,{children:`Nothing is waiting on you.`})}):i.state===`ready`&&i.data.items.map(e=>(0,F.jsx)(ep,{item:e,onOpen:()=>c(e)},e.id))]})]})}var np=[`applied`,`failed`,`denied`,`blocked`],rp=Jn(`inline-flex w-fit shrink-0 items-center justify-center gap-1 rounded-none border border-transparent px-2 py-0.5 text-[10px] whitespace-nowrap [&>svg]:size-3`,{variants:{variant:{accent:`bg-accent-100 text-accent-900`,neutral:`bg-neutral-200 text-neutral-800`,outline:`border-divider text-neutral-700`,alarm:`border-alarm/40 bg-alarm/10 text-alarm`}},defaultVariants:{variant:`neutral`}});function ip({className:e,variant:t,asChild:n=!1,...r}){let i=n?rr:`span`;return(0,F.jsx)(i,{"data-slot":`badge`,className:$(rp({variant:t}),e),...r})}var ap=`h-8 rounded-none border border-divider bg-bg px-2 text-[12px] text-ink outline-none transition-colors focus-visible:border-accent disabled:pointer-events-none disabled:opacity-45`;function op({className:e,type:t,...n}){return(0,F.jsx)(`input`,{type:t,"data-slot":`input`,className:$(ap,e),...n})}function sp({className:e,...t}){return(0,F.jsx)(`select`,{"data-slot":`native-select`,className:$(ap,`cursor-pointer`,e),...t})}function cp({className:e,...t}){return(0,F.jsx)(Bl,{"data-slot":`label`,className:$(`eyebrow flex items-center gap-2 select-none`,e),...t})}function lp({className:e,...t}){return(0,F.jsx)(`table`,{"data-slot":`table`,className:$(`w-full border-separate border-spacing-0 text-left`,e),...t})}function up({className:e,...t}){return(0,F.jsx)(`thead`,{"data-slot":`table-header`,className:$(e),...t})}function dp({className:e,...t}){return(0,F.jsx)(`tbody`,{"data-slot":`table-body`,className:$(e),...t})}function fp({className:e,...t}){return(0,F.jsx)(`tr`,{"data-slot":`table-row`,className:$(`transition-colors hover:bg-neutral-200/50`,e),...t})}function pp({className:e,...t}){return(0,F.jsx)(`th`,{"data-slot":`table-head`,className:$(`eyebrow sticky top-0 z-10 bg-bg px-3 py-2 shadow-[0_1px_0_var(--color-divider)]`,e),...t})}function mp({className:e,...t}){return(0,F.jsx)(`td`,{"data-slot":`table-cell`,className:$(`border-b border-divider/60 px-3 py-2 align-top`,e),...t})}function hp(e){return e===0?`today`:e===1?`1d`:e<30?`${e}d`:e<60?`1mo`:`${Math.floor(e/30)}mo`}function gp(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.toISOString().slice(0,10)} ${t.toTimeString().slice(0,5)}`}function _p(e){return e.toFixed(1)}var vp=200,yp=[`when`,`machine`,`actor`,`action`,`target`,`change`,`outcome`],bp=[`project`,`runtime`,`machine`,`authority`,`outcome`,`since`,`until`],xp=[`user`,`agent`],Sp=[`claude`,`cursor`,`codex`,`copilot`,`opencode`,`unknown`],Cp={project:``,runtime:``,machine:``,authority:``,outcome:``,since:``,until:``};function wp(e){return e.state===`ready`?[...new Set(e.data.rows.map(e=>e.machine))].filter(Boolean).sort():[]}function Tp(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r&&t.set(n,r);let n=t.toString();return n?`/api/ledger?${n}`:`/api/ledger`}function Ep(e){return e===`applied`?`neutral`:e===`failed`?`outline`:`alarm`}function Dp({label:e,control:t}){let n=(0,O.useId)();return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(cp,{htmlFor:n,children:e}),t(n)]})}function Op({view:e}){let t=[{n:e.stats.total,label:`actions`},{n:e.stats.refusals,label:`refusals`},...np.map(t=>({n:e.stats.outcomes[t].total,label:t}))];return(0,F.jsx)(`div`,{className:`mb-4 grid grid-cols-2 gap-px border border-divider bg-divider sm:grid-cols-3 lg:grid-cols-6`,children:t.map(e=>(0,F.jsxs)(`div`,{className:`bg-bg px-3 py-2.5`,children:[(0,F.jsx)(`div`,{className:`font-heading text-[26px] leading-none font-semibold tabular-nums`,children:e.n}),(0,F.jsx)(`div`,{className:`eyebrow`,children:e.label})]},e.label))})}function kp({r:e,open:t,onToggle:n}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(fp,{className:`cursor-pointer`,onClick:n,children:[(0,F.jsx)(mp,{className:`whitespace-nowrap text-neutral-700`,children:gp(e.ts)}),(0,F.jsx)(mp,{className:`whitespace-nowrap`,children:e.machine}),(0,F.jsxs)(mp,{children:[e.actor,(0,F.jsxs)(`span`,{className:`block text-[11px] text-neutral-600`,children:[e.authority,` · `,e.runtime]})]}),(0,F.jsx)(mp,{className:`font-mono text-[11.5px]`,children:e.tool}),(0,F.jsx)(mp,{title:e.target,children:e.target}),(0,F.jsx)(mp,{className:`whitespace-nowrap text-neutral-700`,children:e.change}),(0,F.jsxs)(mp,{children:[(0,F.jsx)(ip,{variant:Ep(e.outcome),children:e.outcome}),e.reason&&(0,F.jsx)(`span`,{className:`block max-w-[220px] text-[11px] text-neutral-700`,children:e.reason})]})]}),t&&(e.command||e.reason)&&(0,F.jsx)(fp,{children:(0,F.jsx)(mp,{colSpan:yp.length,className:`bg-neutral-200`,children:(0,F.jsxs)(`pre`,{className:`m-0 font-mono text-[11.5px] whitespace-pre-wrap`,children:[e.command?`$ ${e.command}\n`:``,e.reason??``]})})})]})}function Ap({filter:e,onFilter:t}){let n=Hf(`/api/projects`),r=Hf(Tp(e)),[i,a]=(0,O.useState)(null),o=(n,r,i=`all`)=>(0,F.jsx)(Dp,{label:n,control:a=>(0,F.jsxs)(sp,{id:a,value:e[n],onChange:e=>t({[n]:e.target.value}),children:[(0,F.jsx)(`option`,{value:``,children:i}),r.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})});return(0,F.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-end gap-3`,children:[o(`project`,n.state===`ready`?n.data.map(e=>e.slug):[]),o(`runtime`,Sp),o(`machine`,wp(r),`both`),o(`authority`,xp),o(`outcome`,np),(0,F.jsx)(Dp,{label:`since`,control:n=>(0,F.jsx)(op,{id:n,type:`date`,value:e.since,onChange:e=>t({since:e.target.value})})}),(0,F.jsx)(Dp,{label:`until`,control:n=>(0,F.jsx)(op,{id:n,type:`date`,value:e.until,onChange:e=>t({until:e.target.value})})}),(0,F.jsx)(Cf,{variant:`secondary`,onClick:()=>t(Cp),children:`reset`})]}),(0,F.jsx)(zf,{value:r}),r.state===`ready`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Op,{view:r.data}),(0,F.jsx)(`div`,{className:`blueprint flex min-h-0 flex-1 flex-col bg-bg`,children:r.data.rows.length===0?(0,F.jsx)(Bf,{children:`No actions in this window.`}):(0,F.jsx)(Rf,{children:(0,F.jsxs)(lp,{className:`min-w-[880px] text-[12.5px]`,children:[(0,F.jsx)(up,{children:(0,F.jsx)(`tr`,{children:yp.map(e=>(0,F.jsx)(pp,{children:e},e))})}),(0,F.jsx)(dp,{children:r.data.rows.slice(0,vp).map(e=>(0,F.jsx)(kp,{r:e,open:i===e.id,onToggle:()=>a(i===e.id?null:e.id)},e.id))})]})})}),r.data.rows.length>vp&&(0,F.jsxs)(`p`,{className:`pt-2 text-[12px] text-neutral-500`,children:[`Newest `,vp,` of `,r.data.rows.length,`. Narrow the window for the rest.`]})]})]})}function jp({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,F.jsx)(mu,{"data-slot":`separator`,decorative:n,orientation:t,className:$(`shrink-0 bg-divider data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}var Mp={open:``,done:`✓`,retired:`~`},Np=7;function Pp(e){return e===`applied`?`neutral`:e===`failed`?`outline`:`alarm`}function Fp({slug:e,iscs:t,onChanged:n}){let[r,i]=(0,O.useState)(null);if(t.length===0)return(0,F.jsx)(Bf,{children:`No criteria written yet.`});let a=t=>{Wf(e,t.id,t.status===`open`?`done`:`open`).then(e=>{i(e),e||n()})};return(0,F.jsxs)(F.Fragment,{children:[r&&(0,F.jsx)(`p`,{className:`mb-2 border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:r}),(0,F.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:t.map(t=>(0,F.jsxs)(`li`,{className:$(`grid grid-cols-[18px_58px_minmax(0,1fr)] items-start gap-3 border-b border-divider/60 py-2 last:border-b-0`,t.status!==`open`&&`opacity-60`),children:[(0,F.jsxs)(`button`,{type:`button`,disabled:t.status===`retired`,onClick:()=>a(t),title:t.status===`open`?`close this criterion`:`reopen it`,className:$(`mt-0.5 grid size-3.5 cursor-pointer place-items-center border border-neutral-500 text-[10px] leading-none text-bg hover:border-accent disabled:cursor-default`,t.status===`done`&&`bg-accent`,t.status===`retired`&&`bg-neutral-400`),children:[Mp[t.status],(0,F.jsx)(`span`,{className:`sr-only`,children:t.status})]}),(0,F.jsxs)(`span`,{className:`pt-px text-[11.5px] text-neutral-600`,children:[`ISC-`,t.id]}),(0,F.jsxs)(`span`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`span`,{className:`text-pretty`,children:[t.text,t.snoozedUntil&&(0,F.jsxs)(`span`,{className:`block text-[11.5px] text-neutral-600`,children:[`snoozed until `,t.snoozedUntil]})]}),t.status===`open`&&(0,F.jsx)(Cf,{variant:`ghost`,size:`sm`,onClick:()=>{Jf(e,t.id,t.snoozedUntil?0:Np).then(e=>{i(e),e||n()})},children:t.snoozedUntil?`wake`:`snooze ${Np}d`})]})]},t.id))})]})}function Ip({decisions:e}){return e.length===0?(0,F.jsx)(Bf,{children:`Nothing recorded.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5 text-[12.5px]`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[78px_1fr] gap-3`,children:[(0,F.jsx)(`span`,{className:`text-[11.5px] text-neutral-600`,children:e.date??`—`}),(0,F.jsxs)(`span`,{children:[e.text,e.why&&(0,F.jsxs)(`span`,{className:`text-neutral-600`,children:[` — `,e.why]})]})]},e.text))})}function Lp({runtimes:e}){let t=Object.entries(e);if(t.length===0)return(0,F.jsx)(Bf,{children:`No recorded actions in the window.`});let n=Math.max(1,...t.map(([,e])=>e));return(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:t.map(([e,t])=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[70px_1fr_32px] items-center gap-2 text-[12px]`,children:[(0,F.jsx)(`span`,{children:e}),(0,F.jsx)(`span`,{className:`h-1.5 bg-neutral-300`,children:(0,F.jsx)(`span`,{className:`block h-1.5 bg-accent`,style:{width:`${t/n*100}%`}})}),(0,F.jsx)(`span`,{className:`text-right tabular-nums text-neutral-700`,children:t})]},e))})}function Rp({rows:e}){return e.length===0?(0,F.jsx)(Bf,{children:`Nothing recorded yet.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[86px_1fr_auto] gap-2 text-[11.5px]`,children:[(0,F.jsx)(`span`,{className:`text-neutral-600`,children:gp(e.ts).slice(5)}),(0,F.jsxs)(`span`,{className:`truncate`,children:[(0,F.jsx)(`b`,{className:`font-medium`,children:e.tool}),` `,(0,F.jsx)(`span`,{className:`text-neutral-700`,children:e.target})]}),(0,F.jsx)(ip,{variant:Pp(e.outcome),children:e.outcome})]},e.id))})}function zp({d:e}){let t=e.iscs.filter(e=>e.status===`open`).length;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`nav`,{className:`mb-1.5 text-[12px] text-neutral-600`,children:[(0,F.jsx)(jn,{to:`/projects`,className:`hover:text-accent`,children:`projects`}),` `,`/ `,e.slug]}),(0,F.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-start justify-between gap-6`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`m-0 flex items-center gap-3 text-[38px]`,children:[e.slug,(0,F.jsx)(ip,{variant:`neutral`,children:e.status})]}),(0,F.jsx)(`p`,{className:`max-w-[760px] text-[13px] text-pretty text-neutral-800`,children:e.goal||e.purpose})]}),(0,F.jsxs)(`div`,{className:`text-right text-[11.5px] text-neutral-600`,children:[(0,F.jsx)(`div`,{children:e.remote??`no remote on record`}),(0,F.jsx)(`div`,{children:e.path??`not checked out here`}),(0,F.jsxs)(`div`,{children:[t,` open · serves `,e.serves??`nothing on record`,e.servesBy&&` · ${e.servesBy}`]})]})]})]})}function Bp({slug:e}){let[t,n]=(0,O.useState)(0),r=Hf(`/api/project?slug=${encodeURIComponent(e)}&v=${t}`);if(r.state!==`ready`)return(0,F.jsx)(zf,{value:r});let i=r.data;return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(zp,{d:i}),(0,F.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_340px]`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,F.jsx)(Ff,{title:`Ideal state criteria`,aside:`changes here write to the record directly · no agent, no tokens`,children:(0,F.jsx)(Fp,{slug:i.slug,iscs:i.iscs,onChanged:()=>n(e=>e+1)})}),(0,F.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-2`,children:[(0,F.jsx)(Ff,{title:`Next`,children:i.next.length===0?(0,F.jsx)(Bf,{children:`nothing queued`}):(0,F.jsx)(`ol`,{className:`m-0 flex list-decimal flex-col gap-1.5 pl-5 text-[12.5px]`,children:i.next.map(e=>(0,F.jsx)(`li`,{children:e},e))})}),(0,F.jsx)(Ff,{title:`Blockers`,children:i.blockers.length===0?(0,F.jsx)(Bf,{children:`none`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5 text-[12.5px]`,children:i.blockers.map(e=>(0,F.jsx)(`p`,{className:`bg-accent-100 px-2 py-1.5 text-accent-900`,children:e},e))})})]}),(0,F.jsx)(Ff,{title:`Decisions`,children:(0,F.jsx)(Ip,{decisions:i.decisions})})]}),(0,F.jsxs)(`aside`,{className:`flex flex-col gap-6`,children:[(0,F.jsx)(Ff,{title:`Handoff`,children:i.handoff?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{className:`text-[12.5px] text-pretty`,title:i.handoff.full,children:i.handoff.sentence}),i.handoff.waitingOn&&(0,F.jsxs)(`p`,{className:`mt-2 bg-accent-100 px-2 py-1.5 text-[12px] text-accent-900`,children:[`waiting on you · `,i.handoff.waitingOn]})]}):(0,F.jsx)(Bf,{children:`No handoff. Every session on this project closed cleanly.`})}),(0,F.jsxs)(Ff,{title:`Agents on this project · 14d`,aside:(0,F.jsx)(jn,{to:`/log?project=${encodeURIComponent(i.slug)}`,className:`hover:text-accent`,children:`full log →`}),children:[(0,F.jsx)(Lp,{runtimes:i.runtimes}),(0,F.jsx)(jp,{className:`my-3`}),(0,F.jsx)(Rp,{rows:i.recent})]}),(0,F.jsx)(Ff,{title:`Context`,children:i.context.length===0?(0,F.jsx)(Bf,{children:`nothing recorded`}):(0,F.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-4 text-[12.5px]`,children:i.context.map(e=>(0,F.jsx)(`li`,{children:e},e))})})]})]})]})}var Vp=[{value:`ranked`,label:`active + paused`},{value:`active`,label:`active`},{value:`paused`,label:`paused`},{value:`all`,label:`all`}];function Hp(e){return Vp.some(t=>t.value===e)}var Up=new Set([`active`,`paused`]),Wp=[{label:`Project`,numeric:!1},{label:`Status`,numeric:!1},{label:`Serves`,numeric:!1},{label:`Open ISCs`,numeric:!0},{label:`Sessions / 30d`,numeric:!0},{label:`Agents`,numeric:!1},{label:`Here`,numeric:!1},{label:`Touched`,numeric:!0}];function Gp(e,t){return t===`all`?!0:t===`ranked`?Up.has(e.status):e.status===t}function Kp({card:e}){return(0,F.jsxs)(fp,{children:[(0,F.jsxs)(mp,{children:[(0,F.jsx)(jn,{to:`/projects/${e.slug}`,className:`font-heading text-[15px] font-semibold text-ink hover:text-accent`,children:e.slug}),e.next[0]&&(0,F.jsx)(`span`,{className:`block text-[11.5px] text-neutral-700`,children:e.next[0]})]}),(0,F.jsx)(mp,{children:(0,F.jsx)(ip,{variant:`neutral`,children:e.status})}),(0,F.jsxs)(mp,{className:`text-[12px]`,children:[e.serves??`unranked`,e.servesBy&&(0,F.jsxs)(`span`,{className:`ml-1 text-[10.5px] text-neutral-600`,children:[`· `,e.servesBy]})]}),(0,F.jsx)(mp,{className:`font-heading text-right text-[16px] font-semibold tabular-nums`,children:e.openIscs}),(0,F.jsx)(mp,{className:`text-right tabular-nums`,children:e.sessions30d}),(0,F.jsx)(mp,{children:(0,F.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:Object.entries(e.runtimes).map(([e,t])=>(0,F.jsxs)(ip,{variant:`outline`,children:[e,` `,t]},e))})}),(0,F.jsx)(mp,{className:`text-[12px] text-neutral-700`,children:e.path??`not checked out here`}),(0,F.jsx)(mp,{className:`text-right text-[12px] whitespace-nowrap text-neutral-700`,children:hp(e.ageDays)})]})}function qp({filter:e}){let t=Hf(`/api/board`);if(t.state!==`ready`)return(0,F.jsx)(zf,{value:t});let n=t.data.filter(t=>Gp(t,e));return(0,F.jsx)(`div`,{className:`blueprint flex min-h-0 flex-1 flex-col bg-bg`,children:n.length===0?(0,F.jsx)(Bf,{children:`No project matches this filter.`}):(0,F.jsx)(Rf,{children:(0,F.jsxs)(lp,{className:`min-w-[880px] text-[13px]`,children:[(0,F.jsx)(up,{children:(0,F.jsx)(`tr`,{children:Wp.map(e=>(0,F.jsx)(pp,{className:$(e.numeric&&`text-right`),children:e.label},e.label))})}),(0,F.jsx)(dp,{children:n.map(e=>(0,F.jsx)(Kp,{card:e},e.slug))})]})})})}function Jp({className:e,...t}){return(0,F.jsx)(Tu,{"data-slot":`switch`,className:$(`inline-flex h-4 w-7 shrink-0 cursor-pointer items-center border border-divider transition-colors data-[state=checked]:bg-accent data-[state=unchecked]:bg-transparent`,e),...t,children:(0,F.jsx)(Du,{"data-slot":`switch-thumb`,className:`block size-2.5 transition-transform data-[state=checked]:translate-x-3.5 data-[state=checked]:bg-bg data-[state=unchecked]:translate-x-0.5 data-[state=unchecked]:bg-neutral-500`})})}function Yp({label:e,hint:t,value:n,onChange:r}){return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(cp,{children:e}),(0,F.jsx)(`span`,{className:`text-[11px] text-neutral-600`,children:t}),(0,F.jsx)(op,{value:n,onChange:e=>r(e.target.value)})]})}function Xp({initial:e}){let[t,n]=(0,O.useState)(e),[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(!1),s=t.actor!==e.actor||t.timezone!==e.timezone;return(0,O.useEffect)(()=>{s&&o(!1)},[s]),(0,F.jsx)(Ff,{title:`This install`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(Yp,{label:`actor`,hint:`who caused a record — this travels with an export`,value:t.actor,onChange:e=>n({...t,actor:e})}),(0,F.jsx)(Yp,{label:`timezone`,hint:`how dates are read, e.g. Europe/Budapest`,value:t.timezone,onChange:e=>n({...t,timezone:e})}),r&&(0,F.jsx)(`p`,{className:`border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:r}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(Cf,{variant:`primary`,disabled:!s,onClick:()=>{qf({...t}).then(e=>{i(e),o(e===null)})},children:`Save`}),a&&(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-600`,children:`saved`})]})]})})}function Zp(e){return e.finishedAt??e.attemptedAt??e.skippedAt??``}function Qp(e){if(!e)return`never run`;let t=Zp(e),n=t?` · ${gp(t)}`:``;return t&&t===e.skippedAt?`waited — ${e.skipped}${n}`:e.finishedAt?e.ok?`updated ${e.from} → ${e.to}${n}`:`failed — ${e.error??`unknown error`}${n}`:`running since ${gp(e.attemptedAt??``)}`}function $p(e){return e.available&&e.latest?`${e.current} → ${e.latest}`:`${e.current} · up to date`}function em({initial:e}){let[t,n]=(0,O.useState)(e),[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(!1),s=()=>{fetch(`/api/update`).then(e=>e.json()).then(n).catch(()=>i(`could not read update status`))};return(0,F.jsx)(Ff,{title:`Updates`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[12.5px]`,children:[(0,F.jsx)(`span`,{children:`update once a day, at session start`}),(0,F.jsx)(Jp,{"aria-label":`update once a day`,checked:t.enabled,onCheckedChange:e=>{n({...t,enabled:e}),Xf(e).then(r=>{i(r),r&&n({...t,enabled:!e})})}})]}),(0,F.jsxs)(`dl`,{className:`m-0 grid grid-cols-[110px_1fr] gap-y-1.5 text-[12.5px]`,children:[(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`version`}),(0,F.jsx)(`dd`,{className:`m-0 tabular-nums`,children:$p(t)}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`last run`}),(0,F.jsx)(`dd`,{className:`m-0`,children:Qp(t.last)})]}),r&&(0,F.jsx)(`p`,{className:`border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:r}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(Cf,{variant:`primary`,disabled:a,onClick:()=>{o(!0),Zf().then(e=>{i(e),setTimeout(()=>{o(!1),s()},4e3)})},children:a?`Updating…`:`Update now`}),t.mode===`repo`&&(0,F.jsx)(`span`,{className:`text-[11px] text-neutral-600`,children:`waits if this clone has uncommitted changes`})]})]})})}var tm={refusals:`A hook blocked a call, or you denied one`,waiting:`A handoff left a question for you`,unranked:`A project has no purpose on record`},nm=[{key:`quietAfterDays`,label:`a project is "gone quiet" after`},{key:`urgentWithinDays`,label:`a dated step is urgent within`}];function rm({initial:e}){let[t,n]=(0,O.useState)(e),[r,i]=(0,O.useState)(null),a=e=>{Yf(e).then(r=>{i(r),r||n({...t,...e})})};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ff,{title:`Ranking`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[nm.map(({key:e,label:r})=>(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(cp,{children:r}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(op,{type:`number`,min:1,max:365,className:`w-20`,value:t[e],onChange:r=>{let i=Number(r.target.value);n({...t,[e]:i}),Number.isInteger(i)&&i>0&&a({[e]:i})}}),(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-700`,children:`days`})]})]},e)),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-divider pt-3 text-[12.5px]`,children:[(0,F.jsx)(`span`,{children:`rank stated goals in the grid, not just projects`}),(0,F.jsx)(Jp,{"aria-label":`rank stated goals in the grid`,checked:t.rankGoals,onCheckedChange:e=>a({rankGoals:e})})]}),r&&(0,F.jsx)(`p`,{className:`border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:r})]})}),(0,F.jsxs)(Ff,{title:`Attention`,children:[(0,F.jsx)(`p`,{className:`mb-3 text-[12px] text-neutral-700`,children:`What lights the bell. Each source is a fact PAL already holds — nothing here asks a model.`}),(0,F.jsx)(`div`,{className:`flex flex-col`,children:Object.entries(t.attention).map(([e,t])=>(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-divider py-2.5 text-[12.5px] first:border-t-0`,children:[(0,F.jsx)(`span`,{children:tm[e]??e}),(0,F.jsx)(Jp,{"aria-label":tm[e]??e,checked:t,onCheckedChange:t=>a({attention:{[e]:t}})})]},e))})]})]})}function im(){let e=Hf(`/api/settings`),t=Hf(`/api/prefs`),n=Hf(`/api/status`),r=Hf(`/api/update`);return e.state===`ready`?(0,F.jsxs)(`div`,{className:`grid items-start gap-6 md:grid-cols-2`,children:[(0,F.jsx)(Xp,{initial:e.data}),t.state===`ready`&&(0,F.jsx)(rm,{initial:t.data}),r.state===`ready`&&(0,F.jsx)(em,{initial:r.data}),(0,F.jsxs)(Ff,{title:`Where it runs`,children:[n.state===`ready`?(0,F.jsxs)(`dl`,{className:`m-0 grid grid-cols-[110px_1fr] gap-y-1.5 text-[12.5px]`,children:[(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`machine`}),(0,F.jsx)(`dd`,{className:`m-0`,children:n.data.machine}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`port`}),(0,F.jsx)(`dd`,{className:`m-0 tabular-nums`,children:n.data.port}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`pid`}),(0,F.jsx)(`dd`,{className:`m-0 tabular-nums`,children:n.data.pid}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`ledger`}),(0,F.jsxs)(`dd`,{className:`m-0`,children:[n.data.ledgerFiles,` file(s)`]}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`up since`}),(0,F.jsx)(`dd`,{className:`m-0`,children:n.data.startedAt})]}):(0,F.jsx)(Bf,{children:`not answering`}),(0,F.jsxs)(`p`,{className:`mt-3 text-[11px] text-neutral-600`,children:[`Loopback only. The machine label is set with `,(0,F.jsx)(`code`,{children:`pal cli machine`}),`, and stays on this machine.`]})]})]}):(0,F.jsx)(zf,{value:e})}var am=[`goal`,`revenue`,`fun`];function om({item:e,onSaved:t}){return e.kind===`project`?(0,F.jsxs)(sp,{"aria-label":`what ${e.label} serves`,value:e.serves??``,title:e.servesBy===`user`?`your answer`:`PAL's guess — change it to correct it`,onChange:n=>{Kf(e.id,n.target.value).then(t)},className:$(`h-auto py-0.5 text-[10px]`,e.servesBy===`user`&&`border-accent bg-accent-100 text-accent-900`),children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`unranked`}),am.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]}):null}var sm=[{value:``,label:`let PAL place it`},{value:`now`,label:`Do now`},{value:`plan`,label:`Give it a slot`},{value:`noise`,label:`Loud, not load-bearing`},{value:`later`,label:`Let it sit`}];function cm({item:e,onSaved:t}){return e.kind===`project`?(0,F.jsx)(sp,{"aria-label":`where ${e.label} belongs`,value:e.placed??``,title:e.placed?`your placement`:`placed by PAL — change it to overrule`,onChange:n=>{Gf(e.id,n.target.value||null).then(t)},className:$(`h-auto py-0.5 text-[10px]`,e.placed&&`border-accent bg-accent-100 text-accent-900`),children:sm.map(e=>(0,F.jsx)(`option`,{value:e.value,children:e.label},e.value))}):null}function lm({item:e}){return(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.urgentBecause.map(e=>(0,F.jsx)(ip,{variant:`accent`,children:e},e)),(0,F.jsx)(ip,{variant:`neutral`,children:e.importantBecause})]})}function um({item:e,onSaved:t}){let n=e.kind===`project`;return(0,F.jsxs)(`article`,{className:`flex flex-col gap-2 border border-divider bg-bg px-3 py-3 hover:border-accent`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n?(0,F.jsx)(jn,{to:`/projects/${e.id}`,className:`font-heading text-[16px] font-semibold text-ink hover:text-accent`,children:e.label}):(0,F.jsx)(`span`,{className:`font-heading text-[16px] font-semibold text-ink`,children:e.label}),n?(0,F.jsx)(om,{item:e,onSaved:t}):(0,F.jsx)(ip,{variant:`accent`,children:`goal`}),(0,F.jsx)(`span`,{className:`ml-auto text-[11px] whitespace-nowrap text-neutral-600`,children:e.due??``})]}),e.waitingOn&&(0,F.jsxs)(`p`,{className:`bg-accent-100 px-2 py-1.5 text-[12px] text-accent-900`,children:[`waiting on you · `,e.waitingOn]}),e.detail&&(0,F.jsx)(`p`,{className:`text-[12px] text-neutral-800`,children:e.detail}),(0,F.jsx)(lm,{item:e}),n&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-divider/60 pt-2`,children:[(0,F.jsx)(`span`,{className:`eyebrow`,children:`placed`}),(0,F.jsx)(cm,{item:e,onSaved:t})]})]})}function dm({moves:e,size:t=`compact`}){return e.length===0?(0,F.jsx)(Bf,{children:`No moves yet. They are written when a session ends — finish one and come back.`}):(0,F.jsx)(`ol`,{className:`flex list-none flex-col gap-0 p-0`,children:e.map((e,n)=>(0,F.jsxs)(`li`,{className:$(`grid items-start gap-4 border-t border-divider py-4 first:border-t-0`,t===`large`?`grid-cols-[44px_1fr]`:`grid-cols-[26px_1fr]`),children:[(0,F.jsx)(`span`,{className:$(`font-heading leading-none font-semibold text-accent`,t===`large`?`text-[40px]`:`text-[22px]`),children:String(n+1).padStart(2,`0`)}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:$(`block font-medium text-pretty`,t===`large`&&`font-heading text-[22px] leading-tight font-semibold`),children:e.move}),(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-700`,children:e.because})]})]},e.move))})}function fm({cards:e}){return e.length===0?(0,F.jsx)(Bf,{children:`Nothing in progress. Every handoff is closed.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsxs)(`span`,{className:`flex justify-between gap-2 text-[11px] text-neutral-600`,children:[e.slug?(0,F.jsx)(jn,{to:`/projects/${e.slug}`,className:`font-semibold text-ink hover:text-accent`,children:e.label}):(0,F.jsx)(`b`,{className:`font-semibold text-ink`,children:e.label}),(0,F.jsxs)(`span`,{children:[e.source,` · `,hp(e.ageDays)]})]}),(0,F.jsx)(`span`,{className:`text-[12.5px] text-pretty`,title:e.handoff,children:e.sentence})]},e.cwd))})}function pm({goals:e}){return e.length===0?(0,F.jsx)(Bf,{children:`No goals written down yet.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex justify-between gap-2 text-[12.5px]`,children:[(0,F.jsx)(`span`,{className:`text-pretty`,children:e.label}),(0,F.jsx)(`span`,{className:`text-[11px] whitespace-nowrap text-neutral-600`,children:e.due??e.detail})]}),(0,F.jsxs)(`div`,{className:`mt-1 text-[11px] text-neutral-600`,children:[e.progress?`${e.progress.closed} of ${e.progress.written} criteria closed · served by ${e.progress.projects.join(`, `)}`:`no project serves this yet`,e.urgentBecause.length>0&&` · ${e.urgentBecause.join(` · `)}`]})]},e.id))})}var mm=[{value:`matrix`,label:`matrix`},{value:`list`,label:`list`},{value:`briefing`,label:`briefing`}];function hm(e){return mm.some(t=>t.value===e)}var gm=[{id:`now`,title:`Do now`,note:`matters and cannot wait`,lit:!0},{id:`plan`,title:`Give it a slot`,note:`matters, nothing forcing it`,lit:!1},{id:`noise`,title:`Loud, not load-bearing`,note:`pressing but serves nothing`,lit:!1},{id:`later`,title:`Let it sit`,note:`neither`,lit:!1}],_m=14;function vm(e){return[...e.now,...e.plan,...e.noise,...e.later].filter(e=>e.kind===`goal`)}function ym(e){return gm.flatMap(({id:t,title:n})=>e[t].map(e=>({item:e,quadrant:n})))}function bm({title:e,note:t,lit:n,items:r,onSaved:i,compact:a}){return(0,F.jsxs)(`div`,{className:$(`blueprint flex flex-col gap-2 p-4`,n?`bg-accent-100`:`bg-transparent`,a?`min-h-[120px]`:`min-h-[160px]`),children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,F.jsx)(`h3`,{className:`m-0 text-[20px]`,children:e}),(0,F.jsx)(`span`,{className:`text-[11px] text-neutral-700`,children:t})]}),r.length===0?(0,F.jsx)(Bf,{children:`nothing here`}):r.map(e=>(0,F.jsx)(um,{item:e,onSaved:i},`${e.kind}:${e.id}`))]})}function xm(){let e=Hf(`/api/summary?days=${_m}`),t=e.state===`ready`?e.data:null;return(0,F.jsx)(Ff,{title:`Last ${_m} days`,children:(0,F.jsxs)(`dl`,{className:`m-0 grid grid-cols-3 gap-2`,children:[(0,F.jsx)(Sm,{n:t?String(t.actions):`—`,label:`actions`}),(0,F.jsx)(Sm,{n:t?String(t.refusals):`—`,label:`refusals`}),(0,F.jsx)(Sm,{n:t?.rating===null||!t?`—`:_p(t.rating),label:`rating, last 10`})]})})}function Sm({n:e,label:t}){return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`dt`,{className:`font-heading text-[26px] leading-none font-semibold tabular-nums`,children:e}),(0,F.jsx)(`dd`,{className:`m-0 text-[11px] text-neutral-600`,children:t})]})}function Cm(){let e=Hf(`/api/signal`);if(e.state!==`ready`)return(0,F.jsx)(zf,{value:e});let t=Object.entries(e.data.due).filter(([,e])=>e.state===`due`);return t.length===0?(0,F.jsx)(Bf,{children:`Nothing is due.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.map(([e,t])=>(0,F.jsxs)(`div`,{className:`text-[12px]`,children:[(0,F.jsx)(ip,{variant:`accent`,children:e}),(0,F.jsx)(`span`,{className:`ml-2 text-neutral-700`,children:t.detail})]},e))})}function wm({matrix:e,handoffs:t}){return(0,F.jsxs)(`aside`,{className:`flex flex-col gap-6`,children:[(0,F.jsx)(Ff,{title:`Where you left off`,children:(0,F.jsx)(fm,{cards:t})}),(0,F.jsx)(Ff,{title:`Goals`,children:(0,F.jsx)(pm,{goals:vm(e)})}),(0,F.jsx)(xm,{}),(0,F.jsx)(Ff,{title:`Needs a run`,children:(0,F.jsx)(Cm,{})})]})}function Tm({matrix:e,handoffs:t,moves:n,onSaved:r}){return(0,F.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`mb-6 grid gap-px border border-divider bg-divider md:grid-cols-3`,children:n.map((e,t)=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[26px_1fr] gap-2 bg-bg px-4 py-3`,children:[(0,F.jsx)(`span`,{className:`font-heading text-[22px] leading-none font-semibold text-accent`,children:String(t+1).padStart(2,`0`)}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`block font-medium text-pretty`,children:e.move}),(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-700`,children:e.because})]})]},e.move))}),(0,F.jsxs)(`div`,{className:`grid grid-cols-[18px_minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,F.jsx)(`div`,{}),(0,F.jsx)(`div`,{className:`eyebrow pb-1.5 pl-3`,children:`urgent`}),(0,F.jsx)(`div`,{className:`eyebrow pb-1.5 pl-3`,children:`not urgent`}),(0,F.jsx)(`div`,{className:`eyebrow [writing-mode:vertical-rl] rotate-180 text-center`,children:`important`}),gm.slice(0,2).map(t=>(0,F.jsx)(bm,{...t,items:e[t.id],onSaved:r},t.id)),(0,F.jsx)(`div`,{className:`eyebrow [writing-mode:vertical-rl] rotate-180 text-center`,children:`not important`}),gm.slice(2).map(t=>(0,F.jsx)(bm,{...t,items:e[t.id],onSaved:r},t.id))]})]}),(0,F.jsx)(wm,{matrix:e,handoffs:t})]})}function Em({matrix:e,handoffs:t,moves:n}){return(0,F.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_260px]`,children:[(0,F.jsx)(`div`,{className:`blueprint overflow-x-auto bg-bg`,children:(0,F.jsxs)(lp,{className:`min-w-[720px] text-[13px]`,children:[(0,F.jsx)(up,{children:(0,F.jsx)(`tr`,{children:[`Item`,`Placed`,`Why`,`Next`].map(e=>(0,F.jsx)(pp,{children:e},e))})}),(0,F.jsx)(dp,{children:ym(e).map(({item:e,quadrant:t})=>(0,F.jsxs)(fp,{children:[(0,F.jsx)(mp,{children:(0,F.jsx)(`span`,{className:`font-heading text-[15px] font-semibold`,children:e.label})}),(0,F.jsx)(mp,{className:`whitespace-nowrap`,children:t}),(0,F.jsx)(mp,{className:`min-w-[200px]`,children:(0,F.jsx)(lm,{item:e})}),(0,F.jsx)(mp,{className:`max-w-[320px] text-[12px] text-neutral-800`,children:e.detail})]},`${e.kind}:${e.id}`))})]})}),(0,F.jsxs)(`aside`,{className:`flex flex-col gap-6`,children:[(0,F.jsx)(Ff,{title:`Three moves`,children:(0,F.jsx)(dm,{moves:n})}),(0,F.jsx)(Ff,{title:`Grid`,children:(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-1`,children:gm.map(t=>(0,F.jsxs)(`div`,{className:`border border-divider p-2`,children:[(0,F.jsx)(`span`,{className:`font-heading block text-[24px] leading-none font-semibold`,children:e[t.id].length}),(0,F.jsx)(`span`,{className:`eyebrow`,children:t.title})]},t.id))})}),(0,F.jsx)(Ff,{title:`Where you left off`,children:(0,F.jsx)(fm,{cards:t})})]})]})}function Dm({matrix:e,handoffs:t,moves:n,onSaved:r}){return(0,F.jsxs)(`div`,{className:`grid items-start gap-8 lg:grid-cols-[minmax(0,7fr)_minmax(0,5fr)]`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h6`,{className:`eyebrow mb-2`,children:`If you only do three things`}),(0,F.jsx)(dm,{moves:n,size:`large`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h6`,{className:`eyebrow mb-2`,children:`Where you left off`}),(0,F.jsx)(fm,{cards:t})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h6`,{className:`eyebrow mb-2`,children:`The grid`}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:gm.map(t=>(0,F.jsx)(bm,{...t,compact:!0,items:e[t.id],onSaved:r},t.id))})]}),(0,F.jsx)(Ff,{title:`Goals`,children:(0,F.jsx)(pm,{goals:vm(e)})})]})]})}function Om({agenda:e,matrix:t}){let n=e.generatedAt?`agenda written ${e.ageHours??0}h ago at session stop`:`no agenda written yet`;return(0,F.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-baseline justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-4`,children:[(0,F.jsx)(`h1`,{className:`m-0 text-[34px]`,children:new Date().toLocaleDateString(void 0,{weekday:`long`,day:`numeric`,month:`long`})}),(0,F.jsxs)(`span`,{className:$(`text-[12px]`,e.stale?`text-alarm`:`text-neutral-700`),children:[n,` · `,t.now.length,` items need you`]})]}),t.unranked>0&&(0,F.jsxs)(`span`,{className:`text-[12px] text-neutral-700`,children:[t.unranked,` project(s) with no purpose on record`]})]})}function km({layout:e}){let[t,n]=(0,O.useState)(0),r=Hf(`/api/matrix?v=${t}`),i=Hf(`/api/agenda`),a=Hf(`/api/handoffs`),o=()=>n(e=>e+1),s=[r,i,a].find(e=>e.state!==`ready`);if(s||r.state!==`ready`)return(0,F.jsx)(zf,{value:s??r});if(i.state!==`ready`||a.state!==`ready`)return null;let c={matrix:r.data,handoffs:a.data,moves:i.data.moves,onSaved:o};return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(Om,{agenda:i.data,matrix:r.data}),e===`matrix`&&(0,F.jsx)(Tm,{...c}),e===`list`&&(0,F.jsx)(Em,{...c}),e===`briefing`&&(0,F.jsx)(Dm,{...c})]})}var Am=`pal.control-room.layout`,jm=`-m-2 p-2`;function Mm(){try{let e=localStorage.getItem(Am);return hm(e)?e:`matrix`}catch{return`matrix`}}function Nm(e){try{localStorage.setItem(Am,e)}catch{}}function Pm(){let[e,t]=Ln(),n=e.get(`layout`),r=hm(n)?n:Mm();return(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,F.jsx)(If,{label:`layout`,options:mm,value:r,onPick:e=>{Nm(e),t({layout:e})}})}),(0,F.jsx)(Rf,{className:jm,children:(0,F.jsx)(km,{layout:r})})]})}function Fm(){let[e,t]=Ln(),n=e.get(`status`),r=Hp(n)?n:`ranked`;return(0,F.jsx)(Lf,{title:`Projects`,aside:(0,F.jsx)(If,{label:`status`,options:Vp,value:r,onPick:e=>t({status:e})}),children:(0,F.jsx)(qp,{filter:r})})}function Im(){let{slug:e}=ht();return(0,F.jsx)(Rf,{className:jm,children:(0,F.jsx)(Bp,{slug:e??``})})}function Lm(){let[e,t]=Ln(),n=Object.fromEntries(bp.map(t=>[t,e.get(t)??``]));return(0,F.jsx)(Lf,{title:`Action log`,aside:(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-700`,children:`every tool call this install recorded`}),children:(0,F.jsx)(Ap,{filter:n,onFilter:e=>{let r={...n,...e};t(Object.fromEntries(Object.entries(r).filter(([,e])=>e)))}})})}function Rm(){return(0,F.jsx)(Lf,{title:`Settings`,children:(0,F.jsx)(Rf,{className:jm,children:(0,F.jsx)(im,{})})})}var zm=[{to:`/`,label:`Today`,end:!0},{to:`/projects`,label:`Projects`,end:!1},{to:`/log`,label:`Action log`,end:!1},{to:`/settings`,label:`Settings`,end:!1}];function Bm({status:e}){return(0,F.jsxs)(`header`,{className:`flex flex-wrap items-center gap-5 border-b border-divider bg-bg px-7 py-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-[120px] items-baseline gap-2`,children:[(0,F.jsx)(`span`,{className:`font-heading text-[22px] font-semibold tracking-wide`,children:`PAL`}),(0,F.jsx)(`span`,{className:`eyebrow`,children:`control`})]}),(0,F.jsx)(`nav`,{className:`-mb-[11px] flex gap-0.5`,children:zm.map(e=>(0,F.jsx)(Mn,{to:e.to,end:e.end,className:({isActive:e})=>$(`font-heading border-b-2 px-3 py-2 text-[15px] font-semibold whitespace-nowrap`,e?`border-accent text-ink`:`border-transparent text-neutral-600 hover:text-accent`),children:e.label},e.to))}),(0,F.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-[12px] text-neutral-700`,children:[(0,F.jsx)(`span`,{className:`inline-block size-1.5 bg-accent`}),(0,F.jsx)(`b`,{className:`font-medium text-ink`,children:e?.machine??`…`}),(0,F.jsxs)(`span`,{children:[`· `,e?`${e.ledgerFiles} ledger file(s)`:`…`,` · port`,` `,e?.port??`…`]}),(0,F.jsx)(tp,{})]})]})}function Vm(){let e=Hf(`/api/status`);return(0,F.jsx)(An,{children:(0,F.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden`,children:[(0,F.jsx)(Bm,{status:e.state===`ready`?e.data:null}),(0,F.jsx)(`main`,{className:`mx-auto flex w-full max-w-[1480px] min-h-0 flex-1 flex-col px-7 pt-6 pb-6`,children:(0,F.jsxs)(Bt,{children:[(0,F.jsx)(Rt,{path:`/`,element:(0,F.jsx)(Pm,{})}),(0,F.jsx)(Rt,{path:`/projects`,element:(0,F.jsx)(Fm,{})}),(0,F.jsx)(Rt,{path:`/projects/:slug`,element:(0,F.jsx)(Im,{})}),(0,F.jsx)(Rt,{path:`/log`,element:(0,F.jsx)(Lm,{})}),(0,F.jsx)(Rt,{path:`/settings`,element:(0,F.jsx)(Rm,{})}),(0,F.jsx)(Rt,{path:`*`,element:(0,F.jsx)(Lt,{to:`/`,replace:!0})})]})}),(0,F.jsxs)(`footer`,{className:`flex flex-wrap justify-between gap-4 border-t border-divider px-7 py-3 text-[11px] text-neutral-600`,children:[(0,F.jsx)(`span`,{children:`loopback only · every number from ~/.pal · no model runs on this page`}),(0,F.jsx)(`span`,{children:e.state===`ready`?`up since ${e.data.startedAt}`:``})]})]})})}var Hm=document.getElementById(`root`);Hm&&(0,Un.createRoot)(Hm).render((0,F.jsx)(O.StrictMode,{children:(0,F.jsx)(Vm,{})}));
49
+ `},B=0,ho=[];function go(e){var t=O.useRef([]),n=O.useRef([0,0]),r=O.useRef(),i=O.useState(B++)[0],a=O.useState(za)[0],o=O.useRef(e);O.useEffect(function(){o.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ha([e.lockRef.current],(e.shards||[]).map(po),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=O.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=uo(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ro(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ro(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return lo(h,t,e,h===`h`?s:c,!0)},[]),c=O.useCallback(function(e){var n=e;if(ho.length&&ho[ho.length-1]===a){var r=`deltaY`in n?fo(n):uo(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&mo(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(po).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=O.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:_o(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=O.useCallback(function(e){n.current=uo(e),r.current=void 0},[]),d=O.useCallback(function(t){l(t.type,fo(t),t.target,s(t,e.lockRef.current))},[]),f=O.useCallback(function(t){l(t.type,uo(t),t.target,s(t,e.lockRef.current))},[]);O.useEffect(function(){return ho.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Qa),document.addEventListener(`touchmove`,c,Qa),document.addEventListener(`touchstart`,u,Qa),function(){ho=ho.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Qa),document.removeEventListener(`touchmove`,c,Qa),document.removeEventListener(`touchstart`,u,Qa)}},[]);var p=e.removeScrollBar,m=e.inert;return O.createElement(O.Fragment,null,m?O.createElement(a,{styles:z(i)}):null,p?O.createElement(Ya,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _o(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var vo=ka(Aa,go),yo=O.forwardRef(function(e,t){return O.createElement(Ma,pa({},e,{ref:t,sideCar:vo}))});yo.classNames=Ma.classNames;var bo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},xo=new WeakMap,So=new WeakMap,Co={},wo=0,To=function(e){return e&&(e.host||To(e.parentNode))},Eo=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=To(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Do=function(e,t,n,r){var i=Eo(t,Array.isArray(e)?e:[e]);Co[n]||(Co[n]=new WeakMap);var a=Co[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(xo.get(e)||0)+1,l=(a.get(e)||0)+1;xo.set(e,c),a.set(e,l),o.push(e),c===1&&i&&So.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),wo++,function(){o.forEach(function(e){var t=xo.get(e)-1,i=a.get(e)-1;xo.set(e,t),a.set(e,i),t||(So.has(e)||e.removeAttribute(r),So.delete(e)),i||e.removeAttribute(n)}),wo--,wo||(xo=new WeakMap,xo=new WeakMap,So=new WeakMap,Co={})}},Oo=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||bo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Do(r,i,n,`aria-hidden`)):function(){return null}},ko=Object.defineProperty,Ao=(e,t)=>ko(e,`name`,{value:t,configurable:!0});function jo(e){let[t,n]=O.useState(void 0);return Yr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Ao(jo,`useSize`);var Mo=[`top`,`right`,`bottom`,`left`],V=Math.min,No=Math.max,Po=Math.round,Fo=Math.floor,Io=e=>({x:e,y:e}),Lo={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ro(e,t,n){return No(e,V(t,n))}function zo(e,t){return typeof e==`function`?e(t):e}function Bo(e){return e.split(`-`)[0]}function Vo(e){return e.split(`-`)[1]}function Ho(e){return e===`x`?`y`:`x`}function Uo(e){return e===`y`?`height`:`width`}function Wo(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Go(e){return Ho(Wo(e))}function Ko(e,t,n){n===void 0&&(n=!1);let r=Vo(e),i=Go(e),a=Uo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ts(o)),[o,ts(o)]}function qo(e){let t=ts(e);return[Jo(e),t,Jo(t)]}function Jo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Yo=[`left`,`right`],Xo=[`right`,`left`],Zo=[`top`,`bottom`],Qo=[`bottom`,`top`];function $o(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xo:Yo:t?Yo:Xo;case`left`:case`right`:return t?Zo:Qo;default:return[]}}function es(e,t,n,r){let i=Vo(e),a=$o(Bo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Jo)))),a}function ts(e){let t=Bo(e);return Lo[t]+e.slice(t.length)}function ns(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function rs(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ns(e)}function is(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function as(e,t,n){let{reference:r,floating:i}=e,a=Wo(t),o=Go(t),s=Uo(o),c=Bo(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Vo(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function os(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=zo(t,e),p=rs(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=is(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=is(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ss=50,cs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:os},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=as(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ss&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=as(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ls=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=zo(e,t)||{};if(l==null)return{};let d=rs(u),f={x:n,y:r},p=Go(i),m=Uo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=V(d[_],T),te=V(d[v],T),E=C-h[m]-te,D=C/2-h[m]/2+w,ne=Ro(ee,D,E),re=!c.arrow&&Vo(i)!=null&&D!==ne&&a.reference[m]/2-(D<ee?ee:te)-h[m]/2<0,O=re?D<ee?D-ee:D-E:0;return{[p]:f[p]+O,data:{[p]:ne,centerOffset:D-ne-O,...re&&{alignmentOffset:O}},reset:re}}}),us=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=zo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Bo(r),_=Wo(o),v=Bo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ts(o)]:qo(o)),x=p!==`none`;!d&&x&&b.push(...es(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ko(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wo(t)||T.every(e=>Wo(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wo(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ds(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fs(e){return Mo.some(t=>e[t]>=0)}var ps=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=zo(e,t);switch(i){case`referenceHidden`:{let e=ds(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:fs(e)}}}case`escaped`:{let e=ds(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:fs(e)}}}default:return{}}}}},ms=new Set([`left`,`top`]);async function hs(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Bo(n),s=Vo(n),c=Wo(n)===`y`,l=ms.has(o)?-1:1,u=a&&c?-1:1,d=zo(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var gs=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await hs(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_s=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=zo(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wo(i),p=Ho(f),m=u[p],h=u[f],g=(e,t)=>Ro(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},vs=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=zo(e,t),u={x:n,y:r},d=Wo(i),f=Ho(d),p=u[f],m=u[d],h=zo(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ms.has(Bo(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ys=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=zo(e,t),c=await i.detectOverflow(t,s),l=Bo(n),u=Vo(n),d=Wo(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=V(p-c[m],g),y=V(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*No(c.left,c.right):S=p-2*No(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function bs(){return typeof window<`u`}function xs(e){return ws(e)?(e.nodeName||``).toLowerCase():`#document`}function Ss(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cs(e){return((ws(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ws(e){return bs()?e instanceof Node||e instanceof Ss(e).Node:!1}function Ts(e){return bs()?e instanceof Element||e instanceof Ss(e).Element:!1}function Es(e){return bs()?e instanceof HTMLElement||e instanceof Ss(e).HTMLElement:!1}function Ds(e){return!bs()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ss(e).ShadowRoot}function Os(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=zs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ks(e){return/^(table|td|th)$/.test(xs(e))}function As(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var js=/transform|translate|scale|rotate|perspective|filter/,Ms=/paint|layout|strict|content/,Ns=e=>!!e&&e!==`none`,Ps;function Fs(e){let t=Ts(e)?zs(e):e;return Ns(t.transform)||Ns(t.translate)||Ns(t.scale)||Ns(t.rotate)||Ns(t.perspective)||!Ls()&&(Ns(t.backdropFilter)||Ns(t.filter))||js.test(t.willChange||``)||Ms.test(t.contain||``)}function Is(e){let t=Vs(e);for(;Es(t)&&!Rs(t);){if(Fs(t))return t;if(As(t))return null;t=Vs(t)}return null}function Ls(){return Ps??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ps}function Rs(e){return/^(html|body|#document)$/.test(xs(e))}function zs(e){return Ss(e).getComputedStyle(e)}function Bs(e){return Ts(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vs(e){if(xs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ds(e)&&e.host||Cs(e);return Ds(t)?t.host:t}function Hs(e){let t=Vs(e);return Rs(t)?(e.ownerDocument||e).body:Es(t)&&Os(t)?t:Hs(t)}function Us(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Hs(e),i=r===e.ownerDocument?.body,a=Ss(r);if(i){let e=Ws(a);return t.concat(a,a.visualViewport||[],Os(r)?r:[],e&&n?Us(e):[])}return t.concat(r,Us(r,[],n))}function Ws(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gs(e){let t=zs(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Es(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Po(n)!==a||Po(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ks(e){return Ts(e)?e:e.contextElement}function qs(e){let t=Ks(e);if(!Es(t))return Io(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gs(t),o=(a?Po(n.width):n.width)/r,s=(a?Po(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Js=Io(0);function Ys(e){let t=Ss(e);return!Ls()||!t.visualViewport?Js:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ss(e)}function Zs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ks(e),o=Io(1);t&&(r?Ts(r)&&(o=qs(r)):o=qs(e));let s=Xs(a,n,r)?Ys(a):Io(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ss(a),t=Ts(r)?Ss(r):r,n=e,i=Ws(n);for(;i&&t!==n;){let e=qs(i),t=i.getBoundingClientRect(),r=zs(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ss(i),i=Ws(n)}}return is({width:u,height:d,x:c,y:l})}function Qs(e,t){let n=Bs(e).scrollLeft;return t?t.left+n:Zs(Cs(e)).left+n}function $s(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qs(e,n),y:n.top+t.scrollTop}}function ec(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Cs(r),s=t?As(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Io(1),u=Io(0),d=Es(r);if((d||!a)&&((xs(r)!==`body`||Os(o))&&(c=Bs(r)),d)){let e=Zs(r);l=qs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$s(o,c):Io(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function tc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function nc(e){let t=Bs(e),n=e.ownerDocument.body,r=No(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=No(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Qs(e),o=-t.scrollTop;return zs(n).direction===`rtl`&&(a+=No(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var rc=25;function ic(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ss(e),a=Cs(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ls()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Qs(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=rc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ac(e,t){let n=Zs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=qs(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function oc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ic(e,n,t);else if(t===`document`)r=nc(Cs(e));else if(Ts(t))r=ac(t,n);else{let n=Ys(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return is(r)}function sc(e,t){let n=t.get(e);if(n)return n;let r=Us(e,[],!1).filter(e=>Ts(e)&&xs(e)!==`body`),i=null,a=zs(e).position===`fixed`,o=a?Vs(e):e;for(;Ts(o)&&!Rs(o);){let e=zs(o),t=Fs(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Vs(o)}return t.set(e,r),r}function cc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?As(t)?[]:sc(t,this._c):[].concat(n),r],o=oc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=oc(t,a[e],i);s=No(n.top,s),c=V(n.right,c),l=V(n.bottom,l),u=No(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function lc(e){let{width:t,height:n}=Gs(e);return{width:t,height:n}}function uc(e,t,n){let r=Es(t),i=Cs(t),a=n===`fixed`,o=Zs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Io(0);if((r||!a)&&((xs(t)!==`body`||Os(i))&&(s=Bs(t)),r)){let e=Zs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Qs(i));let l=i&&!r&&!a?$s(i,s):Io(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function dc(e){return zs(e).position===`static`}function fc(e,t){if(!Es(e)||zs(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Cs(e)===n&&(n=n.ownerDocument.body),n}function pc(e,t){let n=Ss(e);if(As(e))return n;if(!Es(e)){let t=Vs(e);for(;t&&!Rs(t);){if(Ts(t)&&!dc(t))return t;t=Vs(t)}return n}let r=fc(e,t);for(;r&&ks(r)&&dc(r);)r=fc(r,t);return r&&Rs(r)&&dc(r)&&!Fs(r)?n:r||Is(e)||n}var mc=async function(e){let t=this.getOffsetParent||pc,n=this.getDimensions,r=await n(e.floating);return{reference:uc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hc(e){return zs(e).direction===`rtl`}var gc={convertOffsetParentRelativeRectToViewportRelativeRect:ec,getDocumentElement:Cs,getClippingRect:cc,getOffsetParent:pc,getElementRects:mc,getClientRects:tc,getDimensions:lc,getScale:qs,isElement:Ts,isRTL:hc};function _c(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vc(e,t,n){let r=null,i,a=Cs(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Fo(d),h=Fo(a.clientWidth-(u+f)),g=Fo(a.clientHeight-(d+p)),_=Fo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:No(0,V(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!_c(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ss(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function yc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ks(e),u=i||a?[...l?Us(l):[],...t?Us(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?vc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Zs(e):null;c&&g();function g(){let t=Zs(e);h&&!_c(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var bc=gs,xc=_s,Sc=us,Cc=ys,wc=ps,Tc=ls,Ec=vs,Dc=(e,t,n)=>{let r=new Map,i=n??{},a={...gc,...i.platform,_c:r};return cs(e,t,{...i,platform:a})},Oc=typeof document<`u`?O.useLayoutEffect:function(){};function kc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!kc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!kc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ac(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jc(e,t){let n=Ac(e);return Math.round(t*n)/n}function Mc(e){let t=O.useRef(e);return Oc(()=>{t.current=e}),t}function Nc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=O.useState(r);kc(f,r)||p(r);let[m,h]=O.useState(null),[g,_]=O.useState(null),v=O.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=O.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=O.useRef(null),C=O.useRef(null),w=O.useRef(u),T=c!=null,ee=Mc(c),te=Mc(i),E=Mc(l),D=O.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),Dc(S.current,C.current,e).then(e=>{let t={...e,isPositioned:E.current!==!1};ne.current&&!kc(w.current,t)&&(w.current=t,vr.flushSync(()=>{d(t)}))})},[f,t,n,te,E]);Oc(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ne=O.useRef(!1);Oc(()=>(ne.current=!0,()=>{ne.current=!1}),[]),Oc(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(ee.current)return ee.current(b,x,D);D()}},[b,x,D,ee,T]);let re=O.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),k=O.useMemo(()=>({reference:b,floating:x}),[b,x]),ie=O.useMemo(()=>{let e={position:n,left:0,top:0};if(!k.floating)return e;let t=jc(k.floating,u.x),r=jc(k.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ac(k.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,k.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:D,refs:re,elements:k,floatingStyles:ie}),[u,D,re,k,ie])}var Pc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Tc({element:r.current,padding:i}).fn(n):r?Tc({element:r,padding:i}).fn(n):{}}}},Fc=(e,t)=>{let n=bc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ic=(e,t)=>{let n=xc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lc=(e,t)=>({fn:Ec(e).fn,options:[e,t]}),Rc=(e,t)=>{let n=Sc(e);return{name:n.name,fn:n.fn,options:[e,t]}},zc=(e,t)=>{let n=Cc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bc=(e,t)=>{let n=wc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vc=(e,t)=>{let n=Pc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hc=Object.defineProperty,Uc=(e,t)=>Hc(e,`name`,{value:t,configurable:!0}),Wc=`Popper`,[Gc,Kc]=Er(Wc),[qc,Jc]=Gc(Wc),Yc=Uc(e=>{let{__scopePopper:t,children:n}=e,[r,i]=O.useState(null),[a,o]=O.useState(void 0);return(0,F.jsx)(qc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Xc=`PopperAnchor`,Zc=O.forwardRef(Uc(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Jc(Xc,n),o=O.useRef(null),s=a.onAnchorChange,c=$n(t,O.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=O.useRef(null);O.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&il(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,F.jsx)(xr.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Qc=`PopperContent`,[$c,el]=Gc(Qc),tl=O.forwardRef(Uc(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Jc(Qc,n),[_,v]=O.useState(null),y=$n(t,v),[b,x]=O.useState(null),S=jo(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),ee=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},te=Array.isArray(l)?l:[l],E=te.length>0,D={padding:ee,boundary:te.filter(nl),altBoundary:E},{refs:ne,floatingStyles:re,placement:k,isPositioned:ie,middlewareData:ae}=Nc({strategy:`fixed`,placement:T,whileElementsMounted:Uc((...e)=>yc(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Fc({mainAxis:i+w,alignmentAxis:o}),c&&Ic({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Lc():void 0,...D}),c&&Rc({...D}),zc({...D,apply:Uc(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&Vc({element:b,padding:s}),rl({arrowWidth:C,arrowHeight:w}),f&&Bc({strategy:`referenceHidden`,...D,boundary:E?D.boundary:void 0})]}),A=g.setPlacementState;Yr(()=>(A(k),()=>{A(void 0)}),[k,A]);let[j,oe]=il(k),se=ki(m);Yr(()=>{ie&&se?.()},[ie,se]);let ce=ae.arrow?.x,M=ae.arrow?.y,N=ae.arrow?.centerOffset!==0,[P,le]=O.useState();return Yr(()=>{_&&le(window.getComputedStyle(_).zIndex)},[_]),(0,F.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ie?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:P,"--radix-popper-transform-origin":[ae.transformOrigin?.x,ae.transformOrigin?.y].join(` `),...ae.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,F.jsx)($c,{scope:n,placedSide:j,placedAlign:oe,onArrowChange:x,arrowX:ce,arrowY:M,shouldHideArrow:N,children:(0,F.jsx)(xr.div,{"data-side":j,"data-align":oe,...h,ref:y,style:{...h.style,animation:ie?h.style?.animation:`none`}})})})},`PopperContent`));function nl(e){return e!==null}Uc(nl,`isNotNull`);var rl=Uc(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=il(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function il(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Uc(il,`getSideAndAlignFromPlacement`);var al=Yc,ol=Zc,sl=tl,cl=Object.defineProperty,ll=(e,t)=>cl(e,`name`,{value:t,configurable:!0}),ul=!1;function dl(){let[e,t]=O.useState(ul);return O.useEffect(()=>{ul||(ul=!0,t(!0))},[]),e}ll(dl,`useIsHydrated`);var fl=O.useSyncExternalStore;function pl(){return()=>{}}ll(pl,`subscribe`);function ml(){return fl(pl,()=>!0,()=>!1)}ll(ml,`useIsHydratedModern`);var hl=typeof fl==`function`?ml:dl,gl=Object.defineProperty,_l=(e,t)=>gl(e,`name`,{value:t,configurable:!0}),vl=`rovingFocusGroup.onEntryFocus`,yl={bubbles:!1,cancelable:!0},bl=`RovingFocusGroup`,[xl,Sl,Cl]=Ar(bl),[wl,Tl]=Er(bl,[Cl]),[El,Dl]=wl(bl),Ol=O.forwardRef(_l(function(e,t){return(0,F.jsx)(xl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(xl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(kl,{...e,ref:t})})})},`RovingFocusGroup`)),kl=O.forwardRef(_l(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=O.useRef(null),p=$n(t,f),m=Ei(a),[h,g]=ii({prop:o,defaultProp:s??null,onChange:c,caller:bl}),[_,v]=O.useState(!1),y=ki(l),b=Sl(n),x=O.useRef(!1),[S,C]=O.useState(0);return O.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(vl,y),()=>e.removeEventListener(vl,y)},[y]),(0,F.jsx)(El,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:O.useCallback(e=>g(e),[g]),onItemShiftTab:O.useCallback(()=>v(!0),[]),onFocusableItemAdd:O.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:O.useCallback(()=>C(e=>e-1),[]),children:(0,F.jsx)(xr.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Wr(e.onMouseDown,()=>{x.current=!0}),onFocus:Wr(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(vl,yl);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Fl([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:Wr(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),Al=`RovingFocusGroupItem`,jl=O.forwardRef(_l(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Si(),l=a||c,u=Dl(Al,n),d=u.currentTabStopId===l,f=Sl(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=hl();return Yr(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),O.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,F.jsx)(xl.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,F.jsx)(xr.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Wr(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Wr(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Wr(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Pl(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Il(n,r+1):n.slice(r+1)}setTimeout(()=>Fl(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Ml={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Nl(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}_l(Nl,`getDirectionAwareKey`);function Pl(e,t,n){let r=Nl(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ml[r]}_l(Pl,`getFocusIntent`);function Fl(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}_l(Fl,`focusFirst`);function Il(e,t){return e.map((n,r)=>e[(t+r)%e.length])}_l(Il,`wrapArray`);var Ll=Ol,Rl=jl,zl=Object.defineProperty,Bl=O.forwardRef(((e,t)=>zl(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,F.jsx)(xr.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Vl=Object.defineProperty,Hl=(e,t)=>Vl(e,`name`,{value:t,configurable:!0}),H=`Popover`,[U,W]=Er(H,[Kc]),G=Kc(),[K,Ul]=U(H),Wl=Hl(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=G(t),c=O.useRef(null),[l,u]=O.useState(!1),[d,f]=ii({prop:r,defaultProp:i??!1,onChange:a,caller:H});return(0,F.jsx)(al,{...s,children:(0,F.jsx)(K,{scope:t,contentId:Si(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:O.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:O.useCallback(()=>u(!0),[]),onCustomAnchorRemove:O.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Gl=`PopoverTrigger`,Kl=O.forwardRef(Hl(function(e,t){let{__scopePopover:n,...r}=e,i=Ul(Gl,n),a=G(n),o=$n(t,i.triggerRef),s=(0,F.jsx)(xr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":ru(i.open),...r,ref:o,onClick:Wr(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,F.jsx)(ol,{asChild:!0,...a,children:s})},`PopoverTrigger`)),ql=`PopoverPortal`,[Jl,Yl]=U(ql,{forceMount:void 0}),Xl=Hl(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Ul(ql,t);return(0,F.jsx)(Jl,{scope:t,forceMount:n,children:(0,F.jsx)(fi,{present:n||a.open,children:(0,F.jsx)(aa,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Zl=`PopoverContent`,Ql=O.forwardRef(Hl(function(e,t){let n=Yl(Zl,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Ul(Zl,e.__scopePopover);return(0,F.jsx)(fi,{present:r||a.open,children:a.modal?(0,F.jsx)(eu,{...i,ref:t}):(0,F.jsx)(tu,{...i,ref:t})})},`PopoverContent`)),$l=nr(`PopoverContent.RemoveScroll`),eu=O.forwardRef(Hl(function(e,t){let n=Ul(Zl,e.__scopePopover),r=O.useRef(null),i=$n(t,r),a=O.useRef(!1);return O.useEffect(()=>{let e=r.current;if(e)return Oo(e)},[]),(0,F.jsx)(yo,{as:$l,allowPinchZoom:!0,children:(0,F.jsx)(nu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Wr(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Wr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Wr(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),tu=O.forwardRef(Hl(function(e,t){let n=Ul(Zl,e.__scopePopover),r=O.useRef(!1),i=O.useRef(!1);return(0,F.jsx)(nu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),nu=O.forwardRef(Hl(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Ul(Zl,n),p=G(n);return da(),(0,F.jsx)(Ki,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(L,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,F.jsx)(sl,{"data-state":ru(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function ru(e){return e?`open`:`closed`}Hl(ru,`getState`);var iu=Wl,au=Kl,ou=Xl,su=Ql,cu=Object.defineProperty,lu=(e,t)=>cu(e,`name`,{value:t,configurable:!0}),uu=`horizontal`,du=[`horizontal`,`vertical`],fu=O.forwardRef(lu(function(e,t){let{decorative:n,orientation:r=uu,...i}=e,a=pu(r)?r:uu,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,F.jsx)(xr.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function pu(e){return du.includes(e)}lu(pu,`isValidOrientation`);var mu=fu,hu=Object.defineProperty,gu=(e,t)=>hu(e,`name`,{value:t,configurable:!0}),_u=`Switch`,[vu,yu]=Er(_u),[bu,xu]=vu(_u);function Su(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=ii({prop:n,defaultProp:i??!1,onChange:c,caller:_u}),[m,h]=O.useState(null),[g,_]=O.useState(null),v=O.useRef(!1),[y,b]=O.useReducer(e=>e+1,0),x={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,F.jsx)(bu,{scope:t,...x,children:Au(d)?d(x):r})}gu(Su,`SwitchProvider`);var Cu=`SwitchTrigger`,wu=O.forwardRef(gu(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=xu(Cu,e),g=$n(r,u),_=O.useRef(c);return O.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=gu(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,F.jsx)(xr.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":ju(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:g,onClick:Wr(t,e=>{p(),d(e=>!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),Tu=O.forwardRef(gu(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,F.jsx)(Su,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(wu,{...d,ref:t,__scopeSwitch:n}),e&&(0,F.jsx)(ku,{__scopeSwitch:n})]})})},`Switch`)),Eu=`SwitchThumb`,Du=O.forwardRef(gu(function(e,t){let{__scopeSwitch:n,...r}=e,i=xu(Eu,n);return(0,F.jsx)(xr.span,{"data-state":ju(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),Ou=`SwitchBubbleInput`,ku=O.forwardRef(gu(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=xu(Ou,e),g=$n(r,h),_=jo(i),v=O.useRef(!1),y=O.useRef(s),b=O.useRef(o);O.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==b.current;b.current=o;let i=y.current!==s;y.current=s;let c=!(r&&a.current);if(i&&n){v.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),v.current=!1}},[m,s,a,o]);let x=O.useRef(s);return(0,F.jsx)(xr.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??x.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:Wr(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function Au(e){return typeof e==`function`}gu(Au,`isFunction`);function ju(e){return e?`checked`:`unchecked`}gu(ju,`getState`);var Mu=Object.defineProperty,Nu=(e,t)=>Mu(e,`name`,{value:t,configurable:!0}),Pu=`Toggle`,Fu=O.forwardRef(Nu(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=ii({prop:n,onChange:i,defaultProp:r??!1,caller:Pu});return(0,F.jsx)(xr.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:Wr(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Iu=Object.defineProperty,Lu=(e,t)=>Iu(e,`name`,{value:t,configurable:!0}),Ru=`ToggleGroup`,[zu,Bu]=Er(Ru,[Tl]),Vu=Tl(),Hu=O.forwardRef(Lu(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,F.jsx)(Gu,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,F.jsx)(Ku,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Ru}\``)},`ToggleGroup`)),[Uu,Wu]=zu(Ru),Gu=O.forwardRef(Lu(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Lu(()=>{},`onValueChange`),...a}=e,[o,s]=ii({prop:n,defaultProp:r??``,onChange:i,caller:Ru});return(0,F.jsx)(Uu,{scope:e.__scopeToggleGroup,type:`single`,value:O.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:O.useCallback(()=>s(``),[s]),children:(0,F.jsx)(q,{...a,ref:t})})},`ToggleGroupImplSingle`)),Ku=O.forwardRef(Lu(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Lu(()=>{},`onValueChange`),...a}=e,[o,s]=ii({prop:n,defaultProp:r??[],onChange:i,caller:Ru}),c=O.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=O.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,F.jsx)(Uu,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,F.jsx)(q,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[qu,Ju]=zu(Ru),q=O.forwardRef(Lu(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=Vu(n),u=Ei(o),d={dir:u,...c};return(0,F.jsx)(qu,{scope:n,rovingFocus:i,disabled:r,children:i?(0,F.jsx)(Ll,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,F.jsx)(xr.div,{...d,ref:t})}):(0,F.jsx)(xr.div,{...d,ref:t})})},`ToggleGroupImpl`)),Yu=`ToggleGroupItem`,Xu=O.forwardRef(Lu(function(e,t){let n=Wu(Yu,e.__scopeToggleGroup),r=Ju(Yu,e.__scopeToggleGroup),i=Vu(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=O.useRef(null);return r.rovingFocus?(0,F.jsx)(Rl,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,F.jsx)(Zu,{...s,ref:t})}):(0,F.jsx)(Zu,{...s,ref:t})},`ToggleGroupItem`)),Zu=O.forwardRef(Lu(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=Wu(Yu,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===`single`?o:void 0;return(0,F.jsx)(Fu,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),Qu=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},$u=(e,t)=>({classGroupId:e,validator:t}),ed=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),td=`-`,nd=[],rd=`arbitrary..`,id=e=>{let t=sd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return od(e);let n=e.split(td);return ad(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Qu(i,t):t:i||nd}return n[e]||nd}}},ad=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ad(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(td):e.slice(t).join(td),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},od=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?rd+r:void 0})(),sd=e=>{let{theme:t,classGroups:n}=e;return cd(n,t)},cd=(e,t)=>{let n=ed();for(let r in e){let i=e[r];ld(i,n,r,t)}return n},ld=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ud(i,t,n,r)}},ud=(e,t,n,r)=>{if(typeof e==`string`){dd(e,t,n);return}if(typeof e==`function`){fd(e,t,n,r);return}pd(e,t,n,r)},dd=(e,t,n)=>{let r=e===``?t:md(t,e);r.classGroupId=n},fd=(e,t,n,r)=>{if(hd(e)){ld(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push($u(n,e))},pd=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ld(o,md(t,a),n,r)}},md=(e,t)=>{let n=e,r=t.split(td),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ed(),n.nextPart.set(t,i)),n=i}return n},hd=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,gd=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},_d=`!`,vd=`:`,yd=[],bd=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),xd=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===vd){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(_d)?(c=s.slice(0,-1),l=!0):s.startsWith(_d)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return bd(t,l,c,u)};if(t){let e=t+vd,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):bd(yd,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Sd=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Cd=e=>({cache:gd(e.cacheSize),parseClassName:xd(e),sortModifiers:Sd(e),postfixLookupClassGroupIds:J(e),...id(e)}),J=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},wd=/\s+/,Td=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(wd),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+_d:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ed=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Dd(n))&&(i&&(i+=` `),i+=r);return i},Dd=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Dd(e[r]))&&(n&&(n+=` `),n+=t);return n},Od=(e,...t)=>{let n,r,i,a,o=o=>(n=Cd(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Td(e,n);return i(e,a),a};return a=o,(...e)=>a(Ed(...e))},kd=[],Ad=e=>{let t=t=>t[e]||kd;return t.isThemeGetter=!0,t},jd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Md=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Nd=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Pd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Id=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Y=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ld=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rd=e=>Nd.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),zd=e=>!!e&&Number.isInteger(Number(e)),Bd=e=>e.endsWith(`%`)&&X(e.slice(0,-1)),Vd=e=>Pd.test(e),Hd=()=>!0,Ud=e=>Fd.test(e)&&!Id.test(e),Wd=()=>!1,Gd=e=>Y.test(e),Kd=e=>Ld.test(e),qd=e=>!Z(e)&&!Q(e),Jd=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Yd=e=>df(e,hf,Wd),Z=e=>jd.test(e),Xd=e=>df(e,gf,Ud),Zd=e=>df(e,_f,X),Qd=e=>df(e,yf,Hd),$d=e=>df(e,vf,Wd),ef=e=>df(e,pf,Wd),tf=e=>df(e,mf,Kd),nf=e=>df(e,bf,Gd),Q=e=>Md.test(e),rf=e=>ff(e,gf),af=e=>ff(e,vf),of=e=>ff(e,pf),sf=e=>ff(e,hf),cf=e=>ff(e,mf),lf=e=>ff(e,bf,!0),uf=e=>ff(e,yf,!0),df=(e,t,n)=>{let r=jd.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ff=(e,t,n=!1)=>{let r=Md.exec(e);return r?r[1]?t(r[1]):n:!1},pf=e=>e===`position`||e===`percentage`,mf=e=>e===`image`||e===`url`,hf=e=>e===`length`||e===`size`||e===`bg-size`,gf=e=>e===`length`,_f=e=>e===`number`,vf=e=>e===`family-name`,yf=e=>e===`number`||e===`weight`,bf=e=>e===`shadow`,xf=Od(()=>{let e=Ad(`color`),t=Ad(`font`),n=Ad(`text`),r=Ad(`font-weight`),i=Ad(`tracking`),a=Ad(`leading`),o=Ad(`breakpoint`),s=Ad(`container`),c=Ad(`spacing`),l=Ad(`radius`),u=Ad(`shadow`),d=Ad(`inset-shadow`),f=Ad(`text-shadow`),p=Ad(`drop-shadow`),m=Ad(`blur`),h=Ad(`perspective`),g=Ad(`aspect`),_=Ad(`ease`),v=Ad(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Q,Z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Q,Z,c],T=()=>[Rd,`full`,`auto`,...w()],ee=()=>[zd,`none`,`subgrid`,Q,Z],te=()=>[`auto`,{span:[`full`,zd,Q,Z]},zd,Q,Z],E=()=>[zd,`auto`,Q,Z],D=()=>[`auto`,`min`,`max`,`fr`,Q,Z],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],re=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],O=()=>[`auto`,...w()],k=()=>[Rd,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ie=()=>[Rd,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ae=()=>[Rd,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],A=()=>[e,Q,Z],j=()=>[...b(),of,ef,{position:[Q,Z]}],oe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],se=()=>[`auto`,`cover`,`contain`,sf,Yd,{size:[Q,Z]}],ce=()=>[Bd,rf,Xd],M=()=>[``,`none`,`full`,l,Q,Z],N=()=>[``,X,rf,Xd],P=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ue=()=>[X,Bd,of,ef],de=()=>[``,`none`,m,Q,Z],fe=()=>[`none`,X,Q,Z],pe=()=>[`none`,X,Q,Z],me=()=>[X,Q,Z],he=()=>[Rd,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Vd],breakpoint:[Vd],color:[Hd],container:[Vd],"drop-shadow":[Vd],ease:[`in`,`out`,`in-out`],font:[qd],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Vd],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Vd],shadow:[Vd],spacing:[`px`,X],text:[Vd],"text-shadow":[Vd],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Rd,Z,Q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Q,Z]}],"container-named":[Jd],columns:[{columns:[X,Z,Q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[zd,`auto`,Q,Z]}],basis:[{basis:[Rd,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[X,Rd,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,X,Q,Z]}],shrink:[{shrink:[``,X,Q,Z]}],order:[{order:[zd,`first`,`last`,`none`,Q,Z]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...re(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...re()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...re(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...re(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...re(),`baseline`]}],"place-self":[{"place-self":[`auto`,...re()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:k()}],"inline-size":[{inline:[`auto`,...ie()]}],"min-inline-size":[{"min-inline":[`auto`,...ie()]}],"max-inline-size":[{"max-inline":[`none`,...ie()]}],"block-size":[{block:[`auto`,...ae()]}],"min-block-size":[{"min-block":[`auto`,...ae()]}],"max-block-size":[{"max-block":[`none`,...ae()]}],w:[{w:[s,`screen`,...k()]}],"min-w":[{"min-w":[s,`screen`,`none`,...k()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...k()]}],h:[{h:[`screen`,`lh`,...k()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...k()]}],"max-h":[{"max-h":[`screen`,`lh`,...k()]}],"font-size":[{text:[`base`,n,rf,Xd]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,uf,Qd]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Bd,Z]}],"font-family":[{font:[af,$d,t]}],"font-features":[{"font-features":[Z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Q,Z]}],"line-clamp":[{"line-clamp":[X,`none`,Q,Zd]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Q,Z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Q,Z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...P(),`wavy`]}],"text-decoration-thickness":[{decoration:[X,`from-font`,`auto`,Q,Xd]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[X,`auto`,Q,Z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[zd,Q,Z]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Q,Z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Q,Z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:se()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},zd,Q,Z],radial:[``,Q,Z],conic:[zd,Q,Z]},cf,tf]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-bs":[{"border-bs":N()}],"border-w-be":[{"border-be":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":N()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...P(),`hidden`,`none`]}],"divide-style":[{divide:[...P(),`hidden`,`none`]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...P(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[X,Q,Z]}],"outline-w":[{outline:[``,X,rf,Xd]}],"outline-color":[{outline:A()}],shadow:[{shadow:[``,`none`,u,lf,nf]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":[`none`,d,lf,nf]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:N()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[X,Xd]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":[`none`,f,lf,nf]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[X,Q,Z]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Q,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Q,Z]}],filter:[{filter:[``,`none`,Q,Z]}],blur:[{blur:de()}],brightness:[{brightness:[X,Q,Z]}],contrast:[{contrast:[X,Q,Z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,lf,nf]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:[``,X,Q,Z]}],"hue-rotate":[{"hue-rotate":[X,Q,Z]}],invert:[{invert:[``,X,Q,Z]}],saturate:[{saturate:[X,Q,Z]}],sepia:[{sepia:[``,X,Q,Z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Q,Z]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[X,Q,Z]}],"backdrop-contrast":[{"backdrop-contrast":[X,Q,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,X,Q,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,Q,Z]}],"backdrop-invert":[{"backdrop-invert":[``,X,Q,Z]}],"backdrop-opacity":[{"backdrop-opacity":[X,Q,Z]}],"backdrop-saturate":[{"backdrop-saturate":[X,Q,Z]}],"backdrop-sepia":[{"backdrop-sepia":[``,X,Q,Z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Q,Z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[X,`initial`,Q,Z]}],ease:[{ease:[`linear`,`initial`,_,Q,Z]}],delay:[{delay:[X,Q,Z]}],animate:[{animate:[`none`,v,Q,Z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Q,Z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":[`scale-3d`],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[Q,Z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":[`translate-none`],zoom:[{zoom:[zd,Q,Z]}],accent:[{accent:A()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Q,Z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Q,Z]}],fill:[{fill:[`none`,...A()]}],"stroke-w":[{stroke:[X,rf,Xd,Zd]}],stroke:[{stroke:[`none`,...A()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function $(...e){return xf(Gn(e))}var Sf=Jn(`inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-none border font-medium whitespace-nowrap transition-colors disabled:pointer-events-none disabled:opacity-45 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{primary:`border-accent bg-accent text-bg hover:bg-accent-600`,secondary:`border-divider bg-transparent text-ink hover:bg-neutral-200`,ghost:`border-transparent bg-transparent text-ink hover:bg-neutral-200`},size:{default:`h-8 px-4 text-[12px]`,sm:`h-6 px-2 text-[11px]`,icon:`size-8`}},defaultVariants:{variant:`secondary`,size:`default`}});function Cf({className:e,variant:t,size:n,asChild:r=!1,...i}){let a=r?rr:`button`;return(0,F.jsx)(a,{"data-slot":`button`,className:$(Sf({variant:t,size:n,className:e})),...i})}function wf({...e}){return(0,F.jsx)(iu,{"data-slot":`popover`,...e})}function Tf({...e}){return(0,F.jsx)(au,{"data-slot":`popover-trigger`,...e})}function Ef({className:e,align:t=`end`,sideOffset:n=8,...r}){return(0,F.jsx)(ou,{children:(0,F.jsx)(su,{"data-slot":`popover-content`,align:t,sideOffset:n,className:$(`z-50 w-[380px] rounded-none border border-divider bg-bg text-ink shadow-lg outline-none`,e),...r})})}function Df({className:e,...t}){return(0,F.jsx)(`section`,{"data-slot":`card`,className:$(`blueprint flex flex-col bg-bg p-4`,e),...t})}function Of({className:e,...t}){return(0,F.jsx)(`header`,{"data-slot":`card-header`,className:$(`mb-3 flex items-baseline justify-between gap-3`,e),...t})}function kf({className:e,...t}){return(0,F.jsx)(`h2`,{"data-slot":`card-title`,className:$(`eyebrow m-0`,e),...t})}function Af({className:e,...t}){return(0,F.jsx)(`span`,{"data-slot":`card-action`,className:$(`text-[11px] text-neutral-600`,e),...t})}function jf({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-content`,className:$(e),...t})}function Mf({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`skeleton`,className:$(`animate-pulse rounded-none bg-neutral-200`,e),...t})}function Nf({className:e,...t}){return(0,F.jsx)(Hu,{"data-slot":`toggle-group`,className:$(`flex items-stretch border border-divider text-[11px] leading-none`,e),...t})}function Pf({className:e,...t}){return(0,F.jsx)(Xu,{"data-slot":`toggle-group-item`,className:$(`cursor-pointer border-l border-divider bg-transparent px-3 py-2 text-ink transition-colors first:border-l-0 hover:bg-neutral-200 data-[state=on]:bg-accent data-[state=on]:text-bg`,e),...t})}function Ff({title:e,aside:t,className:n,children:r}){return(0,F.jsxs)(Df,{className:n,children:[e&&(0,F.jsxs)(Of,{children:[(0,F.jsx)(kf,{children:e}),t&&(0,F.jsx)(Af,{children:t})]}),(0,F.jsx)(jf,{children:r})]})}function If({options:e,value:t,onPick:n,label:r}){return(0,F.jsx)(Nf,{type:`single`,"aria-label":r,value:t,onValueChange:e=>e&&n(e),children:e.map(e=>(0,F.jsx)(Pf,{value:e.value,children:e.label},e.value))})}function Lf({title:e,aside:t,toolbar:n,children:r}){return(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-baseline justify-between gap-3`,children:[(0,F.jsx)(`h1`,{className:`m-0 text-[34px]`,children:e}),t]}),n,(0,F.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:r})]})}function Rf({className:e,children:t}){return(0,F.jsx)(`div`,{className:$(`min-h-0 flex-1 overflow-auto`,e),children:t})}function zf({value:e}){return e.state===`loading`?(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5 py-2`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:`reading`}),(0,F.jsx)(Mf,{className:`h-3 w-2/5`}),(0,F.jsx)(Mf,{className:`h-3 w-3/5`}),(0,F.jsx)(Mf,{className:`h-3 w-1/3`})]}):e.state===`error`?(0,F.jsx)(`div`,{className:`border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:e.message}):null}function Bf({children:e}){return(0,F.jsx)(`div`,{className:`py-2 text-[12px] text-neutral-500`,children:e})}async function Vf(e){let t=await fetch(e);if(!t.ok)throw Error(`${e} answered ${t.status}`);return await t.json()}function Hf(e){let[t,n]=(0,O.useState)({state:`loading`});return(0,O.useEffect)(()=>{let t=!0;return n({state:`loading`}),Vf(e).then(e=>t&&n({state:`ready`,data:e})).catch(e=>t&&n({state:`error`,message:e.message})),()=>{t=!1}},[e]),t}async function Uf(e,t){try{let n=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return n.ok?null:(await n.json().catch(()=>null))?.error??`${e} answered ${n.status}`}catch(e){return e instanceof Error?e.message:String(e)}}function Wf(e,t,n){return Uf(`/api/isc`,{project:e,id:t,status:n})}function Gf(e,t){return Uf(`/api/placement`,{project:e,quadrant:t})}function Kf(e,t){return Uf(`/api/serves`,{project:e,serves:t})}function qf(e){return Uf(`/api/settings`,e)}function Jf(e,t,n){return Uf(`/api/snooze`,{project:e,id:t,days:n})}function Yf(e){return Uf(`/api/prefs`,e)}function Xf(e){return Uf(`/api/update`,{enabled:e})}function Zf(){return Uf(`/api/update/run`,{})}var Qf={alarm:`bg-alarm`,waiting:`bg-accent`,note:`bg-neutral-400`};function $f(){return(0,F.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9`}),(0,F.jsx)(`path`,{d:`M10.3 21a1.94 1.94 0 0 0 3.4 0`})]})}function ep({item:e,onOpen:t}){return(0,F.jsxs)(`button`,{type:`button`,onClick:t,className:$(`grid w-full cursor-pointer grid-cols-[8px_1fr_auto] items-start gap-3 border-b border-divider px-4 py-3 text-left last:border-b-0 hover:bg-neutral-200`,e.read&&`opacity-55`),children:[(0,F.jsx)(`span`,{className:$(`mt-1.5 size-1.5`,Qf[e.severity])}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`block font-medium`,children:e.title}),(0,F.jsx)(`span`,{className:`block text-[12px] text-neutral-700`,children:e.detail})]}),(0,F.jsx)(`span`,{className:`text-[11px] whitespace-nowrap text-neutral-600`,children:e.at.slice(5,10)})]})}function tp(){let[e,t]=(0,O.useState)(0),[n,r]=(0,O.useState)(!1),i=Hf(`/api/attention?v=${e}`),a=pt(),o=()=>t(e=>e+1),s=i.state===`ready`?i.data.unread:0,c=e=>{Uf(`/api/attention/read`,{ids:[e.id]}).then(()=>{r(!1),o(),a(e.href)})};return(0,F.jsxs)(wf,{open:n,onOpenChange:r,children:[(0,F.jsx)(Tf,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-label":`${s} things need you`,className:`relative cursor-pointer border border-transparent p-1.5 text-ink hover:border-divider`,children:[(0,F.jsx)($f,{}),s>0&&(0,F.jsx)(`span`,{className:`absolute -top-1 -right-1 grid min-w-4 place-items-center bg-accent-900 px-1 text-[10px] font-semibold text-bg tabular-nums`,children:s})]})}),(0,F.jsxs)(Ef,{className:`max-h-[70vh] overflow-auto`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between border-b border-divider px-4 py-2.5`,children:[(0,F.jsx)(`h2`,{className:`font-heading m-0 text-[16px] font-semibold`,children:`Needs your attention`}),(0,F.jsx)(Cf,{variant:`ghost`,size:`sm`,onClick:()=>{Uf(`/api/attention/read`,{all:!0}).then(o)},children:`mark all read`})]}),i.state===`ready`&&i.data.items.length===0?(0,F.jsx)(`div`,{className:`px-4`,children:(0,F.jsx)(Bf,{children:`Nothing is waiting on you.`})}):i.state===`ready`&&i.data.items.map(e=>(0,F.jsx)(ep,{item:e,onOpen:()=>c(e)},e.id))]})]})}var np=[`applied`,`failed`,`denied`,`blocked`],rp=Jn(`inline-flex w-fit shrink-0 items-center justify-center gap-1 rounded-none border border-transparent px-2 py-0.5 text-[10px] whitespace-nowrap [&>svg]:size-3`,{variants:{variant:{accent:`bg-accent-100 text-accent-900`,neutral:`bg-neutral-200 text-neutral-800`,outline:`border-divider text-neutral-700`,alarm:`border-alarm/40 bg-alarm/10 text-alarm`}},defaultVariants:{variant:`neutral`}});function ip({className:e,variant:t,asChild:n=!1,...r}){let i=n?rr:`span`;return(0,F.jsx)(i,{"data-slot":`badge`,className:$(rp({variant:t}),e),...r})}var ap=`h-8 rounded-none border border-divider bg-bg px-2 text-[12px] text-ink outline-none transition-colors focus-visible:border-accent disabled:pointer-events-none disabled:opacity-45`;function op({className:e,type:t,...n}){return(0,F.jsx)(`input`,{type:t,"data-slot":`input`,className:$(ap,e),...n})}function sp({className:e,...t}){return(0,F.jsx)(`select`,{"data-slot":`native-select`,className:$(ap,`cursor-pointer`,e),...t})}function cp({className:e,...t}){return(0,F.jsx)(Bl,{"data-slot":`label`,className:$(`eyebrow flex items-center gap-2 select-none`,e),...t})}function lp({className:e,...t}){return(0,F.jsx)(`table`,{"data-slot":`table`,className:$(`w-full border-separate border-spacing-0 text-left`,e),...t})}function up({className:e,...t}){return(0,F.jsx)(`thead`,{"data-slot":`table-header`,className:$(e),...t})}function dp({className:e,...t}){return(0,F.jsx)(`tbody`,{"data-slot":`table-body`,className:$(e),...t})}function fp({className:e,...t}){return(0,F.jsx)(`tr`,{"data-slot":`table-row`,className:$(`transition-colors hover:bg-neutral-200/50`,e),...t})}function pp({className:e,...t}){return(0,F.jsx)(`th`,{"data-slot":`table-head`,className:$(`eyebrow sticky top-0 z-10 bg-bg px-3 py-2 shadow-[0_1px_0_var(--color-divider)]`,e),...t})}function mp({className:e,...t}){return(0,F.jsx)(`td`,{"data-slot":`table-cell`,className:$(`border-b border-divider/60 px-3 py-2 align-top`,e),...t})}function hp(e){return e===0?`today`:e===1?`1d`:e<30?`${e}d`:e<60?`1mo`:`${Math.floor(e/30)}mo`}function gp(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.toISOString().slice(0,10)} ${t.toTimeString().slice(0,5)}`}function _p(e){return e.toFixed(1)}var vp=200,yp=[`when`,`machine`,`actor`,`action`,`target`,`change`,`outcome`],bp=[`project`,`runtime`,`machine`,`authority`,`outcome`,`since`,`until`],xp=[`user`,`agent`],Sp=[`claude`,`cursor`,`codex`,`copilot`,`opencode`,`unknown`],Cp={project:``,runtime:``,machine:``,authority:``,outcome:``,since:``,until:``};function wp(e){return e.state===`ready`?[...new Set(e.data.rows.map(e=>e.machine))].filter(Boolean).sort():[]}function Tp(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r&&t.set(n,r);let n=t.toString();return n?`/api/ledger?${n}`:`/api/ledger`}function Ep(e){return e===`applied`?`neutral`:e===`failed`?`outline`:`alarm`}function Dp({label:e,control:t}){let n=(0,O.useId)();return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(cp,{htmlFor:n,children:e}),t(n)]})}function Op({view:e}){let t=[{n:e.stats.total,label:`actions`},{n:e.stats.refusals,label:`refusals`},...np.map(t=>({n:e.stats.outcomes[t].total,label:t}))];return(0,F.jsx)(`div`,{className:`mb-4 grid grid-cols-2 gap-px border border-divider bg-divider sm:grid-cols-3 lg:grid-cols-6`,children:t.map(e=>(0,F.jsxs)(`div`,{className:`bg-bg px-3 py-2.5`,children:[(0,F.jsx)(`div`,{className:`font-heading text-[26px] leading-none font-semibold tabular-nums`,children:e.n}),(0,F.jsx)(`div`,{className:`eyebrow`,children:e.label})]},e.label))})}function kp({r:e,open:t,onToggle:n}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(fp,{className:`cursor-pointer`,onClick:n,children:[(0,F.jsx)(mp,{className:`whitespace-nowrap text-neutral-700`,children:gp(e.ts)}),(0,F.jsx)(mp,{className:`whitespace-nowrap`,children:e.machine}),(0,F.jsxs)(mp,{children:[e.actor,(0,F.jsxs)(`span`,{className:`block text-[11px] text-neutral-600`,children:[e.authority,` · `,e.runtime]})]}),(0,F.jsx)(mp,{className:`font-mono text-[11.5px]`,children:e.tool}),(0,F.jsx)(mp,{title:e.target,children:e.target}),(0,F.jsx)(mp,{className:`whitespace-nowrap text-neutral-700`,children:e.change}),(0,F.jsxs)(mp,{children:[(0,F.jsx)(ip,{variant:Ep(e.outcome),children:e.outcome}),e.reason&&(0,F.jsx)(`span`,{className:`block max-w-[220px] text-[11px] text-neutral-700`,children:e.reason})]})]}),t&&(e.command||e.reason)&&(0,F.jsx)(fp,{children:(0,F.jsx)(mp,{colSpan:yp.length,className:`bg-neutral-200`,children:(0,F.jsxs)(`pre`,{className:`m-0 font-mono text-[11.5px] whitespace-pre-wrap`,children:[e.command?`$ ${e.command}\n`:``,e.reason??``]})})})]})}function Ap({filter:e,onFilter:t}){let n=Hf(`/api/projects`),r=Hf(Tp(e)),[i,a]=(0,O.useState)(null),o=(n,r,i=`all`)=>(0,F.jsx)(Dp,{label:n,control:a=>(0,F.jsxs)(sp,{id:a,value:e[n],onChange:e=>t({[n]:e.target.value}),children:[(0,F.jsx)(`option`,{value:``,children:i}),r.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})});return(0,F.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-end gap-3`,children:[o(`project`,n.state===`ready`?n.data.map(e=>e.slug):[]),o(`runtime`,Sp),o(`machine`,wp(r),`both`),o(`authority`,xp),o(`outcome`,np),(0,F.jsx)(Dp,{label:`since`,control:n=>(0,F.jsx)(op,{id:n,type:`date`,value:e.since,onChange:e=>t({since:e.target.value})})}),(0,F.jsx)(Dp,{label:`until`,control:n=>(0,F.jsx)(op,{id:n,type:`date`,value:e.until,onChange:e=>t({until:e.target.value})})}),(0,F.jsx)(Cf,{variant:`secondary`,onClick:()=>t(Cp),children:`reset`})]}),(0,F.jsx)(zf,{value:r}),r.state===`ready`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Op,{view:r.data}),(0,F.jsx)(`div`,{className:`blueprint flex min-h-0 flex-1 flex-col bg-bg`,children:r.data.rows.length===0?(0,F.jsx)(Bf,{children:`No actions in this window.`}):(0,F.jsx)(Rf,{children:(0,F.jsxs)(lp,{className:`min-w-[880px] text-[12.5px]`,children:[(0,F.jsx)(up,{children:(0,F.jsx)(`tr`,{children:yp.map(e=>(0,F.jsx)(pp,{children:e},e))})}),(0,F.jsx)(dp,{children:r.data.rows.slice(0,vp).map(e=>(0,F.jsx)(kp,{r:e,open:i===e.id,onToggle:()=>a(i===e.id?null:e.id)},e.id))})]})})}),r.data.rows.length>vp&&(0,F.jsxs)(`p`,{className:`pt-2 text-[12px] text-neutral-500`,children:[`Newest `,vp,` of `,r.data.rows.length,`. Narrow the window for the rest.`]})]})]})}function jp({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,F.jsx)(mu,{"data-slot":`separator`,decorative:n,orientation:t,className:$(`shrink-0 bg-divider data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}var Mp={open:``,done:`✓`,retired:`~`},Np=7;function Pp(e){return e===`applied`?`neutral`:e===`failed`?`outline`:`alarm`}function Fp({slug:e,iscs:t,onChanged:n}){let[r,i]=(0,O.useState)(null);if(t.length===0)return(0,F.jsx)(Bf,{children:`No criteria written yet.`});let a=t=>{Wf(e,t.id,t.status===`open`?`done`:`open`).then(e=>{i(e),e||n()})};return(0,F.jsxs)(F.Fragment,{children:[r&&(0,F.jsx)(`p`,{className:`mb-2 border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:r}),(0,F.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:t.map(t=>(0,F.jsxs)(`li`,{className:$(`grid grid-cols-[18px_58px_minmax(0,1fr)] items-start gap-3 border-b border-divider/60 py-2 last:border-b-0`,t.status!==`open`&&`opacity-60`),children:[(0,F.jsxs)(`button`,{type:`button`,disabled:t.status===`retired`,onClick:()=>a(t),title:t.status===`open`?`close this criterion`:`reopen it`,className:$(`mt-0.5 grid size-3.5 cursor-pointer place-items-center border border-neutral-500 text-[10px] leading-none text-bg hover:border-accent disabled:cursor-default`,t.status===`done`&&`bg-accent`,t.status===`retired`&&`bg-neutral-400`),children:[Mp[t.status],(0,F.jsx)(`span`,{className:`sr-only`,children:t.status})]}),(0,F.jsxs)(`span`,{className:`pt-px text-[11.5px] text-neutral-600`,children:[`ISC-`,t.id]}),(0,F.jsxs)(`span`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`span`,{className:`text-pretty`,children:[t.text,t.snoozedUntil&&(0,F.jsxs)(`span`,{className:`block text-[11.5px] text-neutral-600`,children:[`snoozed until `,t.snoozedUntil]})]}),t.status===`open`&&(0,F.jsx)(Cf,{variant:`ghost`,size:`sm`,onClick:()=>{Jf(e,t.id,t.snoozedUntil?0:Np).then(e=>{i(e),e||n()})},children:t.snoozedUntil?`wake`:`snooze ${Np}d`})]})]},t.id))})]})}function Ip({decisions:e}){return e.length===0?(0,F.jsx)(Bf,{children:`Nothing recorded.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5 text-[12.5px]`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[78px_1fr] gap-3`,children:[(0,F.jsx)(`span`,{className:`text-[11.5px] text-neutral-600`,children:e.date??`—`}),(0,F.jsxs)(`span`,{children:[e.text,e.why&&(0,F.jsxs)(`span`,{className:`text-neutral-600`,children:[` — `,e.why]})]})]},e.text))})}function Lp({runtimes:e}){let t=Object.entries(e);if(t.length===0)return(0,F.jsx)(Bf,{children:`No recorded actions in the window.`});let n=Math.max(1,...t.map(([,e])=>e));return(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:t.map(([e,t])=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[70px_1fr_32px] items-center gap-2 text-[12px]`,children:[(0,F.jsx)(`span`,{children:e}),(0,F.jsx)(`span`,{className:`h-1.5 bg-neutral-300`,children:(0,F.jsx)(`span`,{className:`block h-1.5 bg-accent`,style:{width:`${t/n*100}%`}})}),(0,F.jsx)(`span`,{className:`text-right tabular-nums text-neutral-700`,children:t})]},e))})}function Rp({rows:e}){return e.length===0?(0,F.jsx)(Bf,{children:`Nothing recorded yet.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[86px_1fr_auto] gap-2 text-[11.5px]`,children:[(0,F.jsx)(`span`,{className:`text-neutral-600`,children:gp(e.ts).slice(5)}),(0,F.jsxs)(`span`,{className:`truncate`,children:[(0,F.jsx)(`b`,{className:`font-medium`,children:e.tool}),` `,(0,F.jsx)(`span`,{className:`text-neutral-700`,children:e.target})]}),(0,F.jsx)(ip,{variant:Pp(e.outcome),children:e.outcome})]},e.id))})}function zp({d:e}){let t=e.iscs.filter(e=>e.status===`open`).length;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`nav`,{className:`mb-1.5 text-[12px] text-neutral-600`,children:[(0,F.jsx)(jn,{to:`/projects`,className:`hover:text-accent`,children:`projects`}),` `,`/ `,e.slug]}),(0,F.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-start justify-between gap-6`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`h1`,{className:`m-0 flex items-center gap-3 text-[38px]`,children:[e.slug,(0,F.jsx)(ip,{variant:`neutral`,children:e.status})]}),(0,F.jsx)(`p`,{className:`max-w-[760px] text-[13px] text-pretty text-neutral-800`,children:e.goal||e.purpose})]}),(0,F.jsxs)(`div`,{className:`text-right text-[11.5px] text-neutral-600`,children:[(0,F.jsx)(`div`,{children:e.remote??`no remote on record`}),(0,F.jsx)(`div`,{children:e.path??`not checked out here`}),(0,F.jsxs)(`div`,{children:[t,` open · serves `,e.serves??`nothing on record`,e.servesBy&&` · ${e.servesBy}`]})]})]})]})}function Bp({slug:e}){let[t,n]=(0,O.useState)(0),r=Hf(`/api/project?slug=${encodeURIComponent(e)}&v=${t}`);if(r.state!==`ready`)return(0,F.jsx)(zf,{value:r});let i=r.data;return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(zp,{d:i}),(0,F.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_340px]`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,F.jsx)(Ff,{title:`Ideal state criteria`,aside:`changes here write to the record directly · no agent, no tokens`,children:(0,F.jsx)(Fp,{slug:i.slug,iscs:i.iscs,onChanged:()=>n(e=>e+1)})}),(0,F.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-2`,children:[(0,F.jsx)(Ff,{title:`Next`,children:i.next.length===0?(0,F.jsx)(Bf,{children:`nothing queued`}):(0,F.jsx)(`ol`,{className:`m-0 flex list-decimal flex-col gap-1.5 pl-5 text-[12.5px]`,children:i.next.map(e=>(0,F.jsx)(`li`,{children:e},e))})}),(0,F.jsx)(Ff,{title:`Blockers`,children:i.blockers.length===0?(0,F.jsx)(Bf,{children:`none`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5 text-[12.5px]`,children:i.blockers.map(e=>(0,F.jsx)(`p`,{className:`bg-accent-100 px-2 py-1.5 text-accent-900`,children:e},e))})})]}),(0,F.jsx)(Ff,{title:`Decisions`,children:(0,F.jsx)(Ip,{decisions:i.decisions})})]}),(0,F.jsxs)(`aside`,{className:`flex flex-col gap-6`,children:[(0,F.jsx)(Ff,{title:`Handoff`,children:i.handoff?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{className:`text-[12.5px] text-pretty`,title:i.handoff.full,children:i.handoff.sentence}),i.handoff.waitingOn&&(0,F.jsxs)(`p`,{className:`mt-2 bg-accent-100 px-2 py-1.5 text-[12px] text-accent-900`,children:[`waiting on you · `,i.handoff.waitingOn]})]}):(0,F.jsx)(Bf,{children:`No handoff. Every session on this project closed cleanly.`})}),(0,F.jsxs)(Ff,{title:`Agents on this project · 14d`,aside:(0,F.jsx)(jn,{to:`/log?project=${encodeURIComponent(i.slug)}`,className:`hover:text-accent`,children:`full log →`}),children:[(0,F.jsx)(Lp,{runtimes:i.runtimes}),(0,F.jsx)(jp,{className:`my-3`}),(0,F.jsx)(Rp,{rows:i.recent})]}),(0,F.jsx)(Ff,{title:`Context`,children:i.context.length===0?(0,F.jsx)(Bf,{children:`nothing recorded`}):(0,F.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-4 text-[12.5px]`,children:i.context.map(e=>(0,F.jsx)(`li`,{children:e},e))})})]})]})]})}var Vp=[{value:`ranked`,label:`active + paused`},{value:`active`,label:`active`},{value:`paused`,label:`paused`},{value:`all`,label:`all`}];function Hp(e){return Vp.some(t=>t.value===e)}var Up=new Set([`active`,`paused`]),Wp=[{label:`Project`,numeric:!1},{label:`Status`,numeric:!1},{label:`Serves`,numeric:!1},{label:`Open ISCs`,numeric:!0},{label:`Sessions / 30d`,numeric:!0},{label:`Agents`,numeric:!1},{label:`Here`,numeric:!1},{label:`Touched`,numeric:!0}];function Gp(e,t){return t===`all`?!0:t===`ranked`?Up.has(e.status):e.status===t}function Kp({card:e}){return(0,F.jsxs)(fp,{children:[(0,F.jsxs)(mp,{children:[(0,F.jsx)(jn,{to:`/projects/${e.slug}`,className:`font-heading text-[15px] font-semibold text-ink hover:text-accent`,children:e.slug}),e.next[0]&&(0,F.jsx)(`span`,{className:`block text-[11.5px] text-neutral-700`,children:e.next[0]})]}),(0,F.jsx)(mp,{children:(0,F.jsx)(ip,{variant:`neutral`,children:e.status})}),(0,F.jsxs)(mp,{className:`text-[12px]`,children:[e.serves??`unranked`,e.servesBy&&(0,F.jsxs)(`span`,{className:`ml-1 text-[10.5px] text-neutral-600`,children:[`· `,e.servesBy]})]}),(0,F.jsx)(mp,{className:`font-heading text-right text-[16px] font-semibold tabular-nums`,children:e.openIscs}),(0,F.jsx)(mp,{className:`text-right tabular-nums`,children:e.sessions30d}),(0,F.jsx)(mp,{children:(0,F.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:Object.entries(e.runtimes).map(([e,t])=>(0,F.jsxs)(ip,{variant:`outline`,children:[e,` `,t]},e))})}),(0,F.jsx)(mp,{className:`text-[12px] text-neutral-700`,children:e.path??`not checked out here`}),(0,F.jsx)(mp,{className:`text-right text-[12px] whitespace-nowrap text-neutral-700`,children:hp(e.ageDays)})]})}function qp({filter:e}){let t=Hf(`/api/board`);if(t.state!==`ready`)return(0,F.jsx)(zf,{value:t});let n=t.data.filter(t=>Gp(t,e));return(0,F.jsx)(`div`,{className:`blueprint flex min-h-0 flex-1 flex-col bg-bg`,children:n.length===0?(0,F.jsx)(Bf,{children:`No project matches this filter.`}):(0,F.jsx)(Rf,{children:(0,F.jsxs)(lp,{className:`min-w-[880px] text-[13px]`,children:[(0,F.jsx)(up,{children:(0,F.jsx)(`tr`,{children:Wp.map(e=>(0,F.jsx)(pp,{className:$(e.numeric&&`text-right`),children:e.label},e.label))})}),(0,F.jsx)(dp,{children:n.map(e=>(0,F.jsx)(Kp,{card:e},e.slug))})]})})})}function Jp({className:e,...t}){return(0,F.jsx)(Tu,{"data-slot":`switch`,className:$(`inline-flex h-4 w-7 shrink-0 cursor-pointer items-center border border-divider transition-colors data-[state=checked]:bg-accent data-[state=unchecked]:bg-transparent`,e),...t,children:(0,F.jsx)(Du,{"data-slot":`switch-thumb`,className:`block size-2.5 transition-transform data-[state=checked]:translate-x-3.5 data-[state=checked]:bg-bg data-[state=unchecked]:translate-x-0.5 data-[state=unchecked]:bg-neutral-500`})})}function Yp({label:e,hint:t,value:n,onChange:r}){return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(cp,{children:e}),(0,F.jsx)(`span`,{className:`text-[11px] text-neutral-600`,children:t}),(0,F.jsx)(op,{value:n,onChange:e=>r(e.target.value)})]})}function Xp({initial:e}){let[t,n]=(0,O.useState)(e),[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(!1),s=t.actor!==e.actor||t.timezone!==e.timezone;return(0,O.useEffect)(()=>{s&&o(!1)},[s]),(0,F.jsx)(Ff,{title:`This install`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsx)(Yp,{label:`actor`,hint:`who caused a record — this travels with an export`,value:t.actor,onChange:e=>n({...t,actor:e})}),(0,F.jsx)(Yp,{label:`timezone`,hint:`how dates are read, e.g. Europe/Budapest`,value:t.timezone,onChange:e=>n({...t,timezone:e})}),r&&(0,F.jsx)(`p`,{className:`border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:r}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(Cf,{variant:`primary`,disabled:!s,onClick:()=>{qf({...t}).then(e=>{i(e),o(e===null)})},children:`Save`}),a&&(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-600`,children:`saved`})]})]})})}function Zp(e){return e.finishedAt??e.attemptedAt??e.skippedAt??``}function Qp(e){if(!e)return`never run`;let t=Zp(e),n=t?` · ${gp(t)}`:``;return t&&t===e.skippedAt?`waited — ${e.skipped}${n}`:e.finishedAt?e.ok?`updated ${e.from} → ${e.to}${n}`:`failed — ${e.error??`unknown error`}${n}`:`running since ${gp(e.attemptedAt??``)}`}function $p(e){return e.available&&e.latest?`${e.current} → ${e.latest}`:`${e.current} · up to date`}function em({initial:e}){let[t,n]=(0,O.useState)(e),[r,i]=(0,O.useState)(null),[a,o]=(0,O.useState)(!1),s=()=>{fetch(`/api/update`).then(e=>e.json()).then(n).catch(()=>i(`could not read update status`))};return(0,F.jsx)(Ff,{title:`Updates`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[12.5px]`,children:[(0,F.jsx)(`span`,{children:`update once a day, when a session closes`}),(0,F.jsx)(Jp,{"aria-label":`update once a day`,checked:t.enabled,onCheckedChange:e=>{n({...t,enabled:e}),Xf(e).then(r=>{i(r),r&&n({...t,enabled:!e})})}})]}),(0,F.jsxs)(`dl`,{className:`m-0 grid grid-cols-[110px_1fr] gap-y-1.5 text-[12.5px]`,children:[(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`version`}),(0,F.jsx)(`dd`,{className:`m-0 tabular-nums`,children:$p(t)}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`last run`}),(0,F.jsx)(`dd`,{className:`m-0`,children:Qp(t.last)})]}),r&&(0,F.jsx)(`p`,{className:`border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:r}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(Cf,{variant:`primary`,disabled:a,onClick:()=>{o(!0),Zf().then(e=>{i(e),setTimeout(()=>{o(!1),s()},4e3)})},children:a?`Updating…`:`Update now`}),t.mode===`repo`&&(0,F.jsx)(`span`,{className:`text-[11px] text-neutral-600`,children:`waits if this clone has uncommitted changes`})]})]})})}var tm={refusals:`A hook blocked a call, or you denied one`,waiting:`A handoff left a question for you`,unranked:`A project has no purpose on record`},nm=[{key:`quietAfterDays`,label:`a project is "gone quiet" after`},{key:`urgentWithinDays`,label:`a dated step is urgent within`}];function rm({initial:e}){let[t,n]=(0,O.useState)(e),[r,i]=(0,O.useState)(null),a=e=>{Yf(e).then(r=>{i(r),r||n({...t,...e})})};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ff,{title:`Ranking`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[nm.map(({key:e,label:r})=>(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(cp,{children:r}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(op,{type:`number`,min:1,max:365,className:`w-20`,value:t[e],onChange:r=>{let i=Number(r.target.value);n({...t,[e]:i}),Number.isInteger(i)&&i>0&&a({[e]:i})}}),(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-700`,children:`days`})]})]},e)),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-divider pt-3 text-[12.5px]`,children:[(0,F.jsx)(`span`,{children:`rank stated goals in the grid, not just projects`}),(0,F.jsx)(Jp,{"aria-label":`rank stated goals in the grid`,checked:t.rankGoals,onCheckedChange:e=>a({rankGoals:e})})]}),r&&(0,F.jsx)(`p`,{className:`border-l-2 border-alarm bg-alarm/10 px-3 py-2 text-[12px] text-alarm`,children:r})]})}),(0,F.jsxs)(Ff,{title:`Attention`,children:[(0,F.jsx)(`p`,{className:`mb-3 text-[12px] text-neutral-700`,children:`What lights the bell. Each source is a fact PAL already holds — nothing here asks a model.`}),(0,F.jsx)(`div`,{className:`flex flex-col`,children:Object.entries(t.attention).map(([e,t])=>(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-divider py-2.5 text-[12.5px] first:border-t-0`,children:[(0,F.jsx)(`span`,{children:tm[e]??e}),(0,F.jsx)(Jp,{"aria-label":tm[e]??e,checked:t,onCheckedChange:t=>a({attention:{[e]:t}})})]},e))})]})]})}function im(){let e=Hf(`/api/settings`),t=Hf(`/api/prefs`),n=Hf(`/api/status`),r=Hf(`/api/update`);return e.state===`ready`?(0,F.jsxs)(`div`,{className:`grid items-start gap-6 md:grid-cols-2`,children:[(0,F.jsx)(Xp,{initial:e.data}),t.state===`ready`&&(0,F.jsx)(rm,{initial:t.data}),r.state===`ready`&&(0,F.jsx)(em,{initial:r.data}),(0,F.jsxs)(Ff,{title:`Where it runs`,children:[n.state===`ready`?(0,F.jsxs)(`dl`,{className:`m-0 grid grid-cols-[110px_1fr] gap-y-1.5 text-[12.5px]`,children:[(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`machine`}),(0,F.jsx)(`dd`,{className:`m-0`,children:n.data.machine}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`port`}),(0,F.jsx)(`dd`,{className:`m-0 tabular-nums`,children:n.data.port}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`pid`}),(0,F.jsx)(`dd`,{className:`m-0 tabular-nums`,children:n.data.pid}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`ledger`}),(0,F.jsxs)(`dd`,{className:`m-0`,children:[n.data.ledgerFiles,` file(s)`]}),(0,F.jsx)(`dt`,{className:`text-neutral-600`,children:`up since`}),(0,F.jsx)(`dd`,{className:`m-0`,children:n.data.startedAt})]}):(0,F.jsx)(Bf,{children:`not answering`}),(0,F.jsxs)(`p`,{className:`mt-3 text-[11px] text-neutral-600`,children:[`Loopback only. The machine label is set with `,(0,F.jsx)(`code`,{children:`pal cli machine`}),`, and stays on this machine.`]})]})]}):(0,F.jsx)(zf,{value:e})}var am=[`goal`,`revenue`,`fun`];function om({item:e,onSaved:t}){return e.kind===`project`?(0,F.jsxs)(sp,{"aria-label":`what ${e.label} serves`,value:e.serves??``,title:e.servesBy===`user`?`your answer`:`PAL's guess — change it to correct it`,onChange:n=>{Kf(e.id,n.target.value).then(t)},className:$(`h-auto py-0.5 text-[10px]`,e.servesBy===`user`&&`border-accent bg-accent-100 text-accent-900`),children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`unranked`}),am.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]}):null}var sm=[{value:``,label:`let PAL place it`},{value:`now`,label:`Do now`},{value:`plan`,label:`Give it a slot`},{value:`noise`,label:`Loud, not load-bearing`},{value:`later`,label:`Let it sit`}];function cm({item:e,onSaved:t}){return e.kind===`project`?(0,F.jsx)(sp,{"aria-label":`where ${e.label} belongs`,value:e.placed??``,title:e.placed?`your placement`:`placed by PAL — change it to overrule`,onChange:n=>{Gf(e.id,n.target.value||null).then(t)},className:$(`h-auto py-0.5 text-[10px]`,e.placed&&`border-accent bg-accent-100 text-accent-900`),children:sm.map(e=>(0,F.jsx)(`option`,{value:e.value,children:e.label},e.value))}):null}function lm({item:e}){return(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.urgentBecause.map(e=>(0,F.jsx)(ip,{variant:`accent`,children:e},e)),(0,F.jsx)(ip,{variant:`neutral`,children:e.importantBecause})]})}function um({item:e,onSaved:t}){let n=e.kind===`project`;return(0,F.jsxs)(`article`,{className:`flex flex-col gap-2 border border-divider bg-bg px-3 py-3 hover:border-accent`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n?(0,F.jsx)(jn,{to:`/projects/${e.id}`,className:`font-heading text-[16px] font-semibold text-ink hover:text-accent`,children:e.label}):(0,F.jsx)(`span`,{className:`font-heading text-[16px] font-semibold text-ink`,children:e.label}),n?(0,F.jsx)(om,{item:e,onSaved:t}):(0,F.jsx)(ip,{variant:`accent`,children:`goal`}),(0,F.jsx)(`span`,{className:`ml-auto text-[11px] whitespace-nowrap text-neutral-600`,children:e.due??``})]}),e.waitingOn&&(0,F.jsxs)(`p`,{className:`bg-accent-100 px-2 py-1.5 text-[12px] text-accent-900`,children:[`waiting on you · `,e.waitingOn]}),e.detail&&(0,F.jsx)(`p`,{className:`text-[12px] text-neutral-800`,children:e.detail}),(0,F.jsx)(lm,{item:e}),n&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-divider/60 pt-2`,children:[(0,F.jsx)(`span`,{className:`eyebrow`,children:`placed`}),(0,F.jsx)(cm,{item:e,onSaved:t})]})]})}function dm({moves:e,size:t=`compact`}){return e.length===0?(0,F.jsx)(Bf,{children:`No moves yet. They are written when a session ends — finish one and come back.`}):(0,F.jsx)(`ol`,{className:`flex list-none flex-col gap-0 p-0`,children:e.map((e,n)=>(0,F.jsxs)(`li`,{className:$(`grid items-start gap-4 border-t border-divider py-4 first:border-t-0`,t===`large`?`grid-cols-[44px_1fr]`:`grid-cols-[26px_1fr]`),children:[(0,F.jsx)(`span`,{className:$(`font-heading leading-none font-semibold text-accent`,t===`large`?`text-[40px]`:`text-[22px]`),children:String(n+1).padStart(2,`0`)}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:$(`block font-medium text-pretty`,t===`large`&&`font-heading text-[22px] leading-tight font-semibold`),children:e.move}),(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-700`,children:e.because})]})]},e.move))})}function fm({cards:e}){return e.length===0?(0,F.jsx)(Bf,{children:`Nothing in progress. Every handoff is closed.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsxs)(`span`,{className:`flex justify-between gap-2 text-[11px] text-neutral-600`,children:[e.slug?(0,F.jsx)(jn,{to:`/projects/${e.slug}`,className:`font-semibold text-ink hover:text-accent`,children:e.label}):(0,F.jsx)(`b`,{className:`font-semibold text-ink`,children:e.label}),(0,F.jsxs)(`span`,{children:[e.source,` · `,hp(e.ageDays)]})]}),(0,F.jsx)(`span`,{className:`text-[12.5px] text-pretty`,title:e.handoff,children:e.sentence})]},e.cwd))})}function pm({goals:e}){return e.length===0?(0,F.jsx)(Bf,{children:`No goals written down yet.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`flex justify-between gap-2 text-[12.5px]`,children:[(0,F.jsx)(`span`,{className:`text-pretty`,children:e.label}),(0,F.jsx)(`span`,{className:`text-[11px] whitespace-nowrap text-neutral-600`,children:e.due??e.detail})]}),(0,F.jsxs)(`div`,{className:`mt-1 text-[11px] text-neutral-600`,children:[e.progress?`${e.progress.closed} of ${e.progress.written} criteria closed · served by ${e.progress.projects.join(`, `)}`:`no project serves this yet`,e.urgentBecause.length>0&&` · ${e.urgentBecause.join(` · `)}`]})]},e.id))})}var mm=[{value:`matrix`,label:`matrix`},{value:`list`,label:`list`},{value:`briefing`,label:`briefing`}];function hm(e){return mm.some(t=>t.value===e)}var gm=[{id:`now`,title:`Do now`,note:`matters and cannot wait`,lit:!0},{id:`plan`,title:`Give it a slot`,note:`matters, nothing forcing it`,lit:!1},{id:`noise`,title:`Loud, not load-bearing`,note:`pressing but serves nothing`,lit:!1},{id:`later`,title:`Let it sit`,note:`neither`,lit:!1}],_m=14;function vm(e){return[...e.now,...e.plan,...e.noise,...e.later].filter(e=>e.kind===`goal`)}function ym(e){return gm.flatMap(({id:t,title:n})=>e[t].map(e=>({item:e,quadrant:n})))}function bm({title:e,note:t,lit:n,items:r,onSaved:i,compact:a}){return(0,F.jsxs)(`div`,{className:$(`blueprint flex flex-col gap-2 p-4`,n?`bg-accent-100`:`bg-transparent`,a?`min-h-[120px]`:`min-h-[160px]`),children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,F.jsx)(`h3`,{className:`m-0 text-[20px]`,children:e}),(0,F.jsx)(`span`,{className:`text-[11px] text-neutral-700`,children:t})]}),r.length===0?(0,F.jsx)(Bf,{children:`nothing here`}):r.map(e=>(0,F.jsx)(um,{item:e,onSaved:i},`${e.kind}:${e.id}`))]})}function xm(){let e=Hf(`/api/summary?days=${_m}`),t=e.state===`ready`?e.data:null;return(0,F.jsx)(Ff,{title:`Last ${_m} days`,children:(0,F.jsxs)(`dl`,{className:`m-0 grid grid-cols-3 gap-2`,children:[(0,F.jsx)(Sm,{n:t?String(t.actions):`—`,label:`actions`}),(0,F.jsx)(Sm,{n:t?String(t.refusals):`—`,label:`refusals`}),(0,F.jsx)(Sm,{n:t?.rating===null||!t?`—`:_p(t.rating),label:`rating, last 10`})]})})}function Sm({n:e,label:t}){return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`dt`,{className:`font-heading text-[26px] leading-none font-semibold tabular-nums`,children:e}),(0,F.jsx)(`dd`,{className:`m-0 text-[11px] text-neutral-600`,children:t})]})}function Cm(){let e=Hf(`/api/signal`);if(e.state!==`ready`)return(0,F.jsx)(zf,{value:e});let t=Object.entries(e.data.due).filter(([,e])=>e.state===`due`);return t.length===0?(0,F.jsx)(Bf,{children:`Nothing is due.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.map(([e,t])=>(0,F.jsxs)(`div`,{className:`text-[12px]`,children:[(0,F.jsx)(ip,{variant:`accent`,children:e}),(0,F.jsx)(`span`,{className:`ml-2 text-neutral-700`,children:t.detail})]},e))})}function wm({matrix:e,handoffs:t}){return(0,F.jsxs)(`aside`,{className:`flex flex-col gap-6`,children:[(0,F.jsx)(Ff,{title:`Where you left off`,children:(0,F.jsx)(fm,{cards:t})}),(0,F.jsx)(Ff,{title:`Goals`,children:(0,F.jsx)(pm,{goals:vm(e)})}),(0,F.jsx)(xm,{}),(0,F.jsx)(Ff,{title:`Needs a run`,children:(0,F.jsx)(Cm,{})})]})}function Tm({matrix:e,handoffs:t,moves:n,onSaved:r}){return(0,F.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`mb-6 grid gap-px border border-divider bg-divider md:grid-cols-3`,children:n.map((e,t)=>(0,F.jsxs)(`div`,{className:`grid grid-cols-[26px_1fr] gap-2 bg-bg px-4 py-3`,children:[(0,F.jsx)(`span`,{className:`font-heading text-[22px] leading-none font-semibold text-accent`,children:String(t+1).padStart(2,`0`)}),(0,F.jsxs)(`span`,{children:[(0,F.jsx)(`span`,{className:`block font-medium text-pretty`,children:e.move}),(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-700`,children:e.because})]})]},e.move))}),(0,F.jsxs)(`div`,{className:`grid grid-cols-[18px_minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,F.jsx)(`div`,{}),(0,F.jsx)(`div`,{className:`eyebrow pb-1.5 pl-3`,children:`urgent`}),(0,F.jsx)(`div`,{className:`eyebrow pb-1.5 pl-3`,children:`not urgent`}),(0,F.jsx)(`div`,{className:`eyebrow [writing-mode:vertical-rl] rotate-180 text-center`,children:`important`}),gm.slice(0,2).map(t=>(0,F.jsx)(bm,{...t,items:e[t.id],onSaved:r},t.id)),(0,F.jsx)(`div`,{className:`eyebrow [writing-mode:vertical-rl] rotate-180 text-center`,children:`not important`}),gm.slice(2).map(t=>(0,F.jsx)(bm,{...t,items:e[t.id],onSaved:r},t.id))]})]}),(0,F.jsx)(wm,{matrix:e,handoffs:t})]})}function Em({matrix:e,handoffs:t,moves:n}){return(0,F.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_260px]`,children:[(0,F.jsx)(`div`,{className:`blueprint overflow-x-auto bg-bg`,children:(0,F.jsxs)(lp,{className:`min-w-[720px] text-[13px]`,children:[(0,F.jsx)(up,{children:(0,F.jsx)(`tr`,{children:[`Item`,`Placed`,`Why`,`Next`].map(e=>(0,F.jsx)(pp,{children:e},e))})}),(0,F.jsx)(dp,{children:ym(e).map(({item:e,quadrant:t})=>(0,F.jsxs)(fp,{children:[(0,F.jsx)(mp,{children:(0,F.jsx)(`span`,{className:`font-heading text-[15px] font-semibold`,children:e.label})}),(0,F.jsx)(mp,{className:`whitespace-nowrap`,children:t}),(0,F.jsx)(mp,{className:`min-w-[200px]`,children:(0,F.jsx)(lm,{item:e})}),(0,F.jsx)(mp,{className:`max-w-[320px] text-[12px] text-neutral-800`,children:e.detail})]},`${e.kind}:${e.id}`))})]})}),(0,F.jsxs)(`aside`,{className:`flex flex-col gap-6`,children:[(0,F.jsx)(Ff,{title:`Three moves`,children:(0,F.jsx)(dm,{moves:n})}),(0,F.jsx)(Ff,{title:`Grid`,children:(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-1`,children:gm.map(t=>(0,F.jsxs)(`div`,{className:`border border-divider p-2`,children:[(0,F.jsx)(`span`,{className:`font-heading block text-[24px] leading-none font-semibold`,children:e[t.id].length}),(0,F.jsx)(`span`,{className:`eyebrow`,children:t.title})]},t.id))})}),(0,F.jsx)(Ff,{title:`Where you left off`,children:(0,F.jsx)(fm,{cards:t})})]})]})}function Dm({matrix:e,handoffs:t,moves:n,onSaved:r}){return(0,F.jsxs)(`div`,{className:`grid items-start gap-8 lg:grid-cols-[minmax(0,7fr)_minmax(0,5fr)]`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h6`,{className:`eyebrow mb-2`,children:`If you only do three things`}),(0,F.jsx)(dm,{moves:n,size:`large`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h6`,{className:`eyebrow mb-2`,children:`Where you left off`}),(0,F.jsx)(fm,{cards:t})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h6`,{className:`eyebrow mb-2`,children:`The grid`}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:gm.map(t=>(0,F.jsx)(bm,{...t,compact:!0,items:e[t.id],onSaved:r},t.id))})]}),(0,F.jsx)(Ff,{title:`Goals`,children:(0,F.jsx)(pm,{goals:vm(e)})})]})]})}function Om({agenda:e,matrix:t}){let n=e.generatedAt?`agenda written ${e.ageHours??0}h ago at session stop`:`no agenda written yet`;return(0,F.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-baseline justify-between gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-4`,children:[(0,F.jsx)(`h1`,{className:`m-0 text-[34px]`,children:new Date().toLocaleDateString(void 0,{weekday:`long`,day:`numeric`,month:`long`})}),(0,F.jsxs)(`span`,{className:$(`text-[12px]`,e.stale?`text-alarm`:`text-neutral-700`),children:[n,` · `,t.now.length,` items need you`]})]}),t.unranked>0&&(0,F.jsxs)(`span`,{className:`text-[12px] text-neutral-700`,children:[t.unranked,` project(s) with no purpose on record`]})]})}function km({layout:e}){let[t,n]=(0,O.useState)(0),r=Hf(`/api/matrix?v=${t}`),i=Hf(`/api/agenda`),a=Hf(`/api/handoffs`),o=()=>n(e=>e+1),s=[r,i,a].find(e=>e.state!==`ready`);if(s||r.state!==`ready`)return(0,F.jsx)(zf,{value:s??r});if(i.state!==`ready`||a.state!==`ready`)return null;let c={matrix:r.data,handoffs:a.data,moves:i.data.moves,onSaved:o};return(0,F.jsxs)(`section`,{children:[(0,F.jsx)(Om,{agenda:i.data,matrix:r.data}),e===`matrix`&&(0,F.jsx)(Tm,{...c}),e===`list`&&(0,F.jsx)(Em,{...c}),e===`briefing`&&(0,F.jsx)(Dm,{...c})]})}var Am=`pal.control-room.layout`,jm=`-m-2 p-2`;function Mm(){try{let e=localStorage.getItem(Am);return hm(e)?e:`matrix`}catch{return`matrix`}}function Nm(e){try{localStorage.setItem(Am,e)}catch{}}function Pm(){let[e,t]=Ln(),n=e.get(`layout`),r=hm(n)?n:Mm();return(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,F.jsx)(If,{label:`layout`,options:mm,value:r,onPick:e=>{Nm(e),t({layout:e})}})}),(0,F.jsx)(Rf,{className:jm,children:(0,F.jsx)(km,{layout:r})})]})}function Fm(){let[e,t]=Ln(),n=e.get(`status`),r=Hp(n)?n:`ranked`;return(0,F.jsx)(Lf,{title:`Projects`,aside:(0,F.jsx)(If,{label:`status`,options:Vp,value:r,onPick:e=>t({status:e})}),children:(0,F.jsx)(qp,{filter:r})})}function Im(){let{slug:e}=ht();return(0,F.jsx)(Rf,{className:jm,children:(0,F.jsx)(Bp,{slug:e??``})})}function Lm(){let[e,t]=Ln(),n=Object.fromEntries(bp.map(t=>[t,e.get(t)??``]));return(0,F.jsx)(Lf,{title:`Action log`,aside:(0,F.jsx)(`span`,{className:`text-[12px] text-neutral-700`,children:`every tool call this install recorded`}),children:(0,F.jsx)(Ap,{filter:n,onFilter:e=>{let r={...n,...e};t(Object.fromEntries(Object.entries(r).filter(([,e])=>e)))}})})}function Rm(){return(0,F.jsx)(Lf,{title:`Settings`,children:(0,F.jsx)(Rf,{className:jm,children:(0,F.jsx)(im,{})})})}var zm=[{to:`/`,label:`Today`,end:!0},{to:`/projects`,label:`Projects`,end:!1},{to:`/log`,label:`Action log`,end:!1},{to:`/settings`,label:`Settings`,end:!1}];function Bm({status:e}){return(0,F.jsxs)(`header`,{className:`flex flex-wrap items-center gap-5 border-b border-divider bg-bg px-7 py-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-[120px] items-baseline gap-2`,children:[(0,F.jsx)(`span`,{className:`font-heading text-[22px] font-semibold tracking-wide`,children:`PAL`}),(0,F.jsx)(`span`,{className:`eyebrow`,children:`control`})]}),(0,F.jsx)(`nav`,{className:`-mb-[11px] flex gap-0.5`,children:zm.map(e=>(0,F.jsx)(Mn,{to:e.to,end:e.end,className:({isActive:e})=>$(`font-heading border-b-2 px-3 py-2 text-[15px] font-semibold whitespace-nowrap`,e?`border-accent text-ink`:`border-transparent text-neutral-600 hover:text-accent`),children:e.label},e.to))}),(0,F.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-[12px] text-neutral-700`,children:[(0,F.jsx)(`span`,{className:`inline-block size-1.5 bg-accent`}),(0,F.jsx)(`b`,{className:`font-medium text-ink`,children:e?.machine??`…`}),(0,F.jsxs)(`span`,{children:[`· `,e?`${e.ledgerFiles} ledger file(s)`:`…`,` · port`,` `,e?.port??`…`]}),(0,F.jsx)(tp,{})]})]})}function Vm(){let e=Hf(`/api/status`);return(0,F.jsx)(An,{children:(0,F.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden`,children:[(0,F.jsx)(Bm,{status:e.state===`ready`?e.data:null}),(0,F.jsx)(`main`,{className:`mx-auto flex w-full max-w-[1480px] min-h-0 flex-1 flex-col px-7 pt-6 pb-6`,children:(0,F.jsxs)(Bt,{children:[(0,F.jsx)(Rt,{path:`/`,element:(0,F.jsx)(Pm,{})}),(0,F.jsx)(Rt,{path:`/projects`,element:(0,F.jsx)(Fm,{})}),(0,F.jsx)(Rt,{path:`/projects/:slug`,element:(0,F.jsx)(Im,{})}),(0,F.jsx)(Rt,{path:`/log`,element:(0,F.jsx)(Lm,{})}),(0,F.jsx)(Rt,{path:`/settings`,element:(0,F.jsx)(Rm,{})}),(0,F.jsx)(Rt,{path:`*`,element:(0,F.jsx)(Lt,{to:`/`,replace:!0})})]})}),(0,F.jsxs)(`footer`,{className:`flex flex-wrap justify-between gap-4 border-t border-divider px-7 py-3 text-[11px] text-neutral-600`,children:[(0,F.jsx)(`span`,{children:`loopback only · every number from ~/.pal · no model runs on this page`}),(0,F.jsx)(`span`,{children:e.state===`ready`?`up since ${e.data.startedAt}`:``})]})]})})}var Hm=document.getElementById(`root`);Hm&&(0,Un.createRoot)(Hm).render((0,F.jsx)(O.StrictMode,{children:(0,F.jsx)(Vm,{})}));
@@ -10,7 +10,7 @@
10
10
  rel="stylesheet"
11
11
  href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600&family=Barlow+Condensed:wght@400;500;600&display=swap"
12
12
  />
13
- <script type="module" crossorigin src="/assets/index-ZQVmA4BJ.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-DyhnNmdi.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="/assets/index-Dncp2bYg.css">
15
15
  </head>
16
16
  <body>
@@ -149,7 +149,7 @@ function Updates({ initial }: { initial: AutoUpdateStatus }) {
149
149
  <Panel title="Updates">
150
150
  <div className="flex flex-col gap-4">
151
151
  <div className="flex items-center justify-between gap-3 text-[12.5px]">
152
- <span>update once a day, at session start</span>
152
+ <span>update once a day, when a session closes</span>
153
153
  <Switch
154
154
  aria-label="update once a day"
155
155
  checked={status.enabled}