@markus-global/cli 0.9.7 → 0.9.8
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.
- package/dist/markus.mjs +8 -5
- package/dist/web-ui/assets/{CommentInput-JPZATTdP.js → CommentInput-CcU4x-2w.js} +1 -1
- package/dist/web-ui/assets/{ContentRenderer-gaxBn1N9.js → ContentRenderer-C28LBAOD.js} +2 -2
- package/dist/web-ui/assets/DeliverableShareModal-DAR6-GIg.js +1 -0
- package/dist/web-ui/assets/Deliverables-BuFmzt8Q.js +3 -0
- package/dist/web-ui/assets/{Notifications-W-Mx_v6q.js → Notifications-DfEPEYXi.js} +1 -1
- package/dist/web-ui/assets/{Search-Cxtd9r1S.js → Search-DVngYDXA.js} +1 -1
- package/dist/web-ui/assets/{Settings-Q87nTBy5.js → Settings-DL8i8fbx.js} +1 -1
- package/dist/web-ui/assets/{Store-BK54Nx60.js → Store-C5bIowl-.js} +1 -1
- package/dist/web-ui/assets/{Team-CWRLD5sM.js → Team-BPirIx0q.js} +30 -30
- package/dist/web-ui/assets/{Work-xejZ7HCT.js → Work-CjgHtG8z.js} +5 -5
- package/dist/web-ui/assets/{arc-BqhlYS08.js → arc-BT_F7CX9.js} +1 -1
- package/dist/web-ui/assets/{architectureDiagram-3BPJPVTR-C8fUeKGJ.js → architectureDiagram-3BPJPVTR-BgRvj0-5.js} +1 -1
- package/dist/web-ui/assets/{blockDiagram-GPEHLZMM-eILAtQzQ.js → blockDiagram-GPEHLZMM-BHGe_N_M.js} +1 -1
- package/dist/web-ui/assets/{c4Diagram-AAUBKEIU-DdV7TyX_.js → c4Diagram-AAUBKEIU-Bf3z_oHk.js} +1 -1
- package/dist/web-ui/assets/channel-BDoV60FN.js +1 -0
- package/dist/web-ui/assets/{chunk-2J33WTMH-BwuewEg2.js → chunk-2J33WTMH-DUOJv34F.js} +1 -1
- package/dist/web-ui/assets/{chunk-4BX2VUAB-Bv26FANh.js → chunk-4BX2VUAB-BnGMN5aR.js} +1 -1
- package/dist/web-ui/assets/{chunk-55IACEB6-DFTeZroI.js → chunk-55IACEB6-cUvrWf3P.js} +1 -1
- package/dist/web-ui/assets/{chunk-727SXJPM-i7IiTNSf.js → chunk-727SXJPM-DAIeVGil.js} +1 -1
- package/dist/web-ui/assets/{chunk-AQP2D5EJ-BoPcIU1Z.js → chunk-AQP2D5EJ-CvHiJGw_.js} +1 -1
- package/dist/web-ui/assets/{chunk-FMBD7UC4-DTXl3WfT.js → chunk-FMBD7UC4-CuFNK3C8.js} +1 -1
- package/dist/web-ui/assets/{chunk-ND2GUHAM-DdzR-Jnl.js → chunk-ND2GUHAM-DvQAnLZh.js} +1 -1
- package/dist/web-ui/assets/{chunk-QZHKN3VN-DqSW43I1.js → chunk-QZHKN3VN-Aoa5sIU7.js} +1 -1
- package/dist/web-ui/assets/classDiagram-4FO5ZUOK-CsLOGMTv.js +1 -0
- package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-CsLOGMTv.js +1 -0
- package/dist/web-ui/assets/{cose-bilkent-S5V4N54A-C-UFRPSb.js → cose-bilkent-S5V4N54A-Uuy7nGWb.js} +1 -1
- package/dist/web-ui/assets/{dagre-BM42HDAG-92ucBloh.js → dagre-BM42HDAG-CF97s255.js} +1 -1
- package/dist/web-ui/assets/{diagram-2AECGRRQ-B8zRoWWP.js → diagram-2AECGRRQ-Cf3bRRU7.js} +1 -1
- package/dist/web-ui/assets/{diagram-5GNKFQAL-CM3pWtYN.js → diagram-5GNKFQAL-DeWiUo-B.js} +1 -1
- package/dist/web-ui/assets/{diagram-KO2AKTUF-V7UmwGTe.js → diagram-KO2AKTUF-g2SF4uuK.js} +1 -1
- package/dist/web-ui/assets/{diagram-LMA3HP47-DG1RtUeD.js → diagram-LMA3HP47-jfceMN5q.js} +1 -1
- package/dist/web-ui/assets/{diagram-OG6HWLK6-BTwLdZJw.js → diagram-OG6HWLK6-CRN8tK4z.js} +1 -1
- package/dist/web-ui/assets/{erDiagram-TEJ5UH35-BNXeXKHH.js → erDiagram-TEJ5UH35-DUTClqO1.js} +1 -1
- package/dist/web-ui/assets/{flowDiagram-I6XJVG4X-VP_sRWgd.js → flowDiagram-I6XJVG4X-miwyCuKa.js} +1 -1
- package/dist/web-ui/assets/{ganttDiagram-6RSMTGT7-CvnpoufX.js → ganttDiagram-6RSMTGT7-Co8Oe3L4.js} +1 -1
- package/dist/web-ui/assets/{gitGraphDiagram-PVQCEYII-zO7DNQqQ.js → gitGraphDiagram-PVQCEYII-VmIpxXAL.js} +1 -1
- package/dist/web-ui/assets/index-DegyOQC4.css +1 -0
- package/dist/web-ui/assets/{index-B1VN5yM1.js → index-sjnbPgLJ.js} +67 -67
- package/dist/web-ui/assets/{infoDiagram-5YYISTIA-BSGbaVLq.js → infoDiagram-5YYISTIA-C4omrfgp.js} +1 -1
- package/dist/web-ui/assets/{ishikawaDiagram-YF4QCWOH-BatvAQOH.js → ishikawaDiagram-YF4QCWOH-Ty2P769k.js} +1 -1
- package/dist/web-ui/assets/{journeyDiagram-JHISSGLW-Cajy4fZr.js → journeyDiagram-JHISSGLW-BKjERdBC.js} +1 -1
- package/dist/web-ui/assets/{kanban-definition-UN3LZRKU-DLpKR4E5.js → kanban-definition-UN3LZRKU-CKepooo8.js} +1 -1
- package/dist/web-ui/assets/{mermaid.core-B4fv65oQ.js → mermaid.core-86q0lHkP.js} +5 -5
- package/dist/web-ui/assets/{mindmap-definition-RKZ34NQL-C2HVqxfu.js → mindmap-definition-RKZ34NQL-DHWtWZRN.js} +1 -1
- package/dist/web-ui/assets/{pieDiagram-4H26LBE5-Bswg7SQl.js → pieDiagram-4H26LBE5-DkU1SDIf.js} +1 -1
- package/dist/web-ui/assets/{quadrantDiagram-W4KKPZXB-CyYiDqNE.js → quadrantDiagram-W4KKPZXB-DJHQgFEW.js} +1 -1
- package/dist/web-ui/assets/{requirementDiagram-4Y6WPE33-BWZmKUo8.js → requirementDiagram-4Y6WPE33-D0PXuzjM.js} +1 -1
- package/dist/web-ui/assets/{sankeyDiagram-5OEKKPKP-C3imZVxk.js → sankeyDiagram-5OEKKPKP-D8ZU245D.js} +1 -1
- package/dist/web-ui/assets/{sequenceDiagram-3UESZ5HK-BrySebCt.js → sequenceDiagram-3UESZ5HK-BKUzkb7M.js} +1 -1
- package/dist/web-ui/assets/{stateDiagram-AJRCARHV-0Lp5CycE.js → stateDiagram-AJRCARHV-hRMrLG3O.js} +1 -1
- package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-CS0Tx8JL.js +1 -0
- package/dist/web-ui/assets/{timeline-definition-PNZ67QCA-BIGJbkoS.js → timeline-definition-PNZ67QCA-CDok_Xbq.js} +1 -1
- package/dist/web-ui/assets/{vennDiagram-CIIHVFJN-CS9GEvPk.js → vennDiagram-CIIHVFJN-BYWGyJ9q.js} +1 -1
- package/dist/web-ui/assets/{wardley-L42UT6IY-BSNtMxtd.js → wardley-L42UT6IY-DnhUtsUo.js} +1 -1
- package/dist/web-ui/assets/{wardleyDiagram-YWT4CUSO-CaEGOjwH.js → wardleyDiagram-YWT4CUSO-B--QBlgZ.js} +1 -1
- package/dist/web-ui/assets/{xychartDiagram-2RQKCTM6-Cr_pwOHb.js → xychartDiagram-2RQKCTM6-CgFIWd7_.js} +1 -1
- package/dist/web-ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/web-ui/assets/DeliverableShareModal-B6qqZgFc.js +0 -1
- package/dist/web-ui/assets/Deliverables-BUi9KGwf.js +0 -3
- package/dist/web-ui/assets/channel-C-TW97LX.js +0 -1
- package/dist/web-ui/assets/classDiagram-4FO5ZUOK-C92nY4nN.js +0 -1
- package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-C92nY4nN.js +0 -1
- package/dist/web-ui/assets/index-BbQpGkiM.css +0 -1
- package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-QVZbqffU.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{u as nt,j as e,r as a,a as us,b as xs,m as fs,d as hs,c as ms,l as p,w as tt,o as Ut,p as ps,P as L,n as Q,M as gs,q as Pe,h as bs,i as zt,s as ys}from"./index-B1VN5yM1.js";import{resolveFormat as vs,ContentRenderer as js}from"./ContentRenderer-gaxBn1N9.js";import{c as ks,D as Ns}from"./DeliverableShareModal-B6qqZgFc.js";function M(u){return Array.isArray(u)?u.map(o=>String(o).trim()).filter(Boolean):typeof u=="string"&&u?u.split(",").map(o=>o.trim()).filter(Boolean):[]}function ws(u){return u.files&&typeof u.files=="object"&&!Array.isArray(u.files)?u.files:null}function J({label:u,value:o}){return o?e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:u}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:o})]}):null}function re({label:u,value:o,color:c}){if(!o)return null;const n={purple:"bg-brand-500/15 text-brand-500",cyan:"bg-blue-500/15 text-blue-600",indigo:"bg-brand-500/15 text-brand-500",gray:"bg-gray-500/15 text-fg-secondary",emerald:"bg-green-500/15 text-green-600"};return e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:u}),e.jsx("div",{className:`mt-0.5 px-2 py-0.5 rounded-full text-[10px] font-medium ${n[c]??n.gray} capitalize inline-block`,children:o})]})}function st({files:u}){const{t:o}=nt(["builder","common"]),[c,n]=a.useState(Object.keys(u)[0]??""),x=Object.keys(u);return x.length===0?null:e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:o("builder:artifact.files",{count:x.length})}),e.jsxs("div",{className:"mt-1 bg-surface-elevated/50 rounded-lg border border-border-default/30 overflow-hidden",children:[e.jsx("div",{className:"flex gap-0.5 px-1.5 py-1 border-b border-border-default/30 overflow-x-auto",children:x.map(b=>e.jsx("button",{onClick:()=>n(b),className:`px-2 py-0.5 text-[10px] rounded whitespace-nowrap transition-colors ${c===b?"bg-brand-600/30 text-brand-500":"text-fg-tertiary hover:text-fg-secondary"}`,children:b},b))}),c&&u[c]!=null&&e.jsx("pre",{className:"p-2 text-[10px] text-fg-secondary max-h-[120px] overflow-auto whitespace-pre-wrap font-mono",children:u[c]})]})]})}function Ss({artifact:u,mode:o}){const{t:c}=nt(["builder","common"]),n=ws(u),x=u.agent,b=u.team,A=u.dependencies,N=u.displayName??u.name;if(o==="agent"){const k=x?.roleName,$=x?.agentRole,y=x?.llmProvider,P=x?.llmModel,g=M(A?.env),I=M(A?.skills);return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(J,{label:c("builder:artifact.name"),value:N}),e.jsx(J,{label:c("builder:artifact.description"),value:u.description}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[k&&e.jsx(re,{label:c("builder:artifact.baseTemplate"),value:k,color:"indigo"}),e.jsx(re,{label:c("builder:artifact.agentRole"),value:$,color:$==="manager"?"purple":"cyan"})]}),M(u.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:M(u.tags).map(v=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:v},v))}),(y||P)&&e.jsxs("div",{className:"flex gap-2",children:[y&&e.jsx(re,{label:c("builder:artifact.llmProvider"),value:y,color:"gray"}),P&&e.jsx(re,{label:c("builder:artifact.llmModel"),value:P,color:"gray"})]}),g.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:c("builder:artifact.requiredEnv")}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:g.map(v=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-amber-500/10 text-amber-600 rounded font-mono",children:v},v))})]}),I.length>0&&e.jsx(J,{label:c("builder:artifact.skills"),value:I.join(", ")}),n&&e.jsx(st,{files:n})]})}if(o==="team"){const $=b?.members??[];return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(J,{label:c("builder:artifact.name"),value:N}),e.jsx(J,{label:c("builder:artifact.description"),value:u.description}),e.jsx("div",{className:"flex flex-wrap gap-2",children:e.jsx(re,{label:c("builder:artifact.category"),value:u.category,color:"indigo"})}),M(u.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:M(u.tags).map(y=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:y},y))}),n&&e.jsx(st,{files:n}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:c("builder:artifact.members",{count:$.length})}),e.jsx("div",{className:"mt-1.5 space-y-1.5",children:$.map((y,P)=>e.jsxs("div",{className:"bg-surface-elevated/30 rounded-lg px-2 py-1.5 border border-border-default/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center text-[10px] font-bold ${y.role==="manager"?"bg-brand-500/20 text-brand-500":"bg-blue-500/20 text-blue-600"}`,children:y.role==="manager"?"★":P+1}),e.jsx("span",{className:"text-xs text-fg-secondary flex-1 truncate",children:y.name}),typeof y.roleName=="string"&&y.roleName&&e.jsx("span",{className:"text-[10px] text-brand-500/70 font-mono",children:y.roleName}),e.jsxs("span",{className:"text-[10px] text-fg-tertiary",children:["x",String(y.count??1)]})]}),M(y.skills).length>0&&e.jsx("div",{className:"mt-1 ml-7 flex flex-wrap gap-1",children:M(y.skills).map(g=>e.jsx("span",{className:"px-1 py-0.5 text-[9px] bg-green-500/10 text-green-600 rounded font-mono",children:g},g))})]},P))})]})]})}return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(J,{label:c("builder:artifact.name"),value:N}),e.jsx(J,{label:c("builder:artifact.description"),value:u.description}),e.jsx("div",{className:"flex gap-2",children:e.jsx(re,{label:c("builder:artifact.category"),value:u.category,color:"indigo"})}),n&&e.jsx(st,{files:n}),M(u.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:M(u.tags).map(k=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:k},k))})]})}const ne={file:{icon:"📄",color:"bg-green-500/10 text-green-600"},directory:{icon:"📁",color:"bg-blue-500/10 text-blue-600"}},Cs=["file","directory"];function Be(u){return/^https?:\/\//i.test(u)}function S(u){return u?.shareStatus??null}function Ls(u,o){const c=Date.now(),n=new Date(u).getTime(),x=c-n,b=Math.floor(x/6e4);if(b<1)return o("time.justNow");if(b<60)return o("time.minutesAgo",{count:b});const A=Math.floor(b/60);if(A<24)return o("time.hoursAgo",{count:A});const N=Math.floor(A/24);if(N===1)return o("time.yesterday");if(N<30)return o("time.daysAgo",{count:N});const k=Math.floor(N/30);return k<12?o("time.monthsAgo",{count:k}):o("time.yearsAgo",{count:Math.floor(k/12)})}const F={agent:{icon:"✦",color:"bg-brand-500/10 text-brand-500"},team:{icon:"◈",color:"bg-blue-500/10 text-blue-600"},skill:{icon:"⬡",color:"bg-amber-500/10 text-amber-600"}};function Ts({authUser:u,previewMode:o,previewData:c}={}){const{t:n}=nt(["deliverables","common"]),x=us(),b=xs(L.DELIVERABLES),A=fs({side:"left",defaultWidth:384,minWidth:280,maxWidth:600,storageKey:"markus_deliverables_list"}),[N,k]=a.useState(!1),$=a.useRef(N);$.current=N,a.useEffect(()=>{if(!x)return;const t=()=>{$.current&&k(!1)};return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[x]);const y=100,P=5e3,[g,I]=a.useState(c?.items??[]),[v,ae]=a.useState(c?.items?.length??0),[le,at]=a.useState(!1),[lt,it]=a.useState(c?.projects??[]),[ot,ct]=a.useState(c?.agents??[]),[dt,Kt]=a.useState([]),[_,ut]=a.useState(!c),[ye,ve]=a.useState(""),[ie,je]=a.useState(""),[B,oe]=a.useState(""),[D,ce]=a.useState(""),[R,xt]=a.useState("date"),[r,C]=a.useState(()=>c?.initialSelectedId&&c.items?c.items.find(t=>t.id===c.initialSelectedId)??c.items[0]??null:c?.items?.[0]??null),[De,ft]=a.useState(null),[ht,mt]=a.useState(""),[U,Gt]=a.useState(!0),[Ve,de]=a.useState(()=>{const t=new Date,s=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;return new Set([s])}),[He,qt]=a.useState(!1),[We,pt]=a.useState(!1),Yt=a.useMemo(()=>[{id:"date"},{id:"project"},{id:"team"},{id:"agent"}],[]),Qt=a.useCallback(t=>{xt(t)},[]),gt=hs(Yt,R,Qt),z=a.useRef(null),[ke,Ne]=a.useState(null),[we,bt]=a.useState("markdown"),[ue,yt]=a.useState(null),[xe,vt]=a.useState(null),[jt,kt]=a.useState(!1),[Nt,fe]=a.useState(!1),[Se,wt]=a.useState(!1),[Fe,Ce]=a.useState(null),[Jt,_e]=a.useState(!1),[Ue,Xt]=a.useState(""),[St,Zt]=a.useState(new Set),[V,O]=a.useState(!1),E=ms(),X=E?.keyboardPane??"content",[he,Z]=a.useState(null),[ee,K]=a.useState(!1),[me,ze]=a.useState(""),[H,G]=a.useState(!1),[Oe,Ct]=a.useState(!1),[Ke,q]=a.useState(null),Ge=a.useRef(null),Lt=a.useCallback(t=>{t&&(t.style.height="auto",t.style.height=t.scrollHeight+"px")},[]),It=a.useRef(void 0);a.useEffect(()=>{Lt(Ge.current)},[me,ee,Lt]);const T=(t,s)=>{ft({type:t,text:s}),setTimeout(()=>ft(null),3e3)},Rt=async t=>{await ys(t)?(wt(!0),setTimeout(()=>wt(!1),1500)):T("error",n("detail.copyFailed"))},Le=a.useMemo(()=>new Map(ot.map(t=>[t.id,t])),[ot]),qe=a.useMemo(()=>new Map(lt.map(t=>[t.id,t])),[lt]),Et=a.useMemo(()=>new Map(dt.map(t=>[t.id,t])),[dt]),Ie=a.useCallback(t=>{if(!t||t==="default")return null;const s=qe.get(t)?.name;return!s||s==="default"?null:s},[qe]);a.useEffect(()=>{o||(p.projects.list().then(t=>it(t.projects)).catch(()=>{}),p.agents.list().then(t=>ct(t.agents??[])).catch(()=>{}),p.teams.list().then(t=>Kt(t.teams??[])).catch(()=>{}),p.system.storage().then(t=>Xt(t.dataDir+"/shared")).catch(()=>{}),p.deliverables.checkHealth().then(t=>Zt(new Set(t.missingFiles))).catch(()=>{}))},[o]),a.useEffect(()=>(It.current=setTimeout(()=>je(ye),300),()=>clearTimeout(It.current)),[ye]);const te=a.useMemo(()=>({q:ie||void 0,type:B||void 0,artifactType:D||void 0}),[ie,B,D]),se=R==="date"?y:P,Ye=a.useCallback((t,s)=>s?{...s,hubShareId:s.hubShareId!=null?s.hubShareId:t.hubShareId??null,shareStatus:s.shareStatus!=null?s.shareStatus:t.shareStatus??null,shareUrl:s.shareUrl!=null?s.shareUrl:t.shareUrl??null,shareVisibility:s.shareVisibility!=null?s.shareVisibility:t.shareVisibility??null,shareReason:s.shareReason!=null?s.shareReason:t.shareReason}:t,[]),Re=a.useCallback(async()=>{try{const{results:t,total:s}=await p.deliverables.search({...te,offset:0,limit:se});I(i=>i.map(l=>{const f=t.find(d=>d.id===l.id);return f?Ye(l,f):l})),ae(s),C(i=>{if(!i)return null;const l=t.find(f=>f.id===i.id);return l?Ye(i,l):i})}catch{}},[te,se,Ye]),Y=a.useCallback(async()=>{ut(!0),z.current?.scrollTo({top:0,behavior:"instant"});try{const{results:t,total:s}=await p.deliverables.search({...te,offset:0,limit:se});I(t),ae(s),C(i=>i&&t.some(l=>l.id===i.id)?i:null)}catch{I([]),ae(0),C(null)}ut(!1)},[te,se]),Ee=a.useCallback(async()=>{if(!(le||g.length>=v)){at(!0);try{const{results:t,total:s}=await p.deliverables.search({...te,offset:g.length,limit:se});I(i=>[...i,...t]),ae(s)}catch{}at(!1)}},[te,se,g.length,v,le]);a.useEffect(()=>{o||Y()},[Y,o]),a.useEffect(()=>{!o||!c||(I(c.items??[]),ae(c.items?.length??0),it(c.projects??[]),ct(c.agents??[]),c.initialSelectedId&&C(c.items?.find(t=>t.id===c.initialSelectedId)??c.items?.[0]??null))},[o,c]);const Qe=a.useRef(r);Qe.current=r,a.useEffect(()=>{if(o||!b)return;const t=tt.on("deliverable:created",()=>Y()),s=tt.on("deliverable:updated",l=>{Re();const f=l.payload?.deliverableId;f&&Qe.current?.id===f&&p.deliverables.get(f).then(d=>{d.deliverable&&(C(h=>({...h??d.deliverable,...d.deliverable,hubShareId:h?.hubShareId??d.deliverable.hubShareId??null,shareStatus:h?.shareStatus??d.deliverable.shareStatus??null,shareUrl:h?.shareUrl??d.deliverable.shareUrl??null,shareVisibility:h?.shareVisibility??d.deliverable.shareVisibility??null,shareReason:h?.shareReason??d.deliverable.shareReason??null})),At(d.deliverable))}).catch(()=>{})}),i=tt.on("deliverable:removed",()=>Y());return()=>{t(),s(),i()}},[Re,b,o]);const Tt=a.useMemo(()=>ks(Ut,bs.getUrl()),[]);a.useEffect(()=>{if(o||!b||!Ut())return;let t=!1;const s=async()=>{try{const l=await Tt.listMine();if(t)return;const f=new Map,d=new Map;for(const m of l)m.id&&f.set(m.id,m),m.localId&&d.set(m.localId,m);const h=new Map;I(m=>m.map(j=>{const w=j.hubShareId&&f.get(j.hubShareId)||d.get(j.id);if(!w)return j;const be={hubShareId:j.hubShareId??w.id??null,shareStatus:w.status??null,shareUrl:w.url??null,shareVisibility:j.shareVisibility??w.visibility??null,...w.reason!=null?{shareReason:w.reason}:{}};return h.set(j.id,be),{...j,...be}})),C(m=>{if(!m)return m;const j=h.get(m.id);return j?{...m,...j}:m});for(const[m,j]of h)p.deliverables.update(m,j).catch(w=>{console.warn("[deliverables] Hub 分享状态本地持久化失败:",w)})}catch{}};s();const i=setInterval(s,3e4);return()=>{t=!0,clearInterval(i)}},[Tt,b,o]);const Te=a.useRef(null),Je=a.useRef(g);Je.current=g;const pe=a.useCallback(t=>{const s=l=>{C(l),x&&(k(!0),history.pushState({mobileDetail:L.DELIVERABLES},"",window.location.hash))},i=Je.current.find(l=>l.id===t);if(i){s(i);return}p.deliverables.get(t).then(l=>{l.deliverable&&s(l.deliverable)}).catch(()=>{})},[x]);a.useEffect(()=>{if(o)return;const t=window.location.hash.slice(1).split("/"),s=ps(t[0])===L.DELIVERABLES?t[1]:void 0,i=localStorage.getItem("markus_nav_openDeliverable")||s;i&&(localStorage.removeItem("markus_nav_openDeliverable"),Je.current.length>0?pe(i):Te.current=i);const l=f=>{const d=f.detail;d?.params?.openDeliverable&&(localStorage.removeItem("markus_nav_openDeliverable"),pe(d.params.openDeliverable))};return window.addEventListener("markus:navigate",l),()=>window.removeEventListener("markus:navigate",l)},[pe,o]),a.useEffect(()=>{const t=Te.current;!t||g.length===0||(Te.current=null,pe(t))},[g,pe]);const Mt=a.useCallback(()=>{const t=z.current;!t||_||le||g.length>=v||t.scrollHeight<=t.clientHeight+100&&Ee()},[_,le,g.length,v,Ee]);a.useEffect(()=>{const t=z.current;if(!t)return;const s=()=>{t.scrollTop+t.clientHeight>=t.scrollHeight-100&&Ee()};return t.addEventListener("scroll",s,{passive:!0}),()=>t.removeEventListener("scroll",s)},[Ee]),a.useEffect(()=>{Mt()},[Mt,U,Ve]);const W=a.useMemo(()=>{const t=new Map;for(const i of g){let l,f;if(R==="project"){const d=Ie(i.projectId);l=d?i.projectId??"_none":"_none",f=d??n("noProject")}else if(R==="team"){const h=(i.agentId?Le.get(i.agentId):void 0)?.teamId??"_none";l=h,f=h!=="_none"?Et.get(h)?.name??h:n("noTeam")}else if(R==="agent")l=i.agentId??"_none",f=i.agentId?Le.get(i.agentId)?.name??i.agentId:n("common:unknown");else{const d=new Date(i.updatedAt);l=`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`,f=l}t.has(l)||t.set(l,{label:f,items:[]}),t.get(l).items.push(i)}const s=[...t.entries()];return R==="date"?s.sort((i,l)=>l[0].localeCompare(i[0])):s.sort((i,l)=>i[1].label.localeCompare(l[1].label)),s},[g,R,qe,Le,Et,n]);a.useEffect(()=>{if(R==="date"&&U){const t=new Date,s=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;de(new Set([s]))}else de(new Set)},[R]);const es=async t=>{mt("remove");try{await p.deliverables.remove(t.id),T("success",n("removed")),C(null),Y()}catch(s){T("error",n("common:error",{message:String(s)}))}mt("")},ts=a.useCallback(t=>{const s=Qe.current,i=s?.id;if(!i)return;const l={hubShareId:t.id??null,shareStatus:t.status??null,shareUrl:t.url??null,shareVisibility:t.visibility??null,...t.reason!=null||t.status==="rejected"?{shareReason:t.reason??s?.shareReason??null}:{}},f={...l,shareStatus:l.shareStatus??s?.shareStatus??null};C(d=>d&&d.id===i?{...d,...f}:d),I(d=>d.map(h=>h.id===i?{...h,...f}:h)),(async()=>{try{await p.deliverables.update(i,l)}catch(d){console.warn("[deliverables] 分享状态本地回写失败,将由 Hub 轮询补偿:",d)}Re()})()},[Re]),ss=()=>{Q.navigate(L.BUILDER)},At=async t=>{if(t.reference&&!Be(t.reference)){if(t.type==="directory"){fe(!0);return}kt(!0);try{const s=await p.files.preview(t.reference);if(s.type==="image"&&s.mimeType)yt({src:`data:${s.mimeType};base64,${s.content}`,name:s.name});else if(s.type==="audio"||s.type==="video"){const i=s.streamUrl||(s.path?p.files.streamUrl(s.path):p.files.streamUrl(t.reference));vt({kind:s.type,src:i,name:s.name})}else s.type==="binary"?fe(!0):typeof s.content=="string"?(Ne(s.content),bt(vs({format:t.format,reference:t.reference,content:s.content}))):fe(!0)}catch{Ne(null),t.type==="file"&&fe(!0)}kt(!1)}};a.useEffect(()=>{o||(Ne(null),bt("markdown"),yt(null),vt(null),fe(!1),r&&At(r))},[r?.id,o]);const $t=a.useCallback(t=>U!==Ve.has(t),[U,Ve]),Pt=W.length>0&&W.every(([t])=>$t(t)),rs=a.useCallback(t=>{de(s=>{const i=new Set(s);return i.has(t)?i.delete(t):i.add(t),i})},[]),Bt=a.useCallback(t=>{de(s=>{if(s.has(t)===U)return s;const i=new Set(s);return U?i.add(t):i.delete(t),i})},[U]),ns=a.useCallback(()=>{Gt(t=>!t),de(new Set)},[]),Me=!!(B||D||ie),Dt=a.useCallback(()=>{oe(""),ce(""),ve(""),je("")},[]),ge=a.useMemo(()=>W.flatMap(([,t])=>t.items),[W]);a.useEffect(()=>{o||x||_||r||Te.current||ge.length!==0&&C(ge[0])},[o,x,_,r,ge]);const Xe=a.useRef(null);a.useEffect(()=>{if(!r){Xe.current=null;return}if(Xe.current===r.id)return;const t=W.find(([,s])=>s.items.some(i=>i.id===r.id));t&&(Xe.current=r.id,Bt(t[0]))},[r?.id,W,Bt]);const Vt=a.useRef(null),Ht=a.useRef(null),Ae=a.useRef(!1),Wt=a.useRef(X);a.useEffect(()=>{if(o||x||!b)return;const t=Wt.current;Wt.current=X,!(X!=="l1"||t==="l1")&&V&&(Ae.current=!0,O(!1))},[X,o,x,b,V]),a.useEffect(()=>{if(o||x||!b)return;const t=s=>{if(s.metaKey||s.ctrlKey){if(s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement){s.key==="Escape"&&(s.target.blur(),s.preventDefault());return}if(zt(s.target))return;if(s.key==="f"){s.preventDefault(),Vt.current?.focus();return}if(s.key.toLowerCase()==="b"){s.preventDefault(),O(w=>{const be=!w;return be&&(Ae.current=!0,E?.setKeyboardPane("l1"),requestAnimationFrame(()=>Ht.current?.focus())),be});return}if(s.key.toLowerCase()==="l"){s.preventDefault(),et();return}return s.altKey,void 0}if(E?.keyboardPane==="l0")return;if(s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement){s.key==="Escape"&&(s.target.blur(),s.preventDefault());return}if(zt(s.target)||s.metaKey||s.ctrlKey||s.altKey)return;const l=s.key.length===1?s.key.toLowerCase():s.key;if(l==="h"||l==="ArrowLeft"){s.preventDefault(),V&&O(!1),E?.setL0FocusPageId(L.DELIVERABLES),E?.setLeftCollapsed(!1),E?.setKeyboardPane("l0");return}if(l==="l"||l==="ArrowRight"){s.preventDefault(),V&&O(!1),E?.keyboardPane!=="l1"&&E?.setKeyboardPane("l1");return}const f=l==="j"||l==="ArrowDown"?1:l==="k"||l==="ArrowUp"?-1:0;if(!f)return;s.preventDefault(),E?.setKeyboardPane("l1"),V&&(Ae.current=!0,O(!1));const d=ge;if(d.length===0)return;const h=r?d.findIndex(w=>w.id===r.id):-1,m=h<0?f>0?-1:0:h,j=Math.max(0,Math.min(d.length-1,m+f));Ft(d[j]),requestAnimationFrame(()=>{document.querySelector(`[data-deliverable-id="${d[j].id}"]`)?.scrollIntoView({block:"nearest"})})};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[ge,r,o,x,b,E,V]);const $e=a.useRef(null),as=a.useCallback(t=>{if(!x)return;const s=z.current;!s||s.scrollTop>0||($e.current={y:t.touches[0].clientY,scrollTop:s.scrollTop})},[x]),ls=a.useCallback(t=>{if(!x||!$e.current||We)return;const s=t.changedTouches[0].clientY-$e.current.y;$e.current=null,s>80&&z.current&&z.current.scrollTop<=0&&(pt(!0),Y().finally(()=>pt(!1)))},[x,We,Y]),Ft=t=>{const s=()=>{C(t),_e(!1),K(!1),G(!1),x&&(k(!0),history.pushState({mobileDetail:L.DELIVERABLES},"",window.location.hash))};H?q({action:s}):s()},is=()=>{if(!H){const t=ke??r?.summary??"";ze(t)}K(!0)},os=()=>{H?q({action:()=>{K(!1),G(!1)}}):K(!1)},_t=async()=>{if(!(!r?.reference||Oe)){Ct(!0);try{await p.files.write(r.reference,me),Ne(me),G(!1),K(!1),T("success",n("detail.saved"))}catch(t){T("error",n("detail.saveFailed")+": "+String(t))}Ct(!1)}},cs=()=>{K(!1),G(!1),q(null)};a.useEffect(()=>{if(!H)return;const t=s=>{s.preventDefault()};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[H]),a.useEffect(()=>{if(!H)return;const t=s=>{s.preventDefault(),s.stopImmediatePropagation(),q({action:()=>{K(!1),G(!1);const{page:i,params:l}=s.detail||{};i&&Q.navigate(i,l)}})};return window.addEventListener("markus:navigate",t),()=>window.removeEventListener("markus:navigate",t)},[H]);const Ze=a.useRef(null),et=a.useCallback((t,s)=>{const i=r?.agentId??"",l=r?.id??"",f={};l&&(f.openDeliverable=l);const d=[];if(l){const h=r?.title?.trim()||l,m=h.length>40?`${h.slice(0,24)}…${h.slice(-12)}`:h;d.push({label:`📄 ${m}`,content:["[deliverable]",`ID: ${l}`,`Title: ${r?.title??""}`,r?.reference?`Reference: ${r.reference}`:"",r?.taskId?`Task: ${r.taskId}`:"",r?.projectId?`Project: ${r.projectId}`:""].filter(Boolean).join(`
|
|
2
|
-
`)})}if(t?.trim()){const h=t.trim().length>40?`${t.trim().slice(0,24)}…${t.trim().slice(-12)}`:t.trim();if(s){const m=r?.reference??"";d.push({label:`🌐 ${h}`,content:["[html-selection]",`Text: "${t.trim()}"`,`CSS Selector: ${s.cssSelector}`,`XPath: ${s.xpath}`,m?`File: ${m}`:""].filter(Boolean).join(`
|
|
3
|
-
`)})}else d.push({label:`📝 ${h}`,content:t.trim()})}d.length>0&&(f.chatChips=JSON.stringify(d)),i&&(f.agentId=i),Z(null),window.getSelection()?.removeAllRanges(),Q.navigate(L.TEAM,f)},[r]),ds=a.useCallback(t=>{if(!t.text.trim())return;const i=Ze.current?.querySelector("iframe")?.getBoundingClientRect(),l=(i?.left??0)+t.rect.x+t.rect.width/2,f=(i?.top??0)+t.rect.y;Z({x:l,y:f,text:t.text,htmlMeta:{xpath:t.xpath,cssSelector:t.cssSelector}})},[]);return a.useEffect(()=>{const t=Ze.current;if(!t)return;const s=()=>{requestAnimationFrame(()=>{const l=window.getSelection(),f=l?.toString().trim();if(!f||!l?.rangeCount){Z(null);return}const d=l.getRangeAt(0);if(!t.contains(d.commonAncestorContainer)){Z(null);return}const h=d.getBoundingClientRect();Z({x:h.left+h.width/2,y:h.top,text:f})})},i=l=>{const f=document.getElementById("selection-toolbar");f&&f.contains(l.target)||Z(null)};return t.addEventListener("mouseup",s),document.addEventListener("mousedown",i),()=>{t.removeEventListener("mouseup",s),document.removeEventListener("mousedown",i)}},[]),e.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[e.jsxs("div",{ref:Ht,tabIndex:-1,"data-keyboard-pane":"l1",className:`${x?"flex-1 min-w-0":"shrink-0"} flex flex-col bg-surface-secondary rounded-xl m-1 mr-0 outline-none ${!x&&X==="l1"?"ring-1 ring-inset ring-brand-500/30":""}`,style:x?N?{display:"none"}:void 0:V?{display:"none"}:{width:A.width},children:[e.jsxs("div",{"data-electron-drag":!0,className:"p-4 space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between gap-2",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x&&e.jsx(gs,{}),!x&&e.jsx("button",{onClick:()=>O(!0),className:"w-8 h-8 flex items-center justify-center rounded-lg transition-colors shrink-0 bg-brand-500/15 text-brand-500 hover:bg-brand-500/25",title:n("sidebar.collapse"),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]})}),e.jsxs("h2",{className:"text-sm font-semibold text-fg-secondary truncate",children:[n("title"),v>0&&e.jsxs("span",{className:"ml-1.5 text-fg-tertiary font-normal",children:["(",v,")"]})]})]})}),e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-fg-muted pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:Vt,value:ye,onChange:t=>ve(t.target.value),placeholder:n("searchPlaceholder"),className:"w-full bg-surface-elevated border border-border-default rounded-lg pl-8 pr-8 py-2 text-sm text-fg-primary focus:border-brand-500 focus:outline-none transition-colors"}),ye&&e.jsx("button",{onClick:()=>{ve(""),je("")},className:"absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 flex items-center justify-center rounded-full bg-surface-overlay text-fg-tertiary hover:text-fg-secondary transition-colors",children:e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),Ue&&!x&&e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-surface-elevated rounded-lg text-[10px] text-fg-tertiary",children:[e.jsx("span",{className:"truncate font-mono",children:Ue}),e.jsx("button",{onClick:()=>{p.system.openPath(Ue)},className:"shrink-0 underline hover:text-fg-secondary transition-colors",children:n("common:open")})]}),x&&e.jsxs("button",{onClick:()=>qt(t=>!t),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors ${He||Me?"bg-brand-500/15 text-brand-500":"bg-surface-elevated text-fg-secondary"}`,children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"20",y2:"12"}),e.jsx("line",{x1:"12",y1:"18",x2:"20",y2:"18"})]}),n("filters.filtersLabel"),Me&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-brand-500"}),e.jsx("svg",{className:`w-3 h-3 ml-auto transition-transform ${He?"rotate-180":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),e.jsxs("div",{className:x&&!He?"hidden":"space-y-3",children:[e.jsxs("div",{className:"flex gap-1 overflow-x-auto scrollbar-hide filter-pills-fade",children:[e.jsx(rt,{label:n("filters.allTypes"),value:"",current:B||D||"",onClick:()=>{oe(""),ce("")}}),Cs.map(t=>e.jsx(rt,{label:`${ne[t]?.icon??""} ${t}`,value:t,current:B,onClick:s=>{oe(s),ce("")}},t)),["agent","team","skill"].map(t=>e.jsx(rt,{label:`${F[t].icon} ${n(`artifactTypes.${t}`)}`,value:t,current:D,onClick:s=>{ce(s),oe("")}},t))]}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary",children:n("filters.group")}),["date","project","team","agent"].map(t=>e.jsx("button",{onClick:()=>{xt(t)},className:`px-2 py-1 rounded text-xs transition-colors ${R===t?"bg-brand-600 text-white":"bg-surface-elevated text-fg-secondary hover:bg-surface-overlay"}`,children:n(`groupBy.${t}`)},t)),W.length>1&&e.jsx("button",{onClick:ns,className:"ml-auto px-1.5 py-1 rounded text-[10px] text-fg-tertiary hover:text-fg-secondary hover:bg-surface-elevated transition-colors",title:n(Pt?"expandAllTooltip":"collapseAllTooltip"),children:n(Pt?"expandAll":"collapseAll")})]})]}),Me&&e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[ie&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:["“",ie,"”",e.jsx("button",{onClick:()=>{ve(""),je("")},className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),B&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[ne[B]?.icon," ",B,e.jsx("button",{onClick:()=>oe(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),D&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[F[D]?.icon," ",n(`artifactTypes.${D}`),e.jsx("button",{onClick:()=>ce(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("button",{onClick:Dt,className:"text-[10px] text-fg-tertiary hover:text-brand-500 ml-auto transition-colors",children:n("filters.clearAll")})]})]}),De&&e.jsx("div",{className:`mx-4 mt-2 px-3 py-1.5 text-xs rounded-lg ${De.type==="success"?"bg-green-500/15 text-green-600":"bg-red-500/15 text-red-500"}`,children:De.text}),e.jsxs("div",{ref:z,className:"flex-1 overflow-y-auto p-2 space-y-1 transition-opacity duration-150",style:{opacity:_?.5:1},onTouchStart:x?t=>{gt.onTouchStart(t),as(t)}:void 0,onTouchEnd:x?t=>{gt.onTouchEnd(t),ls(t)}:void 0,children:[We&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-brand-500",children:[e.jsx(Ot,{})," ",e.jsx("span",{className:"text-[10px]",children:n("filters.refreshing")})]}),_?e.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(t=>e.jsxs("div",{className:"animate-pulse space-y-2",children:[e.jsx("div",{className:"h-4 bg-surface-elevated rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-surface-elevated rounded w-1/2"})]},t))}):g.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-6 text-center",children:[e.jsx("svg",{className:"w-12 h-12 text-fg-muted mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),Me?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:n("empty.noResults")}),e.jsx("p",{className:"text-xs text-fg-tertiary mt-1 mb-3",children:n("empty.noResultsHint")}),e.jsx("button",{onClick:Dt,className:"text-xs px-3 py-1.5 rounded-lg bg-brand-600 hover:bg-brand-500 text-white transition-colors",children:n("filters.clearAll")})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:n("empty.title")}),e.jsx("p",{className:"text-xs text-fg-tertiary mt-1 mb-3",children:n("empty.subtitle")}),e.jsx("button",{onClick:()=>Q.navigate(L.WORK),className:"text-xs px-3 py-1.5 rounded-lg bg-brand-600 hover:bg-brand-500 text-white transition-colors",children:n("empty.goToWork")})]})]}):W.map(([t,s])=>{const i=$t(t);return e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:()=>rs(t),className:"w-full flex items-center gap-1.5 px-2 py-2 rounded-md hover:bg-surface-elevated/50 transition-colors group/header border-b border-border-subtle/50",children:[e.jsx("svg",{className:`w-3 h-3 text-fg-tertiary transition-transform duration-200 shrink-0 ${i?"":"rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),e.jsx("span",{className:"text-[11px] font-semibold text-fg-tertiary uppercase tracking-wider truncate",children:s.label}),e.jsxs("span",{className:"text-[10px] text-fg-muted bg-surface-elevated px-1.5 py-0.5 rounded-full shrink-0",children:[s.items.length,g.length<v?"+":""]})]}),e.jsx("div",{className:`overflow-hidden transition-all duration-200 ${i?"max-h-0 opacity-0":"max-h-[5000px] opacity-100"}`,children:s.items.map(l=>e.jsx("button",{"data-deliverable-id":l.id,onClick:()=>Ft(l),className:`w-full text-left px-3 py-2 rounded-lg transition-all duration-150 ${r?.id===l.id?X==="l1"?"bg-brand-500/25 ring-1 ring-inset ring-brand-500/40 border-l-2 border-l-brand-500 border-y border-r border-y-brand-500/20 border-r-brand-500/20":"bg-brand-600/15 border-l-2 border-l-brand-500 border-y border-r border-y-brand-500/20 border-r-brand-500/20":"hover:bg-surface-elevated/60 border-l-2 border-l-transparent border-y border-r border-transparent"}`,children:e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[l.artifactType&&F[l.artifactType]?e.jsx("span",{className:`text-[10px] px-1 py-0.5 rounded font-medium shrink-0 ${F[l.artifactType].color}`,children:F[l.artifactType].icon}):e.jsx("span",{className:`text-[10px] px-1 py-0.5 rounded font-medium uppercase shrink-0 ${ne[l.type]?.color??"bg-surface-overlay text-fg-secondary"}`,children:ne[l.type]?.icon??l.type.charAt(0)}),e.jsx("span",{className:"text-sm font-medium text-fg-primary truncate flex-1",children:l.title}),S(l)==="published"&&e.jsxs("svg",{className:"shrink-0 text-green-500",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":n("share.published",{defaultValue:"已发布到 Hub"}),children:[e.jsx("title",{children:n("share.published",{defaultValue:"已发布到 Hub"})}),e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),S(l)==="pending_review"&&e.jsxs("svg",{className:"shrink-0 text-amber-500 animate-pulse",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":n("share.pendingReview",{defaultValue:"Hub 审核中"}),children:[e.jsx("title",{children:n("share.pendingReview",{defaultValue:"Hub 审核中"})}),e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),S(l)==="rejected"&&e.jsxs("svg",{className:"shrink-0 text-red-500",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":n("share.rejected",{defaultValue:"Hub 已拒绝"}),children:[e.jsx("title",{children:n("share.rejected",{defaultValue:"Hub 已拒绝"})}),e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),St.has(l.id)&&e.jsx("span",{className:"shrink-0 text-amber-500",title:n("detail.fileMissing"),children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}),e.jsx("span",{className:"text-[10px] text-fg-muted shrink-0",children:Ls(l.updatedAt,n)})]})},l.id))})]},t)}),le&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-3 text-fg-tertiary",children:[e.jsx(Ot,{})," ",e.jsx("span",{className:"text-[10px]",children:n("common:loadingMore")})]}),!_&&g.length>0&&e.jsx("div",{className:"text-center text-[10px] text-fg-tertiary py-2",children:g.length<v?n("count.partial",{loaded:g.length,total:v}):n("count.total",{total:v})})]})]}),!x&&e.jsx("div",{className:"w-2 shrink-0 cursor-col-resize group relative flex items-center justify-center hover:bg-brand-500/5 transition-colors",onMouseDown:A.onResizeStart,children:e.jsxs("div",{className:"flex flex-col gap-1 items-center opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-fg-muted"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-fg-muted"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-fg-muted"})]})}),(!x||N)&&e.jsxs("div",{"data-no-drag":!0,className:"flex-1 overflow-hidden min-w-0 flex relative self-stretch",children:[e.jsxs("div",{ref:Ze,className:"flex-1 overflow-y-auto min-w-0 h-full",children:[V&&!x&&e.jsxs("div",{className:"sticky top-0 z-10 bg-surface-primary/80 backdrop-blur-sm px-4 py-2 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{Ae.current=!0,O(!1)},className:"w-8 h-8 flex items-center justify-center rounded-lg transition-colors shrink-0 text-fg-tertiary hover:text-fg-secondary hover:bg-surface-elevated",title:n("sidebar.expand"),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]})}),e.jsx("span",{className:"text-sm font-medium text-fg-secondary truncate",children:r?.title??n("detail.details")})]}),x&&e.jsxs("div",{className:"sticky top-0 z-10 bg-surface-secondary px-4 py-2.5 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>history.back(),className:"text-fg-secondary hover:text-fg-primary transition-colors p-1 -ml-1",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})})}),e.jsx("span",{className:"text-sm font-medium truncate",children:r?.title??n("detail.details")})]}),r?e.jsxs("div",{className:"p-6 space-y-4",children:[!o&&St.has(r.id)&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-amber-500/10 border border-amber-500/20 rounded-lg text-amber-600 text-xs",children:[e.jsxs("svg",{className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),e.jsx("span",{children:n("detail.fileMissing")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h2",{className:"text-xl font-semibold text-fg-primary",children:r.title}),!o&&e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsxs("button",{onClick:()=>_e(!0),title:n("share.title",{defaultValue:"分享到 Markus Hub"}),"aria-label":n("share.title",{defaultValue:"分享到 Markus Hub"}),className:`relative p-1.5 rounded-lg transition-colors ${S(r)==="published"?"text-green-500 hover:text-green-400 hover:bg-green-500/10":S(r)==="pending_review"?"text-amber-500 hover:text-amber-400 hover:bg-amber-500/10":"text-fg-tertiary hover:text-fg-secondary hover:bg-surface-elevated"}`,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),S(r)==="published"||S(r)==="pending_review"||S(r)==="rejected"?e.jsx("span",{className:`absolute top-0.5 right-0.5 w-2 h-2 rounded-full border border-surface-primary ${S(r)==="published"?"bg-green-500":S(r)==="pending_review"?"bg-amber-500 animate-pulse":"bg-red-500"}`,"aria-hidden":!0}):null]}),e.jsx("button",{onClick:()=>Ce(r),disabled:!!ht,className:"p-1.5 rounded-lg text-fg-tertiary hover:text-red-500 hover:bg-red-500/10 transition-colors disabled:opacity-50 shrink-0",title:n("common:remove"),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:`px-2 py-0.5 rounded text-xs font-medium uppercase ${ne[r.type]?.color??"bg-surface-overlay text-fg-secondary"}`,children:[ne[r.type]?.icon??""," ",r.type]}),r.artifactType&&F[r.artifactType]&&e.jsxs("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${F[r.artifactType].color}`,children:[F[r.artifactType].icon," ",n("detail.builderWithType",{type:n(`artifactTypes.${r.artifactType}`)})]}),r.tags.length>0&&r.tags.map(t=>e.jsx("span",{className:"px-2 py-0.5 text-xs bg-surface-elevated text-fg-secondary rounded",children:t},t)),S(r)==="published"&&e.jsxs("a",{href:r.shareUrl??void 0,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium bg-green-500/15 text-green-600 hover:bg-green-500/25 hover:underline",title:r.shareUrl??void 0,children:[e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),n("share.published",{defaultValue:"已发布"})]}),S(r)==="pending_review"&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium bg-amber-500/15 text-amber-500",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 animate-pulse"}),n("share.pendingReview",{defaultValue:"审核中"})]}),S(r)==="rejected"&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium bg-red-500/15 text-red-500",title:r.shareReason??void 0,children:[n("share.rejected",{defaultValue:"已拒绝"}),r.shareReason?e.jsxs("span",{className:"text-red-400/90 font-normal",children:["— ",r.shareReason]}):null]})]}),(r.taskId||r.agentId||Ie(r.projectId))&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.taskId&&e.jsx("button",{onClick:()=>Q.navigate(L.WORK,{openTask:r.taskId}),className:"text-xs text-brand-500 hover:underline bg-brand-500/10 px-2 py-0.5 rounded",children:n("links.task",{id:`${r.taskId.slice(0,12)}...`})}),r.agentId&&e.jsx("button",{onClick:()=>Q.navigate(L.TEAM,{selectAgent:r.agentId}),className:"text-xs text-blue-600 hover:underline bg-blue-500/10 px-2 py-0.5 rounded",children:n("links.agent",{name:Le.get(r.agentId)?.name??r.agentId.slice(0,12)})}),Ie(r.projectId)&&e.jsx("button",{onClick:()=>Q.navigate(L.WORK,{projectId:r.projectId}),className:"text-xs text-blue-600 hover:underline bg-blue-500/10 px-2 py-0.5 rounded",children:n("links.project",{name:Ie(r.projectId)})})]}),(r.diffStats||r.testResults)&&e.jsxs("div",{className:"flex gap-3 flex-wrap",children:[r.diffStats&&e.jsxs("div",{className:"bg-surface-elevated rounded-lg px-3 py-2 text-xs flex items-center gap-2",children:[e.jsxs("span",{className:"text-fg-tertiary font-medium",children:[n("diffStats.title"),":"]}),e.jsx("span",{className:"text-fg-secondary",children:n("diffStats.files",{count:r.diffStats.filesChanged})}),e.jsxs("span",{className:"text-green-600",children:["+",r.diffStats.additions]}),e.jsxs("span",{className:"text-red-500",children:["-",r.diffStats.deletions]})]}),r.testResults&&e.jsxs("div",{className:"bg-surface-elevated rounded-lg px-3 py-2 text-xs flex items-center gap-2",children:[e.jsxs("span",{className:"text-fg-tertiary font-medium",children:[n("testResults.title"),":"]}),e.jsx("span",{className:"text-green-600",children:n("testResults.passed",{count:r.testResults.passed})}),e.jsx("span",{className:"text-red-500",children:n("testResults.failed",{count:r.testResults.failed})}),e.jsx("span",{className:"text-fg-secondary",children:n("testResults.skipped",{count:r.testResults.skipped})})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-fg-tertiary flex-wrap",children:[e.jsxs("span",{children:[n("metadata.created")," ",new Date(r.createdAt).toLocaleString()]}),e.jsxs("span",{children:[n("metadata.updated")," ",new Date(r.updatedAt).toLocaleString()]}),e.jsx("span",{className:"text-fg-muted select-all",children:r.id.slice(0,12)})]}),r.reference&&!Be(r.reference)&&r.type==="file"&&e.jsxs("div",{className:"flex items-center gap-2 bg-surface-elevated rounded-lg px-3 py-2",children:[e.jsx("button",{onClick:()=>{p.files.reveal(r.reference).catch(()=>T("error",n("detail.failedToOpenBrowser")))},className:"text-xs font-mono text-brand-500 hover:text-brand-500 hover:underline truncate flex-1 text-left cursor-pointer",title:n("detail.openInFileBrowser"),children:r.reference}),e.jsx("button",{onClick:()=>{p.files.reveal(r.reference).catch(()=>T("error",n("detail.failedToOpenBrowser")))},className:"px-2 py-1 text-[10px] rounded bg-brand-600/20 text-brand-500 hover:bg-brand-600/30 transition-colors shrink-0",title:n("detail.revealInFinder"),children:n("common:open")}),e.jsx("button",{onClick:()=>Rt(r.reference),className:`px-2 py-1 text-[10px] rounded transition-colors shrink-0 ${Se?"bg-green-500/20 text-green-600":"bg-surface-overlay/50 text-fg-secondary hover:bg-surface-overlay"}`,title:n("detail.copyPath"),children:n(Se?"common:copied":"common:copy")})]}),r.reference&&!Be(r.reference)&&r.type!=="file"&&r.type!=="directory"&&e.jsx("span",{className:"text-xs text-fg-tertiary font-mono break-all",children:r.reference})]}),r.artifactType&&r.artifactData?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(Ss,{artifact:r.artifactData,mode:r.artifactType})}),r.reference&&e.jsxs("div",{className:"px-3 py-2 bg-surface-elevated rounded-lg",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider block mb-1",children:n("detail.artifactDirectory")}),e.jsx("span",{className:"text-xs text-fg-secondary font-mono break-all",children:r.reference})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx("button",{onClick:ss,className:"flex-1 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors",children:n("detail.openInBuilder")})}),r.summary&&e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(Pe,{content:r.summary,className:"text-fg-secondary text-sm"})})]}):r.reference&&Be(r.reference)?e.jsxs("div",{className:"space-y-4",children:[r.summary&&e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(Pe,{content:r.summary,className:"text-fg-secondary text-sm"})}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-10",children:[e.jsxs("svg",{className:"w-10 h-10 text-fg-muted mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),e.jsx("p",{className:"text-xs text-fg-tertiary font-mono mb-4 px-4 text-center break-all select-all",children:r.reference}),e.jsx("button",{onClick:()=>window.open(r.reference,"_blank","noopener,noreferrer"),className:"px-6 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors",children:n("detail.openUrl")})]})]}):r.type==="directory"&&r.reference?e.jsxs("div",{className:"space-y-4",children:[r.summary&&e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(Pe,{content:r.summary,className:"text-fg-secondary text-sm"})}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-10",children:[e.jsx("svg",{className:"w-10 h-10 text-fg-muted mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),e.jsx("p",{className:"text-xs text-fg-tertiary font-mono mb-4 px-4 text-center break-all select-all",children:r.reference}),e.jsx("button",{onClick:()=>{p.files.reveal(r.reference).catch(()=>T("error",n("detail.failedToOpenBrowser")))},className:"px-6 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors",children:n("detail.openInFileBrowser")})]})]}):e.jsxs("div",{className:"bg-surface-elevated rounded-xl overflow-hidden",children:[(ke||r.summary)&&!jt&&!ue&&!Nt&&r.reference&&r.type==="file"&&(we==="markdown"||we==="text"||we==="html")&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border-subtle bg-surface-secondary/50",children:[e.jsx("button",{onClick:os,className:`px-3 py-1 rounded text-xs font-medium transition-colors ${ee?"text-fg-tertiary hover:text-fg-secondary":"bg-brand-600/20 text-brand-500"}`,children:n("detail.preview")}),e.jsx("button",{onClick:is,className:`px-3 py-1 rounded text-xs font-medium transition-colors ${ee?"bg-brand-600/20 text-brand-500":"text-fg-tertiary hover:text-fg-secondary"}`,children:n("detail.edit")}),e.jsx("div",{className:"flex-1"}),ee&&e.jsx("button",{onClick:_t,disabled:!H||Oe,className:"px-3 py-1 rounded text-xs font-medium bg-brand-600 hover:bg-brand-500 text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:n(Oe?"detail.saving":"detail.save")})]}),e.jsx("div",{className:"p-5",children:jt?e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-full"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-5/6"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-4/6"}),e.jsx("div",{className:"h-32 bg-surface-overlay/40 rounded-lg w-full mt-2"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-2/3"})]}):ue?e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("img",{src:ue.src,alt:ue.name,className:"max-w-full max-h-[60vh] rounded-lg object-contain"}),e.jsx("span",{className:"text-xs text-fg-tertiary",children:ue.name})]}):xe?e.jsxs("div",{className:"flex flex-col gap-3 py-4",children:[xe.kind==="audio"?e.jsx("audio",{controls:!0,preload:"metadata",src:xe.src,className:"w-full"}):e.jsx("video",{controls:!0,preload:"metadata",src:xe.src,className:"w-full max-h-[60vh] rounded-lg bg-black"}),e.jsx("span",{className:"text-xs text-fg-tertiary",children:xe.name})]}):ke?ee?e.jsx("div",{className:"animate-fadeIn",children:e.jsx("textarea",{ref:Ge,value:me,onChange:t=>{ze(t.target.value),G(!0)},className:"w-full min-h-[120px] p-3 text-sm font-mono bg-surface-primary border border-border-subtle rounded-lg text-fg-secondary focus:outline-none focus:ring-1 focus:ring-brand-500/50 overflow-hidden",style:{resize:"none"},spellCheck:!1})},"edit"):e.jsx("div",{className:"animate-fadeIn",children:e.jsx(js,{content:ke,format:we,className:"text-fg-secondary text-sm",onHtmlSelection:ds,basePath:r?.reference?r.reference.replace(/[/\\][^/\\]+$/,""):void 0})},"preview"):Nt?e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:n("detail.cannotPreview",{type:r.type})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{p.files.reveal(r.reference).catch(()=>T("error",n("detail.failedToOpen")))},className:"text-xs bg-surface-elevated px-3 py-2 rounded text-brand-500 hover:text-brand-500 hover:underline flex-1 truncate text-left cursor-pointer font-mono",title:n("detail.openInFileBrowser"),children:r.reference}),e.jsx("button",{onClick:()=>{p.files.reveal(r.reference).catch(()=>T("error",n("detail.failedToOpen")))},className:"px-3 py-2 text-xs rounded-lg bg-brand-600/20 text-brand-500 hover:bg-brand-600/30 transition-colors shrink-0",children:n("common:open")}),e.jsx("button",{onClick:()=>Rt(r.reference),className:`px-3 py-2 text-xs rounded-lg transition-colors shrink-0 ${Se?"bg-green-500/20 text-green-600":"bg-surface-overlay/50 text-fg-secondary hover:bg-surface-overlay"}`,children:n(Se?"common:copied":"common:copy")})]})]}):r.summary?ee?e.jsx("textarea",{ref:Ge,value:me,onChange:t=>{ze(t.target.value),G(!0)},className:"w-full min-h-[120px] p-3 text-sm font-mono bg-surface-primary border border-border-subtle rounded-lg text-fg-secondary focus:outline-none focus:ring-1 focus:ring-brand-500/50 overflow-hidden",style:{resize:"none"},spellCheck:!1}):e.jsx(Pe,{content:r.summary,className:"text-fg-secondary text-sm"}):e.jsx("p",{className:"text-sm text-fg-tertiary italic",children:n("detail.noContent")})})]})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center text-fg-tertiary space-y-3 max-w-xs",children:[e.jsx("div",{className:"w-16 h-16 mx-auto rounded-2xl bg-surface-elevated/60 flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-fg-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),e.jsx("p",{className:"text-sm text-fg-secondary",children:n("detail.selectToView")}),!x&&e.jsx("p",{className:"text-[10px] text-fg-muted",children:n("detail.keyboardHint")})]})})]}),r?.agentId&&!x&&e.jsx("button",{type:"button",onClick:()=>et(),className:"absolute bottom-6 right-6 z-20 w-12 h-12 rounded-full bg-brand-600 hover:bg-brand-500 text-white shadow-lg shadow-black/20 flex items-center justify-center transition-transform hover:scale-105 animate-fab-in",title:n("chat.openChat",{defaultValue:"Open in Team Chat"}),children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})})]}),he&&e.jsx("div",{id:"selection-toolbar",className:"fixed z-50 -translate-x-1/2 -translate-y-full bg-surface-elevated border border-border-default rounded-lg shadow-xl overflow-hidden",style:{left:he.x,top:he.y-8},children:e.jsxs("button",{onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),et(he.text,he.htmlMeta)},className:"px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-overlay hover:text-fg-primary transition-colors flex items-center gap-1.5 whitespace-nowrap",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),n("contextMenu.addToConversation")]})}),Jt&&r&&e.jsx(Ns,{item:r,onClose:()=>_e(!1),onShared:ts}),Fe&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>Ce(null),children:e.jsxs("div",{className:"bg-surface-secondary border border-border-default rounded-xl p-6 max-w-sm mx-4 shadow-2xl",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{className:"w-5 h-5 text-red-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:n("detail.confirmRemoveTitle")}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:n("detail.confirmRemoveMessage",{name:Fe.title})})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>Ce(null),className:"px-4 py-1.5 text-xs text-fg-secondary hover:text-fg-primary border border-border-default hover:border-gray-600 rounded-lg transition-colors",children:n("common:cancel")}),e.jsx("button",{onClick:()=>{const t=Fe;Ce(null),es(t)},disabled:!!ht,className:"px-4 py-1.5 text-xs bg-red-600 hover:bg-red-500 text-white rounded-lg transition-colors disabled:opacity-50",children:n("common:remove")})]})]})}),Ke&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>q(null),children:e.jsxs("div",{className:"bg-surface-secondary border border-border-default rounded-xl p-6 max-w-sm mx-4 shadow-2xl",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/15 flex items-center justify-center shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-amber-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:n("detail.unsavedTitle")}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:n("detail.unsavedMessage")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>q(null),className:"px-4 py-1.5 text-xs text-fg-secondary hover:text-fg-primary border border-border-default hover:border-gray-600 rounded-lg transition-colors",children:n("common:cancel")}),e.jsx("button",{onClick:()=>{cs(),Ke.action()},className:"px-4 py-1.5 text-xs text-fg-secondary hover:text-fg-primary border border-border-default hover:border-gray-600 rounded-lg transition-colors",children:n("detail.discard")}),e.jsx("button",{onClick:async()=>{await _t(),Ke.action(),q(null)},className:"px-4 py-1.5 text-xs bg-brand-600 hover:bg-brand-500 text-white rounded-lg transition-colors",children:n("detail.saveAndLeave")})]})]})})]})}function rt({label:u,value:o,current:c,onClick:n}){return e.jsx("button",{onClick:()=>n(c===o?"":o),className:`px-2 py-1 rounded text-xs whitespace-nowrap shrink-0 transition-colors ${c===o?"bg-brand-600 text-white":"bg-surface-elevated text-fg-secondary hover:bg-surface-overlay"}`,children:u})}function Ot(){return e.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}export{Ts as DeliverablesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ae as o,af as n}from"./mermaid.core-B4fv65oQ.js";const e=(a,r)=>o.lang.round(n.parse(a)[r]);export{e as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-i7IiTNSf.js";import{_ as i}from"./mermaid.core-B4fv65oQ.js";import"./transform-CpIVI4vC.js";import"./chunk-FMBD7UC4-DTXl3WfT.js";import"./chunk-ND2GUHAM-DdzR-Jnl.js";import"./chunk-55IACEB6-DFTeZroI.js";import"./chunk-2J33WTMH-BwuewEg2.js";import"./index-B1VN5yM1.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-i7IiTNSf.js";import{_ as i}from"./mermaid.core-B4fv65oQ.js";import"./transform-CpIVI4vC.js";import"./chunk-FMBD7UC4-DTXl3WfT.js";import"./chunk-ND2GUHAM-DdzR-Jnl.js";import"./chunk-55IACEB6-DFTeZroI.js";import"./chunk-2J33WTMH-BwuewEg2.js";import"./index-B1VN5yM1.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram};
|