0sec-cli 0.22.0 → 0.22.4

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.
Files changed (107) hide show
  1. package/0.js +56 -45
  2. package/README.md +12 -0
  3. package/chunks/{adapt-loop-7I57LXXR.js → adapt-loop-3CCOWE43.js} +4 -4
  4. package/chunks/{artifact-scraper-PYZ3RU3O.js → artifact-scraper-Z4UUIOH3.js} +2 -2
  5. package/chunks/{assumption-mining-MFLF43IR.js → assumption-mining-2UAKQB6V.js} +18 -14
  6. package/chunks/{chunk-RE5EZDG2.js → chunk-2WWAPKAW.js} +126 -1089
  7. package/chunks/{chunk-LPTRPRZR.js → chunk-3BPX75OR.js} +1 -1
  8. package/chunks/chunk-4ZYYX5GY.js +74 -0
  9. package/chunks/{chunk-RSIUX3RW.js → chunk-5JNTMWPK.js} +2 -2
  10. package/chunks/{chunk-RRD4XXPU.js → chunk-5WAJGLCW.js} +3 -3
  11. package/chunks/{chunk-76KSBWOQ.js → chunk-6KFB6AYN.js} +515 -20
  12. package/chunks/{chunk-HR2TU42B.js → chunk-6WQDXWQC.js} +169 -15
  13. package/chunks/chunk-6YZE552K.js +5603 -0
  14. package/chunks/chunk-BGX53365.js +309 -0
  15. package/chunks/{chunk-7DEHG7YT.js → chunk-C6JPA32H.js} +1 -1
  16. package/chunks/chunk-CF3MNS3O.js +990 -0
  17. package/chunks/{chunk-4VGLO2YS.js → chunk-CPCHLL6A.js} +5 -2
  18. package/chunks/{chunk-DM5C5L5D.js → chunk-DPUXXMJW.js} +1 -1
  19. package/chunks/{chunk-LYUAM3TG.js → chunk-E3OOBVOK.js} +30 -12
  20. package/chunks/{chunk-HUNAPTKV.js → chunk-E74LXQFY.js} +1 -1
  21. package/chunks/{chunk-UU7PQP6N.js → chunk-ELI3BVIK.js} +3 -3
  22. package/chunks/chunk-FFHRANYC.js +547 -0
  23. package/chunks/{chunk-IO7R7WBM.js → chunk-G2BE2FC7.js} +1 -1
  24. package/chunks/chunk-GQ3DGHWE.js +1659 -0
  25. package/chunks/{chunk-V36HVTUL.js → chunk-GVY3S5E5.js} +21 -18
  26. package/chunks/{chunk-UV5QWZGE.js → chunk-H4DH7COV.js} +192 -40
  27. package/chunks/{chunk-SJBCK2EI.js → chunk-H6Q2QAIY.js} +23475 -22747
  28. package/chunks/{chunk-VMRRNRMR.js → chunk-IHPTOTLL.js} +1 -1
  29. package/chunks/chunk-IXAHQICR.js +31 -0
  30. package/chunks/{chunk-TH2LW437.js → chunk-KCA35IL3.js} +2 -190
  31. package/chunks/{chunk-VNRY6AWF.js → chunk-L2CCO4KE.js} +282 -34
  32. package/chunks/{chunk-6YNKRUMC.js → chunk-NJLKFC66.js} +321 -5
  33. package/chunks/{chunk-W6UWZFKL.js → chunk-O6KPVYOI.js} +100 -5
  34. package/chunks/{chunk-EGZGZFAH.js → chunk-OAS5SAVZ.js} +6768 -2100
  35. package/chunks/chunk-PS5E7LUQ.js +277 -0
  36. package/chunks/{chunk-2GV4HQKE.js → chunk-QVIRWJ45.js} +257 -145
  37. package/chunks/{chunk-OWLJYJ5O.js → chunk-QWK4R3DB.js} +9 -9
  38. package/chunks/{chunk-XFCTUKXR.js → chunk-RCRTSKQN.js} +1 -1
  39. package/chunks/chunk-RS4MAN3Q.js +73 -0
  40. package/chunks/{chunk-7UFUALR2.js → chunk-RTBZ36BD.js} +8 -274
  41. package/chunks/{chunk-TZFIAMWZ.js → chunk-SCWWLABR.js} +1 -1
  42. package/chunks/chunk-VDOWARMJ.js +63 -0
  43. package/chunks/{chunk-5MWAG3FT.js → chunk-WBRGXCU2.js} +79 -18
  44. package/chunks/{chunk-LCRTAQN2.js → chunk-WHUAUFSX.js} +1 -1
  45. package/chunks/{chunk-YIQSGNAA.js → chunk-XODDLNBI.js} +1535 -1306
  46. package/chunks/chunk-YAZARMJY.js +355 -0
  47. package/chunks/{chunk-OAYUPGF6.js → chunk-YED25PA4.js} +1 -1
  48. package/chunks/{codex-models-7TLJSY3L.js → codex-models-Z43V3427.js} +9 -3
  49. package/chunks/{commands-NEI7L3QA.js → commands-EUGF4FUZ.js} +5844 -4095
  50. package/chunks/{db-5AP3JB4W.js → db-NVAW4WWR.js} +3 -3
  51. package/chunks/{dist-3FNZIBB4.js → dist-27BNG6WD.js} +195 -112
  52. package/chunks/{dist-5YHYNLI3.js → dist-7RUOKPRJ.js} +12 -2
  53. package/chunks/{dist-KEULE5IQ.js → dist-LNXGATR2.js} +2 -2
  54. package/chunks/{dist-XZB53PS5.js → dist-M2X367VW.js} +2 -2
  55. package/chunks/{dist-DD4H6HMQ.js → dist-NG2HT5XU.js} +27 -1
  56. package/chunks/{eval-runner-43BO2C4T.js → eval-runner-6Q3H52SP.js} +13 -9
  57. package/chunks/{exploit-agent-N4A5ELBK.js → exploit-agent-FCCR2HYX.js} +1 -1
  58. package/chunks/{exploit-autoclimb-N7P6KIF5.js → exploit-autoclimb-X5ZS5FAO.js} +1 -1
  59. package/chunks/{exploit-climb-WNEJUB5W.js → exploit-climb-3JHGEO36.js} +2 -2
  60. package/chunks/{fix-Z452M4EC.js → fix-NSNPU33B.js} +12 -6
  61. package/chunks/{harness-QJJJVSG4.js → harness-KXQOVIDQ.js} +3 -3
  62. package/chunks/{hunt-scan-K6D2V3PX.js → hunt-scan-ELTKGKC4.js} +16 -12
  63. package/chunks/{kernel-primitive-TKUACPKD.js → kernel-primitive-MT7YZSIG.js} +2 -2
  64. package/chunks/{kernel-vm-runner-RAAO2PGT.js → kernel-vm-runner-YFRHYC6G.js} +2 -2
  65. package/chunks/{native-loop-2ZRJENZ3.js → native-loop-OFJDRHPI.js} +18 -8
  66. package/chunks/orchestrate-DRZ2SVCP.js +62 -0
  67. package/chunks/{prepare-KYHGFWCJ.js → prepare-72GWTRVI.js} +6 -2
  68. package/chunks/{process-N245QIQG.js → process-MJYJ2K5E.js} +2 -1
  69. package/chunks/{run-U3XU4CTC.js → run-WTJCZZHV.js} +3091 -6037
  70. package/chunks/{runtime-G75TEWQY.js → runtime-FCKOUB7V.js} +10 -4
  71. package/chunks/{runtime-XFWJTBUO.js → runtime-LCJ4XSKE.js} +5 -1
  72. package/chunks/{scan-stream-BMOCPKQX.js → scan-stream-GT6GKQ3U.js} +7 -1
  73. package/chunks/{scope-WXI46UHJ.js → scope-E5QZUOOH.js} +2 -2
  74. package/chunks/service-plugins-MSK2EQP6.js +62 -0
  75. package/chunks/{session-store-27L3ZU73.js → session-store-H3Q7KCYG.js} +6 -4
  76. package/chunks/{variant-candidates-YWZORZMK.js → variant-candidates-SZKDCOLK.js} +9 -3
  77. package/chunks/{web-recon-prepass-YVMFXCIK.js → web-recon-prepass-IO3GXQMW.js} +11 -6
  78. package/dashboard/apple-touch-icon.png +0 -0
  79. package/dashboard/assets/operations-BvB5Qpmk.css +1 -0
  80. package/dashboard/assets/operations-D8Ii01SV.js +114 -0
  81. package/dashboard/assets/zero-peek-Dzm3MT3X.png +0 -0
  82. package/dashboard/favicon.ico +0 -0
  83. package/dashboard/favicon.svg +10 -0
  84. package/dashboard/index.html +5 -3
  85. package/package.json +1 -1
  86. package/chunks/chunk-6GHSR47F.js +0 -147
  87. package/chunks/chunk-CAYANSH6.js +0 -3524
  88. package/chunks/chunk-GHWODZMR.js +0 -16
  89. package/chunks/chunk-MICHDTBK.js +0 -193
  90. package/chunks/orchestrate-2GWGNTBF.js +0 -58
  91. package/dashboard/assets/bot-Bg1Tp9_d.js +0 -1
  92. package/dashboard/assets/dist-B_dDCPbu.js +0 -1
  93. package/dashboard/assets/findings-page-mayGhNx6.js +0 -5
  94. package/dashboard/assets/format--susmHX7.js +0 -1
  95. package/dashboard/assets/input-TuVPR3Zl.js +0 -1
  96. package/dashboard/assets/jsx-runtime-MGseXjj5.js +0 -3
  97. package/dashboard/assets/live-page-HWWHX99U.js +0 -1
  98. package/dashboard/assets/meta-tile-ckHo-w7k.js +0 -1
  99. package/dashboard/assets/operations-BxZ0OoXO.js +0 -10
  100. package/dashboard/assets/operations-CMFVrXEe.css +0 -2
  101. package/dashboard/assets/operations-app-D3d35rgo.js +0 -46
  102. package/dashboard/assets/overview-page-W_4IteEr.js +0 -1
  103. package/dashboard/assets/page-header-Bw9AJgBV.js +0 -1
  104. package/dashboard/assets/scans-page-CgzVXHnn.js +0 -1
  105. package/dashboard/assets/siren-KQj8QAnJ.js +0 -1
  106. package/dashboard/assets/table-8EDklulN.js +0 -1
  107. package/dashboard/assets/tabs-CFHPOwg8.js +0 -1
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __0CreateRequire } from "node:module";
3
- const require = __0CreateRequire(import.meta.url);
4
-
5
- // packages/cli/src/tui/runtime.ts
6
- function isBunRuntime() {
7
- return typeof globalThis === "object" && globalThis !== null && "Bun" in globalThis;
8
- }
9
- function canUseOpenTui() {
10
- return !!(process.stdout.isTTY && process.stdin.isTTY);
11
- }
12
-
13
- export {
14
- isBunRuntime,
15
- canUseOpenTui
16
- };
@@ -1,193 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __0CreateRequire } from "node:module";
3
- const require = __0CreateRequire(import.meta.url);
4
- import {
5
- homeStateDir
6
- } from "./chunk-76KSBWOQ.js";
7
-
8
- // packages/cli/src/tui/session-store.ts
9
- import { chmodSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
10
- import { join } from "node:path";
11
- var SESSIONS_DIRNAME = "console-sessions";
12
- var FILE_MODE = 384;
13
- var DIR_MODE = 448;
14
- var DEFAULT_PRUNE_KEEP = 20;
15
- var PREVIEW_MAX_LENGTH = 120;
16
- var SUMMARY_MAX_LENGTH = 120;
17
- var SESSION_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
18
- var FILE_SUFFIX = ".json";
19
- function sessionsDir(homeDir) {
20
- return join(homeStateDir(homeDir), SESSIONS_DIRNAME);
21
- }
22
- function isValidSessionId(id) {
23
- return typeof id === "string" && SESSION_ID_PATTERN.test(id);
24
- }
25
- function sessionFilePath(id, homeDir) {
26
- if (!isValidSessionId(id)) return null;
27
- return join(sessionsDir(homeDir), `${id}${FILE_SUFFIX}`);
28
- }
29
- function rawValue(raw, key) {
30
- if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return void 0;
31
- return raw[key];
32
- }
33
- function optionalString(raw, key) {
34
- const value = rawValue(raw, key);
35
- return typeof value === "string" && value.length > 0 ? value : void 0;
36
- }
37
- var CONTROL_CHARS = /[\u0000-\u001F\u007F-\u009F]+/g;
38
- function sanitizeLine(value, maxLength) {
39
- if (typeof value !== "string") return "";
40
- const flattened = value.replace(CONTROL_CHARS, " ").replace(/\s+/g, " ").trim();
41
- return flattened.length > maxLength ? `${flattened.slice(0, maxLength - 1)}\u2026` : flattened;
42
- }
43
- function sanitizePreview(value) {
44
- return sanitizeLine(value, PREVIEW_MAX_LENGTH);
45
- }
46
- function sanitizeSummary(value) {
47
- const flattened = sanitizeLine(value, SUMMARY_MAX_LENGTH);
48
- return flattened.length > 0 ? flattened : void 0;
49
- }
50
- function toMeta(id, raw, messageCount) {
51
- const savedAt = rawValue(raw, "savedAt");
52
- const cwd = rawValue(raw, "cwd");
53
- const target = optionalString(raw, "target");
54
- const model = optionalString(raw, "model");
55
- const mode = optionalString(raw, "mode");
56
- const summary = sanitizeSummary(rawValue(raw, "summary"));
57
- return {
58
- id,
59
- savedAt: typeof savedAt === "number" && Number.isFinite(savedAt) ? savedAt : 0,
60
- ...target !== void 0 ? { target } : {},
61
- ...model !== void 0 ? { model } : {},
62
- ...mode !== void 0 ? { mode } : {},
63
- cwd: typeof cwd === "string" ? cwd : "",
64
- messageCount,
65
- preview: sanitizePreview(rawValue(raw, "preview")),
66
- ...summary !== void 0 ? { summary } : {}
67
- };
68
- }
69
- function parseSession(id, text) {
70
- let raw;
71
- try {
72
- raw = JSON.parse(text);
73
- } catch {
74
- return null;
75
- }
76
- const messages = rawValue(raw, "messages");
77
- if (!Array.isArray(messages)) return null;
78
- return { ...toMeta(id, raw, messages.length), messages };
79
- }
80
- function saveSession(session, homeDir) {
81
- try {
82
- if (!Array.isArray(session?.messages)) return false;
83
- const path = sessionFilePath(session.id, homeDir);
84
- if (path === null) return false;
85
- const dir = sessionsDir(homeDir);
86
- mkdirSync(dir, { recursive: true, mode: DIR_MODE });
87
- chmodSync(dir, DIR_MODE);
88
- const payload = {
89
- ...toMeta(session.id, session, session.messages.length),
90
- messages: session.messages
91
- };
92
- writeFileSync(path, `${JSON.stringify(payload)}
93
- `, { encoding: "utf8", mode: FILE_MODE });
94
- chmodSync(path, FILE_MODE);
95
- return true;
96
- } catch {
97
- return false;
98
- }
99
- }
100
- function listSessions(homeDir, opts) {
101
- const dir = sessionsDir(homeDir);
102
- let entries;
103
- try {
104
- entries = readdirSync(dir);
105
- } catch {
106
- return [];
107
- }
108
- const out = [];
109
- for (const entry of entries) {
110
- if (!entry.endsWith(FILE_SUFFIX)) continue;
111
- const id = entry.slice(0, -FILE_SUFFIX.length);
112
- if (!isValidSessionId(id)) continue;
113
- let text;
114
- try {
115
- text = readFileSync(join(dir, entry), "utf8");
116
- } catch {
117
- continue;
118
- }
119
- const parsed = parseSession(id, text);
120
- if (parsed === null) continue;
121
- if (opts?.cwd !== void 0 && parsed.cwd !== opts.cwd) continue;
122
- const { messages: _messages, ...meta } = parsed;
123
- out.push(meta);
124
- }
125
- out.sort((a, b) => b.savedAt - a.savedAt || a.id.localeCompare(b.id));
126
- const limit = opts?.limit;
127
- if (typeof limit === "number" && Number.isFinite(limit)) {
128
- return out.slice(0, Math.max(0, Math.floor(limit)));
129
- }
130
- return out;
131
- }
132
- var SECONDS_PER_MINUTE = 60;
133
- var MINUTES_PER_HOUR = 60;
134
- var HOURS_PER_DAY = 24;
135
- var DAYS_PER_WEEK = 7;
136
- var FUTURE_SKEW_MS = 6e4;
137
- function relativeAge(savedAt, now) {
138
- if (!Number.isFinite(savedAt) || savedAt <= 0) return "";
139
- if (savedAt > now + FUTURE_SKEW_MS) return "";
140
- const seconds = Math.max(0, Math.floor((now - savedAt) / 1e3));
141
- if (seconds < SECONDS_PER_MINUTE) return `${seconds}s`;
142
- const minutes = Math.floor(seconds / SECONDS_PER_MINUTE);
143
- if (minutes < MINUTES_PER_HOUR) return `${minutes}m`;
144
- const hours = Math.floor(minutes / MINUTES_PER_HOUR);
145
- if (hours < HOURS_PER_DAY) return `${hours}h`;
146
- const days = Math.floor(hours / HOURS_PER_DAY);
147
- if (days < DAYS_PER_WEEK) return `${days}d`;
148
- return `${Math.floor(days / DAYS_PER_WEEK)}w`;
149
- }
150
- function loadSession(id, homeDir) {
151
- const path = sessionFilePath(id, homeDir);
152
- if (path === null) return null;
153
- try {
154
- return parseSession(id, readFileSync(path, "utf8"));
155
- } catch {
156
- return null;
157
- }
158
- }
159
- function deleteSession(id, homeDir, opts) {
160
- if (opts?.protectedIds?.has(id)) return false;
161
- const path = sessionFilePath(id, homeDir);
162
- if (path === null) return false;
163
- try {
164
- rmSync(path, { force: false });
165
- return true;
166
- } catch {
167
- return false;
168
- }
169
- }
170
- function pruneSessions(homeDir, opts) {
171
- const requested = opts?.keep;
172
- const keep = typeof requested === "number" && Number.isFinite(requested) ? Math.max(0, Math.floor(requested)) : DEFAULT_PRUNE_KEEP;
173
- let removed = 0;
174
- let archived = 0;
175
- for (const meta of listSessions(homeDir)) {
176
- if (opts?.protectedIds?.has(meta.id)) continue;
177
- if (archived++ < keep) continue;
178
- if (deleteSession(meta.id, homeDir, opts)) removed += 1;
179
- }
180
- return removed;
181
- }
182
-
183
- export {
184
- DEFAULT_PRUNE_KEEP,
185
- sessionsDir,
186
- isValidSessionId,
187
- saveSession,
188
- listSessions,
189
- relativeAge,
190
- loadSession,
191
- deleteSession,
192
- pruneSessions
193
- };
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __0CreateRequire } from "node:module";
3
- const require = __0CreateRequire(import.meta.url);
4
- import {
5
- recoverStaleWorkers,
6
- registerOrchestrateCommand
7
- } from "./chunk-OWLJYJ5O.js";
8
- import "./chunk-EGZGZFAH.js";
9
- import "./chunk-LYUAM3TG.js";
10
- import "./chunk-HLFS6WV2.js";
11
- import "./chunk-QCUFBVIZ.js";
12
- import "./chunk-RSIUX3RW.js";
13
- import "./chunk-TM74SSHC.js";
14
- import "./chunk-2WNCI664.js";
15
- import "./chunk-23DG5YKS.js";
16
- import "./chunk-DQTNI3KY.js";
17
- import "./chunk-VMRRNRMR.js";
18
- import "./chunk-DM5C5L5D.js";
19
- import "./chunk-RRD4XXPU.js";
20
- import "./chunk-HUNAPTKV.js";
21
- import "./chunk-AZ7L3HFD.js";
22
- import "./chunk-UU7PQP6N.js";
23
- import "./chunk-UV5QWZGE.js";
24
- import "./chunk-SJBCK2EI.js";
25
- import "./chunk-K2PWUPUI.js";
26
- import "./chunk-TZFIAMWZ.js";
27
- import "./chunk-2OQOQ2FZ.js";
28
- import "./chunk-UEX7PFSE.js";
29
- import "./chunk-OAYUPGF6.js";
30
- import "./chunk-XFCTUKXR.js";
31
- import "./chunk-HR2TU42B.js";
32
- import "./chunk-RE5EZDG2.js";
33
- import "./chunk-SQCBHFWN.js";
34
- import "./chunk-GVD6SJGH.js";
35
- import "./chunk-5MWAG3FT.js";
36
- import "./chunk-W6UWZFKL.js";
37
- import "./chunk-FHC2B7LN.js";
38
- import "./chunk-DKSCN2AB.js";
39
- import "./chunk-UFHN6RIU.js";
40
- import "./chunk-VNRY6AWF.js";
41
- import "./chunk-TO35Y326.js";
42
- import "./chunk-IXT64DV5.js";
43
- import "./chunk-UELXHK2Y.js";
44
- import "./chunk-LPTRPRZR.js";
45
- import "./chunk-V36HVTUL.js";
46
- import "./chunk-4VGLO2YS.js";
47
- import "./chunk-6YNKRUMC.js";
48
- import "./chunk-7DEHG7YT.js";
49
- import "./chunk-5IBCBQEH.js";
50
- import "./chunk-IO7R7WBM.js";
51
- import "./chunk-2GV4HQKE.js";
52
- import "./chunk-76KSBWOQ.js";
53
- import "./chunk-VIT5ALXF.js";
54
- import "./chunk-VCSFCHAJ.js";
55
- export {
56
- recoverStaleWorkers,
57
- registerOrchestrateCommand
58
- };
@@ -1 +0,0 @@
1
- import{_ as e}from"./input-TuVPR3Zl.js";var t=e(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]);export{t};
@@ -1 +0,0 @@
1
- import{f as e,m as t}from"./jsx-runtime-MGseXjj5.js";import{l as n}from"./format--susmHX7.js";import{i as r,l as i,m as a,n as o,p as s,s as c,t as l,v as u}from"./operations-BxZ0OoXO.js";var d=class extends u{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),s(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&c(t.mutationKey)!==c(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??o();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){r.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},f=t(e(),1);function p(e,t){let n=l(t),[o]=f.useState(()=>new d(n,e));f.useEffect(()=>{o.setOptions(e)},[o,e]);let s=f.useSyncExternalStore(f.useCallback(e=>o.subscribe(r.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),c=f.useCallback((e,t)=>{o.mutate(e,t).catch(i)},[o]);if(s.error&&a(o.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}var m=f.useId||(()=>void 0),h=0;function g(e){let[t,r]=f.useState(m());return n(()=>{e||r(e=>e??String(h++))},[e]),e||(t?`radix-${t}`:``)}var _=f.useInsertionEffect||n;function v({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=y({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=f.useRef(e!==void 0);f.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,f.useCallback(t=>{if(s){let n=b(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function y({defaultProp:e,onChange:t}){let[n,r]=f.useState(e),i=f.useRef(n),a=f.useRef(t);return _(()=>{a.current=t},[t]),f.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function b(e){return typeof e==`function`}export{g as n,p as r,v as t};
@@ -1,5 +0,0 @@
1
- import{c as e,f as t,l as n,m as r,t as i}from"./jsx-runtime-MGseXjj5.js";import{D as a,E as o,O as s,h as c,n as l}from"./format--susmHX7.js";import{r as u}from"./dist-B_dDCPbu.js";import{t as d,y as f}from"./operations-BxZ0OoXO.js";import{_ as p,c as m,d as h,f as g,h as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T}from"./input-TuVPR3Zl.js";import{t as E}from"./bot-Bg1Tp9_d.js";import{a as D,i as ee,n as O,r as te,t as ne}from"./tabs-CFHPOwg8.js";import{n as k,r as re,t as A}from"./meta-tile-ckHo-w7k.js";import{a as ie,c as j,d as M,f as N,i as P,l as F,n as ae,o as I,p as L,r as R,s as oe,t as z,u as B}from"./table-8EDklulN.js";import{t as se}from"./page-header-Bw9AJgBV.js";import{a as ce,c as V,f as H,i as le,l as ue,n as de,o as fe,p as U,r as pe,s as W,t as me,u as he}from"./operations-app-D3d35rgo.js";var ge=p(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),_e=p(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),ve=p(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ye=p(`shield-question-mark`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),be=p(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),xe=p(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),G=p(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),K=r(t()),q=i();function Se({request:e,response:t,analysis:n}){return(0,q.jsxs)(ne,{defaultValue:`request`,className:`space-y-4`,children:[(0,q.jsx)(te,{children:[[`request`,`Evidence request`],[`response`,`Evidence response`],[`analysis`,`Analysis`]].map(([e,t])=>(0,q.jsx)(ee,{value:e,children:t},e))}),(0,q.jsx)(O,{value:`request`,children:(0,q.jsx)(b,{children:(0,q.jsx)(C,{className:`p-4`,children:(0,q.jsx)(`pre`,{className:`text-sm leading-6 text-muted-foreground`,children:e})})})}),(0,q.jsx)(O,{value:`response`,children:(0,q.jsx)(b,{children:(0,q.jsx)(C,{className:`p-4`,children:(0,q.jsx)(`pre`,{className:`text-sm leading-6 text-muted-foreground`,children:t})})})}),(0,q.jsx)(O,{value:`analysis`,children:(0,q.jsx)(b,{children:(0,q.jsx)(C,{className:`p-4`,children:(0,q.jsx)(`pre`,{className:`text-sm leading-6 text-muted-foreground`,children:n??`No evidence analysis recorded.`})})})})]})}var Ce=r(f());function J(){var e=[...arguments];return(0,K.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var we=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Te(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ee(e){return`nodeType`in e}function Y(e){return e?Te(e)?e:Ee(e)?e.ownerDocument?.defaultView??window:window:window}function De(e){let{Document:t}=Y(e);return e instanceof t}function Oe(e){return!Te(e)&&e instanceof Y(e).HTMLElement}function ke(e){return e instanceof Y(e).SVGElement}function Ae(e){return e?Te(e)?e.document:Ee(e)?De(e)?e:Oe(e)||ke(e)?e.ownerDocument:document:document:document}var je=we?K.useLayoutEffect:K.useEffect;function Me(e){let t=(0,K.useRef)(e);return je(()=>{t.current=e}),(0,K.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ne(){let e=(0,K.useRef)(null);return[(0,K.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,K.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function Pe(e,t){t===void 0&&(t=[e]);let n=(0,K.useRef)(e);return je(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){let n=(0,K.useRef)();return(0,K.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Ie(e){let t=Me(e),n=(0,K.useRef)(null);return[n,(0,K.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Le(e){let t=(0,K.useRef)();return(0,K.useEffect)(()=>{t.current=e},[e]),t.current}var Re={};function ze(e,t){return(0,K.useMemo)(()=>{if(t)return t;let n=Re[e]==null?0:Re[e]+1;return Re[e]=n,e+`-`+n},[e,t])}function Be(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Ve=Be(1),He=Be(-1);function Ue(e){return`clientX`in e&&`clientY`in e}function We(e){if(!e)return!1;let{KeyboardEvent:t}=Y(e.target);return t&&e instanceof t}function Ge(e){if(!e)return!1;let{TouchEvent:t}=Y(e.target);return t&&e instanceof t}function Ke(e){if(Ge(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Ue(e)?{x:e.clientX,y:e.clientY}:null}var qe=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[qe.Translate.toString(e),qe.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),Je=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ye(e){return e.matches(Je)?e:e.querySelector(Je)}var Xe={display:`none`};function Ze(e){let{id:t,value:n}=e;return K.createElement(`div`,{id:t,style:Xe},n)}function Qe(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return K.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function $e(){let[e,t]=(0,K.useState)(``);return{announce:(0,K.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var et=(0,K.createContext)(null);function tt(e){let t=(0,K.useContext)(et);(0,K.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function nt(){let[e]=(0,K.useState)(()=>new Set),t=(0,K.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,K.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var rt={draggable:`
2
- To pick up a draggable item, press the space bar.
3
- While dragging, use the arrow keys to move the item.
4
- Press space again to drop the item in its new position, or press escape to cancel.
5
- `},it={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function at(e){let{announcements:t=it,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=rt}=e,{announce:a,announcement:o}=$e(),s=ze(`DndLiveRegion`),[c,l]=(0,K.useState)(!1);if((0,K.useEffect)(()=>{l(!0)},[]),tt((0,K.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=K.createElement(K.Fragment,null,K.createElement(Ze,{id:r,value:i.draggable}),K.createElement(Qe,{id:s,announcement:o}));return n?(0,Ce.createPortal)(u,n):u}var X;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(X||={});function ot(){}function st(e,t){return(0,K.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function ct(){var e=[...arguments];return(0,K.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var Z=Object.freeze({x:0,y:0});function lt(e,t){let n=Ke(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function ut(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function dt(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function ft(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var pt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=ft(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(ut)};function mt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ht(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Z}function gt(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var _t=gt(1);function vt(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function yt(e,t,n){let r=vt(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var bt={ignoreTransform:!1};function xt(e,t){t===void 0&&(t=bt);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=Y(e).getComputedStyle(e);t&&(n=yt(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function St(e){return xt(e,{ignoreTransform:!0})}function Ct(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function wt(e,t){return t===void 0&&(t=Y(e).getComputedStyle(e)),t.position===`fixed`}function Tt(e,t){t===void 0&&(t=Y(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function Et(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(De(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Oe(i)||ke(i)||n.includes(i))return n;let a=Y(e).getComputedStyle(i);return i!==e&&Tt(i,a)&&n.push(i),wt(i,a)?n:r(i.parentNode)}return e?r(e):n}function Dt(e){let[t]=Et(e,1);return t??null}function Ot(e){return!we||!e?null:Te(e)?e:Ee(e)?De(e)||e===Ae(e).scrollingElement?window:Oe(e)?e:null:null}function kt(e){return Te(e)?e.scrollX:e.scrollLeft}function At(e){return Te(e)?e.scrollY:e.scrollTop}function jt(e){return{x:kt(e),y:At(e)}}var Q;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Q||={});function Mt(e){return!we||!e?!1:e===document.scrollingElement}function Nt(e){let t={x:0,y:0},n=Mt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Pt={x:.2,y:.2};function Ft(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Pt);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Nt(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=Q.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=Q.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=Q.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=Q.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function It(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Lt(e){return e.reduce((e,t)=>Ve(e,jt(t)),Z)}function Rt(e){return e.reduce((e,t)=>e+kt(t),0)}function zt(e){return e.reduce((e,t)=>e+At(t),0)}function Bt(e,t){if(t===void 0&&(t=xt),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);Dt(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Vt=[[`x`,[`left`,`right`],Rt],[`y`,[`top`,`bottom`],zt]],Ht=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=Et(t),r=Lt(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Vt)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Ut=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Wt(e){let{EventTarget:t}=Y(e);return e instanceof t?e:Ae(e)}function Gt(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var Kt;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Kt||={});function qt(e){e.preventDefault()}function Jt(e){e.stopPropagation()}var $;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})($||={});var Yt={start:[$.Space,$.Enter],cancel:[$.Esc],end:[$.Space,$.Enter,$.Tab]},Xt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case $.Right:return{...n,x:n.x+25};case $.Left:return{...n,x:n.x-25};case $.Down:return{...n,y:n.y+25};case $.Up:return{...n,y:n.y-25}}},Zt=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Ut(Ae(t)),this.windowListeners=new Ut(Y(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Kt.Resize,this.handleCancel),this.windowListeners.add(Kt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Kt.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Bt(n),t(Z)}handleKeyDown(e){if(We(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Yt,coordinateGetter:a=Xt,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Z;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=He(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Nt(n),p=It(n),m={x:Math.min(i===$.Right?p.right-p.width/2:p.right,Math.max(i===$.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===$.Down?p.bottom-p.height/2:p.bottom,Math.max(i===$.Down?p.top:p.top+p.height/2,u.y))},h=i===$.Right&&!s||i===$.Left&&!c,g=i===$.Down&&!l||i===$.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===$.Right&&e<=d.x||i===$.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===$.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===$.Down&&e<=d.y||i===$.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===$.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Ve(He(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Zt.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Yt,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Qt(e){return!!(e&&`distance`in e)}function $t(e){return!!(e&&`delay`in e)}var en=class{constructor(e,t,n){n===void 0&&(n=Wt(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=Ae(i),this.documentListeners=new Ut(this.document),this.listeners=new Ut(n),this.windowListeners=new Ut(Y(i)),this.initialCoordinates=Ke(r)??Z,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Kt.Resize,this.handleCancel),this.windowListeners.add(Kt.DragStart,qt),this.windowListeners.add(Kt.VisibilityChange,this.handleCancel),this.windowListeners.add(Kt.ContextMenu,qt),this.documentListeners.add(Kt.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($t(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Qt(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Kt.Click,Jt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Kt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Ke(e)??Z,s=He(n,o);if(!t&&a){if(Qt(a)){if(a.tolerance!=null&&Gt(s,a.tolerance))return this.handleCancel();if(Gt(s,a.distance))return this.handleStart()}if($t(a)&&Gt(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===$.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},tn={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},nn=class extends en{constructor(e){let{event:t}=e,n=Ae(t.target);super(e,tn,n)}};nn.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var rn={move:{name:`mousemove`},end:{name:`mouseup`}},an;(function(e){e[e.RightClick=2]=`RightClick`})(an||={});var on=class extends en{constructor(e){super(e,rn,Ae(e.event.target))}};on.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==an.RightClick&&(r?.({event:n}),!0)}}];var sn={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},cn=class extends en{constructor(e){super(e,sn)}static setup(){return window.addEventListener(sn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(sn.move.name,e)};function e(){}}};cn.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var ln;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(ln||={});var un;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(un||={});function dn(e){let{acceleration:t,activator:n=ln.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=un.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=pn({delta:d,disabled:!a}),[m,h]=Ne(),g=(0,K.useRef)({x:0,y:0}),_=(0,K.useRef)({x:0,y:0}),v=(0,K.useMemo)(()=>{switch(n){case ln.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ln.DraggableRect:return i}},[n,i,c]),y=(0,K.useRef)(null),b=(0,K.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,K.useMemo)(()=>s===un.TreeOrder?[...l].reverse():l,[s,l]);(0,K.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=Ft(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var fn={x:{[Q.Backward]:!1,[Q.Forward]:!1},y:{[Q.Backward]:!1,[Q.Forward]:!1}};function pn(e){let{delta:t,disabled:n}=e,r=Le(t);return Fe(e=>{if(n||!r||!e)return fn;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Q.Backward]:e.x[Q.Backward]||i.x===-1,[Q.Forward]:e.x[Q.Forward]||i.x===1},y:{[Q.Backward]:e.y[Q.Backward]||i.y===-1,[Q.Forward]:e.y[Q.Forward]||i.y===1}}},[n,t,r])}function mn(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return Fe(e=>t==null?null:r??e??null,[r,t])}function hn(e,t){return(0,K.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var gn;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(gn||={});var _n;(function(e){e.Optimized=`optimized`})(_n||={});var vn=new Map;function yn(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,K.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,K.useRef)(e),d=g(),f=Pe(d),p=(0,K.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,K.useRef)(null),h=Fe(t=>{if(d&&!n)return vn;if(!t||t===vn||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Ht(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,K.useEffect)(()=>{u.current=e},[e]),(0,K.useEffect)(()=>{d||p()},[n,d]),(0,K.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,K.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case gn.Always:return!1;case gn.BeforeDragging:return n;default:return!n}}}function bn(e,t){return Fe(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function xn(e,t){return bn(e,t)}function Sn(e){let{callback:t,disabled:n}=e,r=Me(t),i=(0,K.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,K.useEffect)(()=>()=>i?.disconnect(),[i]),i}function Cn(e){let{callback:t,disabled:n}=e,r=Me(t),i=(0,K.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,K.useEffect)(()=>()=>i?.disconnect(),[i]),i}function wn(e){return new Ht(xt(e),e)}function Tn(e,t,n){t===void 0&&(t=wn);let[r,i]=(0,K.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=Sn({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=Cn({callback:a});return je(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function En(e){return ht(e,bn(e))}var Dn=[];function On(e){let t=(0,K.useRef)(e),n=Fe(n=>e?n&&n!==Dn&&e&&t.current&&e.parentNode===t.current.parentNode?n:Et(e):Dn,[e]);return(0,K.useEffect)(()=>{t.current=e},[e]),n}function kn(e){let[t,n]=(0,K.useState)(null),r=(0,K.useRef)(e),i=(0,K.useCallback)(e=>{let t=Ot(e.target);t&&n(e=>e?(e.set(t,jt(t)),new Map(e)):null)},[]);return(0,K.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=Ot(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,jt(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{Ot(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,K.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Ve(e,t),Z):Lt(e):Z,[e,t])}function An(e,t){t===void 0&&(t=[]);let n=(0,K.useRef)(null);return(0,K.useEffect)(()=>{n.current=null},t),(0,K.useEffect)(()=>{let t=e!==Z;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?He(e,n.current):Z}function jn(e){(0,K.useEffect)(()=>{if(!we)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function Mn(e,t){return(0,K.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function Nn(e){return(0,K.useMemo)(()=>e?Ct(e):null,[e])}var Pn=[];function Fn(e,t){t===void 0&&(t=xt);let[n]=e,r=Nn(n?Y(n):null),[i,a]=(0,K.useState)(Pn);function o(){a(()=>e.length?e.map(e=>Mt(e)?r:new Ht(t(e),e)):Pn)}let s=Cn({callback:o});return je(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function In(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return Oe(t)?t:e}function Ln(e){let{measure:t}=e,[n,r]=(0,K.useState)(null),i=Cn({callback:(0,K.useCallback)(e=>{for(let{target:n}of e)if(Oe(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=Ie((0,K.useCallback)(e=>{let n=In(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,K.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var Rn=[{sensor:nn,options:{}},{sensor:Zt,options:{}}],zn={current:{}},Bn={draggable:{measure:St},droppable:{measure:St,strategy:gn.WhileDragging,frequency:_n.Optimized},dragOverlay:{measure:xt}},Vn=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Hn={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Vn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ot},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Bn,measureDroppableContainers:ot,windowRect:null,measuringScheduled:!1},Un={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:ot,draggableNodes:new Map,over:null,measureDroppableContainers:ot},Wn=(0,K.createContext)(Un),Gn=(0,K.createContext)(Hn);function Kn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Vn}}}function qn(e,t){switch(t.type){case X.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case X.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case X.DragEnd:case X.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case X.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Vn(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case X.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Vn(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case X.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Vn(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Jn(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,K.useContext)(Wn),a=Le(r),o=Le(n?.id);return(0,K.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!We(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Ye(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Yn(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Xn(e){return(0,K.useMemo)(()=>({draggable:{...Bn.draggable,...e?.draggable},droppable:{...Bn.droppable,...e?.droppable},dragOverlay:{...Bn.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Zn(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,K.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;je(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=ht(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=Dt(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Qn=(0,K.createContext)({...Z,scaleX:1,scaleY:1}),$n;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})($n||={});var er=(0,K.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=Rn,collisionDetection:o=pt,measuring:s,modifiers:c,...l}=e,[u,d]=(0,K.useReducer)(qn,void 0,Kn),[f,p]=nt(),[m,h]=(0,K.useState)($n.Uninitialized),g=m===$n.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,K.useRef)({initial:null,translated:null}),C=(0,K.useMemo)(()=>_==null?null:{id:_,data:x?.data??zn,rect:S},[_,x]),w=(0,K.useRef)(null),[T,E]=(0,K.useState)(null),[D,ee]=(0,K.useState)(null),O=Pe(l,Object.values(l)),te=ze(`DndDescribedBy`,t),ne=(0,K.useMemo)(()=>b.getEnabled(),[b]),k=Xn(s),{droppableRects:re,measureDroppableContainers:A,measuringScheduled:ie}=yn(ne,{dragging:g,dependencies:[y.x,y.y],config:k.droppable}),j=mn(v,_),M=(0,K.useMemo)(()=>D?Ke(D):null,[D]),N=Se(),P=xn(j,k.draggable.measure);Zn({activeNode:_==null?null:v.get(_),config:N.layoutShiftCompensation,initialRect:P,measure:k.draggable.measure});let F=Tn(j,k.draggable.measure,P),ae=Tn(j?j.parentElement:null),I=(0,K.useRef)({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),L=b.getNodeFor(I.current.over?.id),R=Ln({measure:k.dragOverlay.measure}),oe=R.nodeRef.current??j,z=g?R.rect??F:null,B=!!(R.nodeRef.current&&R.rect),se=En(B?null:F),ce=Nn(oe?Y(oe):null),V=On(g?L??j:null),H=Fn(V),le=Yn(c,{transform:{x:y.x-se.x,y:y.y-se.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:F,containerNodeRect:ae,draggingNodeRect:z,over:I.current.over,overlayNodeRect:R.rect,scrollableAncestors:V,scrollableAncestorRects:H,windowRect:ce}),ue=M?Ve(M,y):null,de=kn(V),fe=An(de),U=An(de,[F]),pe=Ve(le,fe),W=z?_t(z,le):null,me=C&&W?o({active:C,collisionRect:W,droppableRects:re,droppableContainers:ne,pointerCoordinates:ue}):null,he=dt(me,`id`),[ge,_e]=(0,K.useState)(null),ve=mt(B?le:Ve(le,U),ge?.rect??null,F),ye=(0,K.useRef)(null),be=(0,K.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:I,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=O.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=O.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=O.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Ce.unstable_batchedUpdates)(()=>{r?.(i),h($n.Initializing),d({type:X.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(ye.current),ee(a)})},onMove(e){d({type:X.DragMove,coordinates:e})},onEnd:s(X.DragEnd),onCancel:s(X.DragCancel)});ye.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=I.current,o=null;if(t&&i){let{cancelDrop:s}=O.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===X.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=X.DragCancel)}w.current=null,(0,Ce.unstable_batchedUpdates)(()=>{d({type:e}),h($n.Uninitialized),_e(null),E(null),ee(null),ye.current=null;let t=e===X.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=O.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),xe=hn(a,(0,K.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,be(n,t))},[v,be]));jn(a),je(()=>{F&&m===$n.Initializing&&h($n.Initialized)},[F,m]),(0,K.useEffect)(()=>{let{onDragMove:e}=O.current,{active:t,activatorEvent:n,collisions:r,over:i}=I.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:pe.x,y:pe.y},over:i};(0,Ce.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[pe.x,pe.y]),(0,K.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=I.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=O.current,o=r.get(he),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Ce.unstable_batchedUpdates)(()=>{_e(s),a?.(c),f({type:`onDragOver`,event:c})})},[he]),je(()=>{I.current={activatorEvent:D,active:C,activeNode:j,collisionRect:W,collisions:me,droppableRects:re,draggableNodes:v,draggingNode:oe,draggingNodeRect:z,droppableContainers:b,over:ge,scrollableAncestors:V,scrollAdjustedTranslate:pe},S.current={initial:z,translated:W}},[C,j,me,W,v,oe,z,re,b,ge,V,pe]),dn({...N,delta:y,draggingRect:W,pointerCoordinates:ue,scrollableAncestors:V,scrollableAncestorRects:H});let G=(0,K.useMemo)(()=>({active:C,activeNode:j,activeNodeRect:F,activatorEvent:D,collisions:me,containerNodeRect:ae,dragOverlay:R,draggableNodes:v,droppableContainers:b,droppableRects:re,over:ge,measureDroppableContainers:A,scrollableAncestors:V,scrollableAncestorRects:H,measuringConfiguration:k,measuringScheduled:ie,windowRect:ce}),[C,j,F,D,me,ae,R,v,b,re,ge,A,V,H,k,ie,ce]),q=(0,K.useMemo)(()=>({activatorEvent:D,activators:xe,active:C,activeNodeRect:F,ariaDescribedById:{draggable:te},dispatch:d,draggableNodes:v,over:ge,measureDroppableContainers:A}),[D,xe,C,F,d,te,v,ge,A]);return K.createElement(et.Provider,{value:p},K.createElement(Wn.Provider,{value:q},K.createElement(Gn.Provider,{value:G},K.createElement(Qn.Provider,{value:ve},i)),K.createElement(Jn,{disabled:n?.restoreFocus===!1})),K.createElement(at,{...n,hiddenTextDescribedById:te}));function Se(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),tr=(0,K.createContext)(null),nr=`button`,rr=`Draggable`;function ir(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=ze(rr),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,K.useContext)(Wn),{role:p=nr,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,K.useContext)(g?Qn:tr),[v,y]=Ie(),[b,x]=Ie(),S=Mn(o,t),C=Pe(n);return je(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,K.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===nr?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function ar(){return(0,K.useContext)(Gn)}var or=`Droppable`,sr={timeout:25};function cr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=ze(or),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,K.useContext)(Wn),u=(0,K.useRef)({disabled:n}),d=(0,K.useRef)(!1),f=(0,K.useRef)(null),p=(0,K.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...sr,...i},_=Pe(h??r),v=Cn({callback:(0,K.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=Ie((0,K.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=Pe(t);return(0,K.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,K.useEffect)(()=>(s({type:X.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:X.UnregisterDroppable,key:a,id:r})),[r]),(0,K.useEffect)(()=>{n!==u.current.disabled&&(s({type:X.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function lr(e){let{animation:t,children:n}=e,[r,i]=(0,K.useState)(null),[a,o]=(0,K.useState)(null),s=Le(n);return!n&&!r&&s&&i(s),je(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),K.createElement(K.Fragment,null,n,r?(0,K.cloneElement)(r,{ref:o}):null)}var ur={x:0,y:0,scaleX:1,scaleY:1};function dr(e){let{children:t}=e;return K.createElement(Wn.Provider,{value:Un},K.createElement(Qn.Provider,{value:ur},t))}var fr={position:`fixed`,touchAction:`none`},pr=e=>We(e)?`transform 250ms ease`:void 0,mr=(0,K.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=pr}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...fr,width:s.width,height:s.height,top:s.top,left:s.left,transform:qe.Transform.toString(d),transformOrigin:i&&r?lt(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return K.createElement(n,{className:o,style:f,ref:t},a)}),hr={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:qe.Transform.toString(t)},{transform:qe.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function gr(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return Me((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=In(a);if(!c)return;let{transform:l}=Y(a).getComputedStyle(a),u=vt(l);if(!u)return;let d=typeof t==`function`?t:_r(t);return Bt(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function _r(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...hr,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var vr=0;function yr(e){return(0,K.useMemo)(()=>{if(e!=null)return vr++,vr},[e])}var br=K.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=ar(),S=(0,K.useContext)(Qn),C=yr(d?.id),w=Yn(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=bn(f),E=gr({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return K.createElement(dr,null,K.createElement(lr,{animation:E},d&&C?K.createElement(mr,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))});function xr(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Sr(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function Cr(e){return e!==null&&e>=0}function wr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Tr(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var Er=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=xr(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Dr={scaleX:1,scaleY:1},Or=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...Dr}:null}let s=kr(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...Dr}:r<t&&r>=a?{x:0,y:o.height+s,...Dr}:{x:0,y:0,...Dr}};function kr(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var Ar=`Sortable`,jr=K.createContext({activeIndex:-1,containerId:Ar,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Er,disabled:{draggable:!1,droppable:!1}});function Mr(e){let{children:t,id:n,items:r,strategy:i=Er,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=ar(),d=ze(Ar,n),f=s.rect!==null,p=(0,K.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,K.useRef)(p),v=!wr(p,_.current),y=g!==-1&&h===-1||v,b=Tr(a);je(()=>{v&&m&&u(p)},[v,p,m,u]),(0,K.useEffect)(()=>{_.current=p},[p]);let x=(0,K.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:Sr(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return K.createElement(jr.Provider,{value:x},t)}var Nr=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return xr(n,r,i).indexOf(t)},Pr=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},Fr={duration:200,easing:`ease`},Ir=`transform`,Lr=qe.Transition.toString({property:Ir,duration:0,easing:`linear`}),Rr={roleDescription:`sortable`};function zr(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,K.useState)(null),s=(0,K.useRef)(n);return je(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=xt(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,K.useEffect)(()=>{a&&o(null)},[a]),a}function Br(e){let{animateLayoutChanges:t=Pr,attributes:n,disabled:r,data:i,getNewIndex:a=Nr,id:o,strategy:s,resizeObserverConfig:c,transition:l=Fr}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,K.useContext)(jr),y=Vr(r,p),b=u.indexOf(o),x=(0,K.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,K.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=cr({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:ee,activeNodeRect:O,attributes:te,setNodeRef:ne,listeners:k,isDragging:re,over:A,setActivatorNodeRef:ie,transform:j}=ir({id:o,data:x,attributes:{...Rr,...n},disabled:y.draggable}),M=J(E,ne),N=!!D,P=N&&!m&&Cr(f)&&Cr(g),F=!_&&re,ae=P?(F&&P?j:null)??(s??v)({rects:h,activeNodeRect:O,activeIndex:f,overIndex:g,index:b}):null,I=Cr(f)&&Cr(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,L=D?.id,R=(0,K.useRef)({activeId:L,items:u,newIndex:I,containerId:d}),oe=u!==R.current.items,z=t({active:D,containerId:d,isDragging:re,isSorting:N,id:o,index:b,items:u,newIndex:R.current.newIndex,previousItems:R.current.items,previousContainerId:R.current.containerId,transition:l,wasDragging:R.current.activeId!=null}),B=zr({disabled:!z,index:b,node:w,rect:C});return(0,K.useEffect)(()=>{N&&R.current.newIndex!==I&&(R.current.newIndex=I),d!==R.current.containerId&&(R.current.containerId=d),u!==R.current.items&&(R.current.items=u)},[N,I,d,u]),(0,K.useEffect)(()=>{if(L===R.current.activeId)return;if(L!=null&&R.current.activeId==null){R.current.activeId=L;return}let e=setTimeout(()=>{R.current.activeId=L},50);return()=>clearTimeout(e)},[L]),{active:D,activeIndex:f,attributes:te,data:x,rect:C,index:b,newIndex:I,items:u,isOver:T,isSorting:N,isDragging:re,listeners:k,node:w,overIndex:g,over:A,setNodeRef:M,setActivatorNodeRef:ie,setDroppableNodeRef:E,setDraggableNodeRef:ne,transform:B??ae,transition:se()};function se(){if(B||oe&&R.current.newIndex===b)return Lr;if(!(F&&!We(ee)||!l)&&(N||z))return qe.Transition.toString({...l,property:Ir})}}function Vr(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}$.Down,$.Right,$.Up,$.Left;var Hr=[{status:`backlog`,label:`Backlog`,description:`New finding families discovered by the pipeline.`},{status:`todo`,label:`Todo`,description:`Queued for a worker or follow-up pass.`},{status:`in_progress`,label:`In Progress`,description:`Autonomous execution is actively running now.`},{status:`blocked`,label:`Blocked`,description:`Needs more access, context, or a better PoC.`},{status:`done`,label:`Done`,description:`Accepted, verified, or reported.`},{status:`cancelled`,label:`Cancelled`,description:`Suppressed or resolved as false positive.`}];function Ur({groups:e,selectedFingerprint:t,pendingFingerprint:n,onSelect:r,onMove:i}){let[a,o]=(0,K.useState)(null),s=ct(st(nn,{activationConstraint:{distance:6}})),c=(0,K.useMemo)(()=>{let t=new Map;for(let e of Hr)t.set(e.status,[]);for(let n of e)t.get(n.workflow.phase)?.push(n);return t},[e]),l=(0,K.useMemo)(()=>a?e.find(e=>e.fingerprint===a)??null:null,[a,e]);function u(e){o(String(e.active.id))}function d(t){o(null);let{active:n,over:r}=t;if(!r)return;let a=String(n.id),s=e.find(e=>e.fingerprint===a);if(!s)return;let c=null,l=String(r.id);if(Hr.some(e=>e.status===l))c=l;else{let t=e.find(e=>e.fingerprint===l);t&&(c=t.workflow.phase)}c&&c!==s.workflow.phase&&i(a,c)}return(0,q.jsxs)(b,{className:`overflow-hidden`,children:[(0,q.jsx)(h,{className:`border-b border-border`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(T,{children:`Finding board`}),(0,q.jsx)(v,{className:`mt-2`,children:`Finding workflow board`}),(0,q.jsx)(m,{children:`Use this secondary view only when the queue does not make the next action clear.`})]})}),(0,q.jsx)(C,{className:`px-0 pb-0`,children:(0,q.jsxs)(er,{sensors:s,onDragStart:u,onDragEnd:d,children:[(0,q.jsx)(`div`,{className:`overflow-x-auto pb-4`,children:(0,q.jsx)(`div`,{className:`flex min-w-max gap-4 px-6 pb-6`,children:Hr.map(e=>(0,q.jsx)(Wr,{column:e,groups:c.get(e.status)??[],selectedFingerprint:t,pendingFingerprint:n??null,onSelect:r},e.status))})}),(0,q.jsx)(br,{children:l?(0,q.jsx)(Gr,{group:l,selected:t===l.fingerprint,onSelect:r,isOverlay:!0}):null})]})})]})}function Wr({column:e,groups:t,selectedFingerprint:n,pendingFingerprint:r,onSelect:i}){let{setNodeRef:a,isOver:o}=cr({id:e.status});return(0,q.jsxs)(`section`,{className:`flex w-[20rem] shrink-0 flex-col gap-3`,children:[(0,q.jsx)(`div`,{className:`rounded-md border border-border bg-muted/25 px-3 py-3`,children:(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:e.label}),(0,q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:e.description})]}),(0,q.jsx)(`div`,{className:`rounded-sm border border-border bg-background px-2 py-1 text-xs text-muted-foreground`,children:t.length})]})}),(0,q.jsxs)(`div`,{ref:a,className:_(`flex min-h-[20rem] flex-col gap-3 rounded-md border border-dashed border-border bg-muted/15 p-2 transition-colors`,o&&`border-primary/40 bg-primary/7`),children:[(0,q.jsx)(Mr,{items:t.map(e=>e.fingerprint),strategy:Or,children:t.map(e=>(0,q.jsx)(Gr,{group:e,selected:n===e.fingerprint,saving:r===e.fingerprint,onSelect:i},e.fingerprint))}),t.length===0?(0,q.jsx)(`div`,{className:`flex flex-1 items-center justify-center rounded-md border border-dashed border-border/70 bg-background/70 px-4 py-8 text-center text-xs text-muted-foreground`,children:`Drop a finding family here.`}):null]})]})}function Gr({group:e,selected:t,saving:n=!1,onSelect:r,isOverlay:i=!1}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=Br({id:e.fingerprint,data:{group:e}}),d={transform:qe.Transform.toString(c),transition:l},f=n?`Syncing workflow update...`:e.workflow.updatedAt?`Updated ${new Date(e.workflow.updatedAt).toLocaleString()}`:`No workflow activity yet`,p=e.workflow.assignee??e.workflow.activeAgentRoles[0]??`Unassigned`,m=e.workflow.persistedStatus!==e.workflow.phase&&e.workflow.persistedStatus!==e.workflow.reviewGate,h=e.workflow.reviewGate===`human_review`?`Waiting on human review`:e.workflow.reviewGate===`agent_review`?`Waiting on agent review`:e.workflow.phase===`in_progress`?`Execution running`:e.workflow.phase===`blocked`?`Blocked`:`${e.count} hit${e.count>1?`s`:``} · ${e.scanCount} scan${e.scanCount>1?`s`:``}`;return(0,q.jsxs)(`button`,{ref:s,type:`button`,style:d,onClick:()=>r(e.fingerprint),...a,...o,className:_(`rounded-md border border-border bg-card p-3 text-left transition-[border-color,background-color,box-shadow]`,`cursor-grab active:cursor-grabbing hover:border-primary/20 hover:bg-primary/4 hover:shadow-sm`,t&&`border-primary/35 bg-primary/6 shadow-sm ring-1 ring-primary/15`,u&&!i&&`opacity-30`,i&&`shadow-lg ring-1 ring-primary/20`,n&&`border-primary/30 bg-primary/6`),children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:[(0,q.jsx)(_e,{className:`size-3.5`}),e.latest.category,t?(0,q.jsx)(`span`,{className:`rounded-sm bg-primary/10 px-1.5 py-0.5 text-primary-text`,children:`Open`}):null]}),(0,q.jsx)(`div`,{className:`line-clamp-2 text-sm font-semibold leading-5 text-foreground`,children:e.latest.title}),(0,q.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:h})]}),(0,q.jsx)(B,{severity:e.latest.severity})]}),(0,q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[e.workflow.reviewGate===`none`?null:(0,q.jsx)(F,{value:e.workflow.reviewGate}),(0,q.jsx)(oe,{value:e.workflow.consensus}),(0,q.jsx)(M,{value:e.workflow.evidenceSignal}),m?(0,q.jsx)(L,{value:e.workflow.persistedStatus}):null]}),(0,q.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-muted-foreground sm:grid-cols-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-muted/35 px-2.5 py-2`,children:[(0,q.jsx)(ye,{className:`size-3.5`}),(0,q.jsxs)(`span`,{children:[e.count,` hit`,e.count>1?`s`:``]})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-muted/35 px-2.5 py-2`,children:[(0,q.jsx)(xe,{className:`size-3.5`}),(0,q.jsx)(`span`,{children:p})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-sm bg-muted/35 px-2.5 py-2`,children:[(0,q.jsx)(D,{className:`size-3.5`}),(0,q.jsx)(`span`,{children:f})]})]})]})}function Kr({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:_(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-background px-3 py-3 text-base transition-[color,box-shadow,border-color] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function qr(e,t){if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function Jr(e,t){let[n,r]=(0,K.useState)(()=>qr(e,t));return(0,K.useEffect)(()=>{try{window.localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,r]}var Yr=[{value:`backlog`,label:`Backlog`},{value:`todo`,label:`Todo`},{value:`in_progress`,label:`In progress`},{value:`blocked`,label:`Blocked`},{value:`done`,label:`Done`},{value:`cancelled`,label:`Cancelled`}],Xr=[{value:`all`,label:`All consensus`},{value:`pending`,label:`Pending`},{value:`verified`,label:`Verified`},{value:`disputed`,label:`Disputed`},{value:`false-positive`,label:`False positive`}],Zr={search:``,workflowFilter:`all`,reviewFilter:`all`,severityFilter:`all`,consensusFilter:`all`,assigneeFilter:`all`,activeOnly:!1,viewMode:`inbox`,queueSort:`attention`};function Qr(e,t){return[e.latest.title,e.latest.category,e.latest.severity,e.latest.triageStatus,e.workflow.status,e.workflow.phase,e.workflow.reviewGate,e.workflow.persistedStatus,e.workflow.recommendedStatus,e.workflow.reviewReason??``,e.workflow.consensus,e.workflow.assignee??``,e.workflow.activeAgentRoles.join(` `),e.fingerprint].join(` `).toLowerCase().includes(t)}function $r(e,t){let n=t.workflowAssignee.trim()||null,r=t.workflowStatus===`done`||t.workflowStatus===`cancelled`?t.workflowStatus:e.recommendedStatus,i=t.optimisticStatus??(t.workflowStatus===`done`||t.workflowStatus===`cancelled`?t.workflowStatus:e.status),a=_i(t.workflowStatus);return{...e,status:i,persistedStatus:t.workflowStatus,recommendedStatus:r,phase:a,assignee:n,updatedAt:new Date().toISOString()}}function ei(e,t){return{...e,groups:e.groups.map(e=>e.fingerprint===t.fingerprint?{...e,latest:{...e.latest,workflowStatus:t.workflowStatus,workflowAssignee:t.workflowAssignee.trim()||null,workflowUpdatedAt:new Date().toISOString()},workflow:$r(e.workflow,t)}:e)}}function ti(e,t){return e.fingerprint===t.fingerprint?{...e,latest:{...e.latest,workflowStatus:t.workflowStatus,workflowAssignee:t.workflowAssignee.trim()||null,workflowUpdatedAt:new Date().toISOString()},workflow:$r(e.workflow,t)}:e}function ni({dashboard:t}){let{fingerprint:r}=n(),i=e(),l=d(),{openPanel:f,clearPanel:p}=he(),[g,_]=(0,K.useState)(null),[x,D]=Jr(`0:threads:console-state`,Zr),{search:O,workflowFilter:k,reviewFilter:A,severityFilter:ie,consensusFilter:j,assigneeFilter:M,activeOnly:N,viewMode:P,queueSort:F}=x,[ae,I]=(0,K.useState)(!1),L=(0,K.useDeferredValue)(O),R=(0,K.useMemo)(()=>[`all`,...new Set(t.groups.map(e=>e.latest.severity.toLowerCase()))],[t.groups]),oe=(0,K.useMemo)(()=>[`all`,...new Set(t.groups.map(e=>e.workflow.assignee).filter(Boolean))],[t.groups]),z=(0,K.useMemo)(()=>{let e=new Set;for(let n of t.groups){n.workflow.assignee&&e.add(n.workflow.assignee);for(let t of n.workflow.activeAgentRoles)e.add(t)}return[...e].sort((e,t)=>e.localeCompare(t))},[t.groups]),B=(0,K.useMemo)(()=>{let e=L.trim().toLowerCase();return t.groups.filter(t=>!(e&&!Qr(t,e)||k!==`all`&&t.workflow.phase!==k||A!==`all`&&t.workflow.reviewGate!==A||ie!==`all`&&t.latest.severity.toLowerCase()!==ie||j!==`all`&&t.workflow.consensus!==j||M!==`all`&&(t.workflow.assignee??``)!==M&&!t.workflow.activeAgentRoles.includes(M)||N&&t.workflow.activeAgentRoles.length===0))},[N,M,j,t.groups,L,A,ie,k]),H=(0,K.useMemo)(()=>B.filter(e=>e.workflow.reviewGate!==`none`),[B]),U=(0,K.useMemo)(()=>{let e=[...B];return e.sort((e,t)=>F===`newest`?t.latest.timestamp-e.latest.timestamp:F===`severity`?hi(t.latest.severity)-hi(e.latest.severity):gi(t)-gi(e)),e},[B,F]),me=(0,K.useMemo)(()=>U.filter(e=>e.workflow.reviewGate===`none`&&(e.workflow.phase===`todo`||e.workflow.phase===`backlog`)),[U]),ge=(0,K.useMemo)(()=>U.filter(e=>e.workflow.phase===`in_progress`||e.workflow.activeAgentRoles.length>0),[U]),_e=(0,K.useMemo)(()=>U.filter(e=>e.workflow.phase===`blocked`),[U]),ve=(0,K.useMemo)(()=>H.filter(e=>e.workflow.reviewGate===`agent_review`),[H]),ye=(0,K.useMemo)(()=>H.filter(e=>e.workflow.reviewGate===`human_review`),[H]),xe=P===`review`?H:P===`board`?B:U,G=r??null,Se=s({queryKey:[`finding-family`,G],queryFn:()=>c(G),enabled:!!G}),Ce=u({mutationFn:({triageStatus:e,triageNote:t})=>o(G,e,t),onSuccess:async()=>{await Promise.all([l.invalidateQueries({queryKey:[`dashboard`]}),l.invalidateQueries({queryKey:[`finding-family`,G]})])}}),J=u({mutationFn:({fingerprint:e,workflowStatus:t,workflowAssignee:n})=>a(e,t,n),onMutate:async e=>{await Promise.all([l.cancelQueries({queryKey:[`dashboard`]}),l.cancelQueries({queryKey:[`finding-family`,e.fingerprint]})]);let t=l.getQueryData([`dashboard`]),n=l.getQueryData([`finding-family`,e.fingerprint]);return l.setQueryData([`dashboard`],t=>t&&ei(t,e)),l.setQueryData([`finding-family`,e.fingerprint],t=>t&&ti(t,e)),{previousDashboard:t,previousFamily:n,fingerprint:e.fingerprint}},onError:(e,t,n)=>{n?.previousDashboard&&l.setQueryData([`dashboard`],n.previousDashboard),n?.previousFamily&&l.setQueryData([`finding-family`,n.fingerprint],n.previousFamily)},onSettled:async(e,t,n)=>{await Promise.all([l.invalidateQueries({queryKey:[`dashboard`]}),l.invalidateQueries({queryKey:[`finding-family`,n.fingerprint]})])}}),we=t.groups.find(e=>e.fingerprint===G)??null,Te=xe.some(e=>e.fingerprint===G),Ee=O.trim().length>0||k!==`all`||A!==`all`||ie!==`all`||j!==`all`||M!==`all`||N,Y=[k===`all`?null:Yr.find(e=>e.value===k)?.label??k,A===`all`?null:A.replaceAll(`_`,` `),ie===`all`?null:ie,j===`all`?null:j.replaceAll(`-`,` `),M===`all`?null:M,N?`active agents`:null].filter(Boolean),De=P===`review`?`${H.length} review families`:P===`board`?`${B.length} board families`:`${U.length} queued families`;function Oe(){D(e=>({...e,search:``,workflowFilter:`all`,reviewFilter:`all`,severityFilter:`all`,consensusFilter:`all`,assigneeFilter:`all`,activeOnly:!1}))}return(0,K.useEffect)(()=>{G!==g&&_(null)},[g,G]),(0,K.useEffect)(()=>{if(!G||G===g){p();return}let e;return e=Se.isLoading?(0,q.jsx)(ue,{label:`Finding detail`}):Se.error?(0,q.jsx)(V,{error:Se.error}):Se.data?(0,q.jsx)(ri,{data:Se.data,assigneeSuggestions:z,selectedSummary:we?.workflow??null,reviewMode:P===`review`,isSaving:Ce.isPending||J.isPending,onTriage:(e,t)=>Ce.mutate({triageStatus:e,triageNote:t}),onWorkflow:(e,t,n,r)=>J.mutate({fingerprint:e,workflowStatus:t,workflowAssignee:n,optimisticStatus:r})}):(0,q.jsx)(W,{title:`Finding unavailable`,body:`The selected finding family could not be loaded from the local database.`}),f({title:we?.latest.title??`Finding detail`,description:`Inspect this finding family as one execution record with ownership, evidence, chat handoff, and review posture.`,content:(0,q.jsx)(`div`,{className:`p-6`,children:e}),onClose:()=>{_(G),i(`/findings`)}}),()=>{p()}},[z,p,Se.data,Se.error,Se.isLoading,i,f,G,we?.latest.title,we?.workflow,g,Ce.isPending,J.isPending,P]),(0,q.jsxs)(`div`,{className:`space-y-6`,children:[(0,q.jsx)(se,{eyebrow:`Findings`,title:`Findings workspace`,summary:`A finding family groups repeated observations across runs. Start from evidence and the recommended next action; use the scoped chat workspace when the case needs judgment.`,actions:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(y,{variant:`outline`,onClick:()=>I(!0),children:[(0,q.jsx)(be,{className:`size-4`}),`Filters`,Ee?(0,q.jsx)(S,{variant:`neutral`,children:Y.length+ +!!O.trim()}):null]}),G?(0,q.jsx)(y,{variant:`outline`,onClick:()=>i(`/findings`),children:`Close finding`}):null]})}),(0,q.jsxs)(b,{children:[(0,q.jsx)(h,{children:(0,q.jsxs)(`div`,{className:`space-y-3`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(T,{children:`Work queues`}),(0,q.jsx)(v,{className:`mt-2`,children:`Start with what needs a decision`}),(0,q.jsx)(m,{children:`Keep autonomous execution separate from evidence review. The board remains a secondary view, not a second workflow to maintain.`})]}),(0,q.jsx)(ne,{value:P,onValueChange:e=>D(t=>({...t,viewMode:e})),children:(0,q.jsxs)(te,{children:[(0,q.jsx)(ee,{value:`inbox`,children:`Queue`}),(0,q.jsx)(ee,{value:`review`,children:`Review`}),(0,q.jsx)(ee,{value:`board`,children:`Board`})]})})]})}),(0,q.jsxs)(C,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,q.jsx)(ci,{label:`Ready now`,value:`${me.length}`,meta:`Queued for the next autonomous step.`}),(0,q.jsx)(ci,{label:`Running now`,value:`${ge.length}`,meta:`Finding families with live worker activity.`}),(0,q.jsx)(ci,{label:`Blocked`,value:`${_e.length}`,meta:`Need more access, context, or a better PoC.`}),(0,q.jsx)(ci,{label:`Review`,value:`${H.length}`,meta:`Waiting on agent or human sign-off.`})]})]}),(0,q.jsx)(b,{size:`sm`,children:(0,q.jsxs)(C,{className:`space-y-4`,children:[(0,q.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-center`,children:[(0,q.jsxs)(`div`,{className:`relative`,children:[(0,q.jsx)(re,{className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,q.jsx)(w,{value:O,onChange:e=>D(t=>({...t,search:e.target.value})),placeholder:`Search findings, workflow state, assignee, severity, consensus, or fingerprint`,className:`pl-9`})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(E,{className:`size-4`}),De]}),(0,q.jsxs)(S,{variant:`neutral`,children:[t.groups.length,` total`]}),G?(0,q.jsx)(S,{variant:Te?`accent`:`warning`,children:Te?`Finding open`:`Selected finding hidden by filters`}):null]})]}),Ee||O.trim()?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[O.trim()?(0,q.jsxs)(S,{variant:`outline`,children:[`query: `,O.trim()]}):null,Y.map(e=>(0,q.jsx)(S,{variant:`outline`,children:e},e)),(0,q.jsx)(y,{variant:`ghost`,size:`sm`,onClick:Oe,children:`Clear filters`})]}):null]})}),(0,q.jsx)(`div`,{className:`min-w-0 space-y-4`,children:P===`board`?(0,q.jsx)(Ur,{groups:B,selectedFingerprint:G,pendingFingerprint:J.isPending?J.variables?.fingerprint??null:null,onSelect:e=>i(`/findings/${e}`),onMove:(e,n)=>{G!==e&&i(`/findings/${e}`),J.mutate({fingerprint:e,workflowStatus:n,workflowAssignee:t.groups.find(t=>t.fingerprint===e)?.workflow.assignee??``,optimisticStatus:n})}}):P===`review`?(0,q.jsx)(ai,{agentReviewGroups:ve,humanReviewGroups:ye,selectedFingerprint:G,pendingFingerprint:J.isPending?J.variables?.fingerprint??null:null,onSelect:e=>i(`/findings/${e}`)}):(0,q.jsx)(ii,{groups:U,readyGroups:me,activeGroups:ge,blockedGroups:_e,selectedFingerprint:G,queueSort:F,pendingFingerprint:J.isPending?J.variables?.fingerprint??null:null,onSortChange:e=>D(t=>({...t,queueSort:e})),onSelect:e=>i(`/findings/${e}`)})}),(0,q.jsx)(de,{open:ae,onOpenChange:I,children:(0,q.jsxs)(pe,{side:`right`,className:`w-full overflow-y-auto p-0 sm:max-w-xl`,children:[(0,q.jsxs)(ce,{className:`border-b border-border pr-12`,children:[(0,q.jsx)(fe,{children:`Finding filters`}),(0,q.jsx)(le,{children:`Scope finding families by phase, review gate, severity, ownership, or live worker activity.`})]}),(0,q.jsxs)(`div`,{className:`space-y-5 p-6`,children:[(0,q.jsxs)(`label`,{className:`block space-y-2`,children:[(0,q.jsx)(T,{children:`Search`}),(0,q.jsx)(w,{value:O,onChange:e=>D(t=>({...t,search:e.target.value})),placeholder:`Search workflow, evidence, assignee, or fingerprint`})]}),(0,q.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,q.jsxs)(vi,{label:`Workflow`,children:[(0,q.jsx)(yi,{active:k===`all`,onClick:()=>D(e=>({...e,workflowFilter:`all`})),children:`All phases`}),Yr.map(e=>(0,q.jsx)(yi,{active:k===e.value,onClick:()=>D(t=>({...t,workflowFilter:e.value})),children:e.label},e.value))]}),(0,q.jsxs)(vi,{label:`Review gate`,children:[(0,q.jsx)(yi,{active:A===`all`,onClick:()=>D(e=>({...e,reviewFilter:`all`})),children:`All review states`}),(0,q.jsx)(yi,{active:A===`agent_review`,onClick:()=>D(e=>({...e,reviewFilter:`agent_review`})),children:`Agent review`}),(0,q.jsx)(yi,{active:A===`human_review`,onClick:()=>D(e=>({...e,reviewFilter:`human_review`})),children:`Human review`})]}),(0,q.jsx)(vi,{label:`Severity`,children:R.map(e=>(0,q.jsx)(yi,{active:ie===e,onClick:()=>D(t=>({...t,severityFilter:e})),children:e===`all`?`All severities`:e[0]?.toUpperCase()+e.slice(1)},e))}),(0,q.jsx)(vi,{label:`Consensus`,children:Xr.map(e=>(0,q.jsx)(yi,{active:j===e.value,onClick:()=>D(t=>({...t,consensusFilter:e.value})),children:e.label},e.value))}),(0,q.jsxs)(vi,{label:`Ownership`,className:`md:col-span-2`,children:[(0,q.jsx)(yi,{active:M===`all`,onClick:()=>D(e=>({...e,assigneeFilter:`all`})),children:`All assignees`}),oe.filter(e=>e!==`all`).map(e=>(0,q.jsx)(yi,{active:M===e,onClick:()=>D(t=>({...t,assigneeFilter:e})),children:e},e)),(0,q.jsx)(yi,{active:N,onClick:()=>D(e=>({...e,activeOnly:!e.activeOnly})),children:`Active agents only`})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border pt-4`,children:[(0,q.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[xe.length,` of `,t.groups.length,` finding families visible`]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(y,{variant:`ghost`,size:`sm`,onClick:Oe,children:`Reset`}),(0,q.jsx)(y,{size:`sm`,onClick:()=>I(!1),children:`Apply`})]})]})]})]})})]})}function ri({data:e,assigneeSuggestions:t,selectedSummary:n,reviewMode:r,onTriage:i,onWorkflow:a,isSaving:o}){let[s,c]=(0,K.useState)(e.latest.triageNote??``),[u,d]=(0,K.useState)(e.workflow.assignee??``),[f,p]=(0,K.useState)(null),g=`assignee-suggestions-${e.fingerprint}`,_=(0,K.useMemo)(()=>{let n=new Set;e.workflow.assignee&&n.add(e.workflow.assignee);for(let t of e.workflow.activeAgentRoles)n.add(t);for(let e of t)n.add(e);return[...n].slice(0,8)},[t,e.workflow.activeAgentRoles,e.workflow.assignee]),x=e.workItems.find(e=>e.status===`in_progress`)??null,E=e.workItems.find(e=>e.status===`blocked`)??null,D=e.workItems.find(e=>e.status===`todo`||e.status===`backlog`)??null,re=x?.owner??e.workflow.assignee??e.workflow.activeAgentRoles[0]??E?.owner??`Unassigned`,L=E?`Execution is blocked.`:x?`Execution is actively running.`:D?`Execution is queued for the next step.`:e.workflow.reviewGate===`none`?`Execution has no active work item yet.`:`Execution is waiting on review.`,se=E?E.summary||e.workflow.reviewReason||`A blocked step needs operator intervention.`:x?x.summary||e.workflow.reviewReason||`An agent-owned execution step is in progress.`:D?D.summary||`The next queued step is ready to run.`:e.workflow.reviewReason||`No explicit runbook activity is available yet.`,ce=e.case?.targetType===`repository`&&e.workflow.consensus===`verified`?`draft_fix`:e.workflow.reviewGate===`human_review`?`verify`:`investigate`,V=e.consoleCommand.replace(`--finding-intent investigate`,`--finding-intent ${ce}`),le=ce===`draft_fix`?`Plan a source fix in chat`:ce===`verify`?`Review the evidence in chat`:`Investigate in chat`,ue=ce===`draft_fix`?`The chat will establish root cause and propose a patch and regression test. It cannot apply a patch from this handoff.`:ce===`verify`?`The chat will independently assess the evidence before you accept or suppress this finding.`:`The chat starts with this finding's evidence and asks for the next smallest authorized step.`,de=async()=>{try{if(!navigator.clipboard?.writeText)throw Error(`Clipboard access is unavailable.`);await navigator.clipboard.writeText(V),p(`Copied. Run the command in a terminal to continue with the same finding context.`)}catch{p(`Copy is unavailable here. Select the command below and run it in a terminal.`)}};return(0,K.useEffect)(()=>{c(e.latest.triageNote??``)},[e.fingerprint,e.latest.triageNote]),(0,K.useEffect)(()=>{d(e.workflow.assignee??``)},[e.fingerprint,e.workflow.assignee]),(0,K.useEffect)(()=>{p(null)},[e.fingerprint]),(0,q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,q.jsxs)(k,{className:r?`order-2`:`order-1`,eyebrow:r?`Review`:`Operator`,title:r?e.workflow.reviewGate===`human_review`?`Evidence and disposition`:`Evidence and next action`:`Finding controls`,description:r?`Inspect the evidence first. Operator controls remain available after the review record.`:`Review evidence, route the next action into the console, and make a final disposition only when the proof is sufficient.`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,q.jsx)(B,{severity:e.latest.severity}),(0,q.jsx)(j,{value:e.workflow.phase}),(0,q.jsx)(F,{value:e.workflow.reviewGate}),(0,q.jsx)(oe,{value:e.workflow.consensus}),(0,q.jsx)(M,{value:e.workflow.evidenceSignal}),(0,q.jsx)(N,{value:e.latest.triageStatus})]}),(0,q.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:[(0,q.jsx)(di,{label:`Case`,value:e.case?.target??`Unlinked`}),(0,q.jsx)(di,{label:`Case type`,value:e.case?mi(e.case.targetType):`Unknown`}),(0,q.jsx)(di,{label:`Fingerprint`,value:e.fingerprint,mono:!0}),(0,q.jsx)(di,{label:`Category`,value:e.latest.category}),(0,q.jsx)(di,{label:`Occurrences`,value:String(e.rows.length)}),(0,q.jsx)(di,{label:`Review gate`,value:e.workflow.reviewGate.replaceAll(`_`,` `)}),(0,q.jsx)(di,{label:`Active agents`,value:e.workflow.activeAgentRoles.length>0?e.workflow.activeAgentRoles.join(`, `):`None`})]}),(0,q.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/20 p-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(T,{children:`Execution snapshot`}),(0,q.jsx)(`div`,{className:`mt-2 text-sm font-medium text-foreground`,children:L}),(0,q.jsx)(`div`,{className:`mt-1 text-sm leading-6 text-muted-foreground`,children:se}),D?(0,q.jsx)(`div`,{className:`mt-3 text-xs leading-5 text-muted-foreground`,children:"Queued autonomous stages are claimed automatically by a live daemon once dependencies clear. If a finding stalls here, check `Operations` for queue health or worker heartbeats."}):null]}),E?(0,q.jsx)(li,{value:E.status}):x?(0,q.jsx)(li,{value:x.status}):null]}),(0,q.jsxs)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,q.jsx)(di,{label:`Current step`,value:x?x.title:E?E.title:`No live step`}),(0,q.jsx)(di,{label:`Owner`,value:re}),(0,q.jsx)(di,{label:`Next step`,value:D?D.title:e.workflow.reviewGate===`none`?`No queued step`:`Review gate`}),(0,q.jsx)(di,{label:`Blocked by`,value:E?E.title:e.workflow.phase===`blocked`?e.workflow.reviewReason??`Operator input`:`Clear`})]})]}),(0,q.jsx)(`div`,{className:`rounded-md border border-primary/30 bg-primary/5 p-4`,children:(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(ve,{className:`size-4 text-primary-text`}),(0,q.jsx)(T,{children:`Continue in console`})]}),(0,q.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:le}),(0,q.jsx)(`div`,{className:`text-sm leading-6 text-muted-foreground`,children:ue}),(0,q.jsx)(`code`,{className:`block overflow-x-auto rounded bg-background/80 px-3 py-2 font-mono text-xs text-foreground`,children:V}),f?(0,q.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:f}):null]}),(0,q.jsxs)(y,{variant:`outline`,size:`sm`,onClick:()=>void de(),children:[(0,q.jsx)(ge,{className:`size-4`}),`Copy command`]})]})}),(0,q.jsxs)(`label`,{className:`block space-y-2`,children:[(0,q.jsx)(T,{children:`Finding owner`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(w,{list:g,value:u,onChange:e=>d(e.target.value),placeholder:`security-verifier / model owner / person`}),(0,q.jsx)(`datalist`,{id:g,children:_.map(e=>(0,q.jsx)(`option`,{value:e},e))}),(0,q.jsxs)(y,{variant:`outline`,onClick:()=>a(e.fingerprint,e.workflow.phase,u),disabled:o,children:[(0,q.jsx)(xe,{className:`size-4`}),`Assign`]})]})]}),_.length>0?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.map(e=>(0,q.jsx)(y,{variant:u===e?`default`:`outline`,size:`sm`,onClick:()=>d(e),disabled:o,children:e},e))}):null,(0,q.jsx)(`div`,{className:`rounded-md border border-border bg-muted/20 p-4`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`max-w-2xl space-y-2`,children:[(0,q.jsx)(T,{children:`Operator disposition`}),(0,q.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Keep execution state derived from real work.`}),(0,q.jsx)(`div`,{className:`text-sm leading-6 text-muted-foreground`,children:`The queue and console own investigation and remediation planning. Use a disposition only after the evidence is sufficient to accept or suppress this finding family.`})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,q.jsxs)(y,{variant:`success`,onClick:()=>i(`accepted`,s),disabled:o,children:[(0,q.jsx)(U,{className:`size-4`}),`Accept`]}),(0,q.jsxs)(y,{variant:`warning`,onClick:()=>i(`suppressed`,s),disabled:o,children:[(0,q.jsx)(H,{className:`size-4`}),`Suppress`]}),(0,q.jsxs)(y,{variant:`outline`,onClick:()=>i(`new`,s),disabled:o,children:[(0,q.jsx)(ye,{className:`size-4`}),`Reset triage`]})]})]})}),e.workflow.reviewGate!==`none`||e.workflow.persistedStatus!==e.workflow.phase?(0,q.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/35 px-3 py-3 text-sm text-muted-foreground`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-foreground`,children:[(0,q.jsx)(G,{className:`size-4 text-primary-text`}),`Autonomous workflow signal`]}),(0,q.jsxs)(`div`,{className:`mt-1`,children:[`Live execution is currently in `,(0,q.jsx)(`span`,{className:`text-foreground`,children:e.workflow.phase}),e.workflow.reviewGate===`none`?`.`:` with ${e.workflow.reviewGate.replaceAll(`_`,` `)}.`,e.workflow.reviewReason?` ${e.workflow.reviewReason}`:``,n&&n.persistedStatus!==n.phase?` The saved operator workflow is ${n.persistedStatus}.`:``]})]}):null,(0,q.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,q.jsx)(A,{label:`Consensus`,value:e.workflow.consensus}),(0,q.jsx)(A,{label:`Evidence signal`,value:e.workflow.evidenceSignal}),(0,q.jsx)(A,{label:`True positive votes`,value:String(e.workflow.verdictCounts.truePositive)}),(0,q.jsx)(A,{label:`False positive votes`,value:String(e.workflow.verdictCounts.falsePositive)}),(0,q.jsx)(A,{label:`Unsure votes`,value:String(e.workflow.verdictCounts.unsure)}),(0,q.jsx)(A,{label:`Assignee`,value:e.workflow.assignee??`Unassigned`})]}),(0,q.jsxs)(`label`,{className:`block space-y-2`,children:[(0,q.jsx)(T,{children:`Triage note`}),(0,q.jsx)(Kr,{value:s,onChange:e=>c(e.target.value),placeholder:`Capture why this finding is actionable, benign, needs another agent pass, or is waiting on a human call.`})]})]}),(0,q.jsx)(k,{className:r?`order-1`:`order-2`,eyebrow:r?`Review evidence`:`Execution`,title:r?`Evidence before disposition`:`Execution record`,description:r?`Start with the captured proof, then inspect the work chain or make a disposition.`:`Open the runbook, evidence, and occurrence detail only when this finding needs deeper inspection.`,children:(0,q.jsxs)(ne,{defaultValue:r?`evidence`:`runbook`,className:`gap-4`,children:[(0,q.jsxs)(te,{children:[(0,q.jsx)(ee,{value:`runbook`,children:`Runbook`}),(0,q.jsx)(ee,{value:`evidence`,children:`Evidence`}),(0,q.jsx)(ee,{value:`occurrences`,children:`Occurrences`})]}),(0,q.jsxs)(O,{value:`runbook`,className:`space-y-5`,children:[(0,q.jsxs)(`div`,{className:`space-y-3`,children:[(0,q.jsx)(T,{children:`Work chain`}),e.workItems.length===0?(0,q.jsx)(`div`,{className:`rounded-md border border-dashed border-border bg-muted/20 px-4 py-8 text-sm text-muted-foreground`,children:`No persisted work graph exists yet for this finding.`}):(0,q.jsx)(ui,{items:e.workItems,activeWorkItemId:x?.id??null,blockedWorkItemId:E?.id??null})]}),(0,q.jsxs)(`div`,{className:`space-y-3`,children:[(0,q.jsx)(T,{children:`Shared artifacts`}),e.artifacts.length===0?(0,q.jsx)(`div`,{className:`rounded-md border border-dashed border-border bg-muted/20 px-4 py-8 text-sm text-muted-foreground`,children:`No shared artifacts have been persisted for this finding yet.`}):(0,q.jsx)(`div`,{className:`grid gap-3`,children:e.artifacts.map(e=>(0,q.jsx)(`div`,{className:`rounded-md border border-border bg-card px-4 py-3`,children:(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.label}),(0,q.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:e.summary})]}),(0,q.jsx)(S,{variant:`outline`,children:fi(e.kind)})]})},e.id))})]})]}),(0,q.jsx)(O,{value:`evidence`,children:(0,q.jsxs)(`div`,{className:`space-y-3`,children:[(0,q.jsx)(T,{children:`Finding evidence`}),(0,q.jsx)(Se,{request:e.latest.evidenceRequest,response:e.latest.evidenceResponse,analysis:e.latest.evidenceAnalysis})]})}),(0,q.jsx)(O,{value:`occurrences`,children:(0,q.jsxs)(b,{className:`overflow-hidden`,children:[(0,q.jsx)(h,{children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(T,{children:`Occurrences`}),(0,q.jsx)(v,{className:`mt-2`,children:`Matching findings`}),(0,q.jsx)(m,{children:`Each row is an occurrence grouped into this finding family.`})]})}),(0,q.jsx)(C,{children:(0,q.jsxs)(z,{children:[(0,q.jsx)(ie,{children:(0,q.jsxs)(I,{className:`hover:bg-transparent`,children:[(0,q.jsx)(P,{children:`Finding`}),(0,q.jsx)(P,{children:`Scan`}),(0,q.jsx)(P,{children:`Time`}),(0,q.jsx)(P,{className:`w-[8rem]`,children:`Status`})]})}),(0,q.jsx)(ae,{children:e.rows.map(e=>(0,q.jsxs)(I,{children:[(0,q.jsx)(R,{className:`font-mono text-xs text-foreground`,children:e.id.slice(0,8)}),(0,q.jsx)(R,{className:`font-mono text-xs text-muted-foreground`,children:e.scanId.slice(0,8)}),(0,q.jsx)(R,{className:`text-xs text-muted-foreground`,children:l(e.timestamp)}),(0,q.jsx)(R,{children:(0,q.jsx)(N,{value:e.status})})]},e.id))})]})})]})})]})})]})}function ii({groups:e,readyGroups:t,activeGroups:n,blockedGroups:r,selectedFingerprint:i,queueSort:a,pendingFingerprint:o,onSortChange:s,onSelect:c}){return(0,q.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)]`,children:[(0,q.jsxs)(b,{className:`overflow-hidden`,children:[(0,q.jsxs)(h,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(T,{children:`Autonomous queue`}),(0,q.jsx)(v,{className:`mt-2`,children:`What can move next`}),(0,q.jsx)(m,{children:`This queue separates runnable work from active execution. Open a finding when evidence needs a human decision or chat handoff.`})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,q.jsx)(y,{variant:a===`attention`?`default`:`outline`,size:`xs`,onClick:()=>s(`attention`),children:`Needs attention`}),(0,q.jsx)(y,{variant:a===`newest`?`default`:`outline`,size:`xs`,onClick:()=>s(`newest`),children:`Newest`}),(0,q.jsx)(y,{variant:a===`severity`?`default`:`outline`,size:`xs`,onClick:()=>s(`severity`),children:`Severity`})]})]}),(0,q.jsx)(C,{className:`space-y-4`,children:e.length===0?(0,q.jsx)(W,{title:`No finding families in the queue`,body:`Adjust filters or launch a run to populate the finding queue.`}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(oi,{eyebrow:`Ready`,title:`Ready to claim`,description:`Runnable finding families with no review gate. These are the next autonomous work candidates.`,count:t.length,emptyLabel:`No ready finding families under the active filters.`,children:t.map(e=>(0,q.jsx)(si,{group:e,selected:i===e.fingerprint,saving:o===e.fingerprint,mode:`inbox`,onSelect:c},e.fingerprint))}),(0,q.jsx)(oi,{eyebrow:`Running`,title:`Live execution`,description:`Finding families currently owned by a worker or marked in progress.`,count:n.length,emptyLabel:`No live execution right now.`,children:n.map(e=>(0,q.jsx)(si,{group:e,selected:i===e.fingerprint,saving:o===e.fingerprint,mode:`inbox`,onSelect:c},e.fingerprint))})]})})]}),(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsxs)(b,{className:`overflow-hidden`,children:[(0,q.jsx)(h,{children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(T,{children:`Blocked work`}),(0,q.jsx)(v,{className:`mt-2`,children:`Needs intervention`}),(0,q.jsx)(m,{children:`Finding families that need context, access, or a better exploit path before the worker can continue.`})]})}),(0,q.jsx)(C,{className:`px-0 pb-0`,children:r.length===0?(0,q.jsx)(`div`,{className:`px-6 pb-6`,children:(0,q.jsx)(W,{title:`Nothing is blocked`,body:`The current finding set has no blocked execution paths.`})}):(0,q.jsx)(me,{className:`max-h-[38rem]`,children:(0,q.jsx)(g,{children:r.map(e=>(0,q.jsx)(si,{group:e,selected:i===e.fingerprint,saving:o===e.fingerprint,mode:`review`,onSelect:c},e.fingerprint))})})})]}),(0,q.jsxs)(b,{children:[(0,q.jsx)(h,{children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(T,{children:`Reading model`}),(0,q.jsx)(v,{className:`mt-2`,children:`How to use findings`}),(0,q.jsx)(m,{children:`Runs create evidence. Finding families group related observations over time. Workers claim runnable work until a review gate or blocker stops them.`})]})}),(0,q.jsxs)(C,{className:`grid gap-3`,children:[(0,q.jsx)(ci,{label:`Filtered families`,value:`${e.length}`,meta:`Current queue scope after search and filters.`}),(0,q.jsx)(ci,{label:`Ready plus running`,value:`${t.length+n.length}`,meta:`Work automation can touch without human sign-off.`}),(0,q.jsx)(ci,{label:`Blocked plus review`,value:`${r.length}`,meta:`Cases outside the autonomous happy path.`})]})]})]})]})}function ai({agentReviewGroups:e,humanReviewGroups:t,selectedFingerprint:n,pendingFingerprint:r,onSelect:i}){return(0,q.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,q.jsxs)(b,{className:`overflow-hidden`,children:[(0,q.jsx)(h,{children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(T,{children:`Agent review`}),(0,q.jsx)(v,{className:`mt-2`,children:`Consensus and replication`}),(0,q.jsx)(m,{children:`Finding families that need another autonomous pass, conflict resolution, or a stronger PoC before operator review.`})]})}),(0,q.jsx)(C,{className:`px-0 pb-0`,children:e.length===0?(0,q.jsx)(`div`,{className:`px-6 pb-6`,children:(0,q.jsx)(W,{title:`No agent-review families`,body:`Nothing currently needs another agent pass under the active filters.`})}):(0,q.jsx)(me,{className:`max-h-[70vh]`,children:(0,q.jsx)(g,{children:e.map(e=>(0,q.jsx)(si,{group:e,selected:n===e.fingerprint,saving:r===e.fingerprint,mode:`review`,onSelect:i},e.fingerprint))})})})]}),(0,q.jsxs)(b,{className:`overflow-hidden`,children:[(0,q.jsx)(h,{children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(T,{children:`Human review`}),(0,q.jsx)(v,{className:`mt-2`,children:`Operator sign-off`}),(0,q.jsx)(m,{children:`Finding families with enough signal for a final human disposition or report.`})]})}),(0,q.jsx)(C,{className:`px-0 pb-0`,children:t.length===0?(0,q.jsx)(`div`,{className:`px-6 pb-6`,children:(0,q.jsx)(W,{title:`No human-review families`,body:`No finding families currently require operator sign-off under the active filters.`})}):(0,q.jsx)(me,{className:`max-h-[70vh]`,children:(0,q.jsx)(g,{children:t.map(e=>(0,q.jsx)(si,{group:e,selected:n===e.fingerprint,saving:r===e.fingerprint,mode:`review`,onSelect:i},e.fingerprint))})})})]})]})}function oi({eyebrow:e,title:t,description:n,count:r,emptyLabel:i,children:a}){return(0,q.jsxs)(b,{className:`overflow-hidden`,size:`sm`,children:[(0,q.jsx)(h,{className:`border-b border-border`,children:(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(T,{children:e}),(0,q.jsx)(v,{className:`mt-2`,children:t}),(0,q.jsx)(m,{children:n})]}),(0,q.jsx)(S,{variant:`neutral`,children:r})]})}),(0,q.jsx)(C,{className:`px-0 pb-0`,children:r===0?(0,q.jsx)(`div`,{className:`px-4 pb-4`,children:(0,q.jsx)(W,{title:i,body:`The queue will repopulate here as runs produce finding work.`})}):(0,q.jsx)(g,{children:a})})]})}function si({group:e,selected:t,saving:n,mode:r,onSelect:i}){let a=r===`review`?e.workflow.reviewGate===`agent_review`?`Needs agent replication or conflict resolution.`:`Needs operator decision before final disposition.`:e.workflow.reviewReason?e.workflow.reviewReason:e.workflow.phase===`in_progress`?`Execution is active now.`:e.workflow.phase===`blocked`?`Execution is blocked and needs intervention.`:`Ready for the next autonomous step.`;return(0,q.jsx)(x,{interactive:!0,selected:t,className:`p-0`,children:(0,q.jsxs)(`button`,{type:`button`,onClick:()=>i(e.fingerprint),className:`w-full px-4 py-4 text-left`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,q.jsx)(`div`,{className:`text-sm font-semibold leading-5 text-foreground`,children:e.latest.title}),(0,q.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:a})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2`,children:[e.workflow.reviewGate===`none`?null:(0,q.jsx)(F,{value:e.workflow.reviewGate}),(0,q.jsx)(B,{severity:e.latest.severity})]})]}),(0,q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,q.jsx)(j,{value:e.workflow.phase}),(0,q.jsx)(oe,{value:e.workflow.consensus}),(0,q.jsx)(M,{value:e.workflow.evidenceSignal}),(0,q.jsx)(N,{value:e.latest.triageStatus}),e.workflow.persistedStatus!==e.workflow.phase&&e.workflow.persistedStatus!==e.workflow.reviewGate?(0,q.jsx)(L,{value:e.workflow.persistedStatus}):null]}),(0,q.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-muted-foreground md:grid-cols-4`,children:[(0,q.jsxs)(`div`,{children:[`Owner: `,e.workflow.assignee??`Unassigned`]}),(0,q.jsxs)(`div`,{children:[`Coverage: `,e.count,` hits · `,e.scanCount,` scans`]}),(0,q.jsxs)(`div`,{children:[`Agents: `,e.workflow.activeAgentRoles.length>0?e.workflow.activeAgentRoles.join(`, `):`None`]}),(0,q.jsxs)(`div`,{className:`inline-flex items-center gap-1.5`,children:[(0,q.jsx)(D,{className:`size-3.5`}),n?`Saving workflow...`:`Updated ${l(e.workflow.updatedAt??e.latest.timestamp)}`]})]})]})})}function ci({label:e,value:t,meta:n}){return(0,q.jsxs)(`div`,{className:`rounded-md border border-border bg-card px-4 py-3`,children:[(0,q.jsx)(`div`,{className:`text-[10px] font-medium uppercase tracking-widest text-muted-foreground/70`,children:e}),(0,q.jsx)(`div`,{className:`mt-2 text-2xl font-semibold text-foreground`,children:t}),(0,q.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:n})]})}function li({value:e}){return(0,q.jsx)(S,{variant:e===`done`?`success`:e===`blocked`||e===`cancelled`?`danger`:e===`in_progress`?`accent`:e===`todo`?`warning`:`neutral`,children:e.replaceAll(`_`,` `)})}function ui({items:e,activeWorkItemId:t,blockedWorkItemId:n}){return(0,q.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:e.map(e=>{let r=t===e.id,i=n===e.id;return(0,q.jsxs)(`div`,{className:`rounded-md border px-4 py-3 ${i?`border-destructive/30 bg-destructive/5`:r?`border-primary/30 bg-primary/5`:`border-border bg-card`}`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.title}),r?(0,q.jsx)(S,{variant:`accent`,children:`Current`}):null,i?(0,q.jsx)(S,{variant:`danger`,children:`Blocked`}):null]}),(0,q.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:e.summary})]}),(0,q.jsx)(li,{value:e.status})]}),(0,q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,q.jsx)(S,{variant:`outline`,children:pi(e.kind)}),(0,q.jsx)(S,{variant:`outline`,children:e.owner??`Unassigned`})]})]},e.id)})})}function di({label:e,value:t,mono:n=!1}){return(0,q.jsxs)(`div`,{className:`rounded-md border border-border bg-card px-4 py-3`,children:[(0,q.jsx)(`div`,{className:`text-[10px] font-medium uppercase tracking-widest text-muted-foreground/70`,children:e}),(0,q.jsx)(`div`,{className:n?`mt-2 truncate font-mono text-xs text-foreground`:`mt-2 text-sm font-medium text-foreground`,children:t})]})}function fi(e){return e.replaceAll(`_`,` `)}function pi(e){return e.replaceAll(`_`,` `)}function mi(e){return e.replaceAll(`-`,` `)}function hi(e){let t=e.toLowerCase();return t===`critical`?5:t===`high`?4:t===`medium`?3:t===`low`?2:1}function gi(e){let t=0;return e.workflow.reviewGate===`human_review`?t+=100:e.workflow.reviewGate===`agent_review`?t+=90:e.workflow.phase===`blocked`?t+=80:e.workflow.phase===`in_progress`?t+=70:e.workflow.phase===`todo`?t+=60:e.workflow.phase===`backlog`&&(t+=50),e.workflow.assignee||(t+=15),e.workflow.consensus===`disputed`&&(t+=12),e.workflow.activeAgentRoles.length>0&&(t+=8),t*1e6+e.latest.timestamp+hi(e.latest.severity)*1e3}function _i(e){return e===`done`||e===`cancelled`||e===`blocked`||e===`in_progress`||e===`todo`?e:`backlog`}function vi({label:e,className:t,children:n}){return(0,q.jsxs)(`div`,{className:`space-y-3 rounded-md border border-border bg-card px-4 py-4 ${t??``}`,children:[(0,q.jsx)(T,{children:e}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:n})]})}function yi({active:e,onClick:t,children:n}){return(0,q.jsx)(y,{variant:e?`default`:`outline`,size:`xs`,onClick:t,children:n})}export{ni as FindingsPage};
@@ -1 +0,0 @@
1
- import{f as e,m as t,t as n}from"./jsx-runtime-MGseXjj5.js";import{_ as r,a as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,o as p,p as m,r as h,t as g,u as _,v,y}from"./operations-BxZ0OoXO.js";import{a as b,i as x}from"./input-TuVPR3Zl.js";var S=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=i(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),w(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return T(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return T(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof o(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!m(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&E(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||o(this.options.enabled,this.#t)!==o(t.enabled,this.#t)||s(this.options.staleTime,this.#t)!==s(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||o(this.options.enabled,this.#t)!==o(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return O(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(d)),t}#g(){this.#b();let e=s(this.options.staleTime,this.#t);if(p.isServer()||this.#r.isStale||!a(e))return;let t=l(this.#r.dataUpdatedAt,e)+1;this.#d=c.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(p.isServer()||o(this.options.enabled,this.#t)===!1||!a(this.#p)||this.#p===0)&&(this.#f=c.setInterval(()=>{(this.options.refetchIntervalInBackground||r.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(c.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(c.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,a=this.#r,s=this.#i,c=this.#a,l=e===n?this.#n:e.state,{state:u}=e,d={...u},f=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&w(e,t),o=i&&E(e,n,t,r);(a||o)&&(d={...d,...h(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:g,status:v}=d;p=d.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&v===`pending`){let e;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=a.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,p=_(a?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y){if(a&&p===s?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=_(a?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}}this.#s&&(m=this.#s,p=this.#l,g=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,x=v===`pending`,S=v===`error`,C=x&&b,T=p!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:x,isSuccess:v===`success`,isError:S,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!T,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:S&&T,isStale:D(e,t),refetch:this.refetch,promise:this.#o,isEnabled:o(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,r=O.status===`error`&&!t,a=e=>{r?e.reject(O.error):t&&e.resolve(O.data)},o=()=>{let e=this.#o=O.promise=i();a(e)},s=this.#o;switch(s.status){case`pending`:e.queryHash===n.queryHash&&a(s);break;case`fulfilled`:(r||O.data!==s.value)&&o();break;case`rejected`:(!r||O.error!==s.reason)&&o()}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!m(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){u.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function C(e,t){return o(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||o(t.retryOnMount,e)!==!1)}function w(e,t){return C(e,t)||e.state.data!==void 0&&T(e,t,t.refetchOnMount)}function T(e,t,n){if(o(t.enabled,e)!==!1&&s(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&D(e,t)}return!1}function E(e,t,n,r){return(e!==t||o(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&D(e,n)}function D(e,t){return o(t.enabled,e)!==!1&&e.isStaleByTime(s(t.staleTime,e))}function O(e,t){return!m(e.getCurrentResult(),t)}var k=n(),A=t(e(),1),j=A.createContext(!1),M=()=>A.useContext(j);j.Provider;function N(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ee=A.createContext(N()),te=()=>A.useContext(ee),ne=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?f(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},re=e=>{A.useEffect(()=>{e.clearReset()},[e])},ie=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||f(n,[e.error,r])),ae=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},P=(e,t)=>e.isLoading&&e.isFetching&&!t,F=(e,t)=>e?.suspense&&t.isPending,I=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function L(e,t,n){let r=M(),i=te(),a=g(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,ae(o),ne(o,i,s),re(i);let l=!a.getQueryCache().get(o.queryHash),[f]=A.useState(()=>new t(a,o)),m=f.getOptimisticResult(o),h=!r&&c;if(A.useSyncExternalStore(A.useCallback(e=>{let t=h?f.subscribe(u.batchCalls(e)):d;return f.updateResult(),t},[f,h]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),A.useEffect(()=>{f.setOptions(o)},[o,f]),F(o,m))throw I(o,f,i);if(ie({result:m,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw m.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,m),o.experimental_prefetchInRender&&!p.isServer()&&P(m,r)&&(l?I(o,f,i):s?.promise)?.catch(d).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?m:f.trackResult(m)}function R(e,t){return L(e,S,t)}function z(){return document.querySelector(`meta[name="0-control-token"]`)?.getAttribute(`content`)??null}async function B(e,t){let n={"Content-Type":`application/json`,...t?.headers??{}},r=z();r&&(n[`X-0-Control-Token`]=r);let i=await fetch(e,{...t,headers:n});if(!i.ok){let e=`${i.status} ${i.statusText}`;try{let t=await i.json();t.error&&(e=t.error)}catch{}throw Error(e)}let a=i.headers.get(`content-type`)??``;if(!a.includes(`json`))throw Error(`Dashboard API returned ${a||`non-JSON content`} for ${e}. Serve the UI through \`0 dashboard\`.`);return i.json()}function V(){return B(`/api/dashboard`)}async function H(){return(await B(`/api/scans`)).scans}function U(e){return B(`/api/scans/${encodeURIComponent(e)}/events`)}function W(e=20){return B(`/api/events/recent?limit=${encodeURIComponent(String(e))}`)}function G(e){return B(`/api/scans/${encodeURIComponent(e)}/findings`)}function K(e){return B(`/api/finding-family/${encodeURIComponent(e)}`)}function q(e,t,n){return B(`/api/finding-family/${encodeURIComponent(e)}/triage`,{method:`POST`,body:JSON.stringify({triageStatus:t,triageNote:n})})}function J(e,t,n){return B(`/api/finding-family/${encodeURIComponent(e)}/workflow`,{method:`POST`,body:JSON.stringify({workflowStatus:t,workflowAssignee:n})})}function oe(e=3e4){return B(`/api/control/recover-stale-workers`,{method:`POST`,body:JSON.stringify({staleAfterMs:e})})}function se(){return B(`/api/control/prune-stopped-workers`,{method:`POST`,body:JSON.stringify({})})}function ce(e){return B(`/api/control/reset-database`,{method:`POST`,body:JSON.stringify({seed:e})})}function le(e){return B(`/api/control/start-daemon`,{method:`POST`,body:JSON.stringify(e??{})})}function ue(){return B(`/api/control/stop-daemon`,{method:`POST`,body:JSON.stringify({})})}function de(e){return B(`/api/control/launch-run`,{method:`POST`,body:JSON.stringify(e)})}typeof window<`u`&&window.document&&window.document.createElement;function fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function pe(e,t){let n=A.createContext(t),r=e=>{let{children:t,...r}=e,i=A.useMemo(()=>r,Object.values(r));return(0,k.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=A.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function me(e,t=[]){let n=[];function r(t,r){let i=A.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=A.useMemo(()=>o,Object.values(o));return(0,k.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=A.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>A.createContext(e));return function(n){let r=n?.[e]||t;return A.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,he(i,...t)]}function he(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var ge=t(y(),1);function Y(e){let t=_e(e),n=A.forwardRef((e,n)=>{let{children:r,...i}=e,a=A.Children.toArray(r),o=a.find(ye);if(o){let e=o.props.children,r=a.map(t=>t===o?A.Children.count(e)>1?A.Children.only(null):A.isValidElement(e)?e.props.children:null:t);return(0,k.jsx)(t,{...i,ref:n,children:A.isValidElement(e)?A.cloneElement(e,void 0,r):null})}return(0,k.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function _e(e){let t=A.forwardRef((e,t)=>{let{children:n,...r}=e;if(A.isValidElement(n)){let e=xe(n),i=be(r,n.props);return n.type!==A.Fragment&&(i.ref=t?x(t,e):e),A.cloneElement(n,i)}return A.Children.count(n)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ve=Symbol(`radix.slottable`);function ye(e){return A.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ve}function be(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function xe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var X=globalThis?.document?A.useLayoutEffect:()=>{},Se=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Y(`Primitive.${t}`),r=A.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,k.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Z(e,t){e&&ge.flushSync(()=>e.dispatchEvent(t))}function Ce(e){let t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>(...e)=>t.current?.(...e),[])}var we=A.createContext(void 0);function Te(e){let t=A.useContext(we);return e||t||`ltr`}function Ee(e,t){return A.useReducer((e,n)=>t[e][n]??e,e)}var Q=e=>{let{present:t,children:n}=e,r=De(t),i=typeof n==`function`?n({present:r.isPresent}):A.Children.only(n),a=b(r.ref,Oe(i));return typeof n==`function`||r.isPresent?A.cloneElement(i,{ref:a}):null};Q.displayName=`Presence`;function De(e){let[t,n]=A.useState(),r=A.useRef(null),i=A.useRef(e),a=A.useRef(`none`),[o,s]=Ee(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return A.useEffect(()=>{let e=$(r.current);a.current=o===`mounted`?e:`none`},[o]),X(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=$(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),X(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=$(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=$(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:A.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function $(e){return e?.animationName||`none`}function Oe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ke(e){return new Date(e).toLocaleString()}function Ae(e){if(!e||e<=0)return`n/a`;if(e<1e3)return`${e}ms`;let t=Math.round(e/1e3),n=Math.floor(t/60),r=t%60;return n===0?`${t}s`:`${n}m ${r}s`}function je(e){return!e||Object.keys(e).length===0?`No payload`:typeof e.summary==`string`&&e.summary.trim()?e.summary.trim():Array.isArray(e.tools)&&e.tools.length>0?`${typeof e.turn==`number`?`turn ${e.turn} · `:``}tools: ${e.tools.join(`, `)}`:typeof e.excerpt==`string`&&e.excerpt.trim()?`${typeof e.turn==`number`?`turn ${e.turn} · `:``}no tool calls · ${e.excerpt.trim().slice(0,120)}`:Object.entries(e).slice(0,3).map(([e,t])=>`${e}: ${Me(t)}`).join(` · `)}function Me(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?`${e.length} items`:e&&typeof e==`object`?`${Object.keys(e).length} fields`:`n/a`}export{ce as C,J as D,q as E,R as O,oe as S,ue as T,U as _,Te as a,de as b,Z as c,pe as d,me as f,W as g,K as h,Q as i,X as l,V as m,ke as n,Ce as o,fe as p,je as r,Se as s,Ae as t,Y as u,G as v,le as w,se as x,H as y};