p-backlog 0.8.1 → 0.9.0

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 (44) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +12 -6
  3. package/README.ru.md +12 -5
  4. package/dist/cli.js +1866 -1604
  5. package/dist/web/assets/CodeTab-DvFAuZ83.js +1 -0
  6. package/dist/web/assets/CostTab-1Rdp5nwz.js +1 -0
  7. package/dist/web/assets/EffectTab-8aARbrne.js +1 -0
  8. package/dist/web/assets/{Figure-DAdnR-Fu.js → Figure-CCcsLfB5.js} +1 -1
  9. package/dist/web/assets/OverviewTab-DvBBhF85.js +1 -0
  10. package/dist/web/assets/QualityTab-TBeOxc7b.js +1 -0
  11. package/dist/web/assets/ShareBar-C_mQiINj.js +1 -0
  12. package/dist/web/assets/StatsPage-B5K4_4Wb.css +1 -0
  13. package/dist/web/assets/StatsPage-DtpkiP-4.js +1 -0
  14. package/dist/web/assets/StatsPage.module-DrfzjXrP.js +1 -0
  15. package/dist/web/assets/StatsTabState-BmkJh8eP.js +1 -0
  16. package/dist/web/assets/StatsTable-B9Rm04sJ.css +1 -0
  17. package/dist/web/assets/{StatsTable-Dg0CrPof.js → StatsTable-C5qAHApf.js} +1 -1
  18. package/dist/web/assets/UnavailableRepos-ctosBCJf.js +1 -0
  19. package/dist/web/assets/cx-DvgIdypj.js +55 -0
  20. package/dist/web/assets/index-NfqY6Vxd.js +2 -0
  21. package/dist/web/assets/start-BG-1CZwx.css +1 -0
  22. package/dist/web/assets/start-jnWYnN9h.js +41 -0
  23. package/dist/web/assets/{use-grain-panel-BczBScgN.js → use-grain-panel-DRZkQL7T.js} +2 -2
  24. package/dist/web/assets/{value-dot-Dy8YzPPT.js → value-dot-BJdkleLN.js} +1 -1
  25. package/dist/web/index.html +1 -1
  26. package/package.json +5 -3
  27. package/skill/backlog/SKILL.md +20 -14
  28. package/skill/backlog-en/SKILL.md +22 -15
  29. package/dist/web/assets/CodeTab-Bn0Zl7PI.js +0 -1
  30. package/dist/web/assets/CostTab-BBsTM7es.js +0 -1
  31. package/dist/web/assets/EffectTab-gDz3Omnz.js +0 -1
  32. package/dist/web/assets/OverviewTab-CkZ7dCcx.js +0 -1
  33. package/dist/web/assets/QualityTab-Bkxkcnh2.js +0 -1
  34. package/dist/web/assets/ShareBar-CoTArw6Q.js +0 -1
  35. package/dist/web/assets/StatsPage-B-sQM9n_.js +0 -1
  36. package/dist/web/assets/StatsPage-CHUVlZXv.css +0 -1
  37. package/dist/web/assets/StatsPage.module-DxtnhZOJ.js +0 -1
  38. package/dist/web/assets/StatsTabState-BauB3xdU.js +0 -1
  39. package/dist/web/assets/StatsTable-Z9x-Xaha.css +0 -1
  40. package/dist/web/assets/UnavailableRepos-BTMsOBI-.js +0 -1
  41. package/dist/web/assets/cx-CutaZ2Ho.js +0 -55
  42. package/dist/web/assets/index-CM8tBSED.js +0 -2
  43. package/dist/web/assets/start-CbHSVk3k.css +0 -1
  44. package/dist/web/assets/start-Cm2kfqW8.js +0 -41
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>Backlog</title>
7
- <script type="module" crossorigin src="/assets/index-CM8tBSED.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-NfqY6Vxd.js"></script>
8
8
  </head>
9
9
  <body>
10
10
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "p-backlog",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "Keep pull requests clean and audit findings safe: a local, autonomous backlog for Claude Code. The agent files out-of-scope issues as Markdown tasks with context and re-checks them as code changes. Optional web UI with metrics.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -42,7 +42,7 @@
42
42
  ],
43
43
  "scripts": {
44
44
  "test": "vitest run",
45
- "lint": "eslint . && knip && node scripts/check-cyrillic.mjs",
45
+ "lint": "eslint . && prettier --check . && knip && node scripts/check-cyrillic.mjs",
46
46
  "typecheck": "tsc -p tsconfig.json",
47
47
  "build": "vite build && node scripts/build-node.mjs",
48
48
  "install-skill": "node dist/cli.js setup",
@@ -54,7 +54,8 @@
54
54
  "test:package": "vitest run --config vitest.package.config.ts",
55
55
  "prepare": "npm run build",
56
56
  "test:coverage": "vitest run --coverage",
57
- "knip": "knip"
57
+ "knip": "knip",
58
+ "format": "prettier --write ."
58
59
  },
59
60
  "dependencies": {
60
61
  "@hono/node-server": "^2.1.1",
@@ -82,6 +83,7 @@
82
83
  "globals": "^17.12.0",
83
84
  "jsdom": "^30.1.0",
84
85
  "knip": "^6.37.0",
86
+ "prettier": "3.9.9",
85
87
  "react": "^19.3.0",
86
88
  "react-dom": "^19.3.0",
87
89
  "react-is": "^19.3.0",
@@ -56,9 +56,10 @@ description: Use when, while working on code, you notice a problem outside the c
56
56
  - `--category` — обязательно. Запах кода — его категория из каталога code-smells: `bloaters`,
57
57
  `change-preventers`, `couplers`, `data-dealers`, `dispensables`, `functional-abusers`,
58
58
  `lexical-abusers`, `oo-abusers`, `obfuscators`. Неправильное поведение — `bug`.
59
- - `--found` — как найдена, обязательно: `incidental` — ты сам заметил проблему по ходу работы и вынес её,
60
- чтобы не раздувать текущую правку; `review` — находка аудита или ревью по просьбе пользователя; `manual` —
61
- пользователь попросил завести задачу. Только `incidental` считается выигрышем в статистике «Эффект».
59
+ - `--found` — как найдена; передавай всегда: без флага задача запишется как `manual` и не попадёт в «Эффект».
60
+ `incidental` — ты сам заметил проблему по ходу работы и вынес её, чтобы не раздувать текущую правку;
61
+ `review` — находка аудита или ревью по просьбе пользователя; `manual` — пользователь попросил завести
62
+ задачу. Только `incidental` считается выигрышем в статистике «Эффект».
62
63
  - Работаешь над задачей из беклога — добавь `--related <её ID>`.
63
64
  - Чеклист — проверяемые шаги: по нему считается прогресс.
64
65
  - Код выхода 3 и «Похоже на SPA-12 — …» — такая задача уже открыта: новую не создавай, упомяни
@@ -91,7 +92,7 @@ description: Use when, while working on code, you notice a problem outside the c
91
92
  | Код | Что случилось | Что делать |
92
93
  |---|---|---|
93
94
  | 0 | Статус стал `in-progress`, выведены путь, связи и текст задачи | Работать |
94
- | 1 | Это эпик | Показать пользователю задачи эпика из вывода и спросить, какую взять |
95
+ | 1 | Это эпик, либо запись не прошла: файл задачи менялся во время записи или задача не прошла проверку | Эпик — показать пользователю задачи эпика из вывода и спросить, какую взять. Иначе прочитать сообщение: просит повторить команду — повторить, иначе сообщить пользователю |
95
96
  | 2 | Задача или проект не найдены, открытых задач нет | Сообщить пользователю |
96
97
  | 3 | Открытые блокеры или задача уже закрыта; при `--next` и `--path` — все подходящие задачи заблокированы | Перечислить блокеры и остановиться. `take <ID> --force` — только по прямой просьбе пользователя |
97
98
 
@@ -99,13 +100,18 @@ description: Use when, while working on code, you notice a problem outside the c
99
100
  2. Делай работу. Выполнил пункт чеклиста — сразу отметь его в файле задачи (`- [ ]` → `- [x]`, путь есть
100
101
  в выводе `take`). Появились новые шаги — допиши их в чеклист. Frontmatter руками не меняй.
101
102
  3. Посторонние проблемы, найденные по ходу, — через «Записать задачу» с `--related <ID>`.
102
- 4. Перед закрытием проверь результат командами проекта: тесты, линт, типы.
103
- 5. Всё сделано, проверено и закоммичено → `backlog close <ID> --as fixed --reason "Исправлено в <sha>: <что
104
- именно>"` — по хешу статистика узнаёт, кто и чем исправил. Коммита нет (правки ещё не закоммичены) →
105
- `backlog status <ID> done`. Если CLI предупредил о неотмеченных пунктах —
106
- отметь сделанные; если что-то не сделано, задача не закончена.
107
- 6. Сделано не всё → статус оставь `in-progress`, допиши в конец файла задачи раздел и скажи пользователю,
108
- что осталось:
103
+ 4. Закрывай только проверенное: тесты, линт и типы проекта прошли, а если правку ещё будут ревьюить —
104
+ ревью пройдено и замечания по задаче исправлены. Задача, закрытая раньше и возвращённая в работу
105
+ (`backlog status <ID> in-progress`), считается переоткрытой; закрывая её снова, начни `--reason` с
106
+ прежних коммитов — CLI их назовёт.
107
+ 5. Закоммить правку и сразу закрой: `backlog close <ID> --as fixed --reason "Исправлено в <sha>: <что
108
+ именно>"` — хеш есть в выводе `git commit`, по нему статистика узнаёт, кто и чем исправил; исправление
109
+ в нескольких коммитах — перечисли все, основной первым: статистика считает только первый. Коммит
110
+ сделает позже пользователь или его не будет вовсе → `backlog status <ID> done`; появится коммит — тот
111
+ же `backlog close <ID> --as fixed …` привяжет его, не открывая задачу. Если CLI предупредил о
112
+ неотмеченных пунктах — отметь сделанные; если что-то не сделано, задача не закончена.
113
+ 6. Сделано не всё или правка ждёт ревью → статус оставь `in-progress`, допиши в конец файла задачи раздел
114
+ и скажи пользователю, что осталось:
109
115
  ```markdown
110
116
  ## Заметки
111
117
  - <сегодняшняя дата>: сделано …; осталось …, потому что …
@@ -120,9 +126,9 @@ description: Use when, while working on code, you notice a problem outside the c
120
126
  завершённые эпики и сдвинутые `source` он уже исправил сам — это поле `fixed`, список `{ kind, taskId, … }`:
121
127
  `references-removed` — убраны ссылки на несуществующие задачи `ids`; `epic-closed` — эпик закрыт, все его
122
128
  задачи `childIds` закрыты; `epic-reopened` — автоматически закрытый эпик снова открыт, его задачи
123
- `childIds` снова открыты; `source-moved` — `source` сдвинулся `from` → `to`. Перескажи его пользователю
124
- одной строкой. Код выхода 5 — не сбой: есть кандидаты или проблемы задач, которые надо разобрать; 0 —
125
- разбирать нечего.
129
+ `childIds` снова открыты; `source-moved` — `source` сдвинулся или файл задачи переименован, а её строки
130
+ целы: `from` → `to`. Перескажи его пользователю одной строкой. Код выхода 5 — не сбой: есть кандидаты или
131
+ проблемы задач, которые надо разобрать; 0 — разбирать нечего.
126
132
  2. У кандидата `source-changed` в JSON уже есть `problem` — первый абзац описания задачи, `snippet` —
127
133
  текущий код вокруг `source` с номерами строк — и `diff` — изменения файла с последней проверки (у
128
134
  обрезанного `diffOmittedLines` — сколько строк не показано). Обычно этого хватает: реши по ним, не вызывая
@@ -62,10 +62,10 @@ this same task.
62
62
  - `--category` — required. For a code smell, use its category from the code-smells catalog: `bloaters`,
63
63
  `change-preventers`, `couplers`, `data-dealers`, `dispensables`, `functional-abusers`,
64
64
  `lexical-abusers`, `oo-abusers`, `obfuscators`. For incorrect behavior, use `bug`.
65
- - `--found` — how it was found, required: `incidental` — you noticed the problem yourself while working and
66
- moved it out so the current change stays small; `review` — a finding from an audit or review the user asked
67
- for; `manual` — the user asked you to record the task. Only `incidental` counts as a gain in the Effect
68
- statistics.
65
+ - `--found` — how it was found; always pass it: without the flag the task is recorded as `manual` and does
66
+ not count in Effect. `incidental` — you noticed the problem yourself while working and moved it out so the
67
+ current change stays small; `review` — a finding from an audit or review the user asked for; `manual` — the
68
+ user asked you to record the task. Only `incidental` counts as a gain in the Effect statistics.
69
69
  - If you're working on a task from the backlog — add `--related <its ID>`.
70
70
  - The checklist holds verifiable steps: progress is counted from it.
71
71
  - Exit code 3 and "Looks like SPA-12 — …" mean such a task is already open: don't create a new one,
@@ -99,7 +99,7 @@ array) — fix them together, closing each one.
99
99
  | Code | What happened | What to do |
100
100
  |---|---|---|
101
101
  | 0 | Status became `in-progress`, the path, links, and task text were printed | Work on it |
102
- | 1 | It's an epic | Show the user the epic's tasks from the output and ask which one to take |
102
+ | 1 | It's an epic, or the write failed: the task file changed during the write or the task failed validation | Epic — show the user the epic's tasks from the output and ask which one to take. Otherwise read the message: if it asks to retry the command, retry; otherwise tell the user |
103
103
  | 2 | Task or project not found, no open tasks | Tell the user |
104
104
  | 3 | Open blockers, or the task is already closed; with `--next` and `--path` — every matching task is blocked | List the blockers and stop. `take <ID> --force` — only on the user's direct request |
105
105
 
@@ -108,13 +108,19 @@ array) — fix them together, closing each one.
108
108
  path is in the `take` output). New steps came up — add them to the checklist. Don't edit the
109
109
  frontmatter by hand.
110
110
  3. Unrelated problems found along the way — through "Log a task" with `--related <ID>`.
111
- 4. Before closing, verify the result with the project's own commands: tests, lint, types.
112
- 5. Everything is done, verified, and committed → `backlog close <ID> --as fixed --reason "Fixed in <sha>:
113
- <what exactly>"` — the hash lets stats know who fixed it and with what. No commit yet (changes aren't
114
- committed) → `backlog status <ID> done`. If the CLI warned about unchecked items — check off the ones
115
- that are done; if something isn't done, the task isn't finished.
116
- 6. Not everything is done → leave the status `in-progress`, append a section to the end of the task file
117
- and tell the user what's left:
111
+ 4. Close only verified work: the project's tests, lint, and types pass, and if the change is still going
112
+ to be reviewed — the review is done and its findings on the task are fixed. A task closed earlier and
113
+ put back to work (`backlog status <ID> in-progress`) counts as reopened; when closing it again, start
114
+ `--reason` with the earlier commits — the CLI names them.
115
+ 5. Commit the change and close right away: `backlog close <ID> --as fixed --reason "Fixed in <sha>: <what
116
+ exactly>"` — the hash is in the `git commit` output, and it lets stats know who fixed it and with what;
117
+ a fix spread over several commits — list them all, the main one first: stats count only the first. The
118
+ user will commit later, or there will be no commit at all → `backlog status <ID> done`; once the
119
+ commit exists, the same `backlog close <ID> --as fixed …` attaches it without reopening the task. If
120
+ the CLI warned about unchecked items — check off the ones that are done; if something isn't done, the
121
+ task isn't finished.
122
+ 6. Not everything is done, or the change awaits review → leave the status `in-progress`, append a section
123
+ to the end of the task file and tell the user what's left:
118
124
  ```markdown
119
125
  ## Notes
120
126
  - <today's date>: done …; left …, because …
@@ -129,9 +135,10 @@ message), a request to "check the backlog", or "clean up the backlog".
129
135
  Dangling references, completed epics, and shifted `source` — it already fixed those itself; that's the
130
136
  `fixed` field, a list of `{ kind, taskId, … }`: `references-removed` — references to missing tasks `ids`
131
137
  removed; `epic-closed` — the epic closed, all its tasks `childIds` are closed; `epic-reopened` — the
132
- auto-closed epic reopened, its tasks `childIds` are open again; `source-moved` — `source`
133
- moved `from` → `to`. Relay it to the user in one line. Exit code 5 is not a failure: there are candidates or
134
- task problems to work through; 0 means there is nothing to work through.
138
+ auto-closed epic reopened, its tasks `childIds` are open again; `source-moved` — `source` moved, or the
139
+ task's file was renamed with its lines intact: `from` → `to`. Relay it to the user in one line. Exit code 5
140
+ is not a failure: there are candidates or task problems to work through; 0 means there is nothing to work
141
+ through.
135
142
  2. A `source-changed` candidate already has `problem` in the JSON — the task description's first
136
143
  paragraph — `snippet` — the current code around `source` with line numbers — and `diff` — the file's
137
144
  changes since the last check (when cut short, `diffOmittedLines` says how many lines are not shown).
@@ -1 +0,0 @@
1
- import{cn as e,ft as t,i as n,k as r}from"./cx-CutaZ2Ho.js";import{a as i,i as a,n as o,r as s}from"./StatsTabState-BauB3xdU.js";import{t as c}from"./ShareBar-CoTArw6Q.js";import{t as l}from"./StatsPage.module-DxtnhZOJ.js";import{t as u}from"./UnavailableRepos-BTMsOBI-.js";var d={churnRow:`_churnRow_ledt8_1`,densityRow:`_densityRow_ledt8_8`},f=e();function p({churn:e,period:t}){let{stats:n}=r(),o=a(),l=e[0]?.score??1;return(0,f.jsxs)(i,{title:n.churnTitle,period:o.of(`churn`,t),children:[(0,f.jsx)(`p`,{className:s.muted,children:n.churnHint}),e.length===0?(0,f.jsx)(`p`,{className:s.muted,children:n.churnEmpty}):(0,f.jsx)(`ul`,{className:s.rows,children:e.map(e=>(0,f.jsxs)(`li`,{className:d.churnRow,children:[(0,f.jsx)(`code`,{className:s.rowLabel,children:e.label}),(0,f.jsx)(`span`,{className:s.rowValue,children:n.commits(e.commits)}),(0,f.jsx)(`span`,{className:s.rowValue,children:n.churnTasks(e.tasks,e.weight)}),(0,f.jsx)(c,{share:e.score/l})]},e.label))})]})}function m({density:e}){let{stats:t}=r();return(0,f.jsx)(i,{title:t.densityTitle,period:t.periodNow,children:e.projects.length===0?(0,f.jsx)(`p`,{className:s.muted,children:t.noCodeData}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(h,{rows:e.projects.map(e=>({key:e.projectId,label:e.name,row:e}))}),e.folders.length>0&&(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h3`,{className:s.subTitle,children:t.folders}),(0,f.jsx)(h,{rows:e.folders.map(e=>({key:e.label,label:(0,f.jsx)(`code`,{children:e.label}),row:e}))})]})]})})}function h({rows:e}){let{stats:t,core:n}=r();return(0,f.jsx)(`ul`,{className:s.rows,children:e.map(({key:e,label:r,row:i})=>(0,f.jsxs)(`li`,{className:d.densityRow,children:[(0,f.jsx)(`span`,{className:s.rowLabel,children:r}),(0,f.jsx)(`span`,{className:s.rowValue,children:n.count(i.lines,`line`)}),(0,f.jsx)(`span`,{className:s.rowValue,children:n.count(i.open,`task`)}),(0,f.jsx)(`span`,{className:s.rowValue,children:i.perKloc===null?`—`:t.perKloc(i.perKloc)})]},e))})}function g(){let{projectId:e}=t(),r=n(e);return(0,f.jsx)(o,{query:r,children:e=>(0,f.jsx)(_,{report:e})})}function _({report:e}){let{stats:t}=r();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u,{repos:e.unavailableRepos}),(0,f.jsxs)(`div`,{className:l.blocks,children:[(0,f.jsx)(`div`,{className:s.wide,children:(0,f.jsx)(p,{churn:e.churn,period:e.periods.churn})}),(0,f.jsx)(m,{density:e.density})]}),(0,f.jsx)(`p`,{className:l.note,children:t.codeNote})]})}export{g as CodeTab};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t,I as n,O as r,a as i,c as a,cn as o,ft as s,k as c,ln as l}from"./cx-CutaZ2Ho.js";import{_ as u,d,h as f,x as p}from"./index-CM8tBSED.js";import{a as m,i as h,r as g,t as _}from"./StatsTabState-BauB3xdU.js";import{t as v}from"./StatsPage.module-DxtnhZOJ.js";import{n as y,t as b}from"./Figure-DAdnR-Fu.js";import{t as x}from"./StatsTable-Dg0CrPof.js";import{A as S,B as C,C as w,D as ee,Dt as T,E as te,F as ne,G as re,H as ie,I as ae,J as oe,K as se,L as ce,M as le,N as ue,O as de,P as fe,Q as pe,R as me,St as he,T as ge,Tt as _e,U as ve,V as ye,X as be,Y as xe,Z as Se,_ as Ce,_t as E,a as we,at as Te,b as Ee,bt as De,c as Oe,ct as ke,d as Ae,dt as je,et as D,f as Me,ft as O,g as Ne,h as k,ht as Pe,i as A,it as Fe,j as Ie,k as Le,kt as Re,l as ze,lt as Be,m as Ve,mt as He,n as Ue,nt as j,o as We,ot as Ge,p as Ke,pt as M,q as qe,r as Je,rt as Ye,s as Xe,st as Ze,t as Qe,tt as $e,u as et,ut as N,v as P,vt as tt,wt as F,x as nt,xt as I,y as L,yt as rt,z as it}from"./use-grain-panel-BczBScgN.js";import{a as at,i as ot,n as st,o as ct,r as lt,t as R}from"./value-dot-Dy8YzPPT.js";function z(e,n){return n===null?`—`:t(f(e,n))}var B=o();function ut({totals:e,period:t}){let{stats:i}=c(),a=r(),o=h(),s=e=>n(a,e);return(0,B.jsxs)(y,{period:o.of(`lastWeek`,t),children:[(0,B.jsx)(b,{label:i.backlogTokens,value:s(e.tokens),note:i.backlogTokensNote(s(e.hookTokens),s(e.cliTokens))}),(0,B.jsx)(b,{label:i.apiPrice,value:z(a,e.cost),note:e.hasUnpricedTokens?i.unpricedNote:void 0}),(0,B.jsx)(b,{label:i.hookTurns,value:s(e.hookTurns),note:i.hookRunsNote(s(e.hookRuns))}),(0,B.jsx)(b,{label:i.cliCalls,value:s(e.cliRuns)})]})}function dt({models:e,period:t}){let{stats:i}=c(),a=r(),o=h();return(0,B.jsx)(m,{title:i.byModel,period:o.of(`costDays`,t),children:e.length===0?(0,B.jsx)(`p`,{className:g.muted,children:i.noModels}):(0,B.jsx)(x,{label:i.byModel,head:i.modelsHead,rows:e.map(e=>({key:`${e.model}:${e.fast}`,cells:[e.fast?i.fastModel(e.model):e.model,n(a,e.tokens),f(a,e.cost)]}))})})}function ft({commands:e,period:t}){let{stats:i}=c(),a=r(),o=h();return(0,B.jsx)(m,{title:i.commandsTitle,period:o.of(`costDays`,t),children:e.length===0?(0,B.jsx)(`p`,{className:g.muted,children:i.noCommands}):(0,B.jsx)(x,{label:i.commandsTitle,head:i.commandsHead,rows:e.map(e=>({key:e.command,cells:[e.command,n(a,e.runs),i.milliseconds(e.avgMs),i.megabytes(e.avgRssMb),i.megabytes(e.maxRssMb)]}))})})}var pt=(e,t,n)=>re(e,`xAxis`,P(e,t),n),mt=(e,t,n)=>qe(e,`xAxis`,P(e,t),n),ht=(e,t,n)=>re(e,`yAxis`,L(e,t),n),gt=(e,t,n)=>qe(e,`yAxis`,L(e,t),n),_t=M([j,pt,ht,mt,gt],(e,t,n,r,i)=>je(e,`xAxis`)?Ge(t,r,!1):Ge(n,i,!1)),V=M([oe,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),vt=e=>{var t=j(e);return je(t,`xAxis`)?`yAxis`:`xAxis`},yt=(e,t)=>vt(e)===`yAxis`?L(e,t):P(e,t),bt=(e,t,n)=>se(e,vt(e),yt(e,t),n),xt=M([V,bt],(e,t)=>{if(e!=null&&t!=null){var n=e.stackId,r=xe(e);if(n!=null&&r!=null){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),St=M([V,bt],(e,t)=>{if(e!=null&&e.stackId!=null&&t!=null){var n=t[e.stackId];if(n!=null)return n.graphicalItems.map(e=>e.dataKey).filter(rt)}}),Ct=M([j,pt,ht,mt,gt,xt,pe,_t,V,Se,St],(e,t,n,r,i,a,o,s,c,l,u)=>{var d=o.chartData,f=o.dataStartIndex,p=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var m=c.data,h=m&&m.length>0?m:d?.slice(f,p+1);if(h!=null)return Qt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:h,chartBaseValue:l,bandSize:s,stackDataKeys:u})}}),H=e(l()),wt=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],Tt=[`id`,`baseLine`];function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}function Et(e,t){if(e==null)return{};var n,r,i=Dt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ot(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!O(a)||!O(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return I(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),I(c)?H.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function kt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!O(a)||!O(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return I(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),I(c)?H.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function At(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?H.createElement(kt,{alpha:t,points:r,baseLine:i,strokeWidth:a}):H.createElement(Ot,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function jt(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r!==void 0&&r,a=e.isEntrance,o=a!==void 0&&a,s=e.layout,c=e.isRange,l=e.stroke,u=e.connectNulls,d=Et(e,wt),f=s===`vertical`?`vertical`:`horizontal`,p=u??!1,m=de(),h=d.id,g=d.baseLine,_=Et(d,Tt),v=T(_),y=H.createElement(D,U({},d,{id:h,baseLine:g,connectNulls:p,stroke:`none`,className:`recharts-area-area`,layout:f})),b=l!==`none`&&H.createElement(D,U({},v,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:d.points})),x=l!==`none`&&c&&Array.isArray(g)&&H.createElement(D,U({},v,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:p,fill:`none`,stroke:l,points:g}));return o&&(i||n<1)?H.createElement(F,null,H.createElement(`defs`,null,H.createElement(`clipPath`,{id:m},H.createElement(At,{alpha:n,points:d.points??[],baseLine:g,layout:f,strokeWidth:d.strokeWidth}))),H.createElement(F,{clipPath:`url(#${m})`},y,b,x)):H.createElement(H.Fragment,null,y,b,x)}var Mt=[`id`],Nt=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W.apply(null,arguments)}function Pt(e,t){if(e==null)return{};var n,r,i=Ft(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ft(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function It(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?It(Object(n),!0).forEach(function(t){Lt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):It(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Lt(e,t,n){return(t=Rt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rt(e){var t=zt(e,`string`);return typeof t==`symbol`?t:t+``}function zt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Bt={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:ue,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[G(G({},e.next),{},{x:E(e.prev.x,e.next.x,t),y:E(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:jt,xAxisId:0,yAxisId:0,zIndex:be.area};function K(e,t){return e&&e!==`none`?e:t}var Vt=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:K(r,i),value:Be(n,t),payload:e}]},Ht=H.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:he,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Be(o,t),hide:s,type:u,color:K(r,a),unit:c,formatter:l,graphicalItemId:d}};return H.createElement(ne,{tooltipEntrySettings:f})});function Ut(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=T(r);return H.createElement(ct,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function Wt(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return G(G({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return H.createElement(me,{value:t?r:void 0},n)}function Gt(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,s=e.isAnimating,c=e.isEntrance,l=a.layout,u=a.type,d=a.stroke,f=a.connectNulls,p=a.isRange,m=a.shape,h=a.id,g=Pt(a,Mt),_=G(G({},_e(g)),{},{id:h,points:t,connectNulls:f,type:u,baseLine:n,layout:l,stroke:d,isRange:p,animationElapsedTime:o,isAnimating:s,isEntrance:c});return H.createElement(H.Fragment,null,t?.length>1&&H.createElement(F,{clipPath:r?`url(#clipPath-${i})`:void 0},H.createElement(ae,{option:m,DefaultShape:Bt.shape,shapeProps:_})),H.createElement(Ut,{points:t,props:g,clipPathId:i}))}function Kt(e,t,n){if(I(e)){var r=I(t)?t:void 0;return E(r,e,n)}if(De(e)||tt(e)){var i=I(t)?t:void 0;return E(i,0,n)}return e}function qt(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=r.points,s=r.baseLine,c=r.isAnimationActive,l=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationMatchBy,p=r.animationInterpolateFn,m=(0,H.useMemo)(()=>({points:o,baseLine:s}),[o,s]),h=Ie(m,a),g=Ye(),_=S(r.onAnimationStart,r.onAnimationEnd),v=_.isAnimating,y=_.handleAnimationStart,b=_.handleAnimationEnd,x=h.startValue;if(g==null)return null;var C=Array.isArray(s)&&Array.isArray(x)?le(x,s,f):Array.isArray(s)?le(null,s,f):null;return H.createElement(Le,{animationInput:m,animationIdPrefix:`recharts-area-`,items:o,previousItemsRef:i,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:y,onAnimationEnd:b,animationInterpolateFn:p,animationMatchBy:f,layout:g},(e,i,a)=>{var c=i===1?s:Array.isArray(s)?p(C,i,g):a?s:Kt(s,x,i);return h.syncStepValue(c,i),H.createElement(Wt,{showLabels:!v,points:o},r.children,H.createElement(Gt,{points:e,baseLine:c,needClip:t,clipPathId:n,props:r,animationElapsedTime:i,isAnimating:v||i<1,isEntrance:a}),H.createElement(it,{label:r.label}))})}function Jt(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=(0,H.useRef)(null),a=(0,H.useRef)();return H.createElement(qt,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var Yt=class extends H.PureComponent{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.needClip,c=e.xAxisId,l=e.yAxisId,u=e.width,d=e.height,f=e.id,p=e.baseLine,m=e.zIndex;if(t)return null;var h=Re(`recharts-area`,i),g=f,_=ot(n),v=_.r,y=_.strokeWidth,b=ce(n),x=v*2+y,S=s?`url(#clipPath-${b?``:`dots-`}${g})`:void 0;return H.createElement(ie,{zIndex:m},H.createElement(F,{className:h},s&&H.createElement(`defs`,null,H.createElement(Ee,{clipPathId:g,xAxisId:c,yAxisId:l}),!b&&H.createElement(`clipPath`,{id:`clipPath-dots-${g}`},H.createElement(`rect`,{x:o-x/2,y:a-x/2,width:u+x,height:d+x}))),H.createElement(Jt,{needClip:s,clipPathId:g,props:this.props})),H.createElement(at,{points:r,mainColor:K(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(p)&&H.createElement(at,{points:p,mainColor:K(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}};function Xt(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,f=e.stroke,p=e.xAxisId,m=e.yAxisId,h=Pt(e,Nt),g=Fe(),_=ve(),v=nt(p,m).needClip,y=Te(),b=He(t=>Ct(t,e.id,y))??{},x=b.points,S=b.isRange,C=b.baseLine,w=ge();if(g!==`horizontal`&&g!==`vertical`||w==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var ee=w.height,T=w.width,te=w.x,ne=w.y;return!x||!x.length?null:H.createElement(Yt,W({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:C,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:ee,hide:l,layout:g,isAnimationActive:u,isRange:S,legendType:d,needClip:v,points:x,stroke:f,width:T,left:te,top:ne,xAxisId:p,yAxisId:m}))}var Zt=(e,t,n,r,i)=>{var a=n??t;if(I(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function Qt(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=e.stackDataKeys,g=a&&a.length,_=Zt(o,s,r,c,l),v=o===`horizontal`,y=!1,b=u.map((e,t)=>{var r;if(g)r=a[d+t];else{var o=N(e,i);Array.isArray(o)?(r=o,y=!0):r=[_,o]}var s=r?.[1]??null,u=N(e,i),b=g&&u==null&&h!=null&&h.length>0&&h.every(t=>N(e,t)==null),x=s==null||g&&!n&&u==null||b;return v?{x:Ze({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:x?null:l.scale.map(s)??null,value:r,payload:e}:{x:x?null:c.scale.map(s)??null,y:Ze({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:b,baseLine:(g||y?b.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):v?l.scale.map(_):c.scale.map(_))??0,isRange:y}}function $t(e){var t=Pe(e,Bt),n=Te();return H.createElement(ee,{id:t.id,type:`area`},e=>H.createElement(H.Fragment,null,H.createElement(fe,{legendPayload:Vt(t)}),H.createElement(Ht,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),H.createElement(te,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:ke(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),H.createElement(Xt,W({},t,{id:e}))))}var q=H.memo($t,$e);q.displayName=`Area`;var en=[`axis`],tn=(0,H.forwardRef)((e,t)=>H.createElement(Ve,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:en,tooltipPayloadSearcher:ye,categoricalChartProps:e,ref:t})),J=`var(--chart-line-bright)`,Y=`var(--chart-line-blue)`;function nn(e,t){return Ue(n=>({title:Me(t,n.at),rows:[{label:e.processMemory,value:e.megabytes(n.rssMb),shape:`line`,color:J},{label:e.jsHeap,value:e.megabytes(n.heapUsedMb),shape:`dashed`,color:Y}]}))}function rn(){let{stats:e}=c(),t=r(),n=(0,H.useMemo)(()=>nn(e,t),[e,t]),i=[{label:e.processMemory,shape:`line`,color:J},{label:e.jsHeap,shape:`dashed`,color:Y}],o=a().data?.samples??[],s=o.at(-1)?.rssMb??null,l=o.length===0?null:Math.max(...o.map(e=>e.rssMb));return(0,B.jsxs)(m,{title:e.serverMemory,children:[(0,B.jsx)(`p`,{className:g.muted,children:e.memoryRestartNote}),(0,B.jsx)(Ke,{summary:e.memorySummary(e.megabytes(s),e.megabytes(l)),legend:i,children:(0,B.jsxs)(tn,{data:o,margin:We,"aria-label":e.chartLabel(e.serverMemory,`sample`),children:[(0,B.jsx)(w,{vertical:!1}),(0,B.jsx)(Ne,{dataKey:`at`,tickFormatter:e=>et(t,e),...Xe}),(0,B.jsx)(k,{tickFormatter:t=>e.megabytes(t),width:60,...A}),(0,B.jsx)(C,{content:n,...Oe,cursor:{stroke:`var(--line-strong)`}}),(0,B.jsx)(q,{dataKey:`rssMb`,stroke:J,strokeWidth:3,fill:J,fillOpacity:Je,dot:!1,isAnimationActive:!1}),(0,B.jsx)(q,{dataKey:`heapUsedMb`,stroke:Y,strokeWidth:2,strokeDasharray:`5 4`,fill:`none`,dot:!1,isAnimationActive:!1})]})})]})}var X=`var(--chart-bar-warm)`,Z=`var(--chart-bar-neutral)`,Q=`var(--chart-line-green)`,$=`var(--chart-line-yellow)`;function an(e,t,r){return Ue(i=>({title:e.periodOf(r,d(t,i.start)),rows:[{label:e.hookTurnsTooltip,value:e.tokens(i.hookTokens),shape:`bar`,color:X},{label:e.cliOutput,value:e.tokens(i.cliTokens),shape:`bar`,color:Z},{label:e.apiPriceTooltip,value:i.hasUnpricedTokens&&i.cost!==null?`${z(t,i.cost)} (${e.unpricedNote})`:z(t,i.cost)},{label:e.hookRuns,value:n(t,i.hookRuns),shape:`line`,color:Q},{label:e.otherCommands,value:n(t,i.cliRuns),shape:`dashed`,color:$}]}))}function on({day:e,...t}){return{start:e,...t}}function sn({weeks:e,days:t,windows:n}){let{stats:i}=c(),a=r(),o=(0,H.useMemo)(()=>t.map(on),[t]),{grain:s,periods:l,period:u,toggle:d}=Qe(`spend`,`day`,{week:e,day:o},n),f=(0,H.useMemo)(()=>an(i,a,s),[i,a,s]),p=i.spendBy[s],h=[{label:i.hookTurnTokens,shape:`bar`,color:X},{label:i.cliOutputTokens,shape:`bar`,color:Z},{label:i.hookRuns,shape:`line`,color:Q},{label:i.otherCommands,shape:`dashed`,color:$}],g=e=>Ae(a,e);return(0,B.jsx)(m,{title:p,period:u,aside:d,children:(0,B.jsx)(Ke,{summary:cn(i,a,s,l),legend:h,children:(0,B.jsxs)(st,{data:l,margin:We,"aria-label":i.chartLabel(p,s),children:[(0,B.jsx)(w,{vertical:!1}),(0,B.jsx)(Ne,{dataKey:`start`,tickFormatter:e=>ze(a,e),...Xe}),(0,B.jsx)(k,{yAxisId:`tokens`,tickFormatter:g,width:60,...A}),(0,B.jsx)(k,{yAxisId:`runs`,orientation:`right`,allowDecimals:!1,tickFormatter:g,width:60,...A}),(0,B.jsx)(C,{content:f,...Oe}),(0,B.jsx)(Ce,{yAxisId:`tokens`,dataKey:`hookTokens`,stackId:`tokens`,fill:X,isAnimationActive:!1}),(0,B.jsx)(Ce,{yAxisId:`tokens`,dataKey:`cliTokens`,stackId:`tokens`,fill:Z,radius:we,isAnimationActive:!1}),(0,B.jsx)(lt,{yAxisId:`runs`,dataKey:`hookRuns`,stroke:Q,strokeWidth:3,dot:R(Q),isAnimationActive:!1}),(0,B.jsx)(lt,{yAxisId:`runs`,dataKey:`cliRuns`,stroke:$,strokeWidth:2,strokeDasharray:`5 4`,dot:R($),isAnimationActive:!1})]})})})}function cn(e,t,r,i){let a=e=>p(i.map(e)),o=e=>n(t,e);return e.spendSummary({grain:r,periodCount:i.length,hookTokens:a(e=>e.hookTokens),cliTokens:o(a(e=>e.cliTokens)),money:f(t,ln(i)),hookRuns:o(a(e=>e.hookRuns)),cliRuns:o(a(e=>e.cliRuns))})}function ln(e){return e.every(e=>e.cost===null)?null:p(e.map(e=>e.cost??0))}function un(){let{projectId:e}=s(),t=i(e),{stats:n}=c();return(0,B.jsx)(_,{query:t,children:e=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(dn,{scan:e.scan}),(0,B.jsx)(pn,{report:e}),(0,B.jsx)(`p`,{className:v.note,children:n.costNote})]})})}function dn({scan:e}){let{stats:t}=c(),n=fn(t,e);return(0,B.jsx)(`p`,{className:n===null?`visually-hidden`:v.warning,role:`status`,children:n})}function fn(e,t){return t.listed?t.filesTotal===0?e.noTranscripts:t.bytesLeft>0?e.scanProgress(t.filesDone,t.filesTotal):null:e.scanStarting}function pn({report:e}){let{stats:t}=c(),n=r(),i=mn(e);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ut,{totals:e.totals,period:e.periods.totals}),i!==null&&(0,B.jsx)(`p`,{className:v.note,children:t.costSince(d(n,i))}),(0,B.jsxs)(`div`,{className:v.blocks,children:[(0,B.jsx)(`div`,{className:g.wide,children:(0,B.jsx)(sn,{weeks:e.weeks,days:e.days,windows:e.periods})}),(0,B.jsx)(dt,{models:e.models,period:e.periods.days}),(0,B.jsx)(rn,{}),(0,B.jsx)(`div`,{className:g.wide,children:(0,B.jsx)(ft,{commands:e.commands,period:e.periods.days})})]})]})}function mn({since:e,periods:t}){return e!==null&&u(e)>u(t.weeks.from)?e:null}export{un as CostTab};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,I as n,M as r,O as i,cn as a,ft as o,j as s,k as c,ln as l,s as u}from"./cx-CutaZ2Ho.js";import{d,x as f}from"./index-CM8tBSED.js";import{a as p,i as m,n as h,r as g}from"./StatsTabState-BauB3xdU.js";import{t as _}from"./StatsPage.module-DxtnhZOJ.js";import{t as v}from"./UnavailableRepos-BTMsOBI-.js";import{n as y,t as b}from"./Figure-DAdnR-Fu.js";import{t as ee}from"./StatsTable-Dg0CrPof.js";import{B as x,C as S,V as C,_ as w,a as T,c as E,d as D,g as O,h as k,i as A,l as j,m as M,n as N,o as P,p as F,s as I,t as L}from"./use-grain-panel-BczBScgN.js";var R=e(l()),z=[`axis`,`item`],B=(0,R.forwardRef)((e,t)=>R.createElement(M,{chartName:`BarChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:z,tooltipPayloadSearcher:C,categoricalChartProps:e,ref:t})),V={steps:`_steps_advmo_1`,now:`_now_advmo_13`},H=a();function U({totals:e}){let{stats:t}=c(),n=i();return(0,H.jsx)(p,{title:t.explainerTitle,children:(0,H.jsxs)(`ol`,{className:V.steps,children:[(0,H.jsx)(`li`,{children:t.explainerTask}),(0,H.jsxs)(`li`,{children:[t.explainerFixed,(0,H.jsx)(W,{children:t.fixedNow(e.fixedTasks,e.fixedLines)})]}),(0,H.jsxs)(`li`,{children:[t.explainerPending,(0,H.jsx)(W,{children:G(t,e)})]}),(0,H.jsxs)(`li`,{children:[t.explainerTests,(0,H.jsx)(W,{children:t.codeAndTests(e)})]}),(0,H.jsxs)(`li`,{children:[t.explainerNoise,(0,H.jsx)(W,{children:K(t,n,e)})]})]})})}function W({children:e}){let{stats:t}=c();return(0,H.jsxs)(`span`,{className:V.now,children:[t.now,` `,e]})}function G(e,t){return t.openTasks===0?e.noPending:t.estimatedLines===null?e.pendingWithoutEstimate(t.openTasks):e.pendingEstimated(t.openTasks,t.estimatedLines,t.estimatedLines/t.openTasks)}function K(e,i,a){if(a.estimatedLines===null&&a.openTasks>0)return e.estimateLater;if(a.noiseShare===null)return e.noCommitsSinceAdoption;let o=a.estimatedLines??0,c=r(a.estimatedLines);return e.noiseFormula(t(i,a.deferredLines,c),n(i,a.realLines),t(i,o,c),s(a.noiseShare))}var q=`var(--chart-bar-neutral)`,J=`var(--accent-ink)`,Y=6,X=3;function Z(e,n,r,i){let a=e=>t(r,e,Math.round(e)>0);return N(t=>({title:e.periodOf(i,d(r,t.start)),rows:[{label:e.onTopicSeries,value:n.count(Math.round(t.onTopicLines),`line`),shape:`bar`,color:q},{label:e.deferredSeries,value:a(t.deferredLines),shape:`hatch`,color:J},{label:e.codeLines,value:a(t.deferredLines-t.deferredTestLines)},{label:e.testLines,value:a(t.deferredTestLines)},{label:e.deferredTasks,value:String(t.deferredTasks)}]}))}function Q({periods:e,totals:t,grain:n}){let{stats:r,core:a}=c(),o=i(),s=(0,R.useMemo)(()=>Z(r,a,o,n),[r,a,o,n]),l=(0,R.useId)(),u=[{label:r.onTopicSeries,shape:`bar`,color:q},{label:r.deferredSeries,shape:`hatch`,color:J}];return(0,H.jsx)(F,{summary:$(r,n,e,t),legend:u,children:(0,H.jsxs)(B,{data:e,margin:P,"aria-label":r.chartLabel(r.effectTitle,n),children:[(0,H.jsx)(`defs`,{children:(0,H.jsxs)(`pattern`,{id:l,width:Y,height:Y,patternUnits:`userSpaceOnUse`,patternTransform:`rotate(45)`,children:[(0,H.jsx)(`rect`,{width:Y,height:Y,fill:`var(--surface-raised)`}),(0,H.jsx)(`line`,{x1:0,y1:0,x2:0,y2:Y,stroke:J,strokeWidth:X})]})}),(0,H.jsx)(S,{vertical:!1}),(0,H.jsx)(O,{dataKey:`start`,tickFormatter:e=>j(o,e),...I}),(0,H.jsx)(k,{tickFormatter:e=>D(o,e),width:60,...A}),(0,H.jsx)(x,{content:s,...E}),(0,H.jsx)(w,{dataKey:`onTopicLines`,stackId:`lines`,fill:q,isAnimationActive:!1}),(0,H.jsx)(w,{dataKey:`deferredLines`,stackId:`lines`,fill:`url(#${l})`,radius:T,isAnimationActive:!1})]})})}function $(e,t,n,i){let a=r(i.estimatedLines);if(t===`week`)return e.effectSummary(i.realLines,e.linesText(i.deferredLines,a),s(i.noiseShare));let o=Math.round(f(n.map(e=>e.onTopicLines)));return e.effectDaysSummary(n.length,o,e.linesText(f(n.map(e=>e.deferredLines)),a))}function te({totals:e,period:t}){let{stats:r}=c(),a=i(),o=m();return(0,H.jsxs)(y,{period:o.labelled(r.effectWindow,t),children:[(0,H.jsx)(b,{label:r.keptOut,value:ne(r,e),note:`${re(r,a,e)} · ${r.codeAndTests(e)}`}),(0,H.jsx)(b,{label:r.noiseWithoutBacklog,value:s(e.noiseShare),note:r.noiseNote}),(0,H.jsx)(b,{label:r.deferredToBacklog,value:String(e.fixedTasks+e.openTasks),note:r.deferredNote(e.fixedTasks,e.openTasks)}),(0,H.jsx)(b,{label:r.pullRequestLines,value:n(a,e.realLines)})]})}function ne(e,t){return t.estimatedLines===null?e.linesText(t.fixedLines,!1):e.linesText(t.deferredLines,r(t.estimatedLines))}function re(e,i,a){let o=n(i,a.fixedLines);return a.estimatedLines===null?e.keptOutPending(o):e.keptOutEstimated(o,t(i,a.estimatedLines,r(a.estimatedLines)))}function ie({weeks:e,days:t,windows:n,totals:r}){let{stats:i}=c(),{grain:a,periods:o,period:s,toggle:l}=L(`effect`,`week`,{week:e,day:t},n);return(0,H.jsx)(p,{title:i.effectTitle,period:s,aside:l,children:(0,H.jsx)(Q,{periods:o,totals:r,grain:a})})}function ae({projects:e,period:a}){let{stats:o}=c(),l=i(),u=m();return(0,H.jsx)(p,{title:o.byProject,period:u.labelled(o.effectWindow,a),children:e.length===0?(0,H.jsx)(`p`,{className:g.muted,children:o.noCodeData}):(0,H.jsx)(ee,{label:o.byProject,head:o.projectsHead,rows:e.map(e=>({key:e.projectId,cells:[e.name,e.deferredTasks,n(l,e.fixedLines),e.estimatedLines===null?`—`:t(l,e.estimatedLines,r(e.estimatedLines)),n(l,e.realLines),s(e.noiseShare)]}))})})}function oe(){let{projectId:e}=o(),t=u(e);return(0,H.jsx)(h,{query:t,children:e=>(0,H.jsx)(se,{report:e})})}function se({report:e}){let{stats:t}=c(),n=e.totals.fixedTasks+e.totals.openTasks===0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(v,{repos:e.unavailableRepos}),n&&(0,H.jsx)(`p`,{className:_.note,children:t.noDeferredTasks}),(0,H.jsx)(te,{totals:e.totals,period:e.periods.weeks}),(0,H.jsxs)(`div`,{className:_.blocks,children:[(0,H.jsx)(`div`,{className:g.wide,children:(0,H.jsx)(ie,{weeks:e.weeks,days:e.days,windows:e.periods,totals:e.totals})}),(0,H.jsx)(`div`,{className:g.wide,children:(0,H.jsx)(ae,{projects:e.projects,period:e.periods.weeks})}),(0,H.jsx)(`div`,{className:g.wide,children:(0,H.jsx)(U,{totals:e.totals})})]})]})}export{oe as EffectTab};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{B as t,L as n,O as r,R as i,cn as a,ft as o,h as s,k as c,ln as l,t as u}from"./cx-CutaZ2Ho.js";import{d,x as f}from"./index-CM8tBSED.js";import{c as p,u as m}from"./start-Cm2kfqW8.js";import{a as h,i as g,n as _,r as v}from"./StatsTabState-BauB3xdU.js";import{t as ee}from"./ShareBar-CoTArw6Q.js";import{t as y}from"./StatsPage.module-DxtnhZOJ.js";import{t as b}from"./Figure-DAdnR-Fu.js";import{B as x,C as S,_ as C,a as w,c as T,d as E,g as D,h as O,i as k,l as A,n as j,o as M,p as N,s as P,t as F}from"./use-grain-panel-BczBScgN.js";import{n as I,r as L,t as te}from"./value-dot-Dy8YzPPT.js";var R={columns:`_columns_1m2da_1`,countList:`_countList_1m2da_7`,ageRows:`_ageRows_1m2da_11`,ageRow:`_ageRow_1m2da_11`,ageLabel:`_ageLabel_1m2da_25`,ageTrack:`_ageTrack_1m2da_29`,ageSegment:`_ageSegment_1m2da_37`,legend:`_legend_1m2da_41`,legendItem:`_legendItem_1m2da_50`,share:`_share_1m2da_61`,critical:`_critical_1m2da_65`,high:`_high_1m2da_69`,medium:`_medium_1m2da_73`,low:`_low_1m2da_77`,done:`_done_1m2da_81`,fixed:`_fixed_1m2da_85`,obsolete:`_obsolete_1m2da_89`,duplicate:`_duplicate_1m2da_93`,cancelled:`_cancelled_1m2da_97`,unknown:`_unknown_1m2da_101`,shareBar:`_shareBar_1m2da_105`,alarm:`_alarm_1m2da_117`,alarmOn:`_alarmOn_1m2da_123`},z=a();function ne(e,n){let r=[...t].reverse().filter(e=>n[e]>0).map(t=>`${e.priorityCounts[t]} ${n[t]}`);return r.length===0?``:` (${r.join(`, `)})`}function B({age:e}){let{stats:n,core:r}=c(),i=e.buckets.map(({bucket:e,byPriority:n})=>({bucket:e,total:f(t.map(e=>n[e])),byPriority:n})),a=Math.max(1,...i.map(({total:e})=>e)),o=i.map(({bucket:e,total:t,byPriority:r})=>`${n.ageBuckets[e]}: ${t}${ne(n,r)}`).join(`; `);return(0,z.jsxs)(h,{title:n.openAge,period:n.periodNow,children:[(0,z.jsx)(`div`,{role:`img`,"aria-label":o,className:R.ageRows,children:i.map(({bucket:e,total:r,byPriority:i})=>(0,z.jsxs)(`div`,{className:R.ageRow,"aria-hidden":`true`,children:[(0,z.jsx)(`span`,{className:R.ageLabel,children:n.ageBuckets[e]}),(0,z.jsx)(`span`,{className:R.ageTrack,children:t.map(e=>(0,z.jsx)(`span`,{className:u(R.ageSegment,R[e]),style:{width:`${i[e]/a*100}%`}},e))}),(0,z.jsx)(`span`,{className:v.rowValue,children:r})]},e))}),(0,z.jsx)(`p`,{className:R.legend,children:[...t].reverse().map(e=>(0,z.jsx)(`span`,{className:u(R.legendItem,R[e]),children:r.priorityLabel(e)},e))}),(0,z.jsx)(`p`,{className:u(R.alarm,e.urgentStale>0&&R.alarmOn),children:n.urgentStale(e.urgentStale)})]})}var V=[`done`,`fixed`,`obsolete`,`duplicate`,`cancelled`,`unknown`];function H(e,{stats:t,core:n}){return e===`done`||e===`cancelled`||e===`unknown`?t.closingReasons[e]:n.resolutionLabel(e)}function re({closing:e,period:t}){let r=c(),i=g(),{stats:a}=r,o=f(V.map(t=>e.byReason[t])),s=V.map(t=>`${H(t,r)}: ${e.byReason[t]}`).join(`; `);return(0,z.jsxs)(h,{title:a.closing,period:i.of(`weeks`,t),children:[(0,z.jsx)(`div`,{role:`img`,"aria-label":s,className:R.shareBar,children:V.map(t=>(0,z.jsx)(`span`,{className:u(R.share,R[t]),style:{width:o===0?0:`${e.byReason[t]/o*100}%`}},t))}),(0,z.jsx)(`ul`,{className:v.rows,children:V.map(t=>(0,z.jsxs)(`li`,{className:v.row,children:[(0,z.jsx)(`span`,{className:u(R.legendItem,R[t]),children:H(t,r)}),(0,z.jsx)(`span`,{className:v.rowValue,children:e.byReason[t]})]},t))}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h3`,{className:v.subTitle,children:a.noiseAndReopens}),(0,z.jsxs)(`ul`,{className:v.rows,children:[(0,z.jsx)(U,{label:a.duplicatesAmongClosed,value:n(e.duplicateShare)}),(0,z.jsx)(U,{label:a.noSourceAmongCreated,value:n(e.withoutSourceShare)}),(0,z.jsx)(U,{label:a.reopened,value:e.reopened})]})]})]})}function U({label:e,value:t}){return(0,z.jsxs)(`li`,{className:v.row,children:[(0,z.jsx)(`span`,{className:v.rowLabel,children:e}),(0,z.jsx)(`span`,{className:v.rowValue,children:t})]})}var ie=`↓`,W=`↑`;function G(e,t,n){if(t===null||n===null)return;let r=t-n;if(r===0)return;let i=r<0,a=String(Math.abs(r));return{text:e.weekTrend(i?ie:W,a),speech:e.weekTrendSpeech(a,i),tone:i?`decline`:`growth`}}function K({hotspots:e,listPath:t}){let{stats:n}=c();return(0,z.jsx)(h,{title:n.hotspots,period:n.periodNow,children:(0,z.jsxs)(`div`,{className:R.columns,children:[(0,z.jsx)(q,{title:n.folders,empty:n.noSourceFolders,items:e.folders.map(({label:e,count:t})=>({key:e,label:(0,z.jsx)(`code`,{children:e}),count:t}))}),(0,z.jsx)(q,{title:n.tags,empty:n.noTags,items:e.tags.map(({tag:e,count:n})=>({key:e,label:(0,z.jsxs)(m,{to:{pathname:t,search:`tag=${encodeURIComponent(e)}`},children:[`#`,e]}),count:n}))})]})})}function q({title:e,empty:t,items:n}){let r=Math.max(1,...n.map(e=>e.count));return(0,z.jsxs)(`div`,{className:R.countList,children:[(0,z.jsx)(`h3`,{className:v.subTitle,children:e}),n.length===0?(0,z.jsx)(`p`,{className:v.muted,children:t}):(0,z.jsx)(`ul`,{className:v.rows,children:n.map(e=>(0,z.jsxs)(`li`,{className:v.countRow,children:[(0,z.jsx)(`span`,{className:v.rowLabel,children:e.label}),(0,z.jsx)(`span`,{className:v.rowValue,children:e.count}),(0,z.jsx)(ee,{share:e.count/r})]},e.key))})]})}var J=e(l(),1),Y=`var(--chart-bar-neutral)`,X=`var(--chart-bar-green)`,Z=`var(--chart-line-bright)`;function ae(e,t,n){return j(r=>({title:e.periodOf(n,d(t,r.start)),rows:[{label:e.flowCreated,value:String(r.created),shape:`bar`,color:Y},{label:e.flowClosed,value:String(r.closed),shape:`bar`,color:X},{label:e.flowOpen,value:String(r.openAtEnd),shape:`line`,color:Z}]}))}function oe({weeks:e,days:t,windows:n}){let{stats:i}=c(),a=r(),{grain:o,periods:s,period:l,toggle:u}=F(`flow`,`week`,{week:e,day:t},n),d=(0,J.useMemo)(()=>ae(i,a,o),[i,a,o]),p=[{label:i.flowCreated,shape:`bar`,color:Y},{label:i.flowClosed,shape:`bar`,color:X},{label:i.flowOpenAtEnd[o],shape:`line`,color:Z}],m=i.debtBy[o],g=i.flowSummary({grain:o,periodCount:s.length,created:f(s.map(e=>e.created)),closed:f(s.map(e=>e.closed)),openNow:s.at(-1)?.openAtEnd??0}),_=e=>E(a,e);return(0,z.jsx)(h,{title:m,period:l,aside:u,children:(0,z.jsx)(N,{summary:g,legend:p,children:(0,z.jsxs)(I,{data:s,margin:M,"aria-label":i.chartLabel(m,o),children:[(0,z.jsx)(S,{vertical:!1}),(0,z.jsx)(D,{dataKey:`start`,tickFormatter:e=>A(a,e),...P}),(0,z.jsx)(O,{yAxisId:`flow`,allowDecimals:!1,tickFormatter:_,width:60,...k}),(0,z.jsx)(O,{yAxisId:`open`,orientation:`right`,allowDecimals:!1,tickFormatter:_,width:60,...k}),(0,z.jsx)(x,{content:d,...T}),(0,z.jsx)(C,{yAxisId:`flow`,dataKey:`created`,fill:Y,radius:w,isAnimationActive:!1}),(0,z.jsx)(C,{yAxisId:`flow`,dataKey:`closed`,fill:X,radius:w,isAnimationActive:!1}),(0,z.jsx)(L,{yAxisId:`open`,dataKey:`openAtEnd`,stroke:Z,strokeWidth:3,dot:te(Z),isAnimationActive:!1})]})})})}var Q=`var(--chart-bar-warm)`;function se(e,t,n,r){return j(i=>({title:e.periodOf(r,d(n,i.start)),rows:[{label:e.flowCreated,value:t.count(i.created,`task`),shape:`bar`,color:Q}]}))}function $({weeks:e,days:t,windows:n}){let{stats:i,core:a}=c(),o=r(),{grain:s,periods:l,period:u,toggle:d}=F(`intake`,`day`,{week:e,day:t},n),p=(0,J.useMemo)(()=>se(i,a,o,s),[i,a,o,s]),m=[{label:i.createdTasks,shape:`bar`,color:Q}],g=i.createdBy[s];return(0,z.jsx)(h,{title:g,period:u,aside:d,children:(0,z.jsx)(N,{summary:i.intakeSummary(s,l.length,f(l.map(e=>e.created))),legend:m,children:(0,z.jsxs)(I,{data:l,margin:M,"aria-label":i.chartLabel(g,s),children:[(0,z.jsx)(S,{vertical:!1}),(0,z.jsx)(D,{dataKey:`start`,tickFormatter:e=>A(o,e),...P}),(0,z.jsx)(O,{allowDecimals:!1,tickFormatter:e=>E(o,e),width:60,...k}),(0,z.jsx)(x,{content:p,...T}),(0,z.jsx)(C,{dataKey:`created`,fill:Q,radius:w,isAnimationActive:!1})]})})})}function ce(){let{projectId:e}=o(),t=s(e);return(0,z.jsx)(_,{query:t,children:t=>(0,z.jsx)(le,{report:t,taskListPath:p(e)})})}function le({report:e,taskListPath:t}){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ue,{totals:e.totals}),(0,z.jsxs)(`div`,{className:y.blocks,children:[(0,z.jsx)(oe,{weeks:e.weeks,days:e.days,windows:e.periods}),(0,z.jsx)($,{weeks:e.weeks,days:e.days,windows:e.periods}),(0,z.jsx)(K,{hotspots:e.hotspots,listPath:t}),(0,z.jsx)(B,{age:e.age}),(0,z.jsx)(re,{closing:e.closing,period:e.periods.weeks})]})]})}function ue({totals:e}){let{stats:t}=c(),n=e.createdLastWeek-e.closedLastWeek,r=e.previous;return(0,z.jsxs)(`div`,{className:u(y.totals,y.totalsPair),children:[(0,z.jsx)(b,{label:t.tasksToday,value:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`span`,{className:e.createdToday>0?y.growth:void 0,children:[`+`,e.createdToday]}),` `,(0,z.jsxs)(`span`,{className:e.closedToday>0?y.decline:void 0,children:[`−`,e.closedToday]})]}),note:t.createdAndClosed}),(0,z.jsx)(b,{label:t.thisWeek,value:i(n),tone:de(n),note:t.weekNote(e.createdLastWeek,e.closedLastWeek),trend:G(t,n,r?.net??null)})]})}function de(e){if(e>0)return`growth`;if(e<0)return`decline`}export{ce as OverviewTab};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{L as t,O as n,cn as r,ft as i,k as a,ln as o,u as s}from"./cx-CutaZ2Ho.js";import{d as c,x as l}from"./index-CM8tBSED.js";import{a as u,i as d,n as f,r as p}from"./StatsTabState-BauB3xdU.js";import{t as m}from"./StatsPage.module-DxtnhZOJ.js";import{t as h}from"./StatsTable-Dg0CrPof.js";import{B as g,C as _,_ as v,a as y,c as b,g as x,h as S,i as C,l as w,n as T,o as E,p as D,s as O,t as k}from"./use-grain-panel-BczBScgN.js";import{n as A,r as j,t as M}from"./value-dot-Dy8YzPPT.js";var N=e(o(),1),P=r(),F=`var(--chart-bar-neutral)`,I=`var(--chart-line-green)`;function L(e,n,r){return T(i=>({title:e.periodOf(r,c(n,i.start)),rows:[{label:e.decidedCandidates,value:String(i.decided),shape:`bar`,color:F},{label:e.precision,value:t(i.precision),shape:`line`,color:I}]}))}function R({periods:e,grain:r}){let{stats:i}=a(),o=n(),s=(0,N.useMemo)(()=>L(i,o,r),[i,o,r]),c=[{label:i.decidedCandidates,shape:`bar`,color:F},{label:i.precision,shape:`line`,color:I}],u=l(e.map(e=>e.decided)),d=e.filter(e=>e.precision!==null).at(-1),f=i.accuracySummary({grain:r,periodCount:e.length,decided:u,latestPrecision:d===void 0?null:t(d.precision)});return(0,P.jsx)(D,{summary:f,legend:c,children:(0,P.jsxs)(A,{data:e,margin:E,"aria-label":i.chartLabel(i.accuracyTitle,r),children:[(0,P.jsx)(_,{vertical:!1}),(0,P.jsx)(x,{dataKey:`start`,tickFormatter:e=>w(o,e),...O}),(0,P.jsx)(S,{yAxisId:`decided`,allowDecimals:!1,width:60,...C}),(0,P.jsx)(S,{yAxisId:`precision`,orientation:`right`,domain:[0,1],tickFormatter:t,width:60,...C}),(0,P.jsx)(g,{content:s,...b}),(0,P.jsx)(v,{yAxisId:`decided`,dataKey:`decided`,fill:F,radius:y,isAnimationActive:!1}),(0,P.jsx)(j,{yAxisId:`precision`,type:`monotone`,dataKey:`precision`,stroke:I,strokeWidth:3,connectNulls:!0,dot:M(I),isAnimationActive:!1})]})})}function z({rows:e,weeks:n,days:r,windows:i,methodRows:o,matchRows:s}){let{stats:c,core:l}=a(),f=d(),{grain:m,periods:g,period:_,toggle:v}=k(`accuracy`,`week`,{week:n,day:r},i),y=f.of(`weeks`,i.weeks),b=e=>e===`source-changed`?o.map(e=>B(c,e,e.by===`unknown`?c.beforeMethodRecorded:c.checkedBy(l.checkMethodLabel(e.by)))):e===`duplicate`?s.map(e=>B(c,e,e.by===`unknown`?c.beforeMatchRecorded:c.matchedBy(l.duplicateMatchLabel(e.by)))):[];return(0,P.jsx)(u,{title:c.accuracyTitle,period:_,aside:e.length===0?void 0:v,children:e.length===0?(0,P.jsx)(`p`,{className:p.muted,children:c.noCandidates}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`p`,{className:p.muted,children:c.accuracyHint}),(0,P.jsx)(R,{periods:g,grain:m}),(0,P.jsx)(`p`,{className:p.muted,children:y}),(0,P.jsx)(h,{label:c.accuracyTable(y),head:c.accuracyHead,rows:e.flatMap(e=>[{key:e.evidence,tone:e.evidence===`total`?`total`:void 0,cells:[l.evidenceLabel(e.evidence),e.candidates,e.closed,e.verified,e.open,t(e.precision)]},...b(e.evidence).map(t=>({...t,key:`${e.evidence}-${t.key}`}))])})]})})}function B(e,n,r){return{key:n.by,tone:`child`,cells:[e.splitRow(r),n.candidates,n.closed,n.verified,n.open,t(n.precision)]}}function V({graph:e,period:t}){let{stats:n,core:r}=a(),i=d(),{projects:o,filter:s}=e;return s.filtered===0&&o.every(e=>e.state===`none`)?(0,P.jsx)(u,{title:n.graphTitle,children:(0,P.jsx)(`p`,{className:p.muted,children:n.graphMissing(e=>(0,P.jsx)(`code`,{children:e},e))})}):(0,P.jsxs)(u,{title:n.graphTitle,children:[(0,P.jsx)(`p`,{className:p.muted,children:n.graphHint}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:p.subTitle,children:i.labelled(n.filteredTitle,t)}),s.filtered===0?(0,P.jsx)(`p`,{className:p.muted,children:n.nothingFiltered}):(0,P.jsx)(h,{label:n.filteredTable,head:n.filteredHead,rows:[{key:`filtered`,cells:[n.filteredByGraph,s.filtered]},{key:`caught`,cells:[n.filteredCaught,s.caught]},{key:`missed`,cells:[n.filteredMissed,s.missed]},{key:`quiet`,cells:[n.filteredQuiet,s.quiet]}]})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:p.subTitle,children:n.periodCaption(n.projects,n.periodNow)}),(0,P.jsx)(h,{label:n.graphByProject,head:n.graphHead,rows:o.map(e=>({key:e.projectId,cells:[e.name,r.graphStateLabel(e.state),e.pinned,H(e)]}))})]})]})}function H({state:e,pinned:n,resolved:r}){return e===`none`||e===`unreadable`?`—`:`${r} (${t(n===0?null:r/n)})`}function U({rows:e,period:t}){let{stats:n,core:r}=a(),i=d(),o=e=>e.category===`unknown`?n.categoryUnknown:r.categoryLabel(e.category??void 0);return(0,P.jsx)(u,{title:n.categoriesTitle,period:i.of(`weeks`,t),children:e.length===0?(0,P.jsx)(`p`,{className:p.muted,children:n.categoriesEmpty}):(0,P.jsx)(h,{label:n.categoriesTitle,head:n.categoriesHead,rows:e.map(e=>({key:e.category??`none`,cells:[o(e),e.open,e.weight,e.created,e.closed]}))})})}function W({found:e,branches:t,period:n}){let{stats:r}=a(),i=d(),o=e=>e.found===null?r.foundNotRecorded:e.found===`unknown`?r.foundUnknown:r.foundLabels[e.found];return(0,P.jsxs)(u,{title:r.originTitle,period:i.of(`weeks`,n),children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:p.subTitle,children:r.foundTitle}),(0,P.jsx)(h,{label:r.foundTitle,head:r.foundHead,rows:e.map(e=>({key:e.found??`not-recorded`,cells:[o(e),e.created,e.open,e.fixed]}))})]}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:p.subTitle,children:r.branchesTitle}),t.length===0?(0,P.jsx)(`p`,{className:p.muted,children:r.branchesEmpty}):(0,P.jsx)(h,{label:r.branchesTitle,head:r.branchesHead,rows:t.map(e=>({key:e.label,cells:[(0,P.jsx)(`code`,{children:e.label}),e.created,e.open]}))})]})]})}function G(){let{projectId:e}=i(),t=s(e);return(0,P.jsx)(f,{query:t,children:e=>(0,P.jsx)(K,{report:e})})}function K({report:e}){return(0,P.jsxs)(`div`,{className:m.blocks,children:[(0,P.jsx)(`div`,{className:p.wide,children:(0,P.jsx)(z,{rows:e.accuracy,weeks:e.accuracyWeeks,days:e.accuracyDays,windows:e.periods,methodRows:e.methodAccuracy,matchRows:e.matchAccuracy})}),(0,P.jsx)(`div`,{className:p.wide,children:(0,P.jsx)(V,{graph:e.graph,period:e.periods.weeks})}),(0,P.jsx)(`div`,{className:p.wide,children:(0,P.jsx)(U,{rows:e.categories,period:e.periods.weeks})}),(0,P.jsx)(`div`,{className:p.wide,children:(0,P.jsx)(W,{found:e.found,branches:e.branches,period:e.periods.weeks})})]})}export{G as QualityTab};
@@ -1 +0,0 @@
1
- import{cn as e}from"./cx-CutaZ2Ho.js";import{r as t}from"./StatsTabState-BauB3xdU.js";var n=e();function r({share:e}){return(0,n.jsx)(`span`,{className:t.track,"aria-hidden":`true`,children:(0,n.jsx)(`span`,{className:t.fill,style:{transform:`scaleX(${e})`}})})}export{r as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ft as t,cn as n,ft as r,k as i,l as a,ln as o,lt as s,m as c,ot as l,t as u}from"./cx-CutaZ2Ho.js";import{a as d,d as f,i as p,l as m,o as h,t as g,u as _}from"./start-Cm2kfqW8.js";import{t as v}from"./StatsPage.module-DxtnhZOJ.js";var y=e(o(),1),b=n();function x(){let{projectId:e}=r(),{pathname:n}=l(),o=a(),x=c(e),{app:S,core:C,stats:w}=i(),T=e===void 0?w.projects:d(o.data,e),E=w.heading(T),D=m(e),O=e=>e===``?D:`${D}/${e}`,k=(e,n)=>t({path:O(e),end:!0},n)!==null,A=g.find(e=>e.segment!==``&&k(e.segment,n))??g[0],j=s().location?.pathname,M=(0,y.useRef)(null),N=j===void 0?void 0:g.find(e=>k(e.segment,j)),P=w.docTitle(A.segment===``?E:`${w.tabs[A.key]} · ${E}`);return p(P),(0,b.jsxs)(`main`,{id:`content`,tabIndex:-1,className:v.page,"aria-busy":N!==void 0||void 0,children:[(0,b.jsx)(`h1`,{ref:M,tabIndex:-1,className:v.heading,children:E}),e===void 0&&o.data!==void 0&&(0,b.jsx)(`p`,{className:v.scopeNote,children:h(o.data,S)}),(x.data?.signals.length??0)>0&&(0,b.jsxs)(`div`,{className:v.signals,role:`status`,"aria-labelledby":`stats-signals-heading`,children:[(0,b.jsx)(`strong`,{id:`stats-signals-heading`,className:v.signalsTitle,children:w.alerts}),(0,b.jsx)(`ul`,{children:x.data?.signals.map(e=>(0,b.jsx)(`li`,{children:C.signal(e)},e.kind))})]}),(0,b.jsx)(`nav`,{className:v.tabs,"aria-label":w.tabsLabel,children:g.map(e=>(0,b.jsx)(_,{to:O(e.segment),className:u(v.tab,e===A&&v.tabActive,e===N&&v.tabPending),"aria-current":e===A?`page`:void 0,children:w.tabs[e.key]},e.key))}),(0,b.jsx)(f,{context:{heading:M}})]})}export{x as StatsPage};
@@ -1 +0,0 @@
1
- ._page_10yeb_1{min-width:0;overflow-y:var(--main-overflow,auto);container-type:inline-size}._heading_10yeb_7{padding:var(--space-4) var(--space-5) 0;font-size:var(--text-lg);text-wrap:balance;margin:0;font-weight:600}._scopeNote_10yeb_15{margin:var(--space-1) var(--space-5) 0;color:var(--ink-subtle);font-size:var(--text-sm)}._signals_10yeb_21{margin:var(--space-3) var(--space-5) 0;padding:var(--space-2) var(--space-4);border:1px solid var(--warn);border-radius:var(--radius-control);background:var(--warn-soft);color:var(--ink)}._signalsTitle_10yeb_30{margin-bottom:var(--space-1);display:block}._signals_10yeb_21 ul{margin:0;padding-inline-start:var(--space-4)}._tabs_10yeb_40{gap:var(--space-1);padding:var(--space-3) var(--space-5) 0;border-bottom:1px solid var(--line);flex-wrap:wrap;display:flex}._tab_10yeb_40{padding:var(--space-2) var(--space-3);color:var(--ink-muted);white-space:nowrap;transition:color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out);border-bottom:2px solid #0000;text-decoration:none}._tab_10yeb_40:hover{color:var(--ink)}._tabActive_10yeb_61{border-bottom-color:var(--ink);color:var(--ink)}._tabPending_10yeb_66{border-bottom-color:var(--line-strong);cursor:progress}._content_10yeb_71{gap:var(--space-4);padding:var(--space-4) var(--space-5) var(--space-6);flex-direction:column;display:flex}._hint_10yeb_78{max-width:60ch;margin:var(--space-6) var(--space-5);color:var(--ink-muted)}._hintLoading_10yeb_84{color:var(--ink-subtle)}._hint_10yeb_78 p{margin:0 0 var(--space-3);text-wrap:pretty}._warning_10yeb_93{padding:var(--space-3) var(--space-4);border:1px solid var(--warn);border-radius:var(--radius-control);background:var(--warn-soft);color:var(--ink);text-wrap:pretty;margin:0}._totals_10yeb_103{gap:var(--space-3);grid-template-columns:repeat(4,minmax(0,1fr));display:grid}._totalsPair_10yeb_109{grid-template-columns:repeat(2,minmax(0,1fr))}._figureGroup_10yeb_113{gap:var(--space-2);flex-direction:column;display:flex}._figure_10yeb_113{gap:var(--space-1);padding:var(--space-3);border-radius:var(--radius-control);background:var(--surface-raised);box-shadow:0 0 0 1px var(--line);border:none;flex-direction:column;display:flex}._figureLabel_10yeb_130,._figureNote_10yeb_131{color:var(--ink-subtle);font-size:var(--text-sm)}._figureTrend_10yeb_136{font-size:var(--text-sm);font-variant-numeric:tabular-nums}._figureValue_10yeb_141{font-size:var(--text-xl);font-variant-numeric:tabular-nums;overflow-wrap:anywhere;font-weight:600}._growth_10yeb_148{color:var(--accent-ink)}._decline_10yeb_152{color:var(--ok)}._blocks_10yeb_156{gap:var(--space-3);grid-template-columns:repeat(2,minmax(0,1fr));display:grid}._note_10yeb_162{max-width:70ch;color:var(--ink-subtle);font-size:var(--text-sm);text-wrap:pretty;margin:0}@container (width<=900px){._totals_10yeb_103{grid-template-columns:repeat(2,minmax(0,1fr))}._blocks_10yeb_156{grid-template-columns:minmax(0,1fr)}}@container (width<=480px){._totals_10yeb_103{grid-template-columns:minmax(0,1fr)}}
@@ -1 +0,0 @@
1
- var e={page:`_page_10yeb_1`,heading:`_heading_10yeb_7`,scopeNote:`_scopeNote_10yeb_15`,signals:`_signals_10yeb_21`,signalsTitle:`_signalsTitle_10yeb_30`,tabs:`_tabs_10yeb_40`,tab:`_tab_10yeb_40`,tabActive:`_tabActive_10yeb_61`,tabPending:`_tabPending_10yeb_66`,content:`_content_10yeb_71`,hint:`_hint_10yeb_78`,hintLoading:`_hintLoading_10yeb_84`,warning:`_warning_10yeb_93`,totals:`_totals_10yeb_103`,totalsPair:`_totalsPair_10yeb_109`,figureGroup:`_figureGroup_10yeb_113`,figure:`_figure_10yeb_113`,figureLabel:`_figureLabel_10yeb_130`,figureNote:`_figureNote_10yeb_131`,figureTrend:`_figureTrend_10yeb_136`,figureValue:`_figureValue_10yeb_141`,growth:`_growth_10yeb_148`,decline:`_decline_10yeb_152`,blocks:`_blocks_10yeb_156`,note:`_note_10yeb_162`};export{e as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{O as t,T as n,cn as r,dt as i,k as a,ln as o,t as s}from"./cx-CutaZ2Ho.js";import{l as c,p as l}from"./index-CM8tBSED.js";import{r as u,s as d}from"./start-Cm2kfqW8.js";import{t as f}from"./StatsPage.module-DxtnhZOJ.js";var p=e(o(),1),m={panel:`_panel_1n3ez_1`,head:`_head_1n3ez_14`,heading:`_heading_1n3ez_22`,period:`_period_1n3ez_29`,title:`_title_1n3ez_35`},h=r();function g({title:e,period:t,aside:n,children:r}){let i=(0,p.useId)(),a=(0,p.useId)();return(0,h.jsxs)(`section`,{className:m.panel,"aria-labelledby":i,"aria-describedby":t===void 0?void 0:a,children:[(0,h.jsxs)(`div`,{className:m.head,children:[(0,h.jsxs)(`div`,{className:m.heading,children:[(0,h.jsx)(`h2`,{id:i,className:m.title,children:e}),t!==void 0&&(0,h.jsx)(`p`,{id:a,className:m.period,children:t})]}),n]}),r]})}function _(){let{stats:e}=a(),n=t(),r=(t,r)=>e.periodCaption(t,l(n,r.from,r.to)),i=(t,n)=>r(e.periodWindows[t],n);return{of:i,ofGrain:(e,t)=>e===`week`?i(`weeks`,t.weeks):i(`days`,t.days),labelled:r}}var v={muted:`_muted_14ll2_1`,subTitle:`_subTitle_14ll2_7`,rows:`_rows_14ll2_14`,countRow:`_countRow_14ll2_28`,row:`_row_14ll2_14`,rowLabel:`_rowLabel_14ll2_41`,rowValue:`_rowValue_14ll2_58`,wide:`_wide_14ll2_64`,track:`_track_14ll2_68`,fill:`_fill_14ll2_75`,grain:`_grain_14ll2_82`};function y({query:e,empty:t,children:r}){let{stats:o}=a(),{error:c,data:l,isFetching:p}=e,m=l!==void 0,g=c instanceof n&&c.status===404,_=g?null:c,v=c===null&&!m,y=l!==void 0&&t!==void 0&&t.isEmpty(l),b=x(o,c,g,m,y?t.message:null),{status:S,keepFocus:C}=u(b===null&&_===null,i()?.heading);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{ref:S,tabIndex:-1,role:`status`,"aria-live":`polite`,className:b===null&&_===null?`visually-hidden`:s(f.hint,v&&f.hintLoading),children:[b!==null&&(0,h.jsx)(`p`,{children:b}),_!==null&&(0,h.jsx)(d,{error:_,fetching:p,onRetry:()=>{C(),e.refetch()}})]}),!g&&l!==void 0&&!y&&(0,h.jsx)(`div`,{className:f.content,children:r(l)})]})}function b({query:e,children:n}){let{stats:r}=a(),i=t(),o=e.data?.invalidJournalLines??0,s=e.data?.unknownJournalLines??0,c=e.data?.unparsedTasks??0,l=[o>0?r.invalidJournalLines(o):null,s>0?r.unknownJournalLines(s):null,c>0?r.unparsedTasks(c):null].filter(e=>e!==null);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:l.length>0?f.warning:`visually-hidden`,role:`status`,children:l.join(` `)}),(0,h.jsx)(y,{query:e,empty:{isEmpty:e=>e.taskCount===0,message:r.noTasks},children:e=>(0,h.jsxs)(h.Fragment,{children:[n(e),(0,h.jsx)(`p`,{className:f.note,children:S(r,i,e.journalSince)})]})})]})}function x(e,t,n,r,i){return n?e.projectNotFound:t===null?r?i:e.loading:null}function S(e,t,n){return n===null?e.journalEmpty:e.journalSince(c(t,n))}export{g as a,_ as i,b as n,v as r,y as t};
@@ -1 +0,0 @@
1
- ._scroll_14ae0_1{background:linear-gradient(to right, var(--surface-raised) 30%, transparent) left / 24px 100% no-repeat local, linear-gradient(to left, var(--surface-raised) 30%, transparent) right / 24px 100% no-repeat local, radial-gradient(farthest-side at 0 50%, color-mix(in oklch, var(--ink) 35%, transparent), transparent) left / 10px 100% no-repeat scroll, radial-gradient(farthest-side at 100% 50%, color-mix(in oklch, var(--ink) 35%, transparent), transparent) right / 10px 100% no-repeat scroll;overflow-x:auto}._scroll_14ae0_1:focus-visible{outline:2px solid var(--focus-ring);outline-offset:-2px}._table_14ae0_14{border-collapse:collapse;width:100%;font-size:var(--text-sm);font-variant-numeric:tabular-nums}._table_14ae0_14 th,._table_14ae0_14 td{padding:var(--space-1) var(--space-2);border-bottom:1px solid var(--line);text-align:end;white-space:nowrap}._table_14ae0_14 th:first-child,._table_14ae0_14 td:first-child{text-align:start;padding-inline-start:0}._table_14ae0_14 thead th{color:var(--ink-subtle);font-weight:500}._table_14ae0_14 tbody th{color:var(--ink);font-weight:400}._table_14ae0_14 tbody ._child_14ae0_45>*{color:var(--ink-subtle)}._table_14ae0_14 tbody ._total_14ae0_49>*{font-weight:600}
@@ -1 +0,0 @@
1
- import{cn as e,k as t}from"./cx-CutaZ2Ho.js";import{t as n}from"./StatsPage.module-DxtnhZOJ.js";var r=e();function i({repos:e}){let{stats:i}=t();return e.map(e=>(0,r.jsx)(`p`,{className:n.warning,role:`status`,children:i.unavailableRepo(e)},e))}export{i as t};