import{O as e}from"./vendor-markdown-DngssFHR.js";import{Q as t,Y as n,_ as r,it as i,nt as a,pt as o,q as s}from"./vendor-mui-Ckcy4Lfd.js";import{c,i as l,n as u,r as d,s as f}from"./client-BR2IEG0B.js";import{G as p}from"./vendor-mui-icons-606Bohdn.js";import{_ as m,g as h}from"./ui-BLXHSX1T.js";function g(e,t){return d(`/projects/${e}/skills${u({source:t?.source,tag:t?.tag,limit:t?.limit,offset:t?.offset})}`).then(c)}function _(e,t){return d(`/projects/${e}/skills/${t}`)}function v(e,t){return d(`/projects/${e}/skills`,{method:`POST`,body:JSON.stringify(t)})}function y(e,t,n){return d(`/projects/${e}/skills/${t}`,{method:`PUT`,body:JSON.stringify(n)})}function b(e,t){return d(`/projects/${e}/skills/${t}`,{method:`DELETE`})}function x(e,t,n){return d(`/projects/${e}/skills/search${u({q:t,topK:n?.topK,minScore:n?.minScore})}`).then(f)}function S(e,t){return d(`/projects/${e}/skills/links`,{method:`POST`,body:JSON.stringify(t)})}function C(e,t){return d(`/projects/${e}/skills/links`,{method:`DELETE`,body:JSON.stringify(t)})}function w(e,t){return d(`/projects/${e}/skills/${t}/relations`).then(f)}function T(e,t){return d(`/projects/${e}/skills/${t}/attachments`).then(f)}async function E(e,t,n){let r=new FormData;return r.append(`file`,n),l(`/projects/${e}/skills/${t}/attachments`,r)}function D(e,t,n){return d(`/projects/${e}/skills/${t}/attachments/${encodeURIComponent(n)}`,{method:`DELETE`})}function O(e,t,n){return`/api/projects/${e}/skills/${t}/attachments/${encodeURIComponent(n)}`}var k={user:`primary`,learned:`warning`};function A(e){return e===`learned`?`Learned`:`User`}function j(e){return`${Math.round(e*100)}%`}var M=e();function N({skill:e,score:c,onClick:l,onEdit:u}){let{palette:d}=o();return(0,M.jsx)(n,{variant:`outlined`,sx:{cursor:l?`pointer`:`default`,"&:hover":l?{borderColor:`primary.main`}:{}},onClick:l,children:(0,M.jsx)(s,{sx:{py:1.5,px:2,"&:last-child":{pb:1.5}},children:(0,M.jsxs)(t,{sx:{display:`flex`,alignItems:`flex-start`,gap:1},children:[(0,M.jsxs)(t,{sx:{flex:1,minWidth:0},children:[(0,M.jsxs)(t,{sx:{display:`flex`,alignItems:`center`,gap:1,mb:.25},children:[(0,M.jsx)(a,{variant:`subtitle1`,fontWeight:600,noWrap:!0,sx:{flex:1},children:e.title}),(0,M.jsx)(m,{label:A(e.source),color:k[e.source]??`primary`,size:`small`}),(0,M.jsx)(m,{label:j(e.confidence),color:`neutral`,size:`small`}),c!==void 0&&(0,M.jsx)(m,{label:`${(c*100).toFixed(0)}%`,color:`primary`,size:`small`})]}),e.description&&(0,M.jsx)(a,{variant:`body2`,sx:{color:d.custom.textMuted},noWrap:!0,children:e.description}),(0,M.jsxs)(t,{sx:{display:`flex`,alignItems:`center`,gap:1,mt:.5},children:[e.usageCount>0&&(0,M.jsxs)(a,{variant:`caption`,sx:{color:d.custom.textMuted},children:[`Used `,e.usageCount,` time`,e.usageCount===1?``:`s`]}),e.tags?.length>0&&(0,M.jsx)(h,{tags:e.tags})]})]}),u&&(0,M.jsx)(r,{title:`Edit`,children:(0,M.jsx)(i,{size:`small`,onClick:e=>{e.stopPropagation(),u()},children:(0,M.jsx)(p,{fontSize:`small`})})})]})})})}export{E as _,v as a,D as c,T as d,w as f,y as g,O as h,A as i,C as l,x as m,k as n,S as o,g as p,j as r,b as s,N as t,_ as u};