@hearsay-tools/squawk 0.19.0-dev.8877 → 0.19.0-dev.8883
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/dist/server/server.d.ts +8 -8
- package/package.json +4 -4
- package/web/dist/assets/accounts-section-BM-HWieF.js +1 -0
- package/web/dist/assets/activity-motion-BlDa0Oee.js +1 -0
- package/web/dist/assets/activity-route-BOozKrPn.js +1 -0
- package/web/dist/assets/agent-config-section-Bg0OgLPn.js +7 -0
- package/web/dist/assets/agent-defaults-section-B-uXUUCT.js +1 -0
- package/web/dist/assets/appearance-Cv8Qr8nS.js +1 -0
- package/web/dist/assets/archive-on-merge-field-DExgXlBg.js +1 -0
- package/web/dist/assets/attention-CnhIF76m.js +1 -0
- package/web/dist/assets/{automations-route-Dj5mLsB_.js → automations-route-DqS_DIp2.js} +2 -2
- package/web/dist/assets/badge-B6B-xYQQ.js +1 -0
- package/web/dist/assets/button-C8jUIs8Q.js +1 -0
- package/web/dist/assets/centered-state-BgSV4e79.js +1 -0
- package/web/dist/assets/change-counts-wqSYI3W8.js +1 -0
- package/web/dist/assets/{code-editor-B4baSOhz.js → code-editor-GfQChdgl.js} +1 -1
- package/web/dist/assets/{collapsible-BEV4FO-1.js → collapsible-CW6CfTJO.js} +1 -1
- package/web/dist/assets/command-DuxcX6Hr.js +1 -0
- package/web/dist/assets/commit-list-a1vNhwzg.js +1 -0
- package/web/dist/assets/dialog-Dbu3HnqC.js +1 -0
- package/web/dist/assets/diff-DDjPsaQ6.js +3 -0
- package/web/dist/assets/diff-controls-QeCV3Sy1.js +1 -0
- package/web/dist/assets/diff-stat-Dy4uLuyP.js +1 -0
- package/web/dist/assets/{diff-view-mEcoOmP6.js → diff-view-Bv9YauBT.js} +1 -1
- package/web/dist/assets/{dist-Da4ckcJG.js → dist-BS5vYfFC.js} +1 -1
- package/web/dist/assets/dist-C_rn70hE.js +1 -0
- package/web/dist/assets/{dist-DXO3xwbC.js → dist-CtdIjNlG.js} +1 -1
- package/web/dist/assets/{dist-BAoXdNsT.js → dist-DDhqweuB.js} +1 -1
- package/web/dist/assets/{dist-C5mlVBmd.js → dist-Tubgdd25.js} +1 -1
- package/web/dist/assets/dist-VPUfzsfL.js +1 -0
- package/web/dist/assets/dropdown-menu-BaqO-x7U.js +1 -0
- package/web/dist/assets/{es2015-CQth82uv.js → es2015-DpKptHDx.js} +1 -1
- package/web/dist/assets/file-preview-CuwkUuqd.js +2 -0
- package/web/dist/assets/folder-browser-CK1mNIQi.js +1 -0
- package/web/dist/assets/git-toolbar-BWSmSiqy.js +1 -0
- package/web/dist/assets/github-CS_bLWjw.js +1 -0
- package/web/dist/assets/{global-activity-route-u1XpCWGK.js → global-activity-route-D7HmA4W3.js} +1 -1
- package/web/dist/assets/highlighter-Cfo7mLVB.js +3 -0
- package/web/dist/assets/html-report-frame-Ck76gKfA.js +1 -0
- package/web/dist/assets/{image-preview-DCUeM8u3.js → image-preview-CeEKI2T5.js} +1 -1
- package/web/dist/assets/index-B0_haEFL.js +21 -0
- package/web/dist/assets/index-D0mx-XUg.css +1 -0
- package/web/dist/assets/label-eNfbfYFG.js +1 -0
- package/web/dist/assets/markdown-Djjm7pRl.js +2 -0
- package/web/dist/assets/nav-row-styles-CgP5uNp4.js +1 -0
- package/web/dist/assets/{notifications-section-CBdv2T-_.js → notifications-section-Dcclastm.js} +1 -1
- package/web/dist/assets/{open-in-menu-VhRao_Jk.js → open-in-menu-CSbpfQy7.js} +1 -1
- package/web/dist/assets/option-select-DzjSpnye.js +1 -0
- package/web/dist/assets/page-shell-CpdYMj52.js +1 -0
- package/web/dist/assets/popover-CVo54-aS.js +1 -0
- package/web/dist/assets/{preview-pane-connected-B00yRXAd.js → preview-pane-connected-DOnixsSz.js} +3 -3
- package/web/dist/assets/{project-location-DATkk1gA.js → project-location-CBzVRz73.js} +1 -1
- package/web/dist/assets/{project-router-B9FTk0rB.js → project-router-CEnizJ8F.js} +1 -1
- package/web/dist/assets/projects-section-CJAE2fqb.js +1 -0
- package/web/dist/assets/prompt-templates-section-BqmYEq-d.js +1 -0
- package/web/dist/assets/queries-ByqTmyCs.js +1 -0
- package/web/dist/assets/reference-chip-hn8jj_Mo.js +1 -0
- package/web/dist/assets/{remote-settings-notice-BJwP8Vi8.js → remote-settings-notice-ChJJ2HzF.js} +1 -1
- package/web/dist/assets/repo-git-DzX-ZqFC.js +1 -0
- package/web/dist/assets/{report-reader-DDGKyj6B.js → report-reader-DMLkJxpC.js} +1 -1
- package/web/dist/assets/report-selection-BkBJw-sm.js +1 -0
- package/web/dist/assets/reports-DyilNFvz.js +1 -0
- package/web/dist/assets/resources-section-NWZHHXtk.js +1 -0
- package/web/dist/assets/{review-panel-5IbppuWS.js → review-panel-BsKM2hDc.js} +8 -8
- package/web/dist/assets/{run-detail-refresh-Ye2jcT7n.js → run-detail-refresh-BJ4laDVB.js} +1 -1
- package/web/dist/assets/run-header-DpTjMIK-.js +2 -0
- package/web/dist/assets/select-CvnOk0OI.js +1 -0
- package/web/dist/assets/{session-context-section-nSf23HuY.js → session-context-section-B3bs0GoD.js} +2 -2
- package/web/dist/assets/settings-agent-picker-DlX1-8_P.js +1 -0
- package/web/dist/assets/settings-shell-1FhhEiGa.css +1 -0
- package/web/dist/assets/{settings-shell-BlNdAbSK.js → settings-shell-twGuaJwv.js} +1 -1
- package/web/dist/assets/sidebar-section-Crbl2_-9.js +1 -0
- package/web/dist/assets/skills-CXdbXepC.js +1 -0
- package/web/dist/assets/status-dot-BXf-Ubd0.js +1 -0
- package/web/dist/assets/switch-DfPCm1H_.js +1 -0
- package/web/dist/assets/tab-link-3A_SF95U.js +1 -0
- package/web/dist/assets/task-changes-C8m5S54H.js +1 -0
- package/web/dist/assets/{task-commits-C3Aieqql.js → task-commits-CwNBsoyL.js} +1 -1
- package/web/dist/assets/{task-file-scope-EBj6BbvL.js → task-file-scope-C313CMq7.js} +1 -1
- package/web/dist/assets/task-files-CdpANvF1.js +1 -0
- package/web/dist/assets/task-github-item-f4J2WBEt.js +1 -0
- package/web/dist/assets/{task-groups-DD46syqv.js → task-groups-BRrlyl5P.js} +1 -1
- package/web/dist/assets/{task-thread-CbBHJkXy.js → task-thread-BqoX3viB.js} +2 -2
- package/web/dist/assets/{tasks-table-D17JLOhe.js → tasks-table-DtLW8U-4.js} +1 -1
- package/web/dist/assets/textarea-vEsJAUAV.js +1 -0
- package/web/dist/assets/thread-state-Bh4adRbN.js +4 -0
- package/web/dist/assets/toaster-Lf_4oY96.js +4 -0
- package/web/dist/assets/use-hand-to-agent-state-C3NlsVVQ.js +1 -0
- package/web/dist/assets/workflows-Df7ulEcU.js +7 -0
- package/web/dist/assets/{workspace-tools-C2ut23LU.js → workspace-tools-C_93GWNV.js} +1 -1
- package/web/dist/assets/{worktrees-section-BE61T3WC.js → worktrees-section-w9Q1xpeU.js} +4 -4
- package/web/dist/assets/zoomable-image-BUTgYpld.js +1 -0
- package/web/dist/index.html +33 -33
- package/web/dist/assets/accounts-section-UJZxye-z.js +0 -1
- package/web/dist/assets/activity-motion-BnRBlOlc.js +0 -1
- package/web/dist/assets/activity-route-weCjVQ4j.js +0 -1
- package/web/dist/assets/agent-config-section-CGrPPEQR.js +0 -7
- package/web/dist/assets/agent-defaults-section-mocZoAgX.js +0 -1
- package/web/dist/assets/appearance-dnjgFECm.js +0 -1
- package/web/dist/assets/archive-on-merge-field-BkwRlcuT.js +0 -1
- package/web/dist/assets/attention-ILOaW2-t.js +0 -1
- package/web/dist/assets/badge-DQ3U69Ht.js +0 -1
- package/web/dist/assets/button-B7MKxYjT.js +0 -1
- package/web/dist/assets/centered-state-V15AR_qo.js +0 -1
- package/web/dist/assets/change-counts-npLATh-3.js +0 -1
- package/web/dist/assets/command-KdW7aO0N.js +0 -1
- package/web/dist/assets/commit-list-C8pTI7mp.js +0 -1
- package/web/dist/assets/dialog-B531GGAo.js +0 -1
- package/web/dist/assets/diff-BUeqeifm.js +0 -3
- package/web/dist/assets/diff-controls-n4THBHKo.js +0 -1
- package/web/dist/assets/diff-stat-C7KB1kDX.js +0 -1
- package/web/dist/assets/dist-BW234Kg5.js +0 -1
- package/web/dist/assets/dropdown-menu-4e2iKSMT.js +0 -1
- package/web/dist/assets/file-preview-CQdNEFHu.js +0 -2
- package/web/dist/assets/folder-browser-B_jJl4is.js +0 -1
- package/web/dist/assets/git-toolbar-AbHPGj3l.js +0 -1
- package/web/dist/assets/github-DriOZy15.js +0 -1
- package/web/dist/assets/highlighter-DvLzHjjY.js +0 -3
- package/web/dist/assets/html-report-frame-DkHr39E2.js +0 -1
- package/web/dist/assets/index-DOVwFCfP.css +0 -1
- package/web/dist/assets/index-_LohQUeF.js +0 -21
- package/web/dist/assets/label-DMC9mkYa.js +0 -1
- package/web/dist/assets/markdown-DJkMnwyc.js +0 -2
- package/web/dist/assets/nav-row-styles-D5HpOmDZ.js +0 -1
- package/web/dist/assets/page-shell-7pLJMOgh.js +0 -1
- package/web/dist/assets/popover-CZV6tz9i.js +0 -1
- package/web/dist/assets/projects-section-BXkVtC6H.js +0 -1
- package/web/dist/assets/prompt-templates-section-RF3GKyNP.js +0 -1
- package/web/dist/assets/queries-hzlF788B.js +0 -1
- package/web/dist/assets/reference-chip-Dgo5aKeb.js +0 -1
- package/web/dist/assets/repo-git-DuPmx5Mc.js +0 -1
- package/web/dist/assets/report-selection-C-2DJb8L.js +0 -1
- package/web/dist/assets/reports-CUVVGSNs.js +0 -1
- package/web/dist/assets/resources-section-CO9ePehe.js +0 -1
- package/web/dist/assets/run-header-BbjUWTs-.js +0 -2
- package/web/dist/assets/select-Cnv2IYdg.js +0 -1
- package/web/dist/assets/settings-agent-picker-DFTg6k6E.js +0 -1
- package/web/dist/assets/settings-select-CCIMGnyA.js +0 -1
- package/web/dist/assets/settings-shell-AMRJAsgc.css +0 -1
- package/web/dist/assets/sidebar-section-DmBlDKYf.js +0 -1
- package/web/dist/assets/skills-BmwnEyVF.js +0 -1
- package/web/dist/assets/status-dot-BRzVlF2X.js +0 -1
- package/web/dist/assets/switch-DKqVf8-p.js +0 -1
- package/web/dist/assets/tab-link-BlZX-nKP.js +0 -1
- package/web/dist/assets/task-changes-BGxKFPHy.js +0 -1
- package/web/dist/assets/task-files-BkrKQUzS.js +0 -1
- package/web/dist/assets/task-github-item-DdpDpxtU.js +0 -1
- package/web/dist/assets/textarea-vJt9undk.js +0 -1
- package/web/dist/assets/thread-state-9hRlv8vK.js +0 -4
- package/web/dist/assets/toaster-fWyfEGWF.js +0 -4
- package/web/dist/assets/use-hand-to-agent-state-CCWMSRyA.js +0 -1
- package/web/dist/assets/utils-DSMR_WLb.js +0 -1
- package/web/dist/assets/workflows-XpPXRBCU.js +0 -7
- package/web/dist/assets/zoomable-image-6RTKhLGE.js +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
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-DSMR_WLb.js";import{$t as i,Wt as a,Zt as o,g as s,h as c,rn as l,x as u,yt as d}from"./queries-hzlF788B.js";import{Fn as f,hi as p,n as m}from"./toaster-fWyfEGWF.js";import{t as h}from"./button-B7MKxYjT.js";import{t as g}from"./badge-DQ3U69Ht.js";import{t as _}from"./centered-state-V15AR_qo.js";import{A as v,cr as y,pn as b}from"./index-_LohQUeF.js";import{n as x,r as S,t as C}from"./remote-settings-notice-BJwP8Vi8.js";import{t as w}from"./code-editor-B4baSOhz.js";var T=e(t(),1);function E(e){return t=>t.runners.includes(e)}function D(e,t){let n=E(e);return e=>n(e)&&e.kind===t}function O(e){let{label:t,note:n,groups:r}=e.agentConfig;return{id:e.id,label:t,note:n,groups:r.map(({id:t,label:n,note:r,empty:i,showsUserMcp:a})=>({id:t,label:n,note:r,...i?{empty:i}:{},...a?{showsUserMcp:a}:{},files:D(e.id,t)}))}}function k(e){return o(e).map(O)}var A=n();function j(e){return e.seeded?`Copied into each run’s worktree — takes effect on your next run.`:e.tracked===`tracked`?`Runs read the committed copy — this edit applies after you commit it.`:e.tracked===`outside-repo`?`Applies to every session on this machine.`:`Personal, git-ignored.`}function M(){let e=c(),t=S(),n=d(),r=l(),a=r.data,o=(0,T.useMemo)(()=>k(a),[a]),s=(0,T.useMemo)(()=>n.data?v(n.data.checks,a):i(a),[n.data,a]);return r.isError?(0,A.jsx)(_,{icon:(0,A.jsx)(y,{}),tone:`danger`,title:`Runners did not load`,subtitle:r.error.message,heading:`h2`}):e.isError?(0,A.jsx)(_,{icon:(0,A.jsx)(y,{}),tone:`danger`,title:`Agent config did not load`,subtitle:e.error.message,heading:`h2`}):e.isPending||a===void 0?(0,A.jsx)(`p`,{"data-slot":`agent-config-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agent config…`}):(0,A.jsx)(N,{listing:e.data,descriptors:o,installed:s,onOpenFile:t})}function N({listing:e,descriptors:t,installed:n,onOpenFile:i}){let[a,o]=(0,T.useState)(`claude`),[s,c]=(0,T.useState)(null),l=t.find(e=>e.id===a)??t[0];if(l===void 0)return null;let u=P(l,e),d=u.find(e=>e.id===s)??F(u),f=e=>{o(e),c(null)};return(0,A.jsxs)(`div`,{"data-slot":`agent-config`,className:`flex flex-col gap-5 p-4 md:p-6`,children:[(0,A.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Edit project, local, and user-wide config files for each coding agent.`}),!e.editable&&(0,A.jsxs)(`div`,{"data-slot":`agent-config-readonly`,className:`rounded-md border border-border bg-muted/40 px-3 py-2 text-[13px] text-muted-foreground`,children:[`Read-only: this remote cockpit cannot edit agent config. You can still see every file and which one wins. To edit here, the host operator runs `,(0,A.jsx)(`code`,{children:C}),`.`]}),(0,A.jsx)(x,{risk:`Agent config can define hooks and MCP servers that run commands on the machine running Squawk`}),(0,A.jsx)(`div`,{"data-slot":`agent-config-agents`,role:`tablist`,className:`flex flex-wrap gap-1`,children:t.map(e=>(0,A.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":e.id===l.id,"data-slot":`agent-config-agent`,"data-agent":e.id,"data-selected":e.id===l.id,onClick:()=>f(e.id),className:r(`flex min-w-11 items-center justify-center gap-2 rounded-md px-3 py-1.5 text-[13px] transition-colors`,e.id===l.id?`bg-background font-semibold shadow-sm`:`hover:bg-muted/60`),children:[e.label,!n.includes(e.id)&&(0,A.jsx)(g,{variant:`outline`,className:`text-xs text-soft-foreground`,children:`Not installed`})]},e.id))}),l.note&&(0,A.jsx)(`p`,{"data-slot":`agent-config-agent-note`,className:`text-xs text-muted-foreground`,children:l.note}),(0,A.jsxs)(`div`,{className:`grid min-w-0 gap-6 lg:grid-cols-[minmax(17rem,24rem)_minmax(0,1fr)]`,children:[(0,A.jsx)(`nav`,{"data-slot":`agent-config-nav`,className:`flex min-w-0 flex-col gap-5`,children:(0,A.jsx)(R,{agent:l,listing:e,selectedId:d?.id??null,onSelect:e=>{c(e),i()}})}),(0,A.jsx)(`div`,{"data-slot":`agent-config-editor-pane`,className:`min-w-0`,children:d?(0,A.jsx)(B,{file:d},d.id):(0,A.jsx)(`p`,{"data-slot":`agent-config-editor-empty`,className:`rounded-md border border-border bg-muted/40 px-4 py-3 text-[13px] text-soft-foreground`,children:`This agent has no config files to show.`})})]})]})}function P(e,t){return e.groups.flatMap(e=>t.files.filter(e.files))}function F(e){return e.find(e=>e.scope===`project`)??e[0]??null}var I={project:`Project scope`,local:`Local scope`,user:`User scope`};function L(e,t){for(let n of t){if(!n.label.startsWith(`~/`))continue;let t=n.label.slice(1);if(!n.path.endsWith(t))continue;let r=n.path.slice(0,n.path.length-t.length);if(r&&(e===r||e.startsWith(`${r}/`)))return`~${e.slice(r.length)}`}return e.replace(/^\/(?:home|Users)\/[^/]+(?=\/|$)/,`~`)}function R({agent:e,listing:t,selectedId:n,onSelect:i}){return(0,A.jsx)(A.Fragment,{children:e.groups.map(a=>{let o=t.files.filter(a.files),s=a.showsUserMcp?t.userMcp:void 0;return o.length===0&&!s&&!a.empty?null:(0,A.jsxs)(`section`,{"data-slot":`agent-config-group`,"data-group":a.id,"data-agent":e.id,children:[(0,A.jsx)(`p`,{className:`mb-1 text-xs font-medium uppercase tracking-wide text-soft-foreground`,children:a.label}),a.note&&(0,A.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:a.note}),o.length===0&&a.empty&&(0,A.jsx)(`p`,{"data-slot":`agent-config-group-empty`,className:`rounded-md border border-dashed border-border px-3 py-2 text-xs text-muted-foreground`,children:a.empty}),(0,A.jsx)(`ul`,{className:`flex flex-col gap-1`,children:o.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsxs)(`button`,{type:`button`,"data-slot":`agent-config-file`,"data-selected":e.id===n,onClick:()=>i(e.id),title:e.label,className:r(`flex w-full flex-col items-start gap-1 rounded-md px-2 py-1.5 text-left text-[13px] transition-colors`,e.id===n?`bg-accent-strong/15 text-foreground`:`hover:bg-muted/60`),children:[(0,A.jsx)(`span`,{"data-slot":`agent-config-file-name`,className:`min-w-0 max-w-full break-all font-mono text-[12px]`,children:e.label}),e.seeded||!e.exists?(0,A.jsxs)(`span`,{"data-slot":`agent-config-file-meta`,className:`flex flex-wrap items-center gap-1.5`,children:[e.seeded&&(0,A.jsx)(g,{variant:`outline`,className:`text-xs`,children:`Default template`}),!e.exists&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Not created`})]}):null]})},e.id))}),s&&(0,A.jsx)(z,{userMcp:s,path:L(s.path,t.files)})]},a.id)})})}function z({userMcp:e,path:t}){return(0,A.jsxs)(`div`,{"data-slot":`agent-config-user-mcp`,className:`mt-3`,children:[(0,A.jsx)(`h4`,{className:`mb-1 text-[12px] font-semibold`,children:`User & local scopes`}),(0,A.jsxs)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:[`Managed by `,(0,A.jsx)(`code`,{"data-slot":`agent-config-user-mcp-command`,className:`whitespace-nowrap font-mono`,children:`claude mcp add`}),` in`,` `,(0,A.jsx)(`code`,{"data-slot":`agent-config-user-mcp-path`,title:e.path,className:`break-all font-mono text-foreground`,children:t}),` — Squawk does not edit Claude’s state file.`]}),e.readable?e.servers.length>0?(0,A.jsx)(`ul`,{className:`flex flex-wrap gap-1`,children:e.servers.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(g,{variant:`outline`,className:`font-mono text-xs`,children:e})},e))}):(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No user-scoped MCP servers.`}):(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Could not read the file.`})]})}function B({file:e}){let t=s(e.id),[n,r]=(0,T.useState)(null),[i,a]=(0,T.useState)(!1),[o,c]=(0,T.useState)(null),l=t.data?.version??null,u=n??t.data?.content??``,d=t.data?u!==t.data.content:!1,f=e.writable,p=e.kind===`mcp`||e.holdsMcp;b(f&&d);let{save:m,isSaving:h}=K({file:e,content:u,loadedVersion:l,setDraft:r,setConflict:a,setFormatError:c});return(0,T.useEffect)(()=>{t.data&&(r(t.data.content),a(!1),c(null))},[t.data?.version,t.data]),(0,A.jsxs)(`div`,{"data-slot":`settings-config-editor`,"data-reports-dirty":``,className:`flex flex-col gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-sm`,children:`Configuration file`}),(0,A.jsx)(g,{variant:`outline`,"data-slot":`agent-config-scope`,"data-scope":e.scope,className:`text-[12px]`,children:I[e.scope]})]}),(0,A.jsx)(`p`,{"data-slot":`agent-config-path`,title:e.path,className:`font-mono text-xs text-foreground`,children:L(e.path,[e])}),(0,A.jsxs)(`div`,{className:`settings-readout flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.label}),(0,A.jsx)(g,{variant:`outline`,className:`text-[12px] uppercase`,children:e.format}),(0,A.jsx)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[12px] text-soft-foreground underline hover:text-foreground`,children:`docs`})]}),(0,A.jsxs)(`div`,{className:`settings-config-content-heading`,children:[(0,A.jsx)(`h3`,{children:p?`MCP configuration`:`File contents`}),p&&(0,A.jsx)(`p`,{children:`Review server commands before saving. MCP servers execute locally.`})]}),t.isPending?(0,A.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading file…`}):t.isError?(0,A.jsx)(`p`,{className:`text-[13px] text-destructive`,children:t.error.message}):(0,A.jsx)(V,{file:e,content:u,isMcp:p,onChange:r}),(0,A.jsx)(W,{formatError:o,conflict:i,onReload:()=>void t.refetch()}),f&&(0,A.jsx)(H,{exists:e.exists,dirty:d,isSaving:h,onSave:m,onReset:()=>r(null)}),(0,A.jsxs)(`div`,{className:`settings-config-save-help`,children:[(0,A.jsx)(`p`,{"data-slot":`agent-config-precedence`,className:`text-xs text-muted-foreground`,children:e.precedence}),(0,A.jsxs)(`p`,{"data-slot":`agent-config-effect`,className:`text-xs text-foreground`,children:[j(e),e.hotReload?` ${e.hotReload}`:``]}),(0,A.jsx)(G,{reason:e.readOnlyReason})]})]})}function V({file:e,content:t,isMcp:n,onChange:r}){return(0,A.jsxs)(`div`,{"data-slot":`agent-config-editor-frame`,className:`relative`,children:[(0,A.jsx)(w,{value:t,language:e.format,readOnly:!e.writable,onChange:r,"aria-label":`${e.label} contents`,className:`h-[210px]`}),!e.exists&&t===``&&(0,A.jsx)(`pre`,{"data-slot":`agent-config-placeholder`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-px m-0 overflow-hidden whitespace-pre px-3 py-2 font-mono text-xs leading-[1.7] text-soft-foreground`,children:U(e,n)})]})}function H({exists:e,dirty:t,isSaving:n,onSave:r,onReset:i}){return(0,A.jsxs)(`div`,{className:`settings-form-actions`,children:[(0,A.jsx)(h,{size:`sm`,onClick:r,disabled:!t||n,children:e?`Save file`:`Create file`}),(0,A.jsx)(h,{size:`sm`,variant:`outline`,onClick:i,disabled:!t||n,children:`Reset`}),!n&&(0,A.jsx)(`span`,{"data-slot":`agent-config-save-cue`,className:`self-center text-xs text-muted-foreground`,children:t?`Unsaved changes`:e?`No unsaved changes`:`Enter content above to create this file`})]})}function U(e,t){switch(e.format){case`json`:case`jsonc`:return`// File not created yet — example:\n${t?`{
|
|
2
|
-
"mcpServers": {}
|
|
3
|
-
}`:`{
|
|
4
|
-
"permissions": {}
|
|
5
|
-
}`}`;case`markdown`:return`<!-- File not created yet — write instructions here -->`;case`toml`:return`# File not created yet — example:
|
|
6
|
-
# key = "value"`;case`yaml`:return`# File not created yet — example:
|
|
7
|
-
# key: value`}}function W({formatError:e,conflict:t,onReload:n}){return(0,A.jsxs)(A.Fragment,{children:[e&&(0,A.jsx)(`p`,{"data-slot":`agent-config-format-error`,className:`text-[12px] text-destructive`,children:e}),t&&(0,A.jsxs)(`div`,{"data-slot":`agent-config-conflict`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px]`,children:[(0,A.jsx)(`span`,{children:`The file changed on disk since you opened it.`}),(0,A.jsx)(h,{size:`sm`,variant:`outline`,onClick:n,children:`Reload from disk`})]})]})}function G({reason:e}){return e&&(0,A.jsx)(`p`,{children:e})}function K({file:e,content:t,loadedVersion:n,setDraft:r,setConflict:i,setFormatError:o}){let s=u(e.id),c=p(),l=S();return{save:()=>{o(null),i(!1),s.mutate({content:t,version:n},{onSuccess:()=>{r(null),m(`${e.exists?`Saved`:`Created`} ${e.label}`)},onError:e=>{e instanceof f&&e.status===409?l().then(()=>{c.getQueryData(a.health)?.capabilities.settingsAdmin===!1?m(e.message,{tone:`danger`}):i(!0)}):e instanceof f&&e.status===400?o(e.message):m(e.message,{tone:`danger`})}})},isSaving:s.isPending}}export{M as AgentConfigSection};
|
|
@@ -1 +0,0 @@
|
|
|
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,At as i,C as a,Ct as o,Gt as s,St as c,Tt as l,Wt as u,Xt as d,Zt as f,_ as p,an as m,dn as h,dt as g,jt as _,on as v,rn as y}from"./queries-hzlF788B.js";import{Fn as b,Jt as ee,P as x,Tr as S,a as C,hi as w,hn as T,n as E}from"./toaster-fWyfEGWF.js";import{s as D}from"./design-icons-CzEoMH9c.js";import{t as O}from"./button-B7MKxYjT.js";import{t as k}from"./switch-DKqVf8-p.js";import{t as A}from"./status-dot-BRzVlF2X.js";import{t as j}from"./centered-state-V15AR_qo.js";import{N as M,Tn as N,gn as te,j as ne,pn as re}from"./index-_LohQUeF.js";import{t as P}from"./textarea-vJt9undk.js";import{t as F}from"./settings-select-CCIMGnyA.js";import{a as I,i as L,n as R,r as z,t as B}from"./settings-agent-picker-DFTg6k6E.js";import{n as V}from"./saved-draft-BwzBc-_Y.js";import{t as H}from"./save-cue-Cd3ZAPBS.js";var U=e(t(),1),W=n(),G={connected:N(`connected`),disconnected:N(`disconnected`),"not-installed":N(`not-installed`),unknown:N(`unknown`)};function K(e,t,n){return{providers:e.providers.map(e=>e.provider===t?{...e,enabled:n}:e)}}function q(e,t){return e?G[e]:t?{label:`Checking…`,tone:`neutral`}:G.unknown}function J(e,t){return e===`unknown`||t&&!e}function Y({provider:e,state:t,current:n,statusIsError:r}){return t===`not-installed`?(0,W.jsxs)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:[`Install `,e.displayName,`, then run `,(0,W.jsx)(`code`,{children:e.loginCommand}),`.`]}):J(t,r)?(0,W.jsx)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:`Verification failed. Check again when the provider is available.`}):n?.hint?(0,W.jsx)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:n.hint}):null}function ie({provider:e,state:t,current:n,isConnecting:r,incidentId:i,refresh:a,connect:o,retry:s,queueToggle:c}){let l=t===`disconnected`||t===`unknown`;return(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t===`not-installed`?null:(0,W.jsx)(k,{checked:n?.enabled??!0,"aria-label":`Use ${e.displayName}`,onCheckedChange:t=>c(e.id,t)}),l?(0,W.jsx)(O,{type:`button`,variant:`ghost`,size:`sm`,disabled:a.isPending,onClick:()=>a.mutate(void 0,{onError:e=>E(e.message,{tone:`danger`})}),children:`Check again`}):null,t===`disconnected`&&e.browserLogin?(0,W.jsx)(R,{provider:e.id,label:e.displayName}):null,t===`disconnected`&&e.terminalLogin!==!1?(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(e.id),children:r?`Opening…`:`Connect`}):null,i===void 0?null:(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,disabled:s.isPending,onClick:()=>s.mutate({provider:e.id,authFailureId:i},{onSuccess:()=>E(`${e.displayName} can be tried again.`),onError:e=>E(e.message,{tone:`danger`})}),children:`Try again`})]})}function ae({manual:e,provider:t,connected:n,onCopy:r}){return e===null||e.provider!==t||n?null:(0,W.jsxs)(`div`,{role:`region`,"aria-label":`${e.label} manual sign-in`,className:`rounded-md border border-pending/40 bg-pending/5 px-3.5 py-3`,children:[(0,W.jsx)(`p`,{className:`text-[13px] text-foreground`,children:e.message}),(0,W.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto rounded-sm bg-muted px-2 py-1.5 text-xs`,children:e.command}),(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void r(e.command),children:`Copy command`})]})]})}function oe(){let e=y(),t=o(),n=l(),r=i(),a=w(),[c,u]=(0,U.useState)(null),p=(0,U.useRef)(Promise.resolve()),g=(0,U.useRef)({}),_=(0,U.useRef)({}),v=(0,U.useRef)(t.data);(0,U.useEffect)(()=>{c&&S(t.data,c.provider)?.status===`connected`&&u(null)},[c,t.data]),(0,U.useEffect)(()=>{if(t.data){if(Object.values(_.current).every(e=>e===0)||!v.current){v.current=t.data;return}v.current={providers:t.data.providers.map(e=>({...e,enabled:(_.current[e.provider]??0)>0?S(v.current,e.provider)?.enabled??e.enabled:e.enabled}))}}},[t.data]);let x=(0,U.useCallback)((e,t)=>{let n=s.providerStatus,r=a.getQueryData(n);if(!r)return;v.current||=r;let i=K(r,e,t);_.current[e]=(_.current[e]??0)+1,a.setQueryData(n,i);let o=(g.current[e]??0)+1;g.current[e]=o,p.current=p.current.then(async()=>{try{let r=await T(e,t),i=S(r,e)?.enabled;if(i===void 0)return;if(v.current=K(v.current??r,e,i),o===g.current[e]){let t=a.getQueryData(n);a.setQueryData(n,t?K(t,e,i):r)}}catch(t){if(o===g.current[e]){let r=S(v.current,e)?.enabled,i=a.getQueryData(n);i&&r!==void 0?a.setQueryData(n,K(i,e,r)):v.current?a.setQueryData(n,v.current):a.removeQueries({queryKey:n,exact:!0}),E(t instanceof Error?t.message:String(t),{tone:`danger`})}}finally{_.current[e]=(_.current[e]??0)-1}})},[a]),C=h({mutationFn:e=>ee(e),onSuccess:async(e,t)=>{u(null),E(e.opened?`Finish signing in in the terminal, then check again.`:`Provider is already connected.`),await a.invalidateQueries({queryKey:s.providerStatus}),await m(a,t,`none`)},onError:(t,n)=>{if(t instanceof b&&t.command){let r=d(e.data,n);u({provider:n,label:r,message:t.message,command:t.command});return}E(t.message,{tone:`danger`})}}),D=async e=>{try{await navigator.clipboard.writeText(e),E(`Command copied`)}catch{E(`Could not copy the command`,{tone:`danger`})}};return(0,W.jsxs)(`section`,{id:`providers`,"data-slot":`provider-settings`,className:`scroll-mt-20`,children:[(0,W.jsxs)(`div`,{className:`mb-2`,children:[(0,W.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Providers`}),(0,W.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Connect the coding agents available on this computer.`})]}),t.isError?(0,W.jsxs)(`div`,{role:`alert`,className:`mb-3 flex flex-wrap items-center justify-between gap-2 rounded-md border border-danger/30 bg-danger/5 px-3 py-2.5`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:`Provider status could not be loaded`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.error.message})]}),(0,W.jsx)(O,{type:`button`,variant:`outline`,size:`sm`,disabled:t.isFetching,onClick:()=>void t.refetch(),children:`Retry`})]}):null,(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:f(e.data).map(e=>{let i=S(t.data,e.id),a=i?.status,o=q(a,t.isPending),s=C.isPending&&C.variables===e.id,l=i?.authFailureId;return(0,W.jsxs)(U.Fragment,{children:[(0,W.jsxs)(`div`,{"data-slot":`provider-card`,"data-provider":e.id,className:`rounded-md border border-border bg-card px-3.5 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`h3`,{className:`text-[13px] font-semibold text-foreground`,children:e.displayName}),(0,W.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(A,{tone:o.tone,pulse:t.isPending}),(0,W.jsx)(`span`,{children:o.label}),i?.enabled===!1?(0,W.jsx)(`span`,{children:`Disabled`}):null]}),(0,W.jsx)(Y,{provider:e,state:a,current:i,statusIsError:t.isError})]}),(0,W.jsx)(ie,{provider:e,state:a,current:i,isConnecting:s,incidentId:l,refresh:n,connect:C,retry:r,queueToggle:x})]}),l===void 0?null:(0,W.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Use this after completing the provider sign-in flow. Squawk cannot validate the credential without a task/model request; it will verify it on the next task.`})]}),(0,W.jsx)(ae,{manual:c,provider:e.id,connected:a===`connected`,onCopy:D})]},e.id)})})]})}var X=2e4;function se(){let e=p(),t=y(),n=v(r(t.data)),i=o();return e.isPending?(0,W.jsx)(`p`,{"data-slot":`agents-loading`,className:`p-4 text-[13px] text-soft-foreground md:p-6`,children:`Loading agent settings…`}):e.isError?(0,W.jsx)(j,{icon:(0,W.jsx)(D,{}),tone:`danger`,title:`Agent settings did not load`,subtitle:e.error.message,heading:`h2`}):(0,W.jsx)(ce,{config:e.data,catalogs:n,providerStatus:i,runners:t.data})}function ce({config:e,catalogs:t,providerStatus:n,runners:r}){let i=a(),o=w(),s=h({mutationFn:e=>x(e),onSuccess:e=>{o.setQueryData(u.config,e),o.invalidateQueries({queryKey:u.health}),o.invalidateQueries({queryKey:u.repo})},onError:e=>E(e.message,{tone:`danger`})}),[c,l]=V(e.systemPrompt??``),d=c.trim(),p=d===(e.systemPrompt??``),m=d.length>X;return re(!p),(0,W.jsxs)(`div`,{"data-slot":`agent-defaults-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:[(0,W.jsx)(Z,{defaultRunner:e.defaultRunner,providerStatus:n,saving:s.isPending,onPick:e=>s.mutate({defaultRunner:e})}),(0,W.jsx)(Q,{title:`Default model`,hint:e.modelsLocked?`Models are locked to the defaults configured in the native coding-agent settings.`:`The model preselected in the composer for each runner. Auto lets the runner decide per task.`,children:(0,W.jsx)(`div`,{"data-slot":`agents-model-rows`,className:`flex flex-col gap-2.5`,children:f(r).map(i=>{let{providerConnected:a,providerReason:o}=I(n,i.id),c=t[i.id],l=ne(i.id,r,c),u=M(i.id,r,c?.data,[e.defaultModels[i.id]]),d=e.defaultModels[i.id]??``,f=u.find(e=>e.id===d)?.label??d??`auto (default)`;return(0,W.jsxs)(`label`,{className:`settings-option-row`,children:[(0,W.jsx)(`div`,{children:(0,W.jsx)(`h3`,{children:i.displayName})}),e.modelsLocked?(0,W.jsx)(`output`,{"aria-label":`Default model for ${i.pickerLabel}`,"data-slot":`agents-model`,"data-runner":i.id,title:`Model selection is locked to native coding-agent settings.`,className:`block rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs`,children:f}):(0,W.jsxs)(F,{"aria-label":`Default model for ${i.pickerLabel}`,"data-slot":`agents-model`,"data-runner":i.id,value:d,title:o??i.pickerDescription,disabled:s.isPending||!a,onChange:e=>s.mutate({defaultModels:{[i.id]:e.target.value||null}}),className:`block rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[u.map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.id===``?`Native agent default`:e.label},e.id)),l?(0,W.jsx)(`option`,{disabled:!0,children:l}):null]})]},i.id)})})}),(0,W.jsxs)(Q,{title:`System prompt`,hint:`Extra instructions for every run in this project.`,reportsDirty:!0,children:[(0,W.jsx)(P,{"aria-label":`System prompt`,"data-slot":`agents-system-prompt`,value:c,onChange:e=>l(e.target.value),placeholder:`Extra rules for every agent run — conventions, tone, review requirements…`,className:`min-h-48 w-full`}),(0,W.jsx)(le,{length:d.length,overLimit:m,saved:p,pending:s.isPending,onSave:()=>s.mutate({systemPrompt:d===``?null:d},{onSuccess:()=>E(d===``?`System prompt cleared`:`System prompt saved`)})})]}),(0,W.jsxs)(`section`,{"data-slot":`agents-task-runs`,className:`settings-field flex flex-col gap-5`,children:[(0,W.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:`Task runs`}),(0,W.jsx)($,{title:`Live title updates`,hint:`Refresh a task's short title through the namer model as the run progresses. A manual rename always wins and stops updates for that task.`,children:(0,W.jsxs)(`label`,{className:`flex w-fit items-center gap-3`,children:[(0,W.jsx)(k,{"aria-label":`Live title updates`,"data-slot":`agents-live-title-updates`,checked:e.liveTitleUpdates??!0,disabled:s.isPending,onCheckedChange:e=>s.mutate({liveTitleUpdates:e},{onSuccess:()=>E(e?`Live title updates on`:`Live title updates off`)})}),(0,W.jsxs)(`span`,{className:`text-[13px] text-muted-foreground`,children:[e.liveTitleUpdates??!0?`On`:`Off`,e.liveTitleUpdates===null&&` (default)`]})]})}),(0,W.jsx)($,{title:`Review changes before finishing`,hint:`When on, a task with changes pauses so you can Accept, Send back, or open a Draft PR. Autonomous tasks always skip this and finish on their own. Default: off — tasks finish without asking.`,children:(0,W.jsxs)(`label`,{className:`flex w-fit items-center gap-3`,children:[(0,W.jsx)(k,{"aria-label":`Review changes before finishing`,"data-slot":`agents-review-gate`,checked:e.reviewGate??!1,disabled:s.isPending,onCheckedChange:e=>s.mutate({reviewGate:e},{onSuccess:()=>E(e?`Review gate on`:`Review gate off`)})}),(0,W.jsxs)(`span`,{className:`text-[13px] text-muted-foreground`,children:[e.reviewGate??!1?`On`:`Off`,e.reviewGate===null&&` (default)`]})]})}),(0,W.jsx)($,{title:`Base branch`,hint:`New task worktrees branch from this and draft PRs target it. Also settable from the Git view.`,children:i.data?.info?(0,W.jsxs)(F,{"aria-label":`Base branch`,"data-slot":`agents-base-branch`,value:e.baseBranch??``,disabled:s.isPending,onChange:e=>s.mutate({baseBranch:e.target.value||null}),className:`block rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,W.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),i.data.branches.map(e=>(0,W.jsx)(`option`,{value:e,children:e},e))]}):(0,W.jsx)(`p`,{"data-slot":`agents-base-branch-unavailable`,className:`text-[13px] text-soft-foreground`,children:i.isPending?`Loading branches…`:`Not a git repository — tasks run in place, no branching.`})})]}),(0,W.jsxs)(`details`,{className:`settings-disclosure`,children:[(0,W.jsx)(`summary`,{children:`Provider connections`}),(0,W.jsx)(oe,{})]})]})}function Z({defaultRunner:e,providerStatus:t,saving:n,onPick:r}){let i=g(),o=c(),s=C(),l=a(),u=_(),d=s.projectId??`default`,f=l.data?.info?.root,p=te(i.data,s.projectId,f),m=y().data,h=z(i.data?.profiles??[],m),v=L(h,m);return(0,W.jsxs)(Q,{title:`Default runner`,hint:`Project defaults. A task can override these choices.`,children:[(0,W.jsx)(B,{rows:h,runner:e,accountFor:e=>p?.[e]??null,providerStatus:t,disabled:n,accountDisabled:u.isPending||o.data===void 0,onPick:(t,n,i)=>{t!==e&&r(t),i&&u.mutate({projectId:d,provider:t,profileId:n},{onError:e=>E(e.message,{tone:`danger`})})}}),!t.isPending&&!t.isError&&S(t.data,e)?.enabled===!1?(0,W.jsx)(`p`,{"data-slot":`agents-runner-disabled`,className:`text-[13px] text-muted-foreground`,children:`This provider is disabled. Enable it above or choose another provider.`}):null,v?(0,W.jsx)(`p`,{className:`max-w-md text-[13px] text-muted-foreground`,children:`The account is personal and never committed. Tasks already started under another account can’t be resumed here — their sessions live in that account’s folder.`}):null]})}function Q({title:e,hint:t,reportsDirty:n,children:r}){return(0,W.jsxs)(`section`,{"data-reports-dirty":n?``:void 0,className:`settings-field flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),(0,W.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:t})]}),r]})}function $({title:e,hint:t,children:n}){return(0,W.jsxs)(`section`,{className:`settings-option-row`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{children:e}),(0,W.jsx)(`p`,{children:t})]}),n]})}function le({length:e,overLimit:t,saved:n,pending:r,onSave:i}){return(0,W.jsxs)(W.Fragment,{children:[t?(0,W.jsxs)(`p`,{"data-slot":`agents-prompt-limit`,className:`text-xs text-danger`,children:[e.toLocaleString(),` characters — the limit is `,X.toLocaleString(),`.`]}):(0,W.jsx)(`p`,{"data-slot":`agents-prompt-help`,className:`text-xs text-muted-foreground`,children:`Leave empty and save to clear. Applied to new runs only.`}),(0,W.jsx)(`div`,{className:`settings-form-actions`,children:(0,W.jsx)(H,{show:n&&!t&&!r,children:(0,W.jsx)(O,{type:`button`,variant:`primary`,size:`sm`,"data-action":`agents-save-prompt`,disabled:n||t||r,onClick:i,children:`Save prompt`})})})]})}export{se as AgentDefaultsSection};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{St as n}from"./queries-hzlF788B.js";import{t as r}from"./createLucideIcon-BHp8sXmF.js";import{n as i,t as a}from"./moon-CRE9nU5R.js";import{t as o}from"./button-B7MKxYjT.js";import{Kn as s,ut as c,yn as l}from"./index-_LohQUeF.js";var u=r(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),d=e(),f=[{value:`system`,label:`System`,icon:i},{value:`light`,label:`Light`,icon:u},{value:`dark`,label:`Dark`,icon:a}],p=[{value:`cezarion`,label:`Squawk`,swatch:`var(--accent-strong)`}],m=[{value:`comfortable`,label:`Comfortable`},{value:`compact`,label:`Compact`},{value:`ultra`,label:`Ultra-compact`}],h=[{value:`narrow`,label:`Narrow`},{value:`wide`,label:`Wide`}];function g({slot:e,label:n,value:r,options:i,onChange:a}){return(0,d.jsx)(`div`,{role:`radiogroup`,"aria-label":n,"data-slot":e,className:`inline-flex w-fit gap-0.5 rounded-lg border border-border bg-muted/60 p-1 max-md:max-w-full max-md:flex-wrap`,children:i.map(e=>{let n=e.value===r;return(0,d.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,"data-value":e.value,onClick:()=>a(e.value),className:t(`flex min-h-11 items-center gap-2 whitespace-nowrap rounded-md border border-transparent px-3 py-1.5 text-[13px] font-medium transition-colors`,n?`border border-border bg-card text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[e.icon?(0,d.jsx)(e.icon,{"aria-hidden":`true`,className:`size-3.5`}):null,e.swatch?(0,d.jsx)(`span`,{"aria-hidden":`true`,className:`size-3 rounded-full border border-border`,style:{background:e.swatch}}):null,e.label]},e.value)})})}function _({title:e,hint:t,children:n}){return(0,d.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),(0,d.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:t})]}),n]})}function v(){let e=n(),{order:t,canReorder:r,reset:i}=l();return!((e.data?.projects.length??0)>1)||t.length===0?null:(0,d.jsx)(_,{title:`Project order`,hint:`The project rail is in the order you dragged it into. Reset puts it back in the order the projects were added. Saved with your workspace, so every browser sees it.`,children:(0,d.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,"data-slot":`appearance-project-order-reset`,disabled:!r,onClick:i,className:`w-fit`,children:`Reset order`})})}function y(){let{theme:e,setTheme:t}=s(),{accent:n,density:r,width:i,setAccent:a,setDensity:o,setWidth:l}=c();return(0,d.jsxs)(`div`,{"data-slot":`appearance-section`,className:`flex w-full flex-col gap-7 rounded-lg border border-border bg-card p-5`,children:[(0,d.jsx)(_,{title:`Theme`,hint:`System follows your OS preference. Applies to this browser.`,children:(0,d.jsx)(g,{slot:`appearance-theme`,label:`Theme`,value:e,options:f,onChange:t})}),p.length>1?(0,d.jsx)(_,{title:`Accent`,hint:`The cockpit brand accent. Saved with your workspace appearance.`,children:(0,d.jsx)(g,{slot:`appearance-accent`,label:`Accent`,value:n,options:p,onChange:a})}):null,(0,d.jsx)(_,{title:`Density`,hint:`Compact tightens spacing across the cockpit — text stays the same size.`,children:(0,d.jsx)(g,{slot:`appearance-density`,label:`Density`,value:r,options:m,onChange:o})}),(0,d.jsx)(_,{title:`Reading width`,hint:`Wide lets a task's session and commits use more of the screen. Narrow keeps a comfortable reading column. The Changes tab is always full-width.`,children:(0,d.jsx)(g,{slot:`appearance-width`,label:`Reading width`,value:i,options:h,onChange:l})}),(0,d.jsx)(v,{}),(0,d.jsxs)(`div`,{className:`settings-appearance-preview settings-readout`,children:[(0,d.jsx)(`span`,{className:`text-[12px] text-soft-foreground`,children:`PREVIEW`}),(0,d.jsx)(`p`,{className:`mt-3 text-base`,children:`Review finalization retries`}),(0,d.jsxs)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:[`Needs you · Squawk · Task `,`#`,`227`]}),(0,d.jsx)(`span`,{className:`mt-3 inline-flex rounded-md border border-border bg-card px-4 py-3 text-xs text-foreground shadow-xs`,children:`Open task`})]}),(0,d.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Changes apply immediately. Theme is browser-local; density and reading width are saved with your workspace.`})]})}export{y as AppearanceSection};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Gt as r,It as i,Wt as a,_ as o,dn as s}from"./queries-hzlF788B.js";import{P as c,hi as l,sn as u}from"./toaster-fWyfEGWF.js";import{t as d}from"./settings-select-CCIMGnyA.js";var f=e(t(),1),p=n();function m(){let e=o();return e.isPending?(0,p.jsx)(`p`,{role:`status`,children:`Loading task settings…`}):e.isError?(0,p.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Task settings did not load: `,e.error.message]}):(0,p.jsx)(g,{config:e.data,scope:`project`})}function h(){let e=i();return e.isPending?(0,p.jsx)(`p`,{role:`status`,className:`p-4 text-sm`,children:`Loading task settings…`}):e.isError?(0,p.jsxs)(`p`,{role:`alert`,className:`p-4 text-sm text-danger`,children:[`Task settings did not load: `,e.error.message]}):(0,p.jsx)(`div`,{className:`flex w-full flex-col gap-4`,children:(0,p.jsx)(g,{config:e.data,scope:`global`})})}function g({config:e,scope:t}){let n=(0,f.useId)(),i=l(),o=s({mutationFn:async({archiveOnMerge:e,projectKey:n})=>t===`project`?c({archiveOnMerge:e},n[0]):u({archiveOnMerge:e}),onSuccess:(e,{projectKey:n})=>{t===`project`?i.setQueryData(n,e):(i.setQueryData(r.config,e),i.invalidateQueries({predicate:e=>e.queryKey.at(-1)===`config`&&e.queryKey!==r.config}))}});return(0,p.jsxs)(`section`,{"data-slot":`archive-on-merge-field`,className:`flex min-w-0 flex-col gap-3`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`label`,{htmlFor:n,className:`text-sm font-semibold text-foreground`,children:`Archive tasks after PRs merge`}),(0,p.jsx)(`p`,{id:`${n}-hint`,className:`text-[13px] text-muted-foreground`,children:`Automatically archive a settled task and its workers once all their associated pull requests merge. History stays available in Archived.`})]}),(0,p.jsxs)(d,{id:n,"aria-describedby":`${n}-hint ${n}-effective`,className:`min-h-11 w-64 max-w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-2 focus-visible:outline-ring active:bg-muted disabled:opacity-50`,value:e.archiveOnMerge===null?`inherit`:e.archiveOnMerge?`enabled`:`disabled`,disabled:o.isPending,onChange:e=>o.mutate({archiveOnMerge:e.target.value===`inherit`?null:e.target.value===`enabled`,projectKey:a.config}),children:[(0,p.jsx)(`option`,{value:`inherit`,children:t===`project`?`Inherit global setting`:`Use default`}),(0,p.jsx)(`option`,{value:`enabled`,children:`Enabled`}),(0,p.jsx)(`option`,{value:`disabled`,children:`Disabled`})]}),(0,p.jsxs)(`p`,{id:`${n}-effective`,className:`text-[13px] text-muted-foreground`,children:[`Currently `,e.effectiveArchiveOnMerge?`enabled`:`disabled`,` · `,e.archiveOnMergeSource,` setting.`]}),(0,p.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Unarchive restores the task. It stays visible until a later associated PR merges.`}),o.isPending?(0,p.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Saving…`}):null,o.isError?(0,p.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not save: `,o.error.message]}):null]})}export{m as ArchiveOnMergeField,h as TasksSection};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{An as e,Tn as t}from"./toaster-fWyfEGWF.js";function n(n){return t[e(n).bucket]<=t.waiting}export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{r}from"./button-B7MKxYjT.js";import{t as i}from"./dist-BW234Kg5.js";e();var a=t(),o=r(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-accent-strong text-accent-strong-foreground [a&]:hover:bg-accent-strong/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-destructive-foreground focus-visible:ring-destructive/20 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-link-foreground underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function s({className:e,variant:t=`default`,asChild:r=!1,...s}){return(0,a.jsx)(r?i:`span`,{"data-slot":`badge`,"data-variant":t,className:n(o({variant:t}),e),...s})}export{s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{r}from"./bundle-mjs-rHxsej31.js";import{t as i}from"./dist-BW234Kg5.js";e();var a=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,o=r,s=(e,t)=>n=>{if(t?.variants==null)return o(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,s=Object.keys(r).map(e=>{let t=n?.[e],o=i?.[e];if(t===null)return null;let s=a(t)||a(o);return r[e][s]}),c=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return o(e,s,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...c}[t]):{...i,...c}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},c=t(),l=s(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-hidden focus-visible:ring-[3px] focus-visible:ring-ring/50 enabled:active:brightness-90 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-action text-action-foreground pointer-hover:brightness-[0.96] disabled:border disabled:border-border disabled:bg-muted/80 disabled:text-muted-foreground disabled:opacity-100`,contrast:`bg-contrast text-contrast-foreground pointer-hover:brightness-[0.96]`,outline:`border border-border bg-card text-foreground pointer-hover:bg-muted`,ghost:`text-muted-foreground pointer-hover:bg-muted pointer-hover:text-foreground`,"danger-ghost":`text-danger pointer-hover:bg-danger/10`},size:{default:`h-11 px-3.5 text-[13px]`,sm:`h-[30px] rounded-sm px-2.5 text-[13px]`,icon:`size-9 text-[13px]`,"icon-sm":`size-[30px] rounded-sm text-[13px]`}},defaultVariants:{variant:`primary`,size:`default`}});function u({className:e,variant:t=`primary`,size:r=`default`,asChild:a=!1,...o}){return(0,c.jsx)(a?i:`button`,{"data-slot":`button`,"data-variant":t,"data-size":r,className:n(l({variant:t,size:r,className:e})),...o})}export{l as n,s as r,u as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";var n=e(),r={primary:`border-accent-strong/25 bg-accent-strong/15 text-link-foreground`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function i({icon:e,tone:i=`neutral`,title:a,subtitle:o,children:c,actions:l,backdrop:u=!1,heading:d=`h1`,className:f}){return(0,n.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":i,className:t(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,f),children:[u?(0,n.jsx)(s,{}):null,(0,n.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,n.jsx)(`div`,{"data-slot":`centered-state-tile`,className:t(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,r[i]),children:e}),(0,n.jsx)(d,{className:`text-2xl font-semibold text-balance text-foreground`,children:a}),o?(0,n.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:o}):null,c?(0,n.jsx)(`div`,{className:`w-full pt-2`,children:c}):null,l?(0,n.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:l}):null]})]})}var a=[{top:`6%`,left:`14%`,size:2,tone:`accent`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`accent`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`accent`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`accent`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`accent`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`accent`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`accent`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`accent`,opacity:.22}],o={accent:`bg-accent-strong`,primary:`bg-action`,pending:`bg-pending`};function s({className:e}){return(0,n.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:t(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,e),children:a.map((e,r)=>(0,n.jsx)(`span`,{className:t(`absolute rounded-[1px] motion-safe:animate-pulse`,e.size===3?`size-[3px]`:`size-0.5`,o[e.tone]),style:{top:e.top,left:e.left,opacity:e.opacity,animationDuration:`3.5s`,animationDelay:`${r%5*700}ms`}},r))})}export{s as n,i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";var n=e();function r({adds:e,dels:r,className:i}){return e<=0&&r<=0?null:(0,n.jsxs)(`span`,{"data-slot":`change-counts`,className:t(`shrink-0 whitespace-nowrap tabular-nums`,i),children:[e>0?(0,n.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,e.toLocaleString(`en-US`)]}):null,e>0&&r>0?` `:null,r>0?(0,n.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,r.toLocaleString(`en-US`)]}):null]})}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r,t as i}from"./utils-DSMR_WLb.js";import{X as a}from"./design-icons-CzEoMH9c.js";import{i as o}from"./dist-BW234Kg5.js";import{a as s}from"./dist-C5mlVBmd.js";import{l as c}from"./es2015-CQth82uv.js";import{a as l,o as u,r as d,t as f}from"./dist-Da4ckcJG.js";import{i as p,o as m,r as h,s as g,t as _}from"./dialog-B531GGAo.js";var v=e(t(),1),y=1,b=.9,x=.8,S=.17,C=.1,w=.999,T=.9999,E=.99,D=/[\\\/_+.#"@\[\(\{&]/,O=/[\\\/_+.#"@\[\(\{&]/g,k=/[\s-]/,A=/[\s-]/g;function j(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?y:E;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=j(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=y:D.test(e.charAt(l-1))?(d*=x,p=e.slice(i,l-1).match(O),p&&i>0&&(d*=w**+p.length)):k.test(e.charAt(l-1))?(d*=b,m=e.slice(i,l-1).match(A),m&&i>0&&(d*=w**+m.length)):(d*=S,i>0&&(d*=w**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=T)),(d<C&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=j(e,t,n,r,l+1,a+2,o),f*C>d&&(d=f*C)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function M(e){return e.toLowerCase().replace(A,` `)}function N(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,j(e,t,M(e),M(t),0,0,{})}var P=`[cmdk-group=""]`,F=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,I=`[cmdk-item=""]`,L=`${I}:not([aria-disabled="true"])`,R=`cmdk-item-select`,z=`data-value`,te=(e,t,n)=>N(e,t,n),ne=v.createContext(void 0),B=()=>v.useContext(ne),re=v.createContext(void 0),V=()=>v.useContext(re),H=v.createContext(void 0),U=v.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),l=J(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:y=!0,...b}=e,x=c(),S=c(),C=c(),w=v.useRef(null),T=fe();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,E.emit()}},[f]),Y(()=>{T(6,M)},[]);let E=v.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)j(),k(),T(1,A);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(C);e?e.focus():(i=document.getElementById(x))==null||i.focus()}if(T(7,()=>{n.current.selectedItemId=N()?.id,E.emit()}),r||T(5,M),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),D=v.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,O(t,r)),T(2,()=>{k(),E.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),T(3,()=>{j(),k(),n.current.value||A(),E.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=N();T(4,()=>{j(),t?.getAttribute(`id`)===e&&A(),E.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:x,inputId:C,labelId:S,listInnerRef:w}),[]);function O(e,t){let r=l.current?.filter??te;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=w.current;B().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(F);t?t.appendChild(e.parentElement===t?e:e.closest(`${F} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${F} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=w.current?.querySelector(`${P}[${z}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function A(){let e=B().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(z);E.setState(`value`,e||void 0)}function j(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=O(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function M(){var e;let t=N();t&&(t.parentElement?.firstChild===t&&((e=t.closest(P)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function N(){return w.current?.querySelector(`${I}[aria-selected="true"]`)}function B(){return Array.from(w.current?.querySelectorAll(L)||[])}function V(e){let t=B()[e];t&&E.setState(`value`,t.getAttribute(z))}function H(e){var t;let n=N(),r=B(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&E.setState(`value`,a.getAttribute(z))}function U(e){let t=N()?.closest(P),n;for(;t&&!n;)t=e>0?le(t,P):ue(t,P),n=t?.querySelector(L);n?E.setState(`value`,n.getAttribute(z)):H(e)}let W=()=>V(B().length-1),G=e=>{e.preventDefault(),e.metaKey?W():e.altKey?U(1):H(1)},K=e=>{e.preventDefault(),e.metaKey?V(0):e.altKey?U(-1):H(-1)};return v.createElement(s.div,{ref:t,tabIndex:-1,...b,"cmdk-root":``,onKeyDown:e=>{var t;(t=b.onKeyDown)==null||t.call(b,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:y&&e.ctrlKey&&G(e);break;case`ArrowDown`:G(e);break;case`p`:case`k`:y&&e.ctrlKey&&K(e);break;case`ArrowUp`:K(e);break;case`Home`:e.preventDefault(),V(0);break;case`End`:e.preventDefault(),W();break;case`Enter`:{e.preventDefault();let t=N();if(t){let e=new Event(R);t.dispatchEvent(e)}}}}},v.createElement(`label`,{"cmdk-label":``,htmlFor:D.inputId,id:D.labelId,style:me},u),Q(e,e=>v.createElement(re.Provider,{value:E},v.createElement(ne.Provider,{value:D},e))))}),W=v.forwardRef((e,t)=>{let n=c(),r=v.useRef(null),i=v.useContext(H),a=B(),l=J(e),u=l.current?.forceMount??i?.forceMount;Y(()=>{if(!u)return a.item(n,i?.id)},[u]);let d=de(n,r,[e.value,e.children,r],e.keywords),f=V(),p=Z(e=>e.value&&e.value===d.current),m=Z(e=>u||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);v.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(R,h),()=>t.removeEventListener(R,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:y,onSelect:b,forceMount:x,keywords:S,...C}=e;return v.createElement(s.div,{ref:o(r,t),...C,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||a.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),G=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,l=c(),u=v.useRef(null),d=v.useRef(null),f=c(),p=B(),m=Z(e=>i||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));Y(()=>p.group(l),[]),de(l,u,[e.value,e.heading,d]);let h=v.useMemo(()=>({id:l,forceMount:i}),[i]);return v.createElement(s.div,{ref:o(u,t),...a,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&v.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Q(e,e=>v.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},v.createElement(H.Provider,{value:h},e))))}),K=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:v.createElement(s.div,{ref:o(i,t),...r,"cmdk-separator":``,role:`separator`})}),ie=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=V(),o=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=B();return v.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),v.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),ae=v.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=v.useRef(null),c=v.useRef(null),l=Z(e=>e.selectedItemId),u=B();return v.useEffect(()=>{if(c.current&&a.current){let e=c.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),v.createElement(s.div,{ref:o(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Q(e,e=>v.createElement(`div`,{ref:o(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),oe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return v.createElement(f,{open:n,onOpenChange:r},v.createElement(u,{container:o},v.createElement(l,{"cmdk-overlay":``,className:i}),v.createElement(d,{"aria-label":e.label,"cmdk-dialog":``,className:a},v.createElement(U,{ref:t,...s}))))}),se=v.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?v.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ce=v.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return v.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>v.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(U,{List:ae,Item:W,Input:ie,Group:G,Separator:K,Dialog:oe,Empty:se,Loading:ce});function le(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function J(e){let t=v.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?v.useEffect:v.useLayoutEffect;function X(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=V(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function de(e,t,n,r=[]){let i=v.useRef(),a=B();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(z,s),i.current=s}),i}var fe=()=>{let[e,t]=v.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function pe(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(pe(t),{ref:t.ref},n(t.props.children)):n(t)}var me={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function he({className:e,...t}){return(0,$.jsx)(q,{"data-slot":`command`,className:i(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ge({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:a,showCloseButton:o=!0,filter:s,...c}){return(0,$.jsxs)(_,{...c,children:[(0,$.jsxs)(m,{className:`sr-only`,children:[(0,$.jsx)(g,{children:e}),(0,$.jsx)(p,{children:t})]}),(0,$.jsx)(h,{className:i(`overflow-hidden p-0`,a),showCloseButton:o,children:(0,$.jsx)(he,{...r({filter:s}),className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function _e({className:e,...t}){return(0,$.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-ss-[inherit] rounded-se-[inherit] border-b px-3`,children:[(0,$.jsx)(a,{className:`size-4 shrink-0 opacity-50`}),(0,$.jsx)(q.Input,{"data-slot":`command-input`,className:i(`flex h-11 min-w-0 flex-1 rounded-md bg-transparent py-3 text-base md:text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function ve({className:e,onPointerMoveCapture:t,...n}){return(0,$.jsx)(q.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:i(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ye({...e}){return(0,$.jsx)(q.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function be({className:e,...t}){return(0,$.jsx)(q.Group,{"data-slot":`command-group`,className:i(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(q.Separator,{"data-slot":`command-separator`,className:i(`-mx-1 h-px bg-border`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(q.Item,{"data-slot":`command-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(`span`,{"data-slot":`command-shortcut`,className:i(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}export{_e as a,xe as c,be as i,Ce as l,ge as n,Se as o,ye as r,ve as s,he as t};
|
|
@@ -1 +0,0 @@
|
|
|
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-DSMR_WLb.js";import{Fn as i}from"./toaster-fWyfEGWF.js";import{X as a,j as o,ot as s,r as c}from"./design-icons-CzEoMH9c.js";import{n as l}from"./diff-controls-n4THBHKo.js";import{l as u}from"./reference-chip-Dgo5aKeb.js";import{t as d}from"./button-B7MKxYjT.js";import{t as f}from"./project-router-B9FTk0rB.js";import{t as p}from"./centered-state-V15AR_qo.js";import{An as m,Bt as h,Nn as g,Zn as _,Zt as v,s as y,zt as b}from"./index-_LohQUeF.js";import{t as x}from"./diff-BUeqeifm.js";var S=e(t(),1),C=n();function w({commit:e,sha:t,backTo:n,backLabel:r,slot:a,className:h,diffClassName:_}){let y=v(),[w,T]=(0,S.useState)(`unified`),[E,D]=(0,S.useState)(!0),O=e.isError&&e.error instanceof i&&e.error.status===409,k=y?w:`unified`;return(0,C.jsxs)(`section`,{"data-slot":a,"data-sha":t,className:h,children:[(0,C.jsxs)(`div`,{className:`mx-4 flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border py-2 md:mx-9`,children:[(0,C.jsx)(d,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,C.jsxs)(f,{to:n,children:[(0,C.jsx)(c,{size:16,"aria-hidden":`true`}),r]})}),(0,C.jsx)(`span`,{className:`ml-auto flex items-center gap-1`,children:(0,C.jsx)(l,{mode:w,wrap:E,onModeChange:T,onWrapChange:D})})]}),e.isPending?(0,C.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-muted-foreground md:px-9`,children:`Loading commit…`}):e.isError?(0,C.jsx)(p,{icon:O?(0,C.jsx)(u,{}):(0,C.jsx)(s,{size:16}),tone:O?`neutral`:`danger`,heading:`h2`,title:O?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{"data-slot":`commit-meta`,className:`mx-4 border-b border-border py-3 md:mx-9`,children:[(0,C.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,C.jsxs)(`p`,{className:`mt-0.5 flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,C.jsx)(`span`,{children:e.data.author}),(0,C.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,C.jsx)(`span`,{title:e.data.when,children:b(e.data.when)}),(0,C.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,C.jsx)(g,{sha:e.data.sha,variant:`inline`}),(0,C.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,C.jsx)(`span`,{"data-slot":`commit-stat`,children:(0,C.jsx)(m,{stat:e.data.stat})})]})]}),e.data.files.length===0?(0,C.jsx)(p,{icon:(0,C.jsx)(o,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,C.jsx)(`div`,{className:_,children:(0,C.jsx)(x,{files:e.data.files,mode:k,wrap:E,totals:!1,className:`min-w-0`})})]})]})}var T=56;function E({slot:e,commits:t,selectedSha:n,className:i,heading:o}){let[s,c]=(0,S.useState)(``),l=s.trim().toLowerCase(),u=l?t.filter(e=>e.subject.toLowerCase().includes(l)):t,d=u.length>150,f=(0,S.useRef)(null),p=(0,S.useRef)(null),[m,h]=(0,S.useState)(0);(0,S.useLayoutEffect)(()=>{if(!d)return;let e=()=>{let e=f.current,t=p.current;!e||!t||h(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[d]);let g=u.map(e=>(0,C.jsx)(D,{commit:e,selected:n!==void 0&&e.sha===n},e.sha));return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`label`,{className:`relative mb-3 block`,children:[(0,C.jsx)(a,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3 left-3 size-4 text-muted-foreground`}),(0,C.jsx)(_,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:s,onChange:e=>c(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-10`})]}),(0,C.jsxs)(`div`,{ref:e=>{f.current=e,e&&(p.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":d,className:r(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-3 py-1 md:px-4`,i),children:[o?(0,C.jsx)(`div`,{className:`flex min-h-11 flex-wrap items-center gap-2 py-2.5`,children:o}):null,u.length===0?(0,C.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,d?(0,C.jsx)(y,{scrollRef:p,startMargin:m,itemSize:T,children:g}):g]})]})}function D({commit:e,selected:t}){return(0,C.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_56px] [content-visibility:auto]`,children:(0,C.jsxs)(f,{"data-slot":`commit-row`,"data-sha":e.sha,"data-selected":t?`true`:void 0,"aria-current":t?`true`:void 0,to:e.href,className:r(`flex min-h-11 min-w-0 items-start gap-2.5 rounded-md px-2 py-2.5 transition-colors hover:bg-muted`,t&&`bg-muted/70`),children:[(0,C.jsx)(o,{size:16,"aria-hidden":`true`,className:`mt-px size-4 shrink-0 text-accent-text`}),(0,C.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,C.jsx)(`span`,{"data-slot":`commit-row-subject`,title:e.subject,className:`line-clamp-2 text-[13px] leading-snug font-medium break-words text-foreground`,children:e.subject}),(0,C.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground`,children:[(0,C.jsx)(O,{sha:e.sha}),(0,C.jsxs)(`span`,{className:`min-w-0 truncate`,children:[e.author,` · `,(0,C.jsx)(`span`,{title:h(e.when,e.at),children:b(e.when,e.at)})]}),e.stat?(0,C.jsx)(m,{stat:e.stat}):null]})]})]})})}function O({sha:e}){return(0,C.jsx)(g,{"data-slot":`commit-sha`,sha:e,variant:`chip`})}export{O as n,w as r,E as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{ft as r}from"./design-icons-CzEoMH9c.js";import{t as i}from"./button-B7MKxYjT.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-Da4ckcJG.js";e();var f=t();function p({...e}){return(0,f.jsx)(d,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(c,{"data-slot":`dialog-portal`,...e})}function h({className:e,...t}){return(0,f.jsx)(a,{"data-slot":`dialog-overlay`,className:n(`fixed inset-0 z-50 bg-black/50 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function g({className:e,children:t,showCloseButton:i=!0,overlayClassName:a,...o}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{className:a}),(0,f.jsxs)(l,{"data-slot":`dialog-content`,className:n(`fixed inset-bs-[50%] start-[50%] z-50 grid max-h-[calc(100dvh-2rem)] overflow-y-auto overscroll-contain w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-hidden motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...o,children:[t,i&&(0,f.jsxs)(s,{"data-slot":`dialog-close`,className:`absolute inset-bs-4 end-4 rounded-sm opacity-70 ring-offset-background transition-opacity pointer-hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(r,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:n(`flex shrink-0 flex-col gap-2 text-center sm:text-start`,e),...t})}function v({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-body`,className:n(`min-h-0 min-w-0 overflow-y-auto overscroll-contain`,e),...t})}function y({className:e,showCloseButton:t=!1,children:r,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:n(`flex shrink-0 flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...a,children:[r,t&&(0,f.jsx)(s,{asChild:!0,children:(0,f.jsx)(i,{variant:`outline`,children:`Close`})})]})}function b({className:e,...t}){return(0,f.jsx)(u,{"data-slot":`dialog-title`,className:n(`text-lg leading-none font-semibold`,e),...t})}function x({className:e,...t}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:n(`text-sm text-muted-foreground`,e),...t})}export{y as a,x as i,v as n,_ as o,g as r,b as s,p as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-mEcoOmP6.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/utils-DSMR_WLb.js","assets/bundle-mjs-rHxsej31.js","assets/chevron-right-BENZ-1ZN.js","assets/createLucideIcon-BHp8sXmF.js","assets/eye-B8okNWXU.js","assets/diff-stat-C7KB1kDX.js","assets/index-_LohQUeF.js","assets/queries-hzlF788B.js","assets/toaster-fWyfEGWF.js","assets/live-protocol-DMhTnCmf.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-Cg8l-LDN.js","assets/label-DMC9mkYa.js","assets/cez-idle-CdswdDRd.js","assets/run-detail-refresh-Ye2jcT7n.js","assets/dist-C5mlVBmd.js","assets/dist-BW234Kg5.js","assets/tasks-table-D17JLOhe.js","assets/attention-ILOaW2-t.js","assets/task-groups-DD46syqv.js","assets/design-icons-CzEoMH9c.js","assets/open-in-menu-VhRao_Jk.js","assets/bot-TkDIw4y-.js","assets/external-link-BE6y205O.js","assets/folder-o-AvL3y3.js","assets/smartphone-Lr8Ug2z_.js","assets/square-terminal-B6RYYieR.js","assets/button-B7MKxYjT.js","assets/dropdown-menu-4e2iKSMT.js","assets/es2015-CQth82uv.js","assets/dist-BAoXdNsT.js","assets/dist-DXO3xwbC.js","assets/own-lookup-DS54wXvD.js","assets/check-OP-CVgZG.js","assets/chevron-down-CHGyCDBH.js","assets/nav-row-styles-D5HpOmDZ.js","assets/folder-browser-B_jJl4is.js","assets/loader-circle-CPBhhDbB.js","assets/play-CmVAj_fu.js","assets/reference-chip-Dgo5aKeb.js","assets/popover-CZV6tz9i.js","assets/dist-Da4ckcJG.js","assets/switch-DKqVf8-p.js","assets/dist-Czz3Y5qH.js","assets/badge-DQ3U69Ht.js","assets/dialog-B531GGAo.js","assets/project-router-B9FTk0rB.js","assets/status-dot-BRzVlF2X.js","assets/report-selection-C-2DJb8L.js","assets/use-search-params-writer-ClMScnNe.js","assets/format-BU7D3IfE.js","assets/command-KdW7aO0N.js","assets/project-order-AcHI4Dcl.js","assets/skills-pM_PouEs.js","assets/agents-settings-path-7X6_cvUg.js","assets/page-shell-7pLJMOgh.js","assets/page-shell-DQPYcKyL.css","assets/centered-state-V15AR_qo.js","assets/index-DOVwFCfP.css","assets/highlighter-DvLzHjjY.js","assets/image-preview-DCUeM8u3.js","assets/zoomable-image-6RTKhLGE.js","assets/markdown-BBDDg-4t.js","assets/markdown-DJkMnwyc.js","assets/chunk-BO2N2NFS-DQrpGzb-.js","assets/lib-DrPFkMXk.js","assets/html-report-BX3msvci.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-DSMR_WLb.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{t as a}from"./diff-stat-C7KB1kDX.js";import{n as o,r as s,t as c}from"./image-preview-DCUeM8u3.js";var l=e(t(),1),u=n();function d(e){let[t,n]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-mEcoOmP6.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,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69])),()=>{e=!0}},[]),e.files.length===0?(0,u.jsx)(`p`,{"data-slot":`diff-empty`,className:r(`px-1 text-xs text-muted-foreground`,e.className),children:`No changes.`}):t===`failed`?(0,u.jsx)(f,{...e}):t===null?(0,u.jsx)(`p`,{"data-slot":`diff-loading`,className:r(`px-1 text-xs text-muted-foreground`,e.className),children:`Loading diff…`}):(0,u.jsx)(t.View,{...e})}function f({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:i,viewRef:a,totals:o=!0,actions:c,className:d}){let f={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},m=(0,l.useRef)(null);return(0,l.useImperativeHandle)(a,()=>({scrollToPath:e=>{for(let t of m.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,u.jsxs)(`div`,{ref:m,"data-slot":`diff`,"data-fallback":`true`,className:r(`flex min-w-0 flex-col gap-3`,d),children:[(0,u.jsxs)(`div`,{"data-slot":`diff-header`,hidden:!o&&!c,className:`flex min-h-9 flex-wrap items-center gap-x-2 gap-y-1.5 px-1`,children:[(0,u.jsx)(s,{stat:f,hidden:!o}),c?(0,u.jsx)(`div`,{"data-slot":`diff-actions`,className:`ms-auto flex items-center gap-1.5`,children:c}):null]}),e.map(e=>(0,u.jsx)(p,{file:e,wrap:t,imageSrc:n,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function p({file:e,wrap:t,imageSrc:n,onOpenInApp:i}){let s=e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,u.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,u.jsxs)(`header`,{className:`flex items-start gap-2 border-b border-border px-3 py-2`,children:[(0,u.jsx)(`span`,{"data-slot":`diff-file-path`,title:s,className:`min-w-0 wrap-anywhere font-mono text-xs font-medium`,children:s}),(0,u.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,u.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-xs`})})]}),o(e)?(0,u.jsx)(c,{file:e,imageSrc:n,onOpenInApp:i}):e.binary?(0,u.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,u.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`No content changes (metadata only).`}):(0,u.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
|
-
`).map((e,t)=>(0,u.jsxs)(`span`,{className:r(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-muted-foreground`),children:[e,e===``?` `:``]},t))})]})}export{d as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{A as n,_ as r}from"./design-icons-CzEoMH9c.js";import{t as i}from"./createLucideIcon-BHp8sXmF.js";import{t as a}from"./button-B7MKxYjT.js";import{or as o}from"./index-_LohQUeF.js";var s=i(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),c=i(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),l=e();function u({mode:e,wrap:t,onModeChange:n,onWrapChange:r,disabled:i=!1}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`inline-flex items-center rounded-lg border border-border bg-card p-0.5 max-md:hidden`,children:[(0,l.jsx)(h,{current:e,value:`unified`,onModeChange:n,disabled:i}),(0,l.jsx)(h,{current:e,value:`split`,onModeChange:n,disabled:i})]}),(0,l.jsx)(p,{wrap:t,onWrapChange:r,disabled:i})]})}var d=`Unavailable while Markdown preview is on`;function f(){return(0,l.jsx)(`span`,{"data-slot":`markdown-preview-hint`,role:`status`,className:`text-xs text-muted-foreground max-sm:sr-only`,children:`Full-document preview — layout and wrap are off`})}function p({wrap:e,onWrapChange:n,className:r=`size-11 rounded-lg`,disabled:i=!1}){return(0,l.jsx)(a,{variant:`outline`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":e,"aria-label":`Wrap long lines`,title:i?d:`Wrap long lines`,disabled:i,className:t(r,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:(0,l.jsx)(c,{"aria-hidden":`true`})})}function m({preview:e,onPreviewChange:n}){return(0,l.jsxs)(a,{variant:`outline`,size:`sm`,"data-slot":`markdown-preview-toggle`,"aria-pressed":e,"aria-label":`Preview Markdown`,title:e?`Show Markdown as a diff`:`Preview Markdown`,className:t(`h-11 min-w-11 gap-1.5 rounded-lg px-0 text-xs font-medium sm:px-3`,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:[(0,l.jsx)(o,{"aria-hidden":`true`,className:`size-4`}),(0,l.jsx)(`span`,{"aria-hidden":`true`,className:`max-sm:hidden`,children:`Preview MD`})]})}function h({current:e,value:n,onModeChange:i,disabled:a}){let o=e===n;return(0,l.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":o,disabled:a,title:a?d:void 0,onClick:()=>i(n),className:t(`inline-flex min-h-11 items-center gap-1.5 rounded-md px-3 text-xs font-medium capitalize transition-colors outline-hidden focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,o?`bg-muted text-foreground`:`text-muted-foreground pointer-hover:text-foreground`),children:[n===`unified`?(0,l.jsx)(s,{"aria-hidden":`true`,className:`size-4`}):(0,l.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function g({branch:e}){return(0,l.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-xs font-medium`,children:[(0,l.jsx)(n,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}export{p as a,m as i,u as n,f as r,g as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";var n=e();function r(e){if(e<1e3)return String(e);let t=[`k`,`M`,`B`,`T`],n=Math.floor(Math.log10(e)/3);return n>t.length?e.toExponential(0).replace(`+`,``):`${Math.floor(e/1e3**n)}${t[n-1]}`}function i({stat:e,className:i,compact:a=!1}){let o=`+${e.adds} −${e.dels} across ${e.files} ${e.files===1?`file`:`files`}`,s=e.repointed?`${o} — measured against another branch checked out in this task's worktree, as this task found it`:void 0;return(0,n.jsxs)(`span`,{"data-slot":`diff-stat`,...s?{"data-repointed":`true`,"aria-label":s}:{},...a&&!s?{"aria-label":o}:{},title:s??o,className:t(`font-mono! text-xs font-semibold tabular-nums`,e.repointed&&`cursor-help underline decoration-dotted underline-offset-2`,i),children:[e.adds===0&&e.dels===0?(0,n.jsx)(`span`,{"data-zero":!0,className:`text-muted-foreground`,children:`—`}):null,e.adds>0?(0,n.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,a?r(e.adds):e.adds.toLocaleString(`en-US`)]}):null,e.adds>0&&e.dels>0?` `:null,e.dels>0?(0,n.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,a?r(e.dels):e.dels.toLocaleString(`en-US`)]}):null]})}export{i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";var n=e(t(),1);function r(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function i(...e){return t=>{let n=!1,i=e.map(e=>{let i=r(e,t);return!n&&typeof i==`function`&&(n=!0),i});if(n)return()=>{for(let t=0;t<i.length;t++){let n=i[t];typeof n==`function`?n():r(e[t],null)}}}}function a(...e){return n.useCallback(i(...e),e)}function o(e){let t=n.forwardRef((t,r)=>{let{children:i,...o}=t,s=null,c=!1,l=[];h(i)&&typeof y==`function`&&(i=y(i._payload)),n.Children.forEach(i,e=>{if(p(e)){c=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;h(n)&&typeof y==`function`&&(n=y(n._payload)),s=u(t,n),l.push(s?.props?.children)}else l.push(e)}),s?s=n.cloneElement(s,void 0,l):!c&&n.Children.count(i)===1&&n.isValidElement(i)&&(s=i);let m=s?f(s):void 0,g=a(r,m);if(!s){if(i||i===0)throw Error(c?v(e):_(e));return i}let b=d(o,s.props??{});return s.type!==n.Fragment&&(b.ref=r?g:m),n.cloneElement(s,b)});return t.displayName=`${e}.Slot`,t}var s=o(`Slot`),c=Symbol.for(`radix.slottable`);function l(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=c,t}var u=(e,t)=>{if(`child`in e.props){let t=e.props.child;return n.isValidElement(t)?n.cloneElement(t,void 0,e.props.children(t.props.children)):null}return n.isValidElement(t)?t:null};function d(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function f(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function p(e){return n.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===c}var m=Symbol.for(`react.lazy`);function h(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===m&&`_payload`in e&&g(e._payload)}function g(e){return typeof e==`object`&&!!e&&`then`in e}var _=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,v=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,y=n.use;export{a,i,o as n,l as r,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r,t as i}from"./utils-DSMR_WLb.js";import{c as a,m as o,u as s}from"./design-icons-CzEoMH9c.js";import{a as c,n as l}from"./dist-BW234Kg5.js";import{a as u,i as d,n as f,o as p,r as m,t as h}from"./dist-C5mlVBmd.js";import{a as g,c as _,i as v,l as y,n as b,o as ee,r as x,t as S,u as C}from"./es2015-CQth82uv.js";import{a as w,i as T,n as te,r as ne,t as E}from"./dist-BAoXdNsT.js";var D=e(t(),1),O=n();function k(e){let t=e+`CollectionProvider`,[n,r]=d(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=D.useRef(null),a=D.useRef(new Map).current;return(0,O.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,u=l(s),f=D.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=c(t,a(s,n).collectionRef);return(0,O.jsx)(u,{ref:i,children:r})});f.displayName=s;let p=e+`CollectionItemSlot`,m=`data-radix-collection-item`,h=l(p),g=D.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=D.useRef(null),s=c(t,o),l=a(p,n);return D.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,O.jsx)(h,{[m]:``,ref:s,children:r})});g.displayName=p;function _(t){let n=a(e+`CollectionConsumer`,t);return D.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:f,ItemSlot:g},_,r]}var re=D.createContext(void 0);function A(e){let t=D.useContext(re);return e||t||`ltr`}var j=!1;function ie(){let[e,t]=D.useState(j);return D.useEffect(()=>{j||(j=!0,t(!0))},[]),e}var M=D.useSyncExternalStore;function N(){return()=>{}}function P(){return M(N,()=>!0,()=>!1)}var ae=typeof M==`function`?P:ie,F=`rovingFocusGroup.onEntryFocus`,oe={bubbles:!1,cancelable:!0},I=`RovingFocusGroup`,[L,se,ce]=k(I),[le,ue]=d(I,[ce]),[de,fe]=le(I),pe=D.forwardRef((e,t)=>(0,O.jsx)(L.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,O.jsx)(L.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,O.jsx)(me,{...e,ref:t})})}));pe.displayName=I;var me=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,g=D.useRef(null),v=c(t,g),y=A(a),[b,ee]=h({prop:o,defaultProp:s??null,onChange:l,caller:I}),[x,S]=D.useState(!1),C=_(d),w=se(n),T=D.useRef(!1),[te,ne]=D.useState(0);return D.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(F,C),()=>e.removeEventListener(F,C)},[C]),(0,O.jsx)(de,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:b,onItemFocus:D.useCallback(e=>ee(e),[ee]),onItemShiftTab:D.useCallback(()=>S(!0),[]),onFocusableItemAdd:D.useCallback(()=>ne(e=>e+1),[]),onFocusableItemRemove:D.useCallback(()=>ne(e=>e-1),[]),children:(0,O.jsx)(u.div,{tabIndex:x||te===0?-1:0,"data-orientation":r,...p,ref:v,style:{outline:`none`,...e.style},onMouseDown:m(e.onMouseDown,()=>{T.current=!0}),onFocus:m(e.onFocus,e=>{let t=!T.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(F,oe);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);be([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),f)}}T.current=!1}),onBlur:m(e.onBlur,()=>S(!1))})})}),he=`RovingFocusGroupItem`,ge=D.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=y(),l=a||c,d=fe(he,n),p=d.currentTabStopId===l,h=se(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=d,b=ae();return f(()=>{if(!(!b||!r))return g(),()=>_()},[b,r,g,_]),D.useEffect(()=>{if(!(b||!r))return g(),()=>_()},[b,r,g,_]),(0,O.jsx)(L.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,O.jsx)(u.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:m(e.onMouseDown,e=>{r?d.onItemFocus(l):e.preventDefault()}),onFocus:m(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:m(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ye(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?xe(n,r+1):n.slice(r+1)}setTimeout(()=>be(n))}}),children:typeof o==`function`?o({isCurrentTabStop:p,hasTabStop:v!=null}):o})})});ge.displayName=he;var _e={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ve(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ye(e,t,n){let r=ve(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return _e[r]}function be(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Se=pe,Ce=ge,R=[`Enter`,` `],we=[`ArrowDown`,`PageUp`,`Home`],Te=[`ArrowUp`,`PageDown`,`End`],Ee=[...we,...Te],De={ltr:[...R,`ArrowRight`],rtl:[...R,`ArrowLeft`]},Oe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},z=`Menu`,[B,ke,Ae]=k(z),[V,je]=d(z,[Ae,w,ue]),H=w(),Me=ue(),[Ne,U]=V(z),[Pe,W]=V(z),Fe=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=H(t),[c,l]=D.useState(null),u=D.useRef(!1),d=_(a),f=A(i);return D.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),D.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,O.jsx)(T,{...s,children:(0,O.jsx)(Ne,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,O.jsx)(Pe,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Fe.displayName=z;var Ie=`MenuAnchor`,G=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H(n);return(0,O.jsx)(E,{...i,...r,ref:t})});G.displayName=Ie;var Le=`MenuPortal`,[Re,ze]=V(Le,{forceMount:void 0}),Be=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=U(Le,t);return(0,O.jsx)(Re,{scope:t,forceMount:n,children:(0,O.jsx)(C,{present:n||a.open,children:(0,O.jsx)(v,{asChild:!0,container:i,children:r})})})};Be.displayName=Le;var K=`MenuContent`,[Ve,He]=V(K),Ue=D.forwardRef((e,t)=>{let n=ze(K,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=U(K,e.__scopeMenu),o=W(K,e.__scopeMenu);return(0,O.jsx)(B.Provider,{scope:e.__scopeMenu,children:(0,O.jsx)(C,{present:r||a.open,children:(0,O.jsx)(B.Slot,{scope:e.__scopeMenu,children:o.modal?(0,O.jsx)(We,{...i,ref:t}):(0,O.jsx)(Ge,{...i,ref:t})})})})}),We=D.forwardRef((e,t)=>{let n=U(K,e.__scopeMenu),r=D.useRef(null),i=c(t,r);return D.useEffect(()=>{let e=r.current;if(e)return S(e)},[]),(0,O.jsx)(qe,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ge=D.forwardRef((e,t)=>{let n=U(K,e.__scopeMenu);return(0,O.jsx)(qe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ke=l(`MenuContent.ScrollLock`),qe=D.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,disableOutsideScroll:_,...v}=e,y=U(K,n),S=W(K,n),C=H(n),w=Me(n),T=ke(n),[te,E]=D.useState(null),k=D.useRef(null),re=c(t,k,y.onContentChange),A=D.useRef(0),j=D.useRef(``),ie=D.useRef(0),M=D.useRef(null),N=D.useRef(`right`),P=D.useRef(0),ae=_?b:D.Fragment,F=_?{as:Ke,allowPinchZoom:!0}:void 0,oe=e=>{let t=j.current+e,n=T().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Dt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){j.current=t,window.clearTimeout(A.current),t!==``&&(A.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};D.useEffect(()=>()=>window.clearTimeout(A.current),[]),x();let I=D.useCallback(e=>N.current===M.current?.side&&kt(e,M.current?.area),[]);return(0,O.jsx)(Ve,{scope:n,searchRef:j,onItemEnter:D.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:D.useCallback(e=>{I(e)||(k.current?.focus(),E(null))},[I]),onTriggerLeave:D.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:D.useCallback(e=>{M.current=e},[]),children:(0,O.jsx)(ae,{...F,children:(0,O.jsx)(g,{asChild:!0,trapped:i,onMountAutoFocus:m(a,e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,O.jsx)(ee,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:h,children:(0,O.jsx)(Se,{asChild:!0,...w,dir:S.dir,orientation:`vertical`,loop:r,currentTabStopId:te,onCurrentTabStopIdChange:E,onEntryFocus:m(l,e=>{S.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,O.jsx)(ne,{role:`menu`,"aria-orientation":`vertical`,"data-state":Ct(y.open),"data-radix-menu-content":``,dir:S.dir,...C,...v,ref:re,style:{outline:`none`,...v.style},onKeyDown:m(v.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&oe(e.key));let i=k.current;if(e.target!==i||!Ee.includes(e.key))return;e.preventDefault();let a=T().filter(e=>!e.disabled).map(e=>e.ref.current);Te.includes(e.key)&&a.reverse(),Tt(a)}),onBlur:m(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),j.current=``)}),onPointerMove:m(e.onPointerMove,Z(e=>{let t=e.target,n=P.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>P.current?`right`:`left`;N.current=t,P.current=e.clientX}}))})})})})})})});Ue.displayName=K;var Je=`MenuGroup`,Ye=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,O.jsx)(u.div,{role:`group`,...r,ref:t})});Ye.displayName=Je;var Xe=`MenuLabel`,Ze=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,O.jsx)(u.div,{...r,ref:t})});Ze.displayName=Xe;var q=`MenuItem`,Qe=`menu.itemSelect`,J=D.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=D.useRef(null),o=W(q,e.__scopeMenu),s=He(q,e.__scopeMenu),l=c(t,a),u=D.useRef(!1),d=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Qe,{bubbles:!0,cancelable:!0});e.addEventListener(Qe,e=>r?.(e),{once:!0}),p(e,t),t.defaultPrevented?u.current=!1:o.onClose()}};return(0,O.jsx)($e,{...i,ref:l,disabled:n,onClick:m(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:m(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:m(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||R.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});J.displayName=q;var $e=D.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=He(q,n),s=Me(n),l=D.useRef(null),d=c(t,l),[f,p]=D.useState(!1),[h,g]=D.useState(``);return D.useEffect(()=>{let e=l.current;e&&g((e.textContent??``).trim())},[a.children]),(0,O.jsx)(B.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:(0,O.jsx)(Ce,{asChild:!0,...s,focusable:!r,children:(0,O.jsx)(u.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:d,onPointerMove:m(e.onPointerMove,Z(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:m(e.onPointerLeave,Z(e=>o.onItemLeave(e))),onFocus:m(e.onFocus,()=>p(!0)),onBlur:m(e.onBlur,()=>p(!1))})})})}),et=`MenuCheckboxItem`,tt=D.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,O.jsx)(lt,{scope:e.__scopeMenu,checked:n,children:(0,O.jsx)(J,{role:`menuitemcheckbox`,"aria-checked":X(n)?`mixed`:n,...i,ref:t,"data-state":wt(n),onSelect:m(i.onSelect,()=>r?.(X(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tt.displayName=et;var nt=`MenuRadioGroup`,[rt,it]=V(nt,{value:void 0,onValueChange:()=>{}}),at=D.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=_(r);return(0,O.jsx)(rt,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,O.jsx)(Ye,{...i,ref:t})})});at.displayName=nt;var ot=`MenuRadioItem`,st=D.forwardRef((e,t)=>{let{value:n,...r}=e,i=it(ot,e.__scopeMenu),a=n===i.value;return(0,O.jsx)(lt,{scope:e.__scopeMenu,checked:a,children:(0,O.jsx)(J,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":wt(a),onSelect:m(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});st.displayName=ot;var ct=`MenuItemIndicator`,[lt,ut]=V(ct,{checked:!1}),dt=D.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ut(ct,n);return(0,O.jsx)(C,{present:r||X(a.checked)||a.checked===!0,children:(0,O.jsx)(u.span,{...i,ref:t,"data-state":wt(a.checked)})})});dt.displayName=ct;var ft=`MenuSeparator`,pt=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,O.jsx)(u.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});pt.displayName=ft;var mt=`MenuArrow`,ht=D.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H(n);return(0,O.jsx)(te,{...i,...r,ref:t})});ht.displayName=mt;var gt=`MenuSub`,[_t,vt]=V(gt),yt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=U(gt,t),o=H(t),[s,c]=D.useState(null),[l,u]=D.useState(null),d=_(i);return D.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,O.jsx)(T,{...o,children:(0,O.jsx)(Ne,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,O.jsx)(_t,{scope:t,contentId:y(),triggerId:y(),trigger:s,onTriggerChange:c,children:n})})})};yt.displayName=gt;var Y=`MenuSubTrigger`,bt=D.forwardRef((e,t)=>{let n=U(Y,e.__scopeMenu),r=W(Y,e.__scopeMenu),i=vt(Y,e.__scopeMenu),a=He(Y,e.__scopeMenu),o=D.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},d=D.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);D.useEffect(()=>d,[d]),D.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),l(null)}},[s,l]);let f=c(t,i.onTriggerChange);return(0,O.jsx)(G,{asChild:!0,...u,children:(0,O.jsx)($e,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Ct(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:m(e.onPointerMove,Z(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:m(e.onPointerLeave,Z(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:m(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||De[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});bt.displayName=Y;var xt=`MenuSubContent`,St=D.forwardRef((e,t)=>{let n=ze(K,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=U(K,e.__scopeMenu),s=W(K,e.__scopeMenu),l=vt(xt,e.__scopeMenu),u=D.useRef(null),d=c(t,u);return(0,O.jsx)(B.Provider,{scope:e.__scopeMenu,children:(0,O.jsx)(C,{present:r||o.open,children:(0,O.jsx)(B.Slot,{scope:e.__scopeMenu,children:(0,O.jsx)(qe,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:m(e.onFocusOutside,e=>{e.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:m(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:m(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Oe[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});St.displayName=xt;function Ct(e){return e?`open`:`closed`}function X(e){return e===`indeterminate`}function wt(e){return X(e)?`indeterminate`:e?`checked`:`unchecked`}function Tt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Et(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Dt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Et(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ot(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function kt(e,t){return t?Ot({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var At=Fe,jt=G,Mt=Be,Nt=Ue,Pt=Ye,Ft=Ze,It=J,Lt=tt,Rt=at,zt=st,Bt=dt,Vt=pt,Ht=ht,Ut=yt,Wt=bt,Gt=St,Q=`DropdownMenu`,[Kt,qt]=d(Q,[je]),$=je(),[Jt,Yt]=Kt(Q),Xt=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=D.useRef(null),[u,d]=h({prop:i,defaultProp:a??!1,onChange:o,caller:Q});return(0,O.jsx)(Jt,{scope:t,triggerId:y(),triggerRef:l,contentId:y(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,O.jsx)(At,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Xt.displayName=Q;var Zt=`DropdownMenuTrigger`,Qt=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Yt(Zt,n),o=$(n),s=c(t,a.triggerRef);return(0,O.jsx)(jt,{asChild:!0,...o,children:(0,O.jsx)(u.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:m(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:m(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Qt.displayName=Zt;var $t=`DropdownMenuPortal`,en=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,O.jsx)(Mt,{...r,...n})};en.displayName=$t;var tn=`DropdownMenuContent`,nn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Yt(tn,n),a=$(n),o=D.useRef(!1);return(0,O.jsx)(Nt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:m(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});nn.displayName=tn;var rn=`DropdownMenuGroup`,an=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Pt,{...i,...r,ref:t})});an.displayName=rn;var on=`DropdownMenuLabel`,sn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Ft,{...i,...r,ref:t})});sn.displayName=on;var cn=`DropdownMenuItem`,ln=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(It,{...i,...r,ref:t})});ln.displayName=cn;var un=`DropdownMenuCheckboxItem`,dn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Lt,{...i,...r,ref:t})});dn.displayName=un;var fn=`DropdownMenuRadioGroup`,pn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Rt,{...i,...r,ref:t})});pn.displayName=fn;var mn=`DropdownMenuRadioItem`,hn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(zt,{...i,...r,ref:t})});hn.displayName=mn;var gn=`DropdownMenuItemIndicator`,_n=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Bt,{...i,...r,ref:t})});_n.displayName=gn;var vn=`DropdownMenuSeparator`,yn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Vt,{...i,...r,ref:t})});yn.displayName=vn;var bn=`DropdownMenuArrow`,xn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Ht,{...i,...r,ref:t})});xn.displayName=bn;var Sn=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=$(t),[s,c]=h({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,O.jsx)(Ut,{...o,open:s,onOpenChange:c,children:n})},Cn=`DropdownMenuSubTrigger`,wn=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Wt,{...i,...r,ref:t})});wn.displayName=Cn;var Tn=`DropdownMenuSubContent`,En=D.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,O.jsx)(Gt,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});En.displayName=Tn;var Dn=Xt,On=Qt,kn=en,An=nn,jn=sn,Mn=ln,Nn=dn,Pn=pn,Fn=hn,In=_n,Ln=yn,Rn=Sn,zn=wn,Bn=En;function Vn({...e}){return(0,O.jsx)(Dn,{"data-slot":`dropdown-menu`,...e})}function Hn({...e}){return(0,O.jsx)(kn,{"data-slot":`dropdown-menu-portal`,...e})}function Un({...e}){return(0,O.jsx)(On,{"data-slot":`dropdown-menu-trigger`,...e})}function Wn({className:e,sideOffset:t=4,...n}){return(0,O.jsx)(kn,{children:(0,O.jsx)(An,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:i(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...n})})}function Gn({className:e,inset:t,variant:n=`default`,...r}){return(0,O.jsx)(Mn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Kn({className:e,children:t,checked:n,...o}){return(0,O.jsxs)(Nn,{"data-slot":`dropdown-menu-checkbox-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r({checked:n}),...o,children:[(0,O.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,O.jsx)(In,{children:(0,O.jsx)(a,{className:`size-4`})})}),t]})}function qn({...e}){return(0,O.jsx)(Pn,{"data-slot":`dropdown-menu-radio-group`,...e})}function Jn({className:e,children:t,...n}){return(0,O.jsxs)(Fn,{"data-slot":`dropdown-menu-radio-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,O.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,O.jsx)(In,{children:(0,O.jsx)(o,{className:`size-2 fill-current`})})}),t]})}function Yn({className:e,inset:t,...n}){return(0,O.jsx)(jn,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:i(`px-2 py-1.5 text-sm font-medium data-[inset]:ps-8`,e),...n})}function Xn({className:e,...t}){return(0,O.jsx)(Ln,{"data-slot":`dropdown-menu-separator`,className:i(`-mx-1 my-1 h-px bg-border`,e),...t})}function Zn({...e}){return(0,O.jsx)(Rn,{"data-slot":`dropdown-menu-sub`,...e})}function Qn({className:e,inset:t,children:n,...r}){return(0,O.jsxs)(zn,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:i(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:ps-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,O.jsx)(s,{className:`ms-auto size-4`})]})}function $n({className:e,...t}){return(0,O.jsx)(Bn,{"data-slot":`dropdown-menu-sub-content`,className:i(`z-50 min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...t})}export{Yn as a,Jn as c,$n as d,Qn as f,k as h,Gn as i,Xn as l,A as m,Kn as n,Hn as o,Un as p,Wn as r,qn as s,Vn as t,Zn as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
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-DSMR_WLb.js";import{et as i}from"./queries-hzlF788B.js";import{Fn as a,Ht as o}from"./toaster-fWyfEGWF.js";import{f as s,p as c}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{ot as l,w as u}from"./design-icons-CzEoMH9c.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{a as f}from"./diff-controls-n4THBHKo.js";import{t as p}from"./centered-state-V15AR_qo.js";import{a as m,i as h,r as g}from"./highlighter-DvLzHjjY.js";import{n as _,t as v}from"./markdown-DJkMnwyc.js";import{r as y}from"./html-report-BX3msvci.js";import{t as b}from"./html-report-frame-DkHr39E2.js";var x=d(`file-exclamation-point`,[[`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:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),S=d(`file-question-mark`,[[`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:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),C=d(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),w=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function T(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:w.has(t.slice(n+1).toLowerCase())}function E(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return T(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}var D=e(t(),1);function O(e){return e.tooLarge?`too-large`:E(e.path)?`image`:e.binary?`binary`:`text`}function k(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var A=n();function j({runId:e,path:t,className:n}){let r=i(e,t??void 0);if(t===null)return(0,A.jsx)(R,{className:n,children:(0,A.jsx)(p,{icon:(0,A.jsx)(u,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,A.jsx)(R,{className:n,children:(0,A.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof a&&r.error.status===409;return(0,A.jsx)(R,{className:n,children:(0,A.jsx)(p,{icon:e?(0,A.jsx)(C,{}):(0,A.jsx)(l,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,A.jsx)(P,{runId:e,entry:r.data,className:n}):(0,A.jsx)(R,{className:n,children:(0,A.jsx)(p,{icon:(0,A.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function M(e,t,n){let r=t?.replace(/\/+$/,``);if(r&&e.startsWith(`${r}/`))return e.slice(r.length+1);let i=/^.*\/\.ai\/(?:cezar|squawk)\/worktrees\/[^/]+\/(.+)$/.exec(e);if(i?.[1])return i[1];if(e.startsWith(`/`)&&n&&!n.startsWith(`/`)){let t=n.replace(/^\.?\//,``);if(t&&(e===`/${t}`||e.endsWith(`/${t}`)))return t}return e}function N(e,t,n){let r=t&&/\.(?:md|markdown)$/i.test(e.path),i=t&&y(e.path),a=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(e.path),o=t&&a&&e.size<=10*1024*1024?`image`:O(e);return{html:i,kind:o,toggle:(r||i)&&o===`text`,showImage:o===`image`&&(!t||a),rendered:n?null:r?`markdown`:i?`html`:null}}function P({runId:e,entry:t,displayPath:n,className:i,imageUrl:a,downloadUrl:o,snapshot:s,readerHref:c,documentPreview:l=!1}){let[u,d]=(0,D.useState)(!1),[p,m]=(0,D.useState)(!0),h=n??M(t.path),g=N(t,l,u),_=!!(s||o||g.toggle),v=!g.showImage&&g.kind===`text`&&g.rendered===null;return(0,A.jsxs)(R,{className:i,children:[(0,A.jsxs)(`header`,{"data-slot":`file-preview-head`,className:r(`flex min-h-11 items-center gap-2 border-b border-border bg-muted/40 ps-4 text-xs`,v?`pe-2 py-1`:`pe-4 py-2.5`),children:[(0,A.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium text-foreground`,title:h,children:h}),(0,A.jsx)(`span`,{"data-slot":`file-preview-size`,className:`ml-auto shrink-0 font-mono text-xs tabular-nums text-muted-foreground`,children:k(t.size)}),v?(0,A.jsx)(f,{wrap:p,onWrapChange:m,className:`size-8 rounded-md max-md:size-11 pointer-coarse:size-11`}):null]}),_?(0,A.jsx)(I,{snapshot:s,downloadUrl:o,source:g.toggle?u:null,onSource:()=>d(e=>!e),readerHref:g.html&&g.kind===`text`?c:void 0}):null,(0,A.jsx)(F,{runId:e,entry:t,kind:g.kind,showImage:g.showImage,rendered:g.rendered,imageUrl:a,wrap:p})]})}function F({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a,wrap:s}){return r?(0,A.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,A.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??o(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,A.jsx)(p,{icon:(0,A.jsx)(x,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${k(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,A.jsx)(p,{icon:(0,A.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${k(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(v,{document:!0,children:t.content??``})}):i===`html`?(0,A.jsx)(b,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,A.jsx)(V,{path:t.path,text:t.content??``,wrap:s})}function I({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,A.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,A.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,A.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,A.jsx)(L,{href:i}):null]})}function L({href:e}){let t=c(),n=s();return(0,A.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:r=>_(r,t,e,n),children:`Open reader`})}function R({className:e,children:t}){return(0,A.jsx)(`section`,{"data-slot":`file-preview`,className:r(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var z=1500;function B(e,t){let n=(0,D.useMemo)(()=>t.split(`
|
|
2
|
-
`).map(e=>[{content:e}]),[t]),r=(0,D.useMemo)(()=>m(e),[e]),i=n.length>z,[a,o]=(0,D.useState)(null);return(0,D.useEffect)(()=>{if(r===null||i)return;let n=!1;return g(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:h(t,r)?.tokens??n}function V({path:e,text:t,wrap:n=!1}){let i=B(e,t);return(0,A.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":m(e)??`plaintext`,className:`overflow-x-auto overscroll-x-contain py-2 font-mono text-xs leading-[1.7] [scrollbar-width:thin]`,children:(0,A.jsx)(`div`,{className:n?`min-w-0`:`w-max min-w-full`,children:i.map((e,t)=>(0,A.jsxs)(`div`,{className:`flex`,children:[(0,A.jsx)(`span`,{className:`sticky left-0 w-14 shrink-0 select-none bg-card pr-3 pl-4 text-right tabular-nums text-muted-foreground`,children:t+1}),(0,A.jsx)(`span`,{className:r(`min-w-0 flex-1 pr-6`,n?`whitespace-pre-wrap wrap-anywhere`:`whitespace-pre`),children:e.map((e,t)=>(0,A.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})})}export{k as a,S as c,M as i,x as l,P as n,E as o,j as r,C as s,V as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{_t as n}from"./queries-hzlF788B.js";import{Fn as r}from"./toaster-fWyfEGWF.js";import{t as i}from"./createLucideIcon-BHp8sXmF.js";import{t as a}from"./chevron-right-BENZ-1ZN.js";import{t as o}from"./folder-o-AvL3y3.js";var s=i(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),c=e(),l=`x-apple.systempreferences:com.apple.preference.security?Privacy_FilesAndFolders`,u=`inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-foreground hover:bg-muted`;function d(e){let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<0?null:n===0?t.slice(0,1):t.slice(0,n)}function f({path:e,selected:r,onSelect:i,onEnter:l,decorate:u,emptyHint:d,showHidden:f=!1}){let m=n(e,f),h=m.data?.parent??null;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`p`,{"data-slot":`fs-breadcrumb`,className:`truncate font-mono text-xs text-soft-foreground`,title:m.data?.path??void 0,children:m.data?.path??(m.isError?``:`Loading…`)}),m.isError?(0,c.jsx)(p,{error:m.error,path:e,onEnter:l,onRetry:()=>void m.refetch()}):(0,c.jsxs)(`ul`,{"data-slot":`fs-listing`,className:`max-h-64 divide-y divide-border/60 overflow-y-auto overscroll-contain rounded-md border border-border`,children:[h===null?null:(0,c.jsx)(`li`,{className:`flex`,children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-up`,onClick:()=>l(h),className:`flex flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,children:[(0,c.jsx)(s,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),`Up one level`]})}),(m.data?.dirs??[]).map(e=>(0,c.jsxs)(`li`,{className:`flex items-stretch`,children:[(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-dir`,"aria-pressed":r?.path===e.path,onClick:()=>i(e),onDoubleClick:()=>l(e.path),className:t(`flex min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,r?.path===e.path&&`bg-muted`),children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`truncate`,children:e.name}),u?.(e)]}),(0,c.jsx)(`button`,{type:`button`,"data-slot":`fs-enter`,"aria-label":`Open ${e.name}`,onClick:()=>l(e.path),className:`flex shrink-0 items-center px-2.5 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,c.jsx)(a,{className:`size-3.5`,"aria-hidden":`true`})})]},e.path)),m.data&&m.data.dirs.length===0?(0,c.jsx)(`li`,{className:`px-3 py-2 text-[13px] text-muted-foreground`,children:d}):null]}),m.data?.truncated?(0,c.jsx)(`p`,{"data-slot":`fs-truncated`,className:`text-xs text-muted-foreground`,children:`Too many folders to list — only the first ones are shown.`}):null]})}function p({error:e,path:t,onEnter:n,onRetry:i}){let a=e instanceof r&&e.status===403,o=t===null?null:d(t);return(0,c.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,c.jsx)(`p`,{"data-slot":`fs-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:e instanceof Error?e.message:`could not list that folder`}),a?(0,c.jsx)(`p`,{"data-slot":`fs-privacy-hint`,className:`text-[12.5px] text-soft-foreground`,children:`Allow it under Privacy & Security ▸ Files & Folders, then try again.`}):null,(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[12.5px]`,children:[o===null?null:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-error-back`,onClick:()=>n(o),className:u,children:[(0,c.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),`Back`]}),a?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`a`,{"data-slot":`fs-privacy-settings`,href:l,target:`_blank`,rel:`noreferrer`,className:u,children:`Open Privacy Settings`}),(0,c.jsx)(`button`,{type:`button`,"data-slot":`fs-retry`,onClick:i,className:u,children:`Try again`})]}):null]})]})}function m(e,t,r=!1){let i=n(e,r);return t?.path??i.data?.path??null}export{m as n,f as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{n as r,t as i}from"./utils-DSMR_WLb.js";import{F as a,T as o,j as s,st as c,u as l}from"./design-icons-CzEoMH9c.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";import{t as d}from"./external-link-BE6y205O.js";import{a as f,i as p,n as m,r as h,t as g}from"./diff-controls-n4THBHKo.js";import{t as _}from"./square-terminal-B6RYYieR.js";import{t as v}from"./button-B7MKxYjT.js";import{i as y,p as b,r as x,t as S}from"./dropdown-menu-4e2iKSMT.js";import{t as C}from"./diff-stat-C7KB1kDX.js";var w=u(`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`}]]),T=u(`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`}]]),E=e(t(),1),D=n();function O({root:e,selected:t,onSelect:n}){return(0,D.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,D.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,D.jsx)(A,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,D.jsx)(M,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function k({adds:e,dels:t}){return(0,D.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs font-medium tabular-nums`,children:[e>0?(0,D.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,D.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,t]}):null]})}function A({dir:e,depth:t,selected:n,onSelect:r}){let[a,s]=(0,E.useState)(!0);return(0,D.jsxs)(`li`,{children:[(0,D.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>s(e=>!e),className:`flex min-h-11 md:min-h-8 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,D.jsx)(l,{size:16,"aria-hidden":`true`,className:i(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,D.jsx)(o,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,D.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,D.jsx)(k,{adds:e.adds,dels:e.dels})]}),a?(0,D.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,D.jsx)(A,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,D.jsx)(M,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var j={added:`text-semantic-green`,deleted:`text-semantic-red`};function M({file:e,depth:t,selected:n,onSelect:r}){let a=n===e.path;return(0,D.jsx)(`li`,{children:(0,D.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":a?`true`:void 0,onClick:()=>r(e.path),className:i(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,D.jsx)(T,{"aria-hidden":`true`,className:i(`size-3.5 shrink-0`,j[e.status])}),(0,D.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,D.jsx)(k,{adds:e.adds,dels:e.dels})]})})}function N(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function P(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(P)}}var F=(e,t)=>e.name.localeCompare(t.name);function I(e){let t=N(``,``),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=N(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(F),e.files.sort(F)};return i(t),{...t,dirs:t.dirs.map(P)}}function L({bar:e,healthReady:t,branch:n,stat:r,mode:a,wrap:o,preview:s=!1,onModeChange:c,onWrapChange:l,onPreviewChange:u,onAction:d}){let _=s&&u!==void 0;return(0,D.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-3 gap-y-2 px-4 py-4 md:px-9 [&_button]:min-h-11`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[n?(0,D.jsx)(g,{branch:n}):null,r?(0,D.jsx)(B,{stat:r}):null]}),(0,D.jsxs)(`span`,{className:i(`ml-auto flex items-center gap-1.5`,!u&&`md:hidden`),children:[(0,D.jsx)(`span`,{className:`flex md:hidden`,children:(0,D.jsx)(f,{wrap:o,onWrapChange:l,disabled:_})}),_?(0,D.jsx)(h,{}):null,u?(0,D.jsx)(p,{preview:s,onPreviewChange:u}):null]}),(0,D.jsxs)(`span`,{className:i(`flex items-center gap-2 max-md:w-full`,!u&&`md:ml-auto`),children:[(0,D.jsx)(`span`,{className:`hidden items-center gap-1.5 md:flex`,children:(0,D.jsx)(m,{mode:a,wrap:o,onModeChange:c,onWrapChange:l,disabled:_})}),(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`hidden h-5 w-px bg-border md:block`}),(0,D.jsxs)(`span`,{"data-slot":`git-toolbar-actions`,className:`flex items-center gap-1.5 max-md:flex-1 max-md:[&>*]:flex-1`,children:[e.secondary.map(e=>(0,D.jsx)(z,{action:e,variant:`outline`,onAction:d},e.id)),(0,D.jsx)(z,{action:e.primary,variant:`primary`,onAction:d})]}),e.menu.length>0?(0,D.jsxs)(S,{children:[(0,D.jsx)(b,{asChild:!0,children:(0,D.jsx)(v,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,className:`max-md:min-w-11 max-md:border max-md:border-border max-md:bg-card`,children:(0,D.jsx)(w,{"aria-hidden":`true`})})}),(0,D.jsx)(x,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,D.jsxs)(y,{disabled:!e.enabled,title:e.reason,onSelect:()=>d(e.id),children:[R[e.id],e.label]},e.id))})]}):null]})]})}var R={commit:(0,D.jsx)(s,{size:16,"aria-hidden":`true`}),push:(0,D.jsx)(c,{size:16,"aria-hidden":`true`}),"create-pr":(0,D.jsx)(a,{size:16,"aria-hidden":`true`}),"view-pr":(0,D.jsx)(d,{"aria-hidden":`true`}),"open-terminal":(0,D.jsx)(_,{"aria-hidden":`true`})};function z({action:e,variant:t,onAction:n}){return e.id===`view-pr`?r(e.href)?(0,D.jsx)(v,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,D.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[R[e.id],e.label]})}):(0,D.jsxs)(v,{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:[R[e.id],e.label]}):(0,D.jsxs)(v,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[R[e.id],e.label]})}function B({stat:e}){return(0,D.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,D.jsx)(C,{stat:{adds:V(e.adds),dels:V(e.dels),files:e.files}})})}function V(e){let[t,n]=(0,E.useState)(e),r=(0,E.useRef)(e);return(0,E.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{O as i,L as n,I as r,B as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{c as r,t as i}from"./utils-DSMR_WLb.js";import{M as a,Wt as o,cn as s,dn as c,i as l,k as u,l as d,o as f,r as p,s as m}from"./queries-hzlF788B.js";import{An as h,G as g,I as _,K as v,Si as y,U as b,hi as x,n as S,q as C}from"./toaster-fWyfEGWF.js";import{h as ee}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{F as w,I as T,X as E,Y as D,c as O,ct as k,l as A,ot as j,p as M,r as te}from"./design-icons-CzEoMH9c.js";import{t as ne}from"./chevron-down-CHGyCDBH.js";import{t as N}from"./chevron-right-BENZ-1ZN.js";import{t as P}from"./loader-circle-CPBhhDbB.js";import{t as re}from"./play-CmVAj_fu.js";import{t as F}from"./button-B7MKxYjT.js";import{a as I,i as L,n as ie,r as R,t as ae}from"./select-Cnv2IYdg.js";import{i as z,r as B,t as V}from"./popover-CZV6tz9i.js";import{r as oe,t as H}from"./project-router-B9FTk0rB.js";import"./attention-ILOaW2-t.js";import{f as se,v as ce}from"./task-groups-DD46syqv.js";import{t as le}from"./status-dot-BRzVlF2X.js";import{a as ue,o as de,r as fe,s as pe,t as me}from"./command-KdW7aO0N.js";import{d as he,s as U,u as W}from"./page-shell-7pLJMOgh.js";import{t as G}from"./centered-state-V15AR_qo.js";import{t as ge}from"./use-search-params-writer-ClMScnNe.js";import{Ct as _e,Dt as ve,Et as ye,Ln as be,Mn as xe,On as Se,St as Ce,Tt as we,Zt as Te,_t as Ee,bn as K,bt as De,gt as Oe,ht as ke,mt as Ae,ot as je,r as Me,s as Ne,vt as Pe,wt as Fe,xt as Ie,yt as Le}from"./index-_LohQUeF.js";import{a as Re,d as ze,f as Be,i as Ve,l as He,n as Ue,o as We,r as Ge,s as Ke,t as qe,u as q}from"./use-hand-to-agent-state-CCWMSRyA.js";import{t as Je}from"./tab-link-BlZX-nKP.js";var J=e(t(),1),Ye=`cez-github-list-width`;function Y(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 Xe(){try{let e=localStorage.getItem(Ye);return e===null?360:Y(e)}catch{return 360}}function Ze(e){try{localStorage.setItem(Ye,String(Y(e)))}catch{}}var X=n();function Qe({number:e,repo:t}){let n=r();return(0,X.jsx)($e,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function $e({number:e,repo:t,scope:n}){let r=(0,J.useId)(),o=(0,J.useId)(),[c,l]=(0,J.useState)(!1),u=c?ne:N,d=s(n,!0,n==="default"),f=a(`#${e}`,!0),p=(0,J.useMemo)(()=>Fe(ce(d.data??[],f.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[d.data,f.data,e,t,n]);return(0,X.jsxs)(`section`,{"aria-labelledby":r,className:i(`mt-4 min-w-0 rounded-lg border border-border`,c?`p-3`:`p-0.5`),children:[(0,X.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":c,"aria-controls":o,onClick:()=>l(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2.5 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(u,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,X.jsxs)(`span`,{children:[`Linked tasks`,d.data?` (${p.length}${f.hasNextPage||f.isError?`+`:``})`:``]})]})}),(0,X.jsx)(`div`,{id:o,children:c?(0,X.jsxs)(X.Fragment,{children:[d.isPending?(0,X.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,d.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,X.jsx)(F,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry linked tasks`})]}):null,d.data&&p.length===0&&!d.isError?(0,X.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,p.length>0?(0,X.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:p.map(e=>{let t=Se(e,h(e));return(0,X.jsx)(`li`,{children:(0,X.jsxs)(H,{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,X.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:se(e)}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(le,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,X.jsx)(Me,{"data-slot":`linked-task-archived`,dot:K.tone,shape:K.shape,className:`px-2 py-px`,children:K.label}):null,(0,X.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,f.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,X.jsx)(F,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void f.refetch(),disabled:f.isFetching,children:`Retry older linked tasks`})]}):f.hasNextPage?(0,X.jsx)(F,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void f.fetchNextPage(),disabled:f.isFetchingNextPage,children:f.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var et=`w-44 max-w-full`,Z=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-ring disabled:opacity-60`,Q=`__all__`;function tt(e,t){let n=new Map;for(let t of e)for(let e of t.assignees??[])n.set(e.toLowerCase(),e);for(let e of t)n.set(e.toLowerCase(),e);return[...n.values()].sort((e,t)=>e.localeCompare(t))}function nt(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function rt(e){let t=` Previous memberships are shown; issues with unknown membership remain visible.`;return e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${t}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${t}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`)}function it(e){return[e.viewerLogin?``:`GitHub login unavailable.`,rt(e)].filter(Boolean).join(` `)}function at({options:e,assignees:t,onAssigneesChange:n}){return(0,X.jsxs)(V,{children:[(0,X.jsx)(z,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:`${Z} inline-flex items-center gap-1.5`,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,X.jsx)(A,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(B,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,X.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,X.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),e.map(e=>{let r=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,X.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(r?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,X.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]})}function ot({data:e,projectId:t,onProjectChange:n,pickerRef:r}){if(e.projects?.length)return(0,X.jsxs)(ae,{value:t||Q,onValueChange:e=>n(e===Q?``:e),children:[(0,X.jsx)(L,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":t,className:`${Z} ${et} justify-between`,children:(0,X.jsx)(I,{placeholder:`All boards`})}),(0,X.jsxs)(ie,{align:`start`,children:[(0,X.jsx)(R,{value:Q,children:`All boards`}),e.projects.map(e=>(0,X.jsx)(R,{value:e.id,"data-board":e.id,children:e.title},e.id))]})]});if(e.projects||e.projectsState){let t=e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`;return(0,X.jsxs)(ae,{disabled:!0,value:Q,children:[(0,X.jsx)(L,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":``,className:`${Z} ${et} justify-between`,children:(0,X.jsx)(I,{placeholder:t,children:t})}),(0,X.jsx)(ie,{align:`start`,children:(0,X.jsx)(R,{value:Q,children:t})})]})}return null}function st({data:e,message:t,lastMessage:n,hasMessage:r,statusOpen:i,setStatusOpen:a,triggerRef:o,contentRef:s}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{role:`status`,className:`sr-only`,children:t}),(0,X.jsxs)(V,{open:i,onOpenChange:a,children:[(0,X.jsx)(z,{asChild:!0,children:(0,X.jsx)(`button`,{ref:o,type:`button`,className:`${Z} inline-flex items-center justify-center ${t?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:t?void 0:-1,children:e.projectsState===`refreshing`?(0,X.jsx)(D,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,X.jsx)(j,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,X.jsx)(B,{ref:s,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{r||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:t||n.current})]})]})}function ct({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,J.useState)(!1),s=(0,J.useRef)(null),c=(0,J.useRef)(null),l=(0,J.useRef)(null),u=(0,J.useRef)(null),d=tt(e.issues,t),f=nt(e.viewerLogin,t),p=it(e),m=p!==``,h=(0,J.useRef)(p);m&&(h.current=p);let g=(0,J.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,J.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{g.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&_()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,J.useEffect)(()=>{if(m)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&_()},[m]),(0,X.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,X.jsx)(at,{options:d,assignees:t,onAssigneesChange:r}),(0,X.jsxs)(`button`,{ref:u,type:`button`,"data-slot":`gh-assigned-me`,className:`${Z} inline-flex items-center gap-1.5 rounded-full aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:[(0,X.jsx)(k,{size:14,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Assigned to me`]}),(0,X.jsx)(ot,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,X.jsx)(st,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function lt({onRefresh:e,refreshing:t}){let n=Ae(r());return(0,X.jsx)(W,{route:`github`,density:`full`,headerSpacing:`compact`,header:{title:`GitHub`,secondaryActions:(0,X.jsx)(U,{type:`button`,variant:`ghost`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,children:(0,X.jsx)(D,{size:17,"aria-hidden":`true`,className:i(`size-[17px]`,t&&`motion-safe:animate-spin`)})})},children:(0,X.jsx)(`div`,{"data-slot":`github-filter-screen`,children:(0,X.jsx)(ke,{model:n,variant:`screen`})})})}function ut({view:e,activeFilter:t,isDesktop:n,rawFilterParam:r,n:i,gh:a,actions:o}){return{headerSlot:`gh-masthead`,title:n?e===`issues`?`Issues`:`Pull requests`:`GitHub`,scope:n?Oe[t]:void 0,scopeSlot:`gh-title-qualifier`,subtitle:a.repo?(0,X.jsxs)(`span`,{className:`block min-w-0 truncate`,children:[(0,X.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,X.jsxs)(`span`,{"data-slot":`gh-synced`,title:a.syncedAt?new Date(a.syncedAt).toLocaleString():void 0,children:[` `,`· `,a.syncedAt?(0,X.jsx)(xe,{iso:a.syncedAt,prefix:`Synced `}):`Not synced yet`]})]}):void 0,secondaryActions:(0,X.jsx)(dt,{...o}),headerExtra:r!==null&&i===void 0?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`mt-1 flex min-w-0 items-center gap-3 md:hidden`,children:[(0,X.jsxs)(H,{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,X.jsx)(te,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),t===`all`?null:(0,X.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-muted-foreground`,children:[...Pe,...Le].find(e=>e.id===t)?.label})]}):void 0}}function dt({automationsAvailable:e,refreshing:t,onRefresh:n}){return(0,X.jsxs)(`div`,{"data-slot":`gh-page-actions`,className:`flex shrink-0 flex-wrap items-center gap-2`,children:[e?(0,X.jsx)(U,{variant:`outline`,asChild:!0,children:(0,X.jsx)(H,{to:`/automations/new`,children:`Set up automations`})}):null,(0,X.jsxs)(U,{type:`button`,variant:`outline`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:t,onClick:n,children:[(0,X.jsx)(D,{size:16,"aria-hidden":`true`,className:i(`size-3.5`,t&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function ft({view:e,number:t}){return(0,X.jsx)(G,{icon:e===`issues`?(0,X.jsx)(M,{size:16}):(0,X.jsx)(w,{size:16}),tone:`neutral`,heading:`h2`,title:t===null?`Nothing selected`:`Not found`,subtitle:t===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${t} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${t} above to look it up on GitHub, closed and merged included.`})}function pt({item:e,view:t,filter:n,colors:r,active:a,queued:s,checks:c,comments:l}){let u=e.kind===`issue`?M:w,d=x(),f=()=>{d.prefetchQuery({queryKey:o.githubComments(e.kind,e.number),queryFn:({signal:t})=>v(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,X.jsxs)(H,{to:Ie(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Ge(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:f,onFocus:f,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":a?`page`:void 0,title:`Drag into the composer to prefill a task`,className:i(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,a&&`bg-accent-strong/10 text-accent-text`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,X.jsx)(u,{"aria-hidden":`true`,"data-slot":`gh-row-icon`,className:i(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,X.jsx)(`span`,{"data-slot":`gh-row-title`,className:i(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,a&&`font-semibold`),children:e.title})]}),(0,X.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 pl-[22px] text-xs text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,X.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[`#`,e.number]}),(0,X.jsx)($,{}),(0,X.jsx)(`span`,{"data-slot":`gh-row-author`,className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,X.jsx)($,{}),(0,X.jsx)(xe,{iso:e.createdAt,className:`shrink-0`}),l?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(Re,{count:l})]}):null,c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(Ve,{checks:c})]}):null,s?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`shrink-0 font-sans font-medium text-accent-text`,children:`↗ run queued`})]}):null]}),e.labels.length>0?(0,X.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,X.jsx)(Ke,{label:e,color:r[e],plain:!0},e))}):null]})}function $(){return(0,X.jsx)(`span`,{"data-slot":`gh-row-dot`,"aria-hidden":`true`,className:`shrink-0`,children:`·`})}function mt(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function ht(e){let[t,n]=(0,J.useState)(null);return(0,J.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(mt(e));t();let r=typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 768px)`):null;r?.addEventListener(`change`,t);let i=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return i?.observe(e),()=>{r?.removeEventListener(`change`,t),i?.disconnect()}},[e]),t}function gt(e,t){let[n,r]=(0,J.useState)(0);return(0,J.useLayoutEffect)(()=>{let n=()=>{!e||!t||r(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return n(),window.addEventListener(`resize`,n),()=>window.removeEventListener(`resize`,n)},[e,t]),n}function _t(e,t,n){let[r,i]=(0,J.useState)(null),a=(0,J.useRef)(n);return(0,J.useEffect)(()=>{a.current=n}),(0,J.useEffect)(()=>{if(!e||!r||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&a.current()},{root:t.getAttribute(`data-slot`)===`main`?null:t,rootMargin:`0px 0px 600px 0px`});return n.observe(r),()=>n.disconnect()},[e,r,t]),i}function vt(e,t,n,r,i){let[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(null),l=ht(a),u=(0,J.useRef)(null);u.current=l;let d=gt(s,l),f=e===`issues`?n?.issues.length??0:n?.prs.length??0,p=t.hasNextPage&&r===null&&f>0;return{listEl:a,setListEl:o,setRowsEl:c,scrollOwner:l,scrollOwnerRef:u,startMargin:d,pagingAvailable:p,manualPaging:p&&i,loadMoreRef:_t(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}function yt({item:e,queuedRunId:t}){return t?(0,X.jsx)(F,{asChild:!0,variant:`outline`,size:`sm`,className:`max-md:h-11 no-hover:h-11`,children:(0,X.jsxs)(H,{to:`/tasks/${t}`,"data-action":`gh-header-view-task`,children:[(0,X.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,X.jsxs)(F,{type:`button`,variant:`primary`,size:`sm`,"data-action":`gh-header-handoff`,title:`Write the prompt and pick the workflow and runner for this ${e.kind===`pr`?`PR`:`issue`}`,className:`max-md:h-11 no-hover:h-11`,onClick:bt,children:[(0,X.jsx)(re,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}function bt(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}var xt=100;function St(e,t,n,r,i){if(!e?.available||t!==`prs`)return[];let a=new Set;n!==null&&Number.isInteger(n)&&a.add(n);for(let t of[...r,...i,...e.prs]){if(a.size>=xt)break;a.add(t.number)}return[...a]}function Ct(e,t,n,r,i,a){let o=St(n,e,r,i,a),s=p(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,u=l(e===`issues`?`issue`:`pr`,(0,J.useMemo)(()=>(t.data?.pages??[]).map(t=>(e===`issues`?t.issues:t.prs).map(e=>e.number)),[t.data,e]),n?.available===!0&&n.commentsDeferred===!0),d=(0,J.useMemo)(()=>new Set(n?.commentsDeferred?(e===`issues`?n.issues:n.prs).map(e=>e.number):[]),[n,e]);return{checkPrNumbers:o,checksMap:c,commentsOf:e=>u[e.number]??(d.has(e.number)?void 0:e.comments)}}function wt(e){let[t,n]=ge(),r=t.get(`filter`),i=we(e,r);return{rawFilterParam:r,filter:i,activeFilter:i??`all`,setFilterParam:e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n})}}function Tt(e,t,{filter:n,activeFilter:r,setFilterParam:i}){let[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)([]),[l,u]=(0,J.useState)([]),{setProjectFilter:d,activeProject:f}=Et(t),p=e===`issues`&&r===`assigned`,m=p?t?.viewerLogin?[t.viewerLogin]:[]:l;return{query:a,setQuery:o,labelFilter:s,setLabelFilter:c,setProjectFilter:d,activeProject:f,isAssignedFilter:p,effectiveAssignees:m,changeAssignees:e=>{u(e),p&&i(`all`)},clearFilters:()=>{o(``),c([]),u([]),d(``),n!==null&&n!==`all`&&i(`all`)},filtering:a.trim()!==``||s.length>0||e===`issues`&&(m.length>0||f!==``)||n!==null&&n!==`all`,narrowing:a.trim()!==``||s.length>0||e===`issues`&&(!p&&l.length>0||f!==``)}}function Et(e){let[t,n]=(0,J.useState)(``),r=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,i=r||e?.projects?.some(e=>e.id===t)?t:``;return(0,J.useEffect)(()=>{e&&!r&&t&&!i&&n(``)},[e,t,i,r]),{setProjectFilter:n,activeProject:i}}function Dt(e,t,{filter:n,activeFilter:i},a){let o=r(),c=e===`issues`&&(i===`no-task`||i===`has-task`),l=s(o,c,o==="default"),u=(0,J.useMemo)(()=>l.data?_e(l.data,t?.repo,o):null,[l.data,t?.repo,o]),f=Ce(e,n)?ve(n):null,p=d(`pr`,f??``,f!==null&&t?.available===!0),m=f!==null&&p.data?.available?p.data.items:null,h=(0,J.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),g=(0,J.useMemo)(()=>m?ye(m,h):null,[m,h]),_=Ot({view:e,gh:t,activeFilter:i,isAssignedFilter:a,taskFilter:c,taskNumbers:u,runsQuery:l,backedQuery:f,filterHits:m,filterSearch:p});return{backedQuery:f,filterSearch:p,fullList:h,filterRows:g,filterGate:_,openItems:(0,J.useMemo)(()=>_?[]:g??h,[_,g,h]),narrow:(0,J.useMemo)(()=>e===`issues`?i===`no-task`&&u?{excludeNumbers:u}:i===`has-task`&&u?{includeNumbers:u}:{}:i===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:m?{includeNumbers:new Set(m.map(e=>e.number))}:{},[e,i,u,t?.viewerLogin,m])}}function Ot({view:e,gh:t,activeFilter:n,isAssignedFilter:r,taskFilter:i,taskNumbers:a,runsQuery:o,backedQuery:s,filterHits:c,filterSearch:l}){return t?.available?(r||e===`prs`&&n===`mine`)&&!t.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:i&&!a?o.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:s!==null&&!c?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}function kt(e,t){return t?C(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function At(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let s=o.github()[0],c=t===void 0?null:Number.parseInt(t,10),l=!r&&n.data?.available?n.data.items.find(e=>e.number===c):void 0,u=i&&c!==null&&!a.some(e=>e.number===c)?i.find(e=>e.number===c):void 0,d=l??u,[f,p]=(0,J.useState)(null);return(0,J.useEffect)(()=>{d&&p({scope:s,view:e,item:d})},[s,e,d]),{selectedNumber:c,remoteDetail:d??(f?.scope===s&&f.view===e&&f.item.number===c?f.item:null)}}function jt(e,t,n,{fullList:r,filterRows:i},a){let s=x(),c=(0,J.useRef)(null),l=e===`issues`?`issue`:`pr`,u=t?.available===!0&&n!==null&&Number.isSafeInteger(n)&&n>0&&!r.some(e=>e.number===n)&&!i?.some(e=>e.number===n)&&a===null,d=f(l,n??0,u),p=u&&d.data?.available&&d.data.item?.kind===l?d.data.item:null;c.current=u&&n!==null?{kind:l,number:n,key:o.githubItem(l,n)}:null;let[m,h]=(0,J.useState)(!1);return{exactWanted:u,exactItem:d,exactDetail:p,exactTargetRef:c,retryingExact:m,retryExact:()=>{h(!0),kt(s,c.current).then(e=>{h(!1),e||S(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function Mt(e,t,n){let r=x(),i=(0,J.useRef)(null);return{refresh:c({mutationFn:e=>(kt(r,e),b({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:o.githubPages(50),exact:!0}),r.setQueryData(o.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:o.githubChecks(t)});let s=e===`issues`?`issue`:`pr`,c=(e===`issues`?a.issues:a.prs).map(e=>e.number),l=o.githubCommentCounts(s,c);r.removeQueries({queryKey:o.githubCommentCounts(s,[]).slice(0,4),predicate:e=>e.queryHash!==y(l)}),a.available&&a.commentsDeferred&&c.length>0&&g(s,c,{refresh:!0}).then(e=>r.setQueryData(l,e)).catch(()=>{}),r.invalidateQueries({queryKey:o.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:o.githubSearch(`pr`,De)}),r.invalidateQueries({queryKey:o.githubSearch(`pr`,Ee)});let u=i.current,d=o.githubComments(`issue`,0).slice(0,3);if(!u){r.removeQueries({queryKey:d});return}let f=o.githubComments(u.kind,u.number);v(u.kind,u.number,{refresh:!0}).then(e=>r.setQueryData(f,e)).catch(()=>{}),r.removeQueries({queryKey:d,predicate:e=>e.queryHash!==y(f)})},onError:e=>S(e.message,{tone:`danger`})}),openThreadRef:i}}var Nt=350;function Pt(e,t){let[n,r]=(0,J.useState)(e);return(0,J.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Ft(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let l=Pt(n,Nt),u=(0,J.useMemo)(()=>q(o,{query:l,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,l,r,e,i,a,s]),f=n.trim()===l.trim(),p=t?.available===!0&&!c&&f&&Be(l,u),m=d(e===`issues`?`issue`:`pr`,l,p),h=q(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),g=p&&m.data?.available?m.data:null,_=new Set(h.map(e=>e.number)),v=It(e,g,a,i);return{debouncedQuery:l,searchWanted:p,forgeSearch:m,items:h,searchPayload:g,metadataFailure:v,searchHits:g&&!v?q(g.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!_.has(e.number)):[],...Lt(n,f,p,m)}}function It(e,t,n,r){return e===`issues`&&t?n&&t.items.some(e=>e.projectIds===void 0)?t.projectsReason??`Project board data is incomplete. Refresh to try again.`:r.length&&t.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null}function Lt(e,t,n,r){return{searching:e.trim()!==``&&!t||n&&r.isPending,searchFailed:n&&(r.data?.available===!1||r.isError),searchFailureReason:r.data?.available===!1?r.data.reason??`unknown reason`:r.error instanceof Error?r.error.message:`the search request failed`}}function Rt({width:e,onWidthChange:t}){let n=(0,J.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(Y(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,X.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(Y(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 zt({view:e,changes:t=!1,index:n=!1}){let{n:r}=ee(),i=wt(e),{rawFilterParam:a,activeFilter:o}=i,s=Te(),{pages:c,data:l}=m(50),d=be(),f=Vt(),p=qe(),h=Bt({index:n,isDesktop:s,rawFilterParam:a,n:r,rememberedView:u().data?.githubView}),g=Ht(l?.available===!0&&!h.filterScreen),[_,v]=(0,J.useState)(!1),y=Tt(e,l,i),b=Dt(e,l,i,y.isAssignedFilter),x=Ft(e,l,y,b),S=At(e,r,x.forgeSearch,b),C=jt(e,l,S.selectedNumber,b,S.remoteDetail),w=Ct(e,c,l,S.selectedNumber,x.searchHits,b.openItems),{refresh:T,openThreadRef:E}=Mt(e,w.checkPrNumbers,x.debouncedQuery),D=vt(e,c,l,b.backedQuery,y.narrowing);if(h.restorePrs)return(0,X.jsx)(oe,{to:`/github/prs`,replace:!0});if(!l)return c.isError?(0,X.jsx)(W,{route:`github`,density:`empty`,children:(0,X.jsx)(G,{icon:(0,X.jsx)(j,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:c.error.message})}):(0,X.jsx)(je,{});E.current=null;let O=()=>T.mutate(C.exactTargetRef.current);if(h.filterScreen&&l.available)return(0,X.jsx)(lt,{onRefresh:O,refreshing:T.isPending});if(!l.available)return(0,X.jsx)(qt,{reason:l.reason,refreshing:T.isPending,onRetry:O});let{labelColors:k,labelOptions:A}=Ut(l,x.searchPayload,b.openItems,b.fullList),M=Wt({number:S.selectedNumber,items:x.items,searchHits:x.searchHits,fullList:b.fullList,filterRows:b.filterRows,remoteDetail:S.remoteDetail,exactDetail:C.exactDetail});E.current=M?{kind:M.kind,number:M.number}:null;let{linkFilter:te,listPath:ne}=Gt(e,a,o,s),N={view:e,filter:te,colors:k,selected:M,queued:p.queued,checksMap:w.checksMap,commentsOf:w.commentsOf},P=Kt(e,y,b.filterGate,x),re=he(x.items.length+x.searchHits.length);return(0,X.jsx)(W,{rootRef:g.routeRef,route:`github`,density:re,headerSpacing:`compact`,className:`pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-4`,bodyClassName:`gap-2.5`,header:ut({view:e,activeFilter:o,isDesktop:s,rawFilterParam:a,n:r,gh:l,actions:{automationsAvailable:d,refreshing:T.isPending,onRefresh:O}}),children:(0,X.jsxs)(`div`,{ref:g.workspaceRef,"data-slot":`gh-workspace`,"data-stacked":g.panesStacked,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-5`,children:[(0,X.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-4`,children:[(0,X.jsx)(Jt,{view:e,isDesktop:s,gh:l,onSaveView:f}),(0,X.jsx)(Yt,{view:e,gh:l,filters:y,labelOptions:A,labelColors:k,searchPayload:x.searchPayload})]}),(0,X.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,X.jsx)(Qt,{view:e,n:r,rows:N,verdict:P,search:x,sidebar:b,list:c,paging:D,width:g.githubListWidth,onWidthChange:g.changeGithubListWidth,expanded:_,onExpandedChange:v}),(0,X.jsx)(an,{view:e,n:r,selected:M,selectedNumber:S.selectedNumber,exact:C,repo:l.repo,rows:N,listPath:ne,changes:t,handToAgent:p})]})]})})}function Bt({index:e,isDesktop:t,rawFilterParam:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&n===null&&r===void 0,restorePrs:e&&t&&n===null&&i===`prs`}}function Vt(){let e=x();return t=>{e.setQueryData(o.uiState,e=>({...e,githubView:t})),_({githubView:t}).then(t=>e.setQueryData(o.uiState,t)).catch(t=>{S(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:o.uiState})})}}function Ht(e){let[t,n]=(0,J.useState)(Xe),[r,i]=(0,J.useState)(!0),a=(0,J.useRef)(null),o=(0,J.useRef)(null);return(0,J.useEffect)(()=>{if(!e)return;let n=a.current,r=o.current,s=n?.closest(`[data-slot="main"]`);if(!n||!r||!s)return;let c=window.matchMedia(`(min-width: 768px)`),l=!1,u=()=>{if(l=c.matches&&r.clientWidth>=t+22+360,i(!l),!l||s.clientHeight<1){n.style.removeProperty(`--gh-workspace-height`);return}n.style.setProperty(`--gh-workspace-height`,`${Math.round(s.clientHeight)}px`)};u();let d=new ResizeObserver(u);d.observe(s),d.observe(r);let f=e=>{if(!l||e.ctrlKey||!e.deltaY||Math.abs(e.deltaX)>Math.abs(e.deltaY)||r.getBoundingClientRect().top<=s.getBoundingClientRect().top+1||!(e.target instanceof Element)||!e.target.closest(`[data-slot="gh-panes"]`))return;e.preventDefault();let t=e.deltaMode===1?16:e.deltaMode===2?s.clientHeight:1;s.scrollTop+=e.deltaY*t};return r.addEventListener(`wheel`,f,{passive:!1}),c.addEventListener(`change`,u),()=>{r.removeEventListener(`wheel`,f),d.disconnect(),c.removeEventListener(`change`,u)}},[e,t]),{githubListWidth:t,changeGithubListWidth:e=>{let t=Y(e);n(t),Ze(t)},panesStacked:r,routeRef:a,workspaceRef:o}}function Ut(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:He([...n,...r,...t?.items??[]])}}function Wt({number:e,items:t,searchHits:n,fullList:r,filterRows:i,remoteDetail:a,exactDetail:o}){return e===null?t[0]??n[0]??null:r.find(t=>t.number===e)??i?.find(t=>t.number===e)??a??o??null}function Gt(e,t,n,r){let i=t===null?null:n;return{linkFilter:i,listPath:Ie(e,i??(e===`issues`&&!r?`all`:null))}}function Kt(e,{query:t,filtering:n},r,{searching:i,searchFailed:a,searchFailureReason:o,metadataFailure:s,searchHits:c,searchPayload:l,items:u}){let d=e===`issues`?`issues`:`pull requests`;return r?(0,X.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":r.kind,children:[r.kind===`loading`?(0,X.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,r.message]}):n?i?(0,X.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,t.trim(),`”…`]}):a?c.length>0?(0,X.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,o,`. Use Refresh to try again.`]}):u.length>0?(0,X.jsxs)(`p`,{children:[`GitHub could not be searched: `,o,`.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter, and GitHub could not be searched: `,o,`.`]}):s?(0,X.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,s]}):c.length>0?null:l?.truncated?(0,X.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):l&&u.length>0?(0,X.jsxs)(`p`,{children:[`No additional `,d,` match your filter on GitHub.`]}):l?(0,X.jsxs)(`p`,{children:[`No `,d,` match your filter — open, closed or merged.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,`.`]})}function qt({reason:e,refreshing:t,onRetry:n}){return(0,X.jsx)(W,{route:`github`,density:`empty`,children:(0,X.jsx)(G,{icon:(0,X.jsx)(T,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,X.jsx)(F,{variant:`outline`,"data-action":`gh-retry`,disabled:t,onClick:n,children:`Try again`}),children:(0,X.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`The tab needs the `,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in Squawk works without it.`]})})})}function Jt({view:e,isDesktop:t,gh:n,onSaveView:r}){return(0,X.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,X.jsxs)(Je,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>r(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,X.jsxs)(Je,{to:`/github/prs`,active:e===`prs`,onClick:()=>r(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]})]})}function Yt({view:e,gh:t,filters:n,labelOptions:r,labelColors:i,searchPayload:a}){return(0,X.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,X.jsx)(E,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,X.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:n.query,onChange:e=>n.setQuery(e.target.value),className:`min-h-11 w-full rounded-lg border border-card-edge bg-card shadow-card py-1 pr-2.5 pl-8 text-[13px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,X.jsx)(cn,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,X.jsx)(ct,{data:{...t,issues:[...t.issues,...a?.items??[]]},assignees:n.effectiveAssignees,projectId:n.activeProject,onAssigneesChange:n.changeAssignees,onProjectChange:n.setProjectFilter}):null,(0,X.jsx)(`button`,{type:`button`,disabled:!n.filtering,"data-slot":`gh-clear-filters`,className:`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:border-border disabled:bg-transparent disabled:text-muted-foreground`,onClick:n.clearFilters,children:`Clear filters`})]})}function Xt(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Zt(e,t){return(0,X.jsx)(pt,{item:e,view:t.view,filter:t.filter,colors:t.colors,active:t.selected?.url===e.url,queued:t.queued.has(e.url),checks:Xt(e,t.checksMap),comments:t.commentsOf(e)})}function Qt({view:e,n:t,rows:n,verdict:r,search:i,sidebar:a,list:o,paging:s,width:c,onWidthChange:l,expanded:u,onExpandedChange:d}){let{items:f,searchHits:p}=i,m=e===`issues`&&t!==void 0&&!u;return(0,X.jsxs)(`section`,{ref:s.setListEl,"data-slot":`gh-list`,"data-mobile-preview":m||void 0,style:{"--github-list-width":`${c}px`},className:`relative flex w-full min-h-0 min-w-0 flex-col rounded-lg border border-card-edge bg-card shadow-card p-3 md:w-[var(--github-list-width)] md:shrink-0 md:overflow-x-hidden md:overflow-y-auto`,children:[f.length===0?r&&(0,X.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-muted-foreground`,children:r}):(0,X.jsx)($t,{items:f,rows:n,compactPreview:m,paging:s}),s.pagingAvailable?(0,X.jsx)(en,{view:e,list:o,paging:s}):null,(0,X.jsx)(tn,{backedQuery:a.backedQuery,filterSearch:a.filterSearch}),(0,X.jsx)(nn,{view:e,n:t,count:f.length,expanded:u,onExpandedChange:d}),f.length>0&&i.searchWanted&&r?(0,X.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-muted-foreground`,children:r}):null,p.length>0?(0,X.jsx)(rn,{hits:p,searchPayload:i.searchPayload,rows:n}):null,(0,X.jsx)(Rt,{width:c,onWidthChange:l})]})}function $t({items:e,rows:t,compactPreview:n,paging:r}){let{setRowsEl:i,scrollOwner:a,listEl:o,scrollOwnerRef:s,startMargin:c}=r,l=e.map((e,r)=>(0,X.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":r>0||void 0,"data-compact-hidden":n&&r>=2&&t.selected?.url!==e.url||void 0,children:Zt(e,t)},e.url));return(0,X.jsx)(`div`,{ref:i,"data-slot":`gh-rows`,"data-virtualized":a?`true`:void 0,role:`list`,children:a?(0,X.jsx)(Ne,{scrollRef:s,startMargin:c,children:l},a===o?`list`:`main`):l})}function en({view:e,list:t,paging:n}){return(0,X.jsx)(`div`,{ref:n.loadMoreRef,"data-slot":`gh-load-more`,className:`flex min-h-6 items-center justify-center gap-1.5 px-4 pb-3 text-xs text-muted-foreground`,children:t.isFetchingNextPage?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(P,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Loading more…`]}):t.isFetchNextPageError?(0,X.jsxs)(X.Fragment,{children:[`Could not load more.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-retry`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Retry`})]}):n.manualPaging?(0,X.jsxs)(X.Fragment,{children:[`Filters cover the loaded `,e===`issues`?`issues`:`pull requests`,`.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-manual`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Load more`})]}):null})}function tn({backedQuery:e,filterSearch:t}){return e!==null&&t.data?.available&&t.data.truncated?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-muted-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function nn({view:e,n:t,count:n,expanded:r,onExpandedChange:i}){return e===`issues`&&t!==void 0&&n>2?(0,X.jsx)(F,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":r,onClick:()=>i(e=>!e),children:r?`Show fewer issues`:`View all ${n} issues`}):null}function rn({hits:e,searchPayload:t,rows:n}){return(0,X.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,X.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,X.jsx)(`li`,{children:Zt(e,n)},e.url))})]})}function an({view:e,n:t,selected:n,selectedNumber:r,exact:a,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}){let{exactWanted:d,exactItem:f}=a;return(0,X.jsx)(`section`,{"data-slot":`gh-detail`,className:i(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-card-edge bg-card shadow-card md:overflow-y-auto`,t===void 0?`hidden md:flex`:`flex`),children:n?(0,X.jsx)(on,{item:n,n:t,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}):d&&f.isPending?(0,X.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex min-h-full flex-1 flex-col`,children:(0,X.jsx)(G,{icon:(0,X.jsx)(P,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${r}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):d&&(f.isError||f.data?.available===!1)?(0,X.jsx)(sn,{number:r,exact:a}):(0,X.jsx)(ft,{view:e,number:r})})}function on({item:e,n:t,repo:n,rows:r,listPath:i,changes:a,handToAgent:o}){let{workflows:s,skillList:c,workflow:l,setWorkflow:u,selectedSkills:d,setSelectedSkills:f,engine:p,setEngine:m,queued:h,onQueued:g}=o;return(0,X.jsx)(We,{item:e,comments:r.commentsOf(e),afterHeading:e.kind===`issue`?(0,X.jsx)(Qe,{number:e.number,repo:n},t??`list`):void 0,backLink:{to:i},subNav:{filter:r.filter,changes:a},onRunAgent:bt,headerAction:(0,X.jsx)(yt,{item:e,queuedRunId:h.get(e.url)??null}),colors:r.colors,checks:Xt(e,r.checksMap),children:(0,X.jsx)(Ue,{item:e,workflows:s.data?.workflows??[],skills:c,workflow:l,onWorkflowChange:u,selectedSkills:d,onSkillsChange:f,engine:p,onEngineChange:m,queuedRunId:h.get(e.url)??null,onQueued:g},e.url)})}function sn({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,X.jsx)(G,{icon:(0,X.jsx)(j,{size:16}),tone:n.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${e}`,subtitle:n.data?.available===!1?n.data.reason:n.error instanceof Error?n.error.message:`The request failed.`,actions:(0,X.jsx)(F,{variant:`outline`,disabled:r,onClick:i,children:`Retry`})})}function cn({options:e,colors:t,selected:n,onChange:r}){let[a,o]=(0,J.useState)(!1),s=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,X.jsxs)(V,{open:a,onOpenChange:o,children:[(0,X.jsx)(z,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:i(`inline-flex min-h-11 min-w-11 shrink-0 items-center gap-1.5 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,X.jsx)(A,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(B,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,X.jsxs)(me,{children:[(0,X.jsx)(ue,{placeholder:`Filter labels…`}),(0,X.jsxs)(pe,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,X.jsx)(fe,{children:`No labels.`}),n.length>0?(0,X.jsxs)(de,{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,X.jsxs)(de,{value:e,onSelect:()=>s(e),className:`min-h-11`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:ze(t[e])}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,X.jsx)(O,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{zt as GithubRoute};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-BY76lXLH.js","assets/css-BsVw1vtW.js","assets/javascript-BgS3c2Ky.js","assets/core-DzoyrHjB.js","assets/lib-DrPFkMXk.js","assets/rolldown-runtime-QTnfLwEv.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./utils-DSMR_WLb.js";import{t}from"./preload-helper-Czpn1I53.js";import{t as n}from"./own-lookup-DS54wXvD.js";var r={core:null,langs:new Map},i={name:`cezar-syn`,type:`dark`,fg:`var(--syn-var)`,bg:`transparent`,settings:[{scope:[`keyword`,`storage`,`constant.language`,`variable.language`,`entity.other.attribute-name`,`support.type.property-name`],settings:{foreground:`var(--syn-key)`}},{scope:[`string`,`punctuation.definition.string`],settings:{foreground:`var(--syn-str)`}},{scope:[`entity.name.function`,`support.function`,`entity.name.tag`,`entity.name.type`,`entity.name.class`,`support.class`,`support.type`],settings:{foreground:`var(--syn-fn)`}},{scope:[`comment`,`punctuation.definition.comment`],settings:{foreground:`var(--syn-com)`}},{scope:[`constant.numeric`,`constant.character`,`constant.other`,`support.constant`,`keyword.other.unit`],settings:{foreground:`var(--syn-num)`}},{scope:[`punctuation`,`keyword.operator`,`meta.brace`,`punctuation.separator`,`punctuation.terminator`],settings:{foreground:`var(--syn-punc)`}},{scope:[`variable`,`entity.name.variable`],settings:{foreground:`var(--syn-var)`}}]},a={typescript:()=>t(()=>import(`./typescript-bsJCZSQ-.js`),[]),tsx:()=>t(()=>import(`./tsx-udAQXfEw.js`),[]),javascript:()=>t(()=>import(`./javascript-BgS3c2Ky.js`),[]),jsx:()=>t(()=>import(`./jsx-Bz0zcwM4.js`),[]),json:()=>t(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>t(()=>import(`./jsonc-CYpm1nAK.js`),[]),shellscript:()=>t(()=>import(`./shellscript-CLZ0U2zV.js`),[]),python:()=>t(()=>import(`./python-gzcpVVnB.js`),[]),markdown:()=>t(()=>import(`./markdown-BYOwaDjH.js`),[]),css:()=>t(()=>import(`./css-BsVw1vtW.js`),[]),html:()=>t(()=>import(`./html-BY76lXLH.js`),__vite__mapDeps([0,1,2])),diff:()=>t(()=>import(`./diff-woXpYk--.js`),[]),yaml:()=>t(()=>import(`./yaml-rwi0_p6S.js`),[]),toml:()=>t(()=>import(`./toml-CcmNWLt0.js`),[]),go:()=>t(()=>import(`./go-rLFTqkRN.js`),[]),rust:()=>t(()=>import(`./rust-Cfkwpbl8.js`),[]),sql:()=>t(()=>import(`./sql-BsFa4tDR.js`),[])},o={ts:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,bash:`shellscript`,sh:`shellscript`,shell:`shellscript`,zsh:`shellscript`,console:`shellscript`,py:`python`,md:`markdown`,yml:`yaml`,golang:`go`,rs:`rust`,vue:`html`,xml:`html`},s=new Set([``,`plaintext`,`text`,`txt`,`plain`]);function c(e){let t=e.trim().toLowerCase();return Object.hasOwn(a,t)?t:n(o,t)??null}function l(e){return s.has(e.trim().toLowerCase())}function u(){return[...Object.keys(a),...Object.keys(o),...s].filter(e=>e!==``)}function d(e){let t=e.slice(e.lastIndexOf(`/`)+1),r=t.lastIndexOf(`.`);if(r<=0)return null;let i=t.slice(r+1).toLowerCase();return c(n({mts:`typescript`,cts:`typescript`,htm:`html`},i)??i)}var f=null,p=new Set;function m(){return r.core??=Promise.all([t(()=>import(`./core-DzoyrHjB.js`),__vite__mapDeps([3,4,5])),t(()=>import(`./engine-javascript-FQvzRocB.js`),[])]).then(async([{createHighlighterCore:e},{createJavaScriptRegexEngine:t}])=>(f=await e({themes:[i],langs:[],engine:t({forgiving:!0})}),f)),r.core}function h(e){let t=c(e);if(t===null||p.has(t))return Promise.resolve();let n=r.langs.get(t);return n||(n=m().then(async e=>{await e.loadLanguage(await a[t]()),p.add(t)}).catch(()=>{r.langs.delete(t)}),r.langs.set(t,n)),n}function g(e){return{tokens:e.split(`
|
|
3
|
-
`).map(e=>[{content:e}]),fg:`var(--syn-var)`,bg:`transparent`}}function _(t,n,r={}){if(l(n))return g(t);let a=c(n);if(a===null)return g(t);if(!f||!p.has(a))return null;try{let n=f.codeToTokens(t,{lang:a,theme:i.name,...e({tokenizeTimeLimit:r.tokenizeTimeLimit})});return{tokens:n.tokens.map(t=>t.map(({content:t,color:n})=>({content:t,...e({color:n})}))),fg:n.fg??`var(--syn-var)`,bg:`transparent`}}catch{return g(t)}}async function v(e,t,n={}){return _(e,t,n)||(await h(t),_(e,t,n)??g(e))}export{d as a,_ as i,c as n,u as o,v as r,i as t};
|
|
@@ -1 +0,0 @@
|
|
|
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-DSMR_WLb.js";import{a as i,i as a,n as o,o as s,s as c,t as l}from"./html-report-BX3msvci.js";var u=e(t(),1),d=n(),f=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function p(e){let t=f.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var m={};function h(e){let t=(0,u.useMemo)(()=>s(e),[e]).join(` `),[n,r]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!t)return;let e=!0;return c(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:m}function g({html:e,title:t,fragment:n,className:i}){let a=h(e);return a?(0,d.jsx)(_,{html:e,title:t,fragment:n,className:i,libraries:a}):(0,d.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:r(`flex min-h-0 flex-col`,i)})}function _({html:e,title:t,fragment:n,className:s,libraries:c}){let{srcdoc:f,blocked:m}=(0,u.useMemo)(()=>{let n=a(e,c);return{srcdoc:i(n.srcdoc,t),blocked:n.blocked}},[e,c,t]),h=e=>{n&&/^#\S+$/.test(n)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${n}`)},g=p(m);return(0,d.jsxs)(`div`,{"data-slot":`html-report`,className:r(`flex min-h-0 flex-col`,s),children:[g?(0,d.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,g,`. Reports show only what they carry inside the file.`]}):null,(0,d.jsx)(`div`,{"data-slot":`html-report-viewport`,className:`flex min-h-0 flex-1 flex-col bg-muted/40 p-2 md:p-4`,children:(0,d.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:o,allow:l,srcDoc:f,referrerPolicy:`no-referrer`,onLoad:h,className:`block min-h-0 w-full flex-1 rounded-md border border-border bg-report-canvas shadow-sm`})})]})}export{g as t};
|