const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cloudWorkspaceReports-Dmj54Z_p.js","assets/norm-f7iXVy-b.js","assets/appConfig-CDeG57c-.js","assets/jsx-runtime-CutOxEx1.js","assets/cloudWorkspaceClient-CCTm89GG.js","assets/preload-helper-DzyYoeor.js","assets/authSession-Dulxhbeq.js"])))=>i.map(i=>d[i]);
import{a as e,n as t,t as n}from"./jsx-runtime-CutOxEx1.js";import{t as r}from"./preload-helper-DzyYoeor.js";import{d as i}from"./chunk-6CSD65Y2-BjfinoX-.js";import{a,i as o,s}from"./runtimeTheme-Cf77mCZn.js";import{r as c}from"./authSession-Dulxhbeq.js";import{r as l}from"./norm-f7iXVy-b.js";import{f as u,g as d}from"./cloudModel-CkCu0fP6.js";import{n as f}from"./llmSettings-8VBl-FQI.js";import{t as p}from"./resumeAiConsent-3fYgyUHE.js";import{t as m}from"./exportDomPng-7Vd6Q3rW.js";import{l as h,t as g}from"./LightweightCharts-BjMkXZNH.js";import{t as _}from"./PlatformTokenUsage-BOBT9r1m.js";import{n as v,r as y,t as b}from"./FallbackNoticeCard-huoe2-vu.js";import{i as x}from"./llm-DjSVhhgj.js";import{t as S}from"./resumePdfPipeline-BPJNK1TB.js";import{a as ee,c as te,i as ne,l as re,n as ie,s as C,t as w,u as ae}from"./toolRuntime-CFu8ZbRX.js";import{n as T,r as oe,t as se}from"./ToolSidebarNav-Py6lZOex.js";import{i as ce,r as le}from"./ToolConversationBilling-DMVcVppo.js";import{n as ue}from"./aiResumeMatch-Cv_oifLl.js";import{n as de}from"./taskPointGuard-DQLlEFVj.js";import{n as fe,t as pe}from"./toolSkillSummary-BaaCQSOG.js";import{t as me}from"./resumeMatchCloudSummary-gxGVeodb.js";import{a as he,i as ge,n as _e,r as ve,t as ye}from"./ResumeMatchInsightsPanel-CHmkIzHF.js";import{n as be,r as E}from"./ToolConversationPersistence-BXOyFMX0.js";import{t as xe}from"./ToolConversationExecution-Do6biEtR.js";import{n as Se,t as Ce}from"./useToolRunState-BASJ0aoE.js";import{t as we}from"./JdBuzzwordDetector-nBzVD84Q.js";import{t as Te}from"./ToolRunStatus-Bmkja9xq.js";import{n as Ee,t as De}from"./useRestoredFieldsHighlight-VU80wh2Z.js";import{t as D}from"./AgentTaskPanel-r78PUiyK.js";import{t as Oe}from"./FilePicker-6mDBFbRF.js";var O=e(t(),1),k=n(),ke=`deepseek`,Ae=`deepseek`,je=`deepseek-v4-flash`,Me=e=>{let t=String(e||``).replace(/\r\n/g,`
`).trim();if(!t||/该步骤未返回可用结构化结果|系统将继续基于其他已完成信息完成总结/i.test(t))return``;let n=l(t.match(/^【([^】]+)】/)?.[1]||``),r=Array.from(t.matchAll(/<think>([\s\S]*?)<\/think>/gi)).map(e=>l(e?.[1]||``)).filter(Boolean);return r.length?[n?`【${n}】`:``,r.join(`

`)].filter(Boolean).join(`
`):``},A=e=>{let t=String(e||``).replace(/\r\n/g,`
`).trim();if(!t)return``;let n=t.split(`
`),r=0;for(;r<n.length;){let e=String(n[r]||``).trim();if(!e){r+=1;continue}if(!/工具调用|技术问题|技术性错误|波动|异常|请放心查阅|感谢你的耐心等待|综合分析报告|最终综合报告|深度匹配分析报告/i.test(e))break;r+=1}return n.slice(r).join(`
`).trim()},Ne=(e,t)=>{let n=l(e),r=l(t);return!n&&!r?``:`${n}::${r}`},Pe=()=>{try{let e=new Uint8Array(12);return crypto.getRandomValues(e),Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}catch{return`${Math.random().toString(16).slice(2)}${Date.now().toString(16)}`.slice(0,24)}},j=e=>{let t={title:``,summary:``,fit:``,scoreText:``,overallScoreText:``,objectiveScoreText:``,subjectiveScoreText:``,strengths:[],gaps:[],actions:[],highlights:[],gapsSummary:[],keywords:[],radarLabels:[],radarValues:[]},n=(e,t)=>{let n=String(t||``).trim();n&&(e.includes(n)||e.push(n))},r=String(e||``).replace(/\r\n/g,`
`).split(`
`),i=``,a=(e,n)=>{let r=String(n||``).trim();r&&(t[e]=r)},o=e=>{let t=String(e||``);if(!t)return``;try{return JSON.parse(`"${t.replace(/"/g,`\\"`)}"`)}catch{}return t.replace(/\\"/g,`"`).replace(/\\\\/g,`\\`).replace(/\\n/g,`
`).replace(/\\t/g,`	`)},s=(e,t)=>{let n=RegExp(`"${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}"\\s*:`,`i`).exec(e);return n?n.index+n[0].length:-1},c=(e,t)=>{let n=t;for(;n<e.length&&/\s/.test(e[n]);)n+=1;return n},l=(e,t,n=!1)=>{let r=c(e,s(e,t));if(r<0||e[r]!==`"`)return``;r+=1;let i=!1,a=``;for(;r<e.length;r+=1){let t=e[r];if(i){a+=`\\${t}`,i=!1;continue}if(t===`\\`){i=!0;continue}if(t===`"`)return o(a);a+=t}return n?o(a):``},u=(e,t)=>{let n=s(e,t);if(n<0)return``;let r=e.slice(n).match(/^\s*(-?\d+(?:\.\d+)?)/);return r?String(r[1]||``).trim():``},d=(e,t,r=12)=>{let i=c(e,s(e,t)),a=[];if(i<0||e[i]!==`[`)return a;for(i+=1;i<e.length&&a.length<r&&(i=c(e,i),e[i]!==`]`);){if(e[i]!==`"`){i+=1;continue}i+=1;let t=!1,r=``,s=!1;for(;i<e.length;i+=1){let n=e[i];if(t){r+=`\\${n}`,t=!1;continue}if(n===`\\`){t=!0;continue}if(n===`"`){s=!0,i+=1;break}r+=n}let c=o(r).trim();if(c&&(s||c.length>=4)&&n(a,c),!s)break}return a},f=(e,t,r=12)=>{let i=[],a=RegExp(`"${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}"\\s*:\\s*"`,`gi`),s;for(;(s=a.exec(e))&&i.length<r;){let t=!1,r=``,c=s.index+s[0].length;for(;c<e.length;c+=1){let n=e[c];if(t){r+=`\\${n}`,t=!1;continue}if(n===`\\`){t=!0;continue}if(n===`"`)break;r+=n}r&&n(i,o(r)),a.lastIndex=Math.max(a.lastIndex+1,c+1)}return i},p=(e,t,n=12)=>{let r=c(e,s(e,t));if(r<0||e[r]!==`[`)return[];let i=e.indexOf(`]`,r);return(e.slice(r+1,i>=0?i:e.length).match(/-?\d+(?:\.\d+)?/g)||[]).slice(0,n).map(e=>String(e||``).trim()).filter(Boolean)};for(let e of r){let r=String(e||``).trim();if(!r||/^[\s,]*[{\[\]}][\s,]*$/.test(r))continue;let o=r.match(/^\s*["']?([A-Za-z_][\w-]*)["']?\s*:\s*(.*)$/);if(o){let e=String(o[1]||``).trim(),r=String(o[2]||``).trim(),s=e.toLowerCase();if(s===`summary`){i=`summary`;let e=r.match(/^["']([\s\S]*?)["']\s*,?\s*$/);e&&a(`summary`,e[1])}else if(s===`fit`){i=`fit`;let e=r.match(/^["']([\s\S]*?)["']\s*,?\s*$/);e&&a(`fit`,e[1])}else if(s===`title`){i=`title`;let e=r.match(/^["']([\s\S]*?)["']\s*,?\s*$/);e&&a(`title`,e[1])}else if(s===`score`||s===`overallscore`||s===`objectivescore`||s===`subjectivescore`){let e=r.match(/^([0-9]+(?:\.[0-9]+)?)\s*,?\s*$/);if(e){let t=String(e[1]||``).trim();a(s===`score`?`scoreText`:s===`overallscore`?`overallScoreText`:s===`objectivescore`?`objectiveScoreText`:`subjectiveScoreText`,t)}i=``}else if(s===`strengths`)i=`strengths`;else if(s===`gaps`)i=`gaps`;else if(s===`actions`)i=`actions`;else if(s===`highlights`)i=`highlights`;else if(s===`gapssummary`)i=`gapsSummary`;else if(s===`keywords`)i=`keywords`;else if(s===`keyword`){i=`keywords`;let e=r.match(/^["']([\s\S]*?)["']\s*,?\s*$/);e&&n(t.keywords,e[1])}else i=s===`labels`?`radarLabels`:s===`values`?`radarValues`:``;continue}let s=r.match(/^\s*["']([\s\S]*?)["']\s*,?\s*$/);if(s){let e=String(s[1]||``).trim();if(!e)continue;i===`strengths`?n(t.strengths,e):i===`gaps`?n(t.gaps,e):i===`actions`?n(t.actions,e):i===`highlights`?n(t.highlights,e):i===`gapsSummary`?n(t.gapsSummary,e):i===`keywords`?n(t.keywords,e):i===`radarLabels`&&n(t.radarLabels,e);continue}let c=r.match(/^\s*([0-9]+(?:\.[0-9]+)?)\s*,?\s*$/);if(c&&i===`radarValues`){n(t.radarValues,String(c[1]||``).trim());continue}r.includes(`:`)||/["{}\[\]]/.test(r)&&(r.match(/[A-Za-z\u4e00-\u9fa5]/g)||[]).length}let m=String(e||``);a(`title`,t.title||l(m,`title`,!0)),a(`summary`,t.summary||l(m,`summary`,!0)),a(`fit`,t.fit||l(m,`fit`,!0)),a(`scoreText`,t.scoreText||u(m,`score`)),a(`overallScoreText`,t.overallScoreText||u(m,`overallScore`)),a(`objectiveScoreText`,t.objectiveScoreText||u(m,`objectiveScore`)),a(`subjectiveScoreText`,t.subjectiveScoreText||u(m,`subjectiveScore`));for(let e of d(m,`strengths`))n(t.strengths,e);for(let e of d(m,`gaps`))n(t.gaps,e);for(let e of d(m,`actions`))n(t.actions,e);for(let e of d(m,`highlights`))n(t.highlights,e);for(let e of d(m,`gapsSummary`))n(t.gapsSummary,e);for(let e of f(m,`keyword`))n(t.keywords,e);for(let e of d(m,`labels`,8))n(t.radarLabels,e);for(let e of p(m,`values`,8))n(t.radarValues,e);return t},Fe=e=>{let t=String(e||``).replace(/\r\n/g,`
`);if(!t.trim())return``;let n=t.split(`
`),r=[];for(let e of n){let t=String(e||``).trimEnd(),n=t.replace(/\s+/g,``);if(!n){r.length&&r[r.length-1]!==``&&r.push(``);continue}/^`{3,}/.test(n)||/(^|[^a-z])\{.*"lang"\s*:\s*"zh-CN"/i.test(t)||/output_schema|response_format|compact_json|max_tokens|prompt_tokens/i.test(t)||r.push(t)}let i=r.join(`
`).replace(/\n{3,}/g,`

`).trim();return/^[\d\s.,;:，。；：-]+$/.test(i)?``:i.length<t.length*.15?t:i},Ie=(e,t)=>{let n=String(e||``),r=String(t||``);if(!r)return n;if(!n)return r;if(r===n)return n;if(r.startsWith(n))return r;if(n.startsWith(r))return n;let i=Math.min(n.length,r.length);for(let e=i;e>=1;e--)if(n.slice(-e)===r.slice(0,e))return n+r.slice(e);return`${n}${r}`},M=e=>{let t=Number(e||0);if(!Number.isFinite(t)||t<=0)return``;let n=Math.max(1,Math.round(t/1e3));if(n<60)return`${n} 秒`;let r=Math.floor(n/60),i=n%60;return i?`${r} 分 ${i} 秒`:`${r} 分`},Le=e=>{let t=l(e).toLowerCase();return t===`resume_match`?`匹配分析`:t===`jd_analysis`?`岗位解析`:t===`resume_optimize`?`改写建议`:t===`interview_coach`?`题目生成`:l(e)||`处理中`},Re=e=>A(e)||String(e||``).replace(/\r\n/g,`
`).trim(),ze=(e,t)=>{let n=Re(e);if(!n)return null;let r=j(n),i=n.split(/\r?\n/).map(e=>l(e).replace(/^#{1,6}\s*/,``).replace(/^\*\*(.+)\*\*$/,`$1`)).filter(Boolean),a=i.filter(e=>/^(\d+[\.\)]|[-•])\s*/.test(e)).map(e=>e.replace(/^(\d+[\.\)]|[-•])\s*/,``)).filter(Boolean),o=i.filter(e=>!/^(\d+[\.\)]|[-•])\s*/.test(e)),s=e=>{let t=String(e||``).trim();if(!t)return;let n=Number(t);return Number.isFinite(n)?Math.max(0,Math.min(100,Math.round(n))):void 0},c=s(r.overallScoreText||r.scoreText),u=s(r.objectiveScoreText),d=s(r.subjectiveScoreText),f=r.summary||o.slice(0,3).join(`
`),p=r.fit||o[0]||(n.length>20?`已生成匹配分析`:`未返回有效结果`),m=r.radarLabels.slice(0,8),h=r.radarValues.slice(0,m.length).map(e=>Number(e)).filter(e=>Number.isFinite(e)).map(e=>Math.max(0,Math.min(10,e)));return/异常|错误|失败|无法连接|限制|波动/i.test(n),{lang:`zh-CN`,title:r.title||`简历匹配`,summary:f||p,overallScore:c,objectiveScore:u,subjectiveScore:d,radar:m.length&&h.length?{labels:m,values:h}:void 0,keywords:r.keywords.length?r.keywords.map(e=>({keyword:e,jd:0,resume:0,match:`partial`,note:``})):[],highlights:r.highlights.length?r.highlights:o.slice(0,6),gapsSummary:r.gapsSummary,items:[{jobId:`agent_fallback`,jobTitle:l(t.jobTitle)||`目标岗位`,company:l(t.company)||`当前岗位`,score:c??0,fit:p,strengths:r.strengths,gaps:r.gaps,actions:r.actions.length?r.actions:a.slice(0,6)}],caveats:[]}},Be=(e,t)=>{let n=e&&typeof e==`object`?e:null,r=e=>{let t=Number(e);if(Number.isFinite(t))return Math.max(0,Math.min(100,Math.round(t)))},i=(e,t=12)=>Array.isArray(e)?e.map(e=>l(e)).filter(Boolean).slice(0,t):[],a=(Array.isArray(n?.items)?n.items:[]).map(e=>({jobId:l(e?.jobId),jobTitle:l(e?.jobTitle)||l(t.jobTitle)||`目标岗位`,company:l(e?.company)||l(t.company)||`当前岗位`,score:r(e?.score)??0,fit:l(e?.fit),strengths:i(e?.strengths),gaps:i(e?.gaps),actions:i(e?.actions)})).filter(e=>e.jobId||e.jobTitle||e.company||e.fit||e.strengths.length||e.gaps.length||e.actions.length);if(!a.length)return null;let o=a.reduce((e,t)=>Number(t.score||0)>Number(e?.score||-1)?t:e,a[0]),s=r(n?.overallScore)??r(o?.score),c=r(n?.objectiveScore)??s,u=r(n?.subjectiveScore)??s,d=l(n?.summary)||l(o?.fit)||`已基于当前返回内容生成匹配结论。`,f=l(n?.title)||`简历匹配`,p=i(n?.radar?.labels,8),m=Array.isArray(n?.radar?.values)?n.radar.values.map(e=>Number(e)).filter(e=>Number.isFinite(e)).slice(0,p.length).map(e=>Math.max(0,Math.min(10,e))):[],h=Array.isArray(n?.keywords)?n.keywords.map(e=>{let t=l(e?.keyword);return t?{keyword:t,jd:Math.max(0,Math.min(10,Number(e?.jd||0)||0)),resume:Math.max(0,Math.min(10,Number(e?.resume||0)||0)),match:l(e?.match)||`partial`,note:l(e?.note)}:null}).filter(Boolean).slice(0,12):[];return{lang:`zh-CN`,title:f,summary:d,overallScore:s,objectiveScore:c,subjectiveScore:u,focus:o?{jobId:l(o.jobId),jobTitle:l(o.jobTitle),company:l(o.company)}:void 0,radar:p.length&&m.length?{labels:p,values:m}:void 0,keywords:h,highlights:i(n?.highlights,6).length?i(n?.highlights,6):o?.strengths.slice(0,6),gapsSummary:i(n?.gapsSummary,6).length?i(n?.gapsSummary,6):o?.gaps.slice(0,6),riskSignals:i(n?.riskSignals,6),interviewQuestions:i(n?.interviewQuestions,8),items:a,caveats:i(n?.caveats,10)}},Ve=e=>{let t=`web_${Math.random().toString(16).slice(2)}`,n=l(e.title)||`（未命名岗位）`,r=l(e.company)||`（未填写公司）`,i=l(e.url)||`https://bysjob.com`,a=l(e.jd),o=l(e.requirements);return{id:t,pool:`jobseeker`,title:n,company:r,salary:{min:0,max:0,currency:`CNY`,text:``},description:o&&!a.includes(o)?`${a}\n\n岗位要求：\n${o}`:a,url:i,platform:`import`,tags:[],created_at:Date.now(),updated_at:Date.now()}};function He(){let[e,t]=(0,O.useState)(null),[n,a]=(0,O.useState)(``),[o]=i();(0,O.useEffect)(()=>{if(o.get(`cc_ref`)!==`career_coach`)return;let e=o.get(`cc_resume`)||``;e&&a(t=>t||e)},[]);let[s,m]=(0,O.useState)(``),[h,g]=(0,O.useState)(``),[_,v]=(0,O.useState)(``),[y,b]=(0,O.useState)(``),[T,oe]=(0,O.useState)(``),[se,he]=(0,O.useState)(!1),[ge,_e]=(0,O.useState)([]),ve=(0,O.useRef)(!1),ye=(0,O.useRef)(!1),xe=(0,O.useRef)(!1),we=(0,O.useRef)(!1),Te=(0,O.useRef)(!1),[Ee,D]=(0,O.useState)(!1),[Oe,A]=(0,O.useState)(``),[He,Ue]=(0,O.useState)([]),{runState:N,progress:We,setProgress:Ge,setRunState:Ke,start:qe,partial:Je,done:Ye,failByMessage:Xe}=Se(),[P,F]=(0,O.useState)(null),[Ze,Qe]=(0,O.useState)(null),[$e,I]=(0,O.useState)(``),[et,tt]=(0,O.useState)(``),{restoredFields:L,setRestoredFields:nt,isRestored:rt,hasRestored:it}=De(),at=(0,O.useRef)(null),ot=(0,O.useRef)(null),st=(0,O.useRef)(null),ct=(0,O.useRef)(null),lt=(0,O.useRef)(null),R=(0,O.useRef)(0),z=(0,O.useRef)(0),B=(0,O.useRef)(0),V=(0,O.useRef)(4),H=(0,O.useRef)(null),ut=(0,O.useRef)(null),dt=(0,O.useRef)(!1),ft=(0,O.useRef)(null),pt=(0,O.useRef)(``);be({tool:`resume_match`,onRestore:e=>{l(e.resumeText)&&a(l(e.resumeText)),l(e.jd)&&m(l(e.jd)),l(e.jobTitle)&&g(l(e.jobTitle)),l(e.company)&&v(l(e.company)),l(e.jobUrl)&&b(l(e.jobUrl)),l(e.requirements)&&oe(l(e.requirements)),typeof e.jdCollapsed==`boolean`&&he(!!e.jdCollapsed),Array.isArray(e.jdDrafts)&&_e(e.jdDrafts.slice(0,8)),e.out&&F(e.out),Array.isArray(e.chatTurns)&&Ue(e.chatTurns.slice(-80));let t=e.billing||(Array.isArray(e.chatTurns)?[...e.chatTurns].reverse().find(e=>e?.role===`assistant`&&e?.billing)?.billing:null);t&&Qe(t),l(e.streamText)&&(W(l(e.streamText)),Yt(l(e.streamText))),l(e.streamText)&&(vt.current=l(e.streamText)),l(e.streamThinking)&&K(l(e.streamThinking)),l(e.streamStage)&&q(l(e.streamStage)),l(e.streamActor)&&Y(l(e.streamActor)),Number.isFinite(Number(e.progress))&&Ge(Number(e.progress)),l(e.latestResultId)&&I(l(e.latestResultId));let n=String(e.streamMode||``).trim()===`agent`?`agent`:`direct`;Gt(n===`agent`);let r=l(e.streamRequestId),i=Math.max(0,Number(e.streamLastEventId||0)),o=l(e.streamModelKey);(e.runState===`running`||e.runState===`partial`)&&n===`agent`&&r&&(ft.current={requestId:r,lastEventId:i,mode:n,modelKey:o}),e.timing&&typeof e.timing==`object`&&(_t.current=e.timing,gt(e.timing))},syncEntries:[{key:`out`,signature:e=>e.out&&typeof e.out==`object`?JSON.stringify(e.out):``,apply:e=>F(e.out??null)},{key:`streamText`,signature:e=>l(e.streamText),apply:e=>{let t=l(e.streamText);W(t),Yt(t),t&&(vt.current=t)}},{key:`streamThinking`,signature:e=>l(e.streamThinking),apply:e=>K(l(e.streamThinking))},{key:`streamStage`,signature:e=>l(e.streamStage),apply:e=>q(l(e.streamStage))},{key:`streamActor`,signature:e=>l(e.streamActor),apply:e=>Y(l(e.streamActor))},{key:`progress`,signature:e=>Number.isFinite(Number(e.progress))?String(Number(e.progress)):``,apply:e=>{Number.isFinite(Number(e.progress))&&Ge(Number(e.progress))}},{key:`jdDrafts`,signature:e=>Array.isArray(e.jdDrafts)?JSON.stringify(e.jdDrafts):``,apply:e=>{Array.isArray(e.jdDrafts)&&_e(e.jdDrafts.slice(0,8))}},{key:`timing`,signature:e=>e.timing&&typeof e.timing==`object`?JSON.stringify(e.timing):``,apply:e=>{e.timing&&typeof e.timing==`object`&&(_t.current=e.timing,gt(e.timing))}},{key:`billing`,signature:e=>e.billing&&typeof e.billing==`object`?JSON.stringify(e.billing):``,apply:e=>Qe(e.billing||null)}],onRunState:(e,t)=>{Gt((String(t.streamMode||``).trim()===`agent`?`agent`:`direct`)==`agent`),e===`running`?(Ke(`running`),D(!0)):e===`partial`?(Je(),D(!0),A(``)):e===`done`?(Ye(),D(!1),A(``)):e===`failed`?(Xe(String(t.err||`生成失败`),A),D(!1)):e===`cancelled`&&(Xe(`已取消`,A),D(!1))},shouldStop:e=>e!==`running`&&e!==`partial`}),(0,O.useEffect)(()=>{if(!dt.current){dt.current=!0;return}try{ut.current&&window.clearTimeout(ut.current)}catch{}return ut.current=window.setTimeout(()=>{E(`resume_match`,{resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(T),jdCollapsed:se,jdDrafts:ge.slice(0,8),latestResultId:l($e)})},300),()=>{try{ut.current&&window.clearTimeout(ut.current)}catch{}ut.current=null}},[_,s,se,ge,h,y,$e,T,n]);let[U,W]=(0,O.useState)(``),[G,K]=(0,O.useState)(``),[mt,q]=(0,O.useState)(``),[J,Y]=(0,O.useState)(``),[ht,gt]=(0,O.useState)({steps:[]}),_t=(0,O.useRef)({steps:[]}),vt=(0,O.useRef)(``),yt=(0,O.useMemo)(()=>Fe(G),[G]),X=(0,O.useMemo)(()=>j(U),[U]),bt=e=>{let t=e(_t.current?.steps?_t.current:{steps:[]});return _t.current=t,gt(t),t};(0,O.useEffect)(()=>{let e=e=>{if(!e||typeof e!=`object`)return;let t=l(e.resumeText),n=l(e.jdText),r=l(e.targetRole),i=l(e.targetIndustry),o=l(e.summary);t&&a(e=>e||t),n&&m(e=>e||n),r&&!ve.current&&g(e=>e||r),i&&!ye.current&&v(e=>e||i),o&&!we.current&&oe(e=>e||o),Te.current||he(!1)},t=new URLSearchParams(window.location.search),n=l(t.get(`source`));if(n!==`career_coach`&&n!==`extension`&&n!==`public_jobs`)return;let r=l(t.get(`sid`));if(!r)return;let i=()=>{let t=ne(r);t&&e(t)};i();let o=e=>{e.key&&e.key!==`offer_lens_tool_handoff_v1`||i()},s=()=>{i()},c=()=>{i()},u=0,d=window.setInterval(()=>{u+=1,i(),u>=12&&window.clearInterval(d)},350);return window.addEventListener(`storage`,o),window.addEventListener(`TOOL_HANDOFF_UPDATED_WEB`,s),window.addEventListener(`focus`,c),()=>{window.clearInterval(d),window.removeEventListener(`storage`,o),window.removeEventListener(`TOOL_HANDOFF_UPDATED_WEB`,s),window.removeEventListener(`focus`,c)}},[]),(0,O.useEffect)(()=>{let e=Xt.current;if(e)try{e.scrollTop=e.scrollHeight}catch{}},[He.length,G,U,Ee]);let Z=(0,O.useMemo)(()=>{let e={title:``,summary:``,fit:``,scoreText:``,overallScoreText:``,objectiveScoreText:``,subjectiveScoreText:``,strengths:[],gaps:[],actions:[],highlights:[],gapsSummary:[],keywords:[],radarLabels:[],radarValues:[]};if(!P)return e;let t=(()=>{let e=Array.isArray(P?.items)?P.items:[],t=e[0]||null,n=-1;for(let r of e){let e=Number(r?.score??-1);Number.isFinite(e)&&e>n&&(n=e,t=r)}return t})();return e.title=l(P?.title),e.summary=l(P?.summary),e.fit=l(t?.fit),e.scoreText=Number.isFinite(Number(t?.score))?String(Math.round(Number(t?.score))):``,e.overallScoreText=Number.isFinite(Number(P?.overallScore))?String(Math.round(Number(P?.overallScore))):``,e.objectiveScoreText=Number.isFinite(Number(P?.objectiveScore))?String(Math.round(Number(P?.objectiveScore))):``,e.subjectiveScoreText=Number.isFinite(Number(P?.subjectiveScore))?String(Math.round(Number(P?.subjectiveScore))):``,e.strengths=Array.isArray(t?.strengths)?t.strengths.map(l).filter(Boolean):[],e.gaps=Array.isArray(t?.gaps)?t.gaps.map(l).filter(Boolean):[],e.actions=Array.isArray(t?.actions)?t.actions.map(l).filter(Boolean):[],e.highlights=Array.isArray(P?.highlights)?P.highlights.map(l).filter(Boolean):[],e.gapsSummary=Array.isArray(P?.gapsSummary)?P.gapsSummary.map(l).filter(Boolean):[],e.keywords=Array.isArray(P?.keywords)?P.keywords.map(e=>l(e?.keyword)).filter(Boolean):[],e.radarLabels=Array.isArray(P?.radar?.labels)?P.radar.labels.map(l).filter(Boolean):[],e.radarValues=Array.isArray(P?.radar?.values)?P.radar.values.map(e=>String(e??``).trim()).filter(Boolean):[],e},[P]),Q=(0,O.useMemo)(()=>N===`running`||N===`partial`?{...Z,...X,strengths:X.strengths.length?X.strengths:Z.strengths,gaps:X.gaps.length?X.gaps:Z.gaps,actions:X.actions.length?X.actions:Z.actions,highlights:X.highlights.length?X.highlights:Z.highlights,gapsSummary:X.gapsSummary.length?X.gapsSummary:Z.gapsSummary,keywords:X.keywords.length?X.keywords:Z.keywords}:Z,[Z,N,X]),xt=(0,O.useMemo)(()=>l([...He].reverse().find(e=>e.role===`assistant`)?.id),[He]),St=(0,O.useMemo)(()=>{let e=Number(Q.overallScoreText||Q.scoreText),t=Number.isFinite(e)?Math.max(0,Math.min(100,Math.round(e))):void 0;return{score:t,summary:l(Q.summary),fit:l(Q.fit),headline:t==null?``:t>=80?`这份简历可以直接进入投递决策。`:t>=60?`建议先做一轮针对性改写，再决定是否投递。`:`建议先补关键信息和项目证据，再进入投递。`,primaryAction:`去简历优化`}},[Q]),Ct=(0,O.useMemo)(()=>{let e=Array.isArray(ht.steps)?ht.steps.map(e=>({...e,durationText:M(e.durationMs),startElapsedText:M(e.startElapsedMs),completedElapsedText:M(e.completedElapsedMs)})):[];return{firstReadableText:M(ht.firstReadableMs),completedText:M(ht.completedMs),steps:e,hasAny:!!ht.startedAt}},[ht]),wt=(0,O.useMemo)(()=>ie(`/tools/resume-optimize`,`tool`,{source:`resume_match`,jt:l(h),cp:l(_),matchRid:l($e)}),[_,h,$e]);(0,O.useEffect)(()=>{let e=l($e);e&&te({sid:e,source:`resume_match`,tool:`resume_optimize`,createdAt:Date.now(),resumeText:l(n),jdText:l(s),currentRole:l(_),targetRole:l(h),summary:l(Q.summary)||l(St.summary),primaryAction:`去简历优化`,prefillHint:[l(h)?`目标岗位：${l(h)}`:``,l(_)?`公司：${l(_)}`:``].filter(Boolean).join(`
`)})},[_,s,h,$e,St.summary,n,Q.summary]);let Tt=(0,O.useMemo)(()=>Q.strengths.slice(0,3),[Q]),$=(0,O.useMemo)(()=>(Q.gapsSummary.length?Q.gapsSummary:Q.gaps).slice(0,3),[Q]),Et=(0,O.useMemo)(()=>Q.actions.slice(0,3),[Q]),Dt=(0,O.useMemo)(()=>Array.isArray(P?.riskSignals)?P.riskSignals.slice(0,6).map(e=>l(e)).filter(Boolean):[],[P]),Ot=(0,O.useMemo)(()=>P?fe(`resume_match`,P):null,[P]),kt=()=>{let t=[];return l(h)&&t.push(`目标岗位：${l(h)}`),l(_)&&t.push(`公司：${l(_)}`),l(s)&&t.push(`JD 已提供（${l(s).length} 字）`),l(n)&&t.push(`简历已提供（${l(n).length} 字）`),e&&t.push(`附件：${l(e.name)}`),t.join(`
`)},At=e=>{let t=Array.isArray(e?.items)?e.items[0]:null,n=[];return Number.isFinite(Number(e?.overallScore))&&n.push(`我先给你一个整体判断：这份简历和岗位的综合匹配度大约是 ${Math.round(Number(e.overallScore||0))}%。`),l(t?.fit)&&n.push(`从匹配角度看：${l(t?.fit)}`),Array.isArray(t?.strengths)&&t.strengths.length&&n.push(`最有优势的点：\n${t.strengths.slice(0,4).map(e=>`- ${l(e)}`).join(`
`)}`),Array.isArray(t?.gaps)&&t.gaps.length&&n.push(`最需要补的点：\n${t.gaps.slice(0,4).map(e=>`- ${l(e)}`).join(`
`)}`),Array.isArray(t?.actions)&&t.actions.length&&n.push(`如果你要继续改简历或准备投递，我建议先做这几步：\n${t.actions.slice(0,4).map(e=>`- ${l(e)}`).join(`
`)}`),n.join(`

`)||`已生成简历匹配建议。`},jt=(0,O.useMemo)(()=>l(s).length>20&&(l(n).length>30||!!e),[s,n,e]),Mt=()=>{let e=l(s);if(!e)return;let t={id:`jd_${Date.now()}_${Math.random().toString(16).slice(2,6)}`,title:l(h)||`未命名岗位`,company:l(_),jd:e,url:l(y),requirements:l(T),updatedAt:Date.now()};_e(e=>[t,...e.filter(e=>!(l(e.jd)===t.jd&&l(e.title)===t.title&&l(e.company)===t.company))].slice(0,8))},Nt=e=>{let t=ge.find(t=>t.id===e);t&&(g(l(t.title)),v(l(t.company)),b(l(t.url)),oe(l(t.requirements)),m(l(t.jd)),he(!1))},Pt=e=>{_e(t=>t.filter(t=>t.id!==e))},Ft=()=>{l(s)&&Mt(),g(``),v(``),b(``),oe(``),m(``),he(!1)},[It,Lt]=(0,O.useState)(!1),[Rt,zt]=(0,O.useState)(``),[Bt,Vt]=(0,O.useState)(``),[Ht,Ut]=(0,O.useState)(!0),[Wt,Gt]=(0,O.useState)(!0),[Kt,qt]=(0,O.useState)([]),[Jt,Yt]=(0,O.useState)(``),Xt=(0,O.useRef)(null),Zt=e=>{Ue(t=>[...t,e].slice(-80))};(0,O.useEffect)(()=>{if(!Ee||Wt)return;let e=window.setInterval(()=>{let e=Number(B.current||0);if(!e)return;let t=String(N||``).trim();if(t!==`running`&&t!==`partial`||Date.now()-e<12e4)return;z.current+=1,B.current=0;try{st.current?.abort()}catch{}st.current=null;let i=Be(P,{jobTitle:h,company:_});if(!i){D(!1),Xe(`生成停滞：请点击重新生成或切换模型后重试`,A),E(`resume_match`,{runState:`failed`,err:`stalled`,progress:Number(We||0),streamMode:`direct`});return}let a=l($e)||`resume_match_${Date.now()}_${Math.random().toString(16).slice(2,8)}`;F(i),A(``),I(a),q(`分析完成`),D(!1),Ut(!0),Ye(),Zt({id:`turn_a_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`assistant`,content:At(i),createdAt:Date.now()}),E(`resume_match`,{runState:`done`,progress:100,out:i,requirements:l(T),jdCollapsed:se,chatTurns:[...He].slice(-80),latestResultId:a,resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),streamThinking:l(G),streamText:l(U),streamStage:`分析完成`,streamRequestId:``,streamMode:`direct`}),queueMicrotask(()=>{re(pe({id:a,toolLabel:`简历匹配`,toolType:`resume_match`,title:`${l(h)||`目标岗位`} 匹配结果`,score:Number.isFinite(Number(i?.overallScore))?`匹配度 ${Math.round(Number(i?.overallScore||0))}%`:``,deepLink:ie(`/tools/resume-match`,`result`,{rid:a,jt:l(h),cp:l(_)}),result:i}),{resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(T),result:i}).catch(()=>{}),(async()=>{let{cloudWorkspaceUpsertReport:e}=await r(async()=>{let{cloudWorkspaceUpsertReport:e}=await import(`./cloudWorkspaceReports-Dmj54Z_p.js`);return{cloudWorkspaceUpsertReport:e}},__vite__mapDeps([0,1,2,3,4,5,6]));await e({id:a,reportType:`resume_match`,title:`${l(h)||`目标岗位`} 匹配结果`,jobIds:[],status:`done`,progress:100,summary:me({result:i,resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(T)})}).catch(()=>{})})()})},1e3);return()=>{try{window.clearInterval(e)}catch{}}},[Wt,At,Ee,He,_,Ye,Xe,s,se,h,y,$e,P,We,T,n,N,U,G]),(0,O.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=String(e.get(`focus`)||``).trim(),r=String(e.get(`jt`)||``).trim(),i=String(e.get(`cp`)||``).trim(),o=String(e.get(`rid`)||``).trim();if(r&&!l(h)&&g(r),i&&!l(_)&&v(i),o&&I(o),o&&!it){let e=ee(o,`简历匹配`);if(e&&typeof e==`object`){let t=[];tt(`已恢复历史记录 ${o.slice(-6)}`),l(e?.resumeText)&&!l(n)&&(a(l(e.resumeText)),t.push(`简历文本`)),l(e?.jd)&&!l(s)&&(m(l(e.jd)),t.push(`JD`)),l(e?.jobTitle)&&!l(h)&&g(l(e.jobTitle)),l(e?.company)&&!l(_)&&v(l(e.company)),l(e?.jobUrl)&&!l(y)&&(b(l(e.jobUrl)),t.push(`链接`)),l(e?.requirements)&&!l(T)&&oe(l(e.requirements)),typeof e?.jdCollapsed==`boolean`&&he(!!e.jdCollapsed),e?.result&&!P&&(F(e.result),t.push(`结果`)),nt(t)}}t===`result`&&window.setTimeout(()=>{try{ot.current?.scrollIntoView({behavior:`smooth`,block:`start`})}catch{}},80)},[_,it,s,h,y,P,T,n]);let Qt=e=>{if(ct.current?.abort(),lt.current=null,R.current+=1,t(e),Vt(``),!e){Lt(!1),zt(``);return}a(``),F(null),I(``),W(``),K(``),q(``),qt([]),Yt(``),A(``),Lt(!0),zt(`准备解析新简历…`)},$t=async t=>{if(lt.current)return await lt.current;if(!e)throw Error(`请上传 PDF 简历或粘贴简历文本`);let n=e;if(String(n.type||``).toLowerCase()!==`application/pdf`&&!/\.pdf$/i.test(n.name||``))throw Error(`仅支持 PDF 格式`);if(n.size>1e7)throw Error(`PDF 文件过大（限制 10MB）`);ct.current?.abort();let r=new AbortController;ct.current=r;let i=++R.current;Vt(``),Lt(!0),zt(t===`auto`?`自动解析中…`:`解析中…`);let o=(async()=>{let e=l((await S({file:n,minLength:800,signal:r.signal,onStage:zt}))?.finalText);if(!e)throw Error(`解析结果为空`);return a(e),zt(`解析完成`),Zt({id:`turn_s_parse_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`system`,content:`已解析简历附件《${l(n.name)||`PDF 简历`}》，后续匹配会自动结合这份简历内容。`,createdAt:Date.now(),attachments:[{name:l(n.name)||`PDF 简历`,preview:`${e.slice(0,90)}${e.length>90?`…`:``}`}]}),e})();lt.current=o;try{return await o}finally{if(R.current===i){lt.current=null,Lt(!1);try{ct.current=null}catch{}zt(``)}}},en=async()=>l(n)||await $t(`run`),tn=async e=>{let t=await c();if(!t?.token)return A((0,k.jsxs)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:[`请先`,(0,k.jsx)(`a`,{href:w(),children:`登录`}),`并确认积分余额后继续使用简历匹配。`]})),null;if(!e?.skipQuote)try{let e=await de({tool:`resume_match`,modelChoice:ke,resumeChars:l(n).length,jdChars:l(s).length});if(!e.ok)return A((0,k.jsxs)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:[e.message,` `,(0,k.jsx)(`a`,{href:e.rechargeHref,children:`充值`})]})),null}catch(e){return A((0,k.jsx)(`p`,{style:{color:`var(--accent)`,fontSize:`13px`},children:String(e?.message||`暂时无法校验积分余额，请稍后重试。`)})),null}return t};(0,O.useEffect)(()=>{if(!e){Lt(!1),zt(``),Vt(``),ct.current?.abort(),lt.current=null,R.current+=1;return}(async()=>{if(!await p()){Lt(!1),zt(``),Vt(`未同意隐私条款，已取消解析`);return}try{await $t(`auto`)}catch(e){Vt(l(e?.message||`解析失败`))}})()},[e]);let nn=async e=>{let t=!!e?.requestId;if(Ee&&!t||!await tn({skipQuote:t}))return;let n=++z.current;H.current&&=(clearInterval(H.current),null);let r={startedAt:Date.now(),steps:[]};_t.current=r,gt(r),A(``),t||(F(null),Qe(null),I(``),qt([]),Yt(``),vt.current=``,W(``),K(``),q(`准备开始`),Y(``)),V.current=4,qe(),D(!0),st.current=new AbortController;let i=!1,a=``;try{let o=await ce({rangeDays:1,pageSize:100}),c=await en(),p=await f();if(!p.enabled||!p.proxyUrl)throw Error(`AI 服务未启用，请在设置中开启 AI 代理`);let m=u(ke);a=Ne(m?.provider,m?.model);let g=d(ke),v=e?.requestId||Pe();E(`resume_match`,{runState:`running`,...t?{}:{progress:0,err:``,out:null,billing:null,timing:r,streamText:``,streamThinking:``,streamStage:`准备开始`,streamActor:`agent`},streamRequestId:v,streamLastEventId:Math.max(0,Number(e?.lastEventId||0)),streamMode:`agent`,streamModelKey:a});let b=await x({op:`resume_match_agent`,proxyUrl:p.proxyUrl,gatewayApiKey:p.gatewayApiKey,thinking:g,subProvider:m?.provider,subModel:m?.model,data:{resume:c,jd:l(s),jobTitle:l(h)},signal:st.current.signal,requestId:v,resumeFromSeq:Math.max(0,Number(e?.lastEventId||0)),onToolStart:(e,t,r)=>{if(i||n!==z.current)return;H.current&&=(clearInterval(H.current),null),V.current=Math.max(1,Number(r||0)||1),qt(t=>[...t,{tool:e,status:`running`}]),q(`步骤 ${t}/${r}`);let a=Ce(t,r,`start`);Ge(a);let o=Date.now(),s=bt(n=>{let r=`${e}:${t}`,i=(n.steps||[]).filter(e=>e.key!==r);return i.push({key:r,tool:e,label:Le(e),startedAt:o,startElapsedMs:Math.max(0,o-Number(n.startedAt||o))}),{...n,steps:i}});E(`resume_match`,{runState:`running`,progress:a,streamStage:`步骤 ${t}/${r}`,streamActor:e,timing:s});let c=Ce(t,r,`done`)-1;H.current=window.setInterval(()=>{Ge(e=>e>=c?(clearInterval(H.current),H.current=null,e):e+.4)},1e3)},onToolDone:(e,t)=>{if(i||n!==z.current)return;H.current&&=(clearInterval(H.current),null),qt(t=>t.map(t=>t.tool===e&&t.status===`running`?{...t,status:`done`}:t));let r=Ce(t,V.current,`done`);Ge(r);let a=Date.now(),o=bt(n=>({...n,steps:(n.steps||[]).map(r=>r.key===`${e}:${t}`?{...r,completedAt:a,completedElapsedMs:Math.max(0,a-Number(n.startedAt||a)),durationMs:r.startedAt?Math.max(0,a-r.startedAt):void 0}:r)}));E(`resume_match`,{runState:`partial`,progress:r,streamStage:`已完成 ${t}/${V.current}`,streamActor:e,timing:o});let s=Math.min(r+8,90);H.current=window.setInterval(()=>{Ge(e=>e>=s?(clearInterval(H.current),H.current=null,e):e+.3)},1200)},onProcess:e=>{if(i||n!==z.current)return;let t=Me(e);t&&K(e=>{if(String(e||``).includes(t))return e;let n=[e,t].filter(Boolean).join(`

`);return E(`resume_match`,{runState:`partial`,streamThinking:n}),n})},onThinking:e=>{if(i||n!==z.current)return;let t=String(e||``).trim();t&&(K(t),E(`resume_match`,{runState:`partial`,streamThinking:t}))},onText:e=>{if(i||n!==z.current)return;let t=Re(e);t&&(vt.current=t);let r=bt(e=>{if(e.firstReadableAt||String(t||``).replace(/\s+/g,``).length<24)return e;let n=Date.now();return{...e,firstReadableAt:n,firstReadableMs:Math.max(0,n-Number(e.startedAt||n))}});Yt(t),W(t),E(`resume_match`,{runState:`partial`,streamText:t,timing:r})},onMeta:e=>{e.type===`start`&&E(`resume_match`,{streamRequestId:String(e.requestId||v),streamMode:`agent`,streamModelKey:a})},onEventId:e=>{E(`resume_match`,{streamRequestId:v,streamLastEventId:Math.max(0,Number(e||0)),streamMode:`agent`,streamModelKey:a})}});if(n!==z.current)return;i=!0,H.current&&=(clearInterval(H.current),null);let S=Re(b)||l(vt.current),ee=`resume_match_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,te=ze(S,{jobTitle:h,company:_}),ne=bt(e=>{let t=Date.now();return{...e,firstReadableAt:e.firstReadableAt||(S?t:e.firstReadableAt),firstReadableMs:e.firstReadableMs||(S?Math.max(0,t-Number(e.startedAt||t)):e.firstReadableMs),completedAt:t,completedMs:Math.max(0,t-Number(e.startedAt||t))}});I(ee),te&&F(te),Yt(S),W(S);let re=await le({beforeIds:o,aggregateAllNew:!0,pageSize:100,rangeDays:1});Qe(re);let ie={id:`turn_a_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`assistant`,content:At(te||b),createdAt:Date.now(),billing:re},C=[...He,ie].slice(-80);Ue(C),E(`resume_match`,{runState:`done`,progress:100,out:te,timing:ne,streamText:S,streamThinking:G||yt,streamStage:`分析完成`,streamActor:`agent`,latestResultId:ee,resumeText:c,jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(T),streamRequestId:v,streamMode:`agent`,streamModelKey:a,billing:re,chatTurns:C}),Ye(),D(!1)}catch(e){if(n!==z.current)return;i=!0;let t=C(e,`生成失败`);E(`resume_match`,{runState:`failed`,err:t,streamMode:`agent`,streamModelKey:a}),Xe(t,A)}finally{i=!0,D(!1)}},rn=async t=>{let i=!!t?.requestId;if(Ee&&!i||!await tn({skipQuote:i}))return;let a=++z.current,o=u(ke),c=d(ke),f=Ne(o?.provider,o?.model);if(A(``),!await p())return;i||(F(null),Qe(null),I(``),Yt(``),qt([]),W(``),K(``),q(``),Y(``)),qe(),st.current=new AbortController,D(!0);let m=await ce({rangeDays:1,pageSize:100}),g=null;i||(g={id:`turn_u_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`user`,content:kt(),createdAt:Date.now(),attachments:e?[{name:l(e.name)||`PDF 简历`,preview:`将结合当前简历与 JD 做匹配分析`}]:void 0},Zt(g)),E(`resume_match`,{runState:`running`,...i?{}:{progress:0,err:``,billing:null},resumeText:l(n),jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(T),jdCollapsed:se,chatTurns:[...He,...g?[g]:[]].slice(-80),streamMode:`direct`,streamModelKey:f});let v=!1,b=0;B.current=Date.now();let x=null;try{let e=await en(),n=Ve({title:h,company:_,jd:s,requirements:T,url:y}),o=i&&P&&typeof P==`object`?{...P}:{},u=t?.requestId||Pe(),d={},p=i?l(G):``,S=i?l(U):``,ee=``,te=``,ne=()=>{if(x!=null&&(window.clearTimeout(x),x=null),v||a!==z.current)return;let e=String(o?._streamStage||``).trim(),t=String(o?._streamActor||``).trim(),n=ee,r=te;ee=``,te=``,Je(),A(``),e&&q(e),t&&Y(t),n&&(S=n,W(n)),r&&(p=r,K(r)),F({...o}),E(`resume_match`,{runState:`partial`,progress:b,err:``,out:{...o},requirements:l(T),jdCollapsed:se,streamText:n||S||String(o?._streamText||``),streamThinking:r||p,streamStage:e,streamActor:t})},C=()=>{x??=window.setTimeout(()=>{x=null,ne()},60)};E(`resume_match`,{runState:`running`,streamRequestId:u,streamLastEventId:Math.max(0,Number(t?.lastEventId||0)),streamMode:`direct`,streamModelKey:f});let w=await ae(ue([n],e,{signal:st.current.signal,provider:Ae,model:je,thinking:c,requestId:u,resumeFromSeq:Math.max(0,Number(t?.lastEventId||0)),onEventId:e=>{E(`resume_match`,{streamRequestId:u,streamLastEventId:Math.max(0,Number(e||0)),streamMode:`direct`,streamModelKey:f})},onProgress:e=>{v||a!==z.current||(B.current=Date.now(),b=Math.max(0,Number(e||0)),Ge(b),E(`resume_match`,{runState:`running`,progress:b,err:``,requirements:l(T),jdCollapsed:se}))},onPartial:e=>{if(!(v||a!==z.current)){B.current=Date.now();try{let t=String(e?._streamStage||``).trim(),n=String(e?._streamActor||``).trim(),r=String(e?._streamText||``).trim(),i=String(e?._streamThinking||``).trim();if(r&&(ee=r),t||i){let n=String(e?._streamSegment||t||`analysis`).trim()||`analysis`,r=d[n]||{label:``,content:``};d[n]={label:t||r.label||`分析中`,content:i?Ie(r.content,i):r.content},te=Object.values(d).filter(e=>String(e.content||``).trim()).map(e=>`[${e.label}]\n${e.content}`).join(`

`)}t&&(e._streamStage=t),n&&(e._streamActor=n)}catch{}Object.assign(o,e||{}),C()}}}),6e5,`简历匹配生成`);if(a!==z.current)return;(x!=null||ee||te)&&ne(),v=!0,B.current=0,F(w),A(``);let oe=S||String(w?._streamText||``),ce=p||l(w?._streamThinking);oe&&W(oe),ce&&K(ce);let de=await le({beforeIds:m,aggregateAllNew:!0,pageSize:100,rangeDays:1});Qe(de);let fe={id:`turn_a_${Date.now()}_${Math.random().toString(16).slice(2,8)}`,role:`assistant`,content:At(w),createdAt:Date.now(),billing:de},he=[...He,...g?[g]:[],fe].slice(-80);Ue(he);let ge=`resume_match_${Date.now()}_${Math.random().toString(16).slice(2,8)}`;Ye(),D(!1),Ut(!0),E(`resume_match`,{runState:`done`,progress:100,out:w,requirements:l(T),jdCollapsed:se,chatTurns:he,billing:de,latestResultId:ge,resumeText:e,jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),streamThinking:ce,streamText:oe,streamStage:`分析完成`,streamRequestId:u,streamMode:`direct`,streamModelKey:f}),I(ge),queueMicrotask(()=>{re(pe({id:ge,toolLabel:`简历匹配`,toolType:`resume_match`,title:`${l(h)||`目标岗位`} 匹配结果`,score:Number.isFinite(Number(w?.overallScore))?`匹配度 ${Math.round(Number(w?.overallScore||0))}%`:``,deepLink:ie(`/tools/resume-match`,`result`,{rid:ge,jt:l(h),cp:l(_)}),result:w}),{resumeText:e,jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(T),result:w}).catch(()=>{}),(async()=>{let{cloudWorkspaceUpsertReport:t}=await r(async()=>{let{cloudWorkspaceUpsertReport:e}=await import(`./cloudWorkspaceReports-Dmj54Z_p.js`);return{cloudWorkspaceUpsertReport:e}},__vite__mapDeps([0,1,2,3,4,5,6]));await t({id:ge,reportType:`resume_match`,title:`${l(h)||`目标岗位`} 匹配结果`,jobIds:[n.id],status:`done`,progress:100,summary:me({result:w,resumeText:e,jd:l(s),jobTitle:l(h),company:l(_),jobUrl:l(y),requirements:l(T)})}).catch(()=>{})})()})}catch(e){if(a!==z.current)return;v=!0,B.current=0,x!=null&&(window.clearTimeout(x),x=null);let t=C(e,`生成失败`);Xe(t,A),E(`resume_match`,{runState:String(t||``).includes(`取消`)?`cancelled`:`failed`,err:String(t||``),progress:b,streamMode:`direct`,streamModelKey:f})}finally{x!=null&&(window.clearTimeout(x),x=null),v=!0,B.current=0,D(!1)}};return(0,O.useEffect)(()=>{let e=ft.current;if(!e)return;let t=`${e.mode}:${e.requestId}:${e.lastEventId}:${l(e.modelKey)}`;pt.current!==t&&(pt.current=t,ft.current=null,(async()=>{if(e.mode===`direct`){D(!1);return}let t=!0;try{let n=u(ke),r=Ne(n?.provider,n?.model),i=l(e.modelKey);i&&r&&i!==r&&(t=!1)}catch{}if(!t){tt(`检测到模型已切换：当前进行中的流式结果已失效，请重新点击“开始匹配分析”。`);return}await(e.mode===`agent`?nn(e):rn(e))})())},[_,s,h,T,n]),{resumeFile:e,setResumeFile:Qt,resumeText:n,setResumeText:a,jd:s,setJd:m,jobTitle:h,setJobTitle:e=>{ve.current=!0,g(e)},company:_,setCompany:e=>{ye.current=!0,v(e)},jobUrl:y,setJobUrl:e=>{xe.current=!0,b(e)},requirements:T,setRequirements:e=>{we.current=!0,oe(e)},jdCollapsed:se,setJdCollapsed:e=>{Te.current=!0,he(e)},busy:Ee,setBusy:D,runState:N,progress:We,failByMessage:Xe,err:Oe,setErr:A,chatTurns:He,setChatTurns:Ue,platformBilling:Ze,out:P,setOut:F,latestResultId:$e,setLatestResultId:I,restoredHint:et,setRestoredHint:tt,restoredFields:L,isRestored:rt,exportRef:at,resultCardRef:ot,abortRef:st,parseAbortRef:ct,parsePromiseRef:lt,runSeqRef:z,draftTimerRef:ut,streamText:U,setStreamText:W,streamThinking:G,setStreamThinking:K,streamStage:mt,setStreamStage:q,streamActor:J,setStreamActor:Y,cleanedThinking:yt,timing:ht,timingSummary:Ct,streamSections:X,finalSections:Z,shownSections:Q,latestAssistantTurnId:xt,matchOverview:St,resumeOptimizeHref:wt,jdDrafts:ge,saveCurrentJdDraft:Mt,loadJdDraft:Nt,removeJdDraft:Pt,startNextJd:Ft,matchTopStrengths:Tt,matchTopGaps:$,matchTopActions:Et,matchRiskSignals:Dt,unifiedSummary:Ot,buildUserRunSummary:kt,buildAssistantSummary:At,canRun:jt,parseBusy:It,setParseBusy:Lt,parseStage:Rt,setParseStage:zt,parseErrText:Bt,setParseErrText:Vt,detailExpanded:Ht,setDetailExpanded:Ut,chatScrollRef:Xt,appendTurn:Zt,runParseResume:$t,parseResumeIfNeeded:en,run:rn,runAgent:nn,agentMode:Wt,setAgentMode:Gt,agentSteps:Kt,agentText:Jt}}var Ue=e=>/云端大模型生成.*输出可能不准确/.test(l(e)),N=`var(--he-font-sans)`,We=e=>{let t=l(e);return t?/(博士|phd|doctor)/i.test(t)?`博士`:/(硕士|master|mba)/i.test(t)?`硕士`:/(本科|学士|bachelor)/i.test(t)?`本科`:/(大专|专科|college diploma)/i.test(t)?`大专`:/(高中|中专)/i.test(t)?`高中/中专`:/(大学|学院|学校)/.test(t)?`已提及院校背景`:``:``},Ge=e=>{let t=l(e);if(!t)return``;let n=[...t.matchAll(/(\d{1,2})(?:\s*[-~至到]\s*(\d{1,2}))?\s*年(?:以上|及以上|相关|工作)?经验/g)];if(!n.length)return``;let r=n.reduce((e,t)=>{let n=Math.max(Number(t[1]||0),Number(t[2]||0));return n>e?n:e},0);return r>0?`${r} 年+`:``},Ke=e=>{let t=l(e);if(!t)return``;let n=new Date,r=n.getFullYear(),i=n.getMonth()+1,a=(e,t)=>e*12+(t-1),o=(e,t,n)=>{let a=String(e||``).trim().toLowerCase();if(!a)return null;if(/^(至今|现在|目前|present|current)$/i.test(a))return{year:r,month:i};let o=Number((a.match(/(19\d{2}|20\d{2})/)||[])[1]||0);if(!o)return null;let s=Number(String(t||``).trim()||0);return{year:o,month:s>=1&&s<=12?s:n?12:1}},s=[];for(let e of t.matchAll(/(19\d{2}|20\d{2})(?:\s*[.\-/年]\s*(\d{1,2}))?\s*(?:月)?\s*(?:至|到|[-~—–])\s*(19\d{2}|20\d{2}|至今|现在|目前|present|current)(?:\s*[.\-/年]\s*(\d{1,2}))?\s*(?:月)?/gi)){let t=o(String(e[1]||``),String(e[2]||``),!1),n=o(String(e[3]||``),String(e[4]||``),!0);if(!t||!n)continue;let r=a(t.year,t.month),i=a(n.year,n.month);r>i||s.push({start:r,end:i,startLabel:`${t.year}.${String(t.month).padStart(2,`0`)}`,endLabel:`${n.year}.${String(n.month).padStart(2,`0`)}`})}if(!s.length)return``;s.sort((e,t)=>e.start-t.start);let c=[];for(let e of s){let t=c[c.length-1];if(!t||e.start>t.end+1){c.push({...e});continue}t.end=Math.max(t.end,e.end)}let u=c.reduce((e,t)=>e+(t.end-t.start+1),0);if(u<=0)return``;let d=Math.floor(u/12),f=u%12;return`${d>0?`${d}年`:``}${f>0?`${f}个月`:d>0?``:`不足1个月`}（${s.length}段）`},qe=e=>{let t=l(e);if(!t)return[];let n=new Date,r=n.getFullYear(),i=n.getMonth()+1,a=(e,t)=>e*12+(t-1),o=(e,t,n)=>{let a=String(e||``).trim().toLowerCase();if(!a)return null;if(/^(至今|现在|目前|present|current)$/i.test(a))return{year:r,month:i};let o=Number((a.match(/(19\d{2}|20\d{2})/)||[])[1]||0);if(!o)return null;let s=Number(String(t||``).trim()||0);return{year:o,month:s>=1&&s<=12?s:n?12:1}},s=[];for(let e of t.matchAll(/(19\d{2}|20\d{2})(?:\s*[.\-/年]\s*(\d{1,2}))?\s*(?:月)?\s*(?:至|到|[-~—–])\s*(19\d{2}|20\d{2}|至今|现在|目前|present|current)(?:\s*[.\-/年]\s*(\d{1,2}))?\s*(?:月)?/gi)){let t=o(String(e[1]||``),String(e[2]||``),!1),n=o(String(e[3]||``),String(e[4]||``),!0);if(!t||!n)continue;let r=a(t.year,t.month),i=a(n.year,n.month);if(r>i)continue;let c=i-r+1;s.push({start:r,end:i,text:`${t.year}.${String(t.month).padStart(2,`0`)} - ${n.year}.${String(n.month).padStart(2,`0`)}（${c}个月）`})}return s.sort((e,t)=>e.start-t.start),s.map(e=>e.text).slice(0,12)};function Je(){let{resumeFile:e,setResumeFile:t,resumeText:n,setResumeText:r,jd:i,setJd:c,jobUrl:u,setJobUrl:d,busy:f,setBusy:x,runState:S,progress:ee,failByMessage:te,err:ne,setErr:re,platformBilling:ie,out:C,setOut:w,latestResultId:ae,setLatestResultId:ce,restoredHint:le,restoredFields:ue,isRestored:de,exportRef:fe,resultCardRef:pe,abortRef:me,parseAbortRef:be,runSeqRef:E,streamStage:Se,setStreamStage:Ce,streamActor:De,setStreamActor:ke,streamText:Ae,setStreamText:je,streamThinking:Me,setStreamThinking:A,cleanedThinking:Ne,timingSummary:Pe,shownSections:j,matchOverview:Fe,resumeOptimizeHref:Ie,matchTopGaps:M,matchTopActions:Le,matchRiskSignals:Re,unifiedSummary:ze,canRun:Be,parseBusy:Ve,parseStage:Je,parseErrText:Ye,setParseErrText:Xe,runParseResume:P,run:F,runAgent:Ze,agentMode:Qe,agentSteps:$e,agentText:I}=He(),[et,tt]=(0,O.useState)(()=>o(a()));(0,O.useEffect)(()=>s(({theme:e})=>{tt(e)}),[]);let L=(0,O.useMemo)(()=>(Array.isArray(C?.keywords)?C.keywords:[]).slice(0,12).map(e=>{let t=l(e?.keyword),n=Number(e?.jd||0),r=Number(e?.resume||0),i=l(e?.match).toLowerCase(),a=i===`match`||r>=n?`match`:i===`miss`||r<=0?`miss`:`partial`;return{keyword:t,jd:n,resume:r,note:l(e?.note),status:a}}).filter(e=>e.keyword),[C]),nt=(0,O.useMemo)(()=>(Array.isArray(C?.caveats)?C.caveats:[]).map(e=>l(e)).filter(e=>e&&!Ue(e)).slice(0,6),[C]),rt=(0,O.useMemo)(()=>{let e=[...Le,...Array.isArray(ze?.risks)?ze.risks:[],...M,l(ze?.primaryAction)];return Array.from(new Set(e.map(e=>l(e)).filter(Boolean))).slice(0,5)},[Le,M,ze]),it=(0,O.useMemo)(()=>[...L].sort((e,t)=>Number(t.jd||0)-Number(e.jd||0)).map(e=>e.keyword).filter(Boolean).slice(0,10),[L]),at=(0,O.useMemo)(()=>[...L].filter(e=>Number(e.resume||0)>0).sort((e,t)=>Number(t.resume||0)-Number(e.resume||0)).map(e=>e.keyword).filter(Boolean).slice(0,10),[L]),ot=(0,O.useMemo)(()=>v(C?._fallback),[C]),st=(0,O.useMemo)(()=>y(C?._fallback),[C]),ct=e=>{let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,Math.round(t))):void 0},lt=(0,O.useMemo)(()=>ct(j.overallScoreText),[j.overallScoreText]),R=(0,O.useMemo)(()=>ct(j.objectiveScoreText),[j.objectiveScoreText]),z=(0,O.useMemo)(()=>ct(j.subjectiveScoreText),[j.subjectiveScoreText]),B=(0,O.useMemo)(()=>ct(j.scoreText),[j.scoreText]),V=(0,O.useMemo)(()=>{if(lt!=null)return lt;if(R!=null)return R;if(z!=null)return z;if(B!=null)return B},[B,R,lt,z]),H=(0,O.useMemo)(()=>V==null?null:2*Math.PI*28*(V>0?Math.max(V,4):2)/100,[V]),ut=(0,O.useMemo)(()=>{let e=V;return e==null?{label:`待结构化评分`,tone:`#666666`,bg:`rgba(102,102,102,0.08)`,border:`rgba(102,102,102,0.20)`}:e>=75?{label:`建议优先投递`,tone:`#FF6600`,bg:`rgba(255,102,0,0.10)`,border:`rgba(255,102,0,0.28)`}:e>=55?{label:`建议优化后投递`,tone:`#FF6600`,bg:`rgba(255,102,0,0.08)`,border:`rgba(255,102,0,0.22)`}:{label:`建议补强后再投递`,tone:`#111111`,bg:`rgba(17,17,17,0.04)`,border:`rgba(17,17,17,0.16)`}},[V]),dt=(0,O.useMemo)(()=>he(C),[C]),ft=(0,O.useMemo)(()=>`注：默认展示 6 个一级维度；数值为 0-10 原始证据分，接口缺失项按证据不足处理。`,[]),pt=(0,O.useMemo)(()=>We(i),[i]),U=(0,O.useMemo)(()=>We(n),[n]),W=(0,O.useMemo)(()=>Ge(i),[i]),G=(0,O.useMemo)(()=>Ke(n),[n]),K=(0,O.useMemo)(()=>qe(n),[n]),mt=(0,O.useMemo)(()=>L.filter(e=>e.status===`match`).length,[L]),q=(0,O.useMemo)(()=>[{label:`技能匹配`,jdExpected:L.length?`目标覆盖 ${L.length} 项关键词`:`等待 JD 结构化`,resumeEvidence:L.length?`已覆盖 ${mt}/${L.length}${R==null?``:`（硬性条件 ${R}）`}`:R==null?`等待结构化结果`:`硬性条件 ${R}`,contrast:R==null?`待计算`:R>=80?`基本匹配`:R>=60?`差距 ${100-R}`:`差距显著 ${100-R}`,contrastTone:R==null?`neutral`:R>=80?`ok`:R>=60?`warn`:`risk`},{label:`经验年限`,jdExpected:W||`JD 未明确`,resumeEvidence:G?(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{children:G}),K.length?(0,k.jsxs)(`details`,{style:{marginTop:6},children:[(0,k.jsx)(`summary`,{style:{cursor:`pointer`,fontSize:12,fontWeight:700},children:`展开查看时间段明细`}),(0,k.jsx)(`div`,{style:{marginTop:6,display:`grid`,gap:4,fontSize:12,lineHeight:1.55},children:K.map(e=>(0,k.jsx)(`div`,{children:e},e))})]}):null]}):`简历未识别出明确跨度`,contrast:W?G?`需人工核验`:`证据缺失`:`JD 未明确`,contrastTone:W?G?`warn`:`risk`:`neutral`},{label:`教育背景`,jdExpected:pt||`JD 未明确`,resumeEvidence:U||`简历未识别`,contrast:pt?U?`需人工核验`:`证据缺失`:`JD 未明确`,contrastTone:pt?U?`warn`:`risk`:`neutral`},{label:`胜任力判断`,jdExpected:`岗位场景胜任要求`,resumeEvidence:z==null?j.fit||`等待结果`:`${z} · ${j.fit||`待判断`}`,contrast:z==null?`待计算`:z>=80?`基本匹配`:z>=60?`差距 ${100-z}`:`差距显著 ${100-z}`,contrastTone:z==null?`neutral`:z>=80?`ok`:z>=60?`warn`:`risk`}],[R,L.length,mt,W,G,K,pt,U,z,j.fit]),J=et===`dark`,Y=(0,O.useMemo)(()=>J?{cardBg:`var(--resume-card-bg-alt)`,cardBgSolid:`var(--resume-card-bg-solid)`,cardBgAlt:`var(--resume-card-bg-alt)`,cardInnerBg:`var(--resume-card-inner-bg)`,border:`var(--resume-card-border)`,borderSoft:`var(--resume-card-border-soft)`,textStrong:`var(--resume-card-text-strong)`,textBody:`var(--resume-card-text-body)`,textMuted:`var(--resume-card-text-muted)`,textSoft:`var(--resume-card-text-soft)`,accent:`var(--resume-card-accent)`,accentSoft:`var(--resume-card-accent-soft)`,accentBorder:`var(--resume-card-accent-border)`,inverseBg:`var(--resume-card-accent)`,inverseText:`#141717`,neutralPillBg:`var(--resume-pill-bg)`,neutralPillText:`var(--resume-pill-text)`,neutralPillBorder:`var(--resume-pill-border)`,track:`rgba(255,255,255,0.10)`,ringTrack:`rgba(255,255,255,0.10)`,tableBg:`var(--resume-card-inner-bg)`,rowBg:`rgba(255,255,255,0.02)`,rowBgMuted:`rgba(255,255,255,0.035)`,badgeDarkBg:`var(--resume-pill-bg)`,badgeDarkText:`var(--resume-pill-text)`,badgeDarkBorder:`var(--resume-pill-border)`,keywordOk:`#F3F2EF`}:{cardBg:`var(--resume-card-bg-solid)`,cardBgSolid:`var(--resume-card-bg-solid)`,cardBgAlt:`var(--resume-card-bg-alt)`,cardInnerBg:`var(--resume-card-inner-bg)`,border:`var(--resume-card-border)`,borderSoft:`var(--resume-card-border-soft)`,textStrong:`var(--resume-card-text-strong)`,textBody:`var(--resume-card-text-body)`,textMuted:`var(--resume-card-text-muted)`,textSoft:`var(--resume-card-text-soft)`,accent:`var(--resume-card-accent)`,accentSoft:`var(--resume-card-accent-soft)`,accentBorder:`var(--resume-card-accent-border)`,inverseBg:`#111111`,inverseText:`#FFFFFF`,neutralPillBg:`var(--resume-pill-bg)`,neutralPillText:`var(--resume-pill-text)`,neutralPillBorder:`var(--resume-pill-border)`,track:`rgba(17,17,17,0.08)`,ringTrack:`rgba(17,17,17,0.08)`,tableBg:`var(--resume-card-inner-bg)`,rowBg:`rgba(17,17,17,0.03)`,rowBgMuted:`rgba(17,17,17,0.05)`,badgeDarkBg:`#111111`,badgeDarkText:`#FFFFFF`,badgeDarkBorder:`rgba(17,17,17,0.12)`,keywordOk:`#111111`},[J]),ht=(0,O.useMemo)(()=>J?{...g,paper:`#151919`,backdrop:`rgba(255,255,255,0.03)`,ringFillOdd:`rgba(255,255,255,0.026)`,ringFillEven:`rgba(255,255,255,0.008)`,ringStroke:`rgba(255,255,255,0.065)`,axisStroke:`rgba(255,255,255,0.06)`,tickText:`rgba(243,242,239,0.52)`,labelText:`#F3F2EF`,legendBg:`rgba(255,255,255,0.04)`,legendBorder:`rgba(255,255,255,0.10)`,legendText:`#F3F2EF`,centerDot:`#E8895C`,pointCoreFill:`#141717`}:{...g,paper:ye.paper,ringFillOdd:`rgba(17,17,17,0.018)`,ringFillEven:`rgba(17,17,17,0.006)`,ringStroke:`rgba(17,17,17,0.10)`,axisStroke:`rgba(17,17,17,0.09)`,legendBg:ye.legendBg,legendText:ye.ink,centerDot:ye.ink},[J]),gt={fontSize:19,fontWeight:800,color:`var(--text-1)`,letterSpacing:`0.01em`},_t={display:`inline-flex`,alignItems:`center`,padding:`6px 12px`,borderRadius:999,background:Y.neutralPillBg,border:`1px solid ${Y.neutralPillBorder}`,color:Y.neutralPillText,fontSize:13,fontWeight:700,lineHeight:1.2},vt={border:`1px solid ${Y.border}`,borderRadius:18,background:Y.cardBgSolid,padding:`18px 18px`,boxShadow:`var(--resume-card-shadow)`,transition:`background-color 240ms ease, color 240ms ease, border-color 240ms ease, box-shadow 240ms ease`},yt=(0,O.useMemo)(()=>{let e=l(I).split(/\r?\n/).map(e=>l(e).replace(/^#{1,6}\s*/,``).replace(/^\*\*(.+)\*\*$/,`$1`)).filter(Boolean);if(!e.length)return null;let t=e[0],n=e.filter((e,t)=>t>0&&/^(\d+[\.\)]|[-•])\s*/.test(e)).map(e=>e.replace(/^(\d+[\.\)]|[-•])\s*/,``)),r=e.filter((e,t)=>t>0&&!/^(\d+[\.\)]|[-•])\s*/.test(e));return{headline:t,summary:r[0]||``,bullets:n.slice(0,5),paragraphs:r.slice(1,4)}},[I]),X=S===`running`||S===`partial`;(0,O.useEffect)(()=>{let e=X?S:S||`idle`;try{window.dispatchEvent(new CustomEvent(oe,{detail:{tool:`resume_match`,snapshot:{runState:e}}}))}catch{}},[X,S]);let bt=!!(l(Ne)||l(Me)||l(C?._streamThinking)),Z=(0,O.useMemo)(()=>{let e=l(Ne)||l(Me)||l(C?._streamThinking);if(!e)return[];let t=Array.from(e.matchAll(/\[([^\]\n]{1,80})\]\n([\s\S]*?)(?=(?:\n\[[^\]\n]{1,80}\]\n)|$)/g)).map(e=>({label:String(e[1]||`分析中`).trim(),content:String(e[2]||``).trim()})).filter(e=>e.content);return t.length?t:[{label:`分析中`,content:e}]},[Ne,Me,C]),Q=(0,O.useMemo)(()=>{let e=l(Fe.summary);if(e.length>=80)return e;let t=l(j.fit),n=j.highlights.slice(0,4),r=(j.gapsSummary.length?j.gapsSummary:j.gaps).slice(0,4),i=j.actions.slice(0,4),a=Re.slice(0,3);return[t?`综合诊断：${t}。`:``,n.length?`当前最有说服力的匹配证据包括：${n.join(`；`)}。`:``,r.length?`关键短板主要集中在：${r.join(`；`)}。`:``,a.length?`影响投递判断的风险信号有：${a.join(`；`)}。`:``,i.length?`建议下一步优先完成：${i.join(`；`)}。`:``].filter(Boolean).join(`

`)},[Fe.summary,j.fit,j.highlights,j.gapsSummary,j.gaps,j.actions,Re]),xt=(0,O.useMemo)(()=>ge(C,Q),[C,Q]),St=(0,O.useMemo)(()=>ae?`/report/resume-match?sid=${encodeURIComponent(ae)}`:``,[ae]),Ct=(0,O.useMemo)(()=>!!(V!=null||l(Fe.summary)||l(j.fit)||j.highlights.length||j.gapsSummary.length||j.gaps.length||j.actions.length||j.keywords.length||j.radarLabels.length||L.length||xt.length),[V,L.length,Fe.summary,xt.length,j.actions.length,j.fit,j.gaps.length,j.gapsSummary.length,j.highlights.length,j.keywords.length,j.radarLabels.length]),wt=!!C&&(S===`done`||Ct),Tt=(0,O.useMemo)(()=>!!(Ct||l(Ae).length>=20||M.length||rt.length),[Ct,M.length,rt.length,Ae]),$=(0,O.useMemo)(()=>Tt?[{id:`headline`,title:`综合结论`,content:Fe.headline||j.fit||`正在生成结论...`},...rt.slice(0,2).map((e,t)=>({id:`action_${t}`,title:`建议 ${t+1}`,content:e})),...M.slice(0,2).map((e,t)=>({id:`gap_${t}`,title:`风险 ${t+1}`,content:e}))].filter(e=>l(e.content)):[],[Tt,Fe.headline,M,rt,j.fit]),[Et,Dt]=(0,O.useState)(1);(0,O.useEffect)(()=>{if(!$.length){Dt(0);return}Dt(e=>Math.min(Math.max(e,1),$.length))},[$.length]),(0,O.useEffect)(()=>{if(Et>=$.length)return;let e=window.setTimeout(()=>{Dt(e=>Math.min($.length,e+1))},200);return()=>window.clearTimeout(e)},[$.length,Et]);let Ot=(0,O.useMemo)(()=>!f&&!!ne&&(xt.length>0||L.length>0),[f,ne,L.length,xt.length]),[kt,At]=(0,O.useState)(!0);(0,O.useEffect)(()=>{if(X&&!Ct){At(!0);return}(Ct||S===`done`||S===`failed`)&&At(!1)},[Ct,X,S]);let jt=X||Z.length>0,Mt=()=>{Qe?Ze():F()};return(0,k.jsx)(T,{title:`简历匹配`,subTitle:`上传 PDF 简历（或粘贴简历文本）+ 粘贴 JD，生成匹配度、优势、缺口与行动建议。`,forceThinkingEnabled:!0,hideThinkingToggle:!0,hideModelSelector:!0,defaultModelChoice:`deepseek`,children:(0,k.jsxs)(`div`,{className:`he-tools-layout`,children:[(0,k.jsx)(`aside`,{className:`he-tools-sidebar`,children:(0,k.jsx)(se,{current:`/tools/resume-match`})}),(0,k.jsxs)(`section`,{className:`he-tools-main`,children:[(0,k.jsxs)(`div`,{className:`he-form-grid`,children:[(0,k.jsxs)(`div`,{className:`he-form-block he-accent-blue`,children:[(0,k.jsxs)(`div`,{className:`he-pill`,children:[(0,k.jsx)(`span`,{className:`he-pill-dot`}),`Resume`]}),(0,k.jsxs)(`div`,{style:{marginTop:12},children:[(0,k.jsx)(Oe,{label:`PDF 简历（可选）`,accept:`application/pdf,.pdf`,file:e,onPick:t,hint:`上传后会自动解析；也可直接粘贴简历文本。解析按页计费（会消耗积分），生成结果另按 token 计费。`}),e&&!l(n)?(0,k.jsxs)(`div`,{className:`he-muted he-parse-status`,children:[(0,k.jsx)(`div`,{className:`he-parse-status-text`,children:Ve?`解析中… ${Je||``}`:Ye?`解析失败：${Ye}`:`等待解析…`}),(0,k.jsx)(`div`,{className:`he-inline-actions`,children:Ve?(0,k.jsx)(`button`,{type:`button`,className:`he-compact-action he-compact-action--secondary`,onClick:()=>{try{be.current?.abort()}catch{}},children:`取消解析`}):(0,k.jsx)(`button`,{type:`button`,className:`he-compact-action he-compact-action--secondary`,onClick:async()=>{if(await p())try{await P(`run`)}catch(e){Xe(l(e?.message||`解析失败`))}},children:`重新解析`})})]}):null]}),(0,k.jsx)(`div`,{className:`he-sep`}),(0,k.jsx)(`div`,{className:`he-label`,children:`简历文本（可直接粘贴，优先使用）`}),(0,k.jsx)(`textarea`,{className:[`he-textarea`,de(`简历文本`)?`he-restored-field`:``].join(` `),value:n,onChange:e=>r(e.target.value),placeholder:`粘贴简历文本…`})]}),(0,k.jsxs)(`div`,{className:`he-form-block he-accent-orange`,children:[(0,k.jsxs)(`div`,{className:`he-pill`,children:[(0,k.jsx)(`span`,{className:`he-pill-dot`}),`Job`]}),(0,k.jsx)(`div`,{className:`he-label`,style:{marginTop:10},children:`职位描述 JD（必填）`}),(0,k.jsx)(`textarea`,{className:[`he-textarea`,de(`JD`)?`he-restored-field`:``].join(` `),value:i,onChange:e=>c(e.target.value),placeholder:`粘贴职位描述 / 任职要求…`}),(0,k.jsx)(we,{jd:i,sourceTool:`resume_match`}),(0,k.jsxs)(`div`,{style:{marginTop:12},children:[(0,k.jsx)(`div`,{className:`he-label`,children:`岗位链接（仅记录，可选）`}),(0,k.jsx)(`input`,{className:[`he-input`,de(`链接`)?`he-restored-field`:``].join(` `),value:u,onChange:e=>d(e.target.value),placeholder:`https://...`}),(0,k.jsx)(`div`,{className:`he-muted`,style:{marginTop:6,fontSize:12,lineHeight:1.7},children:`当前仅用于记录岗位来源与后续跳转，还不会自动抓取 JD 内容；请继续手动粘贴完整 JD。`})]}),(0,k.jsx)(`div`,{style:{marginTop:14,display:`flex`,justifyContent:`flex-end`},children:(0,k.jsxs)(`div`,{className:`he-action-pill-group`,children:[(0,k.jsx)(`button`,{type:`button`,className:`he-action-pill`,onClick:()=>{Mt()},disabled:!Be||X,children:X?`匹配分析中…`:`匹配分析`}),(0,k.jsx)(`button`,{type:`button`,className:`he-action-pill he-action-pill--ghost`,onClick:()=>xe({tool:`resume_match`,runSeqRef:E,abortRef:me,setBusy:x,snapshotPatch:{out:null,progress:0,latestResultId:``,streamText:``,streamThinking:``,streamStage:``,streamActor:``,streamRequestId:``,streamLastEventId:0},onCancelled:()=>{w(null),ce(``),je(``),A(``),Ce(``),ke(``),te(`已取消`,re)}}),disabled:!X,children:`取消`})]})})]})]}),X&&Qe&&$e.length>0?(0,k.jsx)(D,{title:`Agent 执行清单`,stage:[l(Se),l(De)].filter(Boolean).join(` · `),progress:ee,steps:$e,labels:{resume_match:`匹配分析`,jd_analysis:`岗位解析`,resume_optimize:`改写建议`,interview_coach:`题目生成`}}):null,!Qe||!I&&!Ae?null:(0,k.jsxs)(`div`,{style:{marginTop:14,padding:`18px 20px`,borderRadius:18,background:`linear-gradient(180deg, rgba(244,136,53,0.08), rgba(244,136,53,0.03))`,border:`1px solid rgba(244,136,53,0.14)`},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`he-label`,children:`Agent 综合结论`}),(0,k.jsx)(`div`,{className:`he-muted`,style:{marginTop:4,fontSize:12},children:`把最终判断和建议收敛成更容易扫读的结论卡。`})]}),S===`done`?(0,k.jsx)(`span`,{className:`he-chip`,children:ut.label}):X&&Ae?(0,k.jsx)(`span`,{className:`he-chip`,children:`实时生成中`}):null]}),yt&&!X?(0,k.jsxs)(`div`,{style:{marginTop:12,display:`grid`,gap:12},children:[(0,k.jsx)(`div`,{style:{fontSize:20,fontWeight:800,color:`var(--text-1)`,lineHeight:1.6},children:yt.headline}),yt.summary?(0,k.jsx)(`div`,{style:{padding:`12px 14px`,borderRadius:14,background:`var(--surface)`,border:`1px solid var(--border-soft)`,color:`var(--text-2)`,lineHeight:1.8},children:yt.summary}):null,yt.bullets.length?(0,k.jsxs)(`div`,{style:{...vt,padding:`14px 16px`},children:[(0,k.jsx)(`div`,{className:`he-label`,style:{fontSize:14,fontWeight:800,color:`var(--text-1)`},children:`关键建议`}),(0,k.jsx)(`div`,{style:{marginTop:10,display:`grid`,gap:8},children:yt.bullets.map((e,t)=>(0,k.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`flex-start`,lineHeight:1.75,color:`var(--text-1)`},children:[(0,k.jsxs)(`span`,{style:{color:`var(--accent)`,fontWeight:800},children:[t+1,`.`]}),(0,k.jsx)(`span`,{children:e})]},`agent_b_${t}`))})]}):null,yt.paragraphs.length?(0,k.jsx)(`div`,{style:{display:`grid`,gap:8},children:yt.paragraphs.map((e,t)=>(0,k.jsx)(`div`,{style:{color:`var(--text-2)`,lineHeight:1.8},children:e},`agent_p_${t}`))}):null,(0,k.jsxs)(`details`,{style:{marginTop:2},children:[(0,k.jsx)(`summary`,{style:{cursor:`pointer`,color:`var(--text-2)`,fontSize:12},children:`查看原始完整结论`}),(0,k.jsx)(`div`,{style:{marginTop:10,padding:`12px 14px`,borderRadius:12,background:`var(--surface)`,border:`1px solid var(--border-soft)`,whiteSpace:`pre-wrap`,lineHeight:1.8,fontSize:14,color:`var(--text-1)`},children:I})]})]}):(0,k.jsx)(`div`,{style:{marginTop:12,whiteSpace:`pre-wrap`,lineHeight:1.8,fontSize:14,color:`var(--text-1)`},children:I||Ae})]}),Qe&&I&&S===`done`?(0,k.jsxs)(`div`,{style:{marginTop:12,display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,k.jsx)(`a`,{href:Ie,className:`btn-primary`,style:{minHeight:34,padding:`0 16px`,display:`inline-flex`,alignItems:`center`,gap:6,fontSize:13},children:`继续下一步：去简历优化`}),(0,k.jsx)(`span`,{className:`he-muted`,style:{fontSize:12},children:`会自动带上当前简历、JD 和匹配建议`})]}):null,(0,k.jsx)(Te,{state:S,progress:ee}),Pe.hasAny?(0,k.jsxs)(`div`,{className:`he-muted`,style:{marginTop:8,fontSize:12,lineHeight:1.8},children:[Pe.firstReadableText?(0,k.jsx)(`div`,{children:`首条可读结果：${Pe.firstReadableText}`}):null,Pe.completedText?(0,k.jsx)(`div`,{children:`完整完成：${Pe.completedText}`}):null,Pe.steps.length?(0,k.jsx)(`div`,{children:`阶段耗时：${Pe.steps.map(e=>`${e.label}${e.durationText?` ${e.durationText}`:``}`).join(` / `)}`}):null]}):null,$.length?(0,k.jsxs)(`section`,{style:{marginTop:14,padding:20,borderRadius:18,background:`var(--surface)`,border:`1px solid var(--border)`,boxShadow:`0 14px 40px rgba(15,23,42,0.05)`,fontFamily:N},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:`var(--text-3)`,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Streaming Conclusions`}),(0,k.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,color:`var(--text-1)`},children:`实时结论`})]}),(0,k.jsx)(`span`,{className:`he-chip`,children:`${Math.min(Et,$.length)}/${$.length} 已显示`})]}),Ot?(0,k.jsx)(`div`,{style:{marginTop:12,padding:`10px 12px`,borderRadius:12,background:`color-mix(in srgb, var(--accent) 8%, transparent)`,border:`1px solid var(--accent-border-soft)`,fontSize:13,lineHeight:1.7,color:`var(--text-1)`},children:`网络中断后已保留当前已渲染内容。可点击“开始匹配分析”重新开始生成，页面不会清空已看到的结论。`}):null,(0,k.jsx)(`div`,{style:{marginTop:16,display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(220px, 1fr))`,gap:12},children:$.slice(0,Et).map((e,t)=>(0,k.jsxs)(`article`,{style:{borderRadius:14,border:`1px solid var(--border)`,background:`transparent`,padding:16,display:`grid`,gap:8},children:[(0,k.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:`var(--accent)`,letterSpacing:`0.08em`,textTransform:`uppercase`},children:`Card ${t+1}`}),(0,k.jsx)(`div`,{style:{fontSize:16,fontWeight:800,color:`var(--text-1)`},children:e.title}),(0,k.jsx)(`div`,{style:{fontSize:14,lineHeight:1.65,color:`var(--text-2)`},children:e.content})]},e.id))})]}):null,jt?(0,k.jsxs)(`div`,{style:{marginTop:12,padding:`16px 18px`,borderRadius:16,background:`linear-gradient(135deg, color-mix(in srgb, var(--surface) 98%, rgba(200,90,34,0.06)), color-mix(in srgb, var(--surface) 98%, rgba(200,90,34,0.02)))`,border:`1px solid rgba(200,90,34,0.15)`,display:`flex`,flexDirection:`column`,gap:10,position:`relative`,overflow:`hidden`},children:[(0,k.jsx)(`style`,{children:`
                @keyframes thinking-pulse {
                  0%, 100% { opacity: 0.3; transform: scale(0.8); }
                  50% { opacity: 1; transform: scale(1); }
                }
                @keyframes thinking-wave {
                  0% { transform: translateX(-100%); }
                  100% { transform: translateX(100%); }
                }
              `}),(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,k.jsx)(`div`,{style:{display:`flex`,gap:4,alignItems:`center`},children:[0,1,2].map(e=>(0,k.jsx)(`span`,{style:{width:6,height:6,borderRadius:999,background:`var(--accent)`,animation:X?`thinking-pulse 1.2s ease-in-out ${e*.15}s infinite`:`none`}},e))}),(0,k.jsx)(`span`,{style:{fontSize:14,fontWeight:700,color:`var(--text-1)`,letterSpacing:`0.02em`},children:bt?`模型思考过程`:`分析过程`}),X?(0,k.jsx)(`span`,{style:{fontSize:11,padding:`2px 8px`,borderRadius:999,background:`rgba(200,90,34,0.12)`,color:`var(--accent)`,fontWeight:600,marginLeft:`auto`},children:`实时更新中`}):null,Z.length?(0,k.jsx)(`button`,{type:`button`,className:`btn-secondary`,style:{minHeight:28,padding:`0 10px`,fontSize:12,marginLeft:X?0:`auto`},onClick:()=>At(e=>!e),children:kt?`收起`:`展开`}):null]}),kt?(0,k.jsxs)(`div`,{style:{fontSize:13,color:`var(--text-2)`,lineHeight:1.7,whiteSpace:`pre-wrap`,maxHeight:240,overflowY:`auto`,padding:`12px`,borderRadius:10,background:`var(--surface)`,border:`1px solid var(--border-soft)`,position:`relative`},children:[(0,k.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,height:32,background:`linear-gradient(to bottom, var(--surface), transparent)`,pointerEvents:`none`,zIndex:1}}),(0,k.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,height:32,background:`linear-gradient(to top, var(--surface), transparent)`,pointerEvents:`none`,zIndex:1}}),(0,k.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`},children:Z.length?Z.map((e,t)=>(0,k.jsxs)(`details`,{open:t===Z.length-1,style:{borderBottom:t<Z.length-1?`1px solid var(--border-soft)`:`none`,paddingBottom:t<Z.length-1?8:0},children:[(0,k.jsx)(`summary`,{style:{cursor:`pointer`,fontWeight:600,color:`var(--text-1)`,marginBottom:4},children:e.label}),(0,k.jsx)(`div`,{style:{paddingLeft:14,borderLeft:`2px solid rgba(200,90,34,0.3)`,marginTop:4},children:e.content})]},t)):(0,k.jsx)(`div`,{style:{color:`var(--text-2)`},children:`正在梳理 JD 要求与简历证据…`})})]}):(0,k.jsx)(`div`,{style:{fontSize:13,color:`var(--text-2)`,lineHeight:1.7,padding:`10px 12px`,borderRadius:10,background:`var(--surface)`,border:`1px solid var(--border-soft)`},children:`思考过程已收起，匹配结论会在下方继续实时刷新。`})]}):null,ne?(0,k.jsx)(`div`,{className:`he-err`,children:ne}):null,(0,k.jsx)(_,{billing:ie,label:`本次生成`,showRequests:!0,style:{marginTop:ne?10:0}}),(0,k.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,marginTop:10},children:[l(i)?(0,k.jsxs)(`span`,{className:`he-chip`,style:{fontSize:11},children:[`JD `,l(i).length,` 字`]}):null,l(n)?(0,k.jsxs)(`span`,{className:`he-chip`,style:{fontSize:11},children:[`简历 `,l(n).length,` 字`]}):null]}),(0,k.jsx)(`div`,{id:`resume-match-detail-view`,style:{marginTop:14,width:`100%`},children:wt||le||C&&X?(0,k.jsxs)(`div`,{className:[`he-split-card`,le?`he-restored-focus`:``].join(` `),ref:pe,style:{width:`100%`},children:[(0,k.jsx)(`div`,{className:`he-split-head`,children:(0,k.jsx)(`div`,{children:(0,k.jsx)(Ee,{restoredHint:le,restoredFields:ue,runState:S})})}),(0,k.jsx)(`div`,{className:`he-split-body`,children:wt?(0,k.jsxs)(`div`,{children:[ot?(0,k.jsx)(b,{raw:C?._fallback,variant:`notice`,style:{marginBottom:12,padding:`10px 14px`,borderRadius:14,background:`rgba(244, 136, 53, 0.08)`,border:`1px solid rgba(244, 136, 53, 0.18)`},textStyle:{color:`var(--text-1)`,fontSize:13,fontWeight:600}}):null,(0,k.jsxs)(`div`,{ref:fe,style:{padding:`20px 24px 24px`,borderRadius:20,background:`var(--surface)`,boxShadow:`inset 0 0 0 1px var(--border-soft)`,fontFamily:N},children:[(0,k.jsx)(`div`,{className:`he-muted`,children:typeof C._progress==`number`?`进度：${Math.round(Number(C._progress||0))}%`:``}),(0,k.jsxs)(`div`,{style:{marginTop:12,display:`grid`,gap:18},children:[(0,k.jsxs)(`section`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,justifyContent:`space-between`,gap:12,paddingBottom:8,borderBottom:`1px solid var(--border-soft)`},children:[(0,k.jsx)(`div`,{children:(0,k.jsx)(`div`,{style:{fontSize:22,fontWeight:800,color:`var(--text-1)`,letterSpacing:`-0.02em`},children:`简历匹配结果`})}),(0,k.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:[V==null?null:(0,k.jsxs)(`span`,{className:`he-chip`,children:[`综合 `,V]}),j.fit?(0,k.jsx)(`span`,{className:`he-chip`,children:j.fit}):null]})]}),st?(0,k.jsx)(`section`,{style:{paddingBottom:18,borderBottom:`1px solid var(--border-soft)`},children:(0,k.jsx)(b,{raw:C?._fallback,variant:`hint`,style:{padding:`10px 14px`,borderRadius:14,background:`rgba(244, 136, 53, 0.07)`,border:`1px solid rgba(244, 136, 53, 0.16)`},textStyle:{color:`var(--text-2)`,fontSize:13,lineHeight:1.65}})}):null,(0,k.jsxs)(`section`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,k.jsx)(`style`,{children:`
                          @keyframes score-sweep {
                            0% { stroke-dashoffset: 226; opacity: 0.35; }
                            100% { stroke-dashoffset: 0; opacity: 1; }
                          }
                          .score-card-hover:hover {
                            transform: translateY(-2px);
                            box-shadow: 0 6px 20px rgba(0,0,0,0.06);
                            transition: all 0.2s ease;
                          }
                        `}),(0,k.jsxs)(`article`,{className:`resume-theme-card-alt`,style:{borderRadius:8,padding:24,fontFamily:N,transition:`background-color 240ms ease, color 240ms ease, border-color 240ms ease, box-shadow 240ms ease`},children:[(0,k.jsx)(`div`,{style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:16,flexWrap:`wrap`},children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:Y.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Resume Match Report`}),(0,k.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`},children:[(0,k.jsx)(`div`,{style:{fontSize:30,fontWeight:800,lineHeight:1.15,letterSpacing:`-0.03em`,color:Y.textStrong},children:Fe.headline||`简历匹配结果`}),(0,k.jsxs)(`div`,{style:{position:`relative`,width:56,height:56,flexShrink:0},children:[(0,k.jsxs)(`svg`,{width:`56`,height:`56`,viewBox:`0 0 80 80`,style:{transform:`rotate(-90deg)`},children:[(0,k.jsx)(`circle`,{cx:`40`,cy:`40`,r:`28`,fill:`none`,stroke:Y.ringTrack,strokeWidth:`8`}),V==null?null:(0,k.jsx)(`circle`,{cx:`40`,cy:`40`,r:`28`,fill:`none`,stroke:Y.accent,strokeWidth:`8`,strokeLinecap:`round`,strokeDasharray:`${H||0} ${2*Math.PI*28}`,style:{animation:`score-sweep 900ms ease-out both`}})]}),(0,k.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:21,fontWeight:800,color:Y.textStrong,letterSpacing:`-0.03em`},children:V==null?`--`:`${V}`})]})]})]})}),(0,k.jsxs)(`div`,{style:{display:`grid`,gap:16},children:[(0,k.jsxs)(`div`,{style:{border:`1px solid ${Y.borderSoft}`,borderRadius:8,overflow:`hidden`,background:Y.tableBg},children:[(0,k.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(96px, 120px) minmax(0, 1fr) minmax(0, 1.1fr) 132px`,padding:`12px 14px`,borderBottom:`1px solid ${Y.borderSoft}`,fontSize:11,fontWeight:800,color:Y.textMuted,letterSpacing:`0.10em`,textTransform:`uppercase`},children:[(0,k.jsx)(`div`,{children:`维度`}),(0,k.jsx)(`div`,{children:`JD 期望（必须达到）`}),(0,k.jsx)(`div`,{children:`简历证据（当前达到）`}),(0,k.jsx)(`div`,{children:`差距结论`})]}),q.map((e,t)=>(0,k.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(96px, 120px) minmax(0, 1fr) minmax(0, 1.1fr) 132px`,gap:12,padding:`14px 14px`,borderBottom:t<q.length-1?`1px solid ${Y.borderSoft}`:`none`,background:e.contrastTone===`risk`?Y.accentSoft:`transparent`,alignItems:`start`},children:[(0,k.jsx)(`div`,{style:{fontSize:13,fontWeight:700,color:Y.textStrong,lineHeight:1.45},children:e.label}),(0,k.jsx)(`div`,{style:{fontSize:14,color:e.label===`技能匹配`||e.label===`胜任力判断`?Y.accent:Y.textStrong,fontWeight:e.label===`技能匹配`||e.label===`胜任力判断`?800:600,lineHeight:1.5},children:e.jdExpected}),(0,k.jsx)(`div`,{style:{fontSize:14,color:Y.textBody,lineHeight:1.5},children:e.resumeEvidence}),(0,k.jsx)(`div`,{children:(0,k.jsx)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,border:`1px solid ${e.contrastTone===`risk`?Y.accent:Y.neutralPillBorder}`,background:e.contrastTone===`ok`?Y.rowBg:e.contrastTone===`risk`?Y.accentSoft:Y.neutralPillBg,color:e.contrastTone===`ok`?Y.textStrong:e.contrastTone===`risk`?Y.accent:Y.neutralPillText,fontSize:12,fontWeight:800},children:e.contrast})})]},e.label))]}),(0,k.jsxs)(`div`,{style:{display:`flex`,gap:10,flexWrap:`wrap`},children:[(0,k.jsx)(`a`,{href:Ie,className:`btn-primary`,style:{minHeight:44,padding:`0 16px`,display:`inline-flex`,alignItems:`center`,fontFamily:N},children:`去简历优化`}),St?(0,k.jsx)(`a`,{href:St,className:`btn-secondary`,style:{minHeight:44,padding:`0 16px`,display:`inline-flex`,alignItems:`center`,fontFamily:N},children:`查看评估报告`}):null,(0,k.jsx)(`button`,{type:`button`,className:`btn-secondary`,style:{minHeight:44,padding:`0 16px`,fontFamily:N},disabled:!C,onClick:async()=>{re(``);try{let e=fe.current;if(!e)throw Error(`导出区域不存在`);await m({element:e,fileName:`简历匹配结果.png`,backgroundColor:document.documentElement.dataset.theme===`dark`?`#0f1111`:`#ffffff`,pixelRatio:2})}catch(e){re(String(e?.message||`导出失败`))}},children:`导出 PNG`})]})]})]}),dt.labels.length?(0,k.jsxs)(`section`,{className:`resume-theme-card-alt`,style:{borderRadius:8,padding:`16px 16px 14px`,fontFamily:N,boxShadow:`var(--resume-card-shadow)`,transition:`background-color 240ms ease, color 240ms ease, border-color 240ms ease, box-shadow 240ms ease`},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:Y.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Resume Match Radar`}),(0,k.jsx)(`div`,{style:{...gt,marginTop:6,color:Y.textStrong},children:`岗位要求 vs 简历证据`}),(0,k.jsx)(`div`,{style:{marginTop:6,fontSize:12,color:Y.textBody,lineHeight:1.7},children:`橙色阴影 = JD 目标；蓝色阴影 = 简历证据。两者重叠越多，表示越接近岗位要求。`})]}),(0,k.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,k.jsx)(`span`,{className:`he-chip`,style:{padding:`5px 10px`,borderRadius:6,background:Y.accentSoft,color:Y.accent,border:`1px solid ${Y.accentBorder}`,fontWeight:800},children:`JD 期望（目标）`}),(0,k.jsx)(`span`,{className:`he-chip`,style:{padding:`5px 10px`,borderRadius:6,background:J?`rgba(96,165,250,0.18)`:`rgba(37,99,235,0.10)`,color:J?`#BFDBFE`:`#1D4ED8`,border:`1px solid ${J?`rgba(96,165,250,0.36)`:`rgba(37,99,235,0.22)`}`,fontWeight:800},children:`简历证据（当前）`}),(0,k.jsx)(`span`,{style:{fontSize:11,fontWeight:700,color:Y.textMuted,letterSpacing:`0.04em`},children:`DYNAMIC DIMENSIONS`})]})]}),(0,k.jsx)(`div`,{style:{marginTop:14,paddingTop:12,borderTop:`1px solid ${Y.borderSoft}`},children:(0,k.jsx)(`div`,{style:{minHeight:270,position:`relative`},children:(0,k.jsx)(h,{labels:dt.labels,datasets:[{label:`JD期望（目标）`,values:dt.jdValues,stroke:J?`#F59E42`:Y.accent,fill:J?`rgba(245,158,66,0.30)`:`rgba(255,106,0,0.24)`,missingMask:dt.missingMask},{label:`简历证据（当前）`,values:dt.resumeValues,stroke:J?`#60A5FA`:`#2563EB`,fill:J?`rgba(96,165,250,0.24)`:`rgba(37,99,235,0.20)`,missingMask:dt.missingMask}],maxValue:10,size:260,theme:ht,footerNote:ft,showScaleLabels:!1,showPointMarkers:!1,showValueLabels:!1,ringCount:2,interactiveTooltip:!1},dt.labels.join(`,`)+`_`+C?._ts)})})]}):null,xt.length?(0,k.jsx)(ve,{summaryText:Q,sections:xt}):null,(0,k.jsx)(_e,{insights:C,onRetry:()=>{X||(Qe?Ze():F())}})]}),j.highlights.length||Re.length?(0,k.jsxs)(`section`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(280px, 1fr))`,gap:16},children:[j.highlights.length?(0,k.jsxs)(`section`,{className:`resume-theme-card`,style:{borderRadius:8,padding:20,fontFamily:N},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,justifyContent:`space-between`,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:Y.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Highlight Evidence`}),(0,k.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,lineHeight:1.2,color:Y.textStrong},children:`亮点证据`})]}),(0,k.jsxs)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,background:Y.accentSoft,border:`1px solid ${Y.accentBorder}`,color:Y.accent,fontSize:11,fontWeight:800},children:[j.highlights.length,` 条重点`]})]}),(0,k.jsx)(`div`,{style:{marginTop:14,borderTop:`1px solid ${Y.borderSoft}`},children:j.highlights.slice(0,8).map((e,t)=>(0,k.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`28px minmax(0, 1fr)`,gap:10,padding:`12px 0`,borderBottom:t<Math.min(j.highlights.length,8)-1?`1px solid ${Y.borderSoft}`:`none`},children:[(0,k.jsx)(`div`,{style:{width:24,height:24,borderRadius:999,background:Y.accentSoft,color:Y.accent,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:11,fontWeight:800},children:t+1}),(0,k.jsx)(`div`,{style:{fontSize:14,lineHeight:1.6,color:Y.textStrong},children:e})]},t))})]}):null,Re.length?(0,k.jsxs)(`section`,{className:`resume-theme-card`,style:{borderRadius:8,padding:20,fontFamily:N},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,justifyContent:`space-between`,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:Y.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Risk Signals`}),(0,k.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,lineHeight:1.2,color:Y.textStrong},children:`风险信号`})]}),(0,k.jsx)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,background:Y.badgeDarkBg,color:Y.badgeDarkText,border:`1px solid ${Y.badgeDarkBorder}`,fontSize:11,fontWeight:800},children:`需重点核查`})]}),(0,k.jsx)(`div`,{style:{marginTop:14,borderTop:`1px solid ${Y.borderSoft}`},children:Re.map((e,t)=>(0,k.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`28px minmax(0, 1fr)`,gap:10,padding:`12px 0`,borderBottom:t<Re.length-1?`1px solid ${Y.borderSoft}`:`none`},children:[(0,k.jsx)(`div`,{style:{width:24,height:24,borderRadius:999,border:`1px solid ${Y.accentBorder}`,color:Y.accent,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:11,fontWeight:800},children:`!`}),(0,k.jsx)(`div`,{style:{fontSize:14,lineHeight:1.6,color:Y.textStrong},children:e})]},t))})]}):null]}):null,L.length?(0,k.jsxs)(`section`,{className:`resume-theme-card`,style:{borderRadius:8,padding:20,fontFamily:N},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-end`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:Y.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Keyword Coverage`}),(0,k.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,lineHeight:1.2,color:Y.textStrong},children:`ATS / JD 关键词对比`}),(0,k.jsx)(`div`,{style:{marginTop:8,fontSize:14,color:Y.textBody,lineHeight:1.6},children:`用对齐表格直接看 JD 要求、简历覆盖程度与优先补强项。`})]}),(0,k.jsxs)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,border:`1px solid ${Y.neutralPillBorder}`,background:Y.neutralPillBg,color:Y.neutralPillText,fontSize:11,fontWeight:800},children:[L.length,` 项对比`]})]}),(0,k.jsxs)(`div`,{style:{marginTop:16,border:`1px solid ${Y.borderSoft}`,borderRadius:8,overflow:`hidden`,background:Y.tableBg},children:[(0,k.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(140px, 1.2fr) 92px 92px 92px 88px`,gap:12,padding:`12px 14px`,borderBottom:`1px solid ${Y.borderSoft}`,fontSize:11,fontWeight:800,color:Y.textMuted,textTransform:`uppercase`,letterSpacing:`0.10em`},children:[(0,k.jsx)(`div`,{children:`关键词`}),(0,k.jsx)(`div`,{children:`JD`}),(0,k.jsx)(`div`,{children:`简历`}),(0,k.jsx)(`div`,{children:`状态`}),(0,k.jsx)(`div`,{children:`动作`})]}),(0,k.jsx)(`div`,{style:{display:`grid`,gap:0},children:L.map((e,t)=>{let n=e.status===`match`?{color:Y.keywordOk,bg:Y.rowBg,bar:Y.keywordOk,label:`覆盖`}:e.status===`miss`?{color:Y.accent,bg:Y.accentSoft,bar:Y.accent,label:`缺口`}:{color:Y.accent,bg:J?`rgba(232,137,92,0.10)`:`rgba(255,102,0,0.06)`,bar:Y.accent,label:`部分`},r=Math.min(10,Math.max(0,Math.round(e.resume||0))),i=Math.min(10,Math.max(0,Math.round(e.jd||0)));return(0,k.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`minmax(140px, 1.2fr) 92px 92px 92px 88px`,gap:12,padding:`14px 14px`,borderBottom:t<L.length-1?`1px solid ${Y.borderSoft}`:`none`,background:n.bg,alignItems:`center`},children:[(0,k.jsxs)(`div`,{style:{minWidth:0},children:[(0,k.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexWrap:`wrap`},children:(0,k.jsx)(`span`,{style:{fontWeight:700,fontSize:13,color:Y.textStrong,textDecoration:e.status===`miss`?`line-through`:`none`,textDecorationColor:Y.accent,textDecorationThickness:`1.5px`},children:e.keyword})}),e.note?(0,k.jsx)(`div`,{style:{marginTop:5,fontSize:12,lineHeight:1.5,color:Y.textMuted},children:e.note}):null]}),(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{style:{fontSize:12,fontWeight:800,color:Y.textStrong},children:[i,`/10`]}),(0,k.jsx)(`div`,{style:{marginTop:6,height:4,borderRadius:2,background:Y.track,overflow:`hidden`},children:(0,k.jsx)(`div`,{style:{width:`${i*10}%`,height:`100%`,background:Y.keywordOk,borderRadius:2}})})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{style:{fontSize:12,fontWeight:800,color:e.status===`match`?Y.textStrong:Y.accent},children:[r,`/10`]}),(0,k.jsx)(`div`,{style:{marginTop:6,height:4,borderRadius:2,background:Y.track,overflow:`hidden`},children:(0,k.jsx)(`div`,{style:{width:`${r*10}%`,height:`100%`,background:n.bar,borderRadius:2}})})]}),(0,k.jsx)(`div`,{children:(0,k.jsx)(`span`,{style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,border:`1px solid ${n.color}33`,color:n.color,fontSize:11,fontWeight:800,background:Y.neutralPillBg},children:n.label})}),(0,k.jsx)(`div`,{children:e.status===`match`?(0,k.jsx)(`span`,{style:{fontSize:11,fontWeight:700,color:Y.textSoft},children:`已满足`}):(0,k.jsx)(`a`,{href:Ie,style:{minHeight:28,padding:`0 10px`,display:`inline-flex`,alignItems:`center`,borderRadius:999,background:Y.accent,color:Y.inverseText,fontSize:11,fontWeight:800,textDecoration:`none`},children:`去补齐`})})]},`${e.keyword}_${t}`)})})]})]}):null,it.length||at.length?(0,k.jsxs)(`section`,{style:{...vt,paddingBottom:18},children:[(0,k.jsx)(`div`,{className:`he-label`,style:gt,children:`岗位与简历关键词`}),it.length?(0,k.jsxs)(`div`,{style:{marginTop:10},children:[(0,k.jsx)(`div`,{className:`he-label`,style:{fontSize:13,fontWeight:700,color:`var(--text-2)`},children:`岗位 / JD 胜任力关键词`}),(0,k.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexWrap:`wrap`,gap:8},children:it.map(e=>(0,k.jsx)(`span`,{style:_t,children:e},`jd_${e}`))})]}):null,at.length?(0,k.jsxs)(`div`,{style:{marginTop:it.length?14:10},children:[(0,k.jsx)(`div`,{className:`he-label`,style:{fontSize:13,fontWeight:700,color:`var(--text-2)`},children:`简历已体现关键词`}),(0,k.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexWrap:`wrap`,gap:8},children:at.map(e=>(0,k.jsx)(`span`,{style:_t,children:e},`resume_${e}`))})]}):null]}):null,nt.length||rt.length?(0,k.jsxs)(`section`,{style:{display:`flex`,flexDirection:`column`,gap:14},children:[nt.length?(0,k.jsxs)(`div`,{style:{...vt,background:J?`linear-gradient(180deg, #171b1b 0%, #121515 100%)`:`linear-gradient(180deg, #fffdfb 0%, #faf5ef 100%)`},children:[(0,k.jsx)(`div`,{className:`he-label`,style:gt,children:`注意事项`}),(0,k.jsx)(`div`,{className:`he-pre`,style:{marginTop:10},children:nt.map(e=>`• ${e}`).join(`
`)})]}):null,rt.length?(0,k.jsxs)(`section`,{className:`resume-theme-card`,style:{borderRadius:8,padding:20,fontFamily:N},children:[(0,k.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-end`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{style:{fontSize:11,fontWeight:800,color:Y.textMuted,textTransform:`uppercase`,letterSpacing:`0.12em`},children:`Next Actions`}),(0,k.jsx)(`div`,{style:{marginTop:6,fontSize:22,fontWeight:800,lineHeight:1.2,color:Y.textStrong},children:`下一步行动建议`}),(0,k.jsx)(`div`,{style:{marginTop:8,fontSize:14,color:Y.textBody,lineHeight:1.6},children:`先处理最影响投递判断的事项，再进入改写与补证据动作。`})]}),(0,k.jsx)(`a`,{href:Ie,className:`btn-primary`,style:{minHeight:44,padding:`0 16px`,display:`inline-flex`,alignItems:`center`,fontFamily:N},children:`继续下一步`})]}),(0,k.jsx)(`div`,{style:{marginTop:16,borderTop:`1px solid ${Y.borderSoft}`},children:rt.map((e,t)=>(0,k.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`30px minmax(0, 1fr)`,gap:10,padding:`12px 0`,borderBottom:t<rt.length-1?`1px solid ${Y.borderSoft}`:`none`},children:[(0,k.jsx)(`div`,{style:{width:24,height:24,borderRadius:999,background:Y.accent,color:Y.inverseText,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:11,fontWeight:800},children:t+1}),(0,k.jsx)(`div`,{style:{fontSize:14,lineHeight:1.6,color:Y.textStrong},children:e})]},t))})]}):null]}):null]})]})]}):C&&X?(0,k.jsx)(`div`,{style:{padding:`16px 18px`,borderRadius:14,border:`1px solid var(--border-soft)`,background:`var(--surface)`,color:`var(--text-2)`,lineHeight:1.75},children:`已生成阶段性匹配内容，正在汇总最终结论与报告卡片，请稍候片刻。`}):null})]}):null})]})]})})}export{Je as default};