@wjarka/cezarion 0.18.0-dev.5863 → 0.18.0-dev.5876
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 +2 -2
- package/web/dist/assets/activity-motion-Dj3dlCYS.js +2 -0
- package/web/dist/assets/{activity-route-1OFUVP3A.js → activity-route-CpjbEhk_.js} +1 -1
- package/web/dist/assets/{alert-dialog-Dj464rjk.js → alert-dialog-h-3h9B4l.js} +1 -1
- package/web/dist/assets/button-CS5tOblf.js +3 -0
- package/web/dist/assets/{centered-state-DGyy0SuA.js → centered-state-BmsqxbI8.js} +1 -1
- package/web/dist/assets/commit-diff-panel-DGx2t9Pw.js +1 -0
- package/web/dist/assets/{control-locations-C9II3kPz.js → control-locations-CD2r0mMU.js} +1 -1
- package/web/dist/assets/{diff-controls-BR2uqhwG.js → diff-controls-BHF0Pvdc.js} +1 -1
- package/web/dist/assets/diff-qq2vW6Xc.js +3 -0
- package/web/dist/assets/{diff-view-BBhxSIlf.js → diff-view-wanjAW5U.js} +5 -5
- package/web/dist/assets/{dropdown-menu-DhrBcVgr.js → dropdown-menu-CjLqyqwB.js} +1 -1
- package/web/dist/assets/{es2015-D345RR4o.js → es2015-CX0rgbM5.js} +1 -1
- package/web/dist/assets/file-preview-YiP5f666.js +2 -0
- package/web/dist/assets/format-BNCkW110.js +1 -0
- package/web/dist/assets/git-toolbar-D0mTYtOj.js +1 -0
- package/web/dist/assets/github-DizdAh0y.js +1 -0
- package/web/dist/assets/{global-activity-route-Dt83uvZc.js → global-activity-route-DMbPEZPP.js} +1 -1
- package/web/dist/assets/{image-preview-Cq1vDiEo.js → image-preview-Dy3o8upo.js} +1 -1
- package/web/dist/assets/index-9YmaiQ1k.css +1 -0
- package/web/dist/assets/index-D51Su-nT.js +34 -0
- package/web/dist/assets/{live-refetch-BdnmTJ_8.js → live-refetch-C2xZHKkJ.js} +1 -1
- package/web/dist/assets/{nav-row-styles-BZUUavOF.js → nav-row-styles-CEA9c88Q.js} +1 -1
- package/web/dist/assets/play-CmVAj_fu.js +1 -0
- package/web/dist/assets/popover-s-Wchzjn.js +1 -0
- package/web/dist/assets/preview-pane-connected-DQYoGd9W.js +3 -0
- package/web/dist/assets/{project-router-MMOk9VbW.js → project-router-BLO2IxbU.js} +1 -1
- package/web/dist/assets/project-scope-context-DbO9a0ii.js +4 -0
- package/web/dist/assets/queries-C_DEjjv2.js +1 -0
- package/web/dist/assets/repo-git-CSTwuYJ5.js +1 -0
- package/web/dist/assets/report-reader-B8D_6si1.js +1 -0
- package/web/dist/assets/reports-Dr312nK-.js +1 -0
- package/web/dist/assets/run-header-B8M6-fvb.js +2 -0
- package/web/dist/assets/skills-Bz-itxvq.js +1 -0
- package/web/dist/assets/{tab-link-BvoGfK8S.js → tab-link-CqVqRhuM.js} +1 -1
- package/web/dist/assets/task-changes-6F8fNE6I.js +1 -0
- package/web/dist/assets/task-commits-1TKZD8tP.js +1 -0
- package/web/dist/assets/task-files-BitTchRw.js +1 -0
- package/web/dist/assets/{task-github-item-npfGLu9C.js → task-github-item-ux8yQOHs.js} +1 -1
- package/web/dist/assets/{task-thread-DnpkXb5P.js → task-thread-DAnwO8BU.js} +7 -7
- package/web/dist/assets/thread-state-COdb27sX.js +4 -0
- package/web/dist/assets/{toaster-B1MyeHiE.js → toaster-CRVRHlMR.js} +1 -1
- package/web/dist/assets/use-hand-to-agent-state-CZK9cWMq.js +1 -0
- package/web/dist/assets/{useInfiniteQuery-BbYMWe23.js → useInfiniteQuery-DCWsxLiy.js} +1 -1
- package/web/dist/assets/useQuery-C2HBIY3e.js +1 -0
- package/web/dist/assets/workflows-CNnPn5Zx.js +7 -0
- package/web/dist/assets/ws-BXdlGFIZ.js +1 -0
- package/web/dist/assets/{zoomable-image-5pOUaPEg.js → zoomable-image-UzXCYU7Z.js} +1 -1
- package/web/dist/index.html +21 -26
- package/web/dist/assets/activity-motion-BdGFmrw-.js +0 -2
- package/web/dist/assets/agent-accounts-f1cxwgfz.js +0 -18
- package/web/dist/assets/button-CHUAMTHK.js +0 -3
- package/web/dist/assets/commit-diff-panel-BiNPMHC6.js +0 -1
- package/web/dist/assets/diff-BHwQUS2W.js +0 -3
- package/web/dist/assets/file-preview-D08Kq15E.js +0 -2
- package/web/dist/assets/git-toolbar-BnOaO_OH.js +0 -1
- package/web/dist/assets/github-CXc8nroh.js +0 -1
- package/web/dist/assets/github-sidebar-model-B0Ufci5S.js +0 -1
- package/web/dist/assets/index-B18AqW0Z.css +0 -1
- package/web/dist/assets/index-B5LayM4y.js +0 -14
- package/web/dist/assets/loader-circle-CZkGEdoI.js +0 -1
- package/web/dist/assets/markdown-D7DUNWcJ.js +0 -6
- package/web/dist/assets/popover-DRcRI46x.js +0 -1
- package/web/dist/assets/preview-pane-connected-JHeCgq7I.js +0 -3
- package/web/dist/assets/project-scope-context-B3M-u8R0.js +0 -4
- package/web/dist/assets/queries-DORTKwyN.js +0 -1
- package/web/dist/assets/repo-git-wEXDON29.js +0 -1
- package/web/dist/assets/report-reader-DJ_0htSx.js +0 -1
- package/web/dist/assets/reports-BIXmTBFJ.js +0 -1
- package/web/dist/assets/run-header-Bgtlx-vc.js +0 -2
- package/web/dist/assets/skills-BJ2nSfyr.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/task-changes-Dz0udwrE.js +0 -1
- package/web/dist/assets/task-commits-5uILgm5M.js +0 -1
- package/web/dist/assets/task-files-DGZjTKSS.js +0 -1
- package/web/dist/assets/textarea-DlVUfdWG.js +0 -1
- package/web/dist/assets/thread-state-BfrO2t7g.js +0 -4
- package/web/dist/assets/use-hand-to-agent-state-DyVB4IBv.js +0 -1
- package/web/dist/assets/useQuery-CqqnAJvu.js +0 -1
- package/web/dist/assets/workflows-ByduCwgu.js +0 -7
- package/web/dist/assets/ws-BtSVmivO.js +0 -1
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{l as t,o as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{B as o,F as s,I as c,J as l,P as u,Y as d,Z as f,et as p,nt as m,rt as h}from"./live-protocol-BVn0UA_g.js";import{c as g,dt as _}from"./queries-DORTKwyN.js";import{h as v,l as y}from"./es2015-D345RR4o.js";import{c as ee,i as te,p as b,r as x,s as S,t as C}from"./dropdown-menu-DhrBcVgr.js";import{d as w,l as T,m as E,p as D}from"./alert-dialog-Dj464rjk.js";import{Q as O,u as k}from"./design-icons-DmYTv2r1.js";import{a as A,c as j,i as M,n as N,s as ne}from"./textarea-DlVUfdWG.js";var P=80,F=2e3,I=50,re=200,ie=50,ae=[{id:`add-tests`,label:`Add tests`,text:`Also add or update tests covering this change.`},{id:`explain-change`,label:`Explain the change`,text:`Explain what changed and why before finishing.`},{id:`keep-minimal`,label:`Keep it minimal`,text:`Keep the change as small and targeted as possible — no unrelated refactors.`},{id:`update-docs`,label:`Update docs`,text:`Also update any relevant documentation or comments.`},{id:`check-edge-cases`,label:`Double-check edge cases`,text:`Double-check edge cases and error handling before finishing.`},{id:`create-automation`,label:`Create an automation`,skills:[`create-cezarion-automation`],text:`Create an automation for this repository.
|
|
2
|
-
Trigger: <a GitHub event or a schedule, e.g. every new pull request; every issue labelled \`needs-agent\`; every day at 04:00; weekdays at 07:30; every 6 hours>.
|
|
3
|
-
Task for each run: <what the launched task must do, e.g. review the diff, run the tests and post findings as a review comment>.
|
|
4
|
-
Leave it paused and, for a GitHub trigger, preview its matches so I can check the filter before enabling it.`}],oe=new Set([`create-automation`]);function se(e,t){return t.automations===!0?e:e.filter(e=>!oe.has(e.id))}function ce(e){return!!e&&typeof e==`object`}function le(e){if(e===void 0||!Array.isArray(e))return ae.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!ce(r))continue;let e=typeof r.id==`string`?r.id.trim():``,i=typeof r.label==`string`?r.label.trim():``,a=typeof r.text==`string`?r.text.trim():``;if(!e||!i||!a||t.has(e))continue;t.add(e);let o=ue(r.skills);if(n.push({id:e,label:i.slice(0,P),text:a.slice(0,F),...o.length>0?{skills:o}:{}}),n.length>=I)break}return n}function ue(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(!(!e||t.has(e))&&(t.add(e.slice(0,re)),t.size>=ie))break}return[...t]}function de(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function fe(e,t){return de(e,t).map(e=>e.text).join(`
|
|
5
|
-
|
|
6
|
-
`)}function pe(e,t,n,r=``){if(e===``||e===r||e===t){let e=r&&n?`${r}\n\n${n}`:r||n;return{text:e,applied:n?e:``}}return{text:e,applied:t}}function me(){return`tpl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function he(e,t,n){let r=Math.max(0,Math.min(t,e.length)),i=e.slice(0,r),a=e.slice(r),o=``;i.length>0&&(o=i.endsWith(`
|
|
7
|
-
|
|
8
|
-
`)?``:i.endsWith(`
|
|
9
|
-
`)?`
|
|
10
|
-
`:`
|
|
11
|
-
|
|
12
|
-
`);let s=a.replace(/^[ \t]+/,``),c=``;return s.length>0&&(c=s.startsWith(`
|
|
13
|
-
|
|
14
|
-
`)?``:s.startsWith(`
|
|
15
|
-
`)?`
|
|
16
|
-
`:`
|
|
17
|
-
|
|
18
|
-
`),{text:i+o+n+c+s,caret:i.length+o.length+n.length}}function ge({prompt:e,base:t,selectionStart:n,focused:r,remembered:i}){return e===t?e.length:r&&n!=null||n!=null&&n>0?n:i??e.length}var L=e(i(),1),_e=1,ve=.9,ye=.8,be=.17,R=.1,xe=.999,Se=.9999,Ce=.99,we=/[\\\/_+.#"@\[\(\{&]/,Te=/[\\\/_+.#"@\[\(\{&]/g,Ee=/[\s-]/,De=/[\s-]/g;function Oe(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?_e:Ce;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Oe(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=_e:we.test(e.charAt(l-1))?(d*=ye,p=e.slice(i,l-1).match(Te),p&&i>0&&(d*=xe**+p.length)):Ee.test(e.charAt(l-1))?(d*=ve,m=e.slice(i,l-1).match(De),m&&i>0&&(d*=xe**+m.length)):(d*=be,i>0&&(d*=xe**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Se)),(d<R&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Oe(e,t,n,r,l+1,a+2,o),f*R>d&&(d=f*R)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function ke(e){return e.toLowerCase().replace(De,` `)}function Ae(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Oe(e,t,ke(e),ke(t),0,0,{})}var z=`[cmdk-group=""]`,je=`[cmdk-group-items=""]`,Me=`[cmdk-group-heading=""]`,Ne=`[cmdk-item=""]`,Pe=`${Ne}:not([aria-disabled="true"])`,Fe=`cmdk-item-select`,B=`data-value`,Ie=(e,t,n)=>Ae(e,t,n),Le=L.createContext(void 0),V=()=>L.useContext(Le),Re=L.createContext(void 0),H=()=>L.useContext(Re),ze=L.createContext(void 0),Be=L.forwardRef((e,t)=>{let n=G(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=G(()=>new Set),i=G(()=>new Map),a=G(()=>new Map),o=G(()=>new Set),s=Ze(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,ee=y(),te=y(),b=y(),x=L.useRef(null),S=$e();W(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),W(()=>{S(6,k)},[]);let C=L.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(ee))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=L.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:ee,inputId:b,labelId:te,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Ie;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(je);t?t.appendChild(e.parentElement===t?e:e.closest(`${je} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${je} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${z}[${B}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(B);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(z)?.querySelector(Me))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Ne}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(Pe)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(B))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(B))}function ne(e){let t=A()?.closest(z),n;for(;t&&!n;)t=e>0?Ye(t,z):Xe(t,z),n=t?.querySelector(Pe);n?C.setState(`value`,n.getAttribute(B)):N(e)}let P=()=>M(j().length-1),F=e=>{e.preventDefault(),e.metaKey?P():e.altKey?ne(1):N(1)},I=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?ne(-1):N(-1)};return L.createElement(v.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&F(e);break;case`ArrowDown`:F(e);break;case`p`:case`k`:g&&e.ctrlKey&&I(e);break;case`ArrowUp`:I(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),P();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(Fe);t.dispatchEvent(e)}}}}},L.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:tt},c),q(e,e=>L.createElement(Re.Provider,{value:C},L.createElement(Le.Provider,{value:w},e))))}),Ve=L.forwardRef((e,t)=>{let r=y(),i=L.useRef(null),a=L.useContext(ze),o=V(),s=Ze(e),c=s.current?.forceMount??a?.forceMount;W(()=>{if(!c)return o.item(r,a?.id)},[c]);let l=Qe(r,i,[e.value,e.children,i],e.keywords),u=H(),d=K(e=>e.value&&e.value===l.current),f=K(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(r)>0);L.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(Fe,p),()=>t.removeEventListener(Fe,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:ee,keywords:te,...b}=e;return L.createElement(v.div,{ref:n(i,t),...b,id:r,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),He=L.forwardRef((e,t)=>{let{heading:r,children:i,forceMount:a,...o}=e,s=y(),c=L.useRef(null),l=L.useRef(null),u=y(),d=V(),f=K(e=>a||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));W(()=>d.group(s),[]),Qe(s,c,[e.value,e.heading,l]);let p=L.useMemo(()=>({id:s,forceMount:a}),[a]);return L.createElement(v.div,{ref:n(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},r&&L.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},r),q(e,e=>L.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":r?u:void 0},L.createElement(ze.Provider,{value:p},e))))}),Ue=L.forwardRef((e,t)=>{let{alwaysRender:r,...i}=e,a=L.useRef(null),o=K(e=>!e.search);return!r&&!o?null:L.createElement(v.div,{ref:n(a,t),...i,"cmdk-separator":``,role:`separator`})}),We=L.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=H(),o=K(e=>e.search),s=K(e=>e.selectedItemId),c=V();return L.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),L.createElement(v.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Ge=L.forwardRef((e,t)=>{let{children:r,label:i=`Suggestions`,...a}=e,o=L.useRef(null),s=L.useRef(null),c=K(e=>e.selectedItemId),l=V();return L.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),L.createElement(v.div,{ref:n(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":i,id:l.listId},q(e,e=>L.createElement(`div`,{ref:n(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),Ke=L.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return L.createElement(T,{open:n,onOpenChange:r},L.createElement(E,{container:o},L.createElement(D,{"cmdk-overlay":``,className:i}),L.createElement(w,{"aria-label":e.label,"cmdk-dialog":``,className:a},L.createElement(Be,{ref:t,...s}))))}),qe=L.forwardRef((e,t)=>K(e=>e.filtered.count===0)?L.createElement(v.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Je=L.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return L.createElement(v.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},q(e,e=>L.createElement(`div`,{"aria-hidden":!0},e)))}),U=Object.assign(Be,{List:Ge,Item:Ve,Input:We,Group:He,Separator:Ue,Dialog:Ke,Empty:qe,Loading:Je});function Ye(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Xe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ze(e){let t=L.useRef(e);return W(()=>{t.current=e}),t}var W=typeof window>`u`?L.useEffect:L.useLayoutEffect;function G(e){let t=L.useRef();return t.current===void 0&&(t.current=e()),t}function K(e){let t=H(),n=()=>e(t.snapshot());return L.useSyncExternalStore(t.subscribe,n,n)}function Qe(e,t,n,r=[]){let i=L.useRef(),a=V();return W(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(B,s),i.current=s}),i}var $e=()=>{let[e,t]=L.useState(),n=G(()=>new Map);return W(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function et(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function q({asChild:e,children:t},n){return e&&L.isValidElement(t)?L.cloneElement(et(t),{ref:t.ref},n(t.props.children)):n(t)}var tt={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},J=a();function nt({className:e,...t}){return(0,J.jsx)(U,{"data-slot":`command`,className:r(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function rt({title:e=`Command Palette`,description:n=`Search for a command to run...`,children:i,className:a,showCloseButton:o=!0,filter:s,value:c,onValueChange:l,overlayClassName:u,contentProps:d,...f}){return(0,J.jsxs)(N,{...f,children:[(0,J.jsxs)(ne,{className:`sr-only`,children:[(0,J.jsx)(j,{children:e}),(0,J.jsx)(A,{children:n})]}),(0,J.jsx)(M,{...d,className:r(`overflow-hidden p-0`,a),showCloseButton:o,overlayClassName:u,children:(0,J.jsx)(nt,{...t({filter:s,value:c,onValueChange:l}),className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:i})})]})}function it({className:e,...t}){return(0,J.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-ss-[inherit] rounded-se-[inherit] border-b px-3`,children:[(0,J.jsx)(O,{className:`size-4 shrink-0 opacity-50`}),(0,J.jsx)(U.Input,{"data-slot":`command-input`,className:r(`flex h-11 min-w-0 flex-1 rounded-md bg-transparent py-3 text-base md:text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function at({className:e,onPointerMoveCapture:t,...n}){return(0,J.jsx)(U.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:r(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ot({...e}){return(0,J.jsx)(U.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function st({className:e,...t}){return(0,J.jsx)(U.Group,{"data-slot":`command-group`,className:r(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function ct({className:e,...t}){return(0,J.jsx)(U.Separator,{"data-slot":`command-separator`,className:r(`-mx-1 h-px bg-border`,e),...t})}function lt({className:e,...t}){return(0,J.jsx)(U.Item,{"data-slot":`command-item`,className:r(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function ut({className:e,...t}){return(0,J.jsx)(`span`,{"data-slot":`command-shortcut`,className:r(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var dt=`default`,ft=p({id:h(),label:h(),path:h(),exists:d()}),pt=p({id:h(),provider:u,label:h(),configDir:h(),path:h(),exists:d(),looksValid:d(),isDefault:d(),status:s.optional(),files:l(ft)});function mt(e){return e.isDefault?`default:${e.provider}`:e.id}var Y=o();p({editable:d(),profiles:l(pt),profileCapableProviders:l(u),selections:m(h(),Y),defaults:Y}),p({projectId:h().min(1).max(64).nullable(),provider:u,profileId:h().max(64).nullable()}),p({selections:m(h(),Y),defaults:Y}),p({status:s}),p({available:d(),reason:h().optional(),fields:l(p({label:h(),value:h()}))}),p({file:h().min(1).max(200),target:h().min(1).max(64).optional()}),p({opened:f(!0),path:h()}),p({provider:u,label:h().trim().max(200).optional(),configDir:h().trim().min(1).max(4096)}),p({profile:pt}),p({label:h().trim().max(200).optional(),configDir:h().trim().min(1).max(4096).optional()}),p({removed:f(!0),id:h()});var ht=`quick-task`;function gt(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var _t=[{id:`claude`,label:`claude`,desc:`Claude Code CLI`},{id:`codex`,label:`codex`,desc:`OpenAI Codex (app-server)`},{id:`opencode`,label:`opencode`,desc:`OpenCode (serve)`},{id:`pi`,label:`pi`,desc:`pi CLI (provider/model)`},{id:`cursor`,label:`Cursor`,desc:`Cursor CLI`},{id:`omp`,label:`OMP`,desc:`Oh My Pi CLI (provider/model)`}],X={claude:[{id:``,label:`auto`,desc:`Pick the best model per step`},{id:`opus`,label:`opus`,desc:`Deep reasoning for hard tasks`},{id:`sonnet`,label:`sonnet`,desc:`Fast and cheap`},{id:`haiku`,label:`haiku`,desc:`Fastest — simple, scoped tasks`}],codex:[{id:``,label:`auto`,desc:`Use your Codex default model`}],opencode:[{id:``,label:`auto`,desc:`Use your OpenCode default model`}],cursor:[{id:``,label:`auto`,desc:`Use your Cursor default model`}],pi:[{id:``,label:`auto`,desc:`Use your pi default model`}],omp:[{id:``,label:`auto`,desc:`Use your OMP default model`}]},Z=[{value:``,label:`auto`,desc:`Harness default`},{value:`low`,label:`low`,desc:`Less reasoning, faster replies`},{value:`medium`,label:`medium`,desc:`Balanced reasoning`},{value:`high`,label:`high`,desc:`More reasoning for hard tasks`},{value:`xhigh`,label:`xhigh`,desc:`Extra-high reasoning`},{value:`max`,label:`max`,desc:`Maximum reasoning`}];function vt(e,t,n){let r=e===`cursor`?[Z[0]]:Z,i=c(e)&&(e!==`cursor`||n?.runner===e)?n?.models.find(e=>e.id===t)?.effortLevels:void 0;if(!i?.length)return r;let a=[Z[0]],o=new Set;for(let e of i){if(o.has(e))continue;let t=Z.find(t=>t.value===e);t&&(o.add(e),a.push(t))}return a.length>1?a:r}function yt(e,t){let n=e??``;return t.some(e=>e.value===n)?n:``}var bt=[`opencode`,`pi`,`omp`];function xt(e,t){return t===`cursor`||!e||X[t].some(t=>t.id===e)?!1:t!==`claude`&&[`claude-fable-5`,`claude-opus-4-8`,`claude-sonnet-5`,`claude-haiku-4-5`].includes(e)?!0:Object.entries(X).some(([n,r])=>n!==t&&!bt.includes(n)&&r.some(t=>t.id!==``&&t.id===e))}function St(e,t,n=[]){let r=t?.runner===e?t.models:[],i=X[e]??X.claude,a=[...r.length?i.slice(0,1):i],o=new Set(a.map(e=>e.id));if(c(e))for(let e of r)!e.id||o.has(e.id)||(o.add(e.id),a.push({id:e.id,label:e.label||e.id,desc:e.description}));for(let t of n)!t||o.has(t)||xt(t,e)||(o.add(t),a.push({id:t,label:t,desc:`Custom or legacy model`}));return a}var Ct={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`,pi:`Pi`,cursor:`Cursor`,omp:`OMP`};function wt(e,t,n=!1,r=!1){if(!c(e))return;let i=Ct[e];if(t?.stale)return`Using cached ${i} model list`;if(n||t?.source===`unavailable`)return`Latest ${i} models unavailable`;if(r&&!t)return`Loading ${i} models…`}function Tt(e){let t=_t.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function Et(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function Dt(e,t,n=!1){return!n&&e===t?void 0:e}function Ot(e,t,n,r){let i=St(t,r,[e,n?.[t]]);if(e!==null&&i.some(t=>t.id===e))return e;let a=n?.[t];return a!==void 0&&i.some(e=>e.id===a)?a:``}function kt(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function At(e,t,n){return e&&kt(e,t,n)?e:null}function jt(e){let{task:t,source:n,model:r,modelsLocked:i,effort:a,runner:o,runnerExplicit:s,defaultRunner:c,agentProfile:l,images:u,worktree:d,autonomous:f,archiveWhenDone:p,autoMergePr:m,allowWorkers:h,allowMessaging:g}=e;return{task:t,...n?.source===`skill`?{steps:[{id:`task`,name:n.ref,skill:n.ref,prompt:`{{task}}`}]}:{workflow:n?.ref??`quick-task`},model:i?void 0:r||void 0,effort:i?void 0:a||void 0,runner:Dt(o,c,s),agentProfile:l||void 0,images:u.length>0?[...u]:void 0,worktree:d!==!1&&void 0,autonomous:f===!0||void 0,...Mt({archiveWhenDone:p,autoMergePr:m,allowWorkers:h,allowMessaging:g})}}function Mt(e){return{...e.archiveWhenDone?{archiveWhenDone:!0}:{},...e.autoMergePr?{autoMergePr:!0}:{},...e.allowWorkers===!1?{allowWorkers:!1}:{},...e.allowMessaging===!1?{allowMessaging:!1}:{}}}function Nt(e,t){return t?{...e,notify:!0}:e}function Pt(e){return`/tasks/${e.id}`}var Ft=`inline-flex h-[26px] min-w-0 max-w-full items-center gap-1.5 rounded-full border border-control-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:border-dashed disabled:bg-muted`,It=(0,J.jsx)(k,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-supporting-foreground`}),Lt=(0,L.createContext)(null),Q=e=>Number.parseFloat(e)||0;function Rt({pill:e,box:t,full:n}){let r=getComputedStyle(e),i=[...e.children].filter(e=>{if(e===t)return!1;let n=getComputedStyle(e);return n.display!==`none`&&n.position!==`absolute`});return i.reduce((e,t)=>e+t.getBoundingClientRect().width,0)+Q(r.columnGap)*i.length+n.getBoundingClientRect().width+Q(r.paddingLeft)+Q(r.paddingRight)+Q(r.borderLeftWidth)+Q(r.borderRightWidth)}function zt(e){for(let t=e.parentElement;t;t=t.parentElement){if(t.dataset.slot===`picker-pill-disabled-wrapper`)continue;let e=getComputedStyle(t).display;if(e===`grid`||e===`flex`)return t}return e.parentElement}function Bt(e){let t=new Map;for(let n of e){let e=zt(n.pill),r=t.get(e)??new Map,i=Math.round(n.pill.getBoundingClientRect().top);r.set(i,[...r.get(i)??[],n]),t.set(e,r)}for(let[e,n]of t){let t=getComputedStyle(e),r=e.clientWidth-Q(t.paddingLeft)-Q(t.paddingRight);for(let e of n.values())if(e.reduce((e,t)=>e+Rt(t),0)+Q(t.columnGap)*(e.length-1)>r+.5)return!1}return!0}function Vt({children:e}){let t=(0,L.useRef)(new Map),n=(0,L.useRef)(null),[r,i]=(0,L.useState)(!0),a=(0,L.useCallback)(()=>i(Bt([...t.current.values()])),[]),o=(0,L.useCallback)((e,r)=>{if(t.current.set(e,r),typeof ResizeObserver<`u`){n.current??=new ResizeObserver(a);for(let e of[r.box,r.full,zt(r.pill)])n.current.observe(e)}return a(),()=>{if(t.current.delete(e),typeof ResizeObserver<`u`)for(let e of[r.box,r.full])n.current?.unobserve(e);a()}},[a]);(0,L.useLayoutEffect)(()=>()=>n.current?.disconnect(),[]);let s=(0,L.useMemo)(()=>({register:o,showPrefixes:r}),[o,r]);return(0,J.jsx)(Lt.Provider,{value:s,children:e})}function Ht({field:e,children:t}){let n=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useContext)(Lt),o=a?.register,s=(0,L.useId)(),[c,l]=(0,L.useState)(!0);(0,L.useLayoutEffect)(()=>{let e=n.current,t=i.current;if(o){let n=e.closest(`[data-slot$="pill"]`);return n?o(s,{pill:n,box:e,full:t}):void 0}let r=()=>l(t.getBoundingClientRect().width<=e.getBoundingClientRect().width+.5);if(r(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(r);return a.observe(e),a.observe(t),()=>a.disconnect()},[e,t,s,o]);let u=a!==null,d=u?a.showPrefixes:c,f=u&&!d;return(0,J.jsxs)(`span`,{ref:n,className:`relative min-w-0 overflow-hidden`,"aria-hidden":`true`,children:[(0,J.jsxs)(`span`,{ref:i,className:r(`invisible w-max whitespace-nowrap`,f?`absolute left-0 top-0`:`block`),children:[e,` · `,t]}),(0,J.jsxs)(`span`,{"data-slot":`picker-label`,className:r(`block truncate`,f?`relative`:`absolute inset-0`),children:[d?(0,J.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,` · `]}):null,t]})]})}function Ut({fieldLabel:e,ariaLabel:t,label:n,options:r,value:i}){return e?`${t} · ${typeof n==`string`?n:r.find(e=>e.value===i)?.label??i}`:t}function Wt({readOnly:e,disabled:t,hint:n,disabledHint:r}){return e?r??n:t?r:n}function Gt({fieldLabel:e,fullLabel:t,explanation:n}){return e?[t,n].filter(Boolean).join(` — `):n}function Kt({icon:e,fieldLabel:t,ariaLabel:n,label:r}){return(0,J.jsxs)(J.Fragment,{children:[e,t?(0,J.jsx)(Ht,{field:n,children:r}):(0,J.jsx)(`span`,{className:`min-w-0 truncate`,title:typeof r==`string`?r:void 0,children:r})]})}function qt({slot:e,ariaLabel:t,label:n,value:i,options:a,onPick:o,disabled:s=!1,readOnly:c=!1,hint:l,disabledHint:u,status:d,searchPlaceholder:f,icon:p,fieldLabel:m=!1}){let[h,g]=(0,L.useState)(!1),[_,v]=(0,L.useState)(``),y=(0,L.useRef)(null),w=(0,L.useRef)(null),T=f?a.filter(e=>e.label.toLowerCase().includes(_.trim().toLowerCase())):a;(0,L.useEffect)(()=>{if(!h||!f)return;let e=window.setTimeout(()=>y.current?.focus());return()=>window.clearTimeout(e)},[h,f]);let E=e=>{y.current&&document.activeElement===y.current&&e.preventDefault()},D=p?` h-11 gap-2 rounded-lg border-border px-3 text-foreground`:``,A=Ut({fieldLabel:m,ariaLabel:t,label:n,options:a,value:i}),j=Gt({fieldLabel:m,fullLabel:A,explanation:Wt({readOnly:c,disabled:s,hint:l,disabledHint:u})}),M=Kt({icon:p,fieldLabel:m,ariaLabel:t,label:n});if(c)return(0,J.jsxs)(`span`,{"data-slot":e,"aria-label":A,title:j,className:r(Ft,D,`cursor-default hover:bg-card hover:text-muted-foreground`),children:[M,m?(0,J.jsx)(`span`,{className:`sr-only`,children:A}):null]});let N=(0,J.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":A,disabled:s,title:j,className:r(Ft,D),children:[M,p?(0,J.jsx)(k,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-muted-foreground`}):It]});return s?(0,J.jsx)(`span`,{"data-slot":`picker-pill-disabled-wrapper`,title:j,className:`inline-flex min-w-0 max-w-full`,children:N}):(0,J.jsxs)(C,{open:h,onOpenChange:e=>{g(e),e||v(``)},children:[(0,J.jsx)(b,{asChild:!0,children:N}),(0,J.jsxs)(x,{ref:w,align:`start`,"data-testid":`${e}-menu`,children:[f?(0,J.jsxs)(`div`,{"data-slot":`picker-search`,className:`mbe-1 flex min-h-11 min-w-56 items-center gap-2 border-b border-border px-2`,children:[(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,J.jsx)(`input`,{ref:y,type:`search`,"aria-label":f,placeholder:f,value:_,onChange:e=>v(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=w.current?.querySelectorAll(`[role="menuitemradio"]:not([data-disabled])`);(e.key===`ArrowDown`?t?.[0]:t?.[t.length-1])?.focus()}else e.key!==`Escape`&&e.stopPropagation()},className:`h-11 w-0 min-w-0 flex-1 bg-transparent text-sm placeholder:text-muted-foreground`})]}):null,(0,J.jsx)(S,{value:i,onValueChange:o,children:T.map(e=>(0,J.jsx)(ee,{value:e.value,className:r(`gap-2.5`,f&&`min-h-11`),onPointerMove:E,onPointerLeave:E,onKeyDown:t=>{y.current&&(t.key===`ArrowUp`&&e===T[0]||t.key===`Tab`&&t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),y.current.focus())},children:(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.label}),e.desc?(0,J.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),f&&T.length===0?(0,J.jsx)(`p`,{role:`status`,className:`px-2 py-5 text-center text-xs text-muted-foreground`,children:`No matches found.`}):null,d?(0,J.jsx)(te,{disabled:!0,onPointerMove:E,onPointerLeave:E,className:`border-t border-border text-[11px] text-muted-foreground`,children:d}):null]})]})}var $=(e,t)=>t===null?e:`${e}:${t}`;function Jt({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o,icon:s,fieldLabel:c}){let l=_t.filter(t=>e.includes(t.id)).flatMap(e=>{let t=i.filter(t=>t.provider===e.id);return t.length<2?[{value:$(e.id,null),label:e.id,desc:e.desc}]:t.map(t=>({value:$(e.id,t.id),label:`${e.id} · ${t.label}`,desc:t.configDir}))}),u=a??o?.[t]??`default`,d=l.some(e=>e.value===$(t,u))?$(t,u):$(t,null);return(0,J.jsx)(qt,{icon:s,fieldLabel:c,slot:`runner-pill`,ariaLabel:`Runner`,label:l.find(e=>e.value===d)?.label??t,value:d,disabled:r,onPick:e=>{let[t,r]=e.split(`:`);n(t,r??null)},options:l})}function Yt(){let e=g(),t=_(),n=(e.data?.profiles??[]).map(e=>({provider:e.provider,id:e.id,label:e.label,configDir:e.configDir})),r=t.data?.info?.root;return{accounts:n,repoAccount:r?e.data?.selections?.[r]:void 0}}function Xt(e,t){return e.filter(e=>e.provider===t).length>1}export{it as A,pe as B,Nt as C,rt as D,nt as E,ae as F,se as H,fe as I,he as L,at as M,ct as N,ot as O,ut as P,me as R,Mt as S,mt as T,ge as V,Ot as _,Jt as a,Dt as b,ht as c,jt as d,vt as f,yt as g,gt as h,Vt as i,lt as j,st as k,_t as l,St as m,Yt as n,It as o,wt as p,qt as r,Ft as s,Xt as t,Tt as u,Et as v,dt as w,Pt as x,At as y,le as z};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{i as r,r as i,t as a}from"./bundle-mjs-BT31bpU6.js";function o(e,t={rebrand:!0,displayName:`Squawk`,command:`hsq`,npx:`npx -p @hearsay-tools/squawk hsq`,npmPackage:`@hearsay-tools/squawk`}){return t.rebrand?t.displayName:e}function s(e={rebrand:!0,displayName:`Squawk`,command:`hsq`,npx:`npx -p @hearsay-tools/squawk hsq`,npmPackage:`@hearsay-tools/squawk`}){return e.command}function c(e={rebrand:!0,displayName:`Squawk`,command:`hsq`,npx:`npx -p @hearsay-tools/squawk hsq`,npmPackage:`@hearsay-tools/squawk`}){return e.npx}function l(e={rebrand:!0,displayName:`Squawk`,command:`hsq`,npx:`npx -p @hearsay-tools/squawk hsq`,npmPackage:`@hearsay-tools/squawk`}){return e.rebrand?`npx -p ${e.npmPackage} ${e.command}`:`npx ${e.npmPackage}`}var u=`/api/v1`,d=``;function f(e){d=e.replace(/\/+$/,``)}function p(){return d}var m=null;function h(e){m=e===``?null:e}function g(){return m}function _(){return m??`default`}var v=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function y(e){return`${d}${u}${b(e)}`}function b(e){return m===null||v.test(e)?e:`/p/${encodeURIComponent(m)}${e}`}var x=/^\/api(?:\/v1)?(\/.*)$/;function S(e){let t=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(t){let n=e.indexOf(`//`,t[0].length);if(n!==t[0].length)return e;let r=e.indexOf(`/`,n+2);if(r===-1)return e;let i=e.slice(0,r),a=C(e.slice(r));return a===null?e:`${i}${a}`}let n=C(d&&e.startsWith(d)?e.slice(d.length):e);return n===null?e:`${d}${n}`}function C(e){let t=x.exec(e);if(!t)return null;let n=t[1];return n.startsWith(`/p/`)?`${u}${n}`:`${u}${b(n)}`}var w=e(t(),1),T=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ee=/^[\\/]{2}/;function te(e,t){return t+e.replace(/\\/g,`/`)}var ne=`popstate`;function re(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ie(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return se(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:O(t)}return ce(t,n,null,e)}function E(e,t){if(e===!1||e==null)throw Error(t)}function D(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ae(){return Math.random().toString(36).substring(2,10)}function oe(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function se(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?k(t):t,state:n,key:t&&t.key||r||ae(),mask:i}}function O({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function k(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ce(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=re(e)?e:se(h.location,e,t);n&&n(r,e),l=u()+1;let d=oe(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=re(e)?e:se(h.location,e,t);n&&n(r,e),l=u();let i=oe(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return le(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ne,d),c=e,()=>{i.removeEventListener(ne,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function le(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),E(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:O(t);return i=i.replace(/ $/,`%20`),!n&&ee.test(i)&&(i=r+i),new URL(i,r)}function ue(e,t,n=`/`){return de(e,t,n,!1)}function de(e,t,n,r,i){let a=j((typeof t==`string`?k(t):t).pathname||`/`,n);if(a==null)return null;let o=i??pe(e),s=null,c=ke(a);for(let e=0;s==null&&e<o.length;++e)s=Ee(o[e],c,r);return s}function fe(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function pe(e){let t=me(e);return ge(t),t}function me(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;E(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=N([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(E(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),me(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:we(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Oe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of he(e.path))a(e,t,!0,n)}),t}function he(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=he(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ge(e){e.sort((e,t)=>e.score===t.score?Te(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var _e=/^:[\w-]+$/,ve=3,ye=2,be=1,xe=10,Se=-2,Ce=e=>e===`*`;function we(e,t){let n=e.split(`/`),r=n.length;return n.some(Ce)&&(r+=Se),t&&(r+=ye),n.filter(e=>!Ce(e)).reduce((e,t)=>e+(_e.test(t)?ve:t===``?be:xe),r)}function Te(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ee(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?De(u,l,s.matcher,s.compiledParams):A(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=A({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:N([a,d.pathname]),pathnameBase:Ie(N([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=N([a,d.pathnameBase]))}return o}function A(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Oe(e.path,e.caseSensitive,e.end);return De(e,t,n,r)}function De(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Oe(e,t=!1,n=!0){D(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ke(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return D(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function j(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Ae(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?k(e):e,a;return n?(n=Fe(n),a=n.startsWith(`/`)?je(n.substring(1),`/`):je(n,t)):a=t,{pathname:a,search:Le(r),hash:Re(i)}}function je(e,t){let n=P(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Me(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ne(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Pe(e){let t=Ne(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function M(e,t,n,r=!1){let i;typeof e==`string`?i=k(e):(i={...e},E(!i.pathname||!i.pathname.includes(`?`),Me(`?`,`pathname`,`search`,i)),E(!i.pathname||!i.pathname.includes(`#`),Me(`#`,`pathname`,`hash`,i)),E(!i.search||!i.search.includes(`#`),Me(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ae(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Fe=e=>e.replace(/[\\/]{2,}/g,`/`),N=e=>Fe(e.join(`/`)),P=e=>e.replace(/\/+$/,``),Ie=e=>P(e).replace(/^\/*/,`/`),Le=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Re=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ze=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Be(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ve(e){return N(e.map(e=>e.route.path).filter(Boolean))||`/`}var He=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ue(e,t){let n=e;if(typeof n!=`string`||!T.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(He)try{let e=new URL(window.location.href),r=ee.test(n)?new URL(te(n,e.protocol)):new URL(n),a=j(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{D(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var We=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(We);var Ge=[`GET`,...We];new Set(Ge);var Ke=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function qe(e){try{return Ke.includes(new URL(e).protocol)}catch{return!1}}var F=w.createContext(null);F.displayName=`DataRouter`;var I=w.createContext(null);I.displayName=`DataRouterState`;var Je=w.createContext(!1);function Ye(){return w.useContext(Je)}var Xe=w.createContext({isTransitioning:!1});Xe.displayName=`ViewTransition`;var Ze=w.createContext(new Map);Ze.displayName=`Fetchers`;var Qe=w.createContext(null);Qe.displayName=`Await`;var L=w.createContext(null);L.displayName=`Navigation`;var R=w.createContext(null);R.displayName=`Location`;var z=w.createContext({outlet:null,matches:[],isDataRoute:!1});z.displayName=`Route`;var $e=w.createContext(null);$e.displayName=`RouteError`;var et=`REACT_ROUTER_ERROR`,tt=`REDIRECT`,nt=`ROUTE_ERROR_RESPONSE`;function rt(e){if(e.startsWith(`${et}:${tt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function it(e){if(e.startsWith(`${et}:${nt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new ze(t.status,t.statusText,t.data)}catch{}}function at(e,{relative:t}={}){E(B(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=w.useContext(L),{hash:i,pathname:a,search:o}=U(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:N([n,a])),r.createHref({pathname:s,search:o,hash:i})}function B(){return w.useContext(R)!=null}function V(){return E(B(),`useLocation() may be used only in the context of a <Router> component.`),w.useContext(R).location}function ot(){return w.useContext(R).navigationType}var st=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ct(e){w.useContext(L).static||w.useLayoutEffect(e)}function H(){let{isDataRoute:e}=w.useContext(z);return e?jt():lt()}function lt(){E(B(),`useNavigate() may be used only in the context of a <Router> component.`);let e=w.useContext(F),{basename:t,navigator:n}=w.useContext(L),{matches:r}=w.useContext(z),{pathname:i}=V(),a=JSON.stringify(Pe(r)),o=w.useRef(!1);return ct(()=>{o.current=!0}),w.useCallback((r,s={})=>{if(D(o.current,st),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=M(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:N([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var ut=w.createContext(null);function dt(e){let t=w.useContext(z).outlet;return w.useMemo(()=>t&&w.createElement(ut.Provider,{value:e},t),[t,e])}function ft(){let{matches:e}=w.useContext(z);return e[e.length-1]?.params??{}}function U(e,{relative:t}={}){let{matches:n}=w.useContext(z),{pathname:r}=V(),i=JSON.stringify(Pe(n));return w.useMemo(()=>M(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function pt(e,t){return mt(e,t)}function mt(e,t,n){E(B(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=w.useContext(L),{matches:i}=w.useContext(z),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Nt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
|
-
|
|
3
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=V(),d;if(t){let e=typeof t==`string`?k(t):t;E(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ue(e,{pathname:p});D(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),D(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=xt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:N([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:N([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?w.createElement(R.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function ht(){let e=At(),t=Be(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=w.createElement(w.Fragment,null,w.createElement(`p`,null,`💿 Hey developer 👋`),w.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,w.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,w.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),w.createElement(w.Fragment,null,w.createElement(`h2`,null,`Unexpected Application Error!`),w.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?w.createElement(`pre`,{style:i},n):null,o)}var gt=w.createElement(ht,null),_t=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=it(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:w.createElement(z.Provider,{value:this.props.routeContext},w.createElement($e.Provider,{value:e,children:this.props.component}));return this.context?w.createElement(yt,{error:e},t):t}};_t.contextType=Je;var vt=new WeakMap;function yt({children:e,error:t}){let{basename:n}=w.useContext(L);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=rt(t.digest);if(e){let r=vt.get(t);if(r)throw r;let i=Ue(e.location,n),a=i.absoluteURL||i.to;if(qe(a))throw Error(`Invalid redirect location`);if(He&&!vt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw vt.set(t,n),n}return w.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function bt({routeContext:e,match:t,children:n}){let r=w.useContext(F);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(z.Provider,{value:e},n)}function xt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);E(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ve(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||gt,o&&(s<0&&c===0?(Nt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?w.createElement(n.route.Component,null):n.route.element?n.route.element:e,w.createElement(bt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?w.createElement(_t,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function St(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ct(e){let t=w.useContext(F);return E(t,St(e)),t}function wt(e){let t=w.useContext(I);return E(t,St(e)),t}function Tt(e){let t=w.useContext(z);return E(t,St(e)),t}function Et(e){let t=Tt(e),n=t.matches[t.matches.length-1];return E(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Dt(){return Et(`useRouteId`)}function Ot(){let e=wt(`useNavigation`);return w.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function kt(){let{matches:e,loaderData:t}=wt(`useMatches`);return w.useMemo(()=>e.map(e=>fe(e,t)),[e,t])}function At(){let e=w.useContext($e),t=wt(`useRouteError`),n=Et(`useRouteError`);return e===void 0?t.errors?.[n]:e}function jt(){let{router:e}=Ct(`useNavigate`),t=Et(`useNavigate`),n=w.useRef(!1);return ct(()=>{n.current=!0}),w.useCallback(async(r,i={})=>{D(n.current,st),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Mt={};function Nt(e,t,n){!t&&!Mt[e]&&(Mt[e]=!0,D(!1,n))}w.memo(Pt);function Pt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return mt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Ft({to:e,replace:t,state:n,relative:r}){E(B(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=w.useContext(L);D(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=w.useContext(z),{pathname:o}=V(),s=H(),c=M(e,Pe(a),o,r===`path`),l=JSON.stringify(c);return w.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function It(e){return dt(e.context)}function Lt(e){E(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Rt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){E(!B(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=w.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=k(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=w.useMemo(()=>{let e=j(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return D(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:w.createElement(L.Provider,{value:c},w.createElement(R.Provider,{children:t,value:h}))}function zt({children:e,location:t}){return pt(W(e),t)}w.Component;function W(e,t=[]){let n=[];return w.Children.forEach(e,(e,r)=>{if(!w.isValidElement(e))return;let i=[...t,r];if(e.type===w.Fragment){n.push.apply(n,W(e.props.children,i));return}E(e.type===Lt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=W(e.props.children,i)),n.push(a)}),n}var Bt=W,G=`get`,K=`application/x-www-form-urlencoded`;function q(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Vt(e){return q(e)&&e.tagName.toLowerCase()===`button`}function Ht(e){return q(e)&&e.tagName.toLowerCase()===`form`}function Ut(e){return q(e)&&e.tagName.toLowerCase()===`input`}function Wt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gt(e,t){return e.button===0&&(!t||t===`_self`)&&!Wt(e)}function Kt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function qt(e,t){let n=Kt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var J=null;function Jt(){if(J===null)try{new FormData(document.createElement(`form`),0),J=!1}catch{J=!0}return J}var Yt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Xt(e){return e!=null&&!Yt.has(e)?(D(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${K}"`),null):e}function Zt(e,t){let n,r,i,a,o;if(Ht(e)){let o=e.getAttribute(`action`);r=o?j(o,t):null,n=e.getAttribute(`method`)||G,i=Xt(e.getAttribute(`enctype`))||K,a=new FormData(e)}else if(Vt(e)||Ut(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?j(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||G,i=Xt(e.getAttribute(`formenctype`))||Xt(o.getAttribute(`enctype`))||K,a=new FormData(o,e),!Jt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(q(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=G,r=null,i=K,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Qt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},$t=/[&><\u2028\u2029]/g;function en(e){return e.replace($t,e=>Qt[e])}function tn(e,t){if(e===!1||e==null)throw Error(t)}function nn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&j(i.pathname,t)===`/`?i.pathname=`${P(t)}/_root.${r}`:i.pathname=`${P(i.pathname)}.${r}`,i}async function rn(e,t){if(e.id in t)return t[e.id];try{let n=await r(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function an(e){return e!=null&&typeof e.page==`string`}function on(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function sn(e,t,n){return fn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await rn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(on).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function cn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ln(e,t,{includeHydrateFallback:n}={}){return un(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function un(e){return[...new Set(e)]}function dn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function fn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!an(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(dn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function pn(){let e=w.useContext(F);return tn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function mn(){let e=w.useContext(I);return tn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Y=w.createContext(void 0);Y.displayName=`FrameworkContext`;function X(){let e=w.useContext(Y);return tn(e,`You must render this element inside a <HydratedRouter> element`),e}function hn(e,t){let n=w.useContext(Y),[r,i]=w.useState(!1),[a,o]=w.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=w.useRef(null);w.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),w.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Z(s,p),onBlur:Z(c,m),onMouseEnter:Z(l,p),onMouseLeave:Z(u,m),onTouchStart:Z(d,p)}]:[a,f,{}]:[!1,f,{}]}function Z(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function gn({page:e,...t}){let n=Ye(),{nonce:r}=X(),{router:i}=pn(),a=w.useMemo(()=>ue(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?w.createElement(vn,{page:e,matches:a,...t}):w.createElement(yn,{page:e,matches:a,...t})):null}function _n(e){let{manifest:t,routeModules:n}=X(),[r,i]=w.useState([]);return w.useEffect(()=>{let r=!1;return sn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function vn({page:e,matches:t,...n}){let r=V(),{future:i}=X(),{basename:a}=pn(),o=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=nn(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return w.createElement(w.Fragment,null,o.map(e=>w.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function yn({page:e,matches:t,...n}){let r=V(),{future:i,manifest:a,routeModules:o}=X(),{basename:s}=pn(),{loaderData:c,matches:l}=mn(),u=w.useMemo(()=>cn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=w.useMemo(()=>cn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=nn(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=w.useMemo(()=>ln(d,a),[d,a]),m=_n(d);return w.createElement(w.Fragment,null,f.map(e=>w.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>w.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>w.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function bn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}w.Component;var xn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{xn&&(window.__reactRouterVersion=`7.18.1`)}catch{}function Sn({basename:e,children:t,useTransitions:n,window:r}){let i=w.useRef();i.current??=ie({window:r,v5Compat:!0});let a=i.current,[o,s]=w.useState({action:a.action,location:a.location}),c=w.useCallback(e=>{n===!1?s(e):w.startTransition(()=>s(e))},[n]);return w.useLayoutEffect(()=>a.listen(c),[a,c]),w.createElement(Rt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Cn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=w.useState({action:n.action,location:n.location}),o=w.useCallback(e=>{r===!1?a(e):w.startTransition(()=>a(e))},[r]);return w.useLayoutEffect(()=>n.listen(o),[n,o]),w.createElement(Rt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Cn.displayName=`unstable_HistoryRouter`;var wn=w.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=w.useContext(L),v=typeof l==`string`&&T.test(l),y=Ue(l,h);l=y.to;let b=at(l,{relative:r}),x=V(),S=null;if(o){let e=M(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:N([h,e.pathname])),S=g.createHref(e)}let[C,ee,te]=hn(n,p),ne=jn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function re(t){e&&e(t),t.defaultPrevented||ne(t)}let ie=!(y.isExternal||i),E=w.createElement(`a`,{...p,...te,href:(ie?S:void 0)||y.absoluteURL||b,onClick:ie?re:e,ref:bn(m,ee),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?w.createElement(w.Fragment,null,E,w.createElement(gn,{page:b})):E});wn.displayName=`Link`;var Tn=w.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=U(a,{relative:c.relative}),d=V(),f=w.useContext(I),{navigator:p,basename:m}=w.useContext(L),h=f!=null&&Vn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=j(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,T;T=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(S):i;return w.createElement(wn,{...c,"aria-current":C,className:T,ref:l,style:ee,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Tn.displayName=`NavLink`;var En=w.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=G,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=w.useContext(L),g=Fn(),_=In(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&T.test(s);return w.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?w.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});En.displayName=`Form`;function Dn({getKey:e,storageKey:t,...n}){let r=w.useContext(Y),{basename:i}=w.useContext(L),a=V(),o=kt();zn({getKey:e,storageKey:t});let s=w.useMemo(()=>{if(!r||!e)return null;let t=Rn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),w.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${en(JSON.stringify(t||Ln))}, ${en(JSON.stringify(s))})`}})}Dn.displayName=`ScrollRestoration`;function On(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kn(e){let t=w.useContext(F);return E(t,On(e)),t}function An(e){let t=w.useContext(I);return E(t,On(e)),t}function jn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=H(),d=V(),f=U(e,{relative:o});return w.useCallback(p=>{if(Gt(p,t)){p.preventDefault();let t=n===void 0?O(d)===O(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?w.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Mn(e){D(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(Kt(e)),n=w.useRef(!1),r=V(),i=w.useMemo(()=>qt(r.search,n.current?null:t.current),[r.search]),a=H();return[i,w.useCallback((e,t)=>{let r=Kt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Nn=0,Pn=()=>`__${String(++Nn)}__`;function Fn(){let{router:e}=kn(`useSubmit`),{basename:t}=w.useContext(L),n=Dt(),r=e.fetch,i=e.navigate;return w.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Zt(e,t);if(a.navigate===!1){let e=a.fetcherKey||Pn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function In(e,{relative:t}={}){let{basename:n}=w.useContext(L),r=w.useContext(z);E(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...U(e||`.`,{relative:t})},o=V();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:N([n,a.pathname])),O(a)}var Ln=`react-router-scroll-positions`,Q={};function Rn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:j(e.pathname,n)||e.pathname},t)),i??=e.key,i}function zn({getKey:e,storageKey:t}={}){let{router:n}=kn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=An(`useScrollRestoration`),{basename:a}=w.useContext(L),o=V(),s=kt(),c=Ot();w.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Bn(w.useCallback(()=>{if(c.state===`idle`){let t=Rn(o,s,a,e);Q[t]=window.scrollY}try{sessionStorage.setItem(t||Ln,JSON.stringify(Q))}catch(e){D(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(w.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Ln);e&&(Q=JSON.parse(e))}catch{}},[t]),w.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Q,()=>window.scrollY,e?(t,n)=>Rn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),w.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{D(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Bn(e,t){let{capture:n}=t||{};w.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Vn(e,{relative:t}={}){let n=w.useContext(Xe);E(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=kn(`useViewTransitionState`),i=U(e,{relative:t});if(!n.isTransitioning)return!1;let a=j(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=j(n.nextLocation.pathname,r)||n.nextLocation.pathname;return A(i.pathname,o)!=null||A(i.pathname,a)!=null}var Hn=a({extend:{classGroups:{shadow:[`shadow-modal`]}}});function Un(...e){return Hn(i(e))}function Wn(e){return typeof e==`string`&&/^https?:\/\//i.test(e)}function Gn(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var Kn=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,qn=i,Jn=(e,t)=>n=>{if(t?.variants==null)return qn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Kn(t)||Kn(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return qn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Yn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Xn(...e){return t=>{let n=!1,r=e.map(e=>{let r=Yn(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Yn(e[t],null)}}}}function Zn(...e){return w.useCallback(Xn(...e),e)}function Qn(e){let t=w.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];sr(r)&&typeof $==`function`&&(r=$(r._payload)),w.Children.forEach(r,e=>{if(ar(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;sr(n)&&typeof $==`function`&&(n=$(n._payload)),a=nr(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=w.cloneElement(a,void 0,s):!o&&w.Children.count(r)===1&&w.isValidElement(r)&&(a=r);let c=a?ir(a):void 0,l=Zn(n,c);if(!a){if(r||r===0)throw Error(o?ur(e):lr(e));return r}let u=rr(i,a.props??{});return a.type!==w.Fragment&&(u.ref=n?l:c),w.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var $n=Qn(`Slot`),er=Symbol.for(`radix.slottable`);function tr(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=er,t}var nr=(e,t)=>{if(`child`in e.props){let t=e.props.child;return w.isValidElement(t)?w.cloneElement(t,void 0,e.props.children(t.props.children)):null}return w.isValidElement(t)?t:null};function rr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ir(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ar(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===er}var or=Symbol.for(`react.lazy`);function sr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===or&&`_payload`in e&&cr(e._payload)}function cr(e){return typeof e==`object`&&!!e&&`then`in e}var lr=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,ur=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,$=w.use,dr=n(),fr=Jn(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-hidden focus-visible:ring-[3px] focus-visible:ring-ring/50 enabled:active:brightness-90 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-action text-action-foreground pointer-hover:brightness-[0.96]`,contrast:`bg-contrast text-contrast-foreground pointer-hover:brightness-[0.96]`,outline:`border border-border bg-card text-foreground pointer-hover:bg-muted`,ghost:`text-muted-foreground pointer-hover:bg-muted pointer-hover:text-foreground`,"danger-ghost":`text-danger pointer-hover:bg-danger/10`},size:{default:`h-11 px-3.5 text-[13px]`,sm:`h-[30px] rounded-sm px-2.5 text-[13px]`,icon:`size-9`,"icon-sm":`size-[30px] rounded-sm`}},defaultVariants:{variant:`primary`,size:`default`}});function pr({className:e,variant:t=`primary`,size:n=`default`,asChild:r=!1,...i}){return(0,dr.jsx)(r?$n:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:Un(fr({variant:t,size:n,className:e})),...i})}export{p as A,V as C,Mn as D,ft as E,h as F,s as I,o as L,_ as M,S as N,u as O,f as P,c as R,B as S,ot as T,Lt as _,tr as a,A as b,Jn as c,Wn as d,Sn as f,It as g,Ft as h,Qn as i,g as j,y as k,Gn as l,Tn as m,fr as n,Xn as o,wn as p,$n as r,Zn as s,pr as t,Un as u,zt as v,H as w,ue as x,Bt as y,l as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./project-scope-context-B3M-u8R0.js";import{M as a,ct as o,r as s}from"./design-icons-DmYTv2r1.js";import{n as c}from"./diff-controls-BR2uqhwG.js";import{u as l}from"./control-locations-C9II3kPz.js";import{t as u}from"./project-router-MMOk9VbW.js";import{t as d}from"./centered-state-DGyy0SuA.js";import{K as f,q as p}from"./index-B5LayM4y.js";import{t as m}from"./diff-BHwQUS2W.js";var h=e(n(),1),g=r();function _({commit:e,sha:n,backTo:r,backLabel:_,slot:v,className:y,diffClassName:b}){let x=p(),[S,C]=(0,h.useState)(`unified`),[w,T]=(0,h.useState)(!1),E=e.isError&&e.error instanceof i&&e.error.status===409,D=x?S:`unified`,O=!x||w;return(0,g.jsxs)(`section`,{"data-slot":v,"data-sha":n,className:y,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,g.jsx)(t,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,g.jsxs)(u,{to:r,children:[(0,g.jsx)(s,{size:16,"aria-hidden":`true`}),_]})}),e.data?(0,g.jsx)(f,{stat:e.data.stat}):null,(0,g.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,g.jsx)(c,{mode:S,wrap:w,onModeChange:C,onWrapChange:T})})]}),e.isPending?(0,g.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):e.isError?(0,g.jsx)(d,{icon:E?(0,g.jsx)(l,{}):(0,g.jsx)(o,{size:16}),tone:E?`neutral`:`danger`,heading:`h2`,title:E?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,g.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[e.data.author,` · `,e.data.when,` ·`,` `,(0,g.jsx)(`span`,{className:`font-mono select-all`,children:e.data.sha})]})]}),e.data.files.length===0?(0,g.jsx)(d,{icon:(0,g.jsx)(a,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,g.jsx)(`div`,{className:b,children:(0,g.jsx)(m,{files:e.data.files,mode:D,wrap:O,className:`min-w-0`})})]})]})}export{_ as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-BBhxSIlf.js","assets/rolldown-runtime-QTnfLwEv.js","assets/button-CHUAMTHK.js","assets/react-runtime-CCIEwYL0.js","assets/bundle-mjs-BT31bpU6.js","assets/eye-B8okNWXU.js","assets/createLucideIcon-BHp8sXmF.js","assets/markdown-D7DUNWcJ.js","assets/alert-dialog-Dj464rjk.js","assets/es2015-D345RR4o.js","assets/chunk-BO2N2NFS-DE6qKn3r.js","assets/lib-BxQXEXDF.js","assets/index-B5LayM4y.js","assets/live-refetch-BdnmTJ_8.js","assets/project-scope-context-B3M-u8R0.js","assets/live-protocol-BVn0UA_g.js","assets/useInfiniteQuery-BbYMWe23.js","assets/queries-DORTKwyN.js","assets/useQuery-CqqnAJvu.js","assets/ws-BtSVmivO.js","assets/toaster-B1MyeHiE.js","assets/cez-idle-EVoUsgU3.js","assets/dropdown-menu-DhrBcVgr.js","assets/design-icons-DmYTv2r1.js","assets/github-sidebar-model-B0Ufci5S.js","assets/popover-DRcRI46x.js","assets/textarea-DlVUfdWG.js","assets/project-router-MMOk9VbW.js","assets/agent-accounts-f1cxwgfz.js","assets/skills-DFBiAuJG.js","assets/skills-workflows-C21NystW.css","assets/loader-circle-CZkGEdoI.js","assets/nav-row-styles-BZUUavOF.js","assets/control-locations-C9II3kPz.js","assets/centered-state-DGyy0SuA.js","assets/sortable.esm-zp_qkYGV.js","assets/index-B18AqW0Z.css","assets/image-preview-Cq1vDiEo.js","assets/zoomable-image-5pOUaPEg.js","assets/markdown-BBDDg-4t.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{K as a}from"./index-B5LayM4y.js";import{n as o,t as s}from"./image-preview-Cq1vDiEo.js";var c=e(n(),1),l=r();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-BBhxSIlf.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:n=!1,imageSrc:r,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:t(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:n,imageSrc:r,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:n,imageSrc:r,onOpenInApp:i}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:r,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:t(`py-2 font-mono text-xs leading-[1.7]`,n?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
|
|
3
|
-
`).map((e,n)=>(0,l.jsxs)(`span`,{className:t(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},n))})]})}export{u as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,u as n,w as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,vn as s}from"./project-scope-context-B3M-u8R0.js";import{xt as c}from"./queries-DORTKwyN.js";import{T as l,ct as u}from"./design-icons-DmYTv2r1.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{t as f}from"./centered-state-DGyy0SuA.js";import{a as p,c as m,d as h,h as g,l as _,m as v,n as y,o as b,p as x,s as S,t as C,u as w}from"./markdown-D7DUNWcJ.js";var T=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`}]]),E=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`}]]),D=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`}]]),O=e(i(),1),k=a(),A=[[`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 j(e){let t=A.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var M={};function N(e){let t=(0,O.useMemo)(()=>w(e),[e]).join(` `),[n,r]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!t)return;let e=!0;return h(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:M}function P({html:e,title:t,fragment:r,className:i}){let a=N(e);return a?(0,k.jsx)(F,{html:e,title:t,fragment:r,className:i,libraries:a}):(0,k.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:n(`flex min-h-0 flex-col`,i)})}function F({html:e,title:t,fragment:r,className:i,libraries:a}){let{srcdoc:o,blocked:s}=(0,O.useMemo)(()=>{let n=m(e,a);return{srcdoc:_(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{r&&/^#\S+$/.test(r)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${r}`)},l=j(s);return(0,k.jsxs)(`div`,{"data-slot":`html-report`,className:n(`flex min-h-0 flex-col`,i),children:[l?(0,k.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,k.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:b,allow:p,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var I=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function L(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:I.has(t.slice(n+1).toLowerCase())}function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return L(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function z(e){return e.tooLarge?`too-large`:R(e.path)?`image`:e.binary?`binary`:`text`}function B(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function V({runId:e,path:t,className:n}){let r=c(e,t??void 0);if(t===null)return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(l,{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,k.jsx)(K,{className:n,children:(0,k.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 o&&r.error.status===409;return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:e?(0,k.jsx)(D,{}):(0,k.jsx)(u,{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,k.jsx)(H,{runId:e,entry:r.data,className:n}):(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),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 H({runId:e,entry:t,className:n,imageUrl:r,downloadUrl:i,snapshot:a,readerHref:o,documentPreview:s=!1}){let[c,l]=(0,O.useState)(!1),u=s&&/\.(?:md|markdown)$/i.test(t.path),d=s&&S(t.path),f=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),p=s&&f&&t.size<=10*1024*1024?`image`:z(t),m=(u||d)&&p===`text`;return(0,k.jsxs)(K,{className:n,children:[(0,k.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,k.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:B(t.size)})]}),a||i||m?(0,k.jsx)(W,{snapshot:a,downloadUrl:i,source:m?c:null,onSource:()=>l(e=>!e),readerHref:d&&p===`text`?o:void 0}):null,(0,k.jsx)(U,{runId:e,entry:t,kind:p,showImage:p===`image`&&(!s||f),rendered:c?null:u?`markdown`:d?`html`:null,imageUrl:r})]})}function U({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a}){return r?(0,k.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,k.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??s(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,k.jsx)(f,{icon:(0,k.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${B(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${B(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(C,{document:!0,children:t.content??``})}):i===`html`?(0,k.jsx)(P,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,k.jsx)(Y,{path:t.path,text:t.content??``})}function W({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,k.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,k.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,k.jsx)(G,{href:i}):null]})}function G({href:e}){let n=r(),i=t();return(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:t=>y(t,n,e,i),children:`Open reader`})}function K({className:e,children:t}){return(0,k.jsx)(`section`,{"data-slot":`file-preview`,className:n(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var q=1500;function J(e,t){let n=(0,O.useMemo)(()=>t.split(`
|
|
2
|
-
`).map(e=>[{content:e}]),[t]),r=(0,O.useMemo)(()=>g(e),[e]),i=n.length>q,[a,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(r===null||i)return;let n=!1;return x(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:v(t,r)?.tokens??n}function Y({path:e,text:t}){let n=J(e,t);return(0,k.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":g(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,k.jsxs)(`div`,{className:`flex px-4`,children:[(0,k.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,k.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}export{R as a,E as c,B as i,T as l,H as n,P as o,V as r,D as s,Y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,t as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,p as s,r as c,t as l}from"./dropdown-menu-DhrBcVgr.js";import{s as u}from"./popover-DRcRI46x.js";import{E as d,I as f,M as p,d as m,lt as h}from"./design-icons-DmYTv2r1.js";import{t as g}from"./createLucideIcon-BHp8sXmF.js";import{n as _,r as v,t as y}from"./diff-controls-BR2uqhwG.js";import{K as b,Lt as x}from"./index-B5LayM4y.js";var S=g(`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`}]]),C=g(`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`}]]),w=e(i(),1),T=a();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:i}){let[a,o]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,T.jsx)(m,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,T.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),a?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":a?`true`:void 0,onClick:()=>i(e.path),className:r(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(C,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(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(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),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=j(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(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,healthReady:t,branch:i,stat:a,mode:u,wrap:d,preview:f=!1,onModeChange:p,onWrapChange:m,onPreviewChange:h,onAction:g}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[i?(0,T.jsx)(y,{branch:i}):null,a?(0,T.jsx)(R,{stat:a}):null,h?(0,T.jsx)(`span`,{className:`ml-auto flex items-center`,children:(0,T.jsx)(v,{preview:f,onPreviewChange:h})}):null,(0,T.jsxs)(`span`,{className:r(`flex items-center gap-1`,h?`max-md:ml-auto`:`ml-auto`),children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(_,{mode:u,wrap:d,onModeChange:p,onWrapChange:m})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:g},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:g}),e.menu.length>0?(0,T.jsxs)(l,{children:[(0,T.jsx)(s,{asChild:!0,children:(0,T.jsx)(n,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(S,{"aria-hidden":`true`})})}),(0,T.jsx)(c,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(o,{disabled:!e.enabled,title:e.reason,onSelect:()=>g(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(p,{size:16,"aria-hidden":`true`}),push:(0,T.jsx)(h,{size:16,"aria-hidden":`true`}),"create-pr":(0,T.jsx)(f,{size:16,"aria-hidden":`true`}),"view-pr":(0,T.jsx)(u,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(x,{"aria-hidden":`true`})};function L({action:e,variant:r,onAction:i}){return e.id===`view-pr`?t(e.href)?(0,T.jsx)(n,{asChild:!0,variant:r,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>i(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(b,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.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{E as i,F as n,P as r,R as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{E as t,L as n,M as r,t as i,u as a}from"./button-CHUAMTHK.js";import{i as o,t as s}from"./react-runtime-CCIEwYL0.js";import"./live-refetch-BdnmTJ_8.js";import{$ as c,Hn as l,Jr as u,Z as d,et as f,nn as p,ri as m,tt as h}from"./project-scope-context-B3M-u8R0.js";import{An as g,Cn as _,D as v,E as y,N as b,P as ee,Pt as te,Un as x,X as S,j as ne,k as C,l as w,n as T}from"./queries-DORTKwyN.js";import{n as E}from"./toaster-B1MyeHiE.js";import{_ as D,a as O,d as k,f as A,g as re,i as j,m as M,n as N,p as ie,r as ae,t as oe,u as P}from"./github-sidebar-model-B0Ufci5S.js";import{i as F,r as I,t as L}from"./popover-DRcRI46x.js";import{I as R,L as se,Q as ce,Z as z,ct as B,l as le,m as V,r as ue,u as H}from"./design-icons-DmYTv2r1.js";import{a as de,t as U}from"./loader-circle-CZkGEdoI.js";import{l as fe,n as pe}from"./nav-row-styles-BZUUavOF.js";import{r as me,t as W}from"./project-router-MMOk9VbW.js";import{t as G}from"./centered-state-DGyy0SuA.js";import{A as he,E as ge,M as _e,O as ve,j as K}from"./agent-accounts-f1cxwgfz.js";import{Pt as ye,X as be,Xt as xe,Zt as Se,n as Ce,ot as we,q as Te,t as Ee,yt as De}from"./index-B5LayM4y.js";import{a as Oe,d as ke,f as Ae,i as je,l as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le,u as q}from"./use-hand-to-agent-state-DyVB4IBv.js";import{t as J}from"./tab-link-BvoGfK8S.js";var Y=e(o(),1),X=`cez-github-list-width`;function Z(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 Re(){try{let e=localStorage.getItem(X);return e===null?360:Z(e)}catch{return 360}}function ze(e){try{localStorage.setItem(X,String(Z(e)))}catch{}}var Q=s();function Be({number:e,repo:t}){let n=r();return(0,Q.jsx)(Ve,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function Ve({number:e,repo:t,scope:n}){let r=(0,Y.useId)(),a=(0,Y.useId)(),[o,s]=(0,Y.useState)(!1),c=o?Se:xe,u=S(n,!0,n==="default"),d=w(`#${e}`,!0),f=(0,Y.useMemo)(()=>ie(g(u.data??[],d.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[u.data,d.data,e,t,n]);return(0,Q.jsxs)(`section`,{"aria-labelledby":r,className:`mt-4 min-w-0 rounded-lg border border-border p-3`,children:[(0,Q.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":o,"aria-controls":a,onClick:()=>s(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,Q.jsx)(c,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Q.jsxs)(`span`,{children:[`Linked tasks`,u.data?` (${f.length}${d.hasNextPage||d.isError?`+`:``})`:``]})]})}),(0,Q.jsx)(`div`,{id:a,children:o?(0,Q.jsxs)(Q.Fragment,{children:[u.isPending?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,u.isError?(0,Q.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,Q.jsx)(i,{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,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,f.length>0?(0,Q.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:f.map(e=>{let t=l(e);return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(W,{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,Q.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:_(e)}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,Q.jsx)(we,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,Q.jsx)(`span`,{className:`rounded border border-border px-1`,children:`Archived`}):null,(0,Q.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,d.isError?(0,Q.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,Q.jsx)(i,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry older linked tasks`})]}):d.hasNextPage?(0,Q.jsx)(i,{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 He=`w-44 max-w-full`,$=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm text-foreground focus-visible:outline-ring disabled:opacity-50`;function Ue(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 We(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function Ge(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 Ke(e){return[e.viewerLogin?``:`GitHub login unavailable.`,Ge(e)].filter(Boolean).join(` `)}function qe({options:e,assignees:t,onAssigneesChange:n}){return(0,Q.jsxs)(L,{children:[(0,Q.jsx)(F,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:$,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,Q.jsx)(H,{size:12,"aria-hidden":`true`,className:`ml-1 inline size-3 shrink-0 align-[-1px] text-soft-foreground`})]})}),(0,Q.jsx)(I,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,Q.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,Q.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,Q.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(r?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,Q.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]})}function Je({data:e,projectId:t,onProjectChange:n,pickerRef:r}){return e.projects?.length?(0,Q.jsxs)(`select`,{ref:r,"aria-label":`Project board`,className:`${$} ${He}`,value:t,onChange:e=>n(e.target.value),children:[(0,Q.jsx)(`option`,{value:``,children:`All boards`}),e.projects.map(e=>(0,Q.jsx)(`option`,{value:e.id,children:e.title},e.id))]}):e.projects||e.projectsState?(0,Q.jsx)(`select`,{ref:r,"aria-label":`Project board`,className:`${$} ${He}`,disabled:!0,value:``,children:(0,Q.jsx)(`option`,{value:``,children:e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`})}):null}function Ye({data:e,message:t,lastMessage:n,hasMessage:r,statusOpen:i,setStatusOpen:a,triggerRef:o,contentRef:s}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{role:`status`,className:`sr-only`,children:t}),(0,Q.jsxs)(L,{open:i,onOpenChange:a,children:[(0,Q.jsx)(F,{asChild:!0,children:(0,Q.jsx)(`button`,{ref:o,type:`button`,className:`${$} inline-flex items-center justify-center ${t?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:t?void 0:-1,children:e.projectsState===`refreshing`?(0,Q.jsx)(z,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,Q.jsx)(B,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,Q.jsx)(I,{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 Xe({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,Y.useState)(!1),s=(0,Y.useRef)(null),c=(0,Y.useRef)(null),l=(0,Y.useRef)(null),u=(0,Y.useRef)(null),d=Ue(e.issues,t),f=We(e.viewerLogin,t),p=Ke(e),m=p!==``,h=(0,Y.useRef)(p);m&&(h.current=p);let g=(0,Y.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,Y.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,Y.useEffect)(()=>{if(m)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&_()},[m]),(0,Q.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,Q.jsx)(qe,{options:d,assignees:t,onAssigneesChange:r}),(0,Q.jsx)(`button`,{ref:u,type:`button`,className:`${$} aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:`Assigned to me`}),(0,Q.jsx)(Je,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,Q.jsx)(Ye,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function Ze({onRefresh:e,refreshing:t}){let n=Ee(r());return(0,Q.jsxs)(`div`,{"data-route":`github`,"data-slot":`github-filter-screen`,className:pe,children:[(0,Q.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,Q.jsx)(`h1`,{className:a(fe,`min-w-0 flex-1`),children:`GitHub`}),(0,Q.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,Q.jsx)(z,{size:17,"aria-hidden":`true`,className:a(`size-[17px]`,t&&`motion-safe:animate-spin`)})})]}),(0,Q.jsx)(Ce,{model:n,variant:`screen`})]})}function Qe(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function $e(e){let[t,n]=(0,Y.useState)(null);return(0,Y.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(Qe(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 et(e,t){let[n,r]=(0,Y.useState)(0);return(0,Y.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 tt(e,t,n){let[r,i]=(0,Y.useState)(null),a=(0,Y.useRef)(n);return(0,Y.useEffect)(()=>{a.current=n}),(0,Y.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 nt(e,t,n,r,i){let[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),l=$e(a),u=(0,Y.useRef)(null);u.current=l;let d=et(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:tt(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}var rt=100;function it(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>=rt)break;a.add(t.number)}return[...a]}function at(e,t,n,r,i,a){let o=it(n,e,r,i,a),s=y(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=v(e===`issues`?`issue`:`pr`,(0,Y.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,Y.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 ot(e){let[t,n]=De(),r=t.get(`filter`),i=M(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 st(e,t,{filter:n,activeFilter:r,setFilterParam:i}){let[a,o]=(0,Y.useState)(``),[s,c]=(0,Y.useState)([]),[l,u]=(0,Y.useState)([]),{setProjectFilter:d,activeProject:f}=ct(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 ct(e){let[t,n]=(0,Y.useState)(``),r=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,i=r||e?.projects?.some(e=>e.id===t)?t:``;return(0,Y.useEffect)(()=>{e&&!r&&t&&!i&&n(``)},[e,t,i,r]),{setProjectFilter:n,activeProject:i}}function lt(e,t,{filter:n,activeFilter:i},a){let o=r(),s=e===`issues`&&(i===`no-task`||i===`has-task`),c=S(o,s,o==="default"),l=(0,Y.useMemo)(()=>c.data?A(c.data,t?.repo,o):null,[c.data,t?.repo,o]),u=k(e,n)?D(n):null,d=b(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,Y.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,Y.useMemo)(()=>f?re(f,p):null,[f,p]),h=ut({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,Y.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,Y.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 ut({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 dt(e,t){return t?h(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function ft(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=T.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,Y.useState)(null);return(0,Y.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 pt(e,t,n,{fullList:r,filterRows:i},a){let o=u(),s=(0,Y.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,d=C(c,n??0,l),f=l&&d.data?.available&&d.data.item?.kind===c?d.data.item:null;s.current=l&&n!==null?{kind:c,number:n,key:T.githubItem(c,n)}:null;let[p,m]=(0,Y.useState)(!1);return{exactWanted:l,exactItem:d,exactDetail:f,exactTargetRef:s,retryingExact:p,retryExact:()=>{m(!0),dt(o,s.current).then(e=>{m(!1),e||E(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function mt(e,t,n){let r=u(),i=(0,Y.useRef)(null);return{refresh:x({mutationFn:e=>(dt(r,e),d({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:T.githubPages(50),exact:!0}),r.setQueryData(T.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:T.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),l=T.githubCommentCounts(o,s);r.removeQueries({queryKey:T.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==m(l)}),a.available&&a.commentsDeferred&&s.length>0&&c(o,s,{refresh:!0}).then(e=>r.setQueryData(l,e)).catch(()=>{}),r.invalidateQueries({queryKey:T.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:T.githubSearch(`pr`,O)}),r.invalidateQueries({queryKey:T.githubSearch(`pr`,N)});let u=i.current;if(!u){r.removeQueries({queryKey:[`github`,`comments`]});return}let d=T.githubComments(u.kind,u.number);f(u.kind,u.number,{refresh:!0}).then(e=>r.setQueryData(d,e)).catch(()=>{}),r.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==m(d)})},onError:e=>E(e.message,{tone:`danger`})}),openThreadRef:i}}var ht=350;function gt(e,t){let[n,r]=(0,Y.useState)(e);return(0,Y.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function _t(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let l=gt(n,ht),u=(0,Y.useMemo)(()=>q(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&&Ae(l,u),p=b(e===`issues`?`issue`:`pr`,l,f),m=q(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)),_=vt(e,h,a,i);return{debouncedQuery:l,searchWanted:f,forgeSearch:p,items:m,searchPayload:h,metadataFailure:_,searchHits:h&&!_?q(h.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!g.has(e.number)):[],...yt(n,d,f,p)}}function vt(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 yt(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 bt({width:e,onWidthChange:t}){let n=(0,Y.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(Z(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,Q.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(Z(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 xt({view:e,changes:n=!1,index:r=!1}){let{n:i}=t(),a=ot(e),{rawFilterParam:o,activeFilter:s}=a,c=Te(),{pages:l,data:u}=ne(50),d=ee().data?.capabilities?.automations===!0,f=Ct(),p=Le(),m=St({index:r,isDesktop:c,rawFilterParam:o,n:i,rememberedView:te().data?.githubView}),h=wt(u?.available===!0&&!m.filterScreen),[g,_]=(0,Y.useState)(!1),v=st(e,u,a),y=lt(e,u,a,v.isAssignedFilter),b=_t(e,u,v,y),x=ft(e,i,b.forgeSearch,y),S=pt(e,u,x.selectedNumber,y,x.remoteDetail),C=at(e,l,u,x.selectedNumber,b.searchHits,y.openItems),{refresh:w,openThreadRef:T}=mt(e,C.checkPrNumbers,b.debouncedQuery),E=nt(e,l,u,y.backedQuery,v.narrowing);if(m.restorePrs)return(0,Q.jsx)(me,{to:`/github/prs`,replace:!0});if(!u)return l.isError?(0,Q.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Q.jsx)(G,{icon:(0,Q.jsx)(B,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:l.error.message})}):(0,Q.jsx)(ye,{});T.current=null;let D=()=>w.mutate(S.exactTargetRef.current);if(m.filterScreen&&u.available)return(0,Q.jsx)(Ze,{onRefresh:D,refreshing:w.isPending});if(!u.available)return(0,Q.jsx)(kt,{reason:u.reason,refreshing:w.isPending,onRetry:D});let{labelColors:O,labelOptions:k}=Tt(u,b.searchPayload,y.openItems,y.fullList),A=Et({number:x.selectedNumber,items:b.items,searchHits:b.searchHits,fullList:y.fullList,filterRows:y.filterRows,remoteDetail:x.remoteDetail,exactDetail:S.exactDetail});T.current=A?{kind:A.kind,number:A.number}:null;let{linkFilter:re,listPath:j}=Dt(e,o,s,c),M={view:e,filter:re,colors:O,selected:A,queued:p.queued,checksMap:C.checksMap,commentsOf:C.commentsOf},N=Ot(e,v,y.filterGate,b);return(0,Q.jsxs)(`div`,{ref:h.routeRef,"data-route":`github`,className:`flex min-h-full flex-col gap-3 px-[18px] pt-[18px] pb-[calc(90px+env(safe-area-inset-bottom))] md:gap-[22px] md:px-7 md:pt-4 md:pb-4`,children:[(0,Q.jsx)(At,{view:e,activeFilter:s,isDesktop:c,rawFilterParam:o,n:i,gh:u}),(0,Q.jsxs)(`div`,{ref:h.workspaceRef,"data-slot":`gh-workspace`,"data-stacked":h.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-[22px]`,children:[(0,Q.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-[22px]`,children:[(0,Q.jsx)(jt,{view:e,isDesktop:c,gh:u,automationsAvailable:d,onSaveView:f,refreshing:w.isPending,onRefresh:D}),(0,Q.jsx)(Mt,{view:e,gh:u,filters:v,labelOptions:k,labelColors:O,searchPayload:b.searchPayload})]}),(0,Q.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,Q.jsx)(Ft,{view:e,n:i,rows:M,verdict:N,search:b,sidebar:y,list:l,paging:E,width:h.githubListWidth,onWidthChange:h.changeGithubListWidth,expanded:g,onExpandedChange:_}),(0,Q.jsx)(Vt,{view:e,n:i,selected:A,selectedNumber:x.selectedNumber,exact:S,repo:u.repo,rows:M,listPath:j,changes:n,handToAgent:p})]})]})]})}function St({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 Ct(){let e=u();return t=>{e.setQueryData(T.uiState,e=>({...e,githubView:t})),p({githubView:t}).then(t=>e.setQueryData(T.uiState,t)).catch(t=>{E(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:T.uiState})})}}function wt(e){let[t,n]=(0,Y.useState)(Re),[r,i]=(0,Y.useState)(!0),a=(0,Y.useRef)(null),o=(0,Y.useRef)(null);return(0,Y.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=Z(e);n(t),ze(t)},panesStacked:r,routeRef:a,workspaceRef:o}}function Tt(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:Me([...n,...r,...t?.items??[]])}}function Et({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 Dt(e,t,n,r){let i=t===null?null:n;return{linkFilter:i,listPath:P(e,i??(e===`issues`&&!r?`all`:null))}}function Ot(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,Q.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,Q.jsx)(U,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,r.message]}):n?i?(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(U,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,t.trim(),`”…`]}):a?c.length>0?(0,Q.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,o,`. Use Refresh to try again.`]}):u.length>0?(0,Q.jsxs)(`p`,{children:[`GitHub could not be searched: `,o,`.`]}):(0,Q.jsxs)(`p`,{children:[`No open `,d,` match your filter, and GitHub could not be searched: `,o,`.`]}):s?(0,Q.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,s]}):c.length>0?null:l?.truncated?(0,Q.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):l&&u.length>0?(0,Q.jsxs)(`p`,{children:[`No additional `,d,` match your filter on GitHub.`]}):l?(0,Q.jsxs)(`p`,{children:[`No `,d,` match your filter — open, closed or merged.`]}):(0,Q.jsxs)(`p`,{children:[`No open `,d,` match your filter.`]}):(0,Q.jsxs)(`p`,{children:[`No open `,d,`.`]})}function kt({reason:e,refreshing:t,onRetry:r}){return(0,Q.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Q.jsx)(G,{icon:(0,Q.jsx)(se,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,Q.jsx)(i,{variant:`outline`,"data-action":`gh-retry`,disabled:t,onClick:r,children:`Try again`}),children:(0,Q.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,Q.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,Q.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in `,n(`cezar`),` works without it.`]})})})}function At({view:e,activeFilter:t,isDesktop:n,rawFilterParam:r,n:i,gh:a}){return(0,Q.jsxs)(`div`,{"data-slot":`gh-masthead`,className:`flex min-w-0 shrink-0 flex-col gap-1 md:flex-row md:items-baseline md:gap-3`,children:[(0,Q.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[15px] md:tracking-normal`,children:n?`${e===`issues`?`Issues`:`Pull requests`} · ${oe[t]}`:`GitHub`}),r!==null&&i===void 0?(0,Q.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`flex min-w-0 items-center gap-3 md:hidden`,children:[(0,Q.jsxs)(W,{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,Q.jsx)(ue,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),t===`all`?null:(0,Q.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-soft-foreground`,children:[...ae,...j].find(e=>e.id===t)?.label})]}):null,a.repo?(0,Q.jsxs)(`span`,{className:`min-w-0 truncate text-[13px] text-muted-foreground md:text-[11px] md:text-soft-foreground`,children:[(0,Q.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,Q.jsxs)(`span`,{"data-slot":`gh-synced`,children:[` · `,a.syncedAt?`Synced ${de(a.syncedAt)} ago`:`Not synced yet`]})]}):null]})}function jt({view:e,isDesktop:t,gh:n,automationsAvailable:r,onSaveView:i,refreshing:o,onRefresh:s}){return(0,Q.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,Q.jsxs)(J,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>i(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,Q.jsxs)(J,{to:`/github/prs`,active:e===`prs`,onClick:()=>i(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]}),r?(0,Q.jsx)(W,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,Q.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:o,onClick:s,className:`gh-utility`,children:[(0,Q.jsx)(z,{size:16,"aria-hidden":`true`,className:a(`size-3.5`,o&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function Mt({view:e,gh:t,filters:n,labelOptions:r,labelColors:i,searchPayload:a}){return(0,Q.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2.5`,children:[(0,Q.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,Q.jsx)(ce,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,Q.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-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,Q.jsx)(qt,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,Q.jsx)(Xe,{data:{...t,issues:[...t.issues,...a?.items??[]]},assignees:n.effectiveAssignees,projectId:n.activeProject,onAssigneesChange:n.changeAssignees,onProjectChange:n.setProjectFilter}):null,(0,Q.jsx)(`button`,{type:`button`,disabled:!n.filtering,className:`min-h-11 min-w-11 rounded-md border border-border bg-card px-4 text-xs disabled:opacity-50`,onClick:n.clearFilters,children:`Clear filters`})]})}function Nt(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Pt(e,t){return(0,Q.jsx)(Kt,{item:e,view:t.view,filter:t.filter,colors:t.colors,active:t.selected?.url===e.url,queued:t.queued.has(e.url),checks:Nt(e,t.checksMap),comments:t.commentsOf(e)})}function Ft({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,Q.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,Q.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:r}):(0,Q.jsx)(It,{items:f,rows:n,compactPreview:m,paging:s}),s.pagingAvailable?(0,Q.jsx)(Lt,{view:e,list:o,paging:s}):null,(0,Q.jsx)(Rt,{backedQuery:a.backedQuery,filterSearch:a.filterSearch}),(0,Q.jsx)(zt,{view:e,n:t,count:f.length,expanded:u,onExpandedChange:d}),f.length>0&&i.searchWanted&&r?(0,Q.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-soft-foreground`,children:r}):null,p.length>0?(0,Q.jsx)(Bt,{hits:p,searchPayload:i.searchPayload,rows:n}):null,(0,Q.jsx)(bt,{width:c,onWidthChange:l})]})}function It({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,Q.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:Pt(e,t)},e.url));return(0,Q.jsx)(`div`,{ref:i,"data-slot":`gh-rows`,"data-virtualized":a?`true`:void 0,role:`list`,children:a?(0,Q.jsx)(be,{scrollRef:s,startMargin:c,children:l},a===o?`list`:`main`):l})}function Lt({view:e,list:t,paging:n}){return(0,Q.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-soft-foreground`,children:t.isFetchingNextPage?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(U,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Loading more…`]}):t.isFetchNextPageError?(0,Q.jsxs)(Q.Fragment,{children:[`Could not load more.`,(0,Q.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,Q.jsxs)(Q.Fragment,{children:[`Filters cover the loaded `,e===`issues`?`issues`:`pull requests`,`.`,(0,Q.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 Rt({backedQuery:e,filterSearch:t}){return e!==null&&t.data?.available&&t.data.truncated?(0,Q.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-soft-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:a}){return e===`issues`&&t!==void 0&&n>2?(0,Q.jsx)(i,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":r,onClick:()=>a(e=>!e),children:r?`Show fewer issues`:`View all ${n} issues`}):null}function Bt({hits:e,searchPayload:t,rows:n}){return(0,Q.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,Q.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,Q.jsx)(`li`,{children:Pt(e,n)},e.url))})]})}function Vt({view:e,n:t,selected:n,selectedNumber:r,exact:i,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}){let{exactWanted:d,exactItem:f}=i;return(0,Q.jsx)(`section`,{"data-slot":`gh-detail`,className:a(`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,Q.jsx)(Ht,{item:n,n:t,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}):d&&f.isPending?(0,Q.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex min-h-full flex-1 flex-col`,children:(0,Q.jsx)(G,{icon:(0,Q.jsx)(U,{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,Q.jsx)(Ut,{number:r,exact:i}):(0,Q.jsx)(Wt,{view:e,number:r})})}function Ht({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,Q.jsx)(Pe,{item:e,comments:r.commentsOf(e),afterHeading:e.kind===`issue`?(0,Q.jsx)(Be,{number:e.number,repo:n},t??`list`):void 0,backLink:{to:i},subNav:{filter:r.filter,changes:a},onRunAgent:Gt,colors:r.colors,checks:Nt(e,r.checksMap),children:(0,Q.jsx)(Ne,{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 Ut({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:a}=t;return(0,Q.jsx)(G,{icon:(0,Q.jsx)(B,{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,Q.jsx)(i,{variant:`outline`,disabled:r,onClick:a,children:`Retry`})})}function Wt({view:e,number:t}){return(0,Q.jsx)(G,{icon:e===`issues`?(0,Q.jsx)(V,{size:16}):(0,Q.jsx)(R,{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 Gt(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}function Kt({item:e,view:t,filter:n,colors:r,active:i,queued:o,checks:s,comments:c}){let l=e.kind===`issue`?V:R,d=u(),p=()=>{d.prefetchQuery({queryKey:T.githubComments(e.kind,e.number),queryFn:({signal:t})=>f(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,Q.jsxs)(W,{to:P(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Fe(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:p,onFocus:p,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":i?`page`:void 0,title:`Drag into the composer to prefill a task`,className:a(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,i&&`bg-accent-strong/10 text-accent-text`),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,Q.jsx)(l,{"aria-hidden":`true`,className:a(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,Q.jsx)(`span`,{className:a(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,i&&`font-semibold`),children:e.title})]}),(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 pl-[22px] font-mono text-[11px] text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,Q.jsxs)(`span`,{children:[`#`,e.number]}),(0,Q.jsx)(`span`,{className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,Q.jsx)(`span`,{children:de(e.createdAt)}),(0,Q.jsx)(Oe,{count:c}),s?(0,Q.jsx)(je,{checks:s}):null,o?(0,Q.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-accent-text`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,Q.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,Q.jsx)(Ie,{label:e,color:r[e],plain:!0},e))}):null]})}function qt({options:e,colors:t,selected:n,onChange:r}){let[i,o]=(0,Y.useState)(!1),s=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Q.jsxs)(L,{open:i,onOpenChange:o,children:[(0,Q.jsx)(F,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:a(`flex min-h-11 min-w-11 shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,Q.jsx)(H,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`})]})}),(0,Q.jsx)(I,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Q.jsxs)(ge,{children:[(0,Q.jsx)(he,{placeholder:`Filter labels…`}),(0,Q.jsxs)(_e,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Q.jsx)(ve,{children:`No labels.`}),n.length>0?(0,Q.jsxs)(K,{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,Q.jsxs)(K,{value:e,onSelect:()=>s(e),className:`min-h-11`,children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:ke(t[e])}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Q.jsx)(le,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{xt as GithubRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{s as t,u as n}from"./button-CHUAMTHK.js";import{i as r,t as i}from"./react-runtime-CCIEwYL0.js";import{Ut as a,_n as o,cn as s}from"./queries-DORTKwyN.js";import{d as c,h as l,m as u,p as d}from"./es2015-D345RR4o.js";import{S as f}from"./dropdown-menu-DhrBcVgr.js";import{i as p,r as m,t as h}from"./popover-DRcRI46x.js";import{K as g,i as _,rt as v,u as y}from"./design-icons-DmYTv2r1.js";import{a as b,c as x,i as S,n as ee}from"./textarea-DlVUfdWG.js";import{c as te,t as ne}from"./project-router-MMOk9VbW.js";import{A as re,E as ie,M as ae,N as oe,O as se,j as C,k as w}from"./agent-accounts-f1cxwgfz.js";import{a as T,i as E}from"./skills-DFBiAuJG.js";/* empty css */import{t as D}from"./markdown-D7DUNWcJ.js";var O=e(r(),1);function k(e){let t=O.useRef({value:e,previous:e});return O.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var A=i(),j=`Switch`,[ce,le]=u(j),[ue,M]=ce(j);function de(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=c({prop:n,defaultProp:i??!1,onChange:l,caller:j}),[h,g]=O.useState(null),[_,v]=O.useState(null),y={checked:p,setChecked:m,disabled:a,control:h,setControl:g,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:O.useRef(!1),required:u,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,A.jsx)(ue,{scope:t,...y,children:B(f)?f(y):r})}var N=`SwitchTrigger`,P=O.forwardRef(({__scopeSwitch:e,onClick:n,...r},i)=>{let{control:a,form:o,value:s,disabled:c,checked:u,required:f,setControl:p,setChecked:m,hasConsumerStoppedPropagationRef:h,isFormControl:g,bubbleInput:_}=M(N,e),v=t(i,p),y=O.useRef(u);return O.useEffect(()=>{let e=o?a?.ownerDocument.getElementById(o):a?.form;if(e instanceof HTMLFormElement){let t=()=>m(y.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,o,m]),(0,A.jsx)(l.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":f,"data-state":V(u),"data-disabled":c?``:void 0,disabled:c,value:s,...r,ref:v,onClick:d(n,e=>{m(e=>!e),_&&g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});P.displayName=N;var F=O.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,A.jsx)(de,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(P,{...d,ref:t,__scopeSwitch:n}),e&&(0,A.jsx)(z,{__scopeSwitch:n})]})})});F.displayName=j;var I=`SwitchThumb`,L=O.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=M(I,n);return(0,A.jsx)(l.span,{"data-state":V(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});L.displayName=I;var R=`SwitchBubbleInput`,z=O.forwardRef(({__scopeSwitch:e,...n},r)=>{let{control:i,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:s,required:c,disabled:u,name:d,value:p,form:m,bubbleInput:h,setBubbleInput:g}=M(R,e),_=t(r,g),v=k(o),y=f(i);O.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!a.current;if(v!==o&&n){let t=new Event(`click`,{bubbles:r});n.call(e,o),e.dispatchEvent(t)}},[h,v,o,a]);let b=O.useRef(o);return(0,A.jsx)(l.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??b.current,required:c,disabled:u,name:d,value:p,form:m,...n,tabIndex:-1,ref:_,style:{...n.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});z.displayName=R;function B(e){return typeof e==`function`}function V(e){return e?`checked`:`unchecked`}function H({templates:e,onInsert:t,triggerClassName:r,disabled:i,iconOnly:a=!1,label:o=`Template`}){let[s,c]=(0,O.useState)(!1),l=(0,O.useRef)(null),u=te();return e.length===0?null:(0,A.jsxs)(h,{open:s,onOpenChange:c,children:[(0,A.jsx)(p,{asChild:!0,children:(0,A.jsxs)(`button`,{type:`button`,"data-slot":`prompt-template-trigger`,"aria-label":`Insert a prompt template`,title:`Insert a prompt template`,disabled:i,className:n(`inline-flex h-[26px] items-center gap-1.5 rounded-full border border-border bg-card text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50`,a?`w-[26px] justify-center px-0`:`h-11 gap-2 rounded-lg px-3 text-foreground`,r),children:[(0,A.jsx)(g,{"aria-hidden":`true`,className:a?`size-3 shrink-0 text-accent-icon`:`size-[18px] shrink-0 text-muted-foreground`}),a?null:(0,A.jsxs)(A.Fragment,{children:[o,(0,A.jsx)(y,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-soft-foreground`})]})]})}),(0,A.jsx)(m,{align:`start`,sideOffset:8,"data-slot":`prompt-template-menu`,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,onCloseAutoFocus:e=>e.preventDefault(),children:(0,A.jsxs)(ie,{filter:T,children:[(0,A.jsx)(re,{placeholder:`search templates…`,onInput:()=>l.current?.scrollTo(0,0)}),(0,A.jsxs)(ae,{ref:l,"data-slot":`prompt-template-list-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,A.jsx)(se,{children:`Nothing matches.`}),(0,A.jsx)(w,{heading:`Insert a template`,children:e.map(e=>(0,A.jsxs)(C,{value:`template ${e.label} ${e.id}`,keywords:[e.text,...e.skills??[]],"data-slot":`prompt-template-option`,"data-template":e.id,title:e.text,className:`flex-col items-start gap-0.5`,onSelect:()=>{t(e.text),c(!1)},children:[(0,A.jsxs)(`span`,{className:`flex w-full items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium text-foreground`,children:e.label}),e.skills&&e.skills.length>0?(0,A.jsxs)(`span`,{"data-slot":`prompt-template-assigned`,title:`Applied automatically with: ${e.skills.join(`, `)}`,className:`inline-flex shrink-0 items-center gap-0.5 text-[12px] font-medium text-accent-text`,children:[(0,A.jsx)(v,{"aria-hidden":`true`,className:`size-2.5`}),e.skills.length]}):null]}),(0,A.jsx)(`span`,{className:`line-clamp-1 text-[11px] text-soft-foreground`,children:e.text})]},e.id))}),(0,A.jsx)(oe,{}),(0,A.jsx)(w,{children:(0,A.jsx)(C,{value:`edit prompt templates settings`,"data-slot":`prompt-template-settings`,className:`text-[12px] text-muted-foreground`,onSelect:()=>{c(!1),u(`/settings/prompt-templates`)},children:`Edit templates…`})})]})]})})]})}function U({className:e,size:t=`default`,...r}){return(0,A.jsx)(F,{"data-slot":`switch`,"data-size":t,className:n(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-none transition-[color,background-color,border-color,box-shadow] outline-hidden focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-6 data-[size=default]:w-10 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-accent-strong data-[state=unchecked]:bg-input`,e),...r,children:(0,A.jsx)(L,{"data-slot":`switch-thumb`,className:n(`pointer-events-none block rounded-full bg-background ring-0 motion-safe:transition-transform group-data-[size=default]/switch:size-[18px] group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-[state=checked]:translate-x-5 group-data-[size=default]/switch:data-[state=unchecked]:translate-x-0.5 group-data-[size=sm]/switch:data-[state=checked]:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-[state=unchecked]:translate-x-0`)})})}function fe({source:e,className:t}){return(0,A.jsx)(`span`,{"data-slot":`skill-source`,"data-source":e,className:n(`shrink-0 rounded bg-accent-strong/10 px-2 py-1 text-[12px]`,E({source:e})?`font-semibold text-foreground`:`text-soft-foreground`,t),children:e===`team`?`Team`:e})}function W({skill:e,activation:t}){return(0,A.jsx)(`span`,{className:`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center`,children:(0,A.jsx)(U,{"data-slot":`skill-switch`,"data-skill":e.name,"data-repo":e.team?.repo,"data-locked":t.locked||void 0,"aria-label":t.ariaLabel,checked:t.checked,disabled:t.disabled,onCheckedChange:()=>t.onCheckedChange(),className:`relative before:absolute before:-inset-x-1 before:-inset-y-2.5 before:content-[''] disabled:cursor-default`})})}function G({skill:e,usedBy:t,activation:n,heading:r=`h2`}){return(0,A.jsxs)(`div`,{"data-slot":`skill-detail`,className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col items-start gap-4`,children:[(0,A.jsxs)(`span`,{className:`sw-detail-source text-[12px]`,children:[(0,A.jsx)(fe,{source:e.source}),` skill`]}),(0,A.jsxs)(`div`,{className:`flex w-full min-w-0 items-start justify-between gap-3`,children:[(0,A.jsx)(r,{className:`min-w-0 text-[19px] font-normal md:text-2xl break-words [overflow-wrap:anywhere]`,children:e.name}),n?(0,A.jsx)(W,{skill:e,activation:n}):null]})]}),n&&!n.checked?(0,A.jsx)(`p`,{"data-slot":`skill-inactive-notice`,className:`mt-4 rounded-md border border-border bg-background px-3 py-2 text-[13px] text-muted-foreground`,children:`Not enabled for this project — agents can’t pick it.`}):null,(0,A.jsxs)(`p`,{"data-slot":`skill-path`,className:`mt-4 text-[12px] break-all text-soft-foreground`,children:[e.path,e.team?` · from ${e.team.repo}`:``]}),e.description?(0,A.jsx)(`p`,{"data-slot":`skill-description`,className:`mt-2.5 text-[13px] text-muted-foreground`,children:e.description}):null,t===void 0?null:(0,A.jsxs)(`section`,{"data-slot":`skill-used-by`,className:`mt-5`,children:[(0,A.jsx)(`h3`,{className:`text-[13px] font-semibold`,children:`Used by`}),t.length>0?(0,A.jsx)(`ul`,{className:`mt-1.5 flex flex-col gap-1`,children:t.map(e=>(0,A.jsxs)(`li`,{className:`flex items-center gap-1.5 font-mono text-xs text-muted-foreground`,children:[(0,A.jsx)(_,{"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`}),e]},e))}):(0,A.jsx)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:`Not referenced by a workflow yet. quick-task can use it when the task mentions it.`})]}),(0,A.jsx)(`section`,{className:`mt-5`,children:(0,A.jsx)(`div`,{"data-slot":`skill-body`,className:`mt-2 text-sm`,children:(0,A.jsx)(D,{children:e.body})})})]})}function pe({skill:e,onClose:t}){return(0,A.jsx)(ee,{open:e!==null,onOpenChange:e=>e?void 0:t(),children:(0,A.jsx)(S,{"data-slot":`skill-preview`,className:`block max-h-[80dvh] overflow-y-auto sm:max-w-2xl`,children:e?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(x,{className:`sr-only`,children:e.name}),(0,A.jsx)(b,{className:`sr-only`,children:`Read-only skill preview`}),(0,A.jsx)(G,{skill:e,heading:`h3`}),(0,A.jsx)(`p`,{className:`mt-5`,children:(0,A.jsx)(ne,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-preview-manage`,onClick:t,className:`text-xs font-semibold text-accent-text hover:underline`,children:`Open in the Skills catalog`})})]}):null})})}function me({className:e,...t}){return(0,A.jsx)(`div`,{"data-slot":`skeleton`,className:n(`animate-pulse rounded-md bg-accent`,e),...t})}var he=[`assigned`,`no-task`,`has-task`,`all`],ge=[`review`,`mine`,`failing`,`all`],_e=50,K=`is:open review-requested:@me`,q=`is:open status:failure`;function ve(e,t){return e===`prs`&&(t===`review`||t===`failing`)}function ye(e){return e===`review`?K:e===`failing`?q:null}function be(e,t){return t===null?null:(e===`issues`?he:ge).includes(t)?t:`all`}function xe(e,t,n,r=``){let i=`${n===void 0?e===`issues`?`/github`:`/github/prs`:`${e===`issues`?`/github/issues`:`/github/prs`}/${n}`}${r}`;return t===null?i:`${i}?filter=${encodeURIComponent(t)}`}function Se(e,t){let n=t??`all`;return n===`all`?e===`issues`?`all`:`all-prs`:n}function Ce(e){return e===`all`?{view:`issues`,filter:`all`}:e===`all-prs`?{view:`prs`,filter:`all`}:{view:e===`review`||e===`mine`||e===`failing`?`prs`:`issues`,filter:e}}var J=[{id:`assigned`,label:`Assigned to me`},{id:`no-task`,label:`No task yet`},{id:`has-task`,label:`Has a task`},{id:`all`,label:`All open`}],Y=[{id:`review`,label:`Review requested`},{id:`mine`,label:`Mine`},{id:`failing`,label:`Checks failing`},{id:`all-prs`,label:`All open`}],X=Object.fromEntries([...J,...Y].map(e=>[e.id,e.label]));function we(e){return e===null?``:`${e.value}${e.bound===`atLeast`?`+`:``}`}function Te(e,t){if(t?.bound===`atLeast`)return e===`review`||e===`failing`?`At least ${t.value}: GitHub search returns at most ${_e} results.`:`At least ${t.value}: only the loaded pages are counted. Scroll to load more.`}var Z=(e,t)=>e!==void 0&&t!==void 0&&e.toLowerCase()===t.toLowerCase();function Ee(e){try{let t=new URL(e).pathname.split(`/`).filter(Boolean);return t.length>=2?`${t[0]}/${t[1]}`.toLowerCase():null}catch{return null}}function De(e,t,n){return new Set(e.filter(e=>!e.archived).flatMap(e=>Q(e,t,n)))}function Q(e,t,n){let r=t?.toLowerCase();return s(e,void 0,n).filter(e=>e.kind===`Issue`&&(!e.url||r!==void 0&&Ee(e.url)===r)).map(e=>e.number)}function Oe(e,t,n,r){let i=new Map;for(let a of e)!o(a)&&Q(a,n,r).includes(t)&&i.set(a.id,a);return[...i.values()].sort((e,t)=>Date.parse(t.createdAt)-Date.parse(e.createdAt)||e.id.localeCompare(t.id))}function ke(e,t){let n=new Map(t.map(e=>[e.number,e]));return e.map(e=>n.get(e.number)??e)}function $(e){return e?.available?{value:e.items.length,bound:e.truncated?`atLeast`:`exact`}:null}function Ae({gh:e,tasks:t,review:n,failing:r}){let i={assigned:null,"no-task":null,"has-task":null,all:null,review:$(n),mine:null,failing:$(r),"all-prs":null};if(!e?.available)return i;let o=!a(e,`issues`),s=!a(e,`prs`),c=(e,t)=>({value:e,bound:t?`atLeast`:`exact`}),l=t?e.issues.filter(e=>t.has(e.number)).length:null;return{...i,all:c(e.issuesTotal??e.issues.length,!1),"all-prs":c(e.prsTotal??e.prs.length,!1),assigned:e.viewerLogin?c(e.issues.filter(t=>t.assignees?.some(t=>Z(t,e.viewerLogin))).length,o):null,mine:e.viewerLogin?c(e.prs.filter(t=>Z(t.author,e.viewerLogin)).length,s):null,"has-task":l===null?null:c(l,o),"no-task":l===null?null:c(e.issues.length-l,o)}}export{H as C,U as S,ye as _,K as a,pe as b,Ce as c,ve as d,De as f,ke as g,Se as h,Y as i,we as l,be as m,q as n,Te as o,Oe as p,J as r,Ae as s,X as t,xe as u,me as v,k as w,W as x,G as y};
|