@customize-agent/server 4.60.36 → 4.61.0

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 (94) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/required-server-files.json +1 -1
  5. package/.next/routes-manifest.json +1 -1
  6. package/.next/server/chunks/1710.js +1 -0
  7. package/.next/server/chunks/3074.js +1 -1
  8. package/.next/server/chunks/3239.js +7 -0
  9. package/.next/server/chunks/5037.js +6 -6
  10. package/.next/server/chunks/5763.js +7 -7
  11. package/.next/server/chunks/9270.js +1 -1
  12. package/.next/server/middleware-build-manifest.js +1 -1
  13. package/.next/server/pages/404.html +1 -1
  14. package/.next/server/pages/500.html +1 -1
  15. package/.next/server/pages/api/assets/generated/preview.js.nft.json +1 -1
  16. package/.next/server/pages/api/assets/generated.js.nft.json +1 -1
  17. package/.next/server/pages/api/config/embedding/healthCheck.js.nft.json +1 -1
  18. package/.next/server/pages/api/config/embedding.js.nft.json +1 -1
  19. package/.next/server/pages/api/config/healthCheck.js.nft.json +1 -1
  20. package/.next/server/pages/api/config/models.js.nft.json +1 -1
  21. package/.next/server/pages/api/config/providers/[provider].js.nft.json +1 -1
  22. package/.next/server/pages/api/config/providers.js.nft.json +1 -1
  23. package/.next/server/pages/api/config/reset.js.nft.json +1 -1
  24. package/.next/server/pages/api/config/web-access.js.nft.json +1 -1
  25. package/.next/server/pages/api/documents/canvas/[id].js.nft.json +1 -1
  26. package/.next/server/pages/api/documents/delivery-review.js.nft.json +1 -1
  27. package/.next/server/pages/api/documents/export.js +1 -1
  28. package/.next/server/pages/api/documents/export.js.nft.json +1 -1
  29. package/.next/server/pages/api/documents/generate/preview.js.nft.json +1 -1
  30. package/.next/server/pages/api/documents/generate.js.nft.json +1 -1
  31. package/.next/server/pages/api/documents/generated/[id]/events.js.nft.json +1 -1
  32. package/.next/server/pages/api/documents/generated/[id]/figure/[name].js.nft.json +1 -1
  33. package/.next/server/pages/api/documents/generated/[id]/instruction.js.nft.json +1 -1
  34. package/.next/server/pages/api/documents/generated/[id]/messages.js.nft.json +1 -1
  35. package/.next/server/pages/api/documents/generated/[id]/nodes/[nodeId].js.nft.json +1 -1
  36. package/.next/server/pages/api/documents/generated/[id]/nodes.js.nft.json +1 -1
  37. package/.next/server/pages/api/documents/generated/[id]/pause.js.nft.json +1 -1
  38. package/.next/server/pages/api/documents/generated/[id]/preview.js.nft.json +1 -1
  39. package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/confirm.js.nft.json +1 -1
  40. package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/rollback.js.nft.json +1 -1
  41. package/.next/server/pages/api/documents/generated/[id]/repair.js.nft.json +1 -1
  42. package/.next/server/pages/api/documents/generated/[id]/report.js.nft.json +1 -1
  43. package/.next/server/pages/api/documents/generated/[id]/resume-generate.js.nft.json +1 -1
  44. package/.next/server/pages/api/documents/generated/[id].js.nft.json +1 -1
  45. package/.next/server/pages/api/documents/generated.js.nft.json +1 -1
  46. package/.next/server/pages/api/health.js.nft.json +1 -1
  47. package/.next/server/pages/api/jobs/[id].js.nft.json +1 -1
  48. package/.next/server/pages/api/kb/categories.js.nft.json +1 -1
  49. package/.next/server/pages/api/kb/duplicates.js.nft.json +1 -1
  50. package/.next/server/pages/api/kb/features.js.nft.json +1 -1
  51. package/.next/server/pages/api/kb/files/detail.js.nft.json +1 -1
  52. package/.next/server/pages/api/kb/files/export.js.nft.json +1 -1
  53. package/.next/server/pages/api/kb/files/open.js.nft.json +1 -1
  54. package/.next/server/pages/api/kb/files/preview-pdf-page.js.nft.json +1 -1
  55. package/.next/server/pages/api/kb/files/reindex.js.nft.json +1 -1
  56. package/.next/server/pages/api/kb/files/search.js.nft.json +1 -1
  57. package/.next/server/pages/api/kb/files/source-preview.js.nft.json +1 -1
  58. package/.next/server/pages/api/kb/files.js.nft.json +1 -1
  59. package/.next/server/pages/api/kb/ignore.js.nft.json +1 -1
  60. package/.next/server/pages/api/kb/material-groups.js.nft.json +1 -1
  61. package/.next/server/pages/api/kb/operations.js.nft.json +1 -1
  62. package/.next/server/pages/api/kb/reindex.js.nft.json +1 -1
  63. package/.next/server/pages/api/kb/stats.js.nft.json +1 -1
  64. package/.next/server/pages/api/kb/tags.js.nft.json +1 -1
  65. package/.next/server/pages/api/kb/upload/complete.js.nft.json +1 -1
  66. package/.next/server/pages/api/kb/upload.js.nft.json +1 -1
  67. package/.next/server/pages/api/prompt/chat.js.nft.json +1 -1
  68. package/.next/server/pages/api/skills/[id].js.nft.json +1 -1
  69. package/.next/server/pages/api/skills/validate.js.nft.json +1 -1
  70. package/.next/server/pages/api/skills.js.nft.json +1 -1
  71. package/.next/server/pages/api/system/data-health.js.nft.json +1 -1
  72. package/.next/server/pages/api/system/reset.js.nft.json +1 -1
  73. package/.next/server/pages/documents.html +1 -1
  74. package/.next/server/pages/generation/[id].html +1 -1
  75. package/.next/server/pages/generation.html +1 -1
  76. package/.next/server/pages/jobs.html +1 -1
  77. package/.next/server/pages/knowledge/file-detail.html +1 -1
  78. package/.next/server/pages/knowledge/files.html +1 -1
  79. package/.next/server/pages/knowledge/manage.html +1 -1
  80. package/.next/server/pages/knowledge/source-preview.html +1 -1
  81. package/.next/server/pages/knowledge.html +1 -1
  82. package/.next/server/pages/models.html +1 -1
  83. package/.next/server/pages/settings.html +1 -1
  84. package/.next/server/pages/skills/[id]/edit.html +1 -1
  85. package/.next/server/pages/skills/[id].html +1 -1
  86. package/.next/server/pages/skills/new.html +1 -1
  87. package/.next/server/pages/skills.html +1 -1
  88. package/.next/server/pages-manifest.json +32 -32
  89. package/.next/static/{e5c2576dc1ab66edac22c9534755509cc2e1354bd840260e3154f2c95cf8bbf2 → 317fea8baac62973504b896cd4a4949fbe758b61932a9d7bd265b7891a57e0ff}/_buildManifest.js +1 -1
  90. package/.next/static/chunks/pages/generation/[id]-83db154d46fd7aeb.js +1 -0
  91. package/package.json +2 -2
  92. package/.next/server/chunks/9283.js +0 -7
  93. package/.next/static/chunks/pages/generation/[id]-1f97e47ce545bd11.js +0 -1
  94. /package/.next/static/{e5c2576dc1ab66edac22c9534755509cc2e1354bd840260e3154f2c95cf8bbf2 → 317fea8baac62973504b896cd4a4949fbe758b61932a9d7bd265b7891a57e0ff}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[200],{70130:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/generation/[id]",function(){return r(74024)}])},74024:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>e1});var n=r(65321),s=r(97109),l=r(3454),a=r.n(l),i=r(43220),o=r.n(i),c=r(86109),d=r(48399),u=r(17807),p=r(42700),m=r(32941),g=r(33442),h=r(85114),f=r(14932),x=r(99811),v=r(82930),y=r(45042),j=r(6578),b=r(48702),w=r(93533),k=r(11702),A=r(85493),N=r(84662),S=r(30486),C=r(4527),R=r(80042),I=r(99650),E=r(25345),T=r(7851),P=r(33555),M=r(23216),D=r(49075),L=r(43240),q=r(26619),_=r(46791),z=r(8579),B=r(26631),F=r(35459),W=r(64629),U=r(76824),H=r(83374),$=r(81668),O=r(39356),Q=r(8263),G=r(61024),X=r(32919),V=r(96538);let K=["failed","paused","repairing","blocked","running","pending","completed"],Z=["chars","costUsd"];function J(e,t){return e.seq!==t.seq?e.seq-t.seq:e.id===t.id?0:e.id<t.id?-1:1}function Y(e){let t=new Map;for(let r of e){if(void 0===r.parentId)continue;let e=t.get(r.parentId);e?e.push(r):t.set(r.parentId,[r])}for(let e of t.values())e.sort(J);return t}function ee(e){let t=new Map(e.map(e=>[e.id,e])),r=new Map;for(let n of e){let e=0,s=n,l=new Set([n.id]);for(;(null==s?void 0:s.parentId)!==void 0;){let r=t.get(s.parentId);if(!r||l.has(r.id))break;l.add(r.id),e+=1,s=r}r.set(n.id,e)}return r}let et=["responsibility","purpose","round","round.decide","round.fix","decision","chapter","repair.request","repair.localize","repair.impact","repair.transaction","repair.recheck","supervisor","resume.plan","skill.load"],er=new Set([...et,"prepare","understand","plan","blueprint","write","close","deliver","block","turn"]);[...et];let en=new Set(["failed","paused","repairing","blocked","running","pending","completed"]);var es=r(2181);let el={pending:{key:"common.statusWaiting",text:"等待中",color:"default"},running:{key:"common.statusRunning",text:es.Uu.running,color:"processing"},completed:{key:"common.statusCompleted",text:es.Uu.success,color:"success"},paused:{key:"common.statusPaused",text:"已暂停",color:"gold"},repairing:{key:"common.statusRepairing",text:"修复中",color:"warning"},blocked:{key:"common.statusBlocked",text:"已放弃(阻塞)",color:"warning"},failed:{key:"common.statusAbnormal",text:"异常",color:"error"}};function ea(e,t,r,n){let s=e[t];if(!s)return"未知".concat(r,"(").concat(t||"空",")");if(s.key&&n){let e=n(s.key);if(e&&e!==s.key)return e}return s.text}function ei(e,t){return ea(el,e,"状态",t)}let eo={queued:{key:"common.statusWaiting",text:"排队中",color:"default"},generating:{key:"common.statusRunning",text:"生成中",color:"processing"},paused:{key:"common.statusPaused",text:"已暂停",color:"gold"},completed:{key:"common.statusCompleted",text:"已完成",color:"success"},completed_with_issues:{key:"common.statusReview",text:"完成(有需复核项)",color:"warning"},warning:{key:"common.statusReview",text:"需复核",color:"warning"},failed:{key:"common.statusAbnormal",text:"失败",color:"error"},aborted:{key:"common.statusAbnormal",text:"已中止",color:"default"}},ec={responsibility:"职责",purpose:"目的",decision:"已生效决定",prepare:"生成准备",understand:"资料理解",plan:"规划",blueprint:"蓝图",write:"正文撰写",close:"收口",deliver:"交付",chapter:"章节",block:"块",turn:"轮次",round:"收口轮","round.decide":"收口\xb7判定","round.fix":"收口\xb7修复","repair.request":"修复\xb7请求","repair.localize":"修复\xb7定位","repair.impact":"修复\xb7影响面","repair.transaction":"修复\xb7事务","repair.recheck":"修复\xb7复检","skill.load":"技能命中",supervisor:"调度决策","resume.plan":"续跑任务书"},ed={role_binding:(0,s.createElement)(N.A),knowledge_retrieval:(0,s.createElement)(S.A),file_understanding:(0,s.createElement)(C.A),fact_extraction:(0,s.createElement)(R.A),chapter_generation:(0,s.createElement)(I.A),llm_review:(0,s.createElement)(E.A),validation:(0,s.createElement)(T.A),reference:(0,s.createElement)(P.A),responsibility:(0,s.createElement)(M.A),purpose:(0,s.createElement)(D.A),decision:(0,s.createElement)(T.A),prepare:(0,s.createElement)(L.A),understand:(0,s.createElement)(q.A),plan:(0,s.createElement)(M.A),blueprint:(0,s.createElement)(_.A),write:(0,s.createElement)(z.A),chapter:(0,s.createElement)(B.A),block:(0,s.createElement)(F.A),turn:(0,s.createElement)(W.A),round:(0,s.createElement)(U.A),close:(0,s.createElement)(H.A),deliver:(0,s.createElement)($.A),repair:(0,s.createElement)(O.A),skill:(0,s.createElement)(Q.A),supervisor:(0,s.createElement)(G.A),resume:(0,s.createElement)(X.A),default:(0,s.createElement)(L.A)};function eu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:160,r=e.replace(/^\s*#{1,6}\s*/u,"").replace(/\s+/gu," ").trim();return r.length>t?"".concat(r.slice(0,t),"…"):r}function ep(e){var t,r;let n=e.issues;return{id:e.id,...void 0!==e.parentId?{parentId:e.parentId}:{},type:e.type||"block",title:null!=(t=e.title)?t:"",seq:"number"==typeof e.seq&&Number.isFinite(e.seq)?e.seq:0,status:"string"==typeof(r=e.status)&&en.has(r)?e.status:"failed",startedAt:"number"==typeof e.startedAt&&Number.isFinite(e.startedAt)&&e.startedAt>0?e.startedAt:0,...void 0!==e.completedAt?{completedAt:e.completedAt}:{},...e.progress?{progress:e.progress}:{},...e.metrics?{metrics:e.metrics}:{},...Array.isArray(n)&&n.length>0?{issues:n}:{},...void 0!==e.payloadRef?{payloadRef:e.payloadRef}:{}}}function em(e){var t;if("number"!=typeof e.startedAt||(null==(t=e.metrics)?void 0:t.instantEvent)===!0)return;let r=("number"==typeof e.completedAt?e.completedAt:Date.now())-e.startedAt;return r>=0?r:void 0}function eg(e){return void 0===e?"—":(0,V.a)(e,{unit:"ms",style:"fine"})}function eh(e){let{readings:t}=e,r=null==t?void 0:t.contractQuality;if(!r)return null;let s=r.score,l=null==t?void 0:t.contractQualityStale;return Array.isArray(s.defects)?(0,n.jsxs)("div",{"aria-label":"七维评价",style:{fontSize:12,lineHeight:1.8},children:[(0,n.jsx)("strong",{children:l?"编辑前的历史七维诊断":"七维专业诊断"}),(0,n.jsxs)("span",{children:[";",l?"当前正文须重新评价":s.deliveryReady?"适用职责核验满足,待专业验收":"仍有缺陷或待核事项"]}),(0,n.jsxs)("div",{children:["阻断 ",s.blocking.length," 项;按根因归并的问题 ",s.defects.length," 项。专业档位不换算为未经标定的百分分数。"]}),l&&(0,n.jsx)("div",{children:l.reason}),(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:"查看七个维度"}),(0,n.jsxs)("table",{style:{width:"100%"},children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"维度"}),(0,n.jsx)("th",{children:"质量档位"}),(0,n.jsx)("th",{children:"满足 / 未满足 / 未判定"})]})}),(0,n.jsx)("tbody",{children:s.dimensions.map(e=>(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{children:e.label}),(0,n.jsx)("td",{children:"not-applicable"===e.status?"不适用":e.qualityLabel}),(0,n.jsxs)("td",{children:[e.verification.met," / ",e.verification.failed," / ",e.verification.unmeasured]})]},e.id))})]}),(0,n.jsx)("div",{children:r.expertValidated?"已完成专家校准。":"尚未完成专家校准。"})]})]}):(0,n.jsx)("div",{role:"status",children:"历史评价回执保留;按当前专业诊断口径重新评价后显示核验与质量档位。"})}let{Paragraph:ef,Text:ex}=d.A,ev={"out-of-scope":"本次范围外",untracked:"未建立轨道",planned:"已建立轨道","section-planned":"已规划小节",drafting:"写作中",reviewing:"审查中",resolved:"已收口",blocked:"阻塞",locked:"已锁定"};function ey(e){return new Date(e).toLocaleString()}function ej(e){var t,r;let{status:s,title:l,html:a,source:i,truncated:o,totalChars:c,renderedChars:d,stats:u,gate:m,loading:f,error:x,onRetry:v,updatedAt:y,generatedAt:j,className:b,t:w,deliveryReadings:N,sectionProgress:S,budgetPause:C}=e,R=null!=a?a:"",I=R.trim().length>0,E=u?function(e){let t=[];return e.droppedDangerousBlocks>0&&t.push("删除了 ".concat(e.droppedDangerousBlocks," 处可执行/可加载内容(脚本、样式、内嵌页面等)")),e.blockedUrls>0&&t.push("拦截了 ".concat(e.blockedUrls," 个协议不安全的链接(如 javascript: / data:)")),e.escapedTags>0&&t.push("转义了 ".concat(e.escapedTags," 个不支持的标签(原文里的原始 HTML 会以文字显示)")),e.droppedAttributes>0&&t.push("剥离了 ".concat(e.droppedAttributes," 个属性(样式、事件、非白名单属性)")),e.droppedComments>0&&t.push("删除了 ".concat(e.droppedComments," 处注释/声明")),t}(u):[],T=(0,n.jsxs)("div",{className:"deliverablePreviewMeta",children:[l&&(0,n.jsx)(ex,{strong:!0,style:{fontSize:15},children:l}),s&&(0,n.jsx)(k.A,{color:null!=(r=null==(t=eo[s])?void 0:t.color)?r:"default",children:ea(eo,s,"记录状态",w)}),i&&(0,n.jsx)(ex,{type:"secondary",style:{fontSize:12},children:"预览正文:".concat("editedMarkdown"===i?"编辑后的正文(以它为准)":"markdown"===i?"记录里的正文(markdown 字段)":"draft"===i?"生成时的草案正文(draft.markdown)":"none"===i?"没有正文":"未识别的正文来源(".concat(i,")"))}),j?(0,n.jsx)(ex,{type:"secondary",style:{fontSize:12},children:"生成于 ".concat(ey(j))}):null,y?(0,n.jsx)(ex,{type:"secondary",style:{fontSize:12},children:"更新于 ".concat(ey(y))}):null]}),P=null!=S?S:[],M=P.filter(e=>e.locked).length,D=P.length>0?Math.round(M/P.length*100):0,L=P.length>0?(0,n.jsxs)("section",{className:"sectionProgressBlock","aria-label":"章节完整性",children:[(0,n.jsxs)("div",{className:"sectionProgressHead",children:[(0,n.jsx)("span",{className:"sectionProgressTitle",children:"章节完整性"}),(0,n.jsx)("span",{className:"sectionProgressCount",children:"".concat(M,"/").concat(P.length," 已锁定")})]}),(0,n.jsx)("div",{className:"sectionProgressBar","aria-hidden":!0,children:(0,n.jsx)("div",{className:"sectionProgressBarFill",style:{width:"".concat(D,"%")}})}),(0,n.jsx)("ul",{className:"sectionProgressList",children:P.map(e=>(0,n.jsxs)("li",{className:"sectionProgressRow",children:[(0,n.jsx)("span",{className:"sectionProgressOrder",children:e.order}),(0,n.jsxs)("span",{className:"sectionProgressName",title:"".concat(e.chapterTitle,"/").concat(e.title),children:[e.chapterTitle,"/",e.title]}),(0,n.jsxs)("span",{className:"sectionProgressPhase is-".concat(e.phase),children:[ev[e.phase],e.unitCount?" \xb7 ".concat(e.unitCount," 单元"):""]}),e.reason?(0,n.jsx)("span",{className:"sectionProgressReason",children:e.reason}):null]},e.sectionId))})]}):null,q=C?(0,n.jsx)(A.A,{style:{width:"100%"},type:"warning",showIcon:!0,title:"生成已按预算".concat("hard-stop"===C.enforcement?"硬停":"安全暂停"),description:(0,n.jsx)(ex,{style:{fontSize:12},children:C.message})}):null;return(0,n.jsx)("div",{className:null!=b?b:"deliverablePreview",children:(0,n.jsxs)("div",{className:"deliverablePreviewStack",children:[T,(0,n.jsx)(eh,{readings:N}),L,q,o&&(0,n.jsx)(A.A,{style:{width:"100%"},type:"warning",showIcon:!0,title:"正文过长,预览只渲染了前 ".concat((null!=d?d:0).toLocaleString()," 字(共 ").concat((null!=c?c:0).toLocaleString()," 字)"),description:"后续内容未渲染;导出物是完整正文,不受预览截断影响。"}),E.length>0&&(0,n.jsx)(A.A,{style:{width:"100%"},type:"info",showIcon:!0,title:"预览已对内容做安全处置(与导出物可能存在差异)",description:(0,n.jsx)("div",{style:{fontSize:12,lineHeight:1.7},children:E.map(e=>(0,n.jsxs)("div",{children:["\xb7 ",e]},e))})}),f&&(0,n.jsxs)(g.A,{align:"center",size:8,children:[(0,n.jsx)(p.A,{size:"small"}),(0,n.jsx)(ex,{type:"secondary",children:"正在取回成稿预览(服务端渲染 + 清洗)…"})]}),!f&&x&&(0,n.jsx)(A.A,{style:{width:"100%"},type:"error",showIcon:!0,title:"取回成稿预览失败",description:(0,n.jsxs)(g.A,{orientation:"vertical",size:6,children:[(0,n.jsx)(ex,{style:{fontSize:12},children:x}),v&&(0,n.jsx)(h.Ay,{size:"small",onClick:v,children:"重新取回"})]})}),!f&&!x&&!I&&(0,n.jsx)(A.A,{style:{width:"100%"},type:"info",showIcon:!0,title:"这条记录还没有可预览的正文",description:"生成完成后这里会显示成稿全文;生成中的记录只有动作与消息(见生成页),没有正文可预览。"}),!x&&I&&(0,n.jsxs)("div",{className:"deliverablePreviewPaper",children:[(0,n.jsx)("article",{className:"deliverablePreviewBody","aria-label":"成稿预览正文",dangerouslySetInnerHTML:{__html:R}}),(0,n.jsxs)("div",{className:"deliverablePreviewEnd",children:[(0,n.jsx)(ex,{type:"secondary",style:{fontSize:12},children:o?"正文到此为止(预览有截断,见上方提示;导出物是完整正文)":d&&d>0?"正文到此为止:以上是本记录的全部正文,共 ".concat(d.toLocaleString()," 字(未截断)"):"正文到此为止:以上是本记录的全部正文(未截断)"}),m&&!m.passed&&(0,n.jsx)(ex,{style:{fontSize:12,color:"var(--colorWarning)"},children:"交付门禁未通过(阻断 ".concat(m.blockingCount," 项)——正文在这里结束并不代表成稿完整,缺什么见上方的阻断项清单。")})]})]}),!x&&I&&(0,n.jsx)(ef,{type:"secondary",style:{fontSize:12,marginBottom:0,textAlign:"left"},children:"预览为服务端渲染结果;排版细节(字体、页眉页脚、分页)以导出物为准。"})]})})}var eb=r(45907),ew=r(34052),ek=r(84253),eA=r(76830);function eN(e){let{reports:t,deliveryReadings:r,t:l}=e,[a,i]=(0,s.useState)(!1),o=(e,t)=>{let r=null==l?void 0:l(e);return r&&r!==e?r:t},c=(0,s.useSyncExternalStore)(j.p5,j.dH,j.dH),d=c?function(e,t){var r,n;let{receipt:s}=e,l=(e,r,n,s)=>t(e,r).replace("{count}",String(n))+(s?":".concat(s):""),a=[];"review"===s.exportPurpose&&a.push({key:"review-purpose",tone:"info",text:"审阅稿:验收结论保持原状态,独立问题报告与正文版本绑定"}),s.issuesReport&&a.push({key:"review-report",tone:"info",text:"独立问题报告:".concat(s.issuesReport.id.slice(0,12),";正文 SHA256:").concat(s.issuesReport.bodySha256)}),"mismatch"===s.gateBinding?a.push({key:"binding-mismatch",tone:"error",text:t("records.receiptBindingMismatch","正文与门禁指纹不匹配:放行依据不是这份正文(收口后被编辑/替换过)")}):"absent"===s.gateBinding&&a.push({key:"binding-absent",tone:"warning",text:t("records.receiptBindingAbsent","门禁未绑定正文指纹:无法核对放行依据是否就是这份正文")}),s.gateIssues&&s.gateIssues.length>0&&a.push({key:"gate-issues",tone:"error",text:l("records.receiptGateIssues","门禁阻断清单 {count} 项",s.gateIssues.length,s.gateIssues[0])}),s.contentIssues&&s.contentIssues.length>0&&a.push({key:"content-issues",tone:"warning",text:l("records.receiptContentIssues","内容问题 {count} 条",s.contentIssues.length,s.contentIssues[0])});let i=null!=(n=null==(r=s.figureInline)?void 0:r.failed)?n:[];return i.length>0&&a.push({key:"figure-inline",tone:"warning",text:l("records.receiptFigureFailures","图件未内联 {count} 张",i.length,i[0])}),s.renderAudit&&s.renderAudit.blockerCount>0&&a.push({key:"render-blockers",tone:"error",text:l("records.receiptRenderBlockers","渲染审计:源层结构缺陷 {count} 项",s.renderAudit.blockerCount)}),s.renderAudit&&s.renderAudit.notices.length>0&&a.push({key:"render-notices",tone:"warning",text:l("records.receiptRenderNotices","渲染审计告警 {count} 条",s.renderAudit.notices.length,s.renderAudit.notices[0])}),s.templateWarning&&a.push({key:"template-warning",tone:"warning",text:"".concat(t("records.receiptTemplateWarning","模板占位符缺失,已回退:")).concat(s.templateWarning)}),s.pageLimit&&a.push({key:"page-limit",tone:"warning",text:s.pageLimit}),"number"==typeof s.pdfPageCount&&a.push({key:"pdf-pages",tone:"info",text:t("records.receiptPdfPages","PDF 共 {count} 页").replace("{count}",String(s.pdfPageCount))}),a}(c,o):[],u=d.filter(e=>"info"!==e.tone),p=d.length>0;if(0===t.length&&!r&&0===u.length&&!(null==c?void 0:c.receipt.issuesReport)&&(null==c?void 0:c.receipt.exportPurpose)!=="review")return null;let m=[...t].sort((e,t)=>t.exportedAt-e.exportedAt),g=m.find(e=>{var t,r;return(null!=(r=null==(t=e.gateChecklist)?void 0:t.items.length)?r:0)>0});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(f.A,{title:o("records.reportTitle","导出闭环报告"),children:(0,n.jsxs)(h.Ay,{size:"small",icon:(0,n.jsx)(eA.A,{}),onClick:()=>i(!0),children:[(null==r?void 0:r.contractQuality)?"七维诊断".concat(r.contractQualityStale?"(历史)":r.contractQuality.score.deliveryReady?"(待验收)":"(待修验)"):o("records.reportEntry","导出报告"),t.length>0&&(0,n.jsx)("span",{className:"ml-1 text-[var(--colorTextTertiary)]",children:t.length}),u.length>0&&(0,n.jsx)(k.A,{color:u.some(e=>"error"===e.tone)?"error":"warning",className:"m-0 ml-1 border-0",children:o("records.receiptBadge","本次导出 {count} 项提醒").replace("{count}",String(u.length))})]})}),(0,n.jsxs)(ew.A,{title:o("records.reportTitle","导出闭环报告"),placement:"right",size:"default",open:a,onClose:()=>i(!1),styles:{body:{padding:16}},children:[p&&c&&(0,n.jsxs)("div",{className:"mb-3 rounded-xl border px-3 py-2.5 text-xs ".concat(u.length>0?"border-[var(--colorWarning)] bg-[var(--colorWarningBg)]":"border-[var(--borderColor)] bg-[var(--colorFillAlter)]"),children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"font-semibold",children:o("records.receiptTitle","最近一次导出回执")}),(0,n.jsx)(k.A,{color:"blue",className:"m-0 border-0 font-semibold",children:c.format.toUpperCase()}),(0,n.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:new Date(c.at).toLocaleString()}),c.filename&&(0,n.jsx)("span",{className:"break-all text-[var(--colorTextTertiary)]",children:c.filename})]}),c.receipt.issuesReport&&(0,n.jsx)("a",{className:"text-[var(--colorPrimary)] underline",href:(0,j.Es)(c,c.receipt.issuesReport),children:"下载本份正文的独立问题报告"}),(0,n.jsx)("div",{className:"mt-2 flex flex-col gap-1.5",children:d.map(e=>(0,n.jsx)("div",{className:"error"===e.tone?"text-[var(--colorError)]":"warning"===e.tone?"text-[var(--colorWarning)]":"text-[var(--colorTextSecondary)]",children:e.text},e.key))})]}),r&&(0,n.jsxs)("div",{className:"mb-3 flex flex-col gap-2 rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5 text-xs",children:[r.contractQuality&&(0,n.jsx)(eh,{readings:r}),r.netChars&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:o("records.netCharsLabel","修复链净增字数")}),(0,n.jsxs)("span",{className:"font-semibold",children:[r.netChars.delta>0?"+":"",r.netChars.delta]}),(0,n.jsxs)("span",{className:"text-[var(--colorTextSecondary)]",children:["(",r.netChars.before," → ",r.netChars.after,",",o("records.netCharsRatio","占原稿")," ",(100*r.netChars.ratio).toFixed(1),"%)"]}),r.netChars.ratio>.05&&(0,n.jsx)(f.A,{title:o("records.netCharsWarn",'目标 ≤5%:净增越大,"分是修出来的"成分越高——首过写作的缺口被修复链补上了'),children:(0,n.jsx)(k.A,{color:"warning",className:"m-0 border-0",children:o("records.netCharsOver","超目标")})})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:o("records.reviewReportLabel","交付三件套报告")}),(0,n.jsx)("a",{href:"/api/documents/generated/".concat(encodeURIComponent(r.docId),"/report").concat(r.projectRoot?"?projectRoot=".concat(encodeURIComponent(r.projectRoot),"&download=1"):"?download=1"),className:"text-[var(--colorPrimary)] underline",children:o("records.reviewReportDownload","下载 .md")}),(0,n.jsx)("a",{href:"/api/documents/generated/".concat(encodeURIComponent(r.docId),"/report").concat(r.projectRoot?"?projectRoot=".concat(encodeURIComponent(r.projectRoot)):""),target:"_blank",rel:"noreferrer",className:"text-[var(--colorPrimary)] underline",children:o("records.reviewReportView","在线查看")}),(0,n.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:o("records.reviewReportHint","未跑到终门禁的记录没有报告(打开会说明原因)")})]})]}),0===m.length?(0,n.jsx)(ek.A,{image:ek.A.PRESENTED_IMAGE_SIMPLE,description:o("records.reportEmpty","还没有导出记录")}):(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[m.map((e,t)=>(0,n.jsxs)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5 text-xs",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)(k.A,{color:"blue",className:"m-0 border-0 font-semibold",children:e.format.toUpperCase()}),(0,n.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:new Date(e.exportedAt).toLocaleString()}),"review"===e.exportPurpose&&(0,n.jsx)(k.A,{children:"审阅稿"}),e.reviewReport&&(0,n.jsx)("a",{className:"text-[var(--colorPrimary)] underline",href:(0,j.Es)({documentId:null==r?void 0:r.docId,projectRoot:null==r?void 0:r.projectRoot},e.reviewReport),children:"下载独立问题报告"})]}),(0,n.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[var(--colorTextSecondary)]",children:[void 0!==e.durationMs&&(0,n.jsxs)("span",{children:[o("records.reportDuration","总用时")," ",(0,V.a)(e.durationMs,{unit:"ms",style:"fine-decimal"})]}),void 0!==e.repairedCount&&(0,n.jsxs)("span",{children:[o("records.reportRepaired","修复")," ",e.repairedCount,void 0!==e.blockingCount?"(".concat(o("records.reportBlocking","质量诊断快照阻断")," ").concat(e.blockingCount,")"):""]}),e.ruleSummary&&e.ruleSummary.length>0&&(0,n.jsxs)("span",{children:[o("records.reportRules","规则")," ",e.ruleSummary.length]}),!1===e.gatePassed&&(0,n.jsxs)(k.A,{color:"error",className:"m-0 border-0",children:[o("records.reportGateBlocked","非交付物"),void 0!==e.gateIssueCount&&e.gateIssueCount>0?" \xb7 ".concat(o("records.reportGateBlockedCount","门禁阻断")," ").concat(e.gateIssueCount," ").concat(o("records.reportGateBlockedUnit","项")):" \xb7 ".concat(o("records.reportGateBlockedUnknown","阻断数未记录(清单缺失)"))]}),e.healthAlerts&&e.healthAlerts.length>0&&(0,n.jsxs)(k.A,{color:"warning",className:"m-0 border-0",children:[o("records.reportHealthAlerts","健康告警")," ",e.healthAlerts.length]})]})]},"".concat(e.exportedAt,"-").concat(t))),(null==g?void 0:g.gateChecklist)&&(0,n.jsxs)("div",{className:"rounded-xl border border-[var(--colorWarning)] bg-[var(--colorWarningBg)] px-3 py-2.5",children:[(0,n.jsxs)("div",{className:"text-xs font-semibold text-[var(--colorWarning)]",children:[o("records.reportChecklistTitle","最近一次非交付物导出的未收敛项"),"(",o("records.reportChecklistTotal","共 {count} 项").replace("{count}",String(g.gateChecklist.total)),")"]}),(0,n.jsx)("div",{className:"mt-2 flex flex-col gap-2",children:g.gateChecklist.items.map(e=>(0,n.jsxs)("div",{className:"text-xs",children:[(0,n.jsx)("div",{className:"whitespace-pre-wrap text-[var(--colorText)]",children:"".concat(e.index,".【").concat(e.category,"】").concat(e.problem)}),(0,n.jsxs)("div",{className:"text-[var(--colorTextSecondary)]",children:[e.repairPath,e.detectorId?"|".concat(e.detectorId):""]})]},e.index))})]})]})]})]})}var eS=r(28629),eC=r(2518);function eR(e){let t=[],r=[];for(let n of e.issues)("stage-details"===n.source?r:t).push(n);return{problems:t,details:r,counts:{error:t.filter(e=>"error"===e.level).length,warning:t.filter(e=>"warning"===e.level).length,info:t.filter(e=>"info"===e.level).length}}}let eI=new Set(["responsibility:actor:chief","responsibility:material-preparation","responsibility:facts-verification","responsibility:structure-planning","responsibility:derivation","responsibility:writing","responsibility:finalize","responsibility:delivery"]);function eE(e,t){let r=e;for(let e=0;r&&e<64&&!eI.has(r.id);e+=1){if(r.id.startsWith("responsibility:actor:"))return function(e){var t,r,n,s;let l=String(null!=e?e:"").replace(/\s+/gu," ").trim(),a=[...(null!=(n=null==(t=l.match(/承接([^::\n]{0,240})/u))?void 0:t[1])?n:"").matchAll(/「([^」]+)」/gu)].map(e=>e[1].trim()).filter(Boolean);if(a.length)return"".concat(a.slice(0,2).join("、")).concat(a.length>2?" 等":"");let i=null!=(s=null==(r=l.split(/[::\n]/u)[0])?void 0:r.replace(/^#{1,6}\s*/u,"").trim())?s:"";return i&&i.length<=28?i:"专业智能体"}(r.title);r=r.parentId?t.get(r.parentId):void 0}return"主控智能体"}function eT(e){return e.replace(/^[A-Z][A-Z0-9_]{2,}\s*[::]\s*/u,"").replace(/^document\s*[::]\s*/iu,"")}function eP(e){return e.replace(/(^|\n)\s*#{1,6}\s+/gu,"$1").replace(/([::])\s*#{1,6}\s+/gu,"$1").replace(/\s#{1,6}\s+/gu," ")}function eM(e){return e.replace(/[;;]?\s*已结束调用\s*\d+(?:\s*[,,]\s*在途\s*\d+)?/gu,"").replace(/[;;]?\s*在途\s*\d+/gu,"").replace(/[;;]?\s*耗时\s*\d+(?:\.\d+)?\s*秒/gu,"").replace(/[;;]?\s*正在等待\/处理[::][^;;。]*/gu,"").replace(/[。;;]?\s*执行结束不等于整稿通过。?/gu,"").replace(/[::]?\s*(?:本项执行结束|正在执行)(?=[;;。,,]|$)/gu,"").replace(/([,,;;、])\s*[,,;;、]+/gu,"$1")}function eD(e){return e.replace(/^[\s,,、;;。.::]+|[\s,,、;;。.::]+$/gu,"")}function eL(e){return e?[...new Set(e.split(/[;;。]/u).map(e=>eD(eM(eT(e.trim())))).map(e=>e.replace(/\s+/gu," ").trim()).filter(Boolean).filter(e=>!/^(?:本项)?执行结束$|^正在执行$|^执行结束$|^未执行$|^已完成$|^完成$|^暂无$/u.test(e)))].join(";"):""}let eq=[{key:"chars",label:"字数",format:e=>Number.isFinite(Number(e))?"".concat(Number(e).toLocaleString()," 字"):""},{key:"chapters",label:"章数",format:e=>"".concat(e," 章")},{key:"facts",label:"事实",format:e=>"".concat(e," 条")},{key:"toolCalls",label:"工具调用",format:e=>"".concat(e," 次")},{key:"attempt",label:"尝试",format:e=>"第 ".concat(e," 次")},{key:"turn",label:"轮次",format:e=>"第 ".concat(e," 轮")},{key:"residual",label:"残余",format:e=>String(e)}],e_={error:"错误",warning:"警告",info:"提示"};function ez(e){let{node:t,agentLabel:r,parentTitle:s,previousTitle:l,nextTitle:a,narrative:i,t:o}=e,c=eR(t),d="running"===t.status?void 0:em(t),u=eu(t.title,300),p=ei(t.status,o),m=function(e){if(!e)return"";let t=eP(eD(eM(eT(e.replace(/^\s*(?:开始|完成|失败|暂停|继续)[::]\s*/u,"").split(/\n+/u).map(e=>e.trim()).filter(e=>e&&!/^#{1,6}\s/u.test(e)).join(" "))))).replace(/\s+/gu," ").trim();return t?t.length>240?"".concat(t.slice(0,240),"…"):t:""}(i),g=t.progress&&t.progress.total>0?"".concat(t.progress.current,"/").concat(t.progress.total).concat(t.progress.label?" \xb7 ".concat(t.progress.label):""):"",h=[s?"所属:".concat(eu(s,80)):"",l?"上一步:".concat(eu(l,80)):"",a?"下一步:".concat(eu(a,80)):""].filter(Boolean),f=function(e){let t=[];for(let{key:r,label:n,format:s}of eq){let l=e[r];if(void 0===l||""===l||!1===l)continue;let a=s(l).trim();a&&t.push({label:n,value:a})}return t}(t.metrics);return(0,n.jsxs)("div",{className:"stepDetails",children:[(0,n.jsxs)("div",{className:"stepDetailHeader",children:[(0,n.jsx)("span",{className:"stepDetailAgent",children:null!=r?r:"主控智能体"}),(0,n.jsx)("span",{className:"stepDetailAction",children:u})]}),(0,n.jsxs)("div",{className:"stepDetailStatusLine",children:[(0,n.jsx)("span",{className:"stepDetailStatus is-".concat(t.status),children:p}),void 0!==d&&(0,n.jsx)("span",{children:eg(d)}),g&&(0,n.jsx)("span",{children:g})]}),m&&(0,n.jsx)("p",{className:"stepDetailLead",children:m}),h.length>0&&(0,n.jsx)("div",{className:"stepDetailFlow",children:h.join(" \xb7 ")}),c.problems.length>0&&(0,n.jsxs)("section",{className:"stepDetailIssues",children:[(0,n.jsx)("div",{className:"stepDetailSectionTitle",children:"问题(".concat(c.problems.length,")")}),(0,n.jsx)("div",{className:"stepDetailIssueList",children:c.problems.slice(0,3).map((e,t)=>(0,n.jsxs)("div",{className:"stepDetailIssue",children:[(0,n.jsx)("span",{className:"stepDetailIssueLevel is-".concat(e.level),children:e_[e.level]}),(0,n.jsx)("span",{className:"stepDetailGridValue",children:e.message})]},"".concat(e.level,"-").concat(t)))}),c.problems.length>3&&(0,n.jsxs)("div",{className:"stepDetailMore",children:["还有 ",c.problems.length-3," 条问题未显示"]})]}),f.length>0&&(0,n.jsxs)("section",{className:"stepDetailMetrics",children:[(0,n.jsx)("div",{className:"stepDetailSectionTitle",children:"执行数据"}),(0,n.jsx)("div",{className:"stepDetailMetricList",children:f.map(e=>(0,n.jsxs)("div",{className:"stepDetailMetric",children:[(0,n.jsx)("span",{className:"stepDetailMetricLabel",children:e.label}),(0,n.jsx)("span",{className:"stepDetailMetricValue",children:e.value})]},e.label))})]})]})}var eB=r(12167),eF=r(97137),eW=r(1169);let{Text:eU}=d.A;function eH(e){var t,r,s;let{node:l,repeat:a,detailOpen:i,onOpenDetails:o}=e,c=eR(l),d="running"===l.status?void 0:em(l),u=eu(l.title),p=c.counts.error,m=c.counts.warning,g=eL("string"==typeof l.metrics.note?l.metrics.note:""),h=l.progress&&l.progress.total>0?"".concat(l.progress.current,"/").concat(l.progress.total).concat(l.progress.label?" \xb7 ".concat(l.progress.label):""):"",f=g||h,x=ei(l.status);return(0,n.jsx)("div",{className:"sessionStep","data-node-id":l.id,children:(0,n.jsxs)("div",{className:"sessionStepSummary",role:"button",tabIndex:0,"aria-expanded":i,"aria-label":"".concat(i?"收起":"查看","节点详情:").concat(eu(l.title,120)),onClick:()=>o(l),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o(l))},children:[(0,n.jsx)("span",{className:"sessionStepKind","aria-hidden":!0,children:null!=(r=ed[(t=l.type).split(".")[0]||t])?r:ed.default}),(0,n.jsxs)("div",{className:"sessionStepText",children:[(0,n.jsxs)("div",{className:"sessionStepTitleRow",children:[(0,n.jsx)(eU,{className:"sessionStepTitle".concat((s=l.title,/^[a-z][a-z0-9_.-]*$/u.test(s))?" sessionStepTitleTool":""),ellipsis:!0,children:u}),void 0!==a&&a>1&&(0,n.jsxs)("span",{className:"sessionStepRepeat",title:"连续 ".concat(a," 条相同动作已合并"),children:["\xd7",a]}),(p>0||m>0)&&(0,n.jsx)(eF.A,{className:"sessionStepAlert".concat(p>0?"":" isWarning"),"aria-label":"".concat(p," 个错误 \xb7 ").concat(m," 个警告"),title:"".concat(p," 个错误 \xb7 ").concat(m," 个警告")})]}),f&&(0,n.jsx)("div",{className:"sessionStepSub",children:f})]}),(0,n.jsxs)("div",{className:"sessionStepMeta",children:[(0,n.jsx)("span",{className:"sessionStepStatusDot is-".concat(l.status),title:x,"aria-label":x}),void 0!==d&&(0,n.jsx)("span",{className:"sessionStepDuration",children:eg(d)}),(0,n.jsx)(eW.A,{className:"sessionStepChevron".concat(i?" isOpen":""),"aria-hidden":!0})]})]})})}let{Text:e$}=d.A;function eO(e){let{entries:t,detailNodeId:r,onOpenDetails:l,renderDetails:a}=e,i=function(e){let t=[];for(let n of e)if("action"===n.kind){var r;let e=null!=(r=n.agentLabel)?r:"主控智能体",s=t[t.length-1];(null==s?void 0:s.kind)==="actions"&&s.agentLabel===e?s.entries.push(n):t.push({kind:"actions",agentLabel:e,entries:[n]})}else t.push({kind:"single",entry:n});return t}(t);return(0,n.jsx)("div",{className:"sessionStreamInner",children:i.map((e,t)=>"single"===e.kind?((e,t)=>{if("message"===e.kind){var r,s;let{message:l}=e;if("system"===l.role)return(0,n.jsx)("div",{className:"sessionSystemMessage",children:(0,n.jsx)(e$,{type:"secondary",children:l.text})},"message-".concat(l.id,"-").concat(t));let a="assistant"===l.role?eP(eM(l.text)).replace(/^[\s,,、;;]+|[\s,,、;;]+$/gu,"").replace(/[ \t]{2,}/gu," ").trim():l.text;return a?(0,n.jsxs)("div",{className:"sessionMessage sessionMessage-".concat(l.role),children:[(0,n.jsxs)("div",{className:"sessionMessageMeta",children:[(0,n.jsx)("span",{children:null!=(r=e.agentLabel)?r:"user"===l.role?"你":"主控智能体"}),(0,n.jsx)("span",{children:!Number.isFinite(s=l.t)||s<=0?"":new Date(s).toLocaleString()})]}),(0,n.jsx)("div",{className:"sessionMessageBubble",children:a})]},"message-".concat(l.id,"-").concat(t)):null}return"notice"===e.kind?(0,n.jsx)("div",{className:"sessionNotice sessionNotice-".concat(e.notice.kind),children:e.notice.text},"notice-".concat(e.notice.id)):null})(e.entry,t):(0,n.jsxs)("div",{className:"sessionAgentGroup",children:[(0,n.jsxs)("div",{className:"sessionAgentHeader",children:[(0,n.jsx)("span",{className:"sessionAgentIcon","aria-hidden":!0,children:"主控智能体"===e.agentLabel?(0,n.jsx)(M.A,{}):(0,n.jsx)(eB.A,{})}),(0,n.jsx)("span",{children:e.agentLabel})]}),(0,n.jsx)("div",{className:"sessionStepGroup",children:e.entries.map(e=>(0,n.jsxs)(s.Fragment,{children:[(0,n.jsx)(eH,{node:e.node,repeat:e.repeat,detailOpen:r===e.node.id,onOpenDetails:l}),r===e.node.id&&(0,n.jsx)("div",{className:"sessionStepOutput",children:a(e.node)})]},e.node.id))})]},"agent-".concat(t,"-").concat(e.agentLabel)))})}let eQ={message:0,action:1,notice:2};function eG(e,t){let r="action"===e.kind?e.node.seq:0;return[e.at,eQ[e.kind],r,t]}function eX(e){let t=[];for(let r of e)t.push(r),t.push(...eX(r.children));return t}function eV(e,t){let r=eG(e.entry,e.index),n=eG(t.entry,t.index);for(let e=0;e<r.length;e+=1)if(r[e]!==n[e])return r[e]-n[e];return 0}function eK(e){var t,r;let{node:n}=e,s=eR(n).counts,l=["running","pending","repairing"].includes(n.status)&&n.progress?"".concat(n.progress.current,"/").concat(n.progress.total,"/").concat(null!=(t=n.progress.label)?t:""):"";return[null!=(r=e.agentLabel)?r:"",eu(n.title,300),n.status,eL("string"==typeof n.metrics.note?n.metrics.note:""),l,s.error,s.warning,s.info].join("\0")}let{Text:eZ}=d.A,eJ=["upsert","status","rollup","reset","start","stage","thinking","text","tool_call_preview","progress","error","done","complete","log"],eY="generation.deliverablePanelWidth";function e0(e,t){let r=t.node;if(!r||"string"!=typeof r.id)return!0;if("upsert"===t.type)return e.set(r.id,r),!0;let n=e.get(r.id);if(!n){var s,l;return e.set(r.id,{...r,title:null!=(s=r.title)?s:r.id,seq:null!=(l=r.seq)?l:0}),!1}let{startedAt:a,...i}=r;return e.set(r.id,{...n,...i,id:n.id}),!0}function e1(){var e,t,r,l,i,d,k,A,N,S,C,R,I,E,T,P,M,D,L,q,_,z;let B=(0,c.useRouter)(),F=(0,b.Vr)(),{message:W}=u.A.useApp(),U="string"==typeof B.query.id?B.query.id:"",H="string"==typeof B.query.projectRoot?B.query.projectRoot:void 0,[$,O]=(0,s.useState)(null),[Q,G]=(0,s.useState)(!0),[X,V]=(0,s.useState)(null),[et,en]=(0,s.useState)(new Map),[es,el]=(0,s.useState)("connecting"),[ea,ei]=(0,s.useState)(""),[eo,ed]=(0,s.useState)(!1),[eu,em]=(0,s.useState)([]),[eg,eh]=(0,s.useState)([]),[ef,ex]=(0,s.useState)(!1),[ev,ey]=(0,s.useState)(!1),[ew,ek]=(0,s.useState)([]),[eA,eR]=(0,s.useState)(null),[eI,eT]=(0,s.useState)(null),eP=(0,s.useRef)(new Map),eM=(0,s.useRef)(0),eD=(0,s.useRef)({nodes:[],cursor:0}),eL=(0,s.useRef)(null),eq=(0,s.useRef)(0),e_=(0,s.useRef)(H),eB=(0,s.useRef)(()=>{}),eF=(0,s.useRef)(null),eW=(0,s.useRef)(null),eU=(0,s.useRef)(null),eH=(0,s.useCallback)(e=>{let t=e.key?F(e.key):e.text,r=t===e.key?e.text:t;eq.current+=1,em(t=>[{id:eq.current,kind:e.kind,text:r,at:Date.now()},...t].slice(0,100)),"error"===e.kind?W.error(r):"warning"===e.kind?W.warning(r):"success"===e.kind&&W.success(r)},[W,F]),e$=(0,w.tl)({projectRoot:H,documentId:U||null,onNotice:eH,t:F}),{refreshDocuments:eQ,applyRecord:eG}=e$,e1=function(e,t){let[r,n]=(0,s.useState)({loading:!1,error:null,preview:null}),l=(0,s.useRef)(0),a=(0,s.useCallback)(async()=>{if(!e)return void n({loading:!1,error:"缺少记录 id,无法取回成稿预览",preview:null});let r=l.current+1;l.current=r,n(e=>({...e,loading:!0,error:null}));try{let{preview:s}=await (0,j.sz)(e,t);if(l.current!==r)return;n({loading:!1,error:null,preview:s})}catch(e){if(l.current!==r)return;n({loading:!1,error:e instanceof Error?e.message:"取回成稿预览失败",preview:null})}},[e,t]),i=(0,s.useCallback)(()=>{l.current+=1,n({loading:!1,error:null,preview:null})},[]);return{...r,load:a,reset:i}}(U,null!=(E=e_.current)?E:H),e2=(0,s.useCallback)(()=>{e1.reset()},[e1]),e3=(0,s.useCallback)(()=>{ex(!1),eU.current&&clearTimeout(eU.current),eU.current=setTimeout(()=>{eU.current=null,ey(!1),e2()},260)},[e2]),e4=(0,s.useCallback)(()=>{if(ef)return void e3();eU.current&&(clearTimeout(eU.current),eU.current=null),ev?ex(!0):(ey(!0),requestAnimationFrame(()=>ex(!0))),e1.load()},[e3,ev,ef,e1]);(0,s.useEffect)(()=>{if(!ef)return;let e=Number(window.localStorage.getItem(eY));if(!Number.isFinite(e)||e<420)return;let t=Math.min(e,Math.max(420,window.innerWidth-360));eF.current=t,eT(t)},[ef]),(0,s.useEffect)(()=>()=>{eU.current&&clearTimeout(eU.current)},[]);let e6=e=>Math.min(Math.max(420,window.innerWidth-360),Math.max(420,Math.round(e))),e5=e6(null!=eI?eI:Math.max(480,Math.min(920,Math.round(.6*window.innerWidth)))),e9=()=>{if(null!==eF.current)try{window.localStorage.setItem(eY,String(eF.current))}catch(e){}},e8=e=>{if(eW.current){eW.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}e9()}},e7=(0,s.useCallback)(e=>{ek(t=>t.includes(e)?t:[...t,e])},[]),te=(0,s.useCallback)(()=>{eL.current||(eL.current=setTimeout(()=>{eL.current=null;let e=eD.current;if(eD.current={nodes:[],cursor:0},e.nodes.length>0){let t=eP.current,r=0;for(let n of e.nodes)e0(t,n)||(r+=1);en(new Map(t)),r>0&&e7("通道收到 ".concat(r," 条指向未知节点的补丁:已按最小节点收下(说明本客户端漏读了 upsert,或日志存在损坏)"))}e.cursor>eM.current&&(eM.current=e.cursor)},120))},[e7]);(0,s.useEffect)(()=>()=>{eL.current&&clearTimeout(eL.current)},[]);let tt=(0,s.useCallback)(e=>{let t=eD.current;t.nodes.push(e),e.logT&&e.logT>t.cursor&&(t.cursor=e.logT),te()},[te]),tr=(0,s.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(U){e.silent||G(!0);try{var t,r,n,s,l,a;let e=e_.current?"?projectRoot=".concat(encodeURIComponent(e_.current)):"",i=await fetch("/api/documents/canvas/".concat(encodeURIComponent(U)).concat(e));if(404===i.status)return void V("记录不存在(可能已被删除)");if(!i.ok)throw Error(await i.text()||"HTTP ".concat(i.status));let o=await i.json();e_.current=null!=(n=o.document.projectRoot)?n:e_.current,O(o),V(null),ek(null!=(s=o.degraded)?s:[]);let c=function(e){let t=[],r=e=>{for(let n of e){let{children:e,...s}=n;t.push(s),e&&r(e)}};return r(e),t}(null!=(l=null==(t=o.nodes)?void 0:t.tree)?l:[]),d=new Map(c.map(e=>[e.id,e]));eP.current=d,en(d),eM.current=Math.max(eM.current,null!=(a=null==(r=o.nodes)?void 0:r.cursor)?a:0)}catch(e){V(e instanceof Error?e.message:String(e))}finally{e.silent||G(!1)}}},[U]);(0,s.useEffect)(()=>{tr()},[tr]),(0,s.useEffect)(()=>{U&&eQ()},[U,eQ]),(0,s.useEffect)(()=>{let e=e$.documents.find(e=>e.id===U);e&&eG(e)},[eG,U,e$.documents]);let tn=(0,s.useCallback)(async()=>{if(U)try{var e,t;let r=new URLSearchParams({since:String(eM.current)});e_.current&&r.set("projectRoot",e_.current);let n=await fetch("/api/documents/generated/".concat(encodeURIComponent(U),"/nodes?").concat(r.toString()));if(!n.ok)return;let s=await n.json(),l=eP.current;for(let t of null!=(e=s.nodes)?e:[])e0(l,{type:"upsert",node:t});(null!=(t=s.nodes)?t:[]).length>0&&en(new Map(l)),s.cursor&&(eM.current=Math.max(eM.current,s.cursor)),s.downgraded&&e7(s.reason||"增量过大,服务端已降级为全量快照")}catch(e){}},[e7,U]);(0,s.useEffect)(()=>{if(!U)return;let e=setInterval(()=>{tn()},1e4);return()=>clearInterval(e)},[U,tn]),(0,s.useEffect)(()=>{if(!U||"undefined"==typeof EventSource)return;let e=e_.current?"?projectRoot=".concat(encodeURIComponent(e_.current)):"",t=new EventSource("/api/documents/generated/".concat(encodeURIComponent(U),"/events").concat(e));el("connecting");let r=e=>t=>{var r;let n={};try{n=JSON.parse(t.data)}catch(e){}let s=null!=(r=n.type)?r:e;"reset"===s&&(tr({silent:!0}),e7("通道补发不可用(服务端重启或环形覆盖):已重取全量快照")),n.node&&(tt({type:s,node:n.node,...n.logT?{logT:n.logT}:{}}),eQ())},n=eJ.map(e=>[e,r(e)]);for(let[e,r]of(t.onopen=()=>el("open"),t.onerror=()=>{el("error"),tn()},n))t.addEventListener(e,r);return t.onmessage=r("message"),()=>{for(let[e,r]of n)t.removeEventListener(e,r);t.close()}},[e7,U,tr,tt,eQ,tn]);let ts=(0,s.useMemo)(()=>(function(e,t){let r=new Map(e.map(e=>[e.id,e]));return(function(e,t){let r=function(e){let t=Y(e),r=ee(e),n=[...e].sort((e,t)=>{var n,s;return(null!=(n=r.get(t.id))?n:0)-(null!=(s=r.get(e.id))?s:0)||J(e,t)}),s=new Map(e.map(e=>[e.id,e]));for(let e of n){let r=t.get(e.id);if(!r||0===r.length)continue;let n=r.map(e=>{var t;return null!=(t=s.get(e.id))?t:e});s.set(e.id,function(e,t){var r,n,s;if(0===t.length)return{...e};let l=[...t].sort(J),a={...null!=(n=e.metrics)?n:{}};for(let t of Z){let r=function(e,t,r){var n,s;let l=0,a=!1,i=null==(n=e.metrics)?void 0:n[r];for(let e of("number"==typeof i&&Number.isFinite(i)&&(l+=i,a=!0),t)){let t=null==(s=e.metrics)?void 0:s[r];"number"==typeof t&&Number.isFinite(t)&&(l+=t,a=!0)}return a?l:void 0}(e,l,t);void 0===r?delete a[t]:a[t]=r}let i=null==(r=e.progress)?void 0:r.label,o={current:l.filter(e=>"completed"===e.status).length,total:l.length,...void 0!==i?{label:i}:{}},c=function(e){let t=new Set,r=[];for(let s of e){var n;let e=null==(n=s.provenance)?void 0:n.fingerprint;if("string"==typeof e&&e.length>0){if(t.has(e))continue;t.add(e)}r.push(s)}return r}(l.flatMap(e=>{var t;return null!=(t=e.issues)?t:[]})),d=null!=(s=function(e){let t,r=1/0;for(let n of e){let e=function(e){let t=K.indexOf(e);return t>=0?t:0}(n);e<r&&(r=e,t=n)}return t}(l.map(e=>e.status)))?s:e.status;return{...e,status:d,progress:o,...Object.keys(a).length>0?{metrics:a}:{},...c.length>0?{issues:c}:{}}}(e,n))}return[...e].sort(J).map(e=>{var t;return null!=(t=s.get(e.id))?t:e})}(e),n=Y(r),s=new Set(r.map(e=>e.id)),l=1/0,a=(e,t)=>{var r;let s=t+1<l?(null!=(r=n.get(e.id))?r:[]).filter(t=>t.id!==e.id).map(e=>a(e,t+1)):[];return{...e,children:s}},i=r.filter(e=>void 0===e.parentId||!s.has(e.parentId)).sort(J).map(e=>a(e,0)),o=new Set,c=e=>{for(let t of e)o.add(t.id),c(t.children)};for(let e of(c(i),r))o.has(e.id)||i.push(a(e,0));return i})(function(e,t){if(void 0===t)return[...e];let r=ee(e),n=Math.max(0,Math.floor(t));return e.filter(e=>{var t;return(null!=(t=r.get(e.id))?t:0)<n})}(e.map(ep),void 0)).map(e=>(function e(t,r){var n,s,l;let a=r.get(t.id),i=null!=(n=null==a?void 0:a.type)?n:String(t.type),o=t.issues;return{id:t.id,...void 0!==t.parentId?{parentId:t.parentId}:{},type:i,unknownType:!("string"==typeof i&&er.has(i)),title:t.title||(i?null!=(l=ec[i])?l:i:"未知节点"),seq:t.seq,status:t.status,..."number"==typeof t.startedAt&&t.startedAt>0?{startedAt:t.startedAt}:{},...void 0!==t.completedAt?{completedAt:t.completedAt}:{},...t.progress?{progress:t.progress}:{},metrics:null!=(s=t.metrics)?s:{},issues:Array.isArray(o)?o:[],...void 0!==t.payloadRef?{payloadRef:t.payloadRef}:{},children:t.children.map(t=>e(t,r))}})(e,r))})([...et.values()]),[et]),tl=(0,s.useMemo)(()=>(function(e){let t=[],r=e=>{for(let n of e)t.push(n),r(n.children)};return r(e),t.sort(J)})(ts),[ts]),ta=(0,s.useMemo)(()=>new Map(tl.map(e=>[e.id,e])),[tl]),ti=(0,s.useCallback)(()=>{let e=null==$?void 0:$.document;if(!e)return;let t=ea.trim();t&&(ed(!0),(0,j.wI)(e.id,t,{...e_.current?{projectRoot:e_.current}:{}}).then(e=>{var t;eH({kind:"info",text:e.answer?"".concat(e.receipt,"\n").concat(e.answer):e.receipt}),eh(null!=(t=e.candidates)?t:[]),ei(""),eB.current()}).catch(e=>eH({kind:"error",text:e instanceof Error?e.message:"指令未受理"})).finally(()=>ed(!1)))},[$,eH,ea]),to=(0,s.useCallback)(e=>{let t=null==$?void 0:$.document;t&&(ed(!0),(0,j.wI)(t.id,"(选定:".concat(e.label,")"),{...e_.current?{projectRoot:e_.current}:{},acceptedCandidate:{kind:e.kind}}).then(e=>{eH({kind:"info",text:e.receipt}),eh([]),eB.current()}).catch(e=>eH({kind:"error",text:e instanceof Error?e.message:"指令未受理"})).finally(()=>ed(!1)))},[$,eH]),tc=(0,s.useCallback)(()=>{e$.pauseDocument(U).catch(e=>eH({kind:"error",text:e instanceof Error?e.message:"暂停失败"}))},[U,e$,eH]),td=(0,s.useCallback)(()=>{e$.resumePausedDocument(U).catch(e=>eH({kind:"error",text:e instanceof Error?e.message:"继续失败"}))},[U,e$,eH]),tu=(0,s.useCallback)(async e=>{if(U)try{let{document:t}=await (0,j.v7)(U,!1,e_.current);if(!t)return void eH({kind:"warning",text:"记录不存在,无法导出"});await e$.export.exportRecord(t,e)}catch(e){eH({kind:"error",text:e instanceof Error?e.message:"导出失败"})}},[U,e$.export,eH]),tp=e$.boundRecord,tm=function(e,t){if(!e)return;let r=(null==t?void 0:t.docId)===e.id?t:void 0,n=e.deliveryQuality;return n?{...r,docId:e.id,...e.projectRoot?{projectRoot:e.projectRoot}:{},contractQuality:n.receipt,...n.stale?{contractQualityStale:n.stale}:{contractQualityStale:void 0}}:r}(null==$?void 0:$.document,e$.deliveryReadings),tg=e$.canResume,th=null!=(T=null==tp?void 0:tp.status)?T:null==$?void 0:$.document.status,tf=e$.loading||"generating"===th||"queued"===th,tx="paused"===th,tv=function(e,t,r){let[n,l]=(0,s.useState)([]),[a,i]=(0,s.useState)([]),[o,c]=(0,s.useState)(!1),d=(0,s.useRef)(!0),u=(0,s.useRef)(null);(0,s.useEffect)(()=>(d.current=!0,()=>{var e;d.current=!1,null==(e=u.current)||e.abort()}),[]);let p=(0,s.useCallback)(async()=>{var r,n;if(!e){l([]),i([]),c(!1);return}null==(r=u.current)||r.abort();let s=new AbortController;u.current=s;try{let r=await (0,j.lS)(e,t,s.signal);if(!d.current||s.signal.aborted)return;l(Array.isArray(r.messages)?r.messages:[]),i(null!=(n=r.degraded)?n:[]),c(!0===r.tornTail)}catch(e){if(!d.current||s.signal.aborted)return;i([e instanceof Error?e.message:String(e)])}},[e,t]);return(0,s.useEffect)(()=>{p()},[p]),(0,s.useEffect)(()=>{if(!e||"generating"!==r&&"queued"!==r)return;let t=setInterval(()=>{p()},2e3);return()=>clearInterval(t)},[e,p,r]),{messages:n,degraded:a,tornTail:o,reload:p}}(U||null,null!=(P=e_.current)?P:H,th);eB.current=()=>{tv.reload()};let ty=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{let e=ty.current;ty.current=th,void 0!==e&&e!==th&&"generating"!==th&&"queued"!==th&&tv.reload()},[tv.reload,th]);let tj=(0,s.useMemo)(()=>[...ew,...tv.degraded,...tv.tornTail?["会话消息日志末行不完整(进程中断残留):已忽略该行"]:[]],[ew,tv.degraded,tv.tornTail]),tb=(0,s.useMemo)(()=>({...(null==tp?void 0:tp.createdAt)!==void 0?{createdAt:tp.createdAt}:(null==$?void 0:$.document.createdAt)!==void 0?{createdAt:$.document.createdAt}:{},...(null==tp?void 0:tp.requirement)?{requirement:tp.requirement}:{},...(null==tp?void 0:tp.instructions)?{instructions:tp.instructions}:{}}),[$,tp]),tw=(0,s.useMemo)(()=>(function(e){let{tree:t,notices:r,record:n}=e,s=Array.isArray(e.messages)?e.messages:[],l=function(e){let t=new Map;for(let r of eX(e))t.set(r.id,r);return t}(t),a=null!=(c=n.createdAt)?c:0,i=[],o=new Set;for(let e of[...s,...function(e,t){var r,n,s,l;if(t.length>0)return[];let a=null!=(r=e.createdAt)?r:0,i=[];for(let[t,r]of(e.requirement&&e.requirement.trim().length>0&&i.push({id:"record-requirement",t:a,role:"user",text:e.requirement,kind:"requirement"}),(null!=(n=e.instructions)?n:[]).entries()))i.push({id:null!=(s=r.id)?s:"record-instruction-".concat(t),t:r.at,role:"user",text:r.text,...r.kind?{kind:r.kind}:{},...r.status?{status:r.status}:{}}),r.receipt&&r.receipt.trim().length>0&&i.push({id:"".concat(null!=(l=r.id)?l:"record-instruction-".concat(t),"-receipt"),t:r.at+1,role:"assistant",text:r.receipt,kind:"instruction.receipt"});return i}(n,s)]){if("assistant"===e.role){let t="".concat(null!=(d=e.kind)?d:"","\0").concat(e.text);if(o.has(t))continue;o.add(t)}i.push({kind:"message",at:e.t,message:e,agentLabel:function(e,t){var r;if("user"===e.role)return"你";if("system"===e.role)return"系统";let n=null==(r=e.roleName)?void 0:r.trim();if(n)return n;let s=e.nodeId?t.get(e.nodeId):void 0;return s?eE(s,t):"主控智能体"}(e,l)})}for(let e of eX(t))i.push({kind:"action",at:null!=(u=e.startedAt)?u:a,node:e,agentLabel:eE(e,l)});for(let e of r)i.push({kind:"notice",at:e.at,notice:e});var c,d,u,p,m=i.map((e,t)=>({entry:e,index:t})).sort(eV).map(e=>e.entry);let g=[];for(let e of m){let t=g[g.length-1];if("action"===e.kind&&(null==t?void 0:t.kind)==="action"&&eK(e)===eK(t)){g[g.length-1]={...t,repeat:(null!=(p=t.repeat)?p:1)+1};continue}g.push(e)}return g})({tree:ts,messages:tv.messages,notices:eu,record:tb}),[ts,tv.messages,eu,tb]),tk=eA&&null!=(M=ta.get(eA))?M:null,tA=(0,s.useCallback)(e=>{eR(t=>t===e.id?null:e.id)},[]),tN=(0,s.useMemo)(()=>tw.filter(e=>"action"===e.kind),[tw]),tS=(0,s.useCallback)(e=>{var t;let r=tN.findIndex(t=>t.node.id===e.id),s=r>=0?tN[r]:void 0,l=r>0?tN[r-1]:void 0,a=r>=0&&r<tN.length-1?tN[r+1]:void 0,i=e.parentId?ta.get(e.parentId):void 0,o=null==(t=[...tv.messages].reverse().find(t=>t.nodeId===e.id))?void 0:t.text;return(0,n.jsx)(ez,{node:e,agentLabel:null==s?void 0:s.agentLabel,parentTitle:null==i?void 0:i.title,previousTitle:null==l?void 0:l.node.title,nextTitle:null==a?void 0:a.node.title,narrative:o,t:F})},[tN,ta,tv.messages,F]);return U?X?(0,n.jsx)(m.Ay,{status:"warning",title:"生成页打不开",subTitle:X,extra:(0,n.jsxs)(g.A,{children:[(0,n.jsx)(h.Ay,{icon:(0,n.jsx)(x.A,{}),onClick:()=>{tr()},children:"重试"}),(0,n.jsx)(o(),{href:"/generation",children:(0,n.jsx)(h.Ay,{type:"primary",children:"回到生成页"})})]})}):(0,n.jsxs)("div",{className:"sessionPage",children:[(0,n.jsx)(a(),{children:(0,n.jsx)("title",{children:(null==$?void 0:$.document.title)?"".concat($.document.title," \xb7 生成"):"生成"})}),(0,n.jsxs)("div",{className:"sessionBody",children:[(0,n.jsxs)("div",{className:"sessionColumn",children:[(0,n.jsx)("div",{className:"sessionStream",role:"log",children:Q?(0,n.jsx)("div",{className:"sessionLoading",children:(0,n.jsxs)(g.A,{orientation:"vertical",align:"center",children:[(0,n.jsx)(p.A,{}),(0,n.jsx)(eZ,{type:"secondary",children:"正在读取执行记录…"})]})}):(0,n.jsxs)(n.Fragment,{children:["error"===es&&(0,n.jsx)("div",{className:"sessionConnectionNote",children:"连接中断,正在重连…"}),tj.length>0&&(0,n.jsxs)("div",{className:"sessionDegraded",children:[(0,n.jsx)(v.A,{})," ",(0,n.jsx)("span",{children:tj.join(";")})]}),(0,n.jsx)(eO,{entries:tw,detailNodeId:eA,onOpenDetails:tA,renderDetails:e=>tk&&tk.id===e.id?tS(tk):null,t:F})]})}),(0,n.jsx)("div",{className:"sessionBottom",children:(0,n.jsx)(eC.D,{suggestions:eg.map(e=>({key:e.kind,label:"按「".concat(e.label,"」执行"),onClick:()=>to(e)})),value:ea,onChange:ei,onSend:ti,generating:!!tf,submitting:eo,disabled:!$,...$?{}:{disabledReason:"正在读取记录…"},paused:tx,resumable:tg,onPause:tc,onResume:td,onContinue:()=>{tp&&e$.resumeDocument(tp)},hasDeliverable:(null!=(D=null==tp?void 0:tp.wordCount)?D:0)>0||["completed","completed_with_issues","warning"].includes(null!=th?th:""),onPreviewDeliverable:e4})}),(0,n.jsx)(eb._,{currentDocumentId:U,...H?{projectRoot:H}:{},onSelect:e=>{e3(),B.push((0,eS.T)(e.id,e.projectRoot||H))},onCurrentDeleted:()=>{e3(),B.push("/generation")}})]}),ev&&(0,n.jsx)("aside",{className:"deliverablePanel".concat(ef?" is-open":""),"aria-label":"成稿面板",style:{width:ef?e5:0},children:(0,n.jsxs)("div",{className:"deliverablePanelInner",style:{width:e5},children:[ef&&(0,n.jsx)("div",{className:"deliverablePanelResize",role:"separator","aria-orientation":"vertical","aria-label":"调整成稿面板宽度","aria-valuemin":420,"aria-valuenow":e5,tabIndex:0,onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),eW.current={startX:e.clientX,startWidth:e5}},onPointerMove:e=>{let t=eW.current;if(!t)return;let r=e6(t.startWidth+(t.startX-e.clientX));eF.current=r,eT(r)},onPointerUp:e8,onPointerCancel:e8,onKeyDown:e=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();let t=e6(e5+("ArrowLeft"===e.key?24:-24));eF.current=t,eT(t),e9()}}),(0,n.jsxs)("header",{className:"deliverablePanelHeader",children:[(0,n.jsx)("div",{className:"deliverablePanelHeading",children:(0,n.jsx)(eZ,{strong:!0,children:"成稿"})}),(0,n.jsxs)(g.A,{size:4,wrap:!0,className:"deliverablePanelActions",children:[(0,n.jsx)(eN,{reports:e$.export.exportReports,deliveryReadings:tm,t:F}),(0,n.jsx)(h.Ay,{size:"small",onClick:()=>{tu("docx")},loading:!!e$.export.exporting,children:"DOCX"}),(0,n.jsx)(h.Ay,{size:"small",onClick:()=>{tu("pdf")},loading:!!e$.export.exporting,children:"PDF"}),(0,n.jsx)(f.A,{title:"重新取回",children:(0,n.jsx)(h.Ay,{size:"small","aria-label":"重新取回成稿",icon:(0,n.jsx)(x.A,{}),onClick:()=>{e1.load()},loading:e1.loading})}),(0,n.jsx)(f.A,{title:"关闭",children:(0,n.jsx)(h.Ay,{size:"small","aria-label":"关闭成稿面板",icon:(0,n.jsx)(y.A,{}),onClick:e3})})]})]}),(0,n.jsx)("div",{className:"deliverablePanelBody",children:(0,n.jsx)(ej,{status:null!=(L=null==(e=e1.preview)?void 0:e.status)?L:th,title:null!=(q=null==(t=e1.preview)?void 0:t.title)?q:null==$?void 0:$.document.title,html:null==(r=e1.preview)?void 0:r.html,source:null==(l=e1.preview)?void 0:l.source,truncated:null==(i=e1.preview)?void 0:i.truncated,totalChars:null==(d=e1.preview)?void 0:d.totalChars,renderedChars:null==(k=e1.preview)?void 0:k.renderedChars,stats:null==(A=e1.preview)?void 0:A.stats,gate:null!=(z=null!=(_=null==(N=e1.preview)?void 0:N.gate)?_:null==$?void 0:$.gate)?z:null,sectionProgress:null==(S=e1.preview)?void 0:S.sectionProgress,budgetPause:null==(C=e1.preview)?void 0:C.budgetPause,deliveryReadings:tm,loading:e1.loading,error:e1.error,onRetry:()=>{e1.load()},updatedAt:null==(R=e1.preview)?void 0:R.updatedAt,generatedAt:null==(I=e1.preview)?void 0:I.generatedAt,t:F})})]})})]})]}):(0,n.jsx)("div",{className:"appShellPlaceholder",children:(0,n.jsx)(p.A,{style:{margin:48}})})}}},e=>{e.O(0,[855,551,210,702,399,576,499,61,112,333,350,326,636,593,792],()=>e(e.s=70130)),_N_E=e.O()}]);