import{i as e}from"./chunk-B3pr0VN8.js";import{n as t,t as n}from"./jsx-runtime-wTfS3W87.js";import{r}from"./norm-CeclA1Tu.js";import{i,l as a,s as o}from"./LightweightCharts-CtdVXWCM.js";var s=e(t(),1),c=n(),l=(e,t,n)=>{let r=Number(e);return Number.isFinite(r)?Math.max(t,Math.min(n,r)):t};function u({out:e}){let t=e?.radar,n=Array.isArray(e?.keywords)?e.keywords:[],u=Array.isArray(e?.items)?e.items:[],d=(0,s.useMemo)(()=>u.slice(0,6).map(e=>{let t=r(e?.jobTitle)||`-`;return{label:t.length>12?`${t.slice(0,12)}…`:t,value:l(e?.score,0,100),subLabel:[r(e?.jobTitle),r(e?.company)].filter(Boolean).join(` · `),color:`rgba(17,24,39,0.68)`}}),[u]),f=(0,s.useMemo)(()=>{if(!t?.labels?.length||!t?.values?.length)return null;let e=t.labels.slice(0,8).map(e=>r(e));return{labels:e,datasets:[{label:`匹配度（0-10）`,values:t.values.slice(0,e.length).map(e=>l(e,0,10)),stroke:`rgba(17, 24, 39, 0.72)`,fill:`rgba(17, 24, 39, 0.08)`}]}},[t?.labels,t?.values]),p=(0,s.useMemo)(()=>n.slice(0,10).map(e=>({label:r(e.keyword).slice(0,18)||`-`,leftLabel:`岗位需求（0-10）`,rightLabel:`简历证据（0-10）`,leftValue:l(e.jd,0,10),rightValue:l(e.resume,0,10),leftColor:`rgba(37,99,235,0.75)`,rightColor:`rgba(16,185,129,0.75)`})),[n]),m=n.slice(0,10),h=e=>{let t=String(e||``).toLowerCase();return t===`match`?`bg-green-50 border-green-200 text-green-800`:t===`partial`?`bg-amber-50 border-amber-200 text-amber-800`:`bg-red-50 border-red-200 text-red-800`},g=e=>{let t=String(e||``).toLowerCase();return t===`match`?`匹配`:t===`partial`?`部分匹配`:`不匹配`};return!d.length&&!f&&!p.length&&!m.length?null:(0,c.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[d.length?(0,c.jsxs)(`section`,{className:`resume-theme-card rounded-2xl p-6`,children:[(0,c.jsx)(`div`,{className:`text-base font-semibold`,style:{color:`var(--resume-card-text-strong)`},children:`岗位得分`}),(0,c.jsx)(`div`,{className:`h-3`}),(0,c.jsx)(`div`,{className:`min-h-[240px]`,children:(0,c.jsx)(o,{rows:d,maxValue:100})}),(0,c.jsx)(`div`,{className:`mt-2 text-[11px]`,style:{color:`var(--resume-card-text-muted)`},children:`逐岗位生成时会逐步更新该图`})]}):null,f?(0,c.jsxs)(`section`,{className:`resume-theme-card rounded-2xl p-6`,children:[(0,c.jsx)(`div`,{className:`text-base font-semibold`,style:{color:`var(--resume-card-text-strong)`},children:`维度雷达图`}),(0,c.jsx)(`div`,{className:`h-3`}),(0,c.jsx)(`div`,{className:`min-h-[280px]`,children:(0,c.jsx)(a,{labels:f.labels,datasets:f.datasets,maxValue:10,size:300})}),(0,c.jsx)(`div`,{className:`mt-2 text-[11px]`,style:{color:`var(--resume-card-text-muted)`},children:`0-10 分：越高表示证据/匹配度越强（缺少事实会提示【待补充】）`})]}):null,p.length?(0,c.jsxs)(`section`,{className:`resume-theme-card rounded-2xl p-6`,children:[(0,c.jsx)(`div`,{className:`text-base font-semibold`,style:{color:`var(--resume-card-text-strong)`},children:`关键词对比`}),(0,c.jsx)(`div`,{className:`h-3`}),(0,c.jsx)(`div`,{className:`min-h-[280px]`,children:(0,c.jsx)(i,{rows:p,maxValue:10})}),(0,c.jsx)(`div`,{className:`mt-2 text-[11px]`,style:{color:`var(--resume-card-text-muted)`},children:`岗位需求来自 JD 关键词提炼；简历证据来自简历文本可见信息`})]}):null,m.length?(0,c.jsxs)(`section`,{className:`resume-theme-card lg:col-span-2 rounded-2xl p-6`,children:[(0,c.jsx)(`div`,{className:`text-base font-semibold`,style:{color:`var(--resume-card-text-strong)`},children:`匹配热力表`}),(0,c.jsx)(`div`,{className:`h-3`}),(0,c.jsx)(`div`,{className:`overflow-auto`,children:(0,c.jsxs)(`div`,{className:`min-w-[520px]`,children:[(0,c.jsxs)(`div`,{className:`grid grid-cols-12 gap-2 text-[11px] font-semibold`,style:{color:`var(--resume-card-text-muted)`},children:[(0,c.jsx)(`div`,{className:`col-span-4`,children:`关键词`}),(0,c.jsx)(`div`,{className:`col-span-2 text-center`,children:`岗位`}),(0,c.jsx)(`div`,{className:`col-span-2 text-center`,children:`简历`}),(0,c.jsx)(`div`,{className:`col-span-2 text-center`,children:`状态`}),(0,c.jsx)(`div`,{className:`col-span-2`,children:`备注`})]}),(0,c.jsx)(`div`,{className:`h-2`}),(0,c.jsx)(`div`,{className:`space-y-2`,children:m.map((e,t)=>(0,c.jsxs)(`div`,{className:`grid grid-cols-12 gap-2 items-start text-sm`,children:[(0,c.jsx)(`div`,{className:`col-span-4 font-semibold truncate`,style:{color:`var(--resume-card-text-strong)`},children:r(e.keyword)||`-`}),(0,c.jsx)(`div`,{className:`col-span-2 text-center`,style:{color:`var(--resume-card-text-body)`},children:l(e.jd,0,10)}),(0,c.jsx)(`div`,{className:`col-span-2 text-center`,style:{color:`var(--resume-card-text-body)`},children:l(e.resume,0,10)}),(0,c.jsx)(`div`,{className:`col-span-2 flex justify-center`,children:(0,c.jsx)(`span`,{className:`px-2 h-6 inline-flex items-center rounded-full border text-[11px] font-extrabold ${h(e.match)}`,children:g(String(e.match||``))})}),(0,c.jsx)(`div`,{className:`col-span-2 text-[11px] leading-relaxed`,style:{color:`var(--resume-card-text-muted)`},children:String(e.note||``).trim()?String(e.note).trim().slice(0,160):`—`})]},`${t}-${e.keyword}`))})]})})]}):null]})}export{u as default};