hunter-mate 0.1.19 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/assets/extension/background/{service-worker.20261008011501.js → service-worker.20261015181453.js} +8 -8
  2. package/dist/assets/extension/background/service-worker.js +8 -8
  3. package/dist/assets/extension/build-info.json +1 -1
  4. package/dist/assets/extension/content/index.js +2 -2
  5. package/dist/assets/extension/manifest.json +3 -3
  6. package/dist/assets/extension/offscreen/offscreen.html +1 -1
  7. package/dist/assets/extension/offscreen/offscreen.js +2 -2
  8. package/dist/assets/extension/package.json +1 -1
  9. package/dist/assets/server/chunks/{chunk-IXYSL3NT.mjs → chunk-BLXHCSZD.mjs} +8 -10
  10. package/dist/assets/server/chunks/{script-rule-ANR2J7E6.mjs → script-rule-ZJN6CEYX.mjs} +1 -1
  11. package/dist/assets/server/main.mjs +4087 -2872
  12. package/dist/index.js +231 -52
  13. package/dist/web/dist/404.html +1 -1
  14. package/dist/web/dist/_next/static/cIjUG1nvMEwYon0Zb8dYt/_buildManifest.js +1 -0
  15. package/dist/web/dist/_next/static/chunks/105-dcd8f6d5867c8995.js +32 -0
  16. package/dist/web/dist/_next/static/chunks/166.b263e636ff66212f.js +1 -0
  17. package/dist/web/dist/_next/static/chunks/1e6d5a0c.75afa2d319272f42.js +15 -0
  18. package/dist/web/dist/_next/static/chunks/555-e2a871b9d2eccb03.js +12 -0
  19. package/dist/web/dist/_next/static/chunks/589-f984bff035a1cb85.js +1 -0
  20. package/dist/web/dist/_next/static/chunks/671.ae431f885d6c7f0c.js +1 -0
  21. package/dist/web/dist/_next/static/chunks/686-9f419b70feea9470.js +1 -0
  22. package/dist/web/dist/_next/static/chunks/852-248884963a986600.js +1 -0
  23. package/dist/web/dist/_next/static/chunks/865-0ed23dd43c0832a2.js +1 -0
  24. package/dist/web/dist/_next/static/chunks/935-7be3e60dd8bc29d2.js +5 -0
  25. package/dist/web/dist/_next/static/chunks/954-fb0212fe71f60a52.js +1 -0
  26. package/dist/web/dist/_next/static/chunks/a7067448-e416655baf443992.js +1 -0
  27. package/dist/web/dist/_next/static/chunks/app/_not-found/page-5b7249eb3c9a6cb9.js +1 -0
  28. package/dist/web/dist/_next/static/chunks/app/admin/data/page-14698e9c4ddaa6d9.js +1 -0
  29. package/dist/web/dist/_next/static/chunks/app/auth/verify/page-05304d5803008d61.js +1 -0
  30. package/dist/web/dist/_next/static/chunks/app/companies/page-ec27ce9ab3610221.js +1 -0
  31. package/dist/web/dist/_next/static/chunks/app/company/admin/page-c2584183bc4b34d1.js +1 -0
  32. package/dist/web/dist/_next/static/chunks/app/entity/page-08755f96102f0565.js +1 -0
  33. package/dist/web/dist/_next/static/chunks/app/jobs/page-4175a90f1b42f87d.js +1 -0
  34. package/dist/web/dist/_next/static/chunks/app/layout-af39afc7866e74db.js +1 -0
  35. package/dist/web/dist/_next/static/chunks/app/logs/page-be50a4e10b1a0024.js +1 -0
  36. package/dist/web/dist/_next/static/chunks/app/matching/jobs/[id]/talents/page-cf445b0cb8c2cb0a.js +1 -0
  37. package/dist/web/dist/_next/static/chunks/app/matching/portraits/[id]/jobs/page-c7ff0d79b6a75915.js +1 -0
  38. package/dist/web/dist/_next/static/chunks/app/page-bd282e1e5f0965f1.js +1 -0
  39. package/dist/web/dist/_next/static/chunks/app/parselog/page-9814e75d6900a743.js +1 -0
  40. package/dist/web/dist/_next/static/chunks/app/recordings/page-441016638b43c4f8.js +1 -0
  41. package/dist/web/dist/_next/static/chunks/app/resource-usage/page-f6fa06bfe21bcd32.js +1 -0
  42. package/dist/web/dist/_next/static/chunks/app/shared/[token]/page-c9c5042a2d07c0bc.js +1 -0
  43. package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/page-f54cf2f0058035ca.js +1 -0
  44. package/dist/web/dist/_next/static/chunks/app/talents/page-c0a0c250eb5f5459.js +1 -0
  45. package/dist/web/dist/_next/static/chunks/app/team/insights/page-8b3934df3e292368.js +1 -0
  46. package/dist/web/dist/_next/static/chunks/framework-8aa939434277315a.js +1 -0
  47. package/dist/web/dist/_next/static/chunks/main-8a2c75d6c43385dd.js +1 -0
  48. package/dist/web/dist/_next/static/chunks/main-app-f496bd51a73ef9f3.js +1 -0
  49. package/dist/web/dist/_next/static/chunks/pages/_app-037e1cd81d653e68.js +4 -0
  50. package/dist/web/dist/_next/static/chunks/pages/_error-59095d3b83385d1f.js +1 -0
  51. package/dist/web/dist/_next/static/chunks/{webpack-cf21e951181fd345.js → webpack-54e74ccc9e9451ee.js} +1 -1
  52. package/dist/web/dist/_next/static/css/bd072fee69ae8474.css +3 -0
  53. package/dist/web/dist/admin/data.html +1 -1
  54. package/dist/web/dist/admin/data.txt +8 -6
  55. package/dist/web/dist/auth/verify.html +1 -1
  56. package/dist/web/dist/auth/verify.txt +8 -6
  57. package/dist/web/dist/companies.html +1 -1
  58. package/dist/web/dist/companies.txt +9 -7
  59. package/dist/web/dist/company/admin.html +1 -1
  60. package/dist/web/dist/company/admin.txt +8 -6
  61. package/dist/web/dist/entity.html +1 -1
  62. package/dist/web/dist/entity.txt +9 -7
  63. package/dist/web/dist/index.html +1 -1
  64. package/dist/web/dist/index.txt +9 -7
  65. package/dist/web/dist/jobs.html +1 -1
  66. package/dist/web/dist/jobs.txt +9 -7
  67. package/dist/web/dist/logs.html +1 -1
  68. package/dist/web/dist/logs.txt +9 -7
  69. package/dist/web/dist/matching/jobs/placeholder/talents.html +1 -1
  70. package/dist/web/dist/matching/jobs/placeholder/talents.txt +8 -6
  71. package/dist/web/dist/matching/portraits/placeholder/jobs.html +1 -1
  72. package/dist/web/dist/matching/portraits/placeholder/jobs.txt +8 -6
  73. package/dist/web/dist/parselog.html +1 -1
  74. package/dist/web/dist/parselog.txt +9 -7
  75. package/dist/web/dist/recordings.html +1 -1
  76. package/dist/web/dist/recordings.txt +9 -7
  77. package/dist/web/dist/resource-usage.html +1 -1
  78. package/dist/web/dist/resource-usage.txt +9 -7
  79. package/dist/web/dist/shared/placeholder.html +1 -1
  80. package/dist/web/dist/shared/placeholder.txt +8 -6
  81. package/dist/web/dist/snapshots/placeholder/agent-prompt.html +1 -1
  82. package/dist/web/dist/snapshots/placeholder/agent-prompt.txt +8 -6
  83. package/dist/web/dist/talents.html +1 -1
  84. package/dist/web/dist/talents.txt +8 -6
  85. package/dist/web/dist/team/insights.html +1 -1
  86. package/dist/web/dist/team/insights.txt +8 -6
  87. package/package.json +1 -1
  88. package/dist/web/dist/_next/static/9Wm8FfXwBJyMk-wYf4l81/_buildManifest.js +0 -1
  89. package/dist/web/dist/_next/static/chunks/166.f30be223f694f8ee.js +0 -1
  90. package/dist/web/dist/_next/static/chunks/1e6d5a0c.0488932e17ecdf24.js +0 -15
  91. package/dist/web/dist/_next/static/chunks/542-4a43545450151f1d.js +0 -1
  92. package/dist/web/dist/_next/static/chunks/589-5e99e548a0ee6bac.js +0 -1
  93. package/dist/web/dist/_next/static/chunks/670-750aa43678fb0d30.js +0 -1
  94. package/dist/web/dist/_next/static/chunks/671.3b8e9cc96b25b6ea.js +0 -1
  95. package/dist/web/dist/_next/static/chunks/686-ade57c57a1737818.js +0 -1
  96. package/dist/web/dist/_next/static/chunks/852-5150a7ae95a599fb.js +0 -1
  97. package/dist/web/dist/_next/static/chunks/935-4058f12c3d405b32.js +0 -5
  98. package/dist/web/dist/_next/static/chunks/a7067448-d3882c7e74c162bf.js +0 -1
  99. package/dist/web/dist/_next/static/chunks/app/_not-found/page-cf5ab201496f0914.js +0 -1
  100. package/dist/web/dist/_next/static/chunks/app/admin/data/page-a566c6b13c61f9d4.js +0 -1
  101. package/dist/web/dist/_next/static/chunks/app/auth/verify/page-38fa28a48f76defa.js +0 -1
  102. package/dist/web/dist/_next/static/chunks/app/companies/page-058047767bc162f4.js +0 -1
  103. package/dist/web/dist/_next/static/chunks/app/company/admin/page-a2088b59c3820800.js +0 -1
  104. package/dist/web/dist/_next/static/chunks/app/entity/page-dc9664fb628e2d08.js +0 -1
  105. package/dist/web/dist/_next/static/chunks/app/jobs/page-4fb6a67d044b238d.js +0 -1
  106. package/dist/web/dist/_next/static/chunks/app/layout-1feb99bf08beb3c8.js +0 -1
  107. package/dist/web/dist/_next/static/chunks/app/logs/page-ccc6bb863cf77e56.js +0 -1
  108. package/dist/web/dist/_next/static/chunks/app/matching/jobs/[id]/talents/page-c6714cec1ffd7c5e.js +0 -1
  109. package/dist/web/dist/_next/static/chunks/app/matching/portraits/[id]/jobs/page-658eca1ae5ca29dc.js +0 -1
  110. package/dist/web/dist/_next/static/chunks/app/page-291cd145a56bd020.js +0 -1
  111. package/dist/web/dist/_next/static/chunks/app/parselog/page-b1b7ae9483273ce0.js +0 -1
  112. package/dist/web/dist/_next/static/chunks/app/recordings/page-c12948f01885099e.js +0 -1
  113. package/dist/web/dist/_next/static/chunks/app/resource-usage/page-8394e96892688180.js +0 -1
  114. package/dist/web/dist/_next/static/chunks/app/shared/[token]/page-e859e87f2301b120.js +0 -1
  115. package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/page-f519552be54e3bdf.js +0 -1
  116. package/dist/web/dist/_next/static/chunks/app/talents/page-75af05473ea322d9.js +0 -1
  117. package/dist/web/dist/_next/static/chunks/app/team/insights/page-7b8769e35cd9987b.js +0 -1
  118. package/dist/web/dist/_next/static/chunks/framework-b3a558b17a070965.js +0 -1
  119. package/dist/web/dist/_next/static/chunks/main-8d45182e1c21cb95.js +0 -1
  120. package/dist/web/dist/_next/static/chunks/main-app-70da092dee991648.js +0 -1
  121. package/dist/web/dist/_next/static/chunks/pages/_app-8438560f1c1a7980.js +0 -4
  122. package/dist/web/dist/_next/static/chunks/pages/_error-17756f67e0a11350.js +0 -1
  123. package/dist/web/dist/_next/static/css/9eaf0c9cc1c24641.css +0 -3
  124. /package/dist/web/dist/_next/static/{9Wm8FfXwBJyMk-wYf4l81 → cIjUG1nvMEwYon0Zb8dYt}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b4eca890-97d2-4b77-9f1e-1565dc9efdb8",e._sentryDebugIdIdentifier="sentry-dbid-b4eca890-97d2-4b77-9f1e-1565dc9efdb8")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[852],{852:function(e,t,l){l.d(t,{EntityListPage:function(){return X}});var s=l(2835),a=l(635),r=l(7473),n=l(4431),i=l(7202),d=l(4518),o=l(3718),c=l(9036),u=l(8448),x=l(6777);let m=["workExperiences","projects","education"],h={intent:["position","salary","city","industries"]},p={name:"姓名",headline:"头衔",currentPosition:"现职位",currentCompany:"现公司",city:"城市",degree:"学历",workYears:"工作年限",age:"年龄",gender:"性别",resId:"resId",statusTag:"状态标签",contactTime:"方便联系时间",phone:"电话",email:"邮箱",profileUrl:"主页 URL",sourceUrl:"来源 URL",selfEvaluation:"自我评价",statement:"平台声明","intent.position":"期望职位","intent.salary":"期望薪资","intent.city":"期望城市","intent.industries":"期望行业",updatedAt:"更新时间"},g={workExperiences:"工作经历",projects:"项目经历",education:"教育经历"},v={company:"公司",position:"职位",period:"时间段",start:"开始",end:"结束",department:"部门",location:"地点",reportsTo:"汇报对象",school:"学校",major:"专业",degree:"学历",name:"名称",role:"角色",description:"描述",duties:"职责",industry:"行业"};function b(e){return null==e||""===e?"—":Array.isArray(e)?e.length?e.map(e=>b(e)).filter(e=>"—"!==e).join("、"):"—":"object"==typeof e?JSON.stringify(e):"string"==typeof e&&/^\d{4}-\d{2}-\d{2}T/.test(e)?(0,u.d3)(e):String(e)}function y(e){var t;let{entity:l}=e,i=(0,r.useRouter)(),d=l.id,[o,c]=(0,a.useState)(null),[x,y]=(0,a.useState)(!1),[j,f]=(0,a.useState)({}),[N,w]=(0,a.useState)(null),[k,S]=(0,a.useState)(new Set),[C,A]=(0,a.useState)({}),[T,I]=(0,a.useState)({}),[E,U]=(0,a.useState)(!1),[D,O]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=!0;return c(null),O(""),(0,n.rd)("/entities/talent/".concat(d,"/duplicates")).then(t=>{var l;e&&c(null!==(l=null==t?void 0:t.candidates)&&void 0!==l?l:[])}),()=>{e=!1}},[d]);let F=(0,a.useMemo)(()=>{var e;return null!==(e=l.extracted)&&void 0!==e?e:{}},[l.extracted]),P=async e=>{if(j[e])return j[e];let t=await (0,n.rd)("/entities/talent/".concat(e));return(null==t?void 0:t.entity)?(f(l=>({...l,[e]:t.entity})),t.entity):null},L=async()=>{var e,t,l,s,a,r,n;U(!0),O("");let i=[d,...(null!=o?o:[]).map(e=>e.talent.id)],c=await Promise.all(i.map(e=>P(e)));if(U(!1),c.some(e=>!e)){O("全量简历拉取失败,请重试");return}let u=c[0],x=null!==(t=u.extracted)&&void 0!==t?t:{},p={name:u.name,headline:u.headline},g={};for(let e of Object.keys(x))if(m.includes(e))g[e]=Array.isArray(x[e])?[...x[e]]:[];else if(h[e]){let t=null!==(s=x[e])&&void 0!==s?s:{};for(let l of h[e])p["".concat(e,".").concat(l)]=null!==(a=t[l])&&void 0!==a?a:"industries"===l?[]:""}else(null==(n=x[e])||["string","number","boolean"].includes(typeof n))&&!e.startsWith("_")&&(p[e]=null!==(l=x[e])&&void 0!==l?l:"");A(p),I(g),w(null!==(r=null==o?void 0:null===(e=o[0])||void 0===e?void 0:e.talent.id)&&void 0!==r?r:null),y(!0)},M=e=>{var t;let s=[],a=t=>{var l,s,a,r;if(t){if("name"===e)return t.name;if("headline"===e)return t.headline;if(e.startsWith("intent.")){let l=e.slice(7),r=null===(a=t.extracted)||void 0===a?void 0:null===(s=a.intent)||void 0===s?void 0:s[l];return"industries"===l?Array.isArray(r)?r:[]:null!=r?r:""}return null!==(r=null===(l=t.extracted)||void 0===l?void 0:l[e])&&void 0!==r?r:""}},r=a(null!==(t=j[d])&&void 0!==t?t:l);for(let e of(s.push({id:0,label:"当前",value:r}),null!=o?o:[])){let t=j[e.talent.id];if(!t)continue;let l=a(t);void 0!==l&&"—"!==b(l)&&s.push({id:e.talent.id,label:"#".concat(e.talent.id),value:l})}return s},_=(e,t)=>A(l=>({...l,[e]:t})),B=async e=>{U(!0);let t=await (0,n.rd)("/entities/talent/".concat(d,"/duplicates/dismiss"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({otherId:e})});U(!1),t?(c(t=>(null!=t?t:[]).filter(t=>t.talent.id!==e)),N===e&&w(null)):O("标注失败,请重试")},q=async()=>{var e,t,l,s;let a={...F};for(let[t,l]of Object.entries(C))if("name"!==t&&"headline"!==t){if(t.startsWith("intent.")){let s=t.slice(7);a.intent={...null!==(e=a.intent)&&void 0!==e?e:{},[s]:l}}else a[t]="number"!=typeof(s=F[t])||"string"!=typeof l||""===l.trim()||Number.isNaN(Number(l))?"boolean"==typeof s&&"string"==typeof l?"true"===l:l:Number(l)}for(let e of m)T[e]&&(a[e]=T[e]);let r=(null!=o?o:[]).filter(e=>!k.has(e.talent.id)).map(e=>e.talent.id);if(0===r.length){O("未勾选任何候选参与合并");return}U(!0);let c=!1;for(let e of r)if(!await (0,n.rd)("/entities/talent/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:d,removeId:e,extracted:a,name:null!==(t=C.name)&&void 0!==t?t:null,headline:null!==(l=C.headline)&&void 0!==l?l:null})})){c=!0;break}if(U(!1),c){O("合并失败,请重试");return}i.replace("/talents?id=".concat(d)),i.refresh(),window.location.reload()},R=async()=>{let e=(null!=o?o:[]).filter(e=>!k.has(e.talent.id)).map(e=>e.talent.id);if(0===e.length){O("未勾选任何候选参与合并");return}U(!0);let t=!0;for(let l of e)if(!await (0,n.rd)("/entities/talent/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepId:d,removeId:l})})){t=!1;break}if(U(!1),!t){O("合并失败,请重试");return}i.replace("/talents?id=".concat(d)),i.refresh(),window.location.reload()};if(null===o||0===o.length)return null;let Y=null!==(t=o.find(e=>e.talent.id===N))&&void 0!==t?t:null,J=null!=N?j[N]:null,z=e=>(0,s.jsx)("span",{className:"flex flex-wrap items-center gap-1",children:M(e).map(t=>(0,s.jsx)("button",{type:"button",title:"采纳:".concat(b(t.value)),onClick:()=>_(e,t.value),className:"rounded border border-gray-200 px-1.5 py-0.5 text-xs text-gray-500 hover:border-blue-400 hover:text-blue-600",children:t.label},t.id))});return(0,s.jsxs)("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("span",{className:"text-sm font-medium text-amber-800",children:["发现 ",o.length," 条可能重复的人才记录"]}),(0,s.jsx)("button",{onClick:()=>void L(),disabled:E,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700 disabled:opacity-50",children:"查看并处理"}),(0,s.jsx)("button",{onClick:()=>void B(o[0].talent.id),disabled:E,className:"rounded border border-amber-400 px-3 py-1 text-sm text-amber-700 hover:bg-amber-100 disabled:opacity-50",children:"与最高分条目非重复"}),D?(0,s.jsx)("span",{className:"text-sm text-red-600",children:D}):null]}),x?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-2 sm:p-4",onClick:()=>y(!1),children:(0,s.jsxs)("div",{className:"flex max-h-[92vh] w-full max-w-6xl flex-col overflow-hidden rounded-lg bg-white shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 border-b border-gray-200 px-4 py-3",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"重复简历合并工作区"}),(0,s.jsxs)("span",{className:"text-sm text-gray-500",children:["当前 #",d,l.name?" \xb7 ".concat(l.name):""," — ",o.length," 条候选"]}),(0,s.jsx)("button",{onClick:()=>y(!1),className:"ml-auto text-sm text-gray-500 hover:text-gray-700",children:"关闭"})]}),(0,s.jsxs)("div",{className:"grid flex-1 gap-0 overflow-hidden md:grid-cols-[250px,1fr]",children:[(0,s.jsxs)("div",{className:"overflow-y-auto border-b border-gray-200 p-3 md:border-b-0 md:border-r",children:[(0,s.jsx)("div",{className:"mb-2 text-xs font-medium text-gray-500",children:"候选简历(逐条处理)"}),(0,s.jsx)("div",{className:"space-y-2",children:o.map(e=>{var t;return(0,s.jsxs)("div",{className:"rounded-lg border p-2 ".concat(N===e.talent.id?"border-blue-400 bg-blue-50":"border-gray-200"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:!k.has(e.talent.id),disabled:E,onChange:t=>{S(l=>{let s=new Set(l);return t.target.checked?s.delete(e.talent.id):s.add(e.talent.id),s})},title:"勾选=同一人,参与本次合并"}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-900",children:null!==(t=e.talent.name)&&void 0!==t?t:"(未命名)"}),(0,s.jsxs)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600",children:["相似度 ",e.score]})]}),(0,s.jsxs)("div",{className:"mt-0.5 truncate text-xs text-gray-500",title:e.talent.sourceUrl,children:[e.talent.source," \xb7 ",(0,u.d3)(e.talent.updatedAt)]}),(0,s.jsxs)("div",{className:"mt-1.5 flex gap-1.5",children:[(0,s.jsx)("button",{type:"button",onClick:()=>w(e.talent.id),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-50",children:"选中对比"}),(0,s.jsx)("button",{type:"button",disabled:E,onClick:()=>void B(e.talent.id),className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-700 hover:bg-gray-50 disabled:opacity-50",children:"非同一人"})]})]},e.talent.id)})})]}),(0,s.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 border-b border-gray-100 px-3 py-2",children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:"最终采用简历(可编辑)"}),(0,s.jsx)("button",{type:"button",onClick:()=>{L()},className:"rounded border border-gray-300 px-2 py-0.5 text-xs text-gray-600 hover:bg-gray-50",children:"重置为当前简历"})]}),(0,s.jsx)("div",{className:"divide-y divide-gray-100",children:Object.keys(C).map(e=>{var t,a;return(0,s.jsxs)("div",{className:"grid grid-cols-[90px,1fr,auto] items-center gap-2 px-3 py-1.5",children:[(0,s.jsx)("label",{className:"text-xs text-gray-500",children:null!==(t=p[e])&&void 0!==t?t:e}),"sourceUrl"===e?(0,s.jsx)("a",{href:String(null!==(a=C[e])&&void 0!==a?a:l.sourceUrl),target:"_blank",rel:"noreferrer",className:"truncate text-sm text-blue-600 hover:underline",children:"—"===b(C[e])?l.sourceUrl:b(C[e])}):"selfEvaluation"===e||"statement"===e?(0,s.jsx)("textarea",{value:"—"===b(C[e])?"":String(C[e]),onChange:t=>_(e,t.target.value),rows:2,className:"w-full rounded border border-gray-300 px-2 py-1 text-sm"}):(0,s.jsx)("input",{value:"—"===b(C[e])?"":String(C[e]),onChange:t=>_(e,t.target.value),className:"w-full rounded border border-gray-300 px-2 py-1 text-sm"}),z(e)]},e)})})]}),m.map(e=>{var t,l,a;let r=null!==(t=T[e])&&void 0!==t?t:[],n=[];for(let t of null!=o?o:[]){let s=j[t.talent.id],a=null==s?void 0:null===(l=s.extracted)||void 0===l?void 0:l[e];Array.isArray(a)&&a.forEach(e=>n.push({id:t.talent.id,item:e}))}return(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,s.jsx)("div",{className:"flex items-center justify-between border-b border-gray-100 px-3 py-2",children:(0,s.jsxs)("h4",{className:"text-sm font-semibold text-gray-900",children:[null!==(a=g[e])&&void 0!==a?a:e,"(",r.length,")"]})}),0===r.length&&0===n.length?(0,s.jsx)("p",{className:"px-3 py-2 text-xs text-gray-400",children:"两侧均无数据"}):(0,s.jsxs)("div",{className:"space-y-2 p-3",children:[r.map((t,l)=>(0,s.jsxs)("div",{className:"rounded border border-gray-200 p-2",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 lg:grid-cols-4",children:Object.keys(null!=t?t:{}).filter(e=>!e.startsWith("_")).map(a=>{var n;return(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"text-xs text-gray-400",children:null!==(n=v[a])&&void 0!==n?n:a}),"string"==typeof t[a]&&t[a].length>40?(0,s.jsx)("textarea",{value:t[a],rows:2,onChange:t=>{let s=[...r];s[l]={...s[l],[a]:t.target.value},I(t=>({...t,[e]:s}))},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"}):(0,s.jsx)("input",{value:"—"===b(t[a])?"":String(t[a]),onChange:t=>{let s=[...r];s[l]={...s[l],[a]:t.target.value},I(t=>({...t,[e]:s}))},className:"w-full rounded border border-gray-300 px-2 py-1 text-xs"})]},a)})}),(0,s.jsx)("div",{className:"mt-1.5 flex items-center gap-2",children:(0,s.jsx)("button",{type:"button",onClick:()=>I(t=>({...t,[e]:r.filter((e,t)=>t!==l)})),className:"rounded border border-red-200 px-2 py-0.5 text-xs text-red-600 hover:bg-red-50",children:"删除此条"})})]},l)),n.length?(0,s.jsxs)("div",{className:"rounded border border-dashed border-gray-300 p-2",children:[(0,s.jsx)("div",{className:"mb-1 text-xs text-gray-500",children:"候选条目(选择合入或更新)"}),(0,s.jsx)("div",{className:"space-y-1.5",children:n.map((t,l)=>{var a,n,i,d,o,c,u,x,m;let h=r.findIndex(e=>(function(e,t){let l=e=>{var t,l,s;return String(null!==(s=null!==(l=null!==(t=null==e?void 0:e.company)&&void 0!==t?t:null==e?void 0:e.school)&&void 0!==l?l:null==e?void 0:e.name)&&void 0!==s?s:"")},s=e=>{var t,l,s;return String(null!==(s=null==e?void 0:e.period)&&void 0!==s?s:"".concat(null!==(t=null==e?void 0:e.start)&&void 0!==t?t:"","-").concat(null!==(l=null==e?void 0:e.end)&&void 0!==l?l:""))},a=l(e),r=l(t),n=s(e),i=s(t);return!!a&&!!r&&a===r||!!n&&!!i&&n===i&&(!a||!r||a===r)})(e,t.item));return(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,s.jsxs)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-gray-500",children:["#",t.id]}),(0,s.jsxs)("span",{className:"min-w-0 flex-1 truncate text-gray-700",children:[b(null!==(i=null!==(n=null!==(a=t.item.company)&&void 0!==a?a:t.item.school)&&void 0!==n?n:t.item.name)&&void 0!==i?i:"")," \xb7 ",b(null!==(c=null!==(o=null!==(d=t.item.position)&&void 0!==d?d:t.item.major)&&void 0!==o?o:t.item.role)&&void 0!==c?c:"")," \xb7 ",b(null!==(m=t.item.period)&&void 0!==m?m:"".concat(null!==(u=t.item.start)&&void 0!==u?u:"","-").concat(null!==(x=t.item.end)&&void 0!==x?x:""))]}),h>=0?(0,s.jsxs)("button",{type:"button",onClick:()=>{let l=[...r];l[h]={...t.item},I(t=>({...t,[e]:l}))},className:"shrink-0 rounded border border-blue-300 px-2 py-0.5 text-blue-600 hover:bg-blue-50",children:["更新条目",h+1]}):(0,s.jsx)("button",{type:"button",onClick:()=>I(l=>({...l,[e]:[...r,{...t.item}]})),className:"shrink-0 rounded border border-green-300 px-2 py-0.5 text-green-700 hover:bg-green-50",children:"合入"})]},l)})})]}):null]})]},e)}),Y&&J?(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200",children:[(0,s.jsx)("div",{className:"border-b border-gray-100 px-3 py-2",children:(0,s.jsxs)("h4",{className:"text-sm font-semibold text-gray-900",children:["与候选 #",Y.talent.id," 对比",Y.reasons.length?(0,s.jsx)("span",{className:"ml-2 space-x-1",children:Y.reasons.map(e=>(0,s.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs font-normal text-gray-600",children:e},e))}):null]})}),(0,s.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b border-gray-100 text-left text-xs text-gray-500",children:[(0,s.jsx)("th",{className:"py-1.5 pl-3 pr-2 font-medium",children:"字段"}),(0,s.jsxs)("th",{className:"py-1.5 pr-2 font-medium",children:["当前 #",d]}),(0,s.jsxs)("th",{className:"py-1.5 pr-3 font-medium",children:["候选 #",Y.talent.id]})]})}),(0,s.jsx)("tbody",{children:Object.keys(C).map(e=>{var t,a,r,n;let i=b(null===(t=M(e)[0])||void 0===t?void 0:t.value),d=b((()=>{var t,l,s,a;let r=j[Y.talent.id];if(r){if("name"===e)return r.name;if("headline"===e)return r.headline;if(e.startsWith("intent.")){let t=e.slice(7),a=null===(s=r.extracted)||void 0===s?void 0:null===(l=s.intent)||void 0===l?void 0:l[t];return"industries"===t?Array.isArray(a)?a:[]:null!=a?a:""}return null!==(a=null===(t=r.extracted)||void 0===t?void 0:t[e])&&void 0!==a?a:""}})()),o=i!==d&&"—"!==i&&"—"!==d;return(0,s.jsxs)("tr",{className:"border-b border-gray-50",children:[(0,s.jsx)("td",{className:"py-1 pl-3 pr-2 text-xs text-gray-500",children:null!==(r=p[e])&&void 0!==r?r:e}),(0,s.jsx)("td",{className:"py-1 pr-2 ".concat(o?"bg-amber-50":""),children:"sourceUrl"===e?(0,s.jsx)("a",{href:String(null!==(n=null===(a=M(e)[0])||void 0===a?void 0:a.value)&&void 0!==n?n:l.sourceUrl),target:"_blank",rel:"noreferrer",className:"break-all text-blue-600 hover:underline",children:i}):(0,s.jsx)("span",{className:"break-all",children:i})}),(0,s.jsx)("td",{className:"py-1 pr-3 ".concat(o?"bg-amber-50":""),children:"sourceUrl"===e?(0,s.jsx)("a",{href:String((()=>{var e;let t=j[Y.talent.id];return null!==(e=null==t?void 0:t.sourceUrl)&&void 0!==e?e:""})()),target:"_blank",rel:"noreferrer",className:"break-all text-blue-600 hover:underline",children:d}):(0,s.jsx)("span",{className:"break-all",children:d})})]},e)})})]})]}):null]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t border-gray-200 px-4 py-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>void q(),disabled:E,className:"rounded bg-blue-600 px-4 py-1.5 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:"提交合并(采用上方编辑值)"}),(0,s.jsx)("button",{type:"button",onClick:()=>void R(),disabled:E,title:"传统语义:保留字段更全的一侧,另一侧补空合并",className:"rounded border border-gray-300 px-4 py-1.5 text-sm text-gray-700 hover:bg-gray-50 disabled:opacity-50",children:"快捷:整行补空合并"}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"被合并的候选会进入回收站(可恢复)"}),D?(0,s.jsx)("span",{className:"text-sm text-red-600",children:D}):null]})]})]})]})}):null]})}function j(e){var t;let{entityId:l,name:r}=e,[i,d]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null),[u,x]=(0,a.useState)([]),[m,h]=(0,a.useState)(""),[p,g]=(0,a.useState)("pending_invite"),[v,b]=(0,a.useState)(!1),[y,j]=(0,a.useState)(null),[f,N]=(0,a.useState)(null);(0,a.useEffect)(()=>{i&&((0,n.rd)("/recommendations/meta").then(c),(0,n.rd)("/job-cases?limit=200").then(e=>{var t;x(null!==(t=null==e?void 0:e.items)&&void 0!==t?t:[])}))},[i]);let w=async()=>{if(""===m)return;b(!0),N(null);let e=await (0,n.uz)("/recommendations",{jobCaseId:m,entityId:l,stage:p});b(!1),e?j({jobCaseId:Number(m)}):N("写入失败(服务未启动或无权限)")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>{d(!0),j(null),N(null)},className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700",children:"加入推荐流程"}),i?(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",children:(0,s.jsx)("div",{className:"w-96 rounded-lg bg-white p-4 shadow-xl",children:y?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"mb-3 text-sm text-gray-800",children:["已把 ",(0,s.jsx)("span",{className:"font-medium",children:r})," 加入推荐流程。"]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{onClick:()=>d(!1),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600",children:"关闭"}),(0,s.jsx)("a",{href:"/jobs?id=".concat(y.jobCaseId),className:"rounded bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700",children:"去职位推荐流程 →"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("h3",{className:"mb-3 text-sm font-semibold text-gray-900",children:["把 ",r," 加入推荐流程"]}),(0,s.jsxs)("label",{className:"mb-2 block text-xs text-gray-500",children:["目标职位",(0,s.jsxs)("select",{value:m,onChange:e=>h(""===e.target.value?"":Number(e.target.value)),className:"mt-1 w-full rounded border border-gray-300 px-2 py-1.5 text-sm",children:[(0,s.jsx)("option",{value:"",children:"选择职位…"}),u.map(e=>(0,s.jsx)("option",{value:e.id,children:e.title||e.externalId},e.id))]})]}),(0,s.jsxs)("label",{className:"mb-3 block text-xs text-gray-500",children:["推荐阶段(默认待邀请)",(0,s.jsx)("select",{value:p,onChange:e=>g(e.target.value),className:"mt-1 w-full rounded border border-gray-300 px-2 py-1.5 text-sm",children:(null!==(t=null==o?void 0:o.stages)&&void 0!==t?t:[{key:"pending_invite",label:"待邀请"}]).map(e=>(0,s.jsx)("option",{value:e.key,children:e.label},e.key))})]}),f?(0,s.jsx)("p",{className:"mb-2 text-xs text-red-600",children:f}):null,(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{onClick:()=>d(!1),className:"rounded border border-gray-300 px-3 py-1 text-xs text-gray-600",children:"取消"}),(0,s.jsx)("button",{onClick:()=>void w(),disabled:""===m||v,className:"rounded bg-blue-600 px-3 py-1 text-xs text-white hover:bg-blue-700 disabled:opacity-40",children:v?"写入中…":"确认加入"})]})]})})}):null]})}let f={merge:"解析合并",sync:"同步覆盖",manual:"人工编辑",backfill:"回溯回填"},N={"identity.displayName":"姓名","identity.gender":"性别","identity.birthYear":"出生年","identity.location":"地点","identity.nationality":"国籍","professional.headline":"头衔","professional.summary":"简介","professional.currentCompany":"现任公司","professional.currentTitle":"现任职位","professional.titleLevel":"职级","professional.yearsOfExperience":"工作年限","professional.currentStatus":"当前状态","professional.desiredJob":"求职意向","professional.skills":"技能","professional.workExperiences":"工作经历","professional.educations":"教育经历","professional.projects":"项目经历","professional.languages":"语言","professional.certifications":"证书","contact.phones":"电话","contact.emails":"邮箱","contact.wechats":"微信","contact.linkedinUrls":"LinkedIn"},w=e=>{if(null==e)return"(空)";if("object"==typeof e){if(e.truncated)return"".concat(String(e.preview).slice(0,40),"…");if(e.name)return String(e.name);if(e.city)return String(e.city);if(e.added||e.removed){var t,l;let s=[];return(null===(t=e.added)||void 0===t?void 0:t.length)&&s.push("+".concat(e.added.map(e=>{var t,l,s,a;return null!==(a=null!==(s=null!==(l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null==e?void 0:e.companyName)&&void 0!==l?l:null==e?void 0:e.school)&&void 0!==s?s:null==e?void 0:e.language)&&void 0!==a?a:String(e)}).join("、"))),(null===(l=e.removed)||void 0===l?void 0:l.length)&&s.push("-".concat(e.removed.map(e=>{var t,l,s,a;return null!==(a=null!==(s=null!==(l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null==e?void 0:e.companyName)&&void 0!==l?l:null==e?void 0:e.school)&&void 0!==s?s:null==e?void 0:e.language)&&void 0!==a?a:String(e)}).join("、"))),s.join(" ")||"(数量变化)"}return JSON.stringify(e).slice(0,40)}return String(e)};function k(e){let{versions:t,recommendations:l,changes:r,evaluations:n,matches:i}=e,d=(0,a.useMemo)(()=>{if(!(null==l?void 0:l.length))return null;let e=null;for(let n of l){var t,s,a,r;let l=null!==(t=n.history)&&void 0!==t?t:[],i=l.length?l[l.length-1]:null,d=null!==(s=null==i?void 0:i.at)&&void 0!==s?s:n.createdAt;(!e||d>e.at)&&(e={at:d,jobTitle:null!==(a=n.jobTitle)&&void 0!==a?a:"职位 #".concat(n.jobCaseId),toStage:null!==(r=null==i?void 0:i.toStage)&&void 0!==r?r:n.stage,by:null==i?void 0:i.by})}return e},[l]),o=(0,a.useMemo)(()=>{if(!(null==l?void 0:l.length))return[];let e=new Map;for(let a of l){var t,s;e.set(a.jobCaseId,{jobTitle:null!==(t=a.jobTitle)&&void 0!==t?t:"职位 #".concat(a.jobCaseId),stage:a.stage,stageLabel:null!==(s=a.stageLabel)&&void 0!==s?s:a.stage,updatedAt:a.updatedAt})}return Array.from(e.entries()).map(e=>{let[t,l]=e;return{jobCaseId:t,...l}}).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))},[l]),c={rejected:"bg-red-50 text-red-700",onboarding:"bg-green-50 text-green-700"},x=(e,t)=>{var l;return(0,s.jsxs)("span",{className:"rounded px-2 py-0.5 text-xs ".concat(null!==(l=c[e])&&void 0!==l?l:"bg-blue-50 text-blue-700"),children:[t,c[e]?"":"(在途)"]})},m=(0,a.useMemo)(()=>{var e,a,i,d,o,c,u,x,m,h;let p=[];for(let t of null!=l?l:[])for(let l of null!==(e=t.history)&&void 0!==e?e:[])p.push({at:l.at,icon:"\uD83D\uDCE4",tone:"text-blue-700",text:(0,s.jsxs)("span",{children:[(0,s.jsx)("b",{children:null!==(a=t.jobTitle)&&void 0!==a?a:"职位 #".concat(t.jobCaseId)}),":",l.fromStage?"".concat(l.fromStage," → "):"",null!==(i=l.toStage)&&void 0!==i?i:l.action,l.by?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",l.by]}):null,l.note?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",l.note]}):null]})});for(let e of null!=r?r:[])p.push({at:e.createdAt,icon:"\uD83D\uDCDD",tone:"text-amber-700",text:(0,s.jsxs)("span",{children:["简历变更:",null!==(d=N[e.fieldPath])&&void 0!==d?d:e.fieldPath,"(",null!==(o=f[e.changeType])&&void 0!==o?o:e.changeType,")",(0,s.jsxs)("span",{className:"text-gray-400",children:[" ",w(e.oldValue)," → ",w(e.newValue)]}),e.sourceSystem?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 来源 ",e.sourceSystem]}):null]})});for(let e of null!=t?t:[])p.push({at:e.createdAt,icon:"\uD83C\uDD95",tone:"text-green-700",text:(0,s.jsxs)("span",{children:["新版本简历入库:",null!==(m=null===(c=e.source)||void 0===c?void 0:c.system)&&void 0!==m?m:"未知渠道",(null===(x=e.source)||void 0===x?void 0:null===(u=x.collector)||void 0===u?void 0:u.creatorName)?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 同步人 ",e.source.collector.creatorName]}):null]})});for(let e of null!=n?n:[])p.push({at:e.createdAt,icon:"\uD83D\uDCCA",tone:"text-violet-700",text:(0,s.jsxs)("span",{children:["生成评估:",(0,s.jsx)("b",{children:null!==(h=e.jobTitle)&&void 0!==h?h:"职位 #".concat(e.jobCaseId)}),(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.generatedBy]})]})});return p.sort((e,t)=>t.at.localeCompare(e.at)).slice(0,30)},[l,r,t,n]),h=(0,a.useMemo)(()=>(null!=i?i:[]).slice().sort((e,t)=>{var l,s,a,r;return(null!==(a=null===(l=t.scores)||void 0===l?void 0:l.overall)&&void 0!==a?a:0)-(null!==(r=null===(s=e.scores)||void 0===s?void 0:s.overall)&&void 0!==r?r:0)}).slice(0,3),[i]);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-blue-200 bg-blue-50/50 p-4",children:[(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"最近一次推荐"}),d?(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-lg font-semibold text-gray-900",children:d.jobTitle}),d.toStage?x(d.toStage,d.toStage):null,(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:[(0,u.d3)(d.at),d.by?" \xb7 ".concat(d.by):""]})]}):(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"暂无推荐记录"})]}),(0,s.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsxs)("h3",{className:"mb-2 text-sm font-semibold text-gray-900",children:["推荐履历(",o.length,")"]}),o.length?(0,s.jsx)("ul",{className:"space-y-2",children:o.map(e=>(0,s.jsxs)("li",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,s.jsx)("a",{href:"/jobs?id=".concat(e.jobCaseId),className:"truncate text-blue-600 hover:underline",children:e.jobTitle}),x(e.stage,e.stageLabel)]},e.jobCaseId))}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无推荐记录"})]}),(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-2 text-sm font-semibold text-gray-900",children:"在管职位匹配 Top 3"}),h.length?(0,s.jsx)("ul",{className:"space-y-2",children:h.map(e=>{var t,l,a,r,n,i,d;return(0,s.jsxs)("li",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,s.jsx)("a",{href:"/jobs?id=".concat(e.jobCaseId),className:"truncate text-blue-600 hover:underline",children:(null===(t=e.jobCase)||void 0===t?void 0:t.title)||"职位 #".concat(e.jobCaseId)}),(0,s.jsxs)("span",{className:"rounded px-2 py-0.5 text-xs ".concat((null!==(n=null===(l=e.scores)||void 0===l?void 0:l.overall)&&void 0!==n?n:0)>=75?"bg-green-50 text-green-700":(null!==(i=null===(a=e.scores)||void 0===a?void 0:a.overall)&&void 0!==i?i:0)>=60?"bg-amber-50 text-amber-700":"bg-gray-100 text-gray-600"),children:[null!==(d=null===(r=e.scores)||void 0===r?void 0:r.overall)&&void 0!==d?d:"-"," 分"]})]},e.id)})}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无高匹配在管职位"}),(0,s.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:"完整匹配与规则明细见「简历」tab"})]})]}),(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-3 text-sm font-semibold text-gray-900",children:"动态(推荐 / 简历变更 / 新版本 / 评估)"}),m.length?(0,s.jsx)("ol",{className:"space-y-2",children:m.map((e,t)=>(0,s.jsxs)("li",{className:"flex items-start gap-2 text-sm",children:[(0,s.jsx)("span",{children:e.icon}),(0,s.jsx)("span",{className:e.tone,children:e.text}),(0,s.jsx)("span",{className:"shrink-0 text-xs text-gray-400",children:(0,u.d3)(e.at)})]},t))}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无动态"})]})]})}let S=[["skill","技能",.25],["experience","经验年限",.2],["industry","行业",.1],["company","公司",.1],["location","地点",.1],["salary","薪资",.1],["education","学历",.05],["stability","稳定性",.05],["availability","可用性",.05]],C=(e,t,l)=>[e,t].filter(Boolean).join(" - ")+(l?"(".concat(l,")"):"");function A(e){let{title:t,children:l}=e;return(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold text-gray-900",children:t}),l]})}function T(e){let{children:t}=e;return(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:t})}function I(e){var t,l;let{entity:r}=e,i=r.extracted||{},[d,o]=(0,a.useState)(null),[c,u]=(0,a.useState)(!1),[x,m]=(0,a.useState)(null),h=(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u(!0);try{var t;let l=e?await (0,n.uz)("/entities/talent/".concat(r.id,"/match-jobs")):await (0,n.rd)("/entities/talent/".concat(r.id,"/matches"));o(null!==(t=null==l?void 0:l.matches)&&void 0!==t?t:[])}finally{u(!1)}},[r.id]);(0,a.useEffect)(()=>{h()},[h]);let p=Array.isArray(i.workExperiences)?i.workExperiences:[],g=Array.isArray(i.projects)?i.projects:[],v=Array.isArray(i.education)?i.education:[],b=e=>"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.name?e.name:null,y=(Array.isArray(i.languages)?i.languages:[]).map(b).filter(e=>!!e),j=(Array.isArray(i.skills)?i.skills:[]).map(b).filter(e=>!!e),f=null!==(l=null===(t=i.extra)||void 0===t?void 0:t.sections)&&void 0!==l?l:[],N=i.intent||{},w=[["性别",i.gender],["年龄",null!=i.age?"".concat(i.age," 岁"):null],["城市",i.city],["学历",i.degree],["工作年限",null!=i.workYears?"".concat(i.workYears," 年"):null],["当前职位",i.currentPosition],["当前公司",i.currentCompany],["状态",i.statusTag],["方便联系",i.contactTime]].filter(e=>{let[,t]=e;return null!=t&&""!==t});return(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[i.photoUrl?(0,s.jsx)("img",{src:i.photoUrl,alt:"",className:"h-14 w-14 rounded-full object-cover"}):null,(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xl font-bold text-gray-900",children:i.name||"(未命名)"}),i.nameMasked?(0,s.jsx)(T,{children:"脱敏"}):null]}),w.length?(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-sm text-gray-600",children:w.map(e=>{let[t,l]=e;return(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"text-gray-400",children:t})," ",l]},t)})}):(0,s.jsx)("p",{className:"mt-2 text-sm text-gray-500",children:"仅卡片级数据(搜索入库),尚无详情页解析字段"})]})]}),Object.keys(N).length?(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2 border-t border-gray-100 pt-3 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-400",children:"求职意向"}),N.position?(0,s.jsx)(T,{children:N.position}):null,N.salary?(0,s.jsx)(T,{children:N.salary}):null,N.city?(0,s.jsx)(T,{children:N.city}):null,(N.industries||[]).map(e=>(0,s.jsx)(T,{children:e},e))]}):null,j.length||y.length?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm",children:[j.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-gray-400",children:"技能"}),j.map(e=>(0,s.jsx)(T,{children:e},e))]}):null,y.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"ml-2 text-gray-400",children:"语言"}),y.map(e=>(0,s.jsx)(T,{children:e},e))]}):null]}):null]}),(0,s.jsxs)(A,{title:"在管职位匹配",children:[null===d?(0,s.jsx)("p",{className:"text-sm text-gray-500",children:c?"匹配计算中…":"加载中…"}):0===d.length?(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无匹配记录"}):(0,s.jsx)("ul",{className:"space-y-3",children:d.map(e=>{var t,l,a,r,n,i,d,o,c,u,h,p,g,v,b,y,j,f;let N=x===e.id,w=null!==(b=e.matchDetails)&&void 0!==b?b:{};return(0,s.jsxs)("li",{className:"rounded border border-gray-100 p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"font-medium text-gray-900",children:[(null===(t=e.jobCase)||void 0===t?void 0:t.title)||"职位 #".concat(e.jobCaseId),(null===(l=e.jobCase)||void 0===l?void 0:l.company)?(0,s.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:e.jobCase.company}):null]}),(0,s.jsxs)("span",{className:"rounded px-2 py-0.5 text-sm font-medium ".concat((null!==(y=null===(a=e.scores)||void 0===a?void 0:a.overall)&&void 0!==y?y:0)>=75?"bg-green-50 text-green-700":(null!==(j=null===(r=e.scores)||void 0===r?void 0:r.overall)&&void 0!==j?j:0)>=60?"bg-amber-50 text-amber-700":"bg-gray-100 text-gray-600"),children:[null!==(f=null===(n=e.scores)||void 0===n?void 0:n.overall)&&void 0!==f?f:"-"," 分"]})]}),(null===(i=e.recommendation)||void 0===i?void 0:i.aiReason)?(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-sm text-gray-600",children:e.recommendation.aiReason}):null,(0,s.jsx)("button",{type:"button",onClick:()=>m(N?null:e.id),className:"mt-2 text-xs text-blue-600 hover:underline",children:N?"收起规则明细 ▲":"查看规则明细(为什么这么分)▼"}),N?(0,s.jsxs)("div",{className:"mt-2 space-y-2 border-t border-gray-100 pt-2",children:[w.gate?"fail"===w.gate.status?(0,s.jsxs)("div",{className:"rounded bg-red-50 p-2 text-xs text-red-700",children:[(0,s.jsx)("div",{className:"font-medium",children:"硬性条件不满足(一票否决,已出局)"}),(0,s.jsx)("ul",{className:"mt-1 list-disc pl-4",children:(w.gate.failed||[]).map((e,t)=>(0,s.jsxs)("li",{children:[e.label,e.talentValue?"(候选人:".concat(e.talentValue,")"):"",e.evidence?" JD 证据:「".concat(e.evidence,"」"):""]},t))})]}):"unknown"===w.gate.status?(0,s.jsxs)("div",{className:"rounded bg-amber-50 p-2 text-xs text-amber-700",children:[(0,s.jsx)("div",{className:"font-medium",children:"硬性条件待核实(信息缺失 ≠ 不满足,请人工复核)"}),(0,s.jsx)("ul",{className:"mt-1 list-disc pl-4",children:(w.gate.unknown||[]).map((e,t)=>(0,s.jsxs)("li",{children:[e.label,e.evidence?" JD 证据:「".concat(e.evidence,"」"):""]},t))})]}):(0,s.jsx)("p",{className:"text-xs text-green-700",children:"硬性条件(性别/学历/年龄/地点等):全部满足"}):null,(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2 md:grid-cols-5",children:S.map(t=>{var l;let[a,r,n]=t;return(0,s.jsxs)("div",{className:"rounded bg-gray-50 p-2 text-xs",children:[(0,s.jsxs)("div",{className:"text-gray-400",children:[r," ",(0,s.jsxs)("span",{title:"规则权重",children:["\xd7",n]})]}),(0,s.jsx)("div",{className:"font-medium",children:(null===(l=e.scores)||void 0===l?void 0:l[a])!=null?"".concat(Math.round(100*e.scores[a])):"-"})]},a)})}),"number"==typeof w.vectorCosine?(0,s.jsxs)("p",{className:"text-xs text-gray-500",children:["语义向量(本地 bge-small 余弦,权重 \xd70.2):",(100*w.vectorCosine).toFixed(1)," 分"]}):null,Array.isArray(w.hitSkills)&&w.hitSkills.length?(0,s.jsxs)("p",{className:"text-xs text-green-700",children:["命中技能:",w.hitSkills.map(e=>{var t;return null!==(t=null==e?void 0:e.name)&&void 0!==t?t:e}).join("、")]}):null,Array.isArray(w.missedSkills)&&w.missedSkills.length?(0,s.jsxs)("p",{className:"text-xs text-red-600",children:["缺失技能:",w.missedSkills.map(e=>{var t;return null!==(t=null==e?void 0:e.name)&&void 0!==t?t:e}).join("、")]}):null,Array.isArray(w.concernFlags)&&w.concernFlags.length?(0,s.jsxs)("p",{className:"text-xs text-amber-700",children:["风险提示:",w.concernFlags.join(";")]}):null,(null===(d=w.industryFit)||void 0===d?void 0:d.fitTag)||(null===(o=w.salaryFit)||void 0===o?void 0:o.fitTag)||(null===(c=w.locationFit)||void 0===c?void 0:c.fitTag)||(null===(u=w.experienceFit)||void 0===u?void 0:u.fitTag)?(0,s.jsxs)("p",{className:"text-xs text-gray-500",children:["适配标签:",[null===(h=w.industryFit)||void 0===h?void 0:h.fitTag,null===(p=w.salaryFit)||void 0===p?void 0:p.fitTag,null===(g=w.locationFit)||void 0===g?void 0:g.fitTag,null===(v=w.experienceFit)||void 0===v?void 0:v.fitTag].filter(Boolean).join(" / ")]}):null]}):null]},e.id)})}),(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)("button",{type:"button",disabled:c,onClick:()=>void h(!0),className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700 disabled:opacity-50",children:c?"匹配中…":"重新匹配在管职位"})})]}),p.length?(0,s.jsx)(A,{title:"工作经历(".concat(p.length,")"),children:(0,s.jsx)("ol",{className:"space-y-4",children:p.map((e,t)=>(0,s.jsxs)("li",{className:"border-l-2 border-blue-100 pl-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:e.company||"(公司未知)"}),(0,s.jsx)("span",{className:"text-gray-700",children:e.position}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:C(e.start,e.end,e.duration)})]}),(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-xs text-gray-500",children:[e.department?(0,s.jsxs)("span",{children:["部门:",e.department]}):null,e.location?(0,s.jsxs)("span",{children:["地点:",e.location]}):null,e.reportsTo?(0,s.jsxs)("span",{children:["汇报:",e.reportsTo]}):null,null!=e.subordinates?(0,s.jsxs)("span",{children:["下属:",e.subordinates," 人"]}):null]}),e.responsibilities?(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-700",children:e.responsibilities}):null,e.extra?(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-xs text-gray-500",children:Object.entries(e.extra).map(e=>{let[t,l]=e;return(0,s.jsxs)("span",{children:[t,":",l]},t)})}):null]},t))})}):null,g.length?(0,s.jsx)(A,{title:"项目经历(".concat(g.length,")"),children:(0,s.jsx)("ol",{className:"space-y-4",children:g.map((e,t)=>(0,s.jsxs)("li",{className:"border-l-2 border-green-100 pl-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:e.name||"(项目未知)"}),e.role?(0,s.jsx)("span",{className:"text-gray-700",children:e.role}):null,e.company?(0,s.jsx)("span",{className:"text-sm text-gray-500",children:e.company}):null,(0,s.jsx)("span",{className:"text-xs text-gray-400",children:C(e.start,e.end,e.duration)})]}),e.description?(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-700",children:e.description}):null,e.duties?(0,s.jsxs)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-600",children:["职责:",e.duties]}):null,e.extra?(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-x-3 text-xs text-gray-500",children:Object.entries(e.extra).map(e=>{let[t,l]=e;return(0,s.jsxs)("span",{children:[t,":",l]},t)})}):null]},t))})}):null,v.length?(0,s.jsx)(A,{title:"教育经历(".concat(v.length,")"),children:(0,s.jsx)("ol",{className:"space-y-3",children:v.map((e,t)=>(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:e.school||"(学校未知)"}),e.major?(0,s.jsx)("span",{className:"text-gray-700",children:e.major}):null,e.degree?(0,s.jsx)(T,{children:e.degree}):null,e.period?(0,s.jsx)("span",{className:"text-xs text-gray-400",children:e.period}):null,(e.tags||[]).map(e=>(0,s.jsx)(T,{children:e},e))]},t))})}):null,i.selfEvaluation?(0,s.jsx)(A,{title:"自我评价",children:(0,s.jsx)("p",{className:"whitespace-pre-wrap text-sm text-gray-700",children:i.selfEvaluation})}):null,f.map(e=>(0,s.jsx)(A,{title:e.title||e.key,children:(0,s.jsx)("p",{className:"whitespace-pre-wrap text-sm text-gray-700",children:e.text})},e.key))]})}function E(e){let{portraitId:t}=e,[l,r]=(0,a.useState)([]),[i,d]=(0,a.useState)(""),[o,c]=(0,a.useState)(!1),[x,m]=(0,a.useState)(null),[h,p]=(0,a.useState)([]);(0,a.useEffect)(()=>{(0,n.rd)("/job-cases?limit=200").then(e=>{var t;r((Array.isArray(e)?e:null!==(t=null==e?void 0:e.items)&&void 0!==t?t:[]).filter(e=>"active"===e.status||!e.status))}).catch(()=>r([]))},[]);let g=(0,a.useCallback)(async()=>{var e;if(!t)return;let l=await (0,n.rd)("/talent-portraits/".concat(t,"/evaluations")).catch(()=>null);p(null!==(e=null==l?void 0:l.items)&&void 0!==e?e:[])},[t]);async function v(){if(m(null),!t||!i){m("先选择要评估的职位");return}try{let e=await fetch("".concat((0,n.Ox)(),"/talent-job-evaluations/evaluate-prompt?portraitId=").concat(t,"&jobCaseId=").concat(i));if(!e.ok)throw Error("HTTP ".concat(e.status));let l=await e.json();await navigator.clipboard.writeText(l.prompt),c(!0),setTimeout(()=>c(!1),4e3),setTimeout(()=>void g(),3e4)}catch(e){m(e.message)}}(0,a.useEffect)(()=>{g()},[g]);let b=i?h.filter(e=>String(e.jobCaseId)===i):h;return(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold text-gray-900",children:"评估(人才 \xd7 职位)"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("select",{value:i,onChange:e=>d(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm",children:[(0,s.jsx)("option",{value:"",children:"选择要评估的在管职位…"}),l.map(e=>(0,s.jsx)("option",{value:e.id,children:e.title||"职位 #".concat(e.id)},e.id))]}),(0,s.jsx)("button",{type:"button",onClick:()=>void v(),className:"rounded bg-violet-600 px-3 py-1 text-sm text-white hover:bg-violet-700",children:o?"已复制 ✓ 请发给 agent":"复制评估 prompt"}),x?(0,s.jsx)("span",{className:"text-xs text-red-600",children:x}):null]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:"评估由 agent 生成后写回;同一人才\xd7职位可多次评估,历史全留痕。原「AI 总结与评估」(不针对职位)已按 2026-10-04 裁定移除。"}),(0,s.jsx)("div",{className:"mt-3 space-y-3",children:b.length?b.map(e=>{var t;return(0,s.jsxs)("div",{className:"rounded border border-gray-100 p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-gray-400",children:[(0,s.jsx)("span",{className:"font-medium text-gray-800",children:null!==(t=e.jobTitle)&&void 0!==t?t:"职位 #".concat(e.jobCaseId)}),(0,s.jsx)("span",{children:(0,u.d3)(e.createdAt)}),(0,s.jsxs)("span",{children:["生成:",e.generatedBy]}),e.createdBy?(0,s.jsxs)("span",{children:["操作者:",e.createdBy]}):null]}),(0,s.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-gray-700",children:e.content})]},e.id)}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无评估记录"})})]})}let U=e=>"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.name?e.name:null;function D(e){var t;let{entity:l,portraitId:r,versions:n,sources:i}=e,[d,o]=(0,a.useState)("merged"),c=null!=n?n:[],m=null!==(t=c.find(e=>e.id===d))&&void 0!==t?t:null;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>o("merged"),className:"rounded px-3 py-1 text-sm ".concat("merged"===d?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:"合并画像(默认)"}),c.map(e=>{var t,l,a,r,n,i;return(0,s.jsxs)("button",{type:"button",onClick:()=>o(e.id),className:"rounded px-3 py-1 text-sm ".concat(d===e.id?"bg-blue-600 text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"),title:"".concat(null!==(n=null===(t=e.source)||void 0===t?void 0:t.url)&&void 0!==n?n:""," ").concat((0,u.d3)(e.createdAt)),children:[null!==(i=null===(l=e.source)||void 0===l?void 0:l.system)&&void 0!==i?i:"未知渠道",(null===(r=e.source)||void 0===r?void 0:null===(a=r.collector)||void 0===a?void 0:a.creatorName)?" \xb7 ".concat(e.source.collector.creatorName):""," \xb7 ",(0,u.d3)(e.createdAt)]},e.id)}),c.length?null:(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"暂无独立版本(合并画像即全部已知信息)"})]}),"merged"!==d&&m?(0,s.jsx)(O,{version:m}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(I,{entity:l}),(0,s.jsx)(E,{portraitId:r}),(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"原始数据(合并画像)"}),(0,s.jsx)(x.Y,{data:l.extracted})]})]}),(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"解析来源"}),i.length?(0,s.jsx)("ul",{className:"space-y-1 text-sm",children:i.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:e.domain}),(0,s.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:(0,u.d3)(e.createdAt)})]},e.id))}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"暂无解析来源记录"})]})]})}function O(e){var t,l,a,r,n,i,d,o,c,m,h,p,g;let{version:v}=e,b=null!==(o=v.extracted)&&void 0!==o?o:{},y=Array.isArray(b.workExperiences)?b.workExperiences:[],j=Array.isArray(b.educations)?null!==(c=b.education)&&void 0!==c?c:b.educations:Array.isArray(b.education)?b.education:[],f=(Array.isArray(b.skills)?b.skills:[]).map(U).filter(Boolean),N=null!==(m=b.contact)&&void 0!==m?m:{};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xl font-bold text-gray-900",children:null!==(p=null!==(h=N.fullName)&&void 0!==h?h:b.name)&&void 0!==p?p:"(未命名)"}),(0,s.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:null!==(g=null===(t=v.source)||void 0===t?void 0:t.system)&&void 0!==g?g:"未知渠道"}),(null===(a=v.source)||void 0===a?void 0:null===(l=a.collector)||void 0===l?void 0:l.creatorName)?(0,s.jsxs)("span",{className:"rounded bg-violet-50 px-2 py-0.5 text-xs text-violet-700",children:["同步人 ",v.source.collector.creatorName]}):null,(0,s.jsx)("span",{className:"text-xs text-gray-400",children:(0,u.d3)(v.createdAt)}),(null===(r=v.confidence)||void 0===r?void 0:r.overall)!=null?(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["置信度 ",Math.round(100*v.confidence.overall),"%"]}):null]}),b.headline?(0,s.jsx)("p",{className:"mt-1 text-gray-600",children:b.headline}):null,(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-sm text-gray-600",children:[b.gender?(0,s.jsxs)("span",{children:["性别 ",b.gender]}):null,(null===(n=b.basic)||void 0===n?void 0:n.gender)?(0,s.jsxs)("span",{children:["性别 ",b.basic.gender]}):null,b.city?(0,s.jsxs)("span",{children:["城市 ",b.city]}):null,(null===(d=b.basic)||void 0===d?void 0:null===(i=d.location)||void 0===i?void 0:i.city)?(0,s.jsxs)("span",{children:["城市 ",b.basic.location.city]}):null]}),f.length?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-400",children:"技能"}),f.map(e=>(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:e},e))]}):null]}),y.length?(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("h3",{className:"mb-2 text-lg font-semibold",children:["工作经历(",y.length,")"]}),(0,s.jsx)("ol",{className:"space-y-2",children:y.map((e,t)=>{var l,a,r,n,i;return(0,s.jsxs)("li",{className:"text-sm",children:[(0,s.jsx)("b",{children:null!==(a=null!==(l=e.companyName)&&void 0!==l?l:e.company)&&void 0!==a?a:"(公司未知)"})," ",null!==(r=e.title)&&void 0!==r?r:e.position," ",(0,s.jsx)("span",{className:"text-xs text-gray-400",children:[null!==(n=e.startDate)&&void 0!==n?n:e.start,null!==(i=e.endDate)&&void 0!==i?i:e.end].filter(Boolean).join(" - ")})]},t)})})]}):null,j.length?(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("h3",{className:"mb-2 text-lg font-semibold",children:["教育经历(",j.length,")"]}),(0,s.jsx)("ol",{className:"space-y-1",children:j.map((e,t)=>(0,s.jsxs)("li",{className:"text-sm",children:[(0,s.jsx)("b",{children:e.school})," ",e.major," ",(0,s.jsx)("span",{className:"text-xs text-gray-400",children:e.degree})]},t))})]}):null,(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"原始数据(该版本)"}),(0,s.jsx)(x.Y,{data:v.extracted})]})]})}let F={create:"建档",move:"阶段流转",form:"表单更新",invite:"邀请",invite_approved:"邀请批准",note:"备注",delete:"删除"};function P(e){let{recommendations:t}=e,[l,r]=(0,a.useState)(null);return(null==t?void 0:t.length)?(0,s.jsx)("div",{className:"space-y-3",children:t.map(e=>{var t,a,n,i,d;let o=l===e.id,c=Object.entries(null!==(t=e.formData)&&void 0!==t?t:{}).filter(e=>{let[,t]=e;return null!=t&&""!==t});return(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("a",{href:"/jobs?id=".concat(e.jobCaseId),className:"font-medium text-blue-600 hover:underline",children:null!==(a=e.jobTitle)&&void 0!==a?a:"职位 #".concat(e.jobCaseId)}),(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:null!==(n=e.stageLabel)&&void 0!==n?n:e.stage})]}),(0,s.jsx)("button",{type:"button",onClick:()=>r(o?null:e.id),className:"text-xs text-blue-600 hover:underline",children:o?"收起 ▲":"展开表单与历史 ▼"})]}),o?(0,s.jsxs)("div",{className:"mt-3 space-y-3 border-t border-gray-100 pt-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 text-xs text-gray-400",children:["当前阶段表单(",c.length,")"]}),c.length?(0,s.jsx)("dl",{className:"grid gap-x-6 gap-y-1 md:grid-cols-2",children:c.map(e=>{let[t,l]=e;return(0,s.jsxs)("div",{className:"flex gap-2 text-sm",children:[(0,s.jsx)("dt",{className:"shrink-0 text-gray-400",children:t}),(0,s.jsx)("dd",{className:"whitespace-pre-wrap text-gray-800",children:"object"==typeof l?JSON.stringify(l):String(l)})]},t)})}):(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"(空)"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-1 text-xs text-gray-400",children:["操作历史(",(null!==(i=e.history)&&void 0!==i?i:[]).length,")"]}),(0,s.jsx)("ol",{className:"space-y-1",children:(null!==(d=e.history)&&void 0!==d?d:[]).map((e,t)=>{var l;return(0,s.jsxs)("li",{className:"text-sm text-gray-700",children:[(0,s.jsx)("span",{className:"text-gray-400",children:(0,u.d3)(e.at)})," ",(0,s.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs",children:null!==(l=F[e.action])&&void 0!==l?l:e.action})," ",e.fromStage?(0,s.jsxs)("span",{children:[e.fromStage," → "]}):null,e.toStage?(0,s.jsx)("b",{children:e.toStage}):null,e.by?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.by]}):null,e.note?(0,s.jsxs)("span",{className:"text-gray-400",children:[" \xb7 ",e.note]}):null]},t)})})]})]}):null]},e.id)})}):(0,s.jsx)("p",{className:"rounded-lg border border-gray-200 bg-white p-5 text-sm text-gray-500 shadow-sm",children:"暂无推荐记录(可从头部「加入推荐流程」建档,或让 agent 写回)"})}let L={merge:"bg-blue-50 text-blue-700",sync:"bg-violet-50 text-violet-700",manual:"bg-amber-50 text-amber-700",backfill:"bg-gray-100 text-gray-600"},M={"identity.displayName":"姓名","identity.gender":"性别","identity.birthYear":"出生年","identity.location":"地点","identity.nationality":"国籍","professional.headline":"头衔","professional.summary":"简介","professional.currentCompany":"现任公司","professional.currentTitle":"现任职位","professional.titleLevel":"职级","professional.yearsOfExperience":"工作年限","professional.currentStatus":"当前状态","professional.desiredJob":"求职意向","professional.skills":"技能","professional.workExperiences":"工作经历","professional.educations":"教育经历","professional.projects":"项目经历","professional.languages":"语言","professional.certifications":"证书","contact.phones":"电话","contact.emails":"邮箱","contact.wechats":"微信","contact.linkedinUrls":"LinkedIn"},_=e=>{if(null==e)return"(空)";if("object"==typeof e){if(e.truncated)return"".concat(String(e.preview).slice(0,60),"…");if(e.name)return String(e.name);if(e.city)return String(e.city);if(e.added||e.removed){var t,l,s;let a=[],r=e=>{var t,l,s,a,r;return null!==(r=null!==(a=null!==(s=null!==(l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null==e?void 0:e.companyName)&&void 0!==l?l:null==e?void 0:e.school)&&void 0!==s?s:null==e?void 0:e.language)&&void 0!==a?a:null==e?void 0:e.value)&&void 0!==r?r:String(e)};return(null===(t=e.added)||void 0===t?void 0:t.length)&&a.push("新增 ".concat(e.added.map(r).join("、"))),(null===(l=e.removed)||void 0===l?void 0:l.length)&&a.push("移除 ".concat(e.removed.map(r).join("、"))),a.length||null==e.before||a.push("".concat(e.before," → ").concat(null!==(s=e.after)&&void 0!==s?s:"?"," 条")),a.join(";")}return JSON.stringify(e).slice(0,60)}return String(e)};function B(e){let{changes:t}=e;return(null==t?void 0:t.length)?(0,s.jsx)("ol",{className:"space-y-2",children:t.map(e=>{var t,l,a;return(0,s.jsxs)("li",{className:"rounded-lg border border-gray-200 bg-white p-3 text-sm shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-gray-900",children:null!==(t=M[e.fieldPath])&&void 0!==t?t:e.fieldPath}),(0,s.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs ".concat(null!==(l=L[e.changeType])&&void 0!==l?l:"bg-gray-100 text-gray-600"),children:null!==(a=f[e.changeType])&&void 0!==a?a:e.changeType}),e.sourceSystem?(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["来源 ",e.sourceSystem]}):null,(0,s.jsx)("span",{className:"ml-auto text-xs text-gray-400",children:(0,u.d3)(e.createdAt)})]}),(0,s.jsxs)("div",{className:"mt-1 text-gray-600",children:[(0,s.jsx)("span",{className:"text-red-600 line-through decoration-red-300",children:_(e.oldValue)}),(0,s.jsx)("span",{className:"mx-2 text-gray-400",children:"→"}),(0,s.jsx)("span",{className:"text-green-700",children:_(e.newValue)})]}),e.actor?(0,s.jsxs)("div",{className:"mt-0.5 text-xs text-gray-400",children:["操作者:",e.actor]}):null]},e.id)})}):(0,s.jsx)("p",{className:"rounded-lg border border-gray-200 bg-white p-5 text-sm text-gray-500 shadow-sm",children:"暂无字段级变更记录(画像被新解析合并/同步覆盖时自动留痕,自 2026-10-04 起记)"})}function q(e){var t,l,a,r,n,i,d,o,c,u,x,m;let{entity:h}=e,p=h.extracted||{},g=Array.isArray(p.workExperiences)?p.workExperiences:[],v=Array.isArray(p.education)?p.education:[],b=e=>"string"==typeof e?e:e&&"object"==typeof e&&"string"==typeof e.name?e.name:null,y=(Array.isArray(p.skills)?p.skills:[]).map(b).filter(Boolean),j=(Array.isArray(p.languages)?p.languages:[]).map(b).filter(e=>!!e),f=[["博士后",9],["博士",8],["DBA",8],["MBA",7],["EMBA",7],["硕士",6],["研究生",6],["MBA/EMBA",7],["本科",5],["学士",5],["大专",4],["专科",4],["高中",2],["中专",2],["初中",1]],N=e=>{if(!e)return 0;let t=0;for(let[l,s]of f)e.includes(l)&&s>t&&(t=s);return t},w=v.length?v.reduce((e,t)=>N(null==t?void 0:t.degree)>N(null==e?void 0:e.degree)?t:e):null,k=e=>{var t,l;return[null!==(t=e.start)&&void 0!==t?t:e.startDate,null!==(l=e.end)&&void 0!==l?l:e.endDate].filter(Boolean).join(" - ")};return(0,s.jsxs)("div",{className:"mb-4 rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-500",children:"现任"}),(0,s.jsx)("b",{className:"text-gray-900",children:null!==(c=null!==(o=null!==(d=p.currentCompany)&&void 0!==d?d:null===(t=g[0])||void 0===t?void 0:t.companyName)&&void 0!==o?o:null===(l=g[0])||void 0===l?void 0:l.company)&&void 0!==c?c:"(未知)"}),(0,s.jsx)("span",{className:"text-gray-700",children:null!==(m=null!==(x=null!==(u=p.currentPosition)&&void 0!==u?u:null===(a=g[0])||void 0===a?void 0:a.title)&&void 0!==x?x:null===(r=g[0])||void 0===r?void 0:r.position)&&void 0!==m?m:""})]}),g.length?(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)("div",{className:"text-xs text-gray-400",children:["工作经历(近 3 段 / 共 ",g.length," 段)"]}),(0,s.jsx)("ul",{className:"mt-1 space-y-0.5 text-sm text-gray-700",children:g.slice(0,3).map((e,t)=>{var l,a,r;return(0,s.jsxs)("li",{children:[(0,s.jsx)("b",{children:null!==(a=null!==(l=e.companyName)&&void 0!==l?l:e.company)&&void 0!==a?a:"(公司未知)"})," ",null!==(r=e.title)&&void 0!==r?r:e.position," ",(0,s.jsx)("span",{className:"text-xs text-gray-400",children:k(e)})]},t)})})]}):null,v.length?(0,s.jsxs)("div",{className:"mt-2 text-sm text-gray-700",children:[(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["教育(最近 / 最高 / 共 ",v.length," 段):"]})," ",null===(n=v[0])||void 0===n?void 0:n.school," ",null===(i=v[0])||void 0===i?void 0:i.degree,w&&w!==v[0]?" \xb7 最高:".concat(w.school," ").concat(w.degree):""]}):null,y.length||j.length?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1 text-sm",children:[y.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"技能"}),y.slice(0,12).map(e=>(0,s.jsx)("span",{className:"rounded bg-blue-50 px-2 py-0.5 text-xs text-blue-700",children:e},e))]}):null,j.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"ml-2 text-xs text-gray-400",children:"语言"}),j.map(e=>(0,s.jsx)("span",{className:"rounded bg-green-50 px-2 py-0.5 text-xs text-green-700",children:e},e))]}):null]}):null]})}function R(e){var t,l,r;let{entity:i,portraitId:d,matches:o,sources:c}=e,[u,x]=(0,a.useState)("overview"),{versions:m,recommendations:h,changes:p,evaluations:g}=function(e){let[t,l]=(0,a.useState)(null),[s,r]=(0,a.useState)(null),[i,d]=(0,a.useState)(null),[o,c]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e){l([]),r([]),d([]),c([]);return}let t=!0;return(async()=>{var s,a,i,o;let[u,x,m,h]=await Promise.all([(0,n.rd)("/parsed-resumes?portraitId=".concat(e)).catch(()=>({items:[]})),(0,n.rd)("/recommendations/by-portrait/".concat(e)).catch(()=>({items:[]})),(0,n.rd)("/resume-field-changes?portraitId=".concat(e)).catch(()=>({items:[]})),(0,n.rd)("/talent-portraits/".concat(e,"/evaluations")).catch(()=>({items:[]}))]);t&&(l(null!==(s=null==u?void 0:u.items)&&void 0!==s?s:[]),r(null!==(a=null==x?void 0:x.items)&&void 0!==a?a:[]),d(null!==(i=null==m?void 0:m.items)&&void 0!==i?i:[]),c(null!==(o=null==h?void 0:h.items)&&void 0!==o?o:[]))})(),()=>{t=!1}},[e]),{versions:t,recommendations:s,changes:i,evaluations:o}}(d),v=[{key:"overview",label:"最新情况"},{key:"resumes",label:"简历",count:null!==(t=null==m?void 0:m.length)&&void 0!==t?t:null},{key:"recommendations",label:"推荐记录",count:null!==(l=null==h?void 0:h.length)&&void 0!==l?l:null},{key:"changes",label:"变更历史",count:null!==(r=null==p?void 0:p.length)&&void 0!==r?r:null}];return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-4 flex flex-wrap gap-1 border-b border-gray-200",children:v.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>x(e.key),className:"px-4 py-2 text-sm ".concat(u===e.key?"border-b-2 border-blue-500 font-medium text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.label,null!=e.count&&e.count>0?(0,s.jsxs)("span",{className:"ml-1 text-xs text-gray-400",children:["(",e.count,")"]}):null]},e.key))}),"overview"===u?(0,s.jsx)(k,{versions:m,recommendations:h,changes:p,evaluations:g,matches:o}):null,"resumes"===u?(0,s.jsx)(D,{entity:i,portraitId:d,versions:m,sources:c}):null,"recommendations"===u?(0,s.jsx)(P,{recommendations:h}):null,"changes"===u?(0,s.jsx)(B,{changes:p}):null]})}let Y={talent:"人才",job:"职位",company:"公司"},J={talent:"bg-blue-50 text-blue-700",job:"bg-yellow-50 text-yellow-700",company:"bg-green-50 text-green-700"};function z(e){var t,l,r,i,d,o;let{type:c,entity:m,sources:h}=e,[p,g]=(0,a.useState)(h.length?String(h[0].id):""),[v,b]=(0,a.useState)(!1),[f,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(null),[S,C]=(0,a.useState)(null);async function A(){N(null);try{let e=await fetch("".concat((0,n.Ox)(),"/entities/").concat(c,"/").concat(m.id,"/repair-prompt"));if(!e.ok)throw Error("HTTP ".concat(e.status));let t=await e.json();await navigator.clipboard.writeText(t.prompt),b(!0),setTimeout(()=>b(!1),4e3)}catch(e){N(e.message)}}(0,a.useEffect)(()=>{if("talent"!==c)return;let e=!0;return(async()=>{try{var t,l;let s=await fetch("".concat((0,n.Ox)(),"/entities/talent/").concat(m.id,"/matches"));if(!s.ok)return;let a=await s.json();if(!e)return;k(null!==(t=null==a?void 0:a.portraitId)&&void 0!==t?t:null),C(null!==(l=null==a?void 0:a.matches)&&void 0!==l?l:[])}catch(e){}})(),()=>{e=!1}},[c,m.id]);let T="talent"===c?null!==(t=m.name)&&void 0!==t?t:"(未命名)":"job"===c?null!==(l=m.title)&&void 0!==l?l:"(未命名职位)":null!==(r=m.name)&&void 0!==r?r:"(未命名)",I="talent"===c?m.headline:"job"===c?m.company:"",E=h.find(e=>String(e.id)===p)||h[0];return(0,s.jsxs)("div",{className:"w-full",children:["talent"===c?(0,s.jsx)(y,{entity:m}):null,(0,s.jsxs)("header",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:T}),(0,s.jsx)("span",{className:"rounded px-2 py-0.5 text-xs ".concat(null!==(i=J[c])&&void 0!==i?i:"bg-gray-100 text-gray-600"),children:null!==(d=Y[c])&&void 0!==d?d:c}),(0,s.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:m.source}),m.sourceUrl?(0,s.jsx)("a",{href:m.sourceUrl,target:"_blank",rel:"noreferrer",title:m.sourceUrl,className:"max-w-xl truncate text-sm text-blue-600 hover:underline",children:m.sourceUrl}):null]}),I?(0,s.jsx)("p",{className:"mt-1 text-gray-600",children:I}):null,m.sessionId?(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:A,className:"rounded bg-amber-600 px-3 py-1 text-sm text-white hover:bg-amber-700",children:v?"已复制 ✓ 请发给 agent":"解析有误让agent修复"}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"按录制重解析、修解析 bug、提 issue"}),f?(0,s.jsx)("span",{className:"text-xs text-red-600",children:f}):null]}):null,"talent"===c?(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)(j,{entityId:m.id,name:T}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"加入某职位推荐流水线,默认待邀请"})]}):null]}),"talent"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(q,{entity:m}),(0,s.jsx)(R,{entity:m,portraitId:w,matches:S,sources:h.map(e=>({id:e.id,sourceUrl:e.sourceUrl,domain:e.domain,createdAt:e.createdAt}))})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"解析来源"}),E?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"当前来源页面"}),(0,s.jsx)("a",{href:E.sourceUrl,target:"_blank",rel:"noreferrer",className:"break-all text-sm text-blue-600 hover:underline",children:E.sourceUrl}),E.hasSnapshot?(0,s.jsx)("span",{className:"ml-2 rounded bg-green-50 px-1.5 py-0.5 text-xs text-green-700",children:"有录制快照"}):null]}),h.length>1?(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("label",{className:"text-sm text-gray-600",children:"历史来源:"}),(0,s.jsx)("select",{value:p,onChange:e=>g(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm",children:h.map(e=>(0,s.jsxs)("option",{value:e.id,children:[e.domain," \xb7 ",(0,u.d3)(e.createdAt)]},e.id))}),(0,s.jsx)("a",{href:E.sourceUrl,target:"_blank",rel:"noreferrer",className:"rounded bg-blue-600 px-3 py-1 text-sm text-white hover:bg-blue-700",children:"打开该来源页面"})]}):null]}):(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"暂无解析来源记录"})]}),(0,s.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"原始数据"}),(0,s.jsx)(x.Y,{data:null!==(o=m.extracted)&&void 0!==o?o:m.raw})]})]})]})}var V=l(5912),W=l(6119),H=l(3464),G=l(5777);function K(e){let t=new URLSearchParams;Object.entries(e).forEach(e=>{let[l,s]=e;s&&t.set(l,s)});let l=t.toString();return l?"?".concat(l):""}function Q(e){var t;let{type:l,label:x,batchDelete:m}=e,h=(0,r.useRouter)(),p=(0,r.usePathname)(),g=(0,r.useSearchParams)(),v=g.get("id")||"",b=(0,a.useMemo)(()=>({q:g.get("q")||"",status:"",from:g.get("from")||"",to:g.get("to")||""}),[g]),[y,j]=(0,a.useState)(null),[f,N]=(0,a.useState)(!1),w=(0,a.useCallback)(e=>{var t,l;let s=null!==(t=e.filters)&&void 0!==t?t:b,a=K({id:null!==(l=e.id)&&void 0!==l?l:v,q:s.q,from:s.from,to:s.to});h.replace("".concat(p).concat(a))},[b,v,p,h]),{session:k}=(0,G.nu)(),S=(0,W.B)({deleteUrl:"/entities/".concat(l),label:x,onDeleted:()=>C.refresh(),currentUserId:null!==(t=null==k?void 0:k.hmUserId)&&void 0!==t?t:null}),C=(0,H.k)({fetchPage:(0,a.useCallback)(async(e,t)=>{var s,a;let r=K({q:b.q,from:b.from,to:b.to}),i=await (0,n.rd)("/entities?type=".concat(l,"&limit=").concat(t,"&offset=").concat(e).concat(r.replace("?","&")));return{items:null!==(s=null==i?void 0:i.items)&&void 0!==s?s:[],total:null!==(a=null==i?void 0:i.total)&&void 0!==a?a:0,nextOffset:null==i?void 0:i.nextOffset}},[l,b.q,b.from,b.to]),pageSize:50,deps:[l,b.q,b.from,b.to]}),A=C.items;(0,a.useEffect)(()=>{S.prune(A.map(e=>String(e.id)))},[A,S]);let T=(0,a.useCallback)(()=>{if(A.length)return A[0].updatedAt},[A]);(0,a.useEffect)(()=>{if(!v){j(null);return}N(!0),Promise.all([(0,n.rd)("/entities/".concat(l,"/").concat(v)),(0,n.rd)("/entities/".concat(l,"/").concat(v,"/sources"))]).then(e=>{let[t,l]=e;if(t){var s;j({entity:t.entity,sources:null!==(s=null==l?void 0:l.items)&&void 0!==s?s:[]})}else j(null);N(!1)})},[l,v]);let I=(0,a.useMemo)(()=>A.map(e=>{var t,a,r;let n=String(e.id),i="talent"===l?(0,s.jsx)(V.oj,{name:null!==(t=e.name)&&void 0!==t?t:"(未命名)",headline:e.headline,source:e.source,updatedAt:e.updatedAt}):"job"===l?(0,s.jsx)(V.rY,{title:null!==(a=e.title)&&void 0!==a?a:"(无标题)",source:e.source,company:e.company,sourceUrl:e.sourceUrl,updatedAt:e.updatedAt}):(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"font-medium text-gray-900",children:null!==(r=e.name)&&void 0!==r?r:"(未命名)"}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-2 text-xs text-gray-400",children:[(0,s.jsx)("span",{children:e.source}),(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsx)("span",{children:(0,u.d3)(e.updatedAt)})]})]});return{id:n,content:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[m&&S.checkbox(n),i]})}}),[A,l,m,S]),E=v?f?(0,s.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):y?(0,s.jsx)(z,{type:l,entity:y.entity,sources:y.sources}):(0,s.jsxs)("div",{className:"flex h-full items-center justify-center text-red-500",children:["未找到该",x]}):(0,s.jsxs)("div",{className:"flex h-full items-center justify-center text-gray-400",children:["请在左侧选择一条",x,"查看详情"]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.m,{filterBar:(0,s.jsxs)("div",{className:"border-b border-gray-200 bg-white",children:[(0,s.jsx)(i.f,{value:b,onChange:e=>w({filters:e})}),(0,s.jsx)(c.Y,{pollUrl:"/entities/count?type=".concat(l),getLatestTimestamp:T,onRefresh:()=>C.refresh(),label:x}),m&&S.bar(I)]}),listPanel:(0,s.jsx)(o.L,{items:I,selectedId:v,onSelect:e=>w({id:e}),loading:C.loading,emptyText:"暂无".concat(x,"数据"),onLoadMore:C.loadMore,loadingMore:C.loadingMore,exhausted:C.exhausted}),detailPanel:E}),S.modal()]})}function X(e){return(0,s.jsx)(a.Suspense,{fallback:(0,s.jsx)("div",{className:"p-6 text-gray-500",children:"加载中…"}),children:(0,s.jsx)(Q,{...e})})}},7202:function(e,t,l){l.d(t,{f:function(){return r}});var s=l(2835),a=l(635);function r(e){let{value:t,showStatus:l,statusOptions:r,onChange:n}=e,[i,d]=(0,a.useState)(t);return(0,a.useEffect)(()=>{d(t)},[t.q,t.status,t.from,t.to]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{(i.q!==t.q||i.status!==t.status||i.from!==t.from||i.to!==t.to)&&n(i)},300);return()=>clearTimeout(e)},[i.q,i.status,i.from,i.to]),(0,s.jsxs)("div",{className:"space-y-2 border-b border-gray-200 bg-white p-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)("input",{type:"text",value:i.q,onChange:e=>d(t=>({...t,q:e.target.value})),placeholder:"搜索关键词...",className:"w-full rounded border border-gray-300 px-2 py-1.5 pr-8 text-sm outline-none focus:border-blue-500"}),(0,s.jsx)("button",{type:"button",onClick:()=>n({q:"",status:"",from:"",to:""}),title:"重置筛选",className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 disabled:opacity-30",disabled:!i.q&&!i.status&&!i.from&&!i.to,children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),l?(0,s.jsxs)("select",{value:i.status,onChange:e=>d(t=>({...t,status:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500",children:[(0,s.jsx)("option",{value:"",children:"全部状态"}),(r||[]).map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"date",value:i.from,onChange:e=>d(t=>({...t,from:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),(0,s.jsx)("span",{className:"text-sm text-gray-400",children:"-"}),(0,s.jsx)("input",{type:"date",value:i.to,onChange:e=>d(t=>({...t,to:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"})]})]})}},6777:function(e,t,l){l.d(t,{Y:function(){return d}});var s=l(2835),a=l(635);function r(e){let{value:t}=e;if(null===t)return(0,s.jsx)("span",{className:"italic text-gray-400",children:"null"});if(void 0===t)return(0,s.jsx)("span",{className:"italic text-gray-400",children:"undefined"});switch(typeof t){case"string":return(0,s.jsxs)("span",{className:"break-all text-red-700",children:['"',t,'"']});case"number":return(0,s.jsx)("span",{className:"text-emerald-700",children:String(t)});case"boolean":return(0,s.jsx)("span",{className:"text-blue-700",children:String(t)});default:return(0,s.jsx)("span",{className:"text-gray-700",children:String(t)})}}function n(e){let{name:t}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"text-indigo-700",children:['"',t,'"']}),(0,s.jsx)("span",{className:"text-gray-500",children:": "})]})}function i(e){let{name:t,value:l,depth:d}=e,[o,c]=(0,a.useState)(d<2);if(!("object"==typeof l&&null!==l&&!Array.isArray(l))&&!Array.isArray(l))return(0,s.jsxs)("div",{className:"min-w-0",children:[null!==t?(0,s.jsx)(n,{name:t}):null,(0,s.jsx)(r,{value:l})]});let u=Array.isArray(l),x=u?l.map((e,t)=>[String(t),e]):Object.entries(l),m=u?"]":"}",h=x.length;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"group flex cursor-pointer select-none items-baseline rounded hover:bg-gray-100",onClick:()=>c(e=>!e),role:"button","aria-expanded":o,children:[(0,s.jsx)("span",{className:"mr-0.5 inline-block w-4 shrink-0 text-center text-gray-400",children:h>0?o?"▾":"▸":""}),null!==t?(0,s.jsx)(n,{name:t}):null,(0,s.jsx)("span",{className:"text-gray-700",children:u?"[":"{"}),o?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"mx-1 rounded bg-gray-100 px-1 text-gray-400 group-hover:bg-gray-200",children:u?"".concat(h," 项"):"".concat(h," 键")}),(0,s.jsx)("span",{className:"text-gray-700",children:m})]})]}),o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"ml-[7px] border-l border-gray-200 pl-3",children:x.map(e=>{let[t,l]=e;return(0,s.jsx)(i,{name:u?null:t,value:l,depth:d+1},t)})}),(0,s.jsx)("div",{className:"pl-5 text-gray-700",children:m})]}):null]})}function d(e){let{data:t}=e;return null==t?(0,s.jsx)("div",{className:"text-xs text-gray-400",children:"(无数据)"}):(0,s.jsx)("div",{className:"max-h-[32rem] overflow-auto rounded bg-gray-50 p-3 font-mono text-xs leading-5",children:(0,s.jsx)(i,{name:null,value:t,depth:0})})}},9036:function(e,t,l){l.d(t,{Y:function(){return n}});var s=l(2835),a=l(635),r=l(4431);function n(e){let{pollUrl:t,intervalMs:l=5e3,onRefresh:n,getLatestTimestamp:i,label:d="新数据"}=e,[o,c]=(0,a.useState)(0),[u,x]=(0,a.useState)(!1),m=(0,a.useRef)(void 0);return((0,a.useEffect)(()=>{let e=()=>x(document.hidden);return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),(0,a.useEffect)(()=>{m.current=i(),c(0)},[i]),(0,a.useEffect)(()=>{if(u)return;let e=async()=>{var e;let l=m.current;if(!l)return;let s=t.includes("?")?"&":"?",a=await (0,r.rd)("".concat(t).concat(s,"since=").concat(encodeURIComponent(l))).catch(()=>null),n=null!==(e=null==a?void 0:a.count)&&void 0!==e?e:0;c(e=>Math.max(e,n))};e();let s=setInterval(e,l);return()=>clearInterval(s)},[t,l,u]),o<=0)?null:(0,s.jsxs)("button",{type:"button",onClick:()=>{c(0),n()},className:"w-full bg-blue-50 px-3 py-2 text-center text-sm text-blue-700 hover:bg-blue-100 active:bg-blue-200",children:["有 ",o," 条",d,",点击刷新"]})}}}]);