(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70250,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(98118),d=e.i(62368),l=e.i(22016);let s=[{value:"seed",label:"种子"},{value:"growing",label:"成长中"},{value:"mature",label:"成熟"},{value:"needs-split",label:"待拆分"},{value:"archived",label:"已归档"}];function o(){let e=(0,a.useWikiData)(),[o,i]=(0,r.useState)("updated"),[n,c]=(0,r.useState)(new Set),u=(0,r.useMemo)(()=>{let t=new Map;for(let r of e.nodes){let a={derivedFrom:[],splitsInto:[]};for(let t of r.derived_from){let r=e.nodeMap[t];r&&a.derivedFrom.push(r)}for(let t of r.splits_into){let r=e.nodeMap[t];r&&a.splitsInto.push(r)}(a.derivedFrom.length||a.splitsInto.length)&&t.set(r.id,a)}return t},[e.nodes,e.nodeMap]),v=(0,r.useMemo)(()=>{let t=e.nodes;n.size>0&&(t=t.filter(e=>n.has(e.status)));let r=[...t].sort((e,t)=>{let r="updated"===o?e.updated:e.created;return("updated"===o?t.updated:t.created).localeCompare(r)}),a=[];for(let e of r){let t="updated"===o?e.updated:e.created,r=a[a.length-1];r&&r.date===t?r.nodes.push(e):a.push({date:t,nodes:[e]})}return a},[e.nodes,o,n]);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsx)("h2",{className:"text-[22px] font-semibold m-0",children:"时间线"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[13px]",children:[(0,t.jsx)("button",{onClick:()=>i("updated"),className:`px-2.5 py-1 rounded-md border transition-colors ${"updated"===o?"":"hover:bg-[var(--hover)]"}`,style:{borderColor:"updated"===o?"var(--active-bg)":"var(--border)",background:"updated"===o?"var(--active-bg)":void 0,color:"updated"===o?"var(--active-text)":"var(--text)"},children:"按更新"}),(0,t.jsx)("button",{onClick:()=>i("created"),className:`px-2.5 py-1 rounded-md border transition-colors ${"created"===o?"":"hover:bg-[var(--hover)]"}`,style:{borderColor:"created"===o?"var(--active-bg)":"var(--border)",background:"created"===o?"var(--active-bg)":void 0,color:"created"===o?"var(--active-text)":"var(--text)"},children:"按创建"})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 mb-6",children:[s.map(e=>(0,t.jsx)("button",{onClick:()=>{var t;return t=e.value,void c(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})},className:"px-2 py-0.5 rounded-full text-[11px] border transition-colors",style:{borderColor:n.has(e.value)?"var(--active-bg)":"var(--border)",background:n.has(e.value)?"var(--active-bg)":void 0,color:n.has(e.value)?"var(--active-text)":"var(--text)"},children:e.label},e.value)),n.size>0&&(0,t.jsx)("button",{onClick:()=>c(new Set),className:"px-2 py-0.5 rounded-full text-[11px]",style:{color:"var(--muted)"},children:"清除筛选"})]}),(0,t.jsxs)("div",{className:"relative pl-6",children:[(0,t.jsx)("div",{className:"absolute left-[9px] top-0 bottom-0 w-px",style:{background:"var(--border)"}}),v.map(e=>(0,t.jsxs)("div",{className:"mb-6 relative",children:[(0,t.jsx)("div",{className:"absolute left-[-15px] top-[6px] w-[12px] h-[12px] rounded-full bg-amber-400 border-2 shadow-sm",style:{borderColor:"var(--surface)"}}),(0,t.jsx)("div",{className:"text-[13px] font-medium mb-2",style:{color:"var(--muted)"},children:e.date}),(0,t.jsx)("div",{className:"border rounded-lg p-4",style:{borderColor:"var(--border)",background:"var(--surface)"},children:e.nodes.map(e=>{let r=u.get(e.id);return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("div",{className:"flex-1 min-w-0",children:(0,t.jsx)(d.NodeCard,{...e,subtitle:"updated"===o?`创建于 ${e.created}`:`更新于 ${e.updated}`})})}),r&&(0,t.jsxs)("div",{className:"ml-6 mb-1 text-[11px] flex flex-wrap gap-x-3",style:{color:"var(--muted)"},children:[r.derivedFrom.map(e=>(0,t.jsxs)("span",{children:["↑ 演化自 ",(0,t.jsx)(l.default,{href:`/node/${e.id}`,className:"underline",style:{color:"var(--accent)"},children:e.title})]},e.id)),r.splitsInto.map(e=>(0,t.jsxs)("span",{children:["↓ 拆分为 ",(0,t.jsx)(l.default,{href:`/node/${e.id}`,className:"underline",style:{color:"var(--accent)"},children:e.title})]},e.id))]})]},e.id)})})]},e.date))]})]})}e.s(["default",0,function(){return(0,t.jsx)(o,{})}],70250)}]);