@wjarka/cezarion 0.16.0-pr1031.1663 → 0.16.0-pr1033.1665
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/web/dist/assets/{compare-variants-C-KqsK-_.js → compare-variants-Cy8_FywW.js} +1 -1
- package/web/dist/assets/{diff-DPsH6DMZ.js → diff-DeZPcfWE.js} +2 -2
- package/web/dist/assets/{diff-view-DIDSDKV4.js → diff-view-CaZBQ6ZX.js} +1 -1
- package/web/dist/assets/{git-toolbar-DxXjcCLH.js → git-toolbar-Ds38hGve.js} +1 -1
- package/web/dist/assets/{github-BECS8PSU.js → github-CDFjNIxb.js} +1 -1
- package/web/dist/assets/{index-B1Uw5ZHq.js → index-TXa1uWzz.js} +4 -4
- package/web/dist/assets/{index-lqkO7pmX.css → index-crA3eQto.css} +1 -1
- package/web/dist/assets/{preview-pane-connected-HhXnjrn_.js → preview-pane-connected-DXT38S9t.js} +1 -1
- package/web/dist/assets/{repo-git-BsTdRUFQ.js → repo-git-C-4zlKFR.js} +1 -1
- package/web/dist/assets/{run-diff-D0I0H-2C.js → run-diff-DejusXm8.js} +1 -1
- package/web/dist/assets/{run-header-CoMGxqGo.js → run-header-CwhJd_5x.js} +1 -1
- package/web/dist/assets/{skills-CDLnkoR_.js → skills-DS7zmR6m.js} +1 -1
- package/web/dist/assets/{task-changes-ffFXrTci.js → task-changes-D93Ul9bn.js} +1 -1
- package/web/dist/assets/{task-commits-DsbRXAHV.js → task-commits-BWwrovRl.js} +1 -1
- package/web/dist/assets/{task-files-C6li65UP.js → task-files-CV9rNubO.js} +1 -1
- package/web/dist/assets/{task-github-item-C06_MbT4.js → task-github-item-BYHN8B46.js} +1 -1
- package/web/dist/assets/{task-thread-CPx8yslg.js → task-thread-BP_BdARh.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-BZlnrtOl.js → use-hand-to-agent-state-nxzzEnrd.js} +1 -1
- package/web/dist/assets/{workflows-ClbmvR8E.js → workflows-BVOi_tNk.js} +1 -1
- package/web/dist/index.html +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wjarka/cezarion",
|
|
3
|
-
"version": "0.16.0-
|
|
3
|
+
"version": "0.16.0-pr1033.1665",
|
|
4
4
|
"description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"zod": "^4.4.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@open-mercato/cezar-api-client": "0.16.0-
|
|
57
|
-
"@open-mercato/cezar-contract": "0.16.0-
|
|
56
|
+
"@open-mercato/cezar-api-client": "0.16.0-pr1033.1665",
|
|
57
|
+
"@open-mercato/cezar-contract": "0.16.0-pr1033.1665",
|
|
58
58
|
"@types/node": "^24.19.1",
|
|
59
59
|
"@types/ws": "^8.18.1",
|
|
60
60
|
"esbuild": "^0.28.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Br as r,Ci as i,F as a,Gt as o,N as s,Xi as c,la as l,t as u}from"./button-Bmy4sD2w.js";import{G as d,K as f,Mn as p,Rt as m,Xn as h,_ as g,a as _,b as v,c as y,i as b,n as x,o as S,qn as C,r as w,rn as T,s as E,sn as D,t as O}from"./alert-dialog-lxIsQu_e.js";import{t as k}from"./utils-D8ErgBN1.js";import{r as A,u as j}from"./format-DXlD46vz.js";import{t as M}from"./search-x-I9Q8pgUa.js";import{B as N,H as P,Jt as F,U as I,V as L,cn as R,dn as z,mt as B}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Br as r,Ci as i,F as a,Gt as o,N as s,Xi as c,la as l,t as u}from"./button-Bmy4sD2w.js";import{G as d,K as f,Mn as p,Rt as m,Xn as h,_ as g,a as _,b as v,c as y,i as b,n as x,o as S,qn as C,r as w,rn as T,s as E,sn as D,t as O}from"./alert-dialog-lxIsQu_e.js";import{t as k}from"./utils-D8ErgBN1.js";import{r as A,u as j}from"./format-DXlD46vz.js";import{t as M}from"./search-x-I9Q8pgUa.js";import{B as N,H as P,Jt as F,U as I,V as L,cn as R,dn as z,mt as B}from"./index-TXa1uWzz.js";import{t as V}from"./run-diff-DejusXm8.js";var H=e(t(),1),U=n();function W(){let{groupId:e}=c(),t=d(e),n=I(f().data),r=l();if((0,H.useEffect)(()=>{e&&r.invalidateQueries({queryKey:v.groups.detail(e)})},[r,e,(m().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,U.jsx)(R,{});if(t.isError){let e=t.error instanceof o&&t.error.status===404;return(0,U.jsx)(`div`,{"data-route":`compare`,className:`task-flow-page flex min-h-full flex-col`,children:(0,U.jsx)(g,{icon:e?(0,U.jsx)(M,{}):(0,U.jsx)(z,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,U.jsx)(u,{asChild:!0,variant:`outline`,children:(0,U.jsx)(A,{to:`/`,children:`Back to tasks`})}),e?null:(0,U.jsx)(u,{variant:`outline`,onClick:()=>void t.refetch(),children:`Retry`})]})})})}return(0,U.jsx)(G,{groupId:e,variants:t.data.runs,showTokens:n.tokens,showCost:n.cost})}function G({groupId:e,variants:t,showTokens:n,showCost:a}){let o=j(),s=l(),[c,u]=(0,H.useState)(null),d=t.every(e=>T.has(e.status)),f=t[0]?p(t[0]):``,m=C({mutationFn:t=>r(e,t),onSuccess:(t,n)=>{s.invalidateQueries({queryKey:v.runs.all}),s.invalidateQueries({queryKey:v.groups.detail(e)}),o(`/tasks/${t.winner?.id??n}`)},onError:e=>i(e.message,{tone:`danger`})});return(0,U.jsxs)(`div`,{"data-route":`compare`,className:`task-flow-page flex w-full flex-col`,children:[(0,U.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,U.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,U.jsx)(z,{className:`size-5 shrink-0 text-accent-icon`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Compare variants`})]}),(0,U.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[f,` · `,t.length,` `,d?`completed variants with distinct committed diffs.`:`variants of the same task, each in its own worktree.`]})]}),d?null:(0,U.jsxs)(`section`,{role:`status`,className:`rounded-xl border border-border bg-card p-5`,children:[(0,U.jsx)(`h2`,{className:`text-lg font-normal`,children:`Variants are still running`}),(0,U.jsx)(`p`,{className:`mt-3 text-[13px] text-muted-foreground`,children:`Compare progress now. Picking a result is disabled until every variant finishes.`})]}),(0,U.jsx)(`div`,{"data-slot":`compare-columns`,className:k(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,U.jsx)(K,{variant:e,allTerminal:d,pickPending:m.isPending,onPick:()=>u(e),showTokens:n,showCost:a},e.id))}),(0,U.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-[22px]`,children:t.map(e=>(0,U.jsx)(q,{variant:e},e.id))}),(0,U.jsx)(O,{open:c!==null,onOpenChange:e=>!e&&u(null),children:(0,U.jsxs)(b,{"data-slot":`variant-confirm-dialog`,children:[(0,U.jsxs)(E,{children:[(0,U.jsxs)(y,{children:[`Pick variant `,c?.variant,`?`]}),(0,U.jsxs)(_,{children:[`Variant `,c?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,U.jsxs)(S,{children:[(0,U.jsx)(w,{children:`Cancel`}),(0,U.jsxs)(x,{"data-slot":`confirm-pick`,onClick:()=>{c&&m.mutate(c.id),u(null)},children:[`Pick variant `,c?.variant]})]})]})})]})}function K({variant:e,allTerminal:t,pickPending:n,onPick:r,showTokens:i,showCost:a}){let o=h(e),c=D(e.costUsd),l=e.inputTokens!==void 0||e.outputTokens!==void 0;return(0,U.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-accent-strong/15 font-mono text-xs font-semibold text-accent-text`,children:e.variant}),(0,U.jsxs)(`span`,{"data-slot":`variant-status`,className:`text-lg font-normal`,children:[`· `,(0,U.jsx)(`span`,{className:`capitalize`,children:o.label})]}),i&&l||a&&c?(0,U.jsxs)(`span`,{"data-slot":`variant-token-metrics`,className:`ml-auto flex shrink-0 items-center gap-1.5 text-[11px] text-soft-foreground`,children:[i?(0,U.jsx)(B,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):null,i&&l&&a&&c?(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`·`}):null,a&&c?(0,U.jsx)(`span`,{className:`font-mono tabular-nums`,children:c}):null]}):null]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,U.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,U.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[13px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,U.jsx)(F,{children:e.handoffExcerpt})}):(0,U.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,U.jsx)(u,{asChild:!0,variant:`outline`,className:`self-start`,children:(0,U.jsx)(A,{to:`/tasks/${e.id}`,children:`Open task`})}),(0,U.jsxs)(u,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,U.jsx)(s,{"aria-hidden":`true`}),`Pick variant `,e.variant]})]})}function q({variant:e}){let[t,n]=(0,H.useState)(!1);return(0,U.jsxs)(N,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,U.jsxs)(P,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,U.jsx)(a,{className:k(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,U.jsx)(L,{children:(0,U.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,U.jsx)(V,{runId:e.id})})})]})}export{W as CompareVariantsRoute};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-D8ErgBN1.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{ht as a}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-CaZBQ6ZX.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/utils-D8ErgBN1.js","assets/bundle-mjs-BT31bpU6.js","assets/index-TXa1uWzz.js","assets/button-Bmy4sD2w.js","assets/src-SvQq1g5A.js","assets/live-protocol-DecAv9sE.js","assets/alert-dialog-lxIsQu_e.js","assets/cez-idle-CUCH2qDt.js","assets/createLucideIcon-BHp8sXmF.js","assets/status-dot-CSSI6gy6.js","assets/nav-row-styles-Dj7dS2DN.js","assets/popover-C5zVHoPD.js","assets/dropdown-menu-DHFIrOOx.js","assets/prompt-templates-DVDthGNW.js","assets/textarea-P-UWly9H.js","assets/preview-state-CeWPfrbj.js","assets/format-DXlD46vz.js","assets/play-CmVAj_fu.js","assets/search-x-I9Q8pgUa.js","assets/square-terminal-B6RYYieR.js","assets/agent-accounts-B1sfGT1I.js","assets/skills-DFBiAuJG.js","assets/chunk-BO2N2NFS-DE6qKn3r.js","assets/lib-BxQXEXDF.js","assets/index-crA3eQto.css","assets/lib-BQXq3kEf.js","assets/image-preview-CFYGlCGg.js","assets/zoomable-image-C4PFgxDI.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-D8ErgBN1.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{ht as a}from"./index-TXa1uWzz.js";import{n as o,t as s}from"./image-preview-CFYGlCGg.js";var c=e(t(),1),l=n();function u(e){let[t,n]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-CaZBQ6ZX.js`).then(t=>{e||n({View:t.DiffView})},()=>{e||n(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:r(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):t===`failed`?(0,l.jsx)(d,{...e}):t===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:r(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(t.View,{...e})}function d({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:r(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:t,imageSrc:n,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:t,imageSrc:n,onOpenInApp:i}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:n,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:r(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
|
|
3
3
|
`).map((e,t)=>(0,l.jsxs)(`span`,{className:r(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},t))})]})}export{u as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-D8ErgBN1.js";import{Qt as i,Xt as a,Zt as o,ht as s,yn as c}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-D8ErgBN1.js";import{Qt as i,Xt as a,Zt as o,ht as s,yn as c}from"./index-TXa1uWzz.js";import{t as l}from"./lib-BQXq3kEf.js";import{n as u,t as d}from"./image-preview-CFYGlCGg.js";var f=e(t(),1),p=44;function m(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
|
|
2
2
|
`),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function h(e){return m(e)*20+p}function g(e){return e.reduce((e,t)=>e+m(t),0)}function _(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function v(e){return`${e.oldPath??``}→${e.path}`}function y(e){let t=0;for(let n of e.split(`
|
|
3
3
|
`))n.length>t&&(t=n.length);return t}var b=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,x=300,S=.3;function C(e,t){if(e===t)return null;let n=e.match(b)??[],r=t.match(b)??[];if(n.length===0||r.length===0||n.length>x||r.length>x)return null;let i=r.length+1,a=new Uint16Array((n.length+1)*i);for(let e=1;e<=n.length;e++)for(let t=1;t<=r.length;t++)a[e*i+t]=n[e-1]===r[t-1]?(a[(e-1)*i+(t-1)]??0)+1:Math.max(a[(e-1)*i+t]??0,a[e*i+(t-1)]??0);if((a[n.length*i+r.length]??0)/Math.max(n.length,r.length)<S)return null;let o=Array(n.length).fill(!1),s=Array(r.length).fill(!1),c=n.length,l=r.length;for(;c>0&&l>0;)n[c-1]===r[l-1]?(o[c-1]=!0,s[l-1]=!0,c--,l--):(a[(c-1)*i+l]??0)>=(a[c*i+(l-1)]??0)?c--:l--;return{del:w(n,o),add:w(r,s)}}function w(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function T(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var E=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,D=`… (patch truncated)`;function O(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
|
|
4
4
|
`);o.at(-1)===``&&o.pop();for(let e of o){let o=E.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(D)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function k(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function A(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function j(e,t){let n=Array(e.length),r=Array(t.length),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=C(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function M(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(j(t,i))}else t(i),r++}}function N(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function P(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var F=n(),I=1500,L=new Map;function R(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function z({files:e,mode:t=`unified`,wrap:n=!1,loadFileText:i,imageSrc:a,onOpenInApp:o,viewRef:c,className:l}){let u=(0,f.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[d,p]=(0,f.useState)(()=>new Set),[m,y]=(0,f.useState)(()=>new Map),b=(0,f.useCallback)(e=>{p(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),x=(0,f.useCallback)(async(e,t)=>{if(!i)return;let n=await i(e.path);if(n===null)return;let r=A(t,n.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{F as r,Ft as i,X as a,nt as o,ot as s,t as c}from"./button-Bmy4sD2w.js";import{n as l,t as u}from"./utils-D8ErgBN1.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{n as f,t as p}from"./diff-controls-sNZ4zSCc.js";import{s as m}from"./popover-C5zVHoPD.js";import{t as h}from"./square-terminal-B6RYYieR.js";import{i as g,p as _,r as v,t as y}from"./dropdown-menu-DHFIrOOx.js";import{ht as b}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{F as r,Ft as i,X as a,nt as o,ot as s,t as c}from"./button-Bmy4sD2w.js";import{n as l,t as u}from"./utils-D8ErgBN1.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{n as f,t as p}from"./diff-controls-sNZ4zSCc.js";import{s as m}from"./popover-C5zVHoPD.js";import{t as h}from"./square-terminal-B6RYYieR.js";import{i as g,p as _,r as v,t as y}from"./dropdown-menu-DHFIrOOx.js";import{ht as b}from"./index-TXa1uWzz.js";var x=d(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),S=d(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),C=e(t(),1),w=n();function T({root:e,selected:t,onSelect:n}){return(0,w.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,w.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,w.jsx)(D,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,w.jsx)(k,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function E({adds:e,dels:t}){return(0,w.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,w.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,w.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function D({dir:e,depth:t,selected:n,onSelect:i}){let[o,s]=(0,C.useState)(!0);return(0,w.jsxs)(`li`,{children:[(0,w.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":o?`open`:`closed`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,w.jsx)(r,{size:16,"aria-hidden":`true`,className:u(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,o&&`rotate-90`)}),(0,w.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,w.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,w.jsx)(E,{adds:e.adds,dels:e.dels})]}),o?(0,w.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,w.jsx)(D,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,w.jsx)(k,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var O={added:`text-success`,deleted:`text-danger`};function k({file:e,depth:t,selected:n,onSelect:r}){let i=n===e.path;return(0,w.jsx)(`li`,{children:(0,w.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":i?`true`:void 0,onClick:()=>r(e.path),className:u(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,i?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,w.jsx)(S,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0`,O[e.status])}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,w.jsx)(E,{adds:e.adds,dels:e.dels})]})})}function A(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function j(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(j)}}var M=(e,t)=>e.name.localeCompare(t.name);function N(e){let t=A(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=A(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(M),e.files.sort(M)};return i(t),{...t,dirs:t.dirs.map(j)}}function P({bar:e,branch:t,stat:n,mode:r,wrap:i,onModeChange:a,onWrapChange:o,onAction:s}){return(0,w.jsxs)(`div`,{"data-slot":`git-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[t?(0,w.jsx)(p,{branch:t}):null,n?(0,w.jsx)(L,{stat:n}):null,(0,w.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,w.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,w.jsx)(f,{mode:r,wrap:i,onModeChange:a,onWrapChange:o})}),e.secondary.map(e=>(0,w.jsx)(I,{action:e,variant:`outline`,onAction:s},e.id)),(0,w.jsx)(I,{action:e.primary,variant:`primary`,onAction:s}),e.menu.length>0?(0,w.jsxs)(y,{children:[(0,w.jsx)(_,{asChild:!0,children:(0,w.jsx)(c,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,w.jsx)(x,{"aria-hidden":`true`})})}),(0,w.jsx)(v,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,w.jsxs)(g,{disabled:!e.enabled,title:e.reason,onSelect:()=>s(e.id),children:[F[e.id],e.label]},e.id))})]}):null]})]})}var F={commit:(0,w.jsx)(o,{size:16,"aria-hidden":`true`}),push:(0,w.jsx)(i,{size:16,"aria-hidden":`true`}),"create-pr":(0,w.jsx)(s,{size:16,"aria-hidden":`true`}),"view-pr":(0,w.jsx)(m,{"aria-hidden":`true`}),"open-terminal":(0,w.jsx)(h,{"aria-hidden":`true`})};function I({action:e,variant:t,onAction:n}){return e.id===`view-pr`?l(e.href)?(0,w.jsx)(c,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,w.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[F[e.id],e.label]})}):(0,w.jsxs)(c,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[F[e.id],e.label]}):(0,w.jsxs)(c,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[F[e.id],e.label]})}function L({stat:e}){return(0,w.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,w.jsx)(b,{stat:{adds:R(e.adds),dels:R(e.dels),files:e.files}})})}function R(e){let[t,n]=(0,C.useState)(e),r=(0,C.useRef)(e);return(0,C.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{T as i,P as n,N as r,L as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Bn as r,Ci as i,Ct as a,D as o,Jr as s,Ln as c,N as l,P as u,Pt as ee,R as te,St as ne,Xi as re,Zi as ie,_a as ae,la as oe,ot as se,st as d,t as f,zn as ce}from"./button-Bmy4sD2w.js";import"./src-SvQq1g5A.js";import{B as le,D as ue,H as de,Hn as p,K as fe,Rn as m,W as pe,Xn as h,_ as g,b as _,lt as me,qn as he,qt as ge,z as _e}from"./alert-dialog-lxIsQu_e.js";import{s as ve,t as v}from"./utils-D8ErgBN1.js";import{t as y}from"./status-dot-CSSI6gy6.js";import{l as ye,n as b}from"./nav-row-styles-Dj7dS2DN.js";import{i as be,r as x,t as S}from"./popover-C5zVHoPD.js";import{c as xe,f as Se,m as C,p as Ce,u as w}from"./prompt-templates-DVDthGNW.js";import{a as we,f as Te,n as Ee,r as De}from"./format-DXlD46vz.js";import{t as Oe}from"./tab-link-BpUy4LYZ.js";import{A as ke,a as Ae,bn as je,c as Me,d as Ne,f as Pe,h as Fe,i as Ie,l as Le,m as Re,n as ze,o as Be,p as Ve,r as He,s as Ue,sn as We,t as Ge,u as Ke,yn as qe}from"./index-B1Uw5ZHq.js";import{a as Je,d as Ye,f as Xe,i as Ze,l as Qe,n as $e,o as et,r as tt,s as nt,t as rt,u as it}from"./use-hand-to-agent-state-BZlnrtOl.js";var T=e(t(),1),E=`cez-github-list-width`;function D(e){if(e==null||e===``||typeof e==`string`&&e.trim()===``)return 360;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(520,Math.max(280,Math.round(t))):360}function at(){try{let e=localStorage.getItem(E);return e===null?360:D(e)}catch{return 360}}function ot(e){try{localStorage.setItem(E,String(D(e)))}catch{}}var O=n();function st({number:e,repo:t}){let n=ve();return(0,O.jsx)(ct,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function ct({number:e,repo:t,scope:n}){let r=(0,T.useId)(),i=(0,T.useId)(),[a,o]=(0,T.useState)(!1),s=a?je:qe,c=me(n,!0,n==="default"),l=ue(`#${e}`,!0),u=(0,T.useMemo)(()=>Pe(p(c.data??[],l.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[c.data,l.data,e,t,n]);return(0,O.jsxs)(`section`,{"aria-labelledby":r,className:`mt-4 min-w-0 rounded-lg border border-border p-3`,children:[(0,O.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,O.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":i,onClick:()=>o(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,O.jsx)(s,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,O.jsxs)(`span`,{children:[`Linked tasks`,c.data?` (${u.length}${l.hasNextPage||l.isError?`+`:``})`:``]})]})}),(0,O.jsx)(`div`,{id:i,children:a?(0,O.jsxs)(O.Fragment,{children:[c.isPending?(0,O.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,c.isError?(0,O.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,O.jsx)(f,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void c.refetch(),disabled:c.isFetching,children:`Retry linked tasks`})]}):null,c.data&&u.length===0&&!c.isError?(0,O.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,u.length>0?(0,O.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:u.map(e=>{let t=h(e);return(0,O.jsx)(`li`,{children:(0,O.jsxs)(De,{to:`/tasks/${encodeURIComponent(e.id)}`,className:`flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-2 py-2 hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,O.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:m(e)}),(0,O.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,O.jsx)(y,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,O.jsx)(`span`,{className:`rounded border border-border px-1`,children:`Archived`}):null,(0,O.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,l.isError?(0,O.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,O.jsx)(f,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void l.refetch(),disabled:l.isFetching,children:`Retry older linked tasks`})]}):l.hasNextPage?(0,O.jsx)(f,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void l.fetchNextPage(),disabled:l.isFetchingNextPage,children:l.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var lt=`w-44 max-w-full`,k=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm text-foreground focus-visible:outline-ring disabled:opacity-50`;function ut({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,T.useState)(!1),s=(0,T.useRef)(null),c=(0,T.useRef)(null),l=(0,T.useRef)(null),te=(0,T.useRef)(null),re=new Map;for(let t of e.issues)for(let e of t.assignees??[])re.set(e.toLowerCase(),e);for(let e of t)re.set(e.toLowerCase(),e);let ie=[...re.values()].sort((e,t)=>e.localeCompare(t)),ae=!!e.viewerLogin&&t.length===1&&t[0]?.toLowerCase()===e.viewerLogin.toLowerCase(),oe=` Previous memberships are shown; issues with unknown membership remain visible.`,se=e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${oe}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${oe}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`),d=[e.viewerLogin?``:`GitHub login unavailable.`,se].filter(Boolean).join(` `),f=d!==``,ce=(0,T.useRef)(d);f&&(ce.current=d);let le=(0,T.useRef)(!f);le.current=!f;let ue=()=>(l.current&&!l.current.disabled?l.current:te.current)?.focus();return(0,T.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{le.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&ue()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,T.useEffect)(()=>{if(f)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&ue()},[f]),(0,O.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,O.jsxs)(S,{children:[(0,O.jsx)(be,{asChild:!0,children:(0,O.jsxs)(`button`,{type:`button`,className:k,disabled:ie.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,O.jsx)(u,{size:12,"aria-hidden":`true`,className:`ml-1 inline size-3 shrink-0 align-[-1px] text-soft-foreground`})]})}),(0,O.jsx)(x,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,O.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,O.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),ie.map(e=>{let n=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,O.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:n,onChange:()=>r(n?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,O.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]}),(0,O.jsx)(`button`,{ref:te,type:`button`,className:`${k} aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":ae,onClick:()=>r(ae?[]:[e.viewerLogin]),children:`Assigned to me`}),e.projects?.length?(0,O.jsxs)(`select`,{ref:l,"aria-label":`Project board`,className:`${k} ${lt}`,value:n,onChange:e=>i(e.target.value),children:[(0,O.jsx)(`option`,{value:``,children:`All boards`}),e.projects.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.title},e.id))]}):e.projects||e.projectsState?(0,O.jsx)(`select`,{ref:l,"aria-label":`Project board`,className:`${k} ${lt}`,disabled:!0,value:``,children:(0,O.jsx)(`option`,{value:``,children:e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`})}):null,(0,O.jsx)(`p`,{role:`status`,className:`sr-only`,children:d}),(0,O.jsxs)(S,{open:a,onOpenChange:o,children:[(0,O.jsx)(be,{asChild:!0,children:(0,O.jsx)(`button`,{ref:s,type:`button`,className:`${k} inline-flex items-center justify-center ${d?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:d?void 0:-1,children:e.projectsState===`refreshing`?(0,O.jsx)(ne,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,O.jsx)(ee,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,O.jsx)(x,{ref:c,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{f||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:d||ce.current})]})]})}function dt({onRefresh:e,refreshing:t}){let n=Ge(ve());return(0,O.jsxs)(`div`,{"data-route":`github`,"data-slot":`github-filter-screen`,className:b,children:[(0,O.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,O.jsx)(`h1`,{className:v(ye,`min-w-0 flex-1`),children:`GitHub`}),(0,O.jsx)(`button`,{type:`button`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,O.jsx)(ne,{size:17,"aria-hidden":`true`,className:v(`size-[17px]`,t&&`motion-safe:animate-spin`)})})]}),(0,O.jsx)(ze,{model:n,variant:`screen`})]})}var ft=Ae,pt=100,mt=350;function ht({width:e,onWidthChange:t}){let n=(0,T.useRef)(null),r=t=>{t.button===0&&(n.current={x:t.clientX,width:e},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault(),t.currentTarget.focus())},i=e=>{let r=n.current;r&&t(D(r.width+(e.clientX-r.x)))},a=e=>{n.current&&(n.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,O.jsx)(`div`,{"data-slot":`gh-list-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the GitHub list`,"aria-valuenow":e,"aria-valuemin":280,"aria-valuemax":520,tabIndex:0,onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a,onKeyDown:n=>{let r=n.key===`ArrowLeft`?e-16:n.key===`ArrowRight`?e+16:n.key===`Home`?280:n.key===`End`?520:null;r!==null&&(n.preventDefault(),t(D(r)))},onDoubleClick:()=>t(360),title:`Drag to resize the GitHub list — double-click to reset`,className:`absolute inset-y-0 -right-[2px] z-20 hidden w-[5px] cursor-col-resize touch-none bg-transparent transition-colors hover:bg-accent-strong/40 focus-visible:bg-accent-strong/60 focus-visible:outline-none md:block`})}function gt(e,t){let[n,r]=(0,T.useState)(e);return(0,T.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function A({view:e,changes:t=!1,index:n=!1}){let{n:l}=re(),[u,ue]=ie(),p=ke(),m=u.get(`filter`),h=Ve(e,m),y=h??`all`,ye=e=>ue(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n},{replace:!0}),b=_e({limit:ft}),be=fe().data?.capabilities?.automations===!0,x=b.data,S=oe(),xe=e=>{S.setQueryData(_.uiState,t=>({...t,githubView:e})),s({githubView:e}).then(e=>S.setQueryData(_.uiState,e)).catch(e=>{i(e instanceof Error?e.message:String(e),{tone:`danger`}),S.invalidateQueries({queryKey:_.uiState})})},Se=(0,T.useRef)(null),C=(0,T.useRef)(null),Ce=e=>e?r(e.kind,e.number,{refresh:!0}).then(t=>(S.setQueryData(e.key,t),!0)).catch(()=>!1):Promise.resolve(!0),w=he({mutationFn:e=>(Ce(e),c({refresh:!0,limit:ft})),onSuccess:t=>{S.setQueryData(_.github({limit:ft}),t),S.invalidateQueries({queryKey:_.githubChecks(sn)}),S.invalidateQueries({queryKey:_.githubSearch(e===`issues`?`issue`:`pr`,z)}),S.invalidateQueries({queryKey:_.githubSearch(`pr`,Me)}),S.invalidateQueries({queryKey:_.githubSearch(`pr`,Ie)});let n=Se.current;if(!n){S.removeQueries({queryKey:[`github`,`comments`]});return}let r=_.githubComments(n.kind,n.number);ce(n.kind,n.number,{refresh:!0}).then(e=>S.setQueryData(r,e)).catch(()=>{}),S.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==ae(r)})},onError:e=>i(e.message,{tone:`danger`})}),{workflows:Ae,skillList:je,workflow:Pe,setWorkflow:ze,selectedSkills:Ge,setSelectedSkills:qe,engine:Je,setEngine:Ye,queued:Ze,onQueued:tt}=rt(),nt=ge(),[E,ct]=(0,T.useState)(at),[lt,k]=(0,T.useState)(!0),[A,xt]=(0,T.useState)(!1),St=(0,T.useRef)(null),Ct=(0,T.useRef)(null),wt=e=>{let t=D(e);ct(t),ot(t)},Tt=n&&!p&&m===null&&l===void 0,Et=b.data?.available===!0&&!Tt;(0,T.useEffect)(()=>{if(!Et)return;let e=St.current,t=Ct.current,n=e?.closest(`[data-slot="main"]`);if(!e||!t||!n)return;let r=window.matchMedia(`(min-width: 768px)`),i=!1,a=()=>{if(i=r.matches&&t.clientWidth>=E+22+360,k(!i),!i||n.clientHeight<1){e.style.removeProperty(`--gh-workspace-height`);return}e.style.setProperty(`--gh-workspace-height`,`${Math.round(n.clientHeight)}px`)};a();let o=new ResizeObserver(a);o.observe(n),o.observe(t);let s=e=>{if(!i||e.ctrlKey||!e.deltaY||Math.abs(e.deltaX)>Math.abs(e.deltaY)||t.getBoundingClientRect().top<=n.getBoundingClientRect().top+1||!(e.target instanceof Element)||!e.target.closest(`[data-slot="gh-panes"]`))return;e.preventDefault();let r=e.deltaMode===1?16:e.deltaMode===2?n.clientHeight:1;n.scrollTop+=e.deltaY*r};return t.addEventListener(`wheel`,s,{passive:!1}),r.addEventListener(`change`,a),()=>{t.removeEventListener(`wheel`,s),o.disconnect(),r.removeEventListener(`change`,a)}},[Et,E]);let[j,Dt]=(0,T.useState)(``),[M,Ot]=(0,T.useState)([]),[kt,At]=(0,T.useState)([]),[jt,Mt]=(0,T.useState)(``),Nt=x?.projectsState===`refreshing`||x?.projectsState===`unavailable`,N=Nt||x?.projects?.some(e=>e.id===jt)?jt:``;(0,T.useEffect)(()=>{x&&!Nt&&jt&&!N&&Mt(``)},[x,jt,N,Nt]);let Pt=e===`issues`&&y===`assigned`,P=Pt?x?.viewerLogin?[x.viewerLogin]:[]:kt,Ft=e=>{At(e),Pt&&ye(`all`)},It=()=>{Dt(``),Ot([]),At([]),Mt(``),h!==null&&h!==`all`&&ye(`all`)},Lt=ve(),Rt=e===`issues`&&(y===`no-task`||y===`has-task`),zt=me(Lt,Rt,Lt==="default"),F=(0,T.useMemo)(()=>zt.data?Ne(zt.data,x?.repo,Lt):null,[zt.data,x?.repo,Lt]),I=Ke(e,h)?Fe(h):null,L=pe(`pr`,I??``,I!==null&&x?.available===!0),R=I!==null&&L.data?.available?L.data.items:null,z=gt(j,mt),B=(0,T.useMemo)(()=>x?.available?e===`issues`?x.issues:x.prs:[],[x,e]),V=(0,T.useMemo)(()=>R?Re(R,B):null,[R,B]),H=x?.available?(Pt||e===`prs`&&y===`mine`)&&!x.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:Rt&&!F?zt.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:I!==null&&!R?L.data?.available===!1?{kind:`blocked`,message:`GitHub could not be searched: ${L.data.reason??`unknown reason`}.`}:L.isError?{kind:`blocked`,message:`GitHub could not be searched: ${L.error instanceof Error?L.error.message:`the search request failed`}.`}:{kind:`loading`,message:`Searching GitHub…`}:null:null,Bt=(0,T.useMemo)(()=>H?[]:V??B,[H,V,B]),Vt=(0,T.useMemo)(()=>e===`issues`?y===`no-task`&&F?{excludeNumbers:F}:y===`has-task`&&F?{includeNumbers:F}:{}:y===`mine`&&x?.viewerLogin?{author:x.viewerLogin}:R?{includeNumbers:new Set(R.map(e=>e.number))}:{},[e,y,F,x?.viewerLogin,R]),Ht=(0,T.useMemo)(()=>it(Bt,{query:z,labels:M,...Vt,...e===`issues`?{assignees:P,projectId:N}:{}}),[Bt,z,M,e,P,N,Vt]),Ut=j.trim()===z.trim(),U=x?.available===!0&&!H&&Ut&&Xe(z,Ht),W=pe(e===`issues`?`issue`:`pr`,z,U),Wt=Bt,G=it(Wt,{query:j,labels:M,...Vt,...e===`issues`?{assignees:P,projectId:N}:{}}),Gt=e===`issues`&&l!==void 0&&!A,Kt=j.trim()!==``||M.length>0||e===`issues`&&(P.length>0||N!==``)||h!==null&&h!==`all`,K=U&&W.data?.available?W.data:null,qt=new Set(G.map(e=>e.number)),Jt=e===`issues`&&K?N&&K.items.some(e=>e.projectIds===void 0)?K.projectsReason??`Project board data is incomplete. Refresh to try again.`:P.length&&K.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null,q=K&&!Jt?it(K.items,{labels:M,...Vt,...e===`issues`?{assignees:P,projectId:N}:{}}).filter(e=>!qt.has(e.number)):[],Yt=_.github()[0],J=l===void 0?null:Number.parseInt(l,10),Xt=!H&&W.data?.available?W.data.items.find(e=>e.number===J):void 0,Zt=V&&J!==null&&!B.some(e=>e.number===J)?V.find(e=>e.number===J):void 0,Qt=Xt??Zt,[Y,$t]=(0,T.useState)(null);(0,T.useEffect)(()=>{Qt&&$t({scope:Yt,view:e,item:Qt})},[Yt,e,Qt]);let en=Qt??(Y?.scope===Yt&&Y.view===e&&Y.item.number===J?Y.item:null),tn=e===`issues`?`issue`:`pr`,X=x?.available===!0&&J!==null&&Number.isSafeInteger(J)&&J>0&&!B.some(e=>e.number===J)&&!V?.some(e=>e.number===J)&&en===null,Z=de(tn,J??0,X),nn=X&&Z.data?.available&&Z.data.item?.kind===tn?Z.data.item:null;C.current=X&&J!==null?{kind:tn,number:J,key:_.githubItem(tn,J)}:null;let[rn,an]=(0,T.useState)(!1),on=()=>{an(!0),Ce(C.current).then(e=>{an(!1),e||i(`Could not reach GitHub for #${J}`,{tone:`danger`})})},sn=(()=>{if(!x?.available||e!==`prs`)return[];let t=new Set;J!==null&&Number.isInteger(J)&&t.add(J);for(let e of[...q,...Bt,...x.prs]){if(t.size>=pt)break;t.add(e.number)}return[...t]})(),cn=le(sn,e===`prs`),ln=cn.data?.available?cn.data.checks:void 0;if(n&&p&&m===null&&nt.data?.githubView===`prs`)return(0,O.jsx)(we,{to:`/github/prs`,replace:!0});if(!x)return b.isError?(0,O.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,O.jsx)(g,{icon:(0,O.jsx)(ee,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:b.error.message})}):(0,O.jsx)(We,{});if(Se.current=null,Tt&&x.available)return(0,O.jsx)(dt,{onRefresh:()=>w.mutate(C.current),refreshing:w.isPending});if(!x.available)return(0,O.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,O.jsx)(g,{icon:(0,O.jsx)(d,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:x.reason??`unknown reason`,actions:(0,O.jsx)(f,{variant:`outline`,"data-action":`gh-retry`,disabled:w.isPending,onClick:()=>w.mutate(C.current),children:`Try again`}),children:(0,O.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,O.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,O.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in cezar works without it.`]})})});let un=j.trim()!==``&&!Ut||U&&W.isPending,dn={...K?.labelColors??{},...x.labelColors??{}},fn=Qe([...Wt,...B,...K?.items??[]]),Q=l===void 0?null:Number.parseInt(l,10),$=Q===null?G[0]??q[0]??null:B.find(e=>e.number===Q)??V?.find(e=>e.number===Q)??en??nn??null;Se.current=$?{kind:$.kind,number:$.number}:null;let pn=m===null?null:y,mn=Le(e,pn??(e===`issues`&&!p?`all`:null)),hn=U&&(W.data?.available===!1||W.isError),gn=W.data?.available===!1?W.data.reason??`unknown reason`:W.error instanceof Error?W.error.message:`the search request failed`,_n=H?(0,O.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":H.kind,children:[H.kind===`loading`?(0,O.jsx)(Te,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,H.message]}):Kt?un?(0,O.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,O.jsx)(Te,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,j.trim(),`”…`]}):hn?q.length>0?(0,O.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,gn,`. Use Refresh to try again.`]}):G.length>0?(0,O.jsxs)(`p`,{children:[`GitHub could not be searched: `,gn,`.`]}):(0,O.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter, and GitHub could not be searched: `,gn,`.`]}):Jt?(0,O.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,Jt]}):q.length>0?null:K?.truncated?(0,O.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):K&&G.length>0?(0,O.jsxs)(`p`,{children:[`No additional `,e===`issues`?`issues`:`pull requests`,` match your filter on GitHub.`]}):K?(0,O.jsxs)(`p`,{children:[`No `,e===`issues`?`issues`:`pull requests`,` match your filter — open, closed or merged.`]}):(0,O.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter.`]}):(0,O.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,`.`]});return(0,O.jsxs)(`div`,{ref:St,"data-route":`github`,className:`flex min-h-full flex-col gap-3 px-[18px] pt-[18px] pb-[calc(90px+env(safe-area-inset-bottom))] md:gap-[22px] md:px-7 md:pt-4 md:pb-4`,children:[(0,O.jsxs)(`div`,{"data-slot":`gh-masthead`,className:`flex min-w-0 shrink-0 flex-col gap-1 md:flex-row md:items-baseline md:gap-3`,children:[(0,O.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[15px] md:tracking-normal`,children:p?`${e===`issues`?`Issues`:`Pull requests`} · ${He[y]}`:`GitHub`}),m!==null&&l===void 0?(0,O.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`flex min-w-0 items-center gap-3 md:hidden`,children:[(0,O.jsxs)(De,{to:`/github`,"data-slot":`gh-back-filters`,className:`inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,O.jsx)(o,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),y===`all`?null:(0,O.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-soft-foreground`,children:[...Be,...Ue].find(e=>e.id===y)?.label})]}):null,x.repo?(0,O.jsxs)(`span`,{className:`min-w-0 truncate text-[13px] text-muted-foreground md:text-[11px] md:text-soft-foreground`,children:[(0,O.jsx)(`span`,{"data-slot":`gh-repo`,children:x.repo}),(0,O.jsxs)(`span`,{"data-slot":`gh-synced`,children:[` · `,x.syncedAt?`Synced ${Ee(x.syncedAt)} ago`:`Not synced yet`]})]}):null]}),(0,O.jsxs)(`div`,{ref:Ct,"data-slot":`gh-workspace`,"data-stacked":lt,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 md:h-[calc(var(--gh-workspace-height,calc(100dvh-4rem))-1rem)] md:flex-none md:gap-[22px]`,children:[(0,O.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-[22px]`,children:[(0,O.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,O.jsxs)(Oe,{to:p?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>xe(`issues`),children:[`Issues · `,vt(x.issues.length)]}),(0,O.jsxs)(Oe,{to:`/github/prs`,active:e===`prs`,onClick:()=>xe(`prs`),children:[`Pull requests · `,vt(x.prs.length)]}),be?(0,O.jsx)(De,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,O.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:w.isPending,onClick:()=>w.mutate(C.current),className:`gh-utility`,children:[(0,O.jsx)(ne,{size:16,"aria-hidden":`true`,className:v(`size-3.5`,w.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,O.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2.5`,children:[(0,O.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,O.jsx)(a,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,O.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:j,onChange:e=>Dt(e.target.value),className:`min-h-11 w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,O.jsx)(bt,{options:fn,colors:dn,selected:M,onChange:Ot}),e===`issues`?(0,O.jsx)(ut,{data:{...x,issues:[...x.issues,...K?.items??[]]},assignees:P,projectId:N,onAssigneesChange:Ft,onProjectChange:Mt}):null,(0,O.jsx)(`button`,{type:`button`,disabled:!Kt,className:`min-h-11 min-w-11 rounded-md border border-border bg-card px-4 text-xs disabled:opacity-50`,onClick:It,children:`Clear filters`})]})]}),(0,O.jsxs)(`div`,{"data-slot":`gh-panes`,className:`flex min-h-0 min-w-0 flex-1 flex-col items-start gap-[22px] md:flex-row md:items-stretch md:overflow-hidden`,children:[(0,O.jsxs)(`section`,{"data-slot":`gh-list`,"data-mobile-preview":Gt||void 0,style:{"--github-list-width":`${E}px`},className:`relative flex w-full min-h-0 min-w-0 flex-col rounded-lg border border-border bg-card p-3 md:w-[var(--github-list-width)] md:shrink-0 md:overflow-x-hidden md:overflow-y-auto`,children:[G.length===0?_n&&(0,O.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:_n}):(0,O.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-1`,children:G.map((t,n)=>(0,O.jsx)(yt,{item:t,view:e,filter:pn,colors:dn,active:$?.url===t.url,compactHidden:Gt&&n>=2&&$?.url!==t.url,queued:Ze.has(t.url),checks:t.kind===`pr`?ln?.[t.number]??t.checks:t.checks},t.url))}),I!==null&&L.data?.available&&L.data.truncated?(0,O.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-soft-foreground`,children:[`Showing the first `,L.data.items.length,` matches from GitHub search; more may exist.`]}):null,e===`issues`&&l!==void 0&&G.length>2?(0,O.jsx)(f,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":A,onClick:()=>xt(e=>!e),children:A?`Show fewer issues`:`View all ${G.length} issues`}):null,G.length>0&&U&&_n?(0,O.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-soft-foreground`,children:_n}):null,q.length>0?(0,O.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,O.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,K?.truncated?` (first matches)`:``]}),(0,O.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:q.map(t=>(0,O.jsx)(yt,{item:t,view:e,filter:pn,colors:dn,active:$?.url===t.url,queued:Ze.has(t.url),checks:t.kind===`pr`?ln?.[t.number]??t.checks:t.checks},t.url))})]}):null,(0,O.jsx)(ht,{width:E,onWidthChange:wt})]}),(0,O.jsx)(`section`,{"data-slot":`gh-detail`,className:v(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-border bg-card md:overflow-y-auto`,l===void 0?`hidden md:flex`:`flex`),children:$?(0,O.jsx)(et,{item:$,afterHeading:$.kind===`issue`?(0,O.jsx)(st,{number:$.number,repo:x.repo},l??`list`):void 0,backLink:{to:mn},subNav:{filter:pn,changes:t},onRunAgent:_t,colors:dn,checks:$.kind===`pr`?ln?.[$.number]??$.checks:$.checks,children:(0,O.jsx)($e,{item:$,workflows:Ae.data?.workflows??[],skills:je,workflow:Pe,onWorkflowChange:ze,selectedSkills:Ge,onSkillsChange:qe,engine:Je,onEngineChange:Ye,queuedRunId:Ze.get($.url)??null,onQueued:tt},$.url)}):X&&Z.isPending?(0,O.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex min-h-full flex-1 flex-col`,children:(0,O.jsx)(g,{icon:(0,O.jsx)(Te,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${J}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):X&&(Z.isError||Z.data?.available===!1)?(0,O.jsx)(g,{icon:(0,O.jsx)(ee,{size:16}),tone:Z.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${J}`,subtitle:Z.data?.available===!1?Z.data.reason:Z.error instanceof Error?Z.error.message:`The request failed.`,actions:(0,O.jsx)(f,{variant:`outline`,disabled:rn,onClick:on,children:`Retry`})}):(0,O.jsx)(g,{icon:e===`issues`?(0,O.jsx)(te,{size:16}):(0,O.jsx)(se,{size:16}),tone:`neutral`,heading:`h2`,title:Q===null?`Nothing selected`:`Not found`,subtitle:Q===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${Q} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${Q} above to look it up on GitHub, closed and merged included.`})})]})]})]})}function _t(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}function vt(e){return`${e}${e>=ft?`+`:``}`}function yt({item:e,view:t,filter:n,colors:r,active:i,compactHidden:a,queued:o,checks:s}){let c=e.kind===`issue`?te:se,l=oe(),u=()=>{l.prefetchQuery({queryKey:_.githubComments(e.kind,e.number),queryFn:({signal:t})=>ce(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,O.jsx)(`li`,{"data-compact-hidden":a||void 0,children:(0,O.jsxs)(De,{to:Le(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,tt(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:u,onFocus:u,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":i?`page`:void 0,title:`Drag into the composer to prefill a task`,className:v(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,i&&`bg-accent-strong/10 text-accent-text`),children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,O.jsx)(c,{"aria-hidden":`true`,className:v(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,O.jsx)(`span`,{className:v(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,i&&`font-semibold`),children:e.title})]}),(0,O.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 pl-[22px] font-mono text-[11px] text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,O.jsxs)(`span`,{children:[`#`,e.number]}),(0,O.jsx)(`span`,{className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,O.jsx)(`span`,{children:Ee(e.createdAt)}),(0,O.jsx)(Je,{count:e.comments}),s?(0,O.jsx)(Ze,{checks:s}):null,o?(0,O.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-accent-text`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,O.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,O.jsx)(nt,{label:e,color:r[e],plain:!0},e))}):null]})})}function bt({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,T.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,O.jsxs)(S,{open:i,onOpenChange:a,children:[(0,O.jsx)(be,{asChild:!0,children:(0,O.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:v(`flex min-h-11 min-w-11 shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,O.jsx)(u,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`})]})}),(0,O.jsx)(x,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,O.jsxs)(xe,{children:[(0,O.jsx)(Se,{placeholder:`Filter labels…`}),(0,O.jsxs)(C,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,O.jsx)(w,{children:`No labels.`}),n.length>0?(0,O.jsxs)(Ce,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,O.jsxs)(Ce,{value:e,onSelect:()=>o(e),className:`min-h-11`,children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:Ye(t[e])}),(0,O.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,O.jsx)(l,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{A as GithubRoute};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Bn as r,Ci as i,Ct as a,D as o,Jr as s,Ln as c,N as l,P as u,Pt as ee,R as te,St as ne,Xi as re,Zi as ie,_a as ae,la as oe,ot as se,st as d,t as f,zn as ce}from"./button-Bmy4sD2w.js";import"./src-SvQq1g5A.js";import{B as le,D as ue,H as de,Hn as p,K as fe,Rn as m,W as pe,Xn as h,_ as g,b as _,lt as me,qn as he,qt as ge,z as _e}from"./alert-dialog-lxIsQu_e.js";import{s as ve,t as v}from"./utils-D8ErgBN1.js";import{t as y}from"./status-dot-CSSI6gy6.js";import{l as ye,n as b}from"./nav-row-styles-Dj7dS2DN.js";import{i as be,r as x,t as S}from"./popover-C5zVHoPD.js";import{c as xe,f as Se,m as C,p as Ce,u as w}from"./prompt-templates-DVDthGNW.js";import{a as we,f as Te,n as Ee,r as De}from"./format-DXlD46vz.js";import{t as Oe}from"./tab-link-BpUy4LYZ.js";import{A as ke,a as Ae,bn as je,c as Me,d as Ne,f as Pe,h as Fe,i as Ie,l as Le,m as Re,n as ze,o as Be,p as Ve,r as He,s as Ue,sn as We,t as Ge,u as Ke,yn as qe}from"./index-TXa1uWzz.js";import{a as Je,d as Ye,f as Xe,i as Ze,l as Qe,n as $e,o as et,r as tt,s as nt,t as rt,u as it}from"./use-hand-to-agent-state-nxzzEnrd.js";var T=e(t(),1),E=`cez-github-list-width`;function D(e){if(e==null||e===``||typeof e==`string`&&e.trim()===``)return 360;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(520,Math.max(280,Math.round(t))):360}function at(){try{let e=localStorage.getItem(E);return e===null?360:D(e)}catch{return 360}}function ot(e){try{localStorage.setItem(E,String(D(e)))}catch{}}var O=n();function st({number:e,repo:t}){let n=ve();return(0,O.jsx)(ct,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function ct({number:e,repo:t,scope:n}){let r=(0,T.useId)(),i=(0,T.useId)(),[a,o]=(0,T.useState)(!1),s=a?je:qe,c=me(n,!0,n==="default"),l=ue(`#${e}`,!0),u=(0,T.useMemo)(()=>Pe(p(c.data??[],l.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[c.data,l.data,e,t,n]);return(0,O.jsxs)(`section`,{"aria-labelledby":r,className:`mt-4 min-w-0 rounded-lg border border-border p-3`,children:[(0,O.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,O.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":i,onClick:()=>o(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,O.jsx)(s,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,O.jsxs)(`span`,{children:[`Linked tasks`,c.data?` (${u.length}${l.hasNextPage||l.isError?`+`:``})`:``]})]})}),(0,O.jsx)(`div`,{id:i,children:a?(0,O.jsxs)(O.Fragment,{children:[c.isPending?(0,O.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,c.isError?(0,O.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,O.jsx)(f,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void c.refetch(),disabled:c.isFetching,children:`Retry linked tasks`})]}):null,c.data&&u.length===0&&!c.isError?(0,O.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,u.length>0?(0,O.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:u.map(e=>{let t=h(e);return(0,O.jsx)(`li`,{children:(0,O.jsxs)(De,{to:`/tasks/${encodeURIComponent(e.id)}`,className:`flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-2 py-2 hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,O.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:m(e)}),(0,O.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,O.jsx)(y,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,O.jsx)(`span`,{className:`rounded border border-border px-1`,children:`Archived`}):null,(0,O.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,l.isError?(0,O.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,O.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,O.jsx)(f,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void l.refetch(),disabled:l.isFetching,children:`Retry older linked tasks`})]}):l.hasNextPage?(0,O.jsx)(f,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void l.fetchNextPage(),disabled:l.isFetchingNextPage,children:l.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var lt=`w-44 max-w-full`,k=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm text-foreground focus-visible:outline-ring disabled:opacity-50`;function ut({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,T.useState)(!1),s=(0,T.useRef)(null),c=(0,T.useRef)(null),l=(0,T.useRef)(null),te=(0,T.useRef)(null),re=new Map;for(let t of e.issues)for(let e of t.assignees??[])re.set(e.toLowerCase(),e);for(let e of t)re.set(e.toLowerCase(),e);let ie=[...re.values()].sort((e,t)=>e.localeCompare(t)),ae=!!e.viewerLogin&&t.length===1&&t[0]?.toLowerCase()===e.viewerLogin.toLowerCase(),oe=` Previous memberships are shown; issues with unknown membership remain visible.`,se=e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${oe}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${oe}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`),d=[e.viewerLogin?``:`GitHub login unavailable.`,se].filter(Boolean).join(` `),f=d!==``,ce=(0,T.useRef)(d);f&&(ce.current=d);let le=(0,T.useRef)(!f);le.current=!f;let ue=()=>(l.current&&!l.current.disabled?l.current:te.current)?.focus();return(0,T.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{le.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&ue()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,T.useEffect)(()=>{if(f)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&ue()},[f]),(0,O.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,O.jsxs)(S,{children:[(0,O.jsx)(be,{asChild:!0,children:(0,O.jsxs)(`button`,{type:`button`,className:k,disabled:ie.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,O.jsx)(u,{size:12,"aria-hidden":`true`,className:`ml-1 inline size-3 shrink-0 align-[-1px] text-soft-foreground`})]})}),(0,O.jsx)(x,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,O.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,O.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),ie.map(e=>{let n=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,O.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:n,onChange:()=>r(n?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,O.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]}),(0,O.jsx)(`button`,{ref:te,type:`button`,className:`${k} aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":ae,onClick:()=>r(ae?[]:[e.viewerLogin]),children:`Assigned to me`}),e.projects?.length?(0,O.jsxs)(`select`,{ref:l,"aria-label":`Project board`,className:`${k} ${lt}`,value:n,onChange:e=>i(e.target.value),children:[(0,O.jsx)(`option`,{value:``,children:`All boards`}),e.projects.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.title},e.id))]}):e.projects||e.projectsState?(0,O.jsx)(`select`,{ref:l,"aria-label":`Project board`,className:`${k} ${lt}`,disabled:!0,value:``,children:(0,O.jsx)(`option`,{value:``,children:e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`})}):null,(0,O.jsx)(`p`,{role:`status`,className:`sr-only`,children:d}),(0,O.jsxs)(S,{open:a,onOpenChange:o,children:[(0,O.jsx)(be,{asChild:!0,children:(0,O.jsx)(`button`,{ref:s,type:`button`,className:`${k} inline-flex items-center justify-center ${d?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:d?void 0:-1,children:e.projectsState===`refreshing`?(0,O.jsx)(ne,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,O.jsx)(ee,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,O.jsx)(x,{ref:c,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{f||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:d||ce.current})]})]})}function dt({onRefresh:e,refreshing:t}){let n=Ge(ve());return(0,O.jsxs)(`div`,{"data-route":`github`,"data-slot":`github-filter-screen`,className:b,children:[(0,O.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,O.jsx)(`h1`,{className:v(ye,`min-w-0 flex-1`),children:`GitHub`}),(0,O.jsx)(`button`,{type:`button`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,O.jsx)(ne,{size:17,"aria-hidden":`true`,className:v(`size-[17px]`,t&&`motion-safe:animate-spin`)})})]}),(0,O.jsx)(ze,{model:n,variant:`screen`})]})}var ft=Ae,pt=100,mt=350;function ht({width:e,onWidthChange:t}){let n=(0,T.useRef)(null),r=t=>{t.button===0&&(n.current={x:t.clientX,width:e},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault(),t.currentTarget.focus())},i=e=>{let r=n.current;r&&t(D(r.width+(e.clientX-r.x)))},a=e=>{n.current&&(n.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,O.jsx)(`div`,{"data-slot":`gh-list-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the GitHub list`,"aria-valuenow":e,"aria-valuemin":280,"aria-valuemax":520,tabIndex:0,onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a,onKeyDown:n=>{let r=n.key===`ArrowLeft`?e-16:n.key===`ArrowRight`?e+16:n.key===`Home`?280:n.key===`End`?520:null;r!==null&&(n.preventDefault(),t(D(r)))},onDoubleClick:()=>t(360),title:`Drag to resize the GitHub list — double-click to reset`,className:`absolute inset-y-0 -right-[2px] z-20 hidden w-[5px] cursor-col-resize touch-none bg-transparent transition-colors hover:bg-accent-strong/40 focus-visible:bg-accent-strong/60 focus-visible:outline-none md:block`})}function gt(e,t){let[n,r]=(0,T.useState)(e);return(0,T.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function A({view:e,changes:t=!1,index:n=!1}){let{n:l}=re(),[u,ue]=ie(),p=ke(),m=u.get(`filter`),h=Ve(e,m),y=h??`all`,ye=e=>ue(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n},{replace:!0}),b=_e({limit:ft}),be=fe().data?.capabilities?.automations===!0,x=b.data,S=oe(),xe=e=>{S.setQueryData(_.uiState,t=>({...t,githubView:e})),s({githubView:e}).then(e=>S.setQueryData(_.uiState,e)).catch(e=>{i(e instanceof Error?e.message:String(e),{tone:`danger`}),S.invalidateQueries({queryKey:_.uiState})})},Se=(0,T.useRef)(null),C=(0,T.useRef)(null),Ce=e=>e?r(e.kind,e.number,{refresh:!0}).then(t=>(S.setQueryData(e.key,t),!0)).catch(()=>!1):Promise.resolve(!0),w=he({mutationFn:e=>(Ce(e),c({refresh:!0,limit:ft})),onSuccess:t=>{S.setQueryData(_.github({limit:ft}),t),S.invalidateQueries({queryKey:_.githubChecks(sn)}),S.invalidateQueries({queryKey:_.githubSearch(e===`issues`?`issue`:`pr`,z)}),S.invalidateQueries({queryKey:_.githubSearch(`pr`,Me)}),S.invalidateQueries({queryKey:_.githubSearch(`pr`,Ie)});let n=Se.current;if(!n){S.removeQueries({queryKey:[`github`,`comments`]});return}let r=_.githubComments(n.kind,n.number);ce(n.kind,n.number,{refresh:!0}).then(e=>S.setQueryData(r,e)).catch(()=>{}),S.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==ae(r)})},onError:e=>i(e.message,{tone:`danger`})}),{workflows:Ae,skillList:je,workflow:Pe,setWorkflow:ze,selectedSkills:Ge,setSelectedSkills:qe,engine:Je,setEngine:Ye,queued:Ze,onQueued:tt}=rt(),nt=ge(),[E,ct]=(0,T.useState)(at),[lt,k]=(0,T.useState)(!0),[A,xt]=(0,T.useState)(!1),St=(0,T.useRef)(null),Ct=(0,T.useRef)(null),wt=e=>{let t=D(e);ct(t),ot(t)},Tt=n&&!p&&m===null&&l===void 0,Et=b.data?.available===!0&&!Tt;(0,T.useEffect)(()=>{if(!Et)return;let e=St.current,t=Ct.current,n=e?.closest(`[data-slot="main"]`);if(!e||!t||!n)return;let r=window.matchMedia(`(min-width: 768px)`),i=!1,a=()=>{if(i=r.matches&&t.clientWidth>=E+22+360,k(!i),!i||n.clientHeight<1){e.style.removeProperty(`--gh-workspace-height`);return}e.style.setProperty(`--gh-workspace-height`,`${Math.round(n.clientHeight)}px`)};a();let o=new ResizeObserver(a);o.observe(n),o.observe(t);let s=e=>{if(!i||e.ctrlKey||!e.deltaY||Math.abs(e.deltaX)>Math.abs(e.deltaY)||t.getBoundingClientRect().top<=n.getBoundingClientRect().top+1||!(e.target instanceof Element)||!e.target.closest(`[data-slot="gh-panes"]`))return;e.preventDefault();let r=e.deltaMode===1?16:e.deltaMode===2?n.clientHeight:1;n.scrollTop+=e.deltaY*r};return t.addEventListener(`wheel`,s,{passive:!1}),r.addEventListener(`change`,a),()=>{t.removeEventListener(`wheel`,s),o.disconnect(),r.removeEventListener(`change`,a)}},[Et,E]);let[j,Dt]=(0,T.useState)(``),[M,Ot]=(0,T.useState)([]),[kt,At]=(0,T.useState)([]),[jt,Mt]=(0,T.useState)(``),Nt=x?.projectsState===`refreshing`||x?.projectsState===`unavailable`,N=Nt||x?.projects?.some(e=>e.id===jt)?jt:``;(0,T.useEffect)(()=>{x&&!Nt&&jt&&!N&&Mt(``)},[x,jt,N,Nt]);let Pt=e===`issues`&&y===`assigned`,P=Pt?x?.viewerLogin?[x.viewerLogin]:[]:kt,Ft=e=>{At(e),Pt&&ye(`all`)},It=()=>{Dt(``),Ot([]),At([]),Mt(``),h!==null&&h!==`all`&&ye(`all`)},Lt=ve(),Rt=e===`issues`&&(y===`no-task`||y===`has-task`),zt=me(Lt,Rt,Lt==="default"),F=(0,T.useMemo)(()=>zt.data?Ne(zt.data,x?.repo,Lt):null,[zt.data,x?.repo,Lt]),I=Ke(e,h)?Fe(h):null,L=pe(`pr`,I??``,I!==null&&x?.available===!0),R=I!==null&&L.data?.available?L.data.items:null,z=gt(j,mt),B=(0,T.useMemo)(()=>x?.available?e===`issues`?x.issues:x.prs:[],[x,e]),V=(0,T.useMemo)(()=>R?Re(R,B):null,[R,B]),H=x?.available?(Pt||e===`prs`&&y===`mine`)&&!x.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:Rt&&!F?zt.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:I!==null&&!R?L.data?.available===!1?{kind:`blocked`,message:`GitHub could not be searched: ${L.data.reason??`unknown reason`}.`}:L.isError?{kind:`blocked`,message:`GitHub could not be searched: ${L.error instanceof Error?L.error.message:`the search request failed`}.`}:{kind:`loading`,message:`Searching GitHub…`}:null:null,Bt=(0,T.useMemo)(()=>H?[]:V??B,[H,V,B]),Vt=(0,T.useMemo)(()=>e===`issues`?y===`no-task`&&F?{excludeNumbers:F}:y===`has-task`&&F?{includeNumbers:F}:{}:y===`mine`&&x?.viewerLogin?{author:x.viewerLogin}:R?{includeNumbers:new Set(R.map(e=>e.number))}:{},[e,y,F,x?.viewerLogin,R]),Ht=(0,T.useMemo)(()=>it(Bt,{query:z,labels:M,...Vt,...e===`issues`?{assignees:P,projectId:N}:{}}),[Bt,z,M,e,P,N,Vt]),Ut=j.trim()===z.trim(),U=x?.available===!0&&!H&&Ut&&Xe(z,Ht),W=pe(e===`issues`?`issue`:`pr`,z,U),Wt=Bt,G=it(Wt,{query:j,labels:M,...Vt,...e===`issues`?{assignees:P,projectId:N}:{}}),Gt=e===`issues`&&l!==void 0&&!A,Kt=j.trim()!==``||M.length>0||e===`issues`&&(P.length>0||N!==``)||h!==null&&h!==`all`,K=U&&W.data?.available?W.data:null,qt=new Set(G.map(e=>e.number)),Jt=e===`issues`&&K?N&&K.items.some(e=>e.projectIds===void 0)?K.projectsReason??`Project board data is incomplete. Refresh to try again.`:P.length&&K.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null,q=K&&!Jt?it(K.items,{labels:M,...Vt,...e===`issues`?{assignees:P,projectId:N}:{}}).filter(e=>!qt.has(e.number)):[],Yt=_.github()[0],J=l===void 0?null:Number.parseInt(l,10),Xt=!H&&W.data?.available?W.data.items.find(e=>e.number===J):void 0,Zt=V&&J!==null&&!B.some(e=>e.number===J)?V.find(e=>e.number===J):void 0,Qt=Xt??Zt,[Y,$t]=(0,T.useState)(null);(0,T.useEffect)(()=>{Qt&&$t({scope:Yt,view:e,item:Qt})},[Yt,e,Qt]);let en=Qt??(Y?.scope===Yt&&Y.view===e&&Y.item.number===J?Y.item:null),tn=e===`issues`?`issue`:`pr`,X=x?.available===!0&&J!==null&&Number.isSafeInteger(J)&&J>0&&!B.some(e=>e.number===J)&&!V?.some(e=>e.number===J)&&en===null,Z=de(tn,J??0,X),nn=X&&Z.data?.available&&Z.data.item?.kind===tn?Z.data.item:null;C.current=X&&J!==null?{kind:tn,number:J,key:_.githubItem(tn,J)}:null;let[rn,an]=(0,T.useState)(!1),on=()=>{an(!0),Ce(C.current).then(e=>{an(!1),e||i(`Could not reach GitHub for #${J}`,{tone:`danger`})})},sn=(()=>{if(!x?.available||e!==`prs`)return[];let t=new Set;J!==null&&Number.isInteger(J)&&t.add(J);for(let e of[...q,...Bt,...x.prs]){if(t.size>=pt)break;t.add(e.number)}return[...t]})(),cn=le(sn,e===`prs`),ln=cn.data?.available?cn.data.checks:void 0;if(n&&p&&m===null&&nt.data?.githubView===`prs`)return(0,O.jsx)(we,{to:`/github/prs`,replace:!0});if(!x)return b.isError?(0,O.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,O.jsx)(g,{icon:(0,O.jsx)(ee,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:b.error.message})}):(0,O.jsx)(We,{});if(Se.current=null,Tt&&x.available)return(0,O.jsx)(dt,{onRefresh:()=>w.mutate(C.current),refreshing:w.isPending});if(!x.available)return(0,O.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,O.jsx)(g,{icon:(0,O.jsx)(d,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:x.reason??`unknown reason`,actions:(0,O.jsx)(f,{variant:`outline`,"data-action":`gh-retry`,disabled:w.isPending,onClick:()=>w.mutate(C.current),children:`Try again`}),children:(0,O.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,O.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,O.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in cezar works without it.`]})})});let un=j.trim()!==``&&!Ut||U&&W.isPending,dn={...K?.labelColors??{},...x.labelColors??{}},fn=Qe([...Wt,...B,...K?.items??[]]),Q=l===void 0?null:Number.parseInt(l,10),$=Q===null?G[0]??q[0]??null:B.find(e=>e.number===Q)??V?.find(e=>e.number===Q)??en??nn??null;Se.current=$?{kind:$.kind,number:$.number}:null;let pn=m===null?null:y,mn=Le(e,pn??(e===`issues`&&!p?`all`:null)),hn=U&&(W.data?.available===!1||W.isError),gn=W.data?.available===!1?W.data.reason??`unknown reason`:W.error instanceof Error?W.error.message:`the search request failed`,_n=H?(0,O.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":H.kind,children:[H.kind===`loading`?(0,O.jsx)(Te,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,H.message]}):Kt?un?(0,O.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,O.jsx)(Te,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,j.trim(),`”…`]}):hn?q.length>0?(0,O.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,gn,`. Use Refresh to try again.`]}):G.length>0?(0,O.jsxs)(`p`,{children:[`GitHub could not be searched: `,gn,`.`]}):(0,O.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter, and GitHub could not be searched: `,gn,`.`]}):Jt?(0,O.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,Jt]}):q.length>0?null:K?.truncated?(0,O.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):K&&G.length>0?(0,O.jsxs)(`p`,{children:[`No additional `,e===`issues`?`issues`:`pull requests`,` match your filter on GitHub.`]}):K?(0,O.jsxs)(`p`,{children:[`No `,e===`issues`?`issues`:`pull requests`,` match your filter — open, closed or merged.`]}):(0,O.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter.`]}):(0,O.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,`.`]});return(0,O.jsxs)(`div`,{ref:St,"data-route":`github`,className:`flex min-h-full flex-col gap-3 px-[18px] pt-[18px] pb-[calc(90px+env(safe-area-inset-bottom))] md:gap-[22px] md:px-7 md:pt-4 md:pb-4`,children:[(0,O.jsxs)(`div`,{"data-slot":`gh-masthead`,className:`flex min-w-0 shrink-0 flex-col gap-1 md:flex-row md:items-baseline md:gap-3`,children:[(0,O.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[15px] md:tracking-normal`,children:p?`${e===`issues`?`Issues`:`Pull requests`} · ${He[y]}`:`GitHub`}),m!==null&&l===void 0?(0,O.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`flex min-w-0 items-center gap-3 md:hidden`,children:[(0,O.jsxs)(De,{to:`/github`,"data-slot":`gh-back-filters`,className:`inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,O.jsx)(o,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),y===`all`?null:(0,O.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-soft-foreground`,children:[...Be,...Ue].find(e=>e.id===y)?.label})]}):null,x.repo?(0,O.jsxs)(`span`,{className:`min-w-0 truncate text-[13px] text-muted-foreground md:text-[11px] md:text-soft-foreground`,children:[(0,O.jsx)(`span`,{"data-slot":`gh-repo`,children:x.repo}),(0,O.jsxs)(`span`,{"data-slot":`gh-synced`,children:[` · `,x.syncedAt?`Synced ${Ee(x.syncedAt)} ago`:`Not synced yet`]})]}):null]}),(0,O.jsxs)(`div`,{ref:Ct,"data-slot":`gh-workspace`,"data-stacked":lt,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 md:h-[calc(var(--gh-workspace-height,calc(100dvh-4rem))-1rem)] md:flex-none md:gap-[22px]`,children:[(0,O.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-[22px]`,children:[(0,O.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,O.jsxs)(Oe,{to:p?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>xe(`issues`),children:[`Issues · `,vt(x.issues.length)]}),(0,O.jsxs)(Oe,{to:`/github/prs`,active:e===`prs`,onClick:()=>xe(`prs`),children:[`Pull requests · `,vt(x.prs.length)]}),be?(0,O.jsx)(De,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,O.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:w.isPending,onClick:()=>w.mutate(C.current),className:`gh-utility`,children:[(0,O.jsx)(ne,{size:16,"aria-hidden":`true`,className:v(`size-3.5`,w.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,O.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2.5`,children:[(0,O.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,O.jsx)(a,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,O.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:j,onChange:e=>Dt(e.target.value),className:`min-h-11 w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,O.jsx)(bt,{options:fn,colors:dn,selected:M,onChange:Ot}),e===`issues`?(0,O.jsx)(ut,{data:{...x,issues:[...x.issues,...K?.items??[]]},assignees:P,projectId:N,onAssigneesChange:Ft,onProjectChange:Mt}):null,(0,O.jsx)(`button`,{type:`button`,disabled:!Kt,className:`min-h-11 min-w-11 rounded-md border border-border bg-card px-4 text-xs disabled:opacity-50`,onClick:It,children:`Clear filters`})]})]}),(0,O.jsxs)(`div`,{"data-slot":`gh-panes`,className:`flex min-h-0 min-w-0 flex-1 flex-col items-start gap-[22px] md:flex-row md:items-stretch md:overflow-hidden`,children:[(0,O.jsxs)(`section`,{"data-slot":`gh-list`,"data-mobile-preview":Gt||void 0,style:{"--github-list-width":`${E}px`},className:`relative flex w-full min-h-0 min-w-0 flex-col rounded-lg border border-border bg-card p-3 md:w-[var(--github-list-width)] md:shrink-0 md:overflow-x-hidden md:overflow-y-auto`,children:[G.length===0?_n&&(0,O.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:_n}):(0,O.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-1`,children:G.map((t,n)=>(0,O.jsx)(yt,{item:t,view:e,filter:pn,colors:dn,active:$?.url===t.url,compactHidden:Gt&&n>=2&&$?.url!==t.url,queued:Ze.has(t.url),checks:t.kind===`pr`?ln?.[t.number]??t.checks:t.checks},t.url))}),I!==null&&L.data?.available&&L.data.truncated?(0,O.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-soft-foreground`,children:[`Showing the first `,L.data.items.length,` matches from GitHub search; more may exist.`]}):null,e===`issues`&&l!==void 0&&G.length>2?(0,O.jsx)(f,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":A,onClick:()=>xt(e=>!e),children:A?`Show fewer issues`:`View all ${G.length} issues`}):null,G.length>0&&U&&_n?(0,O.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-soft-foreground`,children:_n}):null,q.length>0?(0,O.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,O.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,K?.truncated?` (first matches)`:``]}),(0,O.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:q.map(t=>(0,O.jsx)(yt,{item:t,view:e,filter:pn,colors:dn,active:$?.url===t.url,queued:Ze.has(t.url),checks:t.kind===`pr`?ln?.[t.number]??t.checks:t.checks},t.url))})]}):null,(0,O.jsx)(ht,{width:E,onWidthChange:wt})]}),(0,O.jsx)(`section`,{"data-slot":`gh-detail`,className:v(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-border bg-card md:overflow-y-auto`,l===void 0?`hidden md:flex`:`flex`),children:$?(0,O.jsx)(et,{item:$,afterHeading:$.kind===`issue`?(0,O.jsx)(st,{number:$.number,repo:x.repo},l??`list`):void 0,backLink:{to:mn},subNav:{filter:pn,changes:t},onRunAgent:_t,colors:dn,checks:$.kind===`pr`?ln?.[$.number]??$.checks:$.checks,children:(0,O.jsx)($e,{item:$,workflows:Ae.data?.workflows??[],skills:je,workflow:Pe,onWorkflowChange:ze,selectedSkills:Ge,onSkillsChange:qe,engine:Je,onEngineChange:Ye,queuedRunId:Ze.get($.url)??null,onQueued:tt},$.url)}):X&&Z.isPending?(0,O.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex min-h-full flex-1 flex-col`,children:(0,O.jsx)(g,{icon:(0,O.jsx)(Te,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${J}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):X&&(Z.isError||Z.data?.available===!1)?(0,O.jsx)(g,{icon:(0,O.jsx)(ee,{size:16}),tone:Z.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${J}`,subtitle:Z.data?.available===!1?Z.data.reason:Z.error instanceof Error?Z.error.message:`The request failed.`,actions:(0,O.jsx)(f,{variant:`outline`,disabled:rn,onClick:on,children:`Retry`})}):(0,O.jsx)(g,{icon:e===`issues`?(0,O.jsx)(te,{size:16}):(0,O.jsx)(se,{size:16}),tone:`neutral`,heading:`h2`,title:Q===null?`Nothing selected`:`Not found`,subtitle:Q===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${Q} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${Q} above to look it up on GitHub, closed and merged included.`})})]})]})]})}function _t(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}function vt(e){return`${e}${e>=ft?`+`:``}`}function yt({item:e,view:t,filter:n,colors:r,active:i,compactHidden:a,queued:o,checks:s}){let c=e.kind===`issue`?te:se,l=oe(),u=()=>{l.prefetchQuery({queryKey:_.githubComments(e.kind,e.number),queryFn:({signal:t})=>ce(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,O.jsx)(`li`,{"data-compact-hidden":a||void 0,children:(0,O.jsxs)(De,{to:Le(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,tt(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:u,onFocus:u,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":i?`page`:void 0,title:`Drag into the composer to prefill a task`,className:v(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,i&&`bg-accent-strong/10 text-accent-text`),children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,O.jsx)(c,{"aria-hidden":`true`,className:v(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,O.jsx)(`span`,{className:v(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,i&&`font-semibold`),children:e.title})]}),(0,O.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 pl-[22px] font-mono text-[11px] text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,O.jsxs)(`span`,{children:[`#`,e.number]}),(0,O.jsx)(`span`,{className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,O.jsx)(`span`,{children:Ee(e.createdAt)}),(0,O.jsx)(Je,{count:e.comments}),s?(0,O.jsx)(Ze,{checks:s}):null,o?(0,O.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-accent-text`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,O.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,O.jsx)(nt,{label:e,color:r[e],plain:!0},e))}):null]})})}function bt({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,T.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,O.jsxs)(S,{open:i,onOpenChange:a,children:[(0,O.jsx)(be,{asChild:!0,children:(0,O.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:v(`flex min-h-11 min-w-11 shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,O.jsx)(u,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`})]})}),(0,O.jsx)(x,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,O.jsxs)(xe,{children:[(0,O.jsx)(Se,{placeholder:`Filter labels…`}),(0,O.jsxs)(C,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,O.jsx)(w,{children:`No labels.`}),n.length>0?(0,O.jsxs)(Ce,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,O.jsxs)(Ce,{value:e,onSelect:()=>o(e),className:`min-h-11`,children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:Ye(t[e])}),(0,O.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,O.jsx)(l,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{A as GithubRoute};
|