cezarion 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/web/dist/app-icon.png +0 -0
- package/web/dist/assets/accounts-section-COizLyTO.js +1 -0
- package/web/dist/assets/{activity-motion-0wHCeUs7.css → activity-motion-DcKVM8fM.css} +1 -1
- package/web/dist/assets/activity-motion-DfI5xoMG.js +2 -0
- package/web/dist/assets/activity-route-BQs2vBeo.js +1 -0
- package/web/dist/assets/agent-config-section-BwBo-HRw.js +7 -0
- package/web/dist/assets/agent-defaults-section-h-Gjb_gh.js +1 -0
- package/web/dist/assets/agents-settings-path-7X6_cvUg.js +1 -0
- package/web/dist/assets/appearance-Bcl2amXv.js +1 -0
- package/web/dist/assets/archive-on-merge-field-Bm8miJjt.js +1 -0
- package/web/dist/assets/attention-8bNiiAFt.js +1 -0
- package/web/dist/assets/automation-format-DB34jUyF.js +1 -0
- package/web/dist/assets/automations-route-CutF-cGn.css +1 -0
- package/web/dist/assets/automations-route-rSezHxBp.js +2 -0
- package/web/dist/assets/badge-DQ3U69Ht.js +1 -0
- package/web/dist/assets/bot-TkDIw4y-.js +1 -0
- package/web/dist/assets/bundle-mjs-rHxsej31.js +1 -0
- package/web/dist/assets/button-B7MKxYjT.js +1 -0
- package/web/dist/assets/centered-state-V15AR_qo.js +1 -0
- package/web/dist/assets/cez-idle-CdswdDRd.js +1 -0
- package/web/dist/assets/change-counts-CW7O8g5Y.js +1 -0
- package/web/dist/assets/check-OP-CVgZG.js +1 -0
- package/web/dist/assets/chevron-down-CHGyCDBH.js +1 -0
- package/web/dist/assets/chevron-right-BENZ-1ZN.js +1 -0
- package/web/dist/assets/{chunk-BO2N2NFS-DE6qKn3r.js → chunk-BO2N2NFS-DQrpGzb-.js} +17 -17
- package/web/dist/assets/chunk-KS7C4IRE-Cg8l-LDN.js +3 -0
- package/web/dist/assets/circle-x-7nTlobAF.js +1 -0
- package/web/dist/assets/code-editor-B4baSOhz.js +4 -0
- package/web/dist/assets/collapsible-BEV4FO-1.js +1 -0
- package/web/dist/assets/command-KdW7aO0N.js +1 -0
- package/web/dist/assets/commit-list-DtEqtn9o.js +1 -0
- package/web/dist/assets/{core-BCsw8oQw.js → core-DzoyrHjB.js} +2 -2
- package/web/dist/assets/design-icons-CzEoMH9c.js +1 -0
- package/web/dist/assets/dialog-B531GGAo.js +1 -0
- package/web/dist/assets/diff-BK789dS0.js +3 -0
- package/web/dist/assets/diff-controls-BFqQNxRu.js +1 -0
- package/web/dist/assets/diff-view-BEgQ7jZV.js +11 -0
- package/web/dist/assets/dist-BAoXdNsT.js +1 -0
- package/web/dist/assets/dist-BW234Kg5.js +1 -0
- package/web/dist/assets/dist-C5mlVBmd.js +1 -0
- package/web/dist/assets/dist-Czz3Y5qH.js +1 -0
- package/web/dist/assets/dist-DXO3xwbC.js +1 -0
- package/web/dist/assets/dist-Da4ckcJG.js +1 -0
- package/web/dist/assets/dropdown-menu-4e2iKSMT.js +1 -0
- package/web/dist/assets/es2015-CQth82uv.js +41 -0
- package/web/dist/assets/external-link-BE6y205O.js +1 -0
- package/web/dist/assets/file-preview-CDWTFZ4P.js +2 -0
- package/web/dist/assets/folder-browser-BfclRPcX.js +1 -0
- package/web/dist/assets/folder-o-AvL3y3.js +1 -0
- package/web/dist/assets/format-BU7D3IfE.js +1 -0
- package/web/dist/assets/git-toolbar-Pugtjt-9.js +1 -0
- package/web/dist/assets/github-CvpaGHe6.js +1 -0
- package/web/dist/assets/global-activity-route-Di_ICsRI.js +1 -0
- package/web/dist/assets/{highlighted-body-OFNGDK62-BL-MfFgl.js → highlighted-body-OFNGDK62-Cx8MiNVZ.js} +1 -1
- package/web/dist/assets/highlighter-DvLzHjjY.js +3 -0
- package/web/dist/assets/hourglass-CikYdGGQ.js +1 -0
- package/web/dist/assets/image-preview-Dx2w5oIn.js +1 -0
- package/web/dist/assets/index-CGjknHnV.css +1 -0
- package/web/dist/assets/index-CJFT0IZP.js +21 -0
- package/web/dist/assets/label-DEH7fJN4.js +1 -0
- package/web/dist/assets/lib-DrPFkMXk.js +1 -0
- package/web/dist/assets/live-protocol-DMhTnCmf.js +64 -0
- package/web/dist/assets/live-reads-BJ9eDISf.js +1 -0
- package/web/dist/assets/live-refetch-VoLPvzhe.js +1 -0
- package/web/dist/assets/{live-worker-BWdeGzQX.ts → live-worker-DBw-5jVE.ts} +3 -1
- package/web/dist/assets/loader-circle-CPBhhDbB.js +1 -0
- package/web/dist/assets/markdown-Dv0r75AX.js +4 -0
- package/web/dist/assets/mermaid-GHXKKRXX-lTc_AjAC.js +1 -0
- package/web/dist/assets/moon-CRE9nU5R.js +1 -0
- package/web/dist/assets/nav-row-styles-DqKjMToI.js +1 -0
- package/web/dist/assets/notifications-section-DCiqPl3M.js +1 -0
- package/web/dist/assets/open-in-menu-HM5l7Bwk.js +1 -0
- package/web/dist/assets/own-lookup-DS54wXvD.js +1 -0
- package/web/dist/assets/play-CmVAj_fu.js +1 -0
- package/web/dist/assets/plus-CxRU2X8C.js +1 -0
- package/web/dist/assets/popover-BPgUYFyu.js +1 -0
- package/web/dist/assets/preload-helper-Czpn1I53.js +1 -0
- package/web/dist/assets/preview-pane-connected-WV9oolnn.js +3 -0
- package/web/dist/assets/project-location-CfJLc6aJ.js +1 -0
- package/web/dist/assets/project-order-AcHI4Dcl.js +1 -0
- package/web/dist/assets/project-rail-sortable-BmVI4_-T.js +1 -0
- package/web/dist/assets/project-router-Bii3ofOk.js +1 -0
- package/web/dist/assets/project-scope-context-BdqKyBHa.js +4 -0
- package/web/dist/assets/projects-section-D2cACaaG.js +1 -0
- package/web/dist/assets/prompt-templates-section-toLPd5u2.js +1 -0
- package/web/dist/assets/queries-C7VNk-nW.js +1 -0
- package/web/dist/assets/reference-chip-rylFalfg.js +1 -0
- package/web/dist/assets/remote-settings-notice-N9vtBTIK.js +1 -0
- package/web/dist/assets/repo-git-DJym0aRY.js +1 -0
- package/web/dist/assets/report-reader-CjskGtxS.js +1 -0
- package/web/dist/assets/reports-B-G9HA48.js +1 -0
- package/web/dist/assets/reports-CNFNb36Z.css +1 -0
- package/web/dist/assets/resources-section-B88h1y0Q.js +1 -0
- package/web/dist/assets/run-header-B-olCSdg.js +2 -0
- package/web/dist/assets/{run-header-CC7VUTg9.css → run-header-Ccnr9k0X.css} +1 -1
- package/web/dist/assets/save-cue-Cd3ZAPBS.js +1 -0
- package/web/dist/assets/saved-draft-BwzBc-_Y.js +1 -0
- package/web/dist/assets/select-BaydzE-I.js +1 -0
- package/web/dist/assets/session-context-section-BJKRXbss.js +119 -0
- package/web/dist/assets/settings-agent-picker-6xZMIC_D.js +1 -0
- package/web/dist/assets/settings-field-DP9sYv5a.js +1 -0
- package/web/dist/assets/settings-select-CCIMGnyA.js +1 -0
- package/web/dist/assets/settings-shell-BkTgs1S9.js +1 -0
- package/web/dist/assets/settings-shell-iSd4xMWS.css +1 -0
- package/web/dist/assets/sidebar-section-B57HIEgv.js +1 -0
- package/web/dist/assets/skills-pBrfwrKF.js +1 -0
- package/web/dist/assets/skills-pM_PouEs.js +1 -0
- package/web/dist/assets/smartphone-Lr8Ug2z_.js +1 -0
- package/web/dist/assets/sortable.esm-CAVTYaA3.js +5 -0
- package/web/dist/assets/square-terminal-B6RYYieR.js +1 -0
- package/web/dist/assets/status-dot-BRzVlF2X.js +1 -0
- package/web/dist/assets/switch-SP8pw5uU.js +1 -0
- package/web/dist/assets/tab-link-B1CULYRs.js +1 -0
- package/web/dist/assets/task-changes-CXldTh93.js +1 -0
- package/web/dist/assets/task-commits-BZ3B_GPB.js +1 -0
- package/web/dist/assets/task-files-BSfmCkJc.js +1 -0
- package/web/dist/assets/task-github-item-v2bygvdO.js +1 -0
- package/web/dist/assets/task-groups-BbnYlkYj.js +1 -0
- package/web/dist/assets/task-thread-BPWnJ7Qx.js +9 -0
- package/web/dist/assets/task-thread-DzADOhZd.css +1 -0
- package/web/dist/assets/tasks-table-Cx7AM7lZ.js +1 -0
- package/web/dist/assets/textarea-vJt9undk.js +1 -0
- package/web/dist/assets/thread-state-R0MTvwlo.js +4 -0
- package/web/dist/assets/toaster-Bo5vCbz-.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-B6h6kcQg.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-BckHuhr8.js +1 -0
- package/web/dist/assets/{useInfiniteQuery-qEY8OhKb.js → useInfiniteQuery--iQKfpUQ.js} +1 -1
- package/web/dist/assets/useQuery-BSyhc3l3.js +1 -0
- package/web/dist/assets/utils-DSMR_WLb.js +1 -0
- package/web/dist/assets/workflows-BBc2PFDB.js +7 -0
- package/web/dist/assets/workflows-C6suai0L.css +1 -0
- package/web/dist/assets/workspace-tools-CiTG-ArW.js +1 -0
- package/web/dist/assets/worktrees-section-C07tNayi.js +4 -0
- package/web/dist/assets/zoomable-image-CIQl1Wpe.js +1 -0
- package/web/dist/index.html +68 -32
- package/web/dist/live-worker.js +2 -2
- package/web/dist/assets/activity-motion-hhx0e841.js +0 -2
- package/web/dist/assets/activity-route-De0BnSrc.js +0 -1
- package/web/dist/assets/agent-accounts-BCg-578Q.js +0 -18
- package/web/dist/assets/alert-dialog-Dj464rjk.js +0 -1
- package/web/dist/assets/bundle-mjs-BT31bpU6.js +0 -1
- package/web/dist/assets/button-CHUAMTHK.js +0 -3
- package/web/dist/assets/centered-state-DGyy0SuA.js +0 -1
- package/web/dist/assets/cez-idle-BT0U4GN_.js +0 -1
- package/web/dist/assets/commit-diff-panel-DYtYc_dH.js +0 -1
- package/web/dist/assets/control-locations-CA9TMupq.js +0 -1
- package/web/dist/assets/design-icons-DmYTv2r1.js +0 -1
- package/web/dist/assets/diff-controls-BR2uqhwG.js +0 -1
- package/web/dist/assets/diff-tVGVhYyc.js +0 -3
- package/web/dist/assets/diff-view-CNM3u77o.js +0 -11
- package/web/dist/assets/dropdown-menu-DhrBcVgr.js +0 -1
- package/web/dist/assets/es2015-D345RR4o.js +0 -41
- package/web/dist/assets/file-preview-C1eTdJLJ.js +0 -2
- package/web/dist/assets/git-toolbar-Dwz8p8GW.js +0 -1
- package/web/dist/assets/github-BSezqH6f.js +0 -1
- package/web/dist/assets/github-sidebar-model-Ct0DltOv.js +0 -1
- package/web/dist/assets/global-activity-route-BZiYz-B0.js +0 -1
- package/web/dist/assets/hourglass-B0lPAJvT.js +0 -1
- package/web/dist/assets/image-preview-Cq1vDiEo.js +0 -1
- package/web/dist/assets/index-B18AqW0Z.css +0 -1
- package/web/dist/assets/index-D489J7QW.js +0 -14
- package/web/dist/assets/lib-BxQXEXDF.js +0 -1
- package/web/dist/assets/live-protocol-BDY7JJpT.js +0 -64
- package/web/dist/assets/live-refetch-C0kQc3-z.js +0 -1
- package/web/dist/assets/loader-circle-CZkGEdoI.js +0 -1
- package/web/dist/assets/markdown-D7DUNWcJ.js +0 -6
- package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +0 -1
- package/web/dist/assets/nav-row-styles-BZUUavOF.js +0 -1
- package/web/dist/assets/popover-DRcRI46x.js +0 -1
- package/web/dist/assets/preview-pane-connected-DGkEs_L3.js +0 -3
- package/web/dist/assets/project-router-1m_VlC22.js +0 -1
- package/web/dist/assets/project-scope-context-CaUqlAd7.js +0 -4
- package/web/dist/assets/queries-DYfIpJ-d.js +0 -1
- package/web/dist/assets/repo-git-CU1S5P-y.js +0 -1
- package/web/dist/assets/report-reader-DlZol2Ux.js +0 -1
- package/web/dist/assets/reports-B7QAzibP.css +0 -1
- package/web/dist/assets/reports-DIGGjk7C.js +0 -1
- package/web/dist/assets/run-header-DPjiPKRe.js +0 -2
- package/web/dist/assets/skill-empty-hint-YDmkqgo-.js +0 -1
- package/web/dist/assets/skills-BMwanop_.js +0 -1
- package/web/dist/assets/skills-DFBiAuJG.js +0 -1
- package/web/dist/assets/skills-workflows-C21NystW.css +0 -1
- package/web/dist/assets/sortable.esm-zp_qkYGV.js +0 -5
- package/web/dist/assets/tab-link-DCUifQ46.js +0 -1
- package/web/dist/assets/task-changes-BZXWvQN3.js +0 -1
- package/web/dist/assets/task-commits-ByI9MSfc.js +0 -1
- package/web/dist/assets/task-files-LJbenpiH.js +0 -1
- package/web/dist/assets/task-github-item-B0CU9lGR.js +0 -1
- package/web/dist/assets/task-thread-CXCN__1a.js +0 -9
- package/web/dist/assets/task-thread-DtQ6uGfQ.css +0 -1
- package/web/dist/assets/textarea-DlVUfdWG.js +0 -1
- package/web/dist/assets/thread-state-BLaCzqeX.js +0 -4
- package/web/dist/assets/toaster-B1MyeHiE.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-BkmKad8x.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +0 -1
- package/web/dist/assets/useQuery-DOJQOEBO.js +0 -1
- package/web/dist/assets/workflows-Dbxb-d-6.js +0 -7
- package/web/dist/assets/ws-DvGmrP4z.js +0 -1
- package/web/dist/assets/zoomable-image-5pOUaPEg.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{a as i}from"./dist-BW234Kg5.js";import{a,n as o,o as s,r as c}from"./dist-C5mlVBmd.js";var l=e(t(),1);function u(e,t){return l.useReducer((e,n)=>t[e][n]??e,e)}var d=e=>{let{present:t,children:n}=e,r=f(t),i=typeof n==`function`?n({present:r.isPresent}):l.Children.only(n),a=m(r.ref,g(i));return typeof n==`function`||r.isPresent?l.cloneElement(i,{ref:a}):null};d.displayName=`Presence`;function f(e){let[t,n]=l.useState(),r=l.useRef(null),i=l.useRef(e),a=l.useRef(`none`),s=l.useRef(void 0),[c,d]=u(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return l.useEffect(()=>{c===`mounted`?(a.current=s.current??h(r.current),s.current=void 0):a.current=`none`},[c]),o(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=h(t);e?(s.current=o,d(`MOUNT`)):o===`none`||t?.display===`none`?d(`UNMOUNT`):d(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,d]),o(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=h(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(d(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=h(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else d(`ANIMATION_END`)},[t,d]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:l.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=h(t)}else r.current=null;n(e)},[])}}function p(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function m(...e){let t=l.useRef(e);return t.current=e,l.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=p(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():p(n[e],null)}}},[])}function h(e){return e?.animationName||`none`}function g(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _=l.useId||(()=>void 0),v=0;function y(e){let[t,n]=l.useState(_());return o(()=>{e||n(e=>e??String(v++))},[e]),e||(t?`radix-${t}`:``)}function b(e){let t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>((...e)=>t.current?.(...e)),[])}var x=r(),S=`DismissableLayer`,C=`dismissableLayer.update`,w=`dismissableLayer.pointerDownOutside`,ee=`dismissableLayer.focusOutside`,te,T=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),E=l.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...p}=e,m=l.useContext(T),[h,g]=l.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=l.useState({}),y=i(t,g),S=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),ee=w?S.indexOf(w):-1,E=h?S.indexOf(h):-1,ne=m.layersWithOutsidePointerEventsDisabled.size>0,D=E>=ee,O=l.useRef(!1),re=ie(e=>{s?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:_,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:l.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return D&&!t},[m.branches,D])}),A=ae(e=>{if(r&&O.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(u?.(e),d?.(e),e.defaultPrevented||f?.())},_),j=h?E===S.length-1:!1,M=b(e=>{e.key===`Escape`&&(o?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return l.useEffect(()=>{if(j)return _.addEventListener(`keydown`,M,{capture:!0}),()=>_.removeEventListener(`keydown`,M,{capture:!0})},[_,j,M]),l.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(te=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),k(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=te))}},[h,_,n,m]),l.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),k())},[h,m]),l.useEffect(()=>{let e=()=>v({});return document.addEventListener(C,e),()=>document.removeEventListener(C,e)},[]),(0,x.jsx)(a.div,{...p,ref:y,style:{pointerEvents:ne?D?`auto`:`none`:void 0,...e.style},onFocusCapture:c(e.onFocusCapture,A.onFocusCapture),onBlurCapture:c(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:c(e.onPointerDownCapture,re.onPointerDownCapture)})});E.displayName=S;var ne=`DismissableLayerBranch`,D=l.forwardRef((e,t)=>{let n=l.useContext(T),r=l.useRef(null),o=i(t,r);return l.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,x.jsx)(a.div,{...e,ref:o})});D.displayName=ne;function O(){let e=l.useContext(T),[t,n]=l.useState(null);return l.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var re=()=>!0;function ie(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=re}=t,s=b(e),c=l.useRef(!1),u=l.useRef(!1),d=l.useRef(new Map),f=l.useRef(()=>{});return l.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function l(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let l=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||A(w,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?l():(n.removeEventListener(`click`,f.current),f.current=l,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,l,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,l,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function ae(e,t=globalThis?.document){let n=b(e),r=l.useRef(!1);return l.useEffect(()=>{let e=e=>{e.target&&!r.current&&A(ee,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function k(){let e=new CustomEvent(C);document.dispatchEvent(e)}function A(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?s(i,a):i.dispatchEvent(a)}var j=`focusScope.autoFocusOnMount`,M=`focusScope.autoFocusOnUnmount`,oe={bubbles:!1,cancelable:!0},se=`FocusScope`,ce=l.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[u,d]=l.useState(null),f=b(o),p=b(s),m=l.useRef(null),h=i(t,d),g=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let e=function(e){if(g.paused||!u)return;let t=e.target;u.contains(t)?m.current=t:N(m.current,{select:!0})},t=function(e){if(g.paused||!u)return;let t=e.relatedTarget;t!==null&&(u.contains(t)||N(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&N(u)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,u,g.paused]),l.useEffect(()=>{if(u){he.add(g);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(j,oe);u.addEventListener(j,f),u.dispatchEvent(t),t.defaultPrevented||(le(ve(de(u)),{select:!0}),document.activeElement===e&&N(u))}return()=>{u.removeEventListener(j,f),setTimeout(()=>{let t=new CustomEvent(M,oe);u.addEventListener(M,p),u.dispatchEvent(t),t.defaultPrevented||N(e??document.body,{select:!0}),u.removeEventListener(M,p),he.remove(g)},0)}}},[u,f,p,g]);let _=l.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ue(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&N(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&N(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,x.jsx)(a.div,{tabIndex:-1,...c,ref:h,onKeyDown:_})});ce.displayName=se;function le(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(N(r,{select:t}),document.activeElement!==n)return}function ue(e){let t=de(e);return[fe(t,e),fe(t.reverse(),e)]}function de(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function fe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):pe(r,{upTo:t})))return r}function pe(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function me(e){return e instanceof HTMLInputElement&&`select`in e}function N(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&me(e)&&t&&e.select()}}var he=ge();function ge(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=_e(e,t),e.unshift(t)},remove(t){e=_e(e,t),e[0]?.resume()}}}function _e(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ve(e){return e.filter(e=>e.tagName!==`A`)}var ye=e(n(),1),be=`Portal`,xe=l.forwardRef((e,t)=>{let{container:n,...r}=e,[i,s]=l.useState(!1);o(()=>s(!0),[]);let c=n||i&&globalThis?.document?.body;return c?ye.createPortal((0,x.jsx)(a.div,{...r,ref:t}),c):null});xe.displayName=be;var P=0,F=null;function Se(){l.useEffect(()=>{F||={start:Ce(),end:Ce()};let{start:e,end:t}=F;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),P++,()=>{P===1&&(F?.start.remove(),F?.end.remove(),F=null),P=Math.max(0,P-1)}},[])}function Ce(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var I=function(){return I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},I.apply(this,arguments)};function we(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Te(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var L=`right-scroll-bar-position`,R=`width-before-scroll-bar`,Ee=`with-scroll-bars-hidden`,De=`--removed-body-scroll-bar-size`;function z(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Oe(e,t){var n=(0,l.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ke=typeof window<`u`?l.useLayoutEffect:l.useEffect,Ae=new WeakMap;function je(e,t){var n=Oe(t||null,function(t){return e.forEach(function(e){return z(e,t)})});return ke(function(){var t=Ae.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||z(e,null)}),i.forEach(function(e){r.has(e)||z(e,a)})}Ae.set(n,e)},[e]),n}function Me(e){return e}function Ne(e,t){t===void 0&&(t=Me);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Pe(e){e===void 0&&(e={});var t=Ne(null);return t.options=I({async:!0,ssr:!1},e),t}var Fe=function(e){var t=e.sideCar,n=we(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return l.createElement(r,I({},n))};Fe.isSideCarExport=!0;function Ie(e,t){return e.useMedium(t),Fe}var Le=Pe(),B=function(){},V=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:B,onWheelCapture:B,onTouchMoveCapture:B}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=we(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=je([n,t]),w=I(I({},x),i);return l.createElement(l.Fragment,null,d&&l.createElement(S,{sideCar:Le,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?l.cloneElement(l.Children.only(s),I(I({},w),{ref:C})):l.createElement(y,I({},w,{className:c,ref:C}),s))});V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},V.classNames={fullWidth:R,zeroRight:L};var Re,ze=function(){if(Re)return Re;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Be(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ze();return t&&e.setAttribute(`nonce`,t),e}function Ve(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function He(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ue=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Be())&&(Ve(t,n),He(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},We=function(){var e=Ue();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ge=function(){var e=We();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ke={left:0,top:0,right:0,gap:0},H=function(e){return parseInt(e||``,10)||0},qe=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[H(n),H(r),H(i)]},Je=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ke;var t=qe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ye=Ge(),U=`data-scroll-locked`,Xe=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
.${Ee} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${U}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${L} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${R} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${L} .${L} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${R} .${R} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${U}] {
|
|
36
|
+
${De}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},Ze=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Qe=function(){l.useEffect(function(){return document.body.setAttribute(U,(Ze()+1).toString()),function(){var e=Ze()-1;e<=0?document.body.removeAttribute(U):document.body.setAttribute(U,e.toString())}},[])},$e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Qe();var a=l.useMemo(function(){return Je(i)},[i]);return l.createElement(Ye,{styles:Xe(a,!t,i,n?``:`!important`)})},W=!1;if(typeof window<`u`)try{var G=Object.defineProperty({},"passive",{get:function(){return W=!0,!0}});window.addEventListener(`test`,G,G),window.removeEventListener(`test`,G,G)}catch{W=!1}var K=W?{passive:!1}:!1,et=function(e){return e.tagName===`TEXTAREA`},tt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!et(e)&&n[t]===`visible`)},nt=function(e){return tt(e,`overflowY`)},rt=function(e){return tt(e,`overflowX`)},q=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ot(e,r)){var i=st(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},it=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},at=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ot=function(e,t){return e===`v`?nt(t):rt(t)},st=function(e,t){return e===`v`?it(t):at(t)},ct=function(e,t){return e===`h`&&t===`rtl`?-1:1},lt=function(e,t,n,r,i){var a=ct(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=st(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ot(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},J=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ut=function(e){return[e.deltaX,e.deltaY]},dt=function(e){return e&&`current`in e?e.current:e},ft=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pt=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},mt=0,Y=[];function ht(e){var t=l.useRef([]),n=l.useRef([0,0]),r=l.useRef(),i=l.useState(mt++)[0],a=l.useState(Ge)[0],o=l.useRef(e);l.useEffect(function(){o.current=e},[e]),l.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Te([e.lockRef.current],(e.shards||[]).map(dt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=l.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=J(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=q(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=q(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return lt(h,t,e,h===`h`?s:c,!0)},[]),c=l.useCallback(function(e){var n=e;if(!(!Y.length||Y[Y.length-1]!==a)){var r=`deltaY`in n?ut(n):J(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ft(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(dt).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=l.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:gt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=l.useCallback(function(e){n.current=J(e),r.current=void 0},[]),f=l.useCallback(function(t){u(t.type,ut(t),t.target,s(t,e.lockRef.current))},[]),p=l.useCallback(function(t){u(t.type,J(t),t.target,s(t,e.lockRef.current))},[]);l.useEffect(function(){return Y.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,K),document.addEventListener(`touchmove`,c,K),document.addEventListener(`touchstart`,d,K),function(){Y=Y.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,K),document.removeEventListener(`touchmove`,c,K),document.removeEventListener(`touchstart`,d,K)}},[]);var m=e.removeScrollBar,h=e.inert;return l.createElement(l.Fragment,null,h?l.createElement(a,{styles:pt(i)}):null,m?l.createElement($e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function gt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var _t=Ie(Le,ht),vt=l.forwardRef(function(e,t){return l.createElement(V,I({},e,{ref:t,sideCar:_t}))});vt.classNames=V.classNames;var yt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X=new WeakMap,Z=new WeakMap,Q={},$=0,bt=function(e){return e&&(e.host||bt(e.parentNode))},xt=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=bt(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},St=function(e,t,n,r){var i=xt(t,Array.isArray(e)?e:[e]);Q[n]||(Q[n]=new WeakMap);var a=Q[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(X.get(e)||0)+1,l=(a.get(e)||0)+1;X.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Z.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),$++,function(){o.forEach(function(e){var t=X.get(e)-1,i=a.get(e)-1;X.set(e,t),a.set(e,i),t||(Z.has(e)||e.removeAttribute(r),Z.delete(e)),i||e.removeAttribute(n)}),$--,$||(X=new WeakMap,X=new WeakMap,Z=new WeakMap,Q={})}},Ct=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||yt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),St(r,i,n,`aria-hidden`)):function(){return null}};export{ce as a,b as c,xe as i,y as l,vt as n,E as o,Se as r,O as s,Ct as t,d as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-BHp8sXmF.js";var t=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);export{t};
|
|
@@ -0,0 +1,2 @@
|
|
|
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{Bt as i,Nn as a}from"./project-scope-context-BdqKyBHa.js";import{et as o}from"./queries-C7VNk-nW.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{i as f}from"./diff-controls-BFqQNxRu.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{a as _,c as v,d as y,l as b,n as x,o as S,s as C,t as w,u as T}from"./markdown-Dv0r75AX.js";var E=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`}]]),D=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`}]]),O=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`}]]),k=e(t(),1),A=n(),j=[[`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 M(e){let t=j.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var N={};function P(e){let t=(0,k.useMemo)(()=>T(e),[e]).join(` `),[n,r]=(0,k.useState)(null);return(0,k.useEffect)(()=>{if(!t)return;let e=!0;return y(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:N}function F({html:e,title:t,fragment:n,className:i}){let a=P(e);return a?(0,A.jsx)(I,{html:e,title:t,fragment:n,className:i,libraries:a}):(0,A.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:r(`flex min-h-0 flex-col`,i)})}function I({html:e,title:t,fragment:n,className:i,libraries:a}){let{srcdoc:o,blocked:s}=(0,k.useMemo)(()=>{let n=v(e,a);return{srcdoc:b(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{n&&/^#\S+$/.test(n)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${n}`)},l=M(s);return(0,A.jsxs)(`div`,{"data-slot":`html-report`,className:r(`flex min-h-0 flex-col`,i),children:[l?(0,A.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: `,l,`. Reports show only what they carry inside the file.`]}):null,(0,A.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:S,allow:_,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var L=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:L.has(t.slice(n+1).toLowerCase())}function z(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return R(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function B(e){return e.tooLarge?`too-large`:z(e.path)?`image`:e.binary?`binary`:`text`}function V(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function H({runId:e,path:t,className:n}){let r=o(e,t??void 0);if(t===null)return(0,A.jsx)(Y,{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)(Y,{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)(Y,{className:n,children:(0,A.jsx)(p,{icon:e?(0,A.jsx)(O,{}):(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)(G,{runId:e,entry:r.data,className:n}):(0,A.jsx)(Y,{className:n,children:(0,A.jsx)(p,{icon:(0,A.jsx)(D,{}),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 U(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 W(e,t,n){let r=t&&/\.(?:md|markdown)$/i.test(e.path),i=t&&C(e.path),a=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(e.path),o=t&&a&&e.size<=10*1024*1024?`image`:B(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 G({runId:e,entry:t,displayPath:n,className:i,imageUrl:a,downloadUrl:o,snapshot:s,readerHref:c,documentPreview:l=!1}){let[u,d]=(0,k.useState)(!1),[p,m]=(0,k.useState)(!0),h=n??U(t.path),g=W(t,l,u),_=!!(s||o||g.toggle),v=!g.showImage&&g.kind===`text`&&g.rendered===null;return(0,A.jsxs)(Y,{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:V(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)(q,{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)(K,{runId:e,entry:t,kind:g.kind,showImage:g.showImage,rendered:g.rendered,imageUrl:a,wrap:p})]})}function K({runId:e,entry:t,kind:n,showImage:r,rendered:a,imageUrl:o,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:o??i(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)(E,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${V(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,A.jsx)(p,{icon:(0,A.jsx)(D,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${V(t.size)} of binary data — no text preview.`}):a===`markdown`?(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(w,{document:!0,children:t.content??``})}):a===`html`?(0,A.jsx)(F,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,A.jsx)(Q,{path:t.path,text:t.content??``,wrap:s})}function q({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)(J,{href:i}):null]})}function J({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=>x(r,t,e,n),children:`Open reader`})}function Y({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 X=1500;function Z(e,t){let n=(0,k.useMemo)(()=>t.split(`
|
|
2
|
+
`).map(e=>[{content:e}]),[t]),r=(0,k.useMemo)(()=>m(e),[e]),i=n.length>X,[a,o]=(0,k.useState)(null);return(0,k.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 Q({path:e,text:t,wrap:n=!1}){let i=Z(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{V as a,O as c,U as i,D as l,G as n,z as o,H as r,F as s,Q as t,E as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{Nn as n}from"./project-scope-context-BdqKyBHa.js";import{gt as r}from"./queries-C7VNk-nW.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:n,onSelect:i,onEnter:l,decorate:u,emptyHint:d,showHidden:f=!1}){let m=r(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-[11px] 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":n?.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`,n?.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-[11px] text-muted-foreground`,children:`Too many folders to list — only the first ones are shown.`}):null]})}function p({error:e,path:t,onEnter:r,onRetry:i}){let a=e instanceof n&&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:()=>r(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,n=!1){let i=r(e,n);return t?.path??i.data?.path??null}export{m as n,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-BHp8sXmF.js";var t=e(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,n=Date.now()){if(!e)return``;let r=new Date(e).getTime();return Number.isNaN(r)?``:t(Math.max(0,(n-r)/1e3))}function t(e){if(e<10)return`just now`;if(e<60)return`${Math.floor(e)}s`;if(e<3600)return`${Math.floor(e/60)}m`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return t<6&&n>0?`${t}h ${n}m`:e<86400?`${t}h`:`${Math.floor(e/86400)}d`}function n(e){return!e||e===`just now`?e:`${e} ago`}function r(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${(Math.floor(e/1e5)/10).toFixed(1)}M`:e>=1e3?`${(Math.floor(e/100)/10).toFixed(1)}k`:String(Math.floor(e))}function i(e,t=new Date){let n=e.toDateString()===t.toDateString();return new Intl.DateTimeFormat(void 0,n?{timeStyle:`short`}:{dateStyle:`medium`,timeStyle:`short`}).format(e)}function a(e,t){let n=e?Date.parse(e):NaN;if(!Number.isFinite(n)||n<=t)return`scheduled`;let r=Math.max(1,Math.floor((n-t)/6e4));if(r<60)return`resumes in ${r}m`;let i=new Date(n),a=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`}).format(i);return n-t<864e5?`resumes ${a}`:`resumes ${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(i)} ${a}`}export{e as a,a as i,t as n,n as o,r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
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{i as f,n as p,r as m,t as h}from"./diff-controls-BFqQNxRu.js";import{t as g}from"./square-terminal-B6RYYieR.js";import{t as _}from"./button-B7MKxYjT.js";import{i as v,p as y,r as b,t as x}from"./dropdown-menu-4e2iKSMT.js";import{hn as S}from"./index-CJFT0IZP.js";var C=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`}]]),w=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`}]]),T=e(t(),1),E=n();function D({root:e,selected:t,onSelect:n}){return(0,E.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,E.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,E.jsx)(k,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,E.jsx)(j,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function O({adds:e,dels:t}){return(0,E.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs font-medium tabular-nums`,children:[e>0?(0,E.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,E.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function k({dir:e,depth:t,selected:n,onSelect:r}){let[a,s]=(0,T.useState)(!0);return(0,E.jsxs)(`li`,{children:[(0,E.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,E.jsx)(l,{size:16,"aria-hidden":`true`,className:i(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,E.jsx)(o,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,E.jsx)(O,{adds:e.adds,dels:e.dels})]}),a?(0,E.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,E.jsx)(k,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,E.jsx)(j,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var A={added:`text-success`,deleted:`text-danger`};function j({file:e,depth:t,selected:n,onSelect:r}){let a=n===e.path;return(0,E.jsx)(`li`,{children:(0,E.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,E.jsx)(w,{"aria-hidden":`true`,className:i(`size-3.5 shrink-0`,A[e.status])}),(0,E.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,E.jsx)(O,{adds:e.adds,dels:e.dels})]})})}function M(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function N(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(N)}}var P=(e,t)=>e.name.localeCompare(t.name);function F(e){let t=M(``,``),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=M(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(P),e.files.sort(P)};return i(t),{...t,dirs:t.dirs.map(N)}}function I({bar:e,healthReady:t,branch:n,stat:r,mode:a,wrap:o,preview:s=!1,onModeChange:c,onWrapChange:l,onPreviewChange:u,onAction:d}){return(0,E.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,E.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[n?(0,E.jsx)(h,{branch:n}):null,r?(0,E.jsx)(z,{stat:r}):null]}),(0,E.jsxs)(`span`,{className:i(`ml-auto flex items-center gap-1.5`,!u&&`md:hidden`),children:[(0,E.jsx)(`span`,{className:`flex md:hidden`,children:(0,E.jsx)(f,{wrap:o,onWrapChange:l})}),u?(0,E.jsx)(m,{preview:s,onPreviewChange:u}):null]}),(0,E.jsxs)(`span`,{className:i(`flex items-center gap-2 max-md:w-full`,!u&&`md:ml-auto`),children:[(0,E.jsx)(`span`,{className:`hidden items-center gap-1.5 md:flex`,children:(0,E.jsx)(p,{mode:a,wrap:o,onModeChange:c,onWrapChange:l})}),(0,E.jsx)(`span`,{"aria-hidden":`true`,className:`hidden h-5 w-px bg-border md:block`}),(0,E.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,E.jsx)(R,{action:e,variant:`outline`,onAction:d},e.id)),(0,E.jsx)(R,{action:e.primary,variant:`primary`,onAction:d})]}),e.menu.length>0?(0,E.jsxs)(x,{children:[(0,E.jsx)(y,{asChild:!0,children:(0,E.jsx)(_,{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,E.jsx)(C,{"aria-hidden":`true`})})}),(0,E.jsx)(b,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,E.jsxs)(v,{disabled:!e.enabled,title:e.reason,onSelect:()=>d(e.id),children:[L[e.id],e.label]},e.id))})]}):null]})]})}var L={commit:(0,E.jsx)(s,{size:16,"aria-hidden":`true`}),push:(0,E.jsx)(c,{size:16,"aria-hidden":`true`}),"create-pr":(0,E.jsx)(a,{size:16,"aria-hidden":`true`}),"view-pr":(0,E.jsx)(d,{"aria-hidden":`true`}),"open-terminal":(0,E.jsx)(g,{"aria-hidden":`true`})};function R({action:e,variant:t,onAction:n}){return e.id===`view-pr`?r(e.href)?(0,E.jsx)(_,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,E.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[L[e.id],e.label]})}):(0,E.jsxs)(_,{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:[L[e.id],e.label]}):(0,E.jsxs)(_,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[L[e.id],e.label]})}function z({stat:e}){return(0,E.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,E.jsx)(S,{stat:{adds:B(e.adds),dels:B(e.dels),files:e.files}})})}function B(e){let[t,n]=(0,T.useState)(e),r=(0,T.useRef)(e);return(0,T.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{D as i,I as n,F as r,z as t};
|
|
@@ -0,0 +1 @@
|
|
|
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{G as a,On as o,P as s,U as c,V as l,W as u,bi as d,di as f}from"./project-scope-context-BdqKyBHa.js";import{Bt as p,M as m,Qt as h,Yt as g,i as _,k as ee,l as v,o as y,r as b,s as te}from"./queries-C7VNk-nW.js";import{h as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as x}from"./toaster-Bo5vCbz-.js";import{F as S,I as C,X as w,Y as T,c as E,ct as D,l as O,ot as k,p as A,r as j}from"./design-icons-CzEoMH9c.js";import{t as re}from"./chevron-down-CHGyCDBH.js";import{t as M}from"./chevron-right-BENZ-1ZN.js";import{l as ie,n as ae}from"./nav-row-styles-DqKjMToI.js";import{t as N}from"./loader-circle-CPBhhDbB.js";import{t as oe}from"./play-CmVAj_fu.js";import{t as P}from"./button-B7MKxYjT.js";import{a as se,i as ce,n as F,r as I,t as L}from"./select-BaydzE-I.js";import{i as R,r as z,t as B}from"./popover-BPgUYFyu.js";import{r as le,t as V}from"./project-router-Bii3ofOk.js";import"./attention-8bNiiAFt.js";import{f as ue,v as de}from"./task-groups-BbnYlkYj.js";import{t as fe}from"./status-dot-BRzVlF2X.js";import{a as pe,o as H,r as me,s as he,t as ge}from"./command-KdW7aO0N.js";import{a as U}from"./format-BU7D3IfE.js";import{t as W}from"./centered-state-V15AR_qo.js";import{Ct as _e,Dt as ve,Et as ye,St as be,Tn as xe,Tt as Se,_t as Ce,b as we,bt as Te,en as Ee,gt as De,ht as Oe,mt as ke,ot as Ae,s as je,vt as Me,wt as Ne,xt as G,yt as Pe}from"./index-CJFT0IZP.js";import{a as Fe,d as Ie,f as Le,i as Re,l as ze,n as Be,o as Ve,r as He,s as Ue,t as We,u as K}from"./use-hand-to-agent-state-BckHuhr8.js";import{t as q}from"./tab-link-B1CULYRs.js";var J=e(t(),1),Ge=`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 Ke(){try{let e=localStorage.getItem(Ge);return e===null?360:Y(e)}catch{return 360}}function qe(e){try{localStorage.setItem(Ge,String(Y(e)))}catch{}}var X=n();function Je({number:e,repo:t}){let n=r();return(0,X.jsx)(Ye,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function Ye({number:e,repo:t,scope:n}){let r=(0,J.useId)(),a=(0,J.useId)(),[s,c]=(0,J.useState)(!1),l=s?re:M,u=g(n,!0,n==="default"),d=m(`#${e}`,!0),f=(0,J.useMemo)(()=>Ne(de(u.data??[],d.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[u.data,d.data,e,t,n]);return(0,X.jsxs)(`section`,{"aria-labelledby":r,className:i(`mt-4 min-w-0 rounded-lg border border-border`,s?`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":s,"aria-controls":a,onClick:()=>c(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)(l,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,X.jsxs)(`span`,{children:[`Linked tasks`,u.data?` (${f.length}${d.hasNextPage||d.isError?`+`:``})`:``]})]})}),(0,X.jsx)(`div`,{id:a,children:s?(0,X.jsxs)(X.Fragment,{children:[u.isPending?(0,X.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,u.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)(P,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void u.refetch(),disabled:u.isFetching,children:`Retry linked tasks`})]}):null,u.data&&f.length===0&&!u.isError?(0,X.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,f.length>0?(0,X.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:f.map(e=>{let t=o(e);return(0,X.jsx)(`li`,{children:(0,X.jsxs)(V,{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:ue(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)(fe,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,X.jsx)(`span`,{className:`rounded border border-border px-1`,children:`Archived`}):null,(0,X.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):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 older archived linked tasks.`}),(0,X.jsx)(P,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry older linked tasks`})]}):d.hasNextPage?(0,X.jsx)(P,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void d.fetchNextPage(),disabled:d.isFetchingNextPage,children:d.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var Xe=`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 Ze(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 Qe(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function $e(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 et(e){return[e.viewerLogin?``:`GitHub login unavailable.`,$e(e)].filter(Boolean).join(` `)}function tt({options:e,assignees:t,onAssigneesChange:n}){return(0,X.jsxs)(B,{children:[(0,X.jsx)(R,{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)(O,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(z,{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 nt({data:e,projectId:t,onProjectChange:n,pickerRef:r}){if(e.projects?.length)return(0,X.jsxs)(L,{value:t||Q,onValueChange:e=>n(e===Q?``:e),children:[(0,X.jsx)(ce,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":t,className:`${Z} ${Xe} justify-between`,children:(0,X.jsx)(se,{placeholder:`All boards`})}),(0,X.jsxs)(F,{align:`start`,children:[(0,X.jsx)(I,{value:Q,children:`All boards`}),e.projects.map(e=>(0,X.jsx)(I,{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)(L,{disabled:!0,value:Q,children:[(0,X.jsx)(ce,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":``,className:`${Z} ${Xe} justify-between`,children:(0,X.jsx)(se,{placeholder:t,children:t})}),(0,X.jsx)(F,{align:`start`,children:(0,X.jsx)(I,{value:Q,children:t})})]})}return null}function rt({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)(B,{open:i,onOpenChange:a,children:[(0,X.jsx)(R,{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)(T,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,X.jsx)(k,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,X.jsx)(z,{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 it({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=Ze(e.issues,t),f=Qe(e.viewerLogin,t),p=et(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)(tt,{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)(D,{size:14,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Assigned to me`]}),(0,X.jsx)(nt,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,X.jsx)(rt,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function at({onRefresh:e,refreshing:t}){let n=ke(r());return(0,X.jsxs)(`div`,{"data-route":`github`,"data-slot":`github-filter-screen`,className:ae,children:[(0,X.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,X.jsx)(`h1`,{className:i(ie,`min-w-0 flex-1`),children:`GitHub`}),(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,X.jsx)(T,{size:17,"aria-hidden":`true`,className:i(`size-[17px]`,t&&`motion-safe:animate-spin`)})})]}),(0,X.jsx)(Oe,{model:n,variant:`screen`})]})}function ot({view:e,activeFilter:t,isDesktop:n,rawFilterParam:r,n:i,gh:a,actions:o}){return(0,X.jsxs)(`div`,{"data-slot":`gh-masthead`,className:`flex min-w-0 shrink-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2`,children:[(0,X.jsx)(`h1`,{className:`min-w-0 text-[26px] leading-[1.2] font-semibold tracking-tight text-foreground md:text-[28px]`,children:n?(0,X.jsxs)(X.Fragment,{children:[e===`issues`?`Issues`:`Pull requests`,` `,(0,X.jsx)(`span`,{"data-slot":`gh-title-qualifier`,className:`font-normal text-muted-foreground`,children:`· ${De[t]}`})]}):`GitHub`}),(0,X.jsx)(st,{...o})]}),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)(V,{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)(j,{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:[...Me,...Pe].find(e=>e.id===t)?.label})]}):null,a.repo?(0,X.jsxs)(`p`,{className:`mt-1 min-w-0 truncate text-[13px] text-muted-foreground`,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?`Synced ${U(a.syncedAt)}`:`Not synced yet`]})]}):null]})}function st({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)(V,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:t,onClick:n,className:`gh-utility`,children:[(0,X.jsx)(T,{size:16,"aria-hidden":`true`,className:i(`size-3.5`,t&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function ct({item:e,view:t,filter:n,colors:r,active:a,queued:o,checks:s,comments:c}){let l=e.kind===`issue`?A:S,d=f(),m=()=>{d.prefetchQuery({queryKey:p.githubComments(e.kind,e.number),queryFn:({signal:t})=>u(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,X.jsxs)(V,{to:G(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,He(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:m,onFocus:m,"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)(l,{"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)(`time`,{className:`shrink-0`,dateTime:e.createdAt,title:new Date(e.createdAt).toLocaleString(),children:U(e.createdAt)}),c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(Fe,{count:c})]}):null,s?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(Re,{checks:s})]}):null,o?(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)(Ue,{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 lt(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function ut(e){let[t,n]=(0,J.useState)(null);return(0,J.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(lt(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 dt(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 ft(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 pt(e,t,n,r,i){let[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(null),l=ut(a),u=(0,J.useRef)(null);u.current=l;let d=dt(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:ft(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}function mt({item:e,queuedRunId:t}){return t?(0,X.jsx)(P,{asChild:!0,variant:`outline`,size:`sm`,className:`max-md:h-11 no-hover:h-11`,children:(0,X.jsxs)(V,{to:`/tasks/${t}`,"data-action":`gh-header-view-task`,children:[(0,X.jsx)(E,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,X.jsxs)(P,{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:ht,children:[(0,X.jsx)(oe,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}function ht(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}var gt=100;function _t(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>=gt)break;a.add(t.number)}return[...a]}function vt(e,t,n,r,i,a){let o=_t(n,e,r,i,a),s=b(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,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),u=(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=>l[e.number]??(u.has(e.number)?void 0:e.comments)}}function yt(e){let[t,n]=we(),r=t.get(`filter`),i=Se(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 bt(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}=xt(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 xt(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 St(e,t,{filter:n,activeFilter:i},a){let o=r(),s=e===`issues`&&(i===`no-task`||i===`has-task`),c=g(o,s,o==="default"),l=(0,J.useMemo)(()=>c.data?_e(c.data,t?.repo,o):null,[c.data,t?.repo,o]),u=be(e,n)?ve(n):null,d=v(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,J.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,J.useMemo)(()=>f?ye(f,p):null,[f,p]),h=Ct({view:e,gh:t,activeFilter:i,isAssignedFilter:a,taskFilter:s,taskNumbers:l,runsQuery:c,backedQuery:u,filterHits:f,filterSearch:d});return{backedQuery:u,filterSearch:d,fullList:p,filterRows:m,filterGate:h,openItems:(0,J.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,J.useMemo)(()=>e===`issues`?i===`no-task`&&l?{excludeNumbers:l}:i===`has-task`&&l?{includeNumbers:l}:{}:i===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:f?{includeNumbers:new Set(f.map(e=>e.number))}:{},[e,i,l,t?.viewerLogin,f])}}function Ct({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 wt(e,t){return t?a(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function Tt(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=p.github()[0],s=t===void 0?null:Number.parseInt(t,10),c=!r&&n.data?.available?n.data.items.find(e=>e.number===s):void 0,l=i&&s!==null&&!a.some(e=>e.number===s)?i.find(e=>e.number===s):void 0,u=c??l,[d,f]=(0,J.useState)(null);return(0,J.useEffect)(()=>{u&&f({scope:o,view:e,item:u})},[o,e,u]),{selectedNumber:s,remoteDetail:u??(d?.scope===o&&d.view===e&&d.item.number===s?d.item:null)}}function Et(e,t,n,{fullList:r,filterRows:i},a){let o=f(),s=(0,J.useRef)(null),c=e===`issues`?`issue`:`pr`,l=t?.available===!0&&n!==null&&Number.isSafeInteger(n)&&n>0&&!r.some(e=>e.number===n)&&!i?.some(e=>e.number===n)&&a===null,u=y(c,n??0,l),d=l&&u.data?.available&&u.data.item?.kind===c?u.data.item:null;s.current=l&&n!==null?{kind:c,number:n,key:p.githubItem(c,n)}:null;let[m,h]=(0,J.useState)(!1);return{exactWanted:l,exactItem:u,exactDetail:d,exactTargetRef:s,retryingExact:m,retryExact:()=>{h(!0),wt(o,s.current).then(e=>{h(!1),e||x(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function Dt(e,t,n){let r=f(),i=(0,J.useRef)(null);return{refresh:h({mutationFn:e=>(wt(r,e),l({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:p.githubPages(50),exact:!0}),r.setQueryData(p.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:p.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),l=p.githubCommentCounts(o,s);r.removeQueries({queryKey:p.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==d(l)}),a.available&&a.commentsDeferred&&s.length>0&&c(o,s,{refresh:!0}).then(e=>r.setQueryData(l,e)).catch(()=>{}),r.invalidateQueries({queryKey:p.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:p.githubSearch(`pr`,Te)}),r.invalidateQueries({queryKey:p.githubSearch(`pr`,Ce)});let f=i.current,m=p.githubComments(`issue`,0).slice(0,3);if(!f){r.removeQueries({queryKey:m});return}let h=p.githubComments(f.kind,f.number);u(f.kind,f.number,{refresh:!0}).then(e=>r.setQueryData(h,e)).catch(()=>{}),r.removeQueries({queryKey:m,predicate:e=>e.queryHash!==d(h)})},onError:e=>x(e.message,{tone:`danger`})}),openThreadRef:i}}var Ot=350;function kt(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 At(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let l=kt(n,Ot),u=(0,J.useMemo)(()=>K(o,{query:l,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,l,r,e,i,a,s]),d=n.trim()===l.trim(),f=t?.available===!0&&!c&&d&&Le(l,u),p=v(e===`issues`?`issue`:`pr`,l,f),m=K(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),h=f&&p.data?.available?p.data:null,g=new Set(m.map(e=>e.number)),_=jt(e,h,a,i);return{debouncedQuery:l,searchWanted:f,forgeSearch:p,items:m,searchPayload:h,metadataFailure:_,searchHits:h&&!_?K(h.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!g.has(e.number)):[],...Mt(n,d,f,p)}}function jt(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 Mt(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 Nt({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 Pt({view:e,changes:t=!1,index:n=!1}){let{n:r}=ne(),i=yt(e),{rawFilterParam:a,activeFilter:o}=i,s=Ee(),{pages:c,data:l}=te(50),u=xe(),d=It(),f=We(),p=Ft({index:n,isDesktop:s,rawFilterParam:a,n:r,rememberedView:ee().data?.githubView}),m=Lt(l?.available===!0&&!p.filterScreen),[h,g]=(0,J.useState)(!1),_=bt(e,l,i),v=St(e,l,i,_.isAssignedFilter),y=At(e,l,_,v),b=Tt(e,r,y.forgeSearch,v),x=Et(e,l,b.selectedNumber,v,b.remoteDetail),S=vt(e,c,l,b.selectedNumber,y.searchHits,v.openItems),{refresh:C,openThreadRef:w}=Dt(e,S.checkPrNumbers,y.debouncedQuery),T=pt(e,c,l,v.backedQuery,_.narrowing);if(p.restorePrs)return(0,X.jsx)(le,{to:`/github/prs`,replace:!0});if(!l)return c.isError?(0,X.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,X.jsx)(W,{icon:(0,X.jsx)(k,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:c.error.message})}):(0,X.jsx)(Ae,{});w.current=null;let E=()=>C.mutate(x.exactTargetRef.current);if(p.filterScreen&&l.available)return(0,X.jsx)(at,{onRefresh:E,refreshing:C.isPending});if(!l.available)return(0,X.jsx)(Ht,{reason:l.reason,refreshing:C.isPending,onRetry:E});let{labelColors:D,labelOptions:O}=Rt(l,y.searchPayload,v.openItems,v.fullList),A=zt({number:b.selectedNumber,items:y.items,searchHits:y.searchHits,fullList:v.fullList,filterRows:v.filterRows,remoteDetail:b.remoteDetail,exactDetail:x.exactDetail});w.current=A?{kind:A.kind,number:A.number}:null;let{linkFilter:j,listPath:re}=Bt(e,a,o,s),M={view:e,filter:j,colors:D,selected:A,queued:f.queued,checksMap:S.checksMap,commentsOf:S.commentsOf},ie=Vt(e,_,v.filterGate,y);return(0,X.jsxs)(`div`,{ref:m.routeRef,"data-route":`github`,className:`flex min-h-full flex-col gap-2.5 px-4 pt-7 pb-[calc(90px+env(safe-area-inset-bottom))] md:px-9 md:pt-7 md:pb-4`,children:[(0,X.jsx)(ot,{view:e,activeFilter:o,isDesktop:s,rawFilterParam:a,n:r,gh:l,actions:{automationsAvailable:u,refreshing:C.isPending,onRefresh:E}}),(0,X.jsxs)(`div`,{ref:m.workspaceRef,"data-slot":`gh-workspace`,"data-stacked":m.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)(Ut,{view:e,isDesktop:s,gh:l,onSaveView:d}),(0,X.jsx)(Wt,{view:e,gh:l,filters:_,labelOptions:O,labelColors:D,searchPayload:y.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:M,verdict:ie,search:y,sidebar:v,list:c,paging:T,width:m.githubListWidth,onWidthChange:m.changeGithubListWidth,expanded:h,onExpandedChange:g}),(0,X.jsx)($t,{view:e,n:r,selected:A,selectedNumber:b.selectedNumber,exact:x,repo:l.repo,rows:M,listPath:re,changes:t,handToAgent:f})]})]})]})}function Ft({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 It(){let e=f();return t=>{e.setQueryData(p.uiState,e=>({...e,githubView:t})),s({githubView:t}).then(t=>e.setQueryData(p.uiState,t)).catch(t=>{x(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:p.uiState})})}}function Lt(e){let[t,n]=(0,J.useState)(Ke),[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),qe(t)},panesStacked:r,routeRef:a,workspaceRef:o}}function Rt(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:ze([...n,...r,...t?.items??[]])}}function zt({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 Bt(e,t,n,r){let i=t===null?null:n;return{linkFilter:i,listPath:G(e,i??(e===`issues`&&!r?`all`:null))}}function Vt(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)(N,{"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)(N,{"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 Ht({reason:e,refreshing:t,onRetry:n}){return(0,X.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,X.jsx)(W,{icon:(0,X.jsx)(C,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,X.jsx)(P,{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 Ut({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)(q,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>r(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,X.jsxs)(q,{to:`/github/prs`,active:e===`prs`,onClick:()=>r(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]})]})}function Wt({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)(w,{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-border bg-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)(rn,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,X.jsx)(it,{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 Gt(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Kt(e,t){return(0,X.jsx)(ct,{item:e,view:t.view,filter:t.filter,colors:t.colors,active:t.selected?.url===e.url,queued:t.queued.has(e.url),checks:Gt(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-border bg-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)(Jt,{items:f,rows:n,compactPreview:m,paging:s}),s.pagingAvailable?(0,X.jsx)(Yt,{view:e,list:o,paging:s}):null,(0,X.jsx)(Xt,{backedQuery:a.backedQuery,filterSearch:a.filterSearch}),(0,X.jsx)(Zt,{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)(Qt,{hits:p,searchPayload:i.searchPayload,rows:n}):null,(0,X.jsx)(Nt,{width:c,onWidthChange:l})]})}function Jt({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:Kt(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)(je,{scrollRef:s,startMargin:c,children:l},a===o?`list`:`main`):l})}function Yt({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)(N,{"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 Xt({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 Zt({view:e,n:t,count:n,expanded:r,onExpandedChange:i}){return e===`issues`&&t!==void 0&&n>2?(0,X.jsx)(P,{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 Qt({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-[11px] 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:Kt(e,n)},e.url))})]})}function $t({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-border bg-card md:overflow-y-auto`,t===void 0?`hidden md:flex`:`flex`),children:n?(0,X.jsx)(en,{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)(W,{icon:(0,X.jsx)(N,{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)(tn,{number:r,exact:a}):(0,X.jsx)(nn,{view:e,number:r})})}function en({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)(Ve,{item:e,comments:r.commentsOf(e),afterHeading:e.kind===`issue`?(0,X.jsx)(Je,{number:e.number,repo:n},t??`list`):void 0,backLink:{to:i},subNav:{filter:r.filter,changes:a},onRunAgent:ht,headerAction:(0,X.jsx)(mt,{item:e,queuedRunId:h.get(e.url)??null}),colors:r.colors,checks:Gt(e,r.checksMap),children:(0,X.jsx)(Be,{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 tn({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,X.jsx)(W,{icon:(0,X.jsx)(k,{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)(P,{variant:`outline`,disabled:r,onClick:i,children:`Retry`})})}function nn({view:e,number:t}){return(0,X.jsx)(W,{icon:e===`issues`?(0,X.jsx)(A,{size:16}):(0,X.jsx)(S,{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 rn({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)(B,{open:a,onOpenChange:o,children:[(0,X.jsx)(R,{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)(O,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(z,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,X.jsxs)(ge,{children:[(0,X.jsx)(pe,{placeholder:`Filter labels…`}),(0,X.jsxs)(he,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,X.jsx)(me,{children:`No labels.`}),n.length>0?(0,X.jsxs)(H,{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)(H,{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:Ie(t[e])}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,X.jsx)(E,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{Pt as GithubRoute};
|
|
@@ -0,0 +1 @@
|
|
|
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{vt as i,xt as a}from"./queries-C7VNk-nW.js";import{f as o,n as s}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{$ as c,A as l,B as u,D as d,F as f,I as p,J as m,K as h,M as g,O as _,P as v,Q as y,R as b,S as x,V as S,W as ee,X as C,Z as w,_ as te,a as ne,b as T,d as E,et as re,f as ie,h as ae,i as oe,j as D,k as O,l as k,n as A,o as j,p as M,q as N,r as P,t as F,u as I,v as L,x as R,y as z,z as B}from"./activity-motion-DfI5xoMG.js";import{t as V}from"./button-B7MKxYjT.js";import{i as H}from"./project-order-AcHI4Dcl.js";import{Sn as U}from"./index-CJFT0IZP.js";var W=e(t(),1);function G(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function K(e){let t=[],n=[];for(let r of e)S(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function q(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function se(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function ce(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>N(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function le(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var J=n(),ue={w:104,h:20};function de(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,T(r.getBoundingClientRect(),t))}return n}function fe(e,t,n=[]){let r=de(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...L(e),kind:`wait`}))],o=R(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...z(t,n,i,o.get(e.requestId))})}let c=x(s.map(e=>({id:e.id,at:e.label})),ue,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function pe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var Y=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-[10.5px] whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function me({arc:e,wait:t,now:n,motion:i}){return(0,J.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:r(Y,`border-dashed border-message-peer-accent`,t.id in i.waitsClosing&&`activity-line-out`),children:[(0,J.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,C(y(t.since,n))]})}function he({arc:e,request:t,now:n,motion:i}){let a=ie(i,e.id);return(0,J.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:r(Y,a?`border-success`:`border-message-peer-accent`,E(i,e.id)===`fade`&&`activity-line-out`),children:[a?(0,J.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,J.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,C(y(t.createdAt,n))]})}var ge=[],_e=new Set;function ve({arcs:e,waits:t=ge,active:n=_e,layoutKey:i,now:a,motion:o=f,paused:s=!1}){let c=W.useRef(null),l=ae(c,W.useCallback(n=>fe(n,e,t),[e,t]),pe,`[data-activity-pill]`,i),u=W.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=te(o.comets,u,s),p=new Map(e.map(e=>[e.requestId,e])),m=new Map(t.map(e=>[e.id,e])),h=W.useId().replace(/[^a-zA-Z0-9_-]/g,``),g=`activity-arrow-arc-${h}`,_=`activity-ring-arc-${h}`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,J.jsxs)(`defs`,{children:[(0,J.jsx)(`marker`,{id:g,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,J.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,J.jsx)(k,{id:_})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,J.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${_})`,className:r(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,M(o,e.id))},e.id)}let t=E(o,e.id);return(0,J.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${g})`,className:r(`stroke-message-peer-accent`,I(t,e.id in o.opening))},e.id)}),(0,J.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?m.get(e.id):void 0;if(t)return(0,J.jsx)(me,{arc:e,wait:t,now:a,motion:o},e.id);let n=p.get(e.id);return n?(0,J.jsx)(he,{arc:e,request:n,now:a,motion:o},e.id):null})]})}var X=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,ye=[],be=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function xe({task:e}){let t=e.workers.filter(e=>N(e.status));return t.length===0?null:(0,J.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[t.map(e=>(0,J.jsx)(g,{run:e,role:`worker`},e.runId)),(0,J.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function Se({projectId:e,task:t,requests:n,waits:i=ye,index:a,ctx:o,motion:u=f,linked:p=!1,onHover:h}){let x=m(t,o);return(0,J.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":x.action,"data-linked":p?`true`:void 0,...O(t.runId,h),className:r(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,x.action?`border-pending/70`:t.rung===`running`&&N(t.status)?`border-status-running/60`:`border-border`,p&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in u.entering&&`activity-card-enter`),children:[(0,J.jsx)(d,{task:t,motion:u,glow:x.action!==void 0}),(0,J.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,J.jsx)(g,{run:t,role:`root`}),(0,J.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,J.jsx)(s,{to:X(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,J.jsx)(l,{rate:t.rate,className:`h-3 w-10`})]}),(0,J.jsxs)(`div`,{className:`mt-[3px] ml-[19px] flex items-center gap-2`,children:[(0,J.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`min-w-0 flex-1 truncate text-[11.5px] text-muted-foreground tabular-nums`,children:[(0,J.jsx)(v,{"data-slot":`activity-verb`,tone:x.tone,className:`font-semibold`,children:x.verb}),x.action&&x.since?(0,J.jsxs)(J.Fragment,{children:[` · `,(0,J.jsx)(`span`,{"data-slot":`activity-pill-age`,title:w(x.since),children:c(y(x.since,o.now))})]}):null,` · `,(0,J.jsx)(`span`,{"data-slot":`activity-main`,className:r(x.mono&&`font-mono text-[11px]`),children:x.main})]}),x.action?(0,J.jsx)(V,{asChild:!0,size:`sm`,variant:x.action===`answer`?`primary`:`outline`,className:`relative z-[1] h-7 px-2 text-[12px] max-md:min-h-11`,children:(0,J.jsx)(s,{"data-slot":`activity-pill-action`,to:X(e,t.runId),children:x.action===`answer`?`Answer`:`Open task`})}):null]}),(0,J.jsx)(_,{texts:b(t.runId,n,a,i)}),(0,J.jsx)(xe,{task:t}),(0,J.jsx)(D,{runId:t.runId,requests:n,waits:i,index:a,link:s,pathOf:t=>X(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:be})]})}var Z=e=>`/p/${encodeURIComponent(e)}/activity`,Ce=e=>`/p/${encodeURIComponent(e)}/`,Q=`rounded-xl border border-border bg-card px-4 pt-3.5 pb-4`,we=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function $({project:e,headingId:t,detail:n,to:r,label:i}){return(0,J.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,J.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,J.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:n}),(0,J.jsx)(s,{to:r,className:we,children:i})]})}function Te({project:e,notice:t}){let n=W.useId();return(0,J.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Q,children:(0,J.jsx)($,{project:e,headingId:n,detail:t,to:Ce(e.projectId),label:`Open project →`})})}function Ee(e,t){return W.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return q({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function De({project:e,now:t,motion:n=f,paused:i=!1}){let a=W.useId(),o=W.useMemo(()=>ee(e),[e]),s=Ee(e,n),c=W.useMemo(()=>u(e.tasks),[e.tasks]),l=W.useMemo(()=>se(e.tasks,[...c,...p(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=j(c),m={now:t,titleOf:e=>B(o,e)},h=`${e.tasks.map(e=>e.runId).join(`,`)}:${s.map(e=>e.requestId).join(`,`)}:${l.map(e=>e.id).join(`,`)}`,g=s.length>0||l.length>0;return(0,J.jsxs)(`section`,{"aria-labelledby":a,"data-slot":`activity-panel`,"data-project":e.projectId,className:Q,children:[(0,J.jsx)($,{project:e,headingId:a,detail:ce(e),to:Z(e.projectId),label:`Open project activity →`}),(0,J.jsxs)(`div`,{className:r(`relative mt-3`,g&&`md:mt-1 md:pt-10`),children:[(0,J.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:r(`grid grid-cols-[repeat(auto-fit,minmax(min(100%,300px),1fr))] items-start gap-3.5`,g&&`md:gap-y-11`),children:e.tasks.map(t=>(0,J.jsx)(Se,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:o,ctx:m,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),g?(0,J.jsx)(ve,{arcs:s,waits:l,active:d.active,layoutKey:h,now:t,motion:n,paused:i}):null]})]})}function Oe(e){let t=S(e.project);return t===void 0?(0,J.jsx)(De,{...e}):(0,J.jsx)(Te,{project:e.project,notice:t})}function ke({projects:e,belowPanels:t}){return e.length===0?null:(0,J.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[le(e.length,t),` `,e.map((e,t)=>(0,J.jsxs)(W.Fragment,{children:[t>0?`, `:null,(0,J.jsx)(s,{to:Z(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Ae={kind:`workspace`};function je(){let e=a().data?.projects,{order:t}=U();return W.useMemo(()=>e?H(e,t).map(e=>e.id):void 0,[e,t])}function Me(){let e=a().data,t=i(),n=o().state?.activityProjectId,r=e?.bootProject??t.data?.bootProject??null,s=typeof n==`string`&&e?.projects.some(e=>e.id===n&&e.status!==`missing`)?n:r;return{id:s,name:e?.projects.find(e=>e.id===s)?.name}}function Ne(){let e=re(Ae),t=Me(),n=je(),r=F(e.data?.generatedAt,e.dataUpdatedAt),i=e.data?.projects,a=W.useMemo(()=>K(G(i??[],n)),[i,n]),{motion:o,paused:s,reduced:c}=A(e.data,`workspace`);return(0,J.jsxs)(`div`,{"data-route":`activity-global`,"data-activity-paused":s?`true`:void 0,className:`flex min-h-full w-full flex-col gap-3.5 px-4 pb-6 md:px-9`,children:[(0,J.jsx)(P,{name:`All projects`,now:e.data?r:void 0,updatedAt:e.data?.generatedAt,stale:e.isError,children:(0,J.jsx)(oe,{scope:`all`,projectId:t.id,projectName:t.name})}),i?(0,J.jsx)(ne,{summary:h(i),tasksTo:`/tasks`,bumps:o.bumps}):null,e.isPending?(0,J.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!i?(0,J.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-3 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,J.jsx)(V,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),className:`max-md:min-h-11`,children:`Retry`})]}):null,i&&a.panels.length===0&&a.idle.length===0?(0,J.jsx)(`p`,{"data-slot":`activity-empty`,className:`py-6 text-[13px] text-muted-foreground`,children:`No projects to show.`}):null,(0,J.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3`,children:a.panels.map(e=>(0,J.jsx)(Oe,{project:e,now:r,motion:o,paused:s||c},e.projectId))}),(0,J.jsx)(ke,{projects:a.idle,belowPanels:a.panels.length>0})]})}export{Ne as GlobalActivityRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,r as i,t as a}from"./chunk-BO2N2NFS-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,r as i,t as a}from"./chunk-BO2N2NFS-DQrpGzb-.js";var o=e(t(),1),s=n(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(r),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(a,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};
|
|
@@ -0,0 +1,3 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-BHp8sXmF.js";var t=e(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{hn as t}from"./index-CJFT0IZP.js";import{t as n}from"./zoomable-image-CIQl1Wpe.js";var r=e();function i({stat:e,hidden:n=!1}){return(0,r.jsxs)(`p`,{"data-slot":`diff-totals`,hidden:n,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,r.jsxs)(`span`,{children:[e.files,` `,e.files===1?`file`:`files`,` changed`]}),(0,r.jsx)(t,{stat:e})]})}function a(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function o({file:e,imageSrc:t,onOpenInApp:i}){return e.status===`deleted`?(0,r.jsx)(s,{children:`Image deleted — only the new side can be previewed.`}):t?(0,r.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[(0,r.jsx)(n,{src:t(e.path),alt:e.path,className:`max-h-[60vh] max-w-full rounded-sm`}),i?(0,r.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>i(e.path),className:`text-[11px] font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,r.jsx)(s,{children:`Binary file — no text diff.`})}function s({children:e}){return(0,r.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:e})}export{a as n,i as r,o as t};
|