1import{n as e,o as t}from"./rolldown-runtime-CMxvf4Kt.js";import{Ao as n,jo as r}from"./app-const-BzFqCjOv.js";import{Do as i,bo as a,to as o,vo as s,wo as c,z as l}from"./ScrollArea-CdDxdn_v.js";import{I as u,Ki as d,ir as f,n as p,qn as m}from"./es-D7HWafs1.js";import{at as h,n as g}from"./es-D3_QMuVV.js";import{Dh as _,Gd as v,Ld as y,et as b,jh as x,pf as S}from"../vendor/vendor-icons-BXJMWD35.js";var C,w,T,E,D=e((()=>{p(),a(),C=t(r()),w=t(n()),T=28,E=(0,C.memo)(({rows:e=8,showRootFile:t=!0})=>{let n=Array.from({length:e},(e,t)=>t);return(0,w.jsxs)(s,{gap:2,children:[t&&(0,w.jsxs)(s,{horizontal:!0,align:`center`,gap:6,height:T,paddingInline:8,children:[(0,w.jsx)(m.Button,{active:!0,size:`small`,style:{borderRadius:i.borderRadius,height:14,minWidth:14,width:14}}),(0,w.jsx)(m.Button,{active:!0,size:`small`,style:{borderRadius:i.borderRadius,height:16,minWidth:80,opacity:.6,width:`40%`}})]}),n.map(e=>{let t=e%3,n=`${40+e*13%45}%`;return(0,w.jsxs)(s,{horizontal:!0,align:`center`,gap:6,height:T,paddingInline:8,style:{paddingInlineStart:8+t*16},children:[(0,w.jsx)(m.Button,{active:!0,size:`small`,style:{borderRadius:i.borderRadius,height:14,minWidth:14,width:14}}),(0,w.jsx)(m.Button,{active:!0,size:`small`,style:{borderRadius:i.borderRadius,height:16,minWidth:70,opacity:.55,width:n}})]},e)})]})}),E.displayName=`FileTreeSkeleton`})),O,k,A,j,M,N=e((()=>{p(),g(),a(),b(),O=t(r()),k=t(n()),D(),A=c(({css:e,cssVar:t})=>({item:e` 2 cursor: pointer; 3 4 display: flex; 5 gap: 6px; 6 align-items: center; 7 8 padding-block: 6px; 9 padding-inline-end: 8px; 10 border-radius: 6px; 11 12 font-size: 13px; 13 line-height: 1.4; 14 15 &:hover { 16 background: ${t.colorFillTertiary}; 17 } 18 `,itemSelected:e` 19 color: ${t.colorPrimary}; 20 background: ${t.colorFillSecondary}; 21 `,label:e` 22 overflow: hidden; 23 text-overflow: ellipsis; 24 white-space: nowrap; 25 `,editingInput:e` 26 margin: 0 !important; 27 padding: 0 !important; 28 border: none !important; 29 30 font-size: 13px !important; 31 line-height: 1.4 !important; 32 33 background: transparent !important; 34 outline: none !important; 35 box-shadow: none !important; 36 `,editingInputRoot:e` 37 margin: 0 !important; 38 padding: 0 !important; 39 border: none !important; 40 border-radius: 0 !important; 41 42 background: transparent !important; 43 box-shadow: none !important; 44 `})),j=(0,O.memo)(({node:e,depth:t,selectedFile:n,onSelectFile:r,expandedFolders:i,onToggleFolder:a,getFileContextMenuItems:s,editableFilePath:c,onCancelRenameFile:u,onCommitRenameFile:d})=>{let f=e.type===`directory`,p=i.has(e.path),m=!f&&n===e.path,g=!f&&c===e.path&&!!d,[b,C]=(0,O.useState)(e.name),w=(0,O.useRef)(null),T=(0,O.useRef)(!1);(0,O.useEffect)(()=>{g&&(C(e.name),requestAnimationFrame(()=>{w.current?.focus?.(),w.current?.select?.()}))},[g,e.name]);let E=()=>{g||(f?a(e.path):r(e.path))},D=(0,O.useCallback)(()=>{C(e.name),u?.()},[e.name,u]),M=(0,O.useCallback)(async()=>{if(!g||!d||T.current)return;let t=b.trim();if(t===e.name){D();return}T.current=!0;try{await d({name:e.name,path:e.path},t),u?.()}finally{T.current=!1}},[b,D,g,e.name,e.path,u,d]),N=!f&&!g?s?.({name:e.name,path:e.path}):void 0,P=(0,k.jsxs)(`div`,{className:`${A.item} ${m?A.itemSelected:``}`,style:{paddingInlineStart:8+t*16},title:e.path,onClick:E,children:[f&&(0,k.jsx)(o,{icon:p?x:_,size:14}),!f&&(0,k.jsx)(`span`,{style:{flexShrink:0,width:14}}),(0,k.jsx)(o,{icon:f?p?v:y:S,size:16}),g?(0,k.jsx)(h,{classNames:{input:A.editingInput,root:A.editingInputRoot},ref:w,value:b,variant:`borderless`,onBlur:()=>void M(),onChange:e=>C(e.target.value),onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&(e.preventDefault(),e.currentTarget.blur(),M()),e.key===`Escape`&&(e.preventDefault(),D())}}):(0,k.jsx)(`span`,{className:A.label,children:e.name})]});return(0,k.jsxs)(k.Fragment,{children:[!f&&N&&N.length>0?(0,k.jsx)(l,{items:N,children:P}):P,f&&p&&e.children?.map(e=>(0,k.jsx)(j,{depth:t+1,editableFilePath:c,expandedFolders:i,getFileContextMenuItems:s,node:e,selectedFile:n,onCancelRenameFile:u,onCommitRenameFile:d,onSelectFile:r,onToggleFolder:a},e.path))]})}),j.displayName=`TreeNode`,M=(0,O.memo)(({resourceTree:e,rootFile:t,selectedFile:n,onSelectFile:r,getFileContextMenuItems:i,editableFilePath:a,onCancelRenameFile:s,onCommitRenameFile:c})=>{let[u,d]=(0,O.useState)(()=>new Set);(0,O.useEffect)(()=>{let t=new Set,n=e=>{for(let r of e)r.type===`directory`&&(t.add(r.path),r.children&&n(r.children))};n(e),d(t)},[e]);let f=(0,O.useCallback)(e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),p=t===void 0?`SKILL.md`:t?.path,m=t===void 0?`SKILL.md`:t?.label,h=!!p&&n===p,g=(0,O.useMemo)(()=>e.length>0,[e]),_=(0,O.useMemo)(()=>p&&m?i?.({name:m,path:p}):void 0,[i,m,p]),v=p&&m&&(0,k.jsxs)(`div`,{className:`${A.item} ${h?A.itemSelected:``}`,style:{paddingInlineStart:8},onClick:()=>r(p),children:[(0,k.jsx)(`span`,{style:{flexShrink:0,width:14}}),(0,k.jsx)(o,{icon:S,size:16}),(0,k.jsx)(`span`,{className:A.label,children:m})]});return(0,k.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[v&&_&&_.length>0?(0,k.jsx)(l,{items:_,children:v}):v,g&&e.map(e=>(0,k.jsx)(j,{depth:0,editableFilePath:a,expandedFolders:u,getFileContextMenuItems:i,node:e,selectedFile:n,onCancelRenameFile:s,onCommitRenameFile:c,onSelectFile:r,onToggleFolder:f},e.path))]})}),M.displayName=`FileTree`})),P,F,I,L,R,z,B,V=e((()=>{p(),a(),P=t(r()),F=t(n()),I=c(({css:e,cssVar:t})=>({codeWrapper:e` 45 position: relative; 46 overflow-x: auto; 47 margin-block-start: 16px; 48 padding-block-end: calc(100cqb - 1lh); 49 50 pre { 51 margin: 0; 52 } 53 54 code { 55 counter-reset: line; 56 } 57 58 .line { 59 width: 100% !important; 60 margin-inline: 0 !important; 61 padding-inline: 0 !important; 62 } 63 64 .line::before { 65 content: counter(line); 66 counter-increment: line; 67 user-select: none; 68 69 display: inline-block; 70 71 width: 4ch; 72 margin-inline-end: 2ch; 73 74 color: ${t.colorTextQuaternary}; 75 text-align: end; 76 } 77 `,docWrapper:e` 78 max-width: 798px; 79 margin-inline: auto; 80 padding-block: 8px; 81 padding-inline: 24px; 82 `})),L=e=>{switch(e.toLowerCase().split(`.`).pop()){case`js`:case`mjs`:case`cjs`:return`javascript`;case`ts`:return`typescript`;case`tsx`:return`tsx`;case`jsx`:return`jsx`;case`py`:case`pyw`:return`python`;case`java`:return`java`;case`go`:return`go`;case`rs`:return`rust`;case`rb`:return`ruby`;case`sh`:case`bash`:case`zsh`:return`bash`;case`html`:case`htm`:return`html`;case`css`:return`css`;case`scss`:return`scss`;case`json`:return`json`;case`xml`:return`xml`;case`yaml`:case`yml`:return`yaml`;case`toml`:return`toml`;case`md`:case`mdx`:return`markdown`;case`sql`:return`sql`;case`c`:case`h`:return`c`;case`cpp`:case`cxx`:case`cc`:case`hpp`:return`cpp`;case`cs`:return`csharp`;case`swift`:return`swift`;case`kt`:case`kts`:return`kotlin`;case`lua`:return`lua`;case`dart`:return`dart`;case`graphql`:case`gql`:return`graphql`;default:return`txt`}},R=e=>{let t=e.toLowerCase().split(`.`).pop();return t===`md`||t===`mdx`},z=e=>{if(!e)return{body:``};let t=e.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);return t?{body:t[2],frontmatter:t[1]}:{body:e}},B=(0,P.memo)(({skillDetail:e,selectedFile:t,contentMap:n,liveContent:r})=>{if(t===`SKILL.md`){let t=r??e?.content;if(!t)return(0,F.jsx)(`div`,{className:I.docWrapper,children:(0,F.jsx)(`p`,{style:{opacity:.45},children:`No content`})});let{frontmatter:n,body:i}=z(t);return(0,F.jsxs)(`div`,{className:I.docWrapper,children:[n&&(0,F.jsx)(f,{fullFeatured:!0,language:`yaml`,variant:`outlined`,children:n}),(0,F.jsx)(u,{variant:`chat`,children:i})]})}let i=n[t];if(R(t)){let{frontmatter:e,body:t}=z(i);return(0,F.jsxs)(`div`,{className:I.docWrapper,children:[e&&(0,F.jsx)(f,{fullFeatured:!0,language:`yaml`,variant:`outlined`,children:e}),(0,F.jsx)(u,{variant:`chat`,children:t})]})}return(0,F.jsxs)(`div`,{className:I.codeWrapper,children:[(0,F.jsx)(d,{content:i,style:{position:`absolute`,right:8,top:0,zIndex:1}}),(0,F.jsx)(f,{copyable:!1,language:L(t),showLanguage:!1,variant:`borderless`,children:i})]})}),B.displayName=`ContentViewer`}));export{E as a,N as i,V as n,D as o,M as r,B as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.