diff --git a/app/src/pages/resume/ResumePage.tsx b/app/src/pages/resume/ResumePage.tsx index a46d208..6219c44 100644 --- a/app/src/pages/resume/ResumePage.tsx +++ b/app/src/pages/resume/ResumePage.tsx @@ -165,6 +165,23 @@ export function ResumePage() { .then(() => { setInitOpen(false); toast('success', '简历已初始化为默认模板'); }) .catch(e => toast('error', e.message)); }; + // 彻底清空:板块结构保留,内容全部置空(不填充示例) + const clearResume = () => { + const fresh = defaultResumeConfig(); + fresh.sections = fresh.sections.map(x => ({ + ...x, + text: x.kind === 'text' ? '' : x.text, + items: x.kind === 'list' ? [] : x.items, + overrides: {}, excluded: [], itemOrder: [], hiddenFields: [], + })); + setConfig(fresh); + setOpenEditors(new Set()); + void profileUpsert({ info: { ...profile, selfIntro }, resume: fresh }) + .then(() => profileQ.refetch()) + .then(() => { setInitOpen(false); toast('success', '简历数据已彻底清空'); }) + .catch(e => toast('error', e.message)); + }; + // 重新载入:从服务器拉最新记录与配置,丢弃本地未保存状态 const reloadAll = async () => { try { @@ -496,13 +513,15 @@ export function ResumePage() { title="初始化简历" footer={<> setInitOpen(false)}>取消 - - 确认初始化 + 彻底清空 + + 恢复默认模板 >}> - 将清除全部个性化修改(板块调整、自定义条目、文字覆盖、样式设置), - 恢复为默认模板与示例内容。 + 恢复默认模板:清除个性化修改,恢复默认板块与示例内容。 + 彻底清空:保留板块结构,内容全部置空,从零开始。 + 两种操作都不影响记录数据与个人信息。 记录数据与个人信息不受影响,随时可重新修改。 diff --git a/sync-server/www/assets/AdminPage-Br3ZHwTZ.js b/sync-server/www/assets/AdminPage-Cppzhhx8.js similarity index 97% rename from sync-server/www/assets/AdminPage-Br3ZHwTZ.js rename to sync-server/www/assets/AdminPage-Cppzhhx8.js index de68891..ec98190 100644 --- a/sync-server/www/assets/AdminPage-Br3ZHwTZ.js +++ b/sync-server/www/assets/AdminPage-Cppzhhx8.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-AIpE8C-f.js","assets/index-B4Ww6089.css"])))=>i.map(i=>d[i]); -import{c as j,u as je,d as ve,_ as ge,f as q,$ as T,r as i,g as o,j as e,E as f,B as t,a0 as te,m as x,k as ne,a1 as ie,T as re,P as be,I as k,l as ye,F as le,a2 as fe,a3 as ke,a4 as Ne,a5 as Ce,a6 as _e,a7 as we,a8 as ze,a9 as Se,aa as Ee}from"./index-AIpE8C-f.js";import{C as D,a as P,b as R}from"./card-DRk0nwkp.js";import{R as Me}from"./refresh-cw-DydAoMbT.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-T-NGjlrZ.js","assets/index-B4Ww6089.css"])))=>i.map(i=>d[i]); +import{c as j,u as je,d as ve,_ as ge,f as q,$ as T,r as i,g as o,j as e,E as f,B as t,a0 as te,m as x,k as ne,a1 as ie,T as re,P as be,I as k,l as ye,F as le,a2 as fe,a3 as ke,a4 as Ne,a5 as Ce,a6 as _e,a7 as we,a8 as ze,a9 as Se,aa as Ee}from"./index-T-NGjlrZ.js";import{C as D,a as P,b as R}from"./card-C5ifMTlY.js";import{R as Me}from"./refresh-cw-DXuKsZdS.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. @@ -24,5 +24,5 @@ import{c as j,u as je,d as ve,_ as ge,f as q,$ as T,r as i,g as o,j as e,E as f, * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Re=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],Q=j("UsersRound",Re);function Qe({i:d}){return d.used_by?e.jsx(x,{color:"var(--text-3)",children:"已使用"}):d.valid?e.jsx(x,{color:"var(--success)",children:"可用"}):e.jsx(x,{color:"var(--warning)",children:"已停用"})}function $e(){var Z,J,Y,ee,se,ae;const d=je(),K=ve(),r=ge(),N=q({queryKey:["me-admin"],queryFn:async()=>(await ze(()=>import("./index-AIpE8C-f.js").then(a=>a.aj),__vite__mapDeps([0,1]))).serverMe(r),enabled:!!T()}),m=q({queryKey:["admin-users"],queryFn:()=>Se(r),enabled:!!T()}),C=q({queryKey:["admin-invites"],queryFn:()=>Ee(r),enabled:!!T()}),[O,l]=i.useState(""),[oe,A]=i.useState(null),[xe,_]=i.useState(!1),[v,w]=i.useState(""),[$,z]=i.useState(""),[me,u]=i.useState(null),[S,E]=i.useState(""),[h,ue]=i.useState("all"),[n,g]=i.useState(null),[B,M]=i.useState(""),[he,b]=i.useState(!1),y=()=>{d.invalidateQueries({queryKey:["admin-invites"]})},c=s=>l(s.message||"操作失败"),L=o({mutationFn:()=>we(r),onSuccess:s=>{var a,p;b(!1),l(""),K("success","演示账号已重建:"+(((a=s.seeded)==null?void 0:a.footprints)??0)+" 条记录 + "+(((p=s.seeded)==null?void 0:p.semesters)??0)+" 学期"),d.invalidateQueries({queryKey:["admin-users"]})},onError:c}),V=o({mutationFn:s=>_e(s,r),onSuccess:s=>{d.invalidateQueries({queryKey:["admin-users"]}),g(null),M(""),l(""),K("success","用户「"+s.username+"」及其全部数据已删除")},onError:c}),G=o({mutationFn:()=>fe(5,r),onSuccess:s=>{y(),l(""),navigator.clipboard.writeText(s.codes.join(` + */const Re=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],Q=j("UsersRound",Re);function Qe({i:d}){return d.used_by?e.jsx(x,{color:"var(--text-3)",children:"已使用"}):d.valid?e.jsx(x,{color:"var(--success)",children:"可用"}):e.jsx(x,{color:"var(--warning)",children:"已停用"})}function $e(){var Z,J,Y,ee,se,ae;const d=je(),K=ve(),r=ge(),N=q({queryKey:["me-admin"],queryFn:async()=>(await ze(()=>import("./index-T-NGjlrZ.js").then(a=>a.aj),__vite__mapDeps([0,1]))).serverMe(r),enabled:!!T()}),m=q({queryKey:["admin-users"],queryFn:()=>Se(r),enabled:!!T()}),C=q({queryKey:["admin-invites"],queryFn:()=>Ee(r),enabled:!!T()}),[O,l]=i.useState(""),[oe,A]=i.useState(null),[xe,_]=i.useState(!1),[v,w]=i.useState(""),[$,z]=i.useState(""),[me,u]=i.useState(null),[S,E]=i.useState(""),[h,ue]=i.useState("all"),[n,g]=i.useState(null),[B,M]=i.useState(""),[he,b]=i.useState(!1),y=()=>{d.invalidateQueries({queryKey:["admin-invites"]})},c=s=>l(s.message||"操作失败"),L=o({mutationFn:()=>we(r),onSuccess:s=>{var a,p;b(!1),l(""),K("success","演示账号已重建:"+(((a=s.seeded)==null?void 0:a.footprints)??0)+" 条记录 + "+(((p=s.seeded)==null?void 0:p.semesters)??0)+" 学期"),d.invalidateQueries({queryKey:["admin-users"]})},onError:c}),V=o({mutationFn:s=>_e(s,r),onSuccess:s=>{d.invalidateQueries({queryKey:["admin-users"]}),g(null),M(""),l(""),K("success","用户「"+s.username+"」及其全部数据已删除")},onError:c}),G=o({mutationFn:()=>fe(5,r),onSuccess:s=>{y(),l(""),navigator.clipboard.writeText(s.codes.join(` `)).catch(()=>{})},onError:c}),F=o({mutationFn:()=>ke(v.trim(),$.trim(),r),onSuccess:()=>{y(),_(!1),w(""),z(""),l("")},onError:c}),I=o({mutationFn:s=>Ne(s.id,s.patch,r),onSuccess:()=>{y(),u(null),l("")},onError:c}),pe=o({mutationFn:s=>Ce(s,r),onSuccess:()=>{y(),l("")},onError:c}),H=i.useMemo(()=>{var s;return((s=C.data)==null?void 0:s.invites)??[]},[C.data]),W=((Z=m.data)==null?void 0:Z.users)??[],X=i.useMemo(()=>H.filter(s=>h==="valid"?s.valid&&!s.used_by:h==="used"?!!s.used_by:h==="disabled"?!s.valid&&!s.used_by:!0),[H,h]);if(N.data&&!N.data.is_admin)return e.jsx(f,{title:"需要管理员账号",description:"当前登录账号不是管理员。"});const U=s=>{navigator.clipboard.writeText(s.code),A(s.id),setTimeout(()=>A(a=>a===s.id?null:a),1500)};return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"管理"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(t,{variant:"secondary",onClick:()=>b(!0),children:[e.jsx(Q,{size:13})," 重建演示账号"]}),e.jsxs(t,{variant:"secondary",onClick:()=>{d.invalidateQueries()},children:[e.jsx(Me,{size:13})," 刷新"]})]})]}),O&&e.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-md border border-danger/30 bg-danger-subtle px-3 py-2 text-[12px] text-danger",children:[e.jsx("span",{children:O}),e.jsx("button",{className:"rounded p-0.5 hover:bg-surface-3",onClick:()=>l(""),"aria-label":"关闭",children:e.jsx(te,{size:13})})]}),e.jsxs(D,{children:[e.jsx(P,{title:"用户管理("+(((J=m.data)==null?void 0:J.total)??0)+")",extra:e.jsx(Q,{size:14,className:"text-ink-3"})}),e.jsx(R,{className:"p-0",children:e.jsxs("div",{className:"divide-y divide-line",children:[(((Y=m.data)==null?void 0:Y.users)??[]).map(s=>{var p;const a=String(s.id)===String(((p=N.data)==null?void 0:p.user_id)??"");return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-[13px] font-medium text-ink-1",children:s.username}),s.is_admin&&e.jsx(x,{color:"var(--brand-text)",children:"管理员"}),a&&e.jsx(x,{color:"var(--text-3)",children:"当前登录"})]}),e.jsxs("div",{className:"num mt-0.5 text-[11px] text-ink-3",children:[ne(s.created_at)," · 记录 ",s.records," · 附件 ",s.attachments,"(",ie(s.attachment_bytes||0),")"]})]}),!a&&e.jsxs(t,{size:"sm",variant:"ghost",className:"text-danger hover:bg-danger-subtle",onClick:()=>{g({id:s.id,username:s.username}),M("")},children:[e.jsx(re,{size:13})," 删除"]})]},s.id)}),!(((ee=m.data)==null?void 0:ee.users)??[]).length&&e.jsx(f,{title:"暂无用户"})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[e.jsxs(D,{children:[e.jsx(P,{title:"邀请码("+(((se=C.data)==null?void 0:se.total)??0)+")",extra:e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(t,{size:"sm",variant:"secondary",onClick:()=>{_(s=>!s),l("")},children:[e.jsx(be,{size:13})," 新建"]}),e.jsx(t,{size:"sm",variant:"primary",disabled:G.isPending,onClick:()=>G.mutate(),children:"批量生成 5 个"})]})}),e.jsxs(R,{className:"p-0",children:[xe&&e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b border-line bg-surface-2 px-4 py-3",children:[e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"邀请码(4-32 位字母数字-_)"}),e.jsx(k,{className:"w-[210px]",value:v,placeholder:"如 XIONG-2025",onChange:s=>w(s.target.value)})]}),e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"备注(可选)"}),e.jsx(k,{className:"w-[180px]",value:$,placeholder:"发给谁 / 用途",onChange:s=>z(s.target.value),onKeyDown:s=>{s.key==="Enter"&&v.trim()&&F.mutate()}})]}),e.jsxs("div",{className:"flex gap-1.5 pb-0.5",children:[e.jsx(t,{size:"sm",variant:"primary",disabled:!v.trim()||F.isPending,onClick:()=>F.mutate(),children:"创建"}),e.jsx(t,{size:"sm",variant:"ghost",onClick:()=>{_(!1),w(""),z("")},children:"取消"})]})]}),e.jsx("div",{className:"flex gap-1 border-b border-line px-4 py-2 text-[12px]",children:[["all","全部"],["valid","可用"],["used","已使用"],["disabled","已停用"]].map(([s,a])=>e.jsx("button",{className:"rounded-md px-2.5 py-1 transition-colors "+(h===s?"bg-brand-subtle font-medium text-brand-text":"text-ink-3 hover:bg-surface-3"),onClick:()=>ue(s),children:a},s))}),X.length?e.jsx("div",{className:"divide-y divide-line max-h-[430px] overflow-y-auto",children:X.map(s=>e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 text-[12.5px]",children:[e.jsx("button",{className:"num shrink-0 cursor-pointer rounded-sm bg-surface-3 px-1.5 py-0.5 font-mono text-[12px] text-ink-1 transition-colors hover:bg-brand-subtle hover:text-brand-text",title:"点击复制",onClick:()=>U(s),children:oe===s.id?e.jsxs("span",{className:"inline-flex items-center gap-1 text-success",children:[e.jsx(de,{size:11}),"已复制"]}):s.code}),e.jsx(Qe,{i:s}),me===s.id?e.jsxs("span",{className:"ml-1 flex min-w-0 flex-1 items-center gap-1",children:[e.jsx(k,{className:"h-7 flex-1 text-[12px]",value:S,autoFocus:!0,placeholder:"备注(64 字以内)",onChange:a=>E(a.target.value),onKeyDown:a=>{a.key==="Enter"&&I.mutate({id:s.id,patch:{remark:S}}),a.key==="Escape"&&u(null)}}),e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"保存备注",className:"text-success",onClick:()=>I.mutate({id:s.id,patch:{remark:S}}),children:e.jsx(de,{size:13})}),e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"取消",className:"text-ink-3",onClick:()=>u(null),children:e.jsx(te,{size:13})})]}):e.jsx("button",{className:"min-w-0 flex-1 truncate text-left text-[12px] text-ink-3 hover:text-ink-2",title:s.remark?"点击编辑备注":s.created_by_name?"由 "+s.created_by_name+" 创建 · 点击添加备注":"点击添加备注",onClick:()=>{u(s.id),E(s.remark??"")},children:s.remark||(s.created_by_name?"由 "+s.created_by_name+" 创建":e.jsx("span",{className:"opacity-60",children:"添加备注…"}))}),s.used_by_name&&e.jsxs("span",{className:"shrink-0 text-ink-3",children:["被 ",s.used_by_name," 使用于 ",ne(s.used_at)]}),e.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"复制",className:"text-ink-3",onClick:()=>U(s),children:e.jsx(qe,{size:13})}),!s.used_by&&e.jsxs(e.Fragment,{children:[e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"编辑备注",className:"text-ink-3",onClick:()=>{u(s.id),E(s.remark??"")},children:e.jsx(ye,{size:13})}),e.jsx(t,{size:"sm",variant:"ghost",className:s.valid?"text-ink-3 hover:text-warning":"text-ink-3 hover:text-success",onClick:()=>I.mutate({id:s.id,patch:{valid:!s.valid}}),children:s.valid?"停用":"启用"})]}),e.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"删除",className:"text-ink-3 hover:text-danger",onClick:()=>{window.confirm("删除邀请码 "+s.code+"?此操作不可恢复。")&&pe.mutate(s.id)},children:e.jsx(re,{size:13})})]})]},s.id))}):e.jsx(f,{icon:e.jsx(De,{size:32,strokeWidth:1.5}),title:"暂无符合条件的邀请码",description:"新建自定义邀请码,或批量生成后发给需要注册的用户。"})]})]}),e.jsxs(D,{children:[e.jsx(P,{title:"用户("+(((ae=m.data)==null?void 0:ae.total)??0)+")"}),e.jsx(R,{className:"p-0",children:W.length?e.jsx("div",{className:"divide-y divide-line max-h-[520px] overflow-y-auto",children:W.map(s=>e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 text-[12.5px]",children:[e.jsx("span",{className:"font-medium text-ink-1",children:s.username}),s.is_admin&&e.jsx(x,{color:"var(--brand-text)",children:"管理员"}),e.jsxs("span",{className:"num ml-auto text-ink-3",children:[s.devices," 设备 · ",s.records," 记录 · ",ie(s.attachment_bytes)]})]},s.id))}):e.jsx(f,{icon:e.jsx(Q,{size:32,strokeWidth:1.5}),title:"暂无用户"})})]})]}),e.jsx(le,{open:!!n,onClose:()=>g(null),width:460,title:"删除用户(高危操作)",footer:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"ghost",onClick:()=>g(null),children:"取消"}),e.jsxs(t,{variant:"primary",className:"!bg-danger !text-white",disabled:B!==(n==null?void 0:n.username)||V.isPending,onClick:()=>n&&V.mutate(n.id),children:[e.jsx(ce,{size:13})," 永久删除"]})]}),children:e.jsxs("div",{className:"flex flex-col gap-3 text-[12.5px]",children:[e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-danger/30 bg-danger-subtle px-3 py-2.5 text-danger",children:[e.jsx(ce,{size:15,className:"mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("b",{children:"此操作不可撤销!"}),"将永久删除用户「",n==null?void 0:n.username,"」的全部数据:",e.jsxs("ul",{className:"mt-1 list-disc pl-4 text-[12px] leading-relaxed",children:[e.jsx("li",{children:"账号与登录会话(所有设备将被登出)"}),e.jsx("li",{children:"全部记录、成绩、维度与统计数据"}),e.jsx("li",{children:"全部附件文件(服务器本地与图床 COS 上的副本)"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 text-ink-2",children:["请输入用户名 ",e.jsx("b",{className:"text-danger",children:n==null?void 0:n.username})," 以确认:"]}),e.jsx(k,{value:B,onChange:s=>M(s.target.value),placeholder:(n==null?void 0:n.username)??"",autoFocus:!0})]})]})}),e.jsx(le,{open:he,onClose:()=>b(!1),width:440,title:"重建演示账号",footer:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"ghost",onClick:()=>b(!1),children:"取消"}),e.jsx(t,{variant:"primary",disabled:L.isPending,onClick:()=>L.mutate(),children:"重建并重新播种"})]}),children:e.jsxs("div",{className:"text-[12.5px] leading-relaxed text-ink-2",children:["将",e.jsx("b",{children:"删除现有 demo 账号及其全部数据"}),",然后重新创建并播种全套虚拟演示数据 (个人信息档案、16 条足迹、4 学期成绩、简历内容)。",e.jsx("div",{className:"mt-2 text-ink-3",children:"demo / demo1234 · 仅影响演示账号,其他用户不受影响。"})]})})]})}export{$e as AdminPage}; diff --git a/sync-server/www/assets/DashboardPage-BQmjPh_R.js b/sync-server/www/assets/DashboardPage-D4LhDSa-.js similarity index 94% rename from sync-server/www/assets/DashboardPage-BQmjPh_R.js rename to sync-server/www/assets/DashboardPage-D4LhDSa-.js index ba1bee4..5a31860 100644 --- a/sync-server/www/assets/DashboardPage-BQmjPh_R.js +++ b/sync-server/www/assets/DashboardPage-D4LhDSa-.js @@ -1 +1 @@ -import{r as g,f as v,j as t,S as j,t as S}from"./index-AIpE8C-f.js";import{C as c,a as d,b as x}from"./card-DRk0nwkp.js";import{u as N,i as u,a as m}from"./useChart-BPFULpBT.js";import{u as k,i as w,a as C,b as L,c as R,d as $,e as z,f as T}from"./echarts-BIWefrIc.js";k([w,C,L,R,$,z,T]);function q(){const[l,n]=g.useState(""),i=N(),e=v({queryKey:["stats",l||void 0],queryFn:()=>S(l?Number(l):void 0)}).data,p=u("2"),r=u("3"),h=m(()=>({grid:{left:34,right:12,top:14,bottom:24},tooltip:{trigger:"axis"},xAxis:{type:"category",data:(e==null?void 0:e.monthly.map(a=>a.ym.slice(2)))??[],axisLine:{lineStyle:{color:r}},axisTick:{show:!1},axisLabel:{color:r,fontSize:10}},yAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},series:[{type:"bar",data:(e==null?void 0:e.monthly.map(a=>a.count))??[],barMaxWidth:18,itemStyle:{color:"#3056d3",borderRadius:[3,3,0,0]}}]}),[e,i]),b=m(()=>{const a=((e==null?void 0:e.by_type)??[]).filter(s=>s.count>0);return{tooltip:{trigger:"item"},legend:{orient:"vertical",right:4,top:"middle",textStyle:{color:p,fontSize:11},itemWidth:10,itemHeight:10},series:[{type:"pie",radius:["48%","72%"],center:["34%","50%"],label:{show:!1},data:a.map(s=>({name:s.label,value:s.count,itemStyle:{color:s.color||"#64748b"}}))}]}},[e,i]),y=m(()=>{const a=((e==null?void 0:e.by_level)??[]).filter(s=>s.count>0).slice().reverse();return{grid:{left:64,right:24,top:8,bottom:22},tooltip:{trigger:"axis"},xAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},yAxis:{type:"category",data:a.map(s=>s.label),axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:p,fontSize:11}},series:[{type:"bar",data:a.map(s=>({value:s.count,itemStyle:{color:s.color||"#3056d3",borderRadius:[0,3,3,0]}})),barMaxWidth:14}]}},[e,i]),f=((e==null?void 0:e.metrics)??[]).slice(0,3);return t.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[t.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-wrap gap-3",children:[t.jsx(o,{label:"总记录",value:(e==null?void 0:e.total)??0}),t.jsx(o,{label:l?l+" 年新增":"本年新增",value:(e==null?void 0:e.total_this_year)??0}),t.jsx(o,{label:"附件总数",value:(e==null?void 0:e.attachment_total)??0}),f.map(a=>t.jsx(o,{label:a.label,value:a.value,unit:a.unit??""},a.key))]}),t.jsx(j,{className:"w-[120px]",value:l,onChange:a=>n(a.target.value),options:[{value:"",label:"全部年份"},...((e==null?void 0:e.years)??[]).map(a=>({value:String(a),label:a+" 年"}))]})]}),!(e!=null&&e.metrics.length)&&t.jsx("div",{className:"mb-4 rounded-md border border-dashed border-line px-4 py-2 text-[12px] text-ink-3",children:"提示:在「统计」配置中注册指标(如志愿时长、读书本数),带单位的数值字段即可在此量化展示。"}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs(c,{children:[t.jsx(d,{title:"近 12 个月活跃度"}),t.jsx(x,{children:t.jsx("div",{ref:h,className:"h-[220px]"})})]}),t.jsxs(c,{children:[t.jsx(d,{title:"类型分布"}),t.jsx(x,{children:t.jsx("div",{ref:b,className:"h-[220px]"})})]}),t.jsxs(c,{className:"lg:col-span-2",children:[t.jsx(d,{title:"级别分布"}),t.jsx(x,{children:t.jsx("div",{ref:y,className:"h-[200px]"})})]})]})]})}function o({label:l,value:n,unit:i}){return t.jsxs("div",{className:"min-w-[120px] rounded-lg border border-line bg-surface px-4 py-3 shadow-card",children:[t.jsx("div",{className:"text-[12px] text-ink-3",children:l}),t.jsxs("div",{className:"num mt-0.5 text-[22px] font-semibold leading-tight text-ink-1",children:[n,i&&t.jsx("span",{className:"ml-1 text-[12px] font-normal text-ink-3",children:i})]})]})}export{q as DashboardPage}; +import{r as g,f as v,j as t,S as j,t as S}from"./index-T-NGjlrZ.js";import{C as c,a as d,b as x}from"./card-C5ifMTlY.js";import{u as N,i as u,a as m}from"./useChart-dAkYJqaV.js";import{u as k,i as w,a as C,b as L,c as R,d as $,e as z,f as T}from"./echarts-BIWefrIc.js";k([w,C,L,R,$,z,T]);function q(){const[l,n]=g.useState(""),i=N(),e=v({queryKey:["stats",l||void 0],queryFn:()=>S(l?Number(l):void 0)}).data,p=u("2"),r=u("3"),h=m(()=>({grid:{left:34,right:12,top:14,bottom:24},tooltip:{trigger:"axis"},xAxis:{type:"category",data:(e==null?void 0:e.monthly.map(a=>a.ym.slice(2)))??[],axisLine:{lineStyle:{color:r}},axisTick:{show:!1},axisLabel:{color:r,fontSize:10}},yAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},series:[{type:"bar",data:(e==null?void 0:e.monthly.map(a=>a.count))??[],barMaxWidth:18,itemStyle:{color:"#3056d3",borderRadius:[3,3,0,0]}}]}),[e,i]),b=m(()=>{const a=((e==null?void 0:e.by_type)??[]).filter(s=>s.count>0);return{tooltip:{trigger:"item"},legend:{orient:"vertical",right:4,top:"middle",textStyle:{color:p,fontSize:11},itemWidth:10,itemHeight:10},series:[{type:"pie",radius:["48%","72%"],center:["34%","50%"],label:{show:!1},data:a.map(s=>({name:s.label,value:s.count,itemStyle:{color:s.color||"#64748b"}}))}]}},[e,i]),y=m(()=>{const a=((e==null?void 0:e.by_level)??[]).filter(s=>s.count>0).slice().reverse();return{grid:{left:64,right:24,top:8,bottom:22},tooltip:{trigger:"axis"},xAxis:{type:"value",splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:r,fontSize:10}},yAxis:{type:"category",data:a.map(s=>s.label),axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:p,fontSize:11}},series:[{type:"bar",data:a.map(s=>({value:s.count,itemStyle:{color:s.color||"#3056d3",borderRadius:[0,3,3,0]}})),barMaxWidth:14}]}},[e,i]),f=((e==null?void 0:e.metrics)??[]).slice(0,3);return t.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[t.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-wrap gap-3",children:[t.jsx(o,{label:"总记录",value:(e==null?void 0:e.total)??0}),t.jsx(o,{label:l?l+" 年新增":"本年新增",value:(e==null?void 0:e.total_this_year)??0}),t.jsx(o,{label:"附件总数",value:(e==null?void 0:e.attachment_total)??0}),f.map(a=>t.jsx(o,{label:a.label,value:a.value,unit:a.unit??""},a.key))]}),t.jsx(j,{className:"w-[120px]",value:l,onChange:a=>n(a.target.value),options:[{value:"",label:"全部年份"},...((e==null?void 0:e.years)??[]).map(a=>({value:String(a),label:a+" 年"}))]})]}),!(e!=null&&e.metrics.length)&&t.jsx("div",{className:"mb-4 rounded-md border border-dashed border-line px-4 py-2 text-[12px] text-ink-3",children:"提示:在「统计」配置中注册指标(如志愿时长、读书本数),带单位的数值字段即可在此量化展示。"}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs(c,{children:[t.jsx(d,{title:"近 12 个月活跃度"}),t.jsx(x,{children:t.jsx("div",{ref:h,className:"h-[220px]"})})]}),t.jsxs(c,{children:[t.jsx(d,{title:"类型分布"}),t.jsx(x,{children:t.jsx("div",{ref:b,className:"h-[220px]"})})]}),t.jsxs(c,{className:"lg:col-span-2",children:[t.jsx(d,{title:"级别分布"}),t.jsx(x,{children:t.jsx("div",{ref:y,className:"h-[200px]"})})]})]})]})}function o({label:l,value:n,unit:i}){return t.jsxs("div",{className:"min-w-[120px] rounded-lg border border-line bg-surface px-4 py-3 shadow-card",children:[t.jsx("div",{className:"text-[12px] text-ink-3",children:l}),t.jsxs("div",{className:"num mt-0.5 text-[22px] font-semibold leading-tight text-ink-1",children:[n,i&&t.jsx("span",{className:"ml-1 text-[12px] font-normal text-ink-3",children:i})]})]})}export{q as DashboardPage}; diff --git a/sync-server/www/assets/GradesPage-DA15g7rj.js b/sync-server/www/assets/GradesPage-BA4OWO_9.js similarity index 99% rename from sync-server/www/assets/GradesPage-DA15g7rj.js rename to sync-server/www/assets/GradesPage-BA4OWO_9.js index f929753..36f116b 100644 --- a/sync-server/www/assets/GradesPage-DA15g7rj.js +++ b/sync-server/www/assets/GradesPage-BA4OWO_9.js @@ -1,4 +1,4 @@ -import{c as I,f as T,j as e,E as $,w as H,u as N,d as f,r as p,g as b,x as W,y as J,B as j,P as F,C as A,z as U,A as B,D as Y,m as k,l as M,T as _,I as g,F as V,H as w,J as E,K as D}from"./index-AIpE8C-f.js";import{C,a as G,b as q}from"./card-DRk0nwkp.js";import{u as X,i as K,a as P}from"./useChart-BPFULpBT.js";import{u as Z,i as ee,b as se,a as te,c as ae,d as re,e as ne,f as le}from"./echarts-BIWefrIc.js";/** +import{c as I,f as T,j as e,E as $,w as H,u as N,d as f,r as p,g as b,x as W,y as J,B as j,P as F,C as A,z as U,A as B,D as Y,m as k,l as M,T as _,I as g,F as V,H as w,J as E,K as D}from"./index-T-NGjlrZ.js";import{C,a as G,b as q}from"./card-C5ifMTlY.js";import{u as X,i as K,a as P}from"./useChart-dAkYJqaV.js";import{u as Z,i as ee,b as se,a as te,c as ae,d as re,e as ne,f as le}from"./echarts-BIWefrIc.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/ProfilePage-rXdhq-8F.js b/sync-server/www/assets/ProfilePage-TayaPPPy.js similarity index 99% rename from sync-server/www/assets/ProfilePage-rXdhq-8F.js rename to sync-server/www/assets/ProfilePage-TayaPPPy.js index b877b7e..4692873 100644 --- a/sync-server/www/assets/ProfilePage-rXdhq-8F.js +++ b/sync-server/www/assets/ProfilePage-TayaPPPy.js @@ -1,4 +1,4 @@ -import{c as E,u as P,d as S,r as p,f as F,g as q,j as e,B as f,l as B,ab as L,F as z,H as k,S as M,I as Q,ac as _,ad as K,ae as v,af as T}from"./index-AIpE8C-f.js";/** +import{c as E,u as P,d as S,r as p,f as F,g as q,j as e,B as f,l as B,ab as L,F as z,H as k,S as M,I as Q,ac as _,ad as K,ae as v,af as T}from"./index-T-NGjlrZ.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/RecordsPage-C_nMhPms.js b/sync-server/www/assets/RecordsPage-Cw1hR-e8.js similarity index 99% rename from sync-server/www/assets/RecordsPage-C_nMhPms.js rename to sync-server/www/assets/RecordsPage-Cw1hR-e8.js index 8eb2f87..1a13d05 100644 --- a/sync-server/www/assets/RecordsPage-C_nMhPms.js +++ b/sync-server/www/assets/RecordsPage-Cw1hR-e8.js @@ -1,4 +1,4 @@ -import{c as fe,j as e,a as N,r as s,b as he,u as ve,d as ge,e as je,f as L,g as ye,I as be,S as k,B as w,P as Q,h as te,L as se,G as ae,R as Ne,i as ne,k as ke,l as we,T as Ce,E as le,m as Ee,n as Se,o as _e,C as ze,p as qe,q as Le,s as Re,t as De,v as Ie}from"./index-AIpE8C-f.js";/** +import{c as fe,j as e,a as N,r as s,b as he,u as ve,d as ge,e as je,f as L,g as ye,I as be,S as k,B as w,P as Q,h as te,L as se,G as ae,R as Ne,i as ne,k as ke,l as we,T as Ce,E as le,m as Ee,n as Se,o as _e,C as ze,p as qe,q as Le,s as Re,t as De,v as Ie}from"./index-T-NGjlrZ.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/ResumePage-CO3gtN78.js b/sync-server/www/assets/ResumePage-CO3gtN78.js deleted file mode 100644 index cdbd0fb..0000000 --- a/sync-server/www/assets/ResumePage-CO3gtN78.js +++ /dev/null @@ -1,44 +0,0 @@ -import{c as L,d as Ne,f as se,r as T,j as e,B as P,ag as we,ae as K,H as U,S as ne,ac as de,P as $,F as Ce,a8 as Se,T as ie,I as V,af as _e,v as ze}from"./index-AIpE8C-f.js";import{C as ae,a as le,b as re}from"./card-DRk0nwkp.js";import{R as Re}from"./refresh-cw-DydAoMbT.js";/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],me=L("ArrowDown",Pe);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ee=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],xe=L("ArrowUp",Ee);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Te=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Oe=L("ChevronRight",Te);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fe=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Ie=L("GripVertical",Fe);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Le=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],Me=L("PanelRightClose",Le);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const De=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],Ae=L("PanelRightOpen",De);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ke=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Ue=L("Printer",Ke);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Be=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],oe=L("RotateCcw",Be),A=[{key:"info",defaultTitle:"基本信息",kind:"info",fixed:!0},{key:"education",defaultTitle:"教育经历",kind:"edu",fixed:!0},{key:"skills",defaultTitle:"核心技能",kind:"text"},{key:"projects",defaultTitle:"项目经历",kind:"list",types:["竞赛","科研","实习实践"]},{key:"certs",defaultTitle:"证书与荣誉",kind:"list",types:["荣誉惩处","证书技能"]},{key:"campus",defaultTitle:"在校经历",kind:"list",types:["学生工作","志愿公益"]},{key:"activity",defaultTitle:"文体活动",kind:"list",types:["文体活动"]},{key:"other",defaultTitle:"其他经历",kind:"list"},{key:"self",defaultTitle:"自我评价",kind:"text",fixed:!0}],D={skills:{text:`程序设计:熟悉 Python 与 C/C++,掌握常用数据结构与算法,能独立完成中小型工具与脚本开发。 -网络安全:熟悉常见 Web 漏洞原理(SQL 注入、XSS、CSRF 等)与防护方案,掌握 Burp Suite、Nmap、Wireshark 等常用工具。 -网络基础:熟悉 TCP/IP 协议栈与交换路由基础配置,理解 VLAN、NAT、ACL 等核心技术。 -运维基础:熟悉 Linux 常用操作与 Shell 脚本,了解 Docker 容器化部署与 Nginx 服务配置。`},campus:{items:[{title:"校图书馆学生助理",subtitle:"读者服务岗",date:"2024.9 - 2025.6",desc:"负责书库整理与借阅服务,协助开展入馆培训与阅读推广活动,累计服务读者千余人次。培养了责任意识与服务意识,锻炼了多任务时间管理能力。"},{title:"院学生会宣传部干事",subtitle:"平面设计与文案",date:"2023.9 - 2024.6",desc:"参与学院活动的海报设计与推文撰写,负责活动现场的后勤与设备保障。锻炼了审美表达、协作沟通与临场应变能力。"}]},self:{text:"性格沉稳踏实,做事有计划性,习惯提前预判风险并准备预案;学习能力强,能快速上手新技术与工具;责任心强,注重细节与条理,凡事有始有终,能独立推进任务并在压力下保持稳定输出。"}};function q(){return{version:2,template:"tech",accent:"#3056d3",fontScale:1,density:"normal",onePage:!1,sections:A.map(a=>({key:a.key,title:a.defaultTitle,enabled:!0,kind:a.kind,types:a.types,...a.key==="skills"?{text:D.skills.text}:{},...a.key==="campus"?{items:D.campus.items}:{},...a.key==="self"?{text:D.self.text}:{}}))}}function W(a){const f=q();if(!a||typeof a!="object")return f;const h=a,w=Array.isArray(h.sections)?h.sections:[],y=f.sections.map(l=>{var C;const i=w.find(R=>R.key===l.key),_=A.find(R=>R.key===l.key),j={...l,...i??{},enabled:(i==null?void 0:i.enabled)??!0,title:(i==null?void 0:i.title)??(_==null?void 0:_.defaultTitle)??l.title,kind:_?l.kind:(i==null?void 0:i.kind)??l.kind,types:(_==null?void 0:_.types)??(i==null?void 0:i.types)};return l.key==="skills"&&j.text==null&&(j.text=D.skills.text),l.key==="campus"&&!((C=j.items)!=null&&C.length)&&(j.items=D.campus.items),l.key==="self"&&j.text==null&&(j.text=D.self.text),j}),c=new Set(["awards","competition","practice","research"]);for(const l of w)c.has(l.key)||y.some(i=>i.key===l.key)||y.push({key:l.key,title:l.title||l.key,enabled:l.enabled??!0,kind:"text",text:""});return{version:2,template:h.template??"tech",accent:h.accent??"#3056d3",fontScale:Math.min(1.2,Math.max(.8,h.fontScale??1)),density:h.density??"normal",onePage:h.onePage??!1,sections:y}}function He(){return A.filter(a=>a.types).flatMap(a=>a.types)}function We(a){const f=[a.organizer,a.level,a.award_grade].filter(w=>w!=null&&w!=="").map(String).join(" · "),h=[a.result,a.description].filter(w=>w!=null&&w!=="").map(String).join(" — ");return{title:a.title,subtitle:f||void 0,date:a.start_date??a.created_at.slice(0,10),desc:h||void 0,fromRecord:a.id}}function pe(a,f){var c;const h=[],w=He(),y=new Set;for(const l of f.sections){if(!l.enabled)continue;const i=A.find(m=>m.key===l.key);if(l.key==="info"){h.push({key:l.key,title:l.title,kind:"info",hiddenFields:l.hiddenFields??[]});continue}if(l.key==="self"||l.kind==="text"){const m=l.text??"";if(!m.trim())continue;h.push({key:l.key,title:l.title,kind:"text",text:m});continue}const _=new Set(l.excluded??[]);let j=[];const C=i==null?void 0:i.types;C?j=a.filter(m=>C.includes(m.type_name)&&m.status!=="draft"&&!_.has(m.id)&&!y.has(m.id)):j=a.filter(m=>m.status!=="draft"&&!_.has(m.id)&&!y.has(m.id)&&!w.includes(m.type_name));const R=new Map((l.itemOrder??[]).map((m,v)=>[m,v])),k=[];for(const m of j){const v={itemKey:"r"+m.id,...We(m),...((c=l.overrides)==null?void 0:c[String(m.id)])??{}};k.push({...v,_ord:R.get(v.itemKey)??9999}),y.add(m.id)}for(const m of l.items??[]){const v=m.id??"c"+(l.items??[]).indexOf(m);k.push({itemKey:v,...m,_ord:R.get(v)??9999})}k.sort((m,v)=>m._ord-v._ord||(v.date??"").localeCompare(m.date??"")),k.length&&h.push({key:l.key,title:l.title,kind:"list",items:k.map(m=>{const{_ord:v,...d}=m;return d})})}return h}const he=[{key:"tech",name:"互联网技术风",desc:"品牌色标题 + 左侧色条,紧凑现代"},{key:"minimal",name:"极简风",desc:"灰色大写字距标题,大量留白"},{key:"classic",name:"经典风",desc:"黑色衬线标题 + 通栏分隔线,正式通用"}],ue=["#3056d3","#0f766e","#7c3aed","#c2410c","#0e7490","#1f2937"],z=a=>String(a??"").replace(/&/g,"&").replace(//g,">");function qe(a,f,h,w){var F,s,x;const y=h.fontScale,c=o=>(o*y).toFixed(1)+"pt",l=h.accent,i=f,_={classic:"font-size:"+c(14)+";color:#111;border-bottom:1.5pt solid #333;padding-bottom:3pt;margin:14pt 0 7pt",tech:"font-size:"+c(14)+";color:"+l+";border-bottom:1pt solid "+l+";padding-bottom:3pt;margin:14pt 0 7pt",minimal:"font-size:"+c(11.5)+";color:#555;letter-spacing:1.5pt;text-transform:uppercase;border-bottom:0.75pt solid #e0e0e0;padding-bottom:3pt;margin:14pt 0 7pt"},j=h.template==="tech"?l:"#111",C=[i.school,i.college,i.major,i.degree].filter(o=>o!=="").map(o=>z(o)).join(" · "),R=[i.phone,i.email,i.homepage].filter(o=>o!=="").map(o=>z(o)).join(" · "),k=(((F=h.header)==null?void 0:F.showPhoto)??!0)&&w&&i.photoUrl?'':"",m=''+z(i.name||"个人简历")+""+((((s=h.header)==null?void 0:s.showSchool)??!0)&&C?''+C+"":"")+((((x=h.header)==null?void 0:x.showContact)??!0)&&R?''+R+"":"")+""+k+"",v=o=>''+z(o.title)+''+z(o.date??"")+""+(o.subtitle?''+z(o.subtitle)+"":"")+(o.desc?''+z(o.desc)+"":""),d=a.map(o=>{let S="";if(o.kind==="edu"){const M=[["学校",i.school??""],["专业",i.major??""],["学制",i.eduLength??""],["学历",i.degree??""],["入学",i.eduStart??""],["毕业",i.eduEnd??""]].filter(b=>b[1]!=="");S=''+M.map(b=>''+z(b[0])+''+z(b[1])+"").join("")+""+(i.majorCourses?'主修课程:'+z(i.majorCourses)+"":"")}else if(o.kind==="info"){const M=[["name","姓名",i.name??""],["gender","性别",i.gender??""],["birth","出生年月",i.birth??""],["nation","民族",i.nation??""],["native","籍贯",i.native??""],["political","政治面貌",i.political??""],["className","班级",i.className??""],["studentId","学号",i.studentId??""],["degree","学历",i.degree??""],["phone","手机",i.phone??""],["email","邮箱",i.email??""]].filter(b=>b[2]!==""&&!(o.hiddenFields??[]).includes(b[0]));S=''+M.map((b,I)=>(I%2===0?"":"")+''+z(b[1])+''+z(b[2])+""+(I%2===1?"":"")).join("")+""}else o.kind==="list"?S=""+(o.items??[]).map(v).join("")+"":S=''+z(o.text??"").replace(/\n/g,"")+"";return''+z(o.title)+""+S}).join("");return''+z(i.name||"个人简历")+''+m+d+""}const Ve=Object.freeze(Object.defineProperty({__proto__:null,ACCENT_CHOICES:ue,RESUME_SECTION_DEFS:A,TEMPLATES:he,assembleSections:pe,defaultResumeConfig:q,migrateResumeConfig:W,resumeToWordHtml:qe},Symbol.toStringTag,{value:"Module"})),$e={姓名:"name",性别:"gender",出生年月:"birth",民族:"nation",籍贯:"native",政治面貌:"political",班级:"className",学号:"studentId",手机:"phone",邮箱:"email"},Ge=[["name","姓名"],["gender","性别"],["birth","出生年月"],["nation","民族"],["native","籍贯"],["political","政治面貌"],["className","班级"],["studentId","学号"],["phone","手机"],["email","邮箱"]];function ce(a){const f=/^(\d{4})-(\d{1,2})/.exec(a??"");return f?f[1]+"."+Number(f[2]):a??""}function O({html:a,onCommit:f,className:h}){const w=a.replace(/&/g,"&").replace(//g,">");return e.jsx("span",{contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,className:"outline-none break-words rounded-sm transition-shadow focus:shadow-[0_0_0_1.5px_rgba(48,86,211,0.5)] cursor-text "+(h??""),dangerouslySetInnerHTML:{__html:w},onBlur:y=>{const c=(y.currentTarget.textContent??"").trim();c!==a&&f(c)}})}function Xe(){var J,Y,Z,X,ee,te;const a=Ne(),f=se({queryKey:["profile"],queryFn:_e}),h=se({queryKey:["resume-records"],queryFn:()=>ze({page:1,page_size:500})}),[w,y]=T.useState(null),[c,l]=T.useState(""),[i,_]=T.useState(!0),[j,C]=T.useState(new Set),[R,k]=T.useState(1),m=T.useRef(null),v=T.useRef(null);T.useEffect(()=>{var r,n;const t=(r=f.data)==null?void 0:r.content;t&&(y(W(t.resume)),l(((n=t.info)==null?void 0:n.selfIntro)??""))},[f.data]);const d={...((Y=(J=f.data)==null?void 0:J.content)==null?void 0:Y.info)??{}},F=((Z=h.data)==null?void 0:Z.items)??[],s=w??q(),x={...d,selfIntro:c},o=[ce(d.eduStart),ce(d.eduEnd)].filter(Boolean).join("-"),S=T.useMemo(()=>pe(F,s),[F,s]),M=(t,r)=>y(n=>{if(!n)return n;const u=[...n.sections],N=t+r;return N<0||N>=u.length?n:([u[t],u[N]]=[u[N],u[t]],{...n,sections:u})}),b=t=>{y(t),K({info:{...d,selfIntro:c},resume:t}).catch(r=>a("error",r.message))},I=t=>{y(r=>{const n=r??s,u=n.sections.map(p=>{var g;if(p.key!==t.secKey)return p;if(t.field==="text")return{...p,text:t.value};if(t.fromRecord!=null){const E={...((g=p.overrides)==null?void 0:g[t.fromRecord])??{},[t.field]:t.value};return{...p,overrides:{...p.overrides??{},[t.fromRecord]:E}}}if(t.itemIdx!=null&&p.items){const E=[...p.items];return E[t.itemIdx]={...E[t.itemIdx],[t.field]:t.value},{...p,items:E}}return p}),N={...n,sections:u};return K({info:{...d,selfIntro:c},resume:N}).catch(p=>a("error",p.message)),N})},B=(t,r)=>{K({info:{...x,[t]:r}}).then(()=>f.refetch()).catch(n=>a("error",n.message))};T.useEffect(()=>{if(!s.onePage){k(1);return}const t=m.current;if(!t)return;const r=1043,n=t.scrollHeight;k(n>r?Math.max(.7,r/n):1)},[s.onePage,s.fontScale,s.density,S]);const G=s.fontScale*(s.onePage?R:1),fe=()=>{Se(()=>Promise.resolve().then(()=>Ve),void 0).then(function(t){const r=t.resumeToWordHtml(S,x,s,d.photoUrl),n=new Blob(["\uFEFF"+r],{type:"application/msword"}),u=URL.createObjectURL(n),N=document.createElement("a");N.href=u,N.download=(d.name||"个人简历")+".doc",N.click(),setTimeout(()=>URL.revokeObjectURL(u),6e4),a("success","Word 文档已导出")})},Q=t=>{const r="custom_"+Date.now();b({...s,sections:[...s.sections,t==="text"?{key:r,title:"自定义板块",enabled:!0,kind:"text",text:""}:{key:r,title:"自定义经历",enabled:!0,kind:"list",items:[]}]}),C(n=>new Set(n).add(r))},ge=t=>{var r,n;return((n=(r=A.find(u=>u.key===t))==null?void 0:r.types)==null?void 0:n.join(" / "))??"固定板块"},[ye,H]=T.useState(!1),be=()=>{const t=q();y(t),C(new Set),K({info:{...d,selfIntro:c},resume:t}).then(()=>f.refetch()).then(()=>{H(!1),a("success","简历已初始化为默认模板")}).catch(r=>a("error",r.message))},je=async()=>{var t,r;try{const[n]=await Promise.all([f.refetch(),h.refetch()]),u=(t=n.data)==null?void 0:t.content;u&&(y(W(u.resume)),l(((r=u.info)==null?void 0:r.selfIntro)??"")),a("success","已重新载入最新数据")}catch(n){a("error",n.message)}},ke=()=>{const t=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download="简历配置.json",n.click(),setTimeout(()=>URL.revokeObjectURL(r),6e4),a("success","简历配置已导出")},ve=t=>{t&&t.text().then(r=>{try{const n=W(JSON.parse(r));b(n),a("success","配置已导入")}catch{a("error","配置文件格式不正确")}})};return e.jsxs("div",{className:"mx-auto max-w-[1280px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"no-print mb-4 flex flex-wrap items-center justify-between gap-2",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"我的简历"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(P,{variant:"secondary",onClick:()=>_(t=>!t),children:[i?e.jsx(Me,{size:13}):e.jsx(Ae,{size:13}),i?"收起设置":"展开设置"]}),e.jsxs(P,{variant:"secondary",onClick:()=>void je(),children:[e.jsx(Re,{size:13})," 重新载入"]}),e.jsxs(P,{variant:"ghost",className:"text-danger hover:bg-danger-subtle",onClick:()=>H(!0),children:[e.jsx(oe,{size:13})," 初始化简历"]}),e.jsxs(P,{variant:"secondary",onClick:fe,children:[e.jsx(we,{size:13})," 导出 Word"]}),e.jsxs(P,{variant:"primary",onClick:()=>window.print(),children:[e.jsx(Ue,{size:13})," 打印 / PDF"]})]})]}),e.jsxs("div",{className:"grid gap-4 "+(i?"lg:grid-cols-[1fr_340px]":"grid-cols-1"),children:[e.jsxs("div",{children:[e.jsx("div",{className:"print-sheet mx-auto w-full max-w-[794px] rounded-lg border border-line bg-white shadow-card",style:{minHeight:s.onePage?1123:void 0},children:e.jsxs("div",{ref:m,className:"min-w-0 overflow-x-hidden p-5 sm:p-10 resume-tpl-"+s.template,style:{zoom:G,"--accent":s.accent},children:[e.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4 sm:gap-6",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h1",{className:"text-[26px] font-bold leading-tight "+(s.template==="tech"?"text-[var(--accent)]":"text-neutral-900"),children:d.name||"姓名"}),(((X=s.header)==null?void 0:X.showSchool)??!0)&&e.jsx("div",{className:"mt-1.5 text-[12.5px] text-neutral-500",children:[d.school,d.college,d.major,d.degree].filter(Boolean).join(" · ")||"完善个人信息后自动展示"}),(((ee=s.header)==null?void 0:ee.showContact)??!0)&&e.jsx("div",{className:"mt-1 text-[12px] text-neutral-500",children:[d.phone,d.email,d.homepage].filter(Boolean).join(" · ")})]}),(((te=s.header)==null?void 0:te.showPhoto)??!0)&&d.photoUrl&&e.jsx("img",{src:d.photoUrl,alt:"证件照",className:"h-[110px] w-[82px] rounded border border-neutral-200 object-cover"})]}),S.map(t=>{var r;return e.jsxs("div",{className:"mb-5 r-sec",children:[e.jsx("div",{className:"r-sec-title mb-2.5 text-[14px] font-bold text-neutral-900",children:e.jsx(O,{html:t.title,onCommit:n=>I({secKey:t.key,field:"title",value:n})})}),t.kind==="edu"?e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-0.5 text-[13px]",children:[e.jsx("span",{className:"num shrink-0 text-neutral-500",children:e.jsx(O,{html:o,onCommit:n=>{const u=/(\d{4})\.(\d{1,2})\s*[-—~至]\s*(\d{4})\.(\d{1,2})/.exec(n);if(!u){a("error","时间格式:2023.9-2027.6");return}K({info:{...x,eduStart:u[1]+"-"+u[2].padStart(2,"0"),eduEnd:u[3]+"-"+u[4].padStart(2,"0")}}).then(()=>f.refetch()).catch(N=>a("error",N.message))}})}),e.jsx("span",{className:"min-w-0 font-semibold text-neutral-900",children:e.jsx(O,{html:d.school??"",onCommit:n=>B("school",n)})}),e.jsxs("span",{className:"shrink-0 text-neutral-600",children:[e.jsx(O,{html:d.major??"",onCommit:n=>B("major",n)}),d.degree?e.jsxs("span",{children:[" | ",e.jsx(O,{html:d.degree,onCommit:n=>B("degree",n)})]}):null]})]}),d.majorCourses&&e.jsxs("p",{className:"mt-1.5 text-[12px] leading-relaxed text-justify text-neutral-700",children:[e.jsx("b",{children:"主修课程:"}),e.jsx(O,{html:d.majorCourses,onCommit:n=>B("majorCourses",n)})]})]}):t.kind==="info"?e.jsx("div",{className:"grid grid-cols-1 gap-x-8 gap-y-1 text-[12.5px] sm:grid-cols-2",children:[["姓名",d.name],["性别",d.gender],["出生年月",d.birth],["民族",d.nation],["籍贯",d.native],["政治面貌",d.political],["班级",d.className],["学号",d.studentId],["手机",d.phone],["邮箱",d.email]].filter(n=>n[1]&&!(t.hiddenFields??[]).includes($e[n[0]])).map(n=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"w-16 shrink-0 text-neutral-500",children:n[0]}),e.jsx("span",{children:n[1]})]},n[0]))}):t.kind==="text"?e.jsx("p",{className:"whitespace-pre-wrap text-justify text-neutral-700 "+(s.density==="compact"?"":"leading-relaxed"),children:e.jsx(O,{html:t.text??"",onCommit:n=>I({secKey:t.key,field:"text",value:n})})}):e.jsx("div",{className:s.density==="compact"?"flex flex-col gap-1.5":"flex flex-col gap-3",children:(r=t.items)==null?void 0:r.map((n,u)=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-[13px] font-semibold text-neutral-900 r-item-title",children:e.jsx(O,{html:n.title,onCommit:N=>I({secKey:t.key,field:"title",value:N,itemIdx:u,fromRecord:n.fromRecord})})}),e.jsx("span",{className:"num shrink-0 text-[11.5px] text-neutral-500",children:e.jsx(O,{html:n.date??"",onCommit:N=>I({secKey:t.key,field:"date",value:N,itemIdx:u,fromRecord:n.fromRecord})})})]}),n.subtitle&&e.jsx("div",{className:"text-[12px] text-neutral-600",children:n.subtitle}),n.desc&&e.jsx("p",{className:"text-justify text-[12px] text-neutral-500 "+(s.density==="compact"?"":"mt-0.5"),children:e.jsx(O,{html:n.desc,onCommit:N=>I({secKey:t.key,field:"desc",value:N,itemIdx:u,fromRecord:n.fromRecord})})})]},n.itemKey??(n.title??"")+u))})]},t.key)})]})}),s.onePage&&e.jsxs("div",{className:"no-print mt-2 text-center text-[11.5px] text-ink-3",children:["一页限定已启用:内容自动缩放 ",Math.round(G*100),"% 以适配单页 A4"]})]}),i&&e.jsxs("div",{className:"no-print flex flex-col gap-4 lg:sticky lg:top-4 lg:max-h-[calc(100vh-2rem)] lg:self-start lg:overflow-y-auto lg:pr-1",children:[e.jsxs(ae,{children:[e.jsx(le,{title:"模板与风格"}),e.jsxs(re,{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"grid grid-cols-1 gap-2",children:he.map(t=>e.jsxs("button",{className:"rounded-md border px-3 py-2 text-left transition-all "+(s.template===t.key?"border-brand bg-brand-subtle":"border-line bg-surface hover:border-line-strong"),onClick:()=>b({...s,template:t.key}),children:[e.jsx("div",{className:"text-[12.5px] font-semibold "+(s.template===t.key?"text-brand-text":"text-ink-1"),children:t.name}),e.jsx("div",{className:"text-[11px] text-ink-3",children:t.desc})]},t.key))}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(U,{label:"主题色",children:e.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:ue.map(t=>e.jsx("button",{"aria-label":"主题色 "+t,className:"size-5 rounded-full border-2 transition-transform "+(s.accent===t?"scale-110 border-ink-1":"border-transparent"),style:{backgroundColor:t},onClick:()=>b({...s,accent:t})},t))})}),e.jsx(U,{label:"字号",children:e.jsx(ne,{value:String(s.fontScale),onChange:t=>b({...s,fontScale:Number(t.target.value)}),options:[{value:"0.9",label:"小"},{value:"1",label:"标准"},{value:"1.1",label:"大"}]})})]}),e.jsx(U,{label:"头部布局",children:e.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:[["showPhoto","证件照"],["showContact","联系行"],["showSchool","学校行"]].map(t=>{var n;const r=((n=s.header)==null?void 0:n[t[0]])??!0;return e.jsx("button",{className:"rounded-md border px-2.5 py-1 text-[11.5px] transition-colors "+(r?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-3"),onClick:()=>b({...s,header:{...s.header,[t[0]]:!r}}),children:t[1]},t[0])})})}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(U,{label:"间距",children:e.jsx(ne,{value:s.density,onChange:t=>b({...s,density:t.target.value}),options:[{value:"compact",label:"紧凑"},{value:"normal",label:"标准"},{value:"relaxed",label:"宽松"}]})}),e.jsx(U,{label:"单页限定",children:e.jsx("button",{className:"flex h-9 w-full items-center justify-center gap-1.5 rounded-md border text-[12px] transition-colors "+(s.onePage?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2"),onClick:()=>b({...s,onePage:!s.onePage}),children:s.onePage?"已开启":"已关闭"})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-line pt-3",children:[e.jsx(P,{size:"sm",variant:"secondary",onClick:ke,children:"导出配置"}),e.jsxs("label",{className:"flex h-8 cursor-pointer items-center justify-center rounded-md border border-line bg-surface text-[12px] text-ink-2 transition-colors hover:border-line-strong",children:["导入配置",e.jsx("input",{type:"file",accept:"application/json",className:"hidden",onChange:t=>{var r;ve((r=t.target.files)==null?void 0:r[0]),t.target.value=""}})]})]})]})]}),e.jsxs(ae,{children:[e.jsx(le,{title:"板块布局",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"拖动排序 · 点击预览可改内容"})}),e.jsx(re,{className:"p-0",children:e.jsxs("div",{className:"flex flex-col divide-y divide-line",children:[s.sections.map((t,r)=>{var N;const n=j.has(t.key),u=t.kind==="info"?"固定":t.kind==="text"?"文本":t.kind==="edu"?"教育":"记录";return e.jsxs("div",{draggable:!0,onDragStart:()=>{v.current=t.key},onDragOver:p=>p.preventDefault(),onDrop:()=>{const p=s.sections.findIndex(g=>g.key===v.current);if(p>=0&&p!==r){const g=[...s.sections],E=g.splice(p,1)[0];g.splice(r,0,E),b({...s,sections:g})}v.current=null},className:"bg-surface "+(v.current===t.key?"opacity-40":""),children:[e.jsxs("div",{className:"flex items-center gap-1 px-3 py-2",children:[e.jsx(Ie,{size:13,className:"shrink-0 cursor-grab text-ink-3"}),e.jsx("input",{className:"min-w-0 flex-1 rounded-sm border border-transparent bg-transparent px-1 py-0.5 text-[12.5px] font-medium text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:t.title,onChange:p=>b({...s,sections:s.sections.map(g=>g.key===t.key?{...g,title:p.target.value}:g)})}),e.jsx("button",{className:"rounded p-1 text-ink-3 hover:text-ink-1 disabled:opacity-30","aria-label":"上移",disabled:r===0,onClick:()=>M(r,-1),children:e.jsx(xe,{size:12})}),e.jsx("button",{className:"rounded p-1 text-ink-3 hover:text-ink-1 disabled:opacity-30","aria-label":"下移",disabled:r===s.sections.length-1,onClick:()=>M(r,1),children:e.jsx(me,{size:12})}),e.jsx("button",{className:"ml-0.5 rounded-sm border px-1.5 py-0.5 text-[11px] transition-colors "+(t.enabled?"border-brand/40 bg-brand-subtle text-brand-text":"border-line bg-surface-2 text-ink-3"),onClick:()=>b({...s,sections:s.sections.map(p=>p.key===t.key?{...p,enabled:!p.enabled}:p)}),children:t.enabled?"显示":"隐藏"}),e.jsx("button",{className:"rounded p-1 text-ink-3 hover:text-ink-1","aria-label":"展开编辑",onClick:()=>C(p=>{const g=new Set(p);return g.has(t.key)?g.delete(t.key):g.add(t.key),g}),children:e.jsx(Oe,{size:13,className:"transition-transform "+(n?"rotate-90":"")})})]}),n&&e.jsx("div",{className:"border-t border-line bg-surface-2 px-3 py-2.5",children:t.kind==="text"?e.jsx(de,{rows:4,value:t.text??"",placeholder:"输入该板块内容…",onChange:p=>b({...s,sections:s.sections.map(g=>g.key===t.key?{...g,text:p.target.value}:g)})}):t.kind==="info"?e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("div",{className:"mb-0.5 text-[11px] text-ink-3",children:"勾选 = 在基本信息中显示"}),Ge.map(p=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-[12px]",children:[e.jsx("input",{type:"checkbox",className:"size-3.5",checked:!(t.hiddenFields??[]).includes(p[0]),onChange:()=>b({...s,sections:s.sections.map(g=>{if(g.key!==t.key)return g;const E=new Set(g.hiddenFields??[]);return E.has(p[0])?E.delete(p[0]):E.add(p[0]),{...g,hiddenFields:[...E]}})})}),p[1]]},p[0]))]}):t.kind==="list"?e.jsx(Qe,{cfg:s,section:t,records:F,persist:b,sectionTypes:ge(t.key)}):e.jsx("p",{className:"text-[11.5px] text-ink-3",children:"该板块内容来自「个人信息」页与记录数据。"})}),e.jsxs("div",{className:"px-3 pb-1.5 text-[10.5px] text-ink-3",children:[u,(N=t.types)!=null&&N.length?" · "+t.types.join("/"):""]})]},t.key)}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 p-3",children:[e.jsxs(P,{size:"sm",variant:"secondary",onClick:()=>Q("text"),children:[e.jsx($,{size:13})," 文本板块"]}),e.jsxs(P,{size:"sm",variant:"secondary",onClick:()=>Q("list"),children:[e.jsx($,{size:13})," 列表板块"]})]})]})})]})]})]}),e.jsx(Ce,{open:ye,onClose:()=>H(!1),width:440,title:"初始化简历",footer:e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"ghost",onClick:()=>H(!1),children:"取消"}),e.jsxs(P,{variant:"primary",className:"!bg-danger !text-white",disabled:!1,onClick:be,children:[e.jsx(oe,{size:13})," 确认初始化"]})]}),children:e.jsxs("div",{className:"text-[12.5px] leading-relaxed text-ink-2",children:["将清除全部个性化修改(板块调整、自定义条目、文字覆盖、样式设置), 恢复为默认模板与示例内容。",e.jsx("div",{className:"mt-2 text-ink-3",children:"记录数据与个人信息不受影响,随时可重新修改。"})]})})]})}function Qe({cfg:a,section:f,records:h,persist:w,sectionTypes:y}){const[c,l]=T.useState(null),i=new Set(f.excluded??[]),_=h.filter(s=>(f.types??[]).includes(s.type_name)&&s.status!=="draft").sort((s,x)=>(x.start_date??x.created_at).localeCompare(s.start_date??s.created_at)),j=f.items??[],C=s=>w({...a,sections:a.sections.map(x=>x.key===f.key?{...x,...s}:x)}),R=s=>{const x=new Set(f.excluded??[]);x.has(s)?x.delete(s):x.add(s),C({excluded:[...x]})},k=[...f.itemOrder??[]],m=new Set(k),v=new Map;_.forEach(s=>{const x="r"+s.id;v.set(x,{type:"record",r:s}),m.has(x)||(k.push(x),m.add(x))}),j.forEach((s,x)=>{const o=s.id??"c"+x;v.set(o,{type:"custom",c:s,idx:x}),m.has(o)||(k.push(o),m.add(o))});const d=(s,x)=>{const o=k.indexOf(s),S=o+x;o<0||S<0||S>=k.length||([k[o],k[S]]=[k[S],k[o]],C({itemOrder:k}))},F=({k:s})=>e.jsxs("span",{className:"flex shrink-0 flex-col",children:[e.jsx("button",{className:"text-ink-3 hover:text-ink-1","aria-label":"上移",onClick:()=>d(s,-1),children:e.jsx(xe,{size:11})}),e.jsx("button",{className:"text-ink-3 hover:text-ink-1","aria-label":"下移",onClick:()=>d(s,1),children:e.jsx(me,{size:11})})]});return e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx("div",{className:"text-[11px] text-ink-3",children:"条目排序(↑↓)· 记录勾选显隐 · 自定义条目可增删"}),k.map(s=>{const x=v.get(s);if(!x)return null;if(x.type==="record"){const o=x.r;return e.jsxs("div",{className:"flex items-center gap-2 text-[12px]",children:[e.jsx(F,{k:s}),e.jsxs("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"size-3.5",checked:!i.has(o.id),onChange:()=>R(o.id)}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-ink-1",children:o.title})]}),e.jsx("span",{className:"num shrink-0 text-[11px] text-ink-3",children:(o.start_date??"").slice(0,7)})]},s)}return e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-surface p-1.5 text-[12px]",children:[e.jsx(F,{k:s}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-ink-1",children:[x.c.title,e.jsxs("span",{className:"text-ink-3",children:[" · ",x.c.date??""]})]}),e.jsx("button",{className:"text-ink-3 hover:text-danger","aria-label":"删除条目",onClick:()=>C({items:j.filter((o,S)=>S!==x.idx)}),children:e.jsx(ie,{size:12})})]},s)}),e.jsxs("div",{className:"mt-1 border-t border-line pt-2",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[11.5px] font-medium text-ink-2",children:["自定义条目(",j.length,")"]}),e.jsxs(P,{size:"sm",variant:"ghost",onClick:()=>l({title:""}),children:[e.jsx($,{size:12})," 添加"]})]}),c&&e.jsxs("div",{className:"mb-2 rounded-md border border-line bg-surface p-2",children:[e.jsx(V,{className:"mb-1.5",placeholder:"标题",value:c.title,onChange:s=>l({...c,title:s.target.value})}),e.jsxs("div",{className:"mb-1.5 grid grid-cols-2 gap-1.5",children:[e.jsx(V,{placeholder:"副标题(单位/角色)",value:c.subtitle??"",onChange:s=>l({...c,subtitle:s.target.value})}),e.jsx(V,{placeholder:"日期(2025.9)",value:c.date??"",onChange:s=>l({...c,date:s.target.value})})]}),e.jsx(de,{rows:2,placeholder:"描述:做了什么、负责什么、学会什么",value:c.desc??"",onChange:s=>l({...c,desc:s.target.value})}),e.jsxs("div",{className:"mt-1.5 flex gap-1.5",children:[e.jsx(P,{size:"sm",variant:"primary",disabled:!c.title.trim(),onClick:()=>{c.title.trim()&&(C({items:[...j,{...c,id:"c"+Date.now()}]}),l(null))},children:"添加"}),e.jsx(P,{size:"sm",variant:"ghost",onClick:()=>l(null),children:"取消"})]})]}),j.map((s,x)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-surface p-1.5 text-[12px]",children:[e.jsxs("span",{className:"min-w-0 flex-1 truncate text-ink-1",children:[s.title,e.jsxs("span",{className:"text-ink-3",children:[" · ",s.date??""]})]}),e.jsx("button",{className:"text-ink-3 hover:text-danger","aria-label":"删除条目",onClick:()=>C({items:j.filter((o,S)=>S!==x)}),children:e.jsx(ie,{size:12})})]},x)),!j.length&&!c&&e.jsx("p",{className:"text-[11.5px] text-ink-3",children:"暂无自定义条目"})]}),e.jsxs("p",{className:"text-[11px] text-ink-3",children:["「",y,"」相关条目来自你的记录数据,此处可隐藏不需要展示的条目;描述可在预览中点击直接修改。"]})]})}export{Xe as ResumePage}; diff --git a/sync-server/www/assets/ResumePage-DoaIVQ9K.js b/sync-server/www/assets/ResumePage-DoaIVQ9K.js new file mode 100644 index 0000000..494d2cc --- /dev/null +++ b/sync-server/www/assets/ResumePage-DoaIVQ9K.js @@ -0,0 +1,44 @@ +import{c as L,d as we,f as se,r as T,j as e,B as R,ag as Ce,ae as D,H as B,S as ne,ac as de,P as $,F as Se,a8 as _e,T as ie,I as V,af as ze,v as Re}from"./index-T-NGjlrZ.js";import{C as ae,a as le,b as re}from"./card-C5ifMTlY.js";import{R as Pe}from"./refresh-cw-DXuKsZdS.js";/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ee=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],me=L("ArrowDown",Ee);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Te=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],xe=L("ArrowUp",Te);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Fe=L("ChevronRight",Oe);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ie=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Le=L("GripVertical",Ie);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Me=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],De=L("PanelRightClose",Me);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ae=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],Ke=L("PanelRightOpen",Ae);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ue=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Be=L("Printer",Ue);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const He=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],oe=L("RotateCcw",He),K=[{key:"info",defaultTitle:"基本信息",kind:"info",fixed:!0},{key:"education",defaultTitle:"教育经历",kind:"edu",fixed:!0},{key:"skills",defaultTitle:"核心技能",kind:"text"},{key:"projects",defaultTitle:"项目经历",kind:"list",types:["竞赛","科研","实习实践"]},{key:"certs",defaultTitle:"证书与荣誉",kind:"list",types:["荣誉惩处","证书技能"]},{key:"campus",defaultTitle:"在校经历",kind:"list",types:["学生工作","志愿公益"]},{key:"activity",defaultTitle:"文体活动",kind:"list",types:["文体活动"]},{key:"other",defaultTitle:"其他经历",kind:"list"},{key:"self",defaultTitle:"自我评价",kind:"text",fixed:!0}],A={skills:{text:`程序设计:熟悉 Python 与 C/C++,掌握常用数据结构与算法,能独立完成中小型工具与脚本开发。 +网络安全:熟悉常见 Web 漏洞原理(SQL 注入、XSS、CSRF 等)与防护方案,掌握 Burp Suite、Nmap、Wireshark 等常用工具。 +网络基础:熟悉 TCP/IP 协议栈与交换路由基础配置,理解 VLAN、NAT、ACL 等核心技术。 +运维基础:熟悉 Linux 常用操作与 Shell 脚本,了解 Docker 容器化部署与 Nginx 服务配置。`},campus:{items:[{title:"校图书馆学生助理",subtitle:"读者服务岗",date:"2024.9 - 2025.6",desc:"负责书库整理与借阅服务,协助开展入馆培训与阅读推广活动,累计服务读者千余人次。培养了责任意识与服务意识,锻炼了多任务时间管理能力。"},{title:"院学生会宣传部干事",subtitle:"平面设计与文案",date:"2023.9 - 2024.6",desc:"参与学院活动的海报设计与推文撰写,负责活动现场的后勤与设备保障。锻炼了审美表达、协作沟通与临场应变能力。"}]},self:{text:"性格沉稳踏实,做事有计划性,习惯提前预判风险并准备预案;学习能力强,能快速上手新技术与工具;责任心强,注重细节与条理,凡事有始有终,能独立推进任务并在压力下保持稳定输出。"}};function H(){return{version:2,template:"tech",accent:"#3056d3",fontScale:1,density:"normal",onePage:!1,sections:K.map(i=>({key:i.key,title:i.defaultTitle,enabled:!0,kind:i.kind,types:i.types,...i.key==="skills"?{text:A.skills.text}:{},...i.key==="campus"?{items:A.campus.items}:{},...i.key==="self"?{text:A.self.text}:{}}))}}function q(i){const h=H();if(!i||typeof i!="object")return h;const u=i,C=Array.isArray(u.sections)?u.sections:[],g=h.sections.map(r=>{var w;const a=C.find(P=>P.key===r.key),_=K.find(P=>P.key===r.key),j={...r,...a??{},enabled:(a==null?void 0:a.enabled)??!0,title:(a==null?void 0:a.title)??(_==null?void 0:_.defaultTitle)??r.title,kind:_?r.kind:(a==null?void 0:a.kind)??r.kind,types:(_==null?void 0:_.types)??(a==null?void 0:a.types)};return r.key==="skills"&&j.text==null&&(j.text=A.skills.text),r.key==="campus"&&!((w=j.items)!=null&&w.length)&&(j.items=A.campus.items),r.key==="self"&&j.text==null&&(j.text=A.self.text),j}),c=new Set(["awards","competition","practice","research"]);for(const r of C)c.has(r.key)||g.some(a=>a.key===r.key)||g.push({key:r.key,title:r.title||r.key,enabled:r.enabled??!0,kind:"text",text:""});return{version:2,template:u.template??"tech",accent:u.accent??"#3056d3",fontScale:Math.min(1.2,Math.max(.8,u.fontScale??1)),density:u.density??"normal",onePage:u.onePage??!1,sections:g}}function We(){return K.filter(i=>i.types).flatMap(i=>i.types)}function qe(i){const h=[i.organizer,i.level,i.award_grade].filter(C=>C!=null&&C!=="").map(String).join(" · "),u=[i.result,i.description].filter(C=>C!=null&&C!=="").map(String).join(" — ");return{title:i.title,subtitle:h||void 0,date:i.start_date??i.created_at.slice(0,10),desc:u||void 0,fromRecord:i.id}}function pe(i,h){var c;const u=[],C=We(),g=new Set;for(const r of h.sections){if(!r.enabled)continue;const a=K.find(m=>m.key===r.key);if(r.key==="info"){u.push({key:r.key,title:r.title,kind:"info",hiddenFields:r.hiddenFields??[]});continue}if(r.key==="self"||r.kind==="text"){const m=r.text??"";if(!m.trim())continue;u.push({key:r.key,title:r.title,kind:"text",text:m});continue}const _=new Set(r.excluded??[]);let j=[];const w=a==null?void 0:a.types;w?j=i.filter(m=>w.includes(m.type_name)&&m.status!=="draft"&&!_.has(m.id)&&!g.has(m.id)):j=i.filter(m=>m.status!=="draft"&&!_.has(m.id)&&!g.has(m.id)&&!C.includes(m.type_name));const P=new Map((r.itemOrder??[]).map((m,v)=>[m,v])),k=[];for(const m of j){const v={itemKey:"r"+m.id,...qe(m),...((c=r.overrides)==null?void 0:c[String(m.id)])??{}};k.push({...v,_ord:P.get(v.itemKey)??9999}),g.add(m.id)}for(const m of r.items??[]){const v=m.id??"c"+(r.items??[]).indexOf(m);k.push({itemKey:v,...m,_ord:P.get(v)??9999})}k.sort((m,v)=>m._ord-v._ord||(v.date??"").localeCompare(m.date??"")),k.length&&u.push({key:r.key,title:r.title,kind:"list",items:k.map(m=>{const{_ord:v,...d}=m;return d})})}return u}const he=[{key:"tech",name:"互联网技术风",desc:"品牌色标题 + 左侧色条,紧凑现代"},{key:"minimal",name:"极简风",desc:"灰色大写字距标题,大量留白"},{key:"classic",name:"经典风",desc:"黑色衬线标题 + 通栏分隔线,正式通用"}],ue=["#3056d3","#0f766e","#7c3aed","#c2410c","#0e7490","#1f2937"],z=i=>String(i??"").replace(/&/g,"&").replace(//g,">");function Ve(i,h,u,C){var F,s,x;const g=u.fontScale,c=o=>(o*g).toFixed(1)+"pt",r=u.accent,a=h,_={classic:"font-size:"+c(14)+";color:#111;border-bottom:1.5pt solid #333;padding-bottom:3pt;margin:14pt 0 7pt",tech:"font-size:"+c(14)+";color:"+r+";border-bottom:1pt solid "+r+";padding-bottom:3pt;margin:14pt 0 7pt",minimal:"font-size:"+c(11.5)+";color:#555;letter-spacing:1.5pt;text-transform:uppercase;border-bottom:0.75pt solid #e0e0e0;padding-bottom:3pt;margin:14pt 0 7pt"},j=u.template==="tech"?r:"#111",w=[a.school,a.college,a.major,a.degree].filter(o=>o!=="").map(o=>z(o)).join(" · "),P=[a.phone,a.email,a.homepage].filter(o=>o!=="").map(o=>z(o)).join(" · "),k=(((F=u.header)==null?void 0:F.showPhoto)??!0)&&C&&a.photoUrl?'':"",m=''+z(a.name||"个人简历")+""+((((s=u.header)==null?void 0:s.showSchool)??!0)&&w?''+w+"":"")+((((x=u.header)==null?void 0:x.showContact)??!0)&&P?''+P+"":"")+""+k+"",v=o=>''+z(o.title)+''+z(o.date??"")+""+(o.subtitle?''+z(o.subtitle)+"":"")+(o.desc?''+z(o.desc)+"":""),d=i.map(o=>{let S="";if(o.kind==="edu"){const M=[["学校",a.school??""],["专业",a.major??""],["学制",a.eduLength??""],["学历",a.degree??""],["入学",a.eduStart??""],["毕业",a.eduEnd??""]].filter(b=>b[1]!=="");S=''+M.map(b=>''+z(b[0])+''+z(b[1])+"").join("")+""+(a.majorCourses?'主修课程:'+z(a.majorCourses)+"":"")}else if(o.kind==="info"){const M=[["name","姓名",a.name??""],["gender","性别",a.gender??""],["birth","出生年月",a.birth??""],["nation","民族",a.nation??""],["native","籍贯",a.native??""],["political","政治面貌",a.political??""],["className","班级",a.className??""],["studentId","学号",a.studentId??""],["degree","学历",a.degree??""],["phone","手机",a.phone??""],["email","邮箱",a.email??""]].filter(b=>b[2]!==""&&!(o.hiddenFields??[]).includes(b[0]));S=''+M.map((b,I)=>(I%2===0?"":"")+''+z(b[1])+''+z(b[2])+""+(I%2===1?"":"")).join("")+""}else o.kind==="list"?S=""+(o.items??[]).map(v).join("")+"":S=''+z(o.text??"").replace(/\n/g,"")+"";return''+z(o.title)+""+S}).join("");return''+z(a.name||"个人简历")+''+m+d+""}const $e=Object.freeze(Object.defineProperty({__proto__:null,ACCENT_CHOICES:ue,RESUME_SECTION_DEFS:K,TEMPLATES:he,assembleSections:pe,defaultResumeConfig:H,migrateResumeConfig:q,resumeToWordHtml:Ve},Symbol.toStringTag,{value:"Module"})),Ge={姓名:"name",性别:"gender",出生年月:"birth",民族:"nation",籍贯:"native",政治面貌:"political",班级:"className",学号:"studentId",手机:"phone",邮箱:"email"},Qe=[["name","姓名"],["gender","性别"],["birth","出生年月"],["nation","民族"],["native","籍贯"],["political","政治面貌"],["className","班级"],["studentId","学号"],["phone","手机"],["email","邮箱"]];function ce(i){const h=/^(\d{4})-(\d{1,2})/.exec(i??"");return h?h[1]+"."+Number(h[2]):i??""}function O({html:i,onCommit:h,className:u}){const C=i.replace(/&/g,"&").replace(//g,">");return e.jsx("span",{contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,className:"outline-none break-words rounded-sm transition-shadow focus:shadow-[0_0_0_1.5px_rgba(48,86,211,0.5)] cursor-text "+(u??""),dangerouslySetInnerHTML:{__html:C},onBlur:g=>{const c=(g.currentTarget.textContent??"").trim();c!==i&&h(c)}})}function et(){var J,Y,Z,X,ee,te;const i=we(),h=se({queryKey:["profile"],queryFn:ze}),u=se({queryKey:["resume-records"],queryFn:()=>Re({page:1,page_size:500})}),[C,g]=T.useState(null),[c,r]=T.useState(""),[a,_]=T.useState(!0),[j,w]=T.useState(new Set),[P,k]=T.useState(1),m=T.useRef(null),v=T.useRef(null);T.useEffect(()=>{var l,n;const t=(l=h.data)==null?void 0:l.content;t&&(g(q(t.resume)),r(((n=t.info)==null?void 0:n.selfIntro)??""))},[h.data]);const d={...((Y=(J=h.data)==null?void 0:J.content)==null?void 0:Y.info)??{}},F=((Z=u.data)==null?void 0:Z.items)??[],s=C??H(),x={...d,selfIntro:c},o=[ce(d.eduStart),ce(d.eduEnd)].filter(Boolean).join("-"),S=T.useMemo(()=>pe(F,s),[F,s]),M=(t,l)=>g(n=>{if(!n)return n;const f=[...n.sections],N=t+l;return N<0||N>=f.length?n:([f[t],f[N]]=[f[N],f[t]],{...n,sections:f})}),b=t=>{g(t),D({info:{...d,selfIntro:c},resume:t}).catch(l=>i("error",l.message))},I=t=>{g(l=>{const n=l??s,f=n.sections.map(p=>{var y;if(p.key!==t.secKey)return p;if(t.field==="text")return{...p,text:t.value};if(t.fromRecord!=null){const E={...((y=p.overrides)==null?void 0:y[t.fromRecord])??{},[t.field]:t.value};return{...p,overrides:{...p.overrides??{},[t.fromRecord]:E}}}if(t.itemIdx!=null&&p.items){const E=[...p.items];return E[t.itemIdx]={...E[t.itemIdx],[t.field]:t.value},{...p,items:E}}return p}),N={...n,sections:f};return D({info:{...d,selfIntro:c},resume:N}).catch(p=>i("error",p.message)),N})},W=(t,l)=>{D({info:{...x,[t]:l}}).then(()=>h.refetch()).catch(n=>i("error",n.message))};T.useEffect(()=>{if(!s.onePage){k(1);return}const t=m.current;if(!t)return;const l=1043,n=t.scrollHeight;k(n>l?Math.max(.7,l/n):1)},[s.onePage,s.fontScale,s.density,S]);const G=s.fontScale*(s.onePage?P:1),fe=()=>{_e(()=>Promise.resolve().then(()=>$e),void 0).then(function(t){const l=t.resumeToWordHtml(S,x,s,d.photoUrl),n=new Blob(["\uFEFF"+l],{type:"application/msword"}),f=URL.createObjectURL(n),N=document.createElement("a");N.href=f,N.download=(d.name||"个人简历")+".doc",N.click(),setTimeout(()=>URL.revokeObjectURL(f),6e4),i("success","Word 文档已导出")})},Q=t=>{const l="custom_"+Date.now();b({...s,sections:[...s.sections,t==="text"?{key:l,title:"自定义板块",enabled:!0,kind:"text",text:""}:{key:l,title:"自定义经历",enabled:!0,kind:"list",items:[]}]}),w(n=>new Set(n).add(l))},ge=t=>{var l,n;return((n=(l=K.find(f=>f.key===t))==null?void 0:l.types)==null?void 0:n.join(" / "))??"固定板块"},[ye,U]=T.useState(!1),be=()=>{const t=H();g(t),w(new Set),D({info:{...d,selfIntro:c},resume:t}).then(()=>h.refetch()).then(()=>{U(!1),i("success","简历已初始化为默认模板")}).catch(l=>i("error",l.message))},je=()=>{const t=H();t.sections=t.sections.map(l=>({...l,text:l.kind==="text"?"":l.text,items:l.kind==="list"?[]:l.items,overrides:{},excluded:[],itemOrder:[],hiddenFields:[]})),g(t),w(new Set),D({info:{...d,selfIntro:c},resume:t}).then(()=>h.refetch()).then(()=>{U(!1),i("success","简历数据已彻底清空")}).catch(l=>i("error",l.message))},ke=async()=>{var t,l;try{const[n]=await Promise.all([h.refetch(),u.refetch()]),f=(t=n.data)==null?void 0:t.content;f&&(g(q(f.resume)),r(((l=f.info)==null?void 0:l.selfIntro)??"")),i("success","已重新载入最新数据")}catch(n){i("error",n.message)}},ve=()=>{const t=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),l=URL.createObjectURL(t),n=document.createElement("a");n.href=l,n.download="简历配置.json",n.click(),setTimeout(()=>URL.revokeObjectURL(l),6e4),i("success","简历配置已导出")},Ne=t=>{t&&t.text().then(l=>{try{const n=q(JSON.parse(l));b(n),i("success","配置已导入")}catch{i("error","配置文件格式不正确")}})};return e.jsxs("div",{className:"mx-auto max-w-[1280px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"no-print mb-4 flex flex-wrap items-center justify-between gap-2",children:[e.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"我的简历"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(R,{variant:"secondary",onClick:()=>_(t=>!t),children:[a?e.jsx(De,{size:13}):e.jsx(Ke,{size:13}),a?"收起设置":"展开设置"]}),e.jsxs(R,{variant:"secondary",onClick:()=>void ke(),children:[e.jsx(Pe,{size:13})," 重新载入"]}),e.jsxs(R,{variant:"ghost",className:"text-danger hover:bg-danger-subtle",onClick:()=>U(!0),children:[e.jsx(oe,{size:13})," 初始化简历"]}),e.jsxs(R,{variant:"secondary",onClick:fe,children:[e.jsx(Ce,{size:13})," 导出 Word"]}),e.jsxs(R,{variant:"primary",onClick:()=>window.print(),children:[e.jsx(Be,{size:13})," 打印 / PDF"]})]})]}),e.jsxs("div",{className:"grid gap-4 "+(a?"lg:grid-cols-[1fr_340px]":"grid-cols-1"),children:[e.jsxs("div",{children:[e.jsx("div",{className:"print-sheet mx-auto w-full max-w-[794px] rounded-lg border border-line bg-white shadow-card",style:{minHeight:s.onePage?1123:void 0},children:e.jsxs("div",{ref:m,className:"min-w-0 overflow-x-hidden p-5 sm:p-10 resume-tpl-"+s.template,style:{zoom:G,"--accent":s.accent},children:[e.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4 sm:gap-6",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h1",{className:"text-[26px] font-bold leading-tight "+(s.template==="tech"?"text-[var(--accent)]":"text-neutral-900"),children:d.name||"姓名"}),(((X=s.header)==null?void 0:X.showSchool)??!0)&&e.jsx("div",{className:"mt-1.5 text-[12.5px] text-neutral-500",children:[d.school,d.college,d.major,d.degree].filter(Boolean).join(" · ")||"完善个人信息后自动展示"}),(((ee=s.header)==null?void 0:ee.showContact)??!0)&&e.jsx("div",{className:"mt-1 text-[12px] text-neutral-500",children:[d.phone,d.email,d.homepage].filter(Boolean).join(" · ")})]}),(((te=s.header)==null?void 0:te.showPhoto)??!0)&&d.photoUrl&&e.jsx("img",{src:d.photoUrl,alt:"证件照",className:"h-[110px] w-[82px] rounded border border-neutral-200 object-cover"})]}),S.map(t=>{var l;return e.jsxs("div",{className:"mb-5 r-sec",children:[e.jsx("div",{className:"r-sec-title mb-2.5 text-[14px] font-bold text-neutral-900",children:e.jsx(O,{html:t.title,onCommit:n=>I({secKey:t.key,field:"title",value:n})})}),t.kind==="edu"?e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-0.5 text-[13px]",children:[e.jsx("span",{className:"num shrink-0 text-neutral-500",children:e.jsx(O,{html:o,onCommit:n=>{const f=/(\d{4})\.(\d{1,2})\s*[-—~至]\s*(\d{4})\.(\d{1,2})/.exec(n);if(!f){i("error","时间格式:2023.9-2027.6");return}D({info:{...x,eduStart:f[1]+"-"+f[2].padStart(2,"0"),eduEnd:f[3]+"-"+f[4].padStart(2,"0")}}).then(()=>h.refetch()).catch(N=>i("error",N.message))}})}),e.jsx("span",{className:"min-w-0 font-semibold text-neutral-900",children:e.jsx(O,{html:d.school??"",onCommit:n=>W("school",n)})}),e.jsxs("span",{className:"shrink-0 text-neutral-600",children:[e.jsx(O,{html:d.major??"",onCommit:n=>W("major",n)}),d.degree?e.jsxs("span",{children:[" | ",e.jsx(O,{html:d.degree,onCommit:n=>W("degree",n)})]}):null]})]}),d.majorCourses&&e.jsxs("p",{className:"mt-1.5 text-[12px] leading-relaxed text-justify text-neutral-700",children:[e.jsx("b",{children:"主修课程:"}),e.jsx(O,{html:d.majorCourses,onCommit:n=>W("majorCourses",n)})]})]}):t.kind==="info"?e.jsx("div",{className:"grid grid-cols-1 gap-x-8 gap-y-1 text-[12.5px] sm:grid-cols-2",children:[["姓名",d.name],["性别",d.gender],["出生年月",d.birth],["民族",d.nation],["籍贯",d.native],["政治面貌",d.political],["班级",d.className],["学号",d.studentId],["手机",d.phone],["邮箱",d.email]].filter(n=>n[1]&&!(t.hiddenFields??[]).includes(Ge[n[0]])).map(n=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"w-16 shrink-0 text-neutral-500",children:n[0]}),e.jsx("span",{children:n[1]})]},n[0]))}):t.kind==="text"?e.jsx("p",{className:"whitespace-pre-wrap text-justify text-neutral-700 "+(s.density==="compact"?"":"leading-relaxed"),children:e.jsx(O,{html:t.text??"",onCommit:n=>I({secKey:t.key,field:"text",value:n})})}):e.jsx("div",{className:s.density==="compact"?"flex flex-col gap-1.5":"flex flex-col gap-3",children:(l=t.items)==null?void 0:l.map((n,f)=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-[13px] font-semibold text-neutral-900 r-item-title",children:e.jsx(O,{html:n.title,onCommit:N=>I({secKey:t.key,field:"title",value:N,itemIdx:f,fromRecord:n.fromRecord})})}),e.jsx("span",{className:"num shrink-0 text-[11.5px] text-neutral-500",children:e.jsx(O,{html:n.date??"",onCommit:N=>I({secKey:t.key,field:"date",value:N,itemIdx:f,fromRecord:n.fromRecord})})})]}),n.subtitle&&e.jsx("div",{className:"text-[12px] text-neutral-600",children:n.subtitle}),n.desc&&e.jsx("p",{className:"text-justify text-[12px] text-neutral-500 "+(s.density==="compact"?"":"mt-0.5"),children:e.jsx(O,{html:n.desc,onCommit:N=>I({secKey:t.key,field:"desc",value:N,itemIdx:f,fromRecord:n.fromRecord})})})]},n.itemKey??(n.title??"")+f))})]},t.key)})]})}),s.onePage&&e.jsxs("div",{className:"no-print mt-2 text-center text-[11.5px] text-ink-3",children:["一页限定已启用:内容自动缩放 ",Math.round(G*100),"% 以适配单页 A4"]})]}),a&&e.jsxs("div",{className:"no-print flex flex-col gap-4 lg:sticky lg:top-4 lg:max-h-[calc(100vh-2rem)] lg:self-start lg:overflow-y-auto lg:pr-1",children:[e.jsxs(ae,{children:[e.jsx(le,{title:"模板与风格"}),e.jsxs(re,{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"grid grid-cols-1 gap-2",children:he.map(t=>e.jsxs("button",{className:"rounded-md border px-3 py-2 text-left transition-all "+(s.template===t.key?"border-brand bg-brand-subtle":"border-line bg-surface hover:border-line-strong"),onClick:()=>b({...s,template:t.key}),children:[e.jsx("div",{className:"text-[12.5px] font-semibold "+(s.template===t.key?"text-brand-text":"text-ink-1"),children:t.name}),e.jsx("div",{className:"text-[11px] text-ink-3",children:t.desc})]},t.key))}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(B,{label:"主题色",children:e.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:ue.map(t=>e.jsx("button",{"aria-label":"主题色 "+t,className:"size-5 rounded-full border-2 transition-transform "+(s.accent===t?"scale-110 border-ink-1":"border-transparent"),style:{backgroundColor:t},onClick:()=>b({...s,accent:t})},t))})}),e.jsx(B,{label:"字号",children:e.jsx(ne,{value:String(s.fontScale),onChange:t=>b({...s,fontScale:Number(t.target.value)}),options:[{value:"0.9",label:"小"},{value:"1",label:"标准"},{value:"1.1",label:"大"}]})})]}),e.jsx(B,{label:"头部布局",children:e.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:[["showPhoto","证件照"],["showContact","联系行"],["showSchool","学校行"]].map(t=>{var n;const l=((n=s.header)==null?void 0:n[t[0]])??!0;return e.jsx("button",{className:"rounded-md border px-2.5 py-1 text-[11.5px] transition-colors "+(l?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-3"),onClick:()=>b({...s,header:{...s.header,[t[0]]:!l}}),children:t[1]},t[0])})})}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(B,{label:"间距",children:e.jsx(ne,{value:s.density,onChange:t=>b({...s,density:t.target.value}),options:[{value:"compact",label:"紧凑"},{value:"normal",label:"标准"},{value:"relaxed",label:"宽松"}]})}),e.jsx(B,{label:"单页限定",children:e.jsx("button",{className:"flex h-9 w-full items-center justify-center gap-1.5 rounded-md border text-[12px] transition-colors "+(s.onePage?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2"),onClick:()=>b({...s,onePage:!s.onePage}),children:s.onePage?"已开启":"已关闭"})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-line pt-3",children:[e.jsx(R,{size:"sm",variant:"secondary",onClick:ve,children:"导出配置"}),e.jsxs("label",{className:"flex h-8 cursor-pointer items-center justify-center rounded-md border border-line bg-surface text-[12px] text-ink-2 transition-colors hover:border-line-strong",children:["导入配置",e.jsx("input",{type:"file",accept:"application/json",className:"hidden",onChange:t=>{var l;Ne((l=t.target.files)==null?void 0:l[0]),t.target.value=""}})]})]})]})]}),e.jsxs(ae,{children:[e.jsx(le,{title:"板块布局",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"拖动排序 · 点击预览可改内容"})}),e.jsx(re,{className:"p-0",children:e.jsxs("div",{className:"flex flex-col divide-y divide-line",children:[s.sections.map((t,l)=>{var N;const n=j.has(t.key),f=t.kind==="info"?"固定":t.kind==="text"?"文本":t.kind==="edu"?"教育":"记录";return e.jsxs("div",{draggable:!0,onDragStart:()=>{v.current=t.key},onDragOver:p=>p.preventDefault(),onDrop:()=>{const p=s.sections.findIndex(y=>y.key===v.current);if(p>=0&&p!==l){const y=[...s.sections],E=y.splice(p,1)[0];y.splice(l,0,E),b({...s,sections:y})}v.current=null},className:"bg-surface "+(v.current===t.key?"opacity-40":""),children:[e.jsxs("div",{className:"flex items-center gap-1 px-3 py-2",children:[e.jsx(Le,{size:13,className:"shrink-0 cursor-grab text-ink-3"}),e.jsx("input",{className:"min-w-0 flex-1 rounded-sm border border-transparent bg-transparent px-1 py-0.5 text-[12.5px] font-medium text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:t.title,onChange:p=>b({...s,sections:s.sections.map(y=>y.key===t.key?{...y,title:p.target.value}:y)})}),e.jsx("button",{className:"rounded p-1 text-ink-3 hover:text-ink-1 disabled:opacity-30","aria-label":"上移",disabled:l===0,onClick:()=>M(l,-1),children:e.jsx(xe,{size:12})}),e.jsx("button",{className:"rounded p-1 text-ink-3 hover:text-ink-1 disabled:opacity-30","aria-label":"下移",disabled:l===s.sections.length-1,onClick:()=>M(l,1),children:e.jsx(me,{size:12})}),e.jsx("button",{className:"ml-0.5 rounded-sm border px-1.5 py-0.5 text-[11px] transition-colors "+(t.enabled?"border-brand/40 bg-brand-subtle text-brand-text":"border-line bg-surface-2 text-ink-3"),onClick:()=>b({...s,sections:s.sections.map(p=>p.key===t.key?{...p,enabled:!p.enabled}:p)}),children:t.enabled?"显示":"隐藏"}),e.jsx("button",{className:"rounded p-1 text-ink-3 hover:text-ink-1","aria-label":"展开编辑",onClick:()=>w(p=>{const y=new Set(p);return y.has(t.key)?y.delete(t.key):y.add(t.key),y}),children:e.jsx(Fe,{size:13,className:"transition-transform "+(n?"rotate-90":"")})})]}),n&&e.jsx("div",{className:"border-t border-line bg-surface-2 px-3 py-2.5",children:t.kind==="text"?e.jsx(de,{rows:4,value:t.text??"",placeholder:"输入该板块内容…",onChange:p=>b({...s,sections:s.sections.map(y=>y.key===t.key?{...y,text:p.target.value}:y)})}):t.kind==="info"?e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("div",{className:"mb-0.5 text-[11px] text-ink-3",children:"勾选 = 在基本信息中显示"}),Qe.map(p=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-[12px]",children:[e.jsx("input",{type:"checkbox",className:"size-3.5",checked:!(t.hiddenFields??[]).includes(p[0]),onChange:()=>b({...s,sections:s.sections.map(y=>{if(y.key!==t.key)return y;const E=new Set(y.hiddenFields??[]);return E.has(p[0])?E.delete(p[0]):E.add(p[0]),{...y,hiddenFields:[...E]}})})}),p[1]]},p[0]))]}):t.kind==="list"?e.jsx(Je,{cfg:s,section:t,records:F,persist:b,sectionTypes:ge(t.key)}):e.jsx("p",{className:"text-[11.5px] text-ink-3",children:"该板块内容来自「个人信息」页与记录数据。"})}),e.jsxs("div",{className:"px-3 pb-1.5 text-[10.5px] text-ink-3",children:[f,(N=t.types)!=null&&N.length?" · "+t.types.join("/"):""]})]},t.key)}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 p-3",children:[e.jsxs(R,{size:"sm",variant:"secondary",onClick:()=>Q("text"),children:[e.jsx($,{size:13})," 文本板块"]}),e.jsxs(R,{size:"sm",variant:"secondary",onClick:()=>Q("list"),children:[e.jsx($,{size:13})," 列表板块"]})]})]})})]})]})]}),e.jsx(Se,{open:ye,onClose:()=>U(!1),width:440,title:"初始化简历",footer:e.jsxs(e.Fragment,{children:[e.jsx(R,{variant:"ghost",onClick:()=>U(!1),children:"取消"}),e.jsx(R,{variant:"secondary",onClick:je,children:"彻底清空"}),e.jsxs(R,{variant:"primary",onClick:be,children:[e.jsx(oe,{size:13})," 恢复默认模板"]})]}),children:e.jsxs("div",{className:"text-[12.5px] leading-relaxed text-ink-2",children:[e.jsx("b",{children:"恢复默认模板"}),":清除个性化修改,恢复默认板块与示例内容。",e.jsxs("div",{className:"mt-1",children:[e.jsx("b",{children:"彻底清空"}),":保留板块结构,内容全部置空,从零开始。"]}),e.jsx("div",{className:"mt-2 text-ink-3",children:"两种操作都不影响记录数据与个人信息。"}),e.jsx("div",{className:"mt-2 text-ink-3",children:"记录数据与个人信息不受影响,随时可重新修改。"})]})})]})}function Je({cfg:i,section:h,records:u,persist:C,sectionTypes:g}){const[c,r]=T.useState(null),a=new Set(h.excluded??[]),_=u.filter(s=>(h.types??[]).includes(s.type_name)&&s.status!=="draft").sort((s,x)=>(x.start_date??x.created_at).localeCompare(s.start_date??s.created_at)),j=h.items??[],w=s=>C({...i,sections:i.sections.map(x=>x.key===h.key?{...x,...s}:x)}),P=s=>{const x=new Set(h.excluded??[]);x.has(s)?x.delete(s):x.add(s),w({excluded:[...x]})},k=[...h.itemOrder??[]],m=new Set(k),v=new Map;_.forEach(s=>{const x="r"+s.id;v.set(x,{type:"record",r:s}),m.has(x)||(k.push(x),m.add(x))}),j.forEach((s,x)=>{const o=s.id??"c"+x;v.set(o,{type:"custom",c:s,idx:x}),m.has(o)||(k.push(o),m.add(o))});const d=(s,x)=>{const o=k.indexOf(s),S=o+x;o<0||S<0||S>=k.length||([k[o],k[S]]=[k[S],k[o]],w({itemOrder:k}))},F=({k:s})=>e.jsxs("span",{className:"flex shrink-0 flex-col",children:[e.jsx("button",{className:"text-ink-3 hover:text-ink-1","aria-label":"上移",onClick:()=>d(s,-1),children:e.jsx(xe,{size:11})}),e.jsx("button",{className:"text-ink-3 hover:text-ink-1","aria-label":"下移",onClick:()=>d(s,1),children:e.jsx(me,{size:11})})]});return e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsx("div",{className:"text-[11px] text-ink-3",children:"条目排序(↑↓)· 记录勾选显隐 · 自定义条目可增删"}),k.map(s=>{const x=v.get(s);if(!x)return null;if(x.type==="record"){const o=x.r;return e.jsxs("div",{className:"flex items-center gap-2 text-[12px]",children:[e.jsx(F,{k:s}),e.jsxs("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"size-3.5",checked:!a.has(o.id),onChange:()=>P(o.id)}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-ink-1",children:o.title})]}),e.jsx("span",{className:"num shrink-0 text-[11px] text-ink-3",children:(o.start_date??"").slice(0,7)})]},s)}return e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-surface p-1.5 text-[12px]",children:[e.jsx(F,{k:s}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-ink-1",children:[x.c.title,e.jsxs("span",{className:"text-ink-3",children:[" · ",x.c.date??""]})]}),e.jsx("button",{className:"text-ink-3 hover:text-danger","aria-label":"删除条目",onClick:()=>w({items:j.filter((o,S)=>S!==x.idx)}),children:e.jsx(ie,{size:12})})]},s)}),e.jsxs("div",{className:"mt-1 border-t border-line pt-2",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[11.5px] font-medium text-ink-2",children:["自定义条目(",j.length,")"]}),e.jsxs(R,{size:"sm",variant:"ghost",onClick:()=>r({title:""}),children:[e.jsx($,{size:12})," 添加"]})]}),c&&e.jsxs("div",{className:"mb-2 rounded-md border border-line bg-surface p-2",children:[e.jsx(V,{className:"mb-1.5",placeholder:"标题",value:c.title,onChange:s=>r({...c,title:s.target.value})}),e.jsxs("div",{className:"mb-1.5 grid grid-cols-2 gap-1.5",children:[e.jsx(V,{placeholder:"副标题(单位/角色)",value:c.subtitle??"",onChange:s=>r({...c,subtitle:s.target.value})}),e.jsx(V,{placeholder:"日期(2025.9)",value:c.date??"",onChange:s=>r({...c,date:s.target.value})})]}),e.jsx(de,{rows:2,placeholder:"描述:做了什么、负责什么、学会什么",value:c.desc??"",onChange:s=>r({...c,desc:s.target.value})}),e.jsxs("div",{className:"mt-1.5 flex gap-1.5",children:[e.jsx(R,{size:"sm",variant:"primary",disabled:!c.title.trim(),onClick:()=>{c.title.trim()&&(w({items:[...j,{...c,id:"c"+Date.now()}]}),r(null))},children:"添加"}),e.jsx(R,{size:"sm",variant:"ghost",onClick:()=>r(null),children:"取消"})]})]}),j.map((s,x)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-surface p-1.5 text-[12px]",children:[e.jsxs("span",{className:"min-w-0 flex-1 truncate text-ink-1",children:[s.title,e.jsxs("span",{className:"text-ink-3",children:[" · ",s.date??""]})]}),e.jsx("button",{className:"text-ink-3 hover:text-danger","aria-label":"删除条目",onClick:()=>w({items:j.filter((o,S)=>S!==x)}),children:e.jsx(ie,{size:12})})]},x)),!j.length&&!c&&e.jsx("p",{className:"text-[11.5px] text-ink-3",children:"暂无自定义条目"})]}),e.jsxs("p",{className:"text-[11px] text-ink-3",children:["「",g,"」相关条目来自你的记录数据,此处可隐藏不需要展示的条目;描述可在预览中点击直接修改。"]})]})}export{et as ResumePage}; diff --git a/sync-server/www/assets/TaxonomyPage-Bx9s6yCR.js b/sync-server/www/assets/TaxonomyPage-Dz7XzeHU.js similarity index 97% rename from sync-server/www/assets/TaxonomyPage-Bx9s6yCR.js rename to sync-server/www/assets/TaxonomyPage-Dz7XzeHU.js index 8fb17f1..fe60a61 100644 --- a/sync-server/www/assets/TaxonomyPage-Bx9s6yCR.js +++ b/sync-server/www/assets/TaxonomyPage-Dz7XzeHU.js @@ -1 +1 @@ -import{j as e,u as k,d as q,f as z,r as g,g as h,V as F,W as w,B as j,T as D,I as Q,P as T,C as E,X as M,Y as B,s as P,Z as V}from"./index-AIpE8C-f.js";import{C as K,a as S}from"./card-DRk0nwkp.js";const f=["#3056d3","#7c3aed","#0891b2","#16a34a","#d97706","#dc2626","#db2777","#64748b"];function H(){return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsx("p",{className:"mb-4 text-[12px] text-ink-3",children:"字典驱动录入表单中的下拉选项;维度是自定义的成长分类轴,一条记录可挂多个维度。"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(C,{kind:"level",title:"级别字典",description:"国际级、国家级、省市级等,可按学校口径增改"}),e.jsx(C,{kind:"role",title:"角色字典",description:"主导、核心、参加等参与角色"}),e.jsx(I,{})]})]})}function C({kind:r,title:x,description:N}){var v;const l=k(),o=q(),n=(((v=z({queryKey:["taxonomy-all"],queryFn:()=>P()}).data)==null?void 0:v.items)??[]).filter(s=>s.kind===r).sort((s,m)=>s.sort-m.sort),[a,c]=g.useState(""),[u,d]=g.useState(null),t=h({mutationFn:F,onSuccess:()=>void l.invalidateQueries({queryKey:["taxonomy-all"]})}),i=h({mutationFn:s=>w(s),onSuccess:()=>{l.invalidateQueries({queryKey:["taxonomy-all"]}),o("success","已删除"),d(null)},onError:s=>{o("error",s.message),d(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:x,extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:N})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[n.map((s,m)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("input",{type:"color",value:s.color??f[m%f.length],className:"size-5 cursor-pointer rounded border border-line bg-surface",onChange:y=>t.mutate({id:s.id,kind:r,value:s.value,color:y.target.value,sort:s.sort})}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:s.value,onChange:()=>{},onBlur:y=>{const b=y.target.value.trim();b&&b!==s.value&&t.mutate({id:s.id,kind:r,value:b,color:s.color,sort:s.sort})},defaultValue:s.value},s.value),e.jsxs("span",{className:"num w-14 text-right text-[11px] text-ink-3",children:["#",s.sort]}),s.is_builtin?e.jsx("span",{className:"w-7 text-center text-[11px] text-ink-3",children:"内置"}):e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>d({id:s.id,value:s.value}),children:e.jsx(D,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增条目,回车或点击按钮",value:a,onChange:s=>c(s.target.value),onKeyDown:s=>{var m;s.key==="Enter"&&a.trim()&&(t.mutate({kind:r,value:a.trim(),sort:(((m=n.at(-1))==null?void 0:m.sort)??0)+10}),c(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!a.trim(),onClick:()=>{var s;t.mutate({kind:r,value:a.trim(),sort:(((s=n.at(-1))==null?void 0:s.sort)??0)+10}),c("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!u,title:"删除字典条目",content:u?"确定删除「"+u.value+"」吗?":"",onCancel:()=>d(null),onOk:()=>u&&i.mutate(u.id)})]})}function I(){var d;const r=k(),x=q(),l=[...((d=z({queryKey:["dimensions"],queryFn:V}).data)==null?void 0:d.items)??[]].sort((t,i)=>t.sort-i.sort),[o,p]=g.useState(""),[n,a]=g.useState(null),c=h({mutationFn:M,onSuccess:()=>void r.invalidateQueries({queryKey:["dimensions"]})}),u=h({mutationFn:t=>B(t),onSuccess:()=>{r.invalidateQueries({queryKey:["dimensions"]}),x("success","已删除"),a(null)},onError:t=>{x("error",t.message),a(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:"成长维度",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"如:学业深造 / 职业发展 / 兴趣生活"})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[l.map((t,i)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("span",{className:"size-3 rounded-full",style:{backgroundColor:t.color??f[i%f.length]}}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",defaultValue:t.name,onBlur:v=>{const s=v.target.value.trim();s&&s!==t.name&&c.mutate({id:t.id,name:s,color:t.color,sort:t.sort})}},t.name),e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>a({id:t.id,name:t.name}),children:e.jsx(D,{size:13})})]},t.id)),!l.length&&e.jsx("div",{className:"py-2 text-center text-[12px] text-ink-3",children:"尚未配置维度"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增维度名称",value:o,onChange:t=>p(t.target.value),onKeyDown:t=>{var i;t.key==="Enter"&&o.trim()&&(c.mutate({name:o.trim(),sort:(((i=l.at(-1))==null?void 0:i.sort)??0)+10}),p(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!o.trim(),onClick:()=>{var t;c.mutate({name:o.trim(),sort:(((t=l.at(-1))==null?void 0:t.sort)??0)+10}),p("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!n,title:"删除维度",content:n?"确定删除「"+n.name+"」吗?记录与该维度的关联将一并移除。":"",onCancel:()=>a(null),onOk:()=>n&&u.mutate(n.id)})]})}export{H as TaxonomyPage}; +import{j as e,u as k,d as q,f as z,r as g,g as h,V as F,W as w,B as j,T as D,I as Q,P as T,C as E,X as M,Y as B,s as P,Z as V}from"./index-T-NGjlrZ.js";import{C as K,a as S}from"./card-C5ifMTlY.js";const f=["#3056d3","#7c3aed","#0891b2","#16a34a","#d97706","#dc2626","#db2777","#64748b"];function H(){return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsx("p",{className:"mb-4 text-[12px] text-ink-3",children:"字典驱动录入表单中的下拉选项;维度是自定义的成长分类轴,一条记录可挂多个维度。"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(C,{kind:"level",title:"级别字典",description:"国际级、国家级、省市级等,可按学校口径增改"}),e.jsx(C,{kind:"role",title:"角色字典",description:"主导、核心、参加等参与角色"}),e.jsx(I,{})]})]})}function C({kind:r,title:x,description:N}){var v;const l=k(),o=q(),n=(((v=z({queryKey:["taxonomy-all"],queryFn:()=>P()}).data)==null?void 0:v.items)??[]).filter(s=>s.kind===r).sort((s,m)=>s.sort-m.sort),[a,c]=g.useState(""),[u,d]=g.useState(null),t=h({mutationFn:F,onSuccess:()=>void l.invalidateQueries({queryKey:["taxonomy-all"]})}),i=h({mutationFn:s=>w(s),onSuccess:()=>{l.invalidateQueries({queryKey:["taxonomy-all"]}),o("success","已删除"),d(null)},onError:s=>{o("error",s.message),d(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:x,extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:N})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[n.map((s,m)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("input",{type:"color",value:s.color??f[m%f.length],className:"size-5 cursor-pointer rounded border border-line bg-surface",onChange:y=>t.mutate({id:s.id,kind:r,value:s.value,color:y.target.value,sort:s.sort})}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:s.value,onChange:()=>{},onBlur:y=>{const b=y.target.value.trim();b&&b!==s.value&&t.mutate({id:s.id,kind:r,value:b,color:s.color,sort:s.sort})},defaultValue:s.value},s.value),e.jsxs("span",{className:"num w-14 text-right text-[11px] text-ink-3",children:["#",s.sort]}),s.is_builtin?e.jsx("span",{className:"w-7 text-center text-[11px] text-ink-3",children:"内置"}):e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>d({id:s.id,value:s.value}),children:e.jsx(D,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增条目,回车或点击按钮",value:a,onChange:s=>c(s.target.value),onKeyDown:s=>{var m;s.key==="Enter"&&a.trim()&&(t.mutate({kind:r,value:a.trim(),sort:(((m=n.at(-1))==null?void 0:m.sort)??0)+10}),c(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!a.trim(),onClick:()=>{var s;t.mutate({kind:r,value:a.trim(),sort:(((s=n.at(-1))==null?void 0:s.sort)??0)+10}),c("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!u,title:"删除字典条目",content:u?"确定删除「"+u.value+"」吗?":"",onCancel:()=>d(null),onOk:()=>u&&i.mutate(u.id)})]})}function I(){var d;const r=k(),x=q(),l=[...((d=z({queryKey:["dimensions"],queryFn:V}).data)==null?void 0:d.items)??[]].sort((t,i)=>t.sort-i.sort),[o,p]=g.useState(""),[n,a]=g.useState(null),c=h({mutationFn:M,onSuccess:()=>void r.invalidateQueries({queryKey:["dimensions"]})}),u=h({mutationFn:t=>B(t),onSuccess:()=>{r.invalidateQueries({queryKey:["dimensions"]}),x("success","已删除"),a(null)},onError:t=>{x("error",t.message),a(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:"成长维度",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"如:学业深造 / 职业发展 / 兴趣生活"})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[l.map((t,i)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("span",{className:"size-3 rounded-full",style:{backgroundColor:t.color??f[i%f.length]}}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",defaultValue:t.name,onBlur:v=>{const s=v.target.value.trim();s&&s!==t.name&&c.mutate({id:t.id,name:s,color:t.color,sort:t.sort})}},t.name),e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>a({id:t.id,name:t.name}),children:e.jsx(D,{size:13})})]},t.id)),!l.length&&e.jsx("div",{className:"py-2 text-center text-[12px] text-ink-3",children:"尚未配置维度"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增维度名称",value:o,onChange:t=>p(t.target.value),onKeyDown:t=>{var i;t.key==="Enter"&&o.trim()&&(c.mutate({name:o.trim(),sort:(((i=l.at(-1))==null?void 0:i.sort)??0)+10}),p(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!o.trim(),onClick:()=>{var t;c.mutate({name:o.trim(),sort:(((t=l.at(-1))==null?void 0:t.sort)??0)+10}),p("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!n,title:"删除维度",content:n?"确定删除「"+n.name+"」吗?记录与该维度的关联将一并移除。":"",onCancel:()=>a(null),onOk:()=>n&&u.mutate(n.id)})]})}export{H as TaxonomyPage}; diff --git a/sync-server/www/assets/TypesPage-MLRGRNax.js b/sync-server/www/assets/TypesPage-ylNPxGjz.js similarity index 98% rename from sync-server/www/assets/TypesPage-MLRGRNax.js rename to sync-server/www/assets/TypesPage-ylNPxGjz.js index 28392d3..2bf2175 100644 --- a/sync-server/www/assets/TypesPage-MLRGRNax.js +++ b/sync-server/www/assets/TypesPage-ylNPxGjz.js @@ -1,4 +1,4 @@ -import{c as D,u as K,d as F,f as L,r,g as I,j as e,B as p,P as q,M as O,m as _,l as H,T as P,C as R,N as G,F as U,H as i,I as j,O as W,S as z,Q as J,U as V,q as X}from"./index-AIpE8C-f.js";import{C as Y}from"./card-DRk0nwkp.js";/** +import{c as D,u as K,d as F,f as L,r,g as I,j as e,B as p,P as q,M as O,m as _,l as H,T as P,C as R,N as G,F as U,H as i,I as j,O as W,S as z,Q as J,U as V,q as X}from"./index-T-NGjlrZ.js";import{C as Y}from"./card-C5ifMTlY.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/card-DRk0nwkp.js b/sync-server/www/assets/card-C5ifMTlY.js similarity index 89% rename from sync-server/www/assets/card-DRk0nwkp.js rename to sync-server/www/assets/card-C5ifMTlY.js index 464eacd..b9926ce 100644 --- a/sync-server/www/assets/card-DRk0nwkp.js +++ b/sync-server/www/assets/card-C5ifMTlY.js @@ -1 +1 @@ -import{j as s,a}from"./index-AIpE8C-f.js";function i({className:r,...e}){return s.jsx("div",{className:a("rounded-lg border border-line bg-surface shadow-card",r),...e})}function t({title:r,extra:e,className:n}){return s.jsxs("div",{className:a("flex min-h-11 flex-wrap items-center justify-between gap-2 border-b border-line px-4 py-1.5",n),children:[s.jsx("h3",{className:"text-[13px] font-semibold text-ink-1",children:r}),e&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e})]})}function c({className:r,...e}){return s.jsx("div",{className:a("p-4",r),...e})}export{i as C,t as a,c as b}; +import{j as s,a}from"./index-T-NGjlrZ.js";function i({className:r,...e}){return s.jsx("div",{className:a("rounded-lg border border-line bg-surface shadow-card",r),...e})}function t({title:r,extra:e,className:n}){return s.jsxs("div",{className:a("flex min-h-11 flex-wrap items-center justify-between gap-2 border-b border-line px-4 py-1.5",n),children:[s.jsx("h3",{className:"text-[13px] font-semibold text-ink-1",children:r}),e&&s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e})]})}function c({className:r,...e}){return s.jsx("div",{className:a("p-4",r),...e})}export{i as C,t as a,c as b}; diff --git a/sync-server/www/assets/index-AIpE8C-f.js b/sync-server/www/assets/index-T-NGjlrZ.js similarity index 99% rename from sync-server/www/assets/index-AIpE8C-f.js rename to sync-server/www/assets/index-T-NGjlrZ.js index 3221029..8aecc7a 100644 --- a/sync-server/www/assets/index-AIpE8C-f.js +++ b/sync-server/www/assets/index-T-NGjlrZ.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-BQmjPh_R.js","assets/card-DRk0nwkp.js","assets/useChart-BPFULpBT.js","assets/echarts-BIWefrIc.js","assets/GradesPage-DA15g7rj.js","assets/TypesPage-MLRGRNax.js","assets/TaxonomyPage-Bx9s6yCR.js","assets/AdminPage-Br3ZHwTZ.js","assets/refresh-cw-DydAoMbT.js","assets/ResumePage-CO3gtN78.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-D4LhDSa-.js","assets/card-C5ifMTlY.js","assets/useChart-dAkYJqaV.js","assets/echarts-BIWefrIc.js","assets/GradesPage-BA4OWO_9.js","assets/TypesPage-ylNPxGjz.js","assets/TaxonomyPage-Dz7XzeHU.js","assets/AdminPage-Cppzhhx8.js","assets/refresh-cw-DXuKsZdS.js","assets/ResumePage-DoaIVQ9K.js"])))=>i.map(i=>d[i]); var wp=n=>{throw TypeError(n)};var Kf=(n,r,s)=>r.has(n)||wp("Cannot "+s);var T=(n,r,s)=>(Kf(n,r,"read from private field"),s?s.call(n):r.get(n)),he=(n,r,s)=>r.has(n)?wp("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),P=(n,r,s,o)=>(Kf(n,r,"write to private field"),o?o.call(n,s):r.set(n,s),s),Se=(n,r,s)=>(Kf(n,r,"access private method"),s);var Ys=(n,r,s,o)=>({set _(f){P(n,r,f,s)},get _(){return T(n,r,o)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const d of m.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function s(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(f){if(f.ep)return;f.ep=!0;const m=s(f);fetch(f.href,m)}})();var L5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ag(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zf={exports:{}},Iu={};/** * @license React * react-jsx-runtime.production.js @@ -329,4 +329,4 @@ Please change the parent to Ce("app_info"),E4=()=>Ce("sync_status"),ro=()=>Ce("type_list"),_4=n=>Ce("type_upsert",n),T4=n=>Ce("type_delete",{id:n}),E0=n=>Ce("taxonomy_list",{kind:n}),N4=n=>Ce("taxonomy_upsert",n),w4=n=>Ce("taxonomy_delete",{id:n}),Wd=()=>Ce("dimension_list"),C4=n=>Ce("dimension_upsert",n),j4=n=>Ce("dimension_delete",{id:n}),_0=(n={})=>Ce("footprint_list",{query:n}),Id=n=>Ce("footprint_get",{id:n}),T0=n=>Ce("footprint_upsert",{item:n}),z4=n=>Ce("footprint_delete",{id:n}),N0=(n={})=>Ce("timeline",{query:n}),O4=n=>Ce("stats_overview",{year:n}),R4=()=>Ce("metric_list"),A4=n=>Ce("metric_upsert",n),M4=n=>Ce("metric_delete",{key:n}),D4=()=>Ce("grades_overview"),U4=n=>Ce("semester_upsert",n),k4=n=>Ce("semester_delete",{id:n}),H4=n=>Ce("course_upsert",n),q4=n=>Ce("course_delete",{id:n}),L4=n=>Ce("band_upsert",n),B4=n=>Ce("band_delete",{id:n}),w0=n=>Ce("attachment_list",{owner_id:n}),C0=n=>Ce("attachment_delete",{id:n}),eo=n=>Ce("attachment_read",{id:n});async function Td(n,r,s){const o=new URLSearchParams({owner:String(n),name:r.name,mime:r.type||"application/octet-stream"}),f=await fetch(Ol()+"/sync/attachment/raw?"+o,{method:"PUT",headers:{authorization:"Bearer "+vl(),"content-type":r.type||"application/octet-stream"},body:r}),m=await f.json().catch(()=>({ok:!1,error:"HTTP "+f.status}));if(!m.ok)throw new Error(m.error||"上传失败");const d=m.data.item;if(s)try{await Ce("attachment_set_thumb",{id:d.id,thumb_b64:s})}catch{}return d}async function j0(n){var f;const r=await fetch(Ol()+"/api/attachment_download",{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+vl()},body:JSON.stringify({id:n})});if(!r.ok){const m=await r.json().catch(()=>null);throw new Error((m==null?void 0:m.error)||"下载失败")}const s=decodeURIComponent(r.headers.get("x-file-name")||((f=(r.headers.get("content-disposition")||"").match(/UTF-8''([^;]+)/))==null?void 0:f[1])||"file"),o=r.headers.get("content-type")||void 0;return{blob:await r.blob(),file_name:s,mime:o}}const z0=n=>Ce("attachment_thumb",{id:n}),Q4=()=>Ce("view_list"),G4=n=>Ce("view_upsert",n),Y4=n=>Ce("view_delete",{id:n});async function nu(n,r,s){const o=await fetch((s||Ol())+n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+vl()},body:JSON.stringify(r??{})}),f=await o.json().catch(()=>({ok:!1,error:"HTTP "+o.status}));if(!f.ok)throw new Error(f.error||"请求失败");return f.data}async function O0(n,r){const s=await fetch((r||Ol())+n,{headers:{Authorization:"Bearer "+vl()}}),o=await s.json().catch(()=>({ok:!1,error:"HTTP "+s.status}));if(!o.ok)throw new Error(o.error||"请求失败");return o.data}const V4=n=>O0("/admin/invites",n),X4=n=>O0("/admin/users",n),K4=(n,r)=>nu("/admin/invites/generate",{count:n},r),Z4=(n,r,s)=>nu("/admin/invites/create",{code:n,remark:r},s),J4=(n,r,s)=>nu("/admin/invites/update",{id:n,...r},s),F4=n=>nu("/admin/demo-rebuild",{},n),$4=(n,r)=>nu("/admin/users/delete",{user_id:n},r),P4=(n,r)=>nu("/admin/invites/delete",{id:n},r),W4=()=>Ce("profile_get",{}),I4=n=>Ce("profile_upsert",{content:n});async function e_(n){const r=await new Promise((f,m)=>{const d=new FileReader;d.onload=()=>f(String(d.result||"").split(",")[1]||""),d.onerror=()=>m(new Error("读取文件失败")),d.readAsDataURL(n)}),o=await(await fetch(Ol()+"/api/profile_photo",{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+vl()},body:JSON.stringify({data_b64:r,file_name:n.name,mime:n.type||"image/png"})})).json().catch(()=>null);if(!(o!=null&&o.ok))throw new Error((o==null?void 0:o.error)||"证件照上传失败");return o.data.url}const t_=Object.freeze(Object.defineProperty({__proto__:null,AuthError:_d,adminCreateInvite:Z4,adminDeleteInvite:P4,adminDeleteUser:$4,adminDemoRebuild:F4,adminGenerateInvites:K4,adminListInvites:V4,adminListUsers:X4,adminUpdateInvite:J4,appInfo:S4,attachmentDelete:C0,attachmentDownload:j0,attachmentList:w0,attachmentRead:eo,attachmentThumb:z0,attachmentUploadRaw:Td,bandDelete:B4,bandUpsert:L4,clearToken:Fd,courseDelete:q4,courseUpsert:H4,deleteDimension:j4,deleteTaxonomy:w4,deleteType:T4,footprintDelete:z4,footprintGet:Id,footprintList:_0,footprintUpsert:T0,getServerUrl:Ol,getToken:vl,gradesOverview:D4,listDimensions:Wd,listTaxonomy:E0,listTypes:ro,metricDelete:M4,metricList:R4,metricUpsert:A4,profileGet:W4,profilePhotoUpload:e_,profileUpsert:I4,semesterDelete:k4,semesterUpsert:U4,serverLogin:$d,serverMe:b0,serverRegister:Pd,setServerUrl:S0,setToken:Jd,statsOverview:O4,syncStatus:E4,timeline:N0,upsertDimension:C4,upsertTaxonomy:N4,upsertType:_4,viewDelete:Y4,viewList:Q4,viewUpsert:G4},Symbol.toStringTag,{value:"Module"}));function R0(n){var r,s,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var f=n.length;for(r=0;rtypeof n=="boolean"?`${n}`:n===0?"0":n,ag=A0,l_=(n,r)=>s=>{var o;if((r==null?void 0:r.variants)==null)return ag(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:f,defaultVariants:m}=r,d=Object.keys(f).map(p=>{const x=s==null?void 0:s[p],g=m==null?void 0:m[p];if(x===null)return null;const _=lg(x)||lg(g);return f[p][_]}),v=s&&Object.entries(s).reduce((p,x)=>{let[g,_]=x;return _===void 0||(p[g]=_),p},{}),b=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((p,x)=>{let{class:g,className:_,...k}=x;return Object.entries(k).every(K=>{let[q,D]=K;return Array.isArray(D)?D.includes({...m,...v}[q]):{...m,...v}[q]===D})?[...p,g,_]:p},[]);return ag(n,d,b,s==null?void 0:s.class,s==null?void 0:s.className)},a_=(n,r)=>{const s=new Array(n.length+r.length);for(let o=0;o({classGroupId:n,validator:r}),M0=(n=new Map,r=null,s)=>({nextPart:n,validators:r,classGroupId:s}),to="-",ng=[],i_="arbitrary..",u_=n=>{const r=s_(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return r_(d);const v=d.split(to),b=v[0]===""&&v.length>1?1:0;return D0(v,b,r)},getConflictingClassGroupIds:(d,v)=>{if(v){const b=o[d],p=s[d];return b?p?a_(p,b):b:p||ng}return s[d]||ng}}},D0=(n,r,s)=>{if(n.length-r===0)return s.classGroupId;const f=n[r],m=s.nextPart.get(f);if(m){const p=D0(n,r+1,m);if(p)return p}const d=s.validators;if(d===null)return;const v=r===0?n.join(to):n.slice(r).join(to),b=d.length;for(let p=0;pn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),s=r.indexOf(":"),o=r.slice(0,s);return o?i_+o:void 0})(),s_=n=>{const{theme:r,classGroups:s}=n;return o_(s,r)},o_=(n,r)=>{const s=M0();for(const o in n){const f=n[o];eh(f,s,o,r)}return s},eh=(n,r,s,o)=>{const f=n.length;for(let m=0;m{if(typeof n=="string"){f_(n,r,s);return}if(typeof n=="function"){d_(n,r,s,o);return}h_(n,r,s,o)},f_=(n,r,s)=>{const o=n===""?r:U0(r,n);o.classGroupId=s},d_=(n,r,s,o)=>{if(m_(n)){eh(n(o),r,s,o);return}r.validators===null&&(r.validators=[]),r.validators.push(n_(s,n))},h_=(n,r,s,o)=>{const f=Object.entries(n),m=f.length;for(let d=0;d{let s=n;const o=r.split(to),f=o.length;for(let m=0;m"isThemeGetter"in n&&n.isThemeGetter===!0,y_=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),o=Object.create(null);const f=(m,d)=>{s[m]=d,r++,r>n&&(r=0,o=s,s=Object.create(null))};return{get(m){let d=s[m];if(d!==void 0)return d;if((d=o[m])!==void 0)return f(m,d),d},set(m,d){m in s?s[m]=d:f(m,d)}}},Nd="!",ig=":",v_=[],ug=(n,r,s,o,f)=>({modifiers:n,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:o,isExternal:f}),p_=n=>{const{prefix:r,experimentalParseClassName:s}=n;let o=f=>{const m=[];let d=0,v=0,b=0,p;const x=f.length;for(let q=0;qb?p-b:void 0;return ug(m,k,_,K)};if(r){const f=r+ig,m=o;o=d=>d.startsWith(f)?m(d.slice(f.length)):ug(v_,!1,d,void 0,!0)}if(s){const f=o;o=m=>s({className:m,parseClassName:f})}return o},g_=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((s,o)=>{r.set(s,1e6+o)}),s=>{const o=[];let f=[];for(let m=0;m0&&(f.sort(),o.push(...f),f=[]),o.push(d)):f.push(d)}return f.length>0&&(f.sort(),o.push(...f)),o}},b_=n=>({cache:y_(n.cacheSize),parseClassName:p_(n),sortModifiers:g_(n),postfixLookupClassGroupIds:x_(n),...u_(n)}),x_=n=>{const r=Object.create(null),s=n.postfixLookupClassGroups;if(s)for(let o=0;o{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:f,sortModifiers:m,postfixLookupClassGroupIds:d}=r,v=[],b=n.trim().split(S_);let p="";for(let x=b.length-1;x>=0;x-=1){const g=b[x],{isExternal:_,modifiers:k,hasImportantModifier:K,baseClassName:q,maybePostfixModifierPosition:D}=s(g);if(_){p=g+(p.length>0?" "+p:p);continue}let H=!!D,Q;if(H){const F=q.substring(0,D);Q=o(F);const U=Q&&d[Q]?o(q):void 0;U&&U!==Q&&(Q=U,H=!1)}else Q=o(q);if(!Q){if(!H){p=g+(p.length>0?" "+p:p);continue}if(Q=o(q),!Q){p=g+(p.length>0?" "+p:p);continue}H=!1}const Z=k.length===0?"":k.length===1?k[0]:m(k).join(":"),J=K?Z+Nd:Z,Y=J+Q;if(v.indexOf(Y)>-1)continue;v.push(Y);const de=f(Q,H);for(let F=0;F0?" "+p:p)}return p},__=(...n)=>{let r=0,s,o,f="";for(;r{if(typeof n=="string")return n;let r,s="";for(let o=0;o{let s,o,f,m;const d=b=>{const p=r.reduce((x,g)=>g(x),n());return s=b_(p),o=s.cache.get,f=s.cache.set,m=v,v(b)},v=b=>{const p=o(b);if(p)return p;const x=E_(b,s);return f(b,x),x};return m=d,(...b)=>m(__(...b))},N_=[],ct=n=>{const r=s=>s[n]||N_;return r.isThemeGetter=!0,r.themeKey=n,r},H0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,q0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,w_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,C_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,j_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,z_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,O_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Za=n=>w_.test(n),_e=n=>!!n&&!Number.isNaN(Number(n)),Xl=n=>!!n&&Number.isInteger(Number(n)),ad=n=>n.endsWith("%")&&_e(n.slice(0,-1)),fa=n=>C_.test(n),L0=()=>!0,A_=n=>j_.test(n)&&!z_.test(n),th=()=>!1,M_=n=>O_.test(n),D_=n=>R_.test(n),U_=n=>!ne(n)&&!ue(n),k_=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),H_=n=>nn(n,G0,th),ne=n=>H0.test(n),zn=n=>nn(n,Y0,A_),rg=n=>nn(n,X_,_e),q_=n=>nn(n,X0,L0),L_=n=>nn(n,V0,th),sg=n=>nn(n,B0,th),B_=n=>nn(n,Q0,D_),Ks=n=>nn(n,K0,M_),ue=n=>q0.test(n),lr=n=>Vn(n,Y0),Q_=n=>Vn(n,V0),og=n=>Vn(n,B0),G_=n=>Vn(n,G0),Y_=n=>Vn(n,Q0),Zs=n=>Vn(n,K0,!0),V_=n=>Vn(n,X0,!0),nn=(n,r,s)=>{const o=H0.exec(n);return o?o[1]?r(o[1]):s(o[2]):!1},Vn=(n,r,s=!1)=>{const o=q0.exec(n);return o?o[1]?r(o[1]):s:!1},B0=n=>n==="position"||n==="percentage",Q0=n=>n==="image"||n==="url",G0=n=>n==="length"||n==="size"||n==="bg-size",Y0=n=>n==="length",X_=n=>n==="number",V0=n=>n==="family-name",X0=n=>n==="number"||n==="weight",K0=n=>n==="shadow",K_=()=>{const n=ct("color"),r=ct("font"),s=ct("text"),o=ct("font-weight"),f=ct("tracking"),m=ct("leading"),d=ct("breakpoint"),v=ct("container"),b=ct("spacing"),p=ct("radius"),x=ct("shadow"),g=ct("inset-shadow"),_=ct("text-shadow"),k=ct("drop-shadow"),K=ct("blur"),q=ct("perspective"),D=ct("aspect"),H=ct("ease"),Q=ct("animate"),Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],J=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...J(),ue,ne],de=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],U=()=>[ue,ne,b],I=()=>[Za,"full","auto",...U()],le=()=>[Xl,"none","subgrid",ue,ne],Ve=()=>["auto",{span:["full",Xl,ue,ne]},Xl,ue,ne],Fe=()=>[Xl,"auto",ue,ne],ie=()=>["auto","min","max","fr",ue,ne],Te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...U()],ee=()=>[Za,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],R=()=>[v,Za,"screen","full","dvw","lvw","svw","min","max","fit",...U()],ae=()=>[Za,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],X=()=>[n,ue,ne],ke=()=>[...J(),og,sg,{position:[ue,ne]}],Nt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Rl=()=>["auto","cover","contain",G_,H_,{size:[ue,ne]}],w=()=>[ad,lr,zn],G=()=>["","none","full",p,ue,ne],W=()=>["",_e,lr,zn],ce=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[_e,ad,og,sg],Ae=()=>["","none",K,ue,ne],se=()=>["none",_e,ue,ne],ye=()=>["none",_e,ue,ne],Yt=()=>[_e,ue,ne],pa=()=>[Za,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fa],breakpoint:[fa],color:[L0],container:[fa],"drop-shadow":[fa],ease:["in","out","in-out"],font:[U_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fa],shadow:[fa],spacing:["px",_e],text:[fa],"text-shadow":[fa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Za,ne,ue,D]}],container:["container"],"container-type":[{"@container":["","normal","size",ue,ne]}],"container-named":[k_],columns:[{columns:[_e,"auto",ne,ue,v]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:de()}],"overflow-x":[{"overflow-x":de()}],"overflow-y":[{"overflow-y":de()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Xl,"auto",ue,ne]}],basis:[{basis:[Za,"full","auto",v,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Za,"auto","initial","none",ne]}],grow:[{grow:["",_e,ue,ne]}],shrink:[{shrink:["",_e,ue,ne]}],order:[{order:[Xl,"first","last","none",ue,ne]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:Ve()}],"col-start":[{"col-start":Fe()}],"col-end":[{"col-end":Fe()}],"grid-rows":[{"grid-rows":le()}],"row-start-end":[{row:Ve()}],"row-start":[{"row-start":Fe()}],"row-end":[{"row-end":Fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...Te(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...Te()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":Te()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...ae()]}],"min-block-size":[{"min-block":["auto",...ae()]}],"max-block-size":[{"max-block":["none",...ae()]}],w:[{w:[v,"screen",...ee()]}],"min-w":[{"min-w":[v,"screen","none",...ee()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[d]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh","none",...ee()]}],"font-size":[{text:["base",s,lr,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,V_,q_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ad,ne]}],"font-family":[{font:[Q_,L_,r]}],"font-features":[{"font-features":[ne]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[f,ue,ne]}],"line-clamp":[{"line-clamp":[_e,"none",ue,rg]}],leading:[{leading:["none",m,...U()]}],"list-image":[{"list-image":["none",ue,ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ue,ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",ue,zn]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[_e,"auto",ue,ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[Xl,ue,ne]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue,ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ue,ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ke()}],"bg-repeat":[{bg:Nt()}],"bg-size":[{bg:Rl()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xl,ue,ne],radial:["",ue,ne],conic:["",Xl,ue,ne]},Y_,B_]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:w()}],"gradient-via-pos":[{via:w()}],"gradient-to-pos":[{to:w()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-bs":[{"border-bs":W()}],"border-w-be":[{"border-be":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,ue,ne]}],"outline-w":[{outline:["",_e,lr,zn]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","inner","none",x,Zs,Ks]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",g,Zs,Ks]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[_e,zn]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",_,Zs,Ks]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[_e,ue,ne]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[ue,ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":J()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ke()}],"mask-repeat":[{mask:Nt()}],"mask-size":[{mask:Rl()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ue,ne]}],filter:[{filter:["","none",ue,ne]}],blur:[{blur:Ae()}],brightness:[{brightness:[_e,ue,ne]}],contrast:[{contrast:[_e,ue,ne]}],"drop-shadow":[{"drop-shadow":["","none",k,Zs,Ks]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",_e,ue,ne]}],"hue-rotate":[{"hue-rotate":[_e,ue,ne]}],invert:[{invert:["",_e,ue,ne]}],saturate:[{saturate:[_e,ue,ne]}],sepia:[{sepia:["",_e,ue,ne]}],"backdrop-filter":[{"backdrop-filter":["","none",ue,ne]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[_e,ue,ne]}],"backdrop-contrast":[{"backdrop-contrast":[_e,ue,ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,ue,ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,ue,ne]}],"backdrop-invert":[{"backdrop-invert":["",_e,ue,ne]}],"backdrop-opacity":[{"backdrop-opacity":[_e,ue,ne]}],"backdrop-saturate":[{"backdrop-saturate":[_e,ue,ne]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,ue,ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ue,ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",ue,ne]}],ease:[{ease:["linear","initial",H,ue,ne]}],delay:[{delay:[_e,ue,ne]}],animate:[{animate:["none",Q,ue,ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[q,ue,ne]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:Yt()}],"skew-x":[{"skew-x":Yt()}],"skew-y":[{"skew-y":Yt()}],transform:[{transform:[ue,ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:pa()}],"translate-x":[{"translate-x":pa()}],"translate-y":[{"translate-y":pa()}],"translate-z":[{"translate-z":pa()}],"translate-none":["translate-none"],zoom:[{zoom:[Xl,ue,ne]}],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ue,ne]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":X()}],"scrollbar-track-color":[{"scrollbar-track":X()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ue,ne]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[_e,lr,zn,rg]}],stroke:[{stroke:["none",...X()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Z_=T_(K_);function pl(...n){return Z_(A0(n))}const J_=l_("inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors select-none disabled:pointer-events-none disabled:opacity-45",{variants:{variant:{primary:"bg-brand text-white hover:bg-brand-hover shadow-card",secondary:"bg-surface text-ink-1 border border-line hover:bg-surface-3 hover:border-line-strong",ghost:"text-ink-2 hover:bg-surface-3 hover:text-ink-1",subtle:"bg-brand-subtle text-brand-text hover:brightness-[0.97]",danger:"bg-danger text-white hover:brightness-110","danger-ghost":"text-danger hover:bg-danger-subtle"},size:{sm:"h-7 px-2.5 text-[12px]",md:"h-8 px-3 text-[13px]",lg:"h-9 px-4 text-sm",icon:"h-8 w-8 p-0","icon-sm":"h-7 w-7 p-0"}},defaultVariants:{variant:"secondary",size:"md"}}),zt=E.forwardRef(function({className:r,variant:s,size:o,...f},m){return h.jsx("button",{ref:m,className:pl(J_({variant:s,size:o}),r),...f})}),Z0="w-full rounded-md border border-line bg-surface px-2.5 text-[13px] text-ink-1 placeholder:text-ink-3 transition-colors hover:border-line-strong focus:border-brand focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",nt=E.forwardRef(function({className:r,...s},o){return h.jsx("input",{ref:o,className:pl(Z0,"h-8",r),...s})}),wd=E.forwardRef(function({className:r,...s},o){return h.jsx("textarea",{ref:o,className:pl(Z0,"py-2 min-h-[72px] resize-y leading-relaxed",r),...s})});function De({label:n,required:r,hint:s,className:o,children:f}){return h.jsxs("div",{className:pl("flex flex-col gap-1.5",o),children:[h.jsxs("label",{className:"text-[12px] font-medium text-ink-2",children:[n,r&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"}),s&&h.jsx("span",{className:"text-ink-3 font-normal ml-2",children:s})]}),f]})}const ml=E.forwardRef(function({className:r,options:s,children:o,...f},m){return h.jsxs("div",{className:pl("relative",r?r.split(" ").filter(d=>/^w-|^min-w|^flex-/.test(d)).join(" "):""),children:[h.jsx("select",{ref:m,className:pl("w-full h-8 appearance-none rounded-md border border-line bg-surface pl-2.5 pr-7 text-[13px] text-ink-1","transition-colors hover:border-line-strong focus:border-brand focus:outline-none disabled:opacity-50",r),...f,children:s?s.map(d=>h.jsx("option",{value:d.value,children:d.label},d.value)):o}),h.jsx(J3,{size:14,className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-ink-3"})]})});function Ii({className:n,color:r,...s}){return h.jsx("span",{className:pl("inline-flex items-center gap-1 rounded-sm border px-1.5 py-px text-[11px] leading-[18px] font-medium whitespace-nowrap",n),style:r?{color:r,borderColor:r+"44",backgroundColor:r+"14"}:void 0,...s})}function F_({className:n,...r}){return h.jsx("span",{className:pl("inline-flex items-center gap-1 rounded-sm border border-line bg-surface-2 px-1.5 py-px text-[11px] leading-[18px] font-medium text-ink-2 whitespace-nowrap",n),...r})}function so({open:n,onClose:r,title:s,width:o=560,children:f,footer:m}){return E.useEffect(()=>{if(!n)return;const d=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[n,r]),n?KS.createPortal(h.jsxs("div",{className:"fixed inset-0 z-50 flex justify-center overflow-y-auto p-3 sm:p-6",children:[h.jsx("div",{className:"fixed inset-0 bg-black/45",onClick:r}),h.jsxs("div",{className:"animate-in relative my-auto w-full rounded-lg border border-line bg-surface shadow-pop",style:{maxWidth:o},role:"dialog",children:[h.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-line px-4",children:[h.jsx("div",{className:"text-sm font-semibold text-ink-1",children:s}),h.jsx(zt,{variant:"ghost",size:"icon-sm",onClick:r,"aria-label":"关闭",children:h.jsx(g0,{size:15})})]}),h.jsx("div",{className:"max-h-[70vh] overflow-y-auto px-3 py-3 sm:px-4 sm:py-4",children:f}),m&&h.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-3 py-2.5 sm:h-14 sm:flex-nowrap sm:px-4 sm:py-0",children:m})]})]}),document.body):null}function $_({icon:n,title:r,description:s,action:o}){return h.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[h.jsx("div",{className:"text-ink-3",children:n??h.jsx(gE,{size:36,strokeWidth:1.5})}),h.jsx("div",{className:"text-[13px] font-medium text-ink-2",children:r}),s&&h.jsx("div",{className:"max-w-[360px] text-[12px] text-ink-3",children:s}),o&&h.jsx("div",{className:"mt-2",children:o})]})}const J0=E.createContext(()=>{});function oo(){return E.useContext(J0)}const P_={success:h.jsx(W3,{size:15,className:"text-success"}),error:h.jsx($3,{size:15,className:"text-danger"}),info:h.jsx(xE,{size:15,className:"text-brand"})};function W_({children:n}){const[r,s]=E.useState([]),o=E.useRef(0),f=E.useCallback((m,d)=>{const v=++o.current;s(b=>[...b,{id:v,kind:m,text:d}]),setTimeout(()=>s(b=>b.filter(p=>p.id!==v)),3200)},[]);return h.jsxs(J0.Provider,{value:f,children:[n,h.jsx("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex flex-col gap-2",children:r.map(m=>h.jsxs("div",{className:pl("pointer-events-auto flex items-center gap-2 rounded-md border border-line bg-surface px-3 py-2 text-[13px] text-ink-1 shadow-pop","animate-in"),children:[P_[m.kind],m.text]},m.id))})]})}function I_({open:n,title:r,content:s,onCancel:o,onOk:f,loading:m}){return h.jsx(so,{open:n,onClose:o,title:r,width:420,footer:h.jsxs(h.Fragment,{children:[h.jsx(zt,{variant:"secondary",onClick:o,children:"取消"}),h.jsx(zt,{variant:"danger",onClick:f,disabled:m,children:"确认"})]}),children:h.jsx("p",{className:"text-[13px] text-ink-2",children:s??"该操作不可撤销,请确认。"})})}function e5({size:n=44}){return h.jsxs("svg",{width:n,height:n,viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[h.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),h.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),h.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function t5({open:n,onClose:r,defaultUrl:s}){const o=lu(),f=oo(),[m,d]=E.useState("login"),[v,b]=E.useState(s||"https://footpr.linyux.cn"),[p,x]=E.useState(""),[g,_]=E.useState(""),[k,K]=E.useState(""),[q,D]=E.useState(""),[H,Q]=E.useState(!1),Z=async()=>{if(!p.trim()||!g){D("请填写账号与密码");return}let J=v.trim();J&&!J.startsWith("http")&&(J="https://"+J),Q(!0),D("");try{if(m==="login")await $d(p.trim(),g,J);else{if(!k.trim())throw new Error("请填写邀请码");await Pd(p.trim(),g,k.trim(),J)}o.invalidateQueries(),f("success",m==="login"?"已登录 · 同步已开启":"已注册登录 · 同步已开启"),r(),setTimeout(()=>window.location.reload(),300)}catch(Y){D(Y.message)}finally{Q(!1)}};return n?h.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-bg/95",children:h.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[h.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[h.jsx(e5,{}),h.jsx("div",{className:"text-[17px] font-semibold tracking-tight text-ink-1",children:"足迹"}),h.jsx("div",{className:"text-[10px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),h.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(m==="login"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{d("login"),D("")},children:"登录"}),h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(m==="register"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{d("register"),D("")},children:"注册"})]}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx(De,{label:"服务器地址",hint:"与网页版同一账号体系",children:h.jsx(nt,{value:v,onChange:J=>b(J.target.value),placeholder:"https://footpr.linyux.cn"})}),h.jsx(De,{label:"用户名",required:!0,children:h.jsx(nt,{value:p,onChange:J=>x(J.target.value),placeholder:"3-32 位字母数字-_"})}),h.jsx(De,{label:"密码",required:!0,children:h.jsx(nt,{type:"password",value:g,onChange:J=>_(J.target.value),placeholder:"至少 8 位"})}),m==="register"&&h.jsx(De,{label:"邀请码",required:!0,hint:"向管理员索取",children:h.jsx(nt,{value:k,onChange:J=>K(J.target.value),placeholder:"邀请码"})}),q&&h.jsx("div",{className:"text-[12px] text-danger",children:q}),h.jsx(zt,{variant:"primary",size:"lg",onClick:()=>void Z(),disabled:H,children:H?"请稍候…":m==="login"?"登录并同步":"注册并同步"}),h.jsx("p",{className:"text-center text-[11px] text-ink-3",children:"登录后本机数据将多端同步"})]})]})}):null}const l5=[{section:"工作区",items:[{to:"/timeline",label:"时间线",icon:m0},{to:"/records",label:"记录",icon:FE},{to:"/grades",label:"成绩",icon:v0},{to:"/dashboard",label:"统计",icon:K3}]},{section:"个人",items:[{to:"/profile",label:"个人信息",icon:p4},{to:"/resume",label:"我的简历",icon:PE}]},{section:"配置",items:[{to:"/admin",label:"管理",icon:i4},{to:"/types",label:"记录类型",icon:t4},{to:"/taxonomy",label:"字典与维度",icon:r4}]}];function a5(){return h.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"lg",x1:"0",y1:"0",x2:"0",y2:"26",children:[h.jsx("stop",{stopColor:"#4359e8"}),h.jsx("stop",{offset:"1",stopColor:"#2a3ab8"})]})}),h.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"7",fill:"url(#lg)"}),h.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:".95",transform:"rotate(-18 11 10)"}),h.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:".7"})]})}function n5({open:n,onClose:r}){const s=lu(),f=yl({queryKey:["me",vl()??""],refetchOnMount:"always",queryFn:()=>b0(),enabled:!!vl(),retry:0}).data??null,[m,d]=E.useState(!1);return h.jsxs("aside",{className:pl("no-print","flex w-[236px] shrink-0 flex-col border-r border-line bg-surface","max-lg:fixed max-lg:inset-y-0 max-lg:left-0 max-lg:z-40 max-lg:transition-transform",n?"max-lg:translate-x-0":"max-lg:-translate-x-full"),children:[h.jsx(t5,{open:m,onClose:()=>d(!1),defaultUrl:"https://footpr.linyux.cn"}),h.jsxs("div",{className:"flex h-[60px] items-center gap-3 border-b border-line px-5",children:[h.jsx(a5,{}),h.jsxs("div",{className:"leading-tight",children:[h.jsx("div",{className:"text-[15px] font-bold tracking-tight text-ink-1",children:"足迹"}),h.jsx("div",{className:"text-[9px] font-medium tracking-[0.24em] text-ink-3",children:"FOOTPRINTS"})]})]}),h.jsx("nav",{className:"flex-1 overflow-y-auto px-2.5 py-4",children:l5.map(v=>h.jsxs("div",{className:"mb-5",children:[h.jsx("div",{className:"px-2.5 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-ink-3",children:v.section}),h.jsx("div",{className:"flex flex-col gap-0.5",children:v.items.map(b=>h.jsxs(e0,{to:b.to,onClick:r,className:({isActive:p})=>pl("relative flex h-[34px] items-center gap-3 rounded-lg px-3 text-[13px] font-medium transition-all duration-150",p?"bg-brand-subtle text-brand-text nav-active":"text-ink-2 hover:bg-surface-3 hover:text-ink-1"),children:[h.jsx(b.icon,{size:16,strokeWidth:1.8}),b.label]},b.to))})]},v.section))}),h.jsx("div",{className:"border-t border-line px-3 py-3",children:vl()&&f?h.jsxs("div",{className:"rounded-lg bg-surface-2 px-3 py-2.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-brand text-[10px] font-bold text-white",children:f.username.charAt(0).toUpperCase()}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"truncate text-[12px] font-semibold text-ink-1",title:f.username,children:f.username}),f.is_admin&&h.jsx("div",{className:"text-[10px] text-brand-text",children:"管理员"})]})]}),h.jsx("button",{className:"shrink-0 rounded p-1 text-ink-3 transition-colors hover:bg-surface-3 hover:text-danger",title:"退出登录",onClick:()=>{Fd(),s.clear(),window.location.reload()},children:h.jsx(jE,{size:13})})]}),h.jsxs("div",{className:"mt-1.5 flex items-center gap-1 text-[10px] text-success",children:[h.jsx(eE,{size:10}),"云端同步已开启"]})]}):h.jsxs("button",{className:"flex w-full items-center justify-center gap-2 rounded-lg border border-brand/30 bg-brand-subtle px-3 py-2 text-[13px] font-medium text-brand-text transition-all hover:shadow-brand",onClick:()=>d(!0),children:[h.jsx(wE,{size:14}),"登录我的档案"]})})]})}const i5={"/timeline":{title:"时间线",sub:"按学年与月份回顾全部足迹"},"/records":{title:"记录",sub:"全部足迹的检索与管理"},"/grades":{title:"成绩",sub:"学年学科成绩 · 梯度与总览"},"/dashboard":{title:"统计",sub:"量化个人成长收获"},"/types":{title:"记录类型",sub:"类型与字段模板管理"},"/taxonomy":{title:"字典与维度",sub:"级别、角色与成长维度"}};function u5({onMenu:n}){const{pathname:r}=gl(),s=no(),[o,f]=E.useState(""),[m,d]=E.useState(document.documentElement.classList.contains("dark")),v=i5[r]??{title:""},b=()=>{const p=!m;d(p),document.documentElement.classList.toggle("dark",p),localStorage.setItem("fp-theme",p?"dark":"light"),window.dispatchEvent(new CustomEvent("fp-theme-change"))};return h.jsxs("header",{className:"no-print flex h-14 shrink-0 items-center gap-2 border-b border-line bg-surface px-3 sm:gap-4 sm:px-5",children:[h.jsx(zt,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:n,"aria-label":"打开导航",children:h.jsx(OE,{size:17})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h1",{className:"truncate text-[15px] font-semibold leading-tight text-ink-1",children:v.title}),v.sub&&h.jsx("p",{className:"truncate text-[11px] leading-tight text-ink-3",children:v.sub})]}),h.jsxs("div",{className:"relative ml-auto hidden w-[240px] md:block lg:w-[280px]",children:[h.jsx(IE,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-3"}),h.jsx(nt,{className:"pl-8",placeholder:"搜索标题、内容、结果、标签",value:o,onChange:p=>f(p.target.value),onKeyDown:p=>{p.key==="Enter"&&o.trim()&&s("/records?q="+encodeURIComponent(o.trim()))}})]}),h.jsx(zt,{variant:"ghost",size:"icon",onClick:b,"aria-label":"切换主题",children:m?h.jsx(f4,{size:15}):h.jsx(DE,{size:15})}),h.jsxs(zt,{variant:"primary",onClick:()=>s("/records?new=1"),"aria-label":"新建记录",children:[h.jsx(XE,{size:14}),h.jsx("span",{className:"hidden sm:inline",children:"新建记录"})]})]})}function r5(){return h.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[h.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),h.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),h.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function s5(){const[n,r]=E.useState("login"),[s,o]=E.useState(""),[f,m]=E.useState(""),[d,v]=E.useState(""),[b,p]=E.useState(""),[x,g]=E.useState(!1),_="__TAURI_INTERNALS__"in window,[k,K]=E.useState(Ol()),q=H=>{K(H),S0(H)},D=async()=>{if(!s.trim()||!f){p("请填写账号与密码");return}g(!0),p("");try{if(n==="login")await $d(s.trim(),f,k);else{if(!d.trim())throw new Error("请填写邀请码");await Pd(s.trim(),f,d.trim(),k)}setTimeout(()=>window.location.reload(),200)}catch(H){p(H.message)}finally{g(!1)}};return h.jsx("div",{className:"flex h-full items-center justify-center bg-bg px-4",children:h.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[h.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[h.jsx(r5,{}),h.jsx("div",{className:"text-[18px] font-semibold tracking-tight text-ink-1",children:"足迹"}),h.jsx("div",{className:"text-[11px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),h.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(n==="login"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{r("login"),p("")},children:"登录"}),h.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(n==="register"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{r("register"),p("")},children:"注册"})]}),h.jsxs("div",{className:"flex flex-col gap-3",children:[_&&h.jsx(De,{label:"服务器地址",hint:"默认即可",children:h.jsx(nt,{value:k,onChange:H=>q(H.target.value),placeholder:"https://footpr.linyux.cn"})}),h.jsx(De,{label:"用户名",required:!0,children:h.jsx(nt,{value:s,onChange:H=>o(H.target.value),placeholder:"3-32 位字母数字-_",onKeyDown:H=>{H.key==="Enter"&&D()}})}),h.jsx(De,{label:"密码",required:!0,children:h.jsx(nt,{type:"password",value:f,onChange:H=>m(H.target.value),placeholder:"至少 8 位",onKeyDown:H=>{H.key==="Enter"&&D()}})}),n==="register"&&h.jsx(De,{label:"邀请码",required:!0,hint:"向管理员索取",children:h.jsx(nt,{value:d,onChange:H=>v(H.target.value),placeholder:"邀请码",onKeyDown:H=>{H.key==="Enter"&&D()}})}),b&&h.jsx("div",{className:"text-[12px] text-danger",children:b}),h.jsx(zt,{variant:"primary",size:"lg",onClick:()=>void D(),disabled:x,children:x?"请稍候…":n==="login"?"进入我的档案":"创建我的档案"}),h.jsx("button",{type:"button",className:"mt-1 flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-line px-3 py-2 text-[11.5px] text-ink-3 transition-colors hover:border-brand/40 hover:text-brand-text",onClick:()=>{o("demo"),m("demo1234")},children:"演示账号:demo / demo1234(点击填充)"})]})]})})}function o5(){const[n,r]=E.useState(()=>!!vl()),[s,o]=E.useState(!1);return E.useEffect(()=>{const f=()=>r(!1);return window.addEventListener("fp-auth-required",f),()=>window.removeEventListener("fp-auth-required",f)},[]),n?h.jsx(W_,{children:h.jsxs("div",{className:"flex h-full",children:[s&&h.jsx("div",{className:"fixed inset-0 z-30 bg-black/45 lg:hidden",onClick:()=>o(!1),"aria-hidden":!0}),h.jsx(n5,{open:s,onClose:()=>o(!1)}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[h.jsx(u5,{onMenu:()=>o(!0)}),h.jsx("main",{className:"app-scroll min-h-0 flex-1 overflow-y-auto",children:h.jsx(cS,{})})]})]})}):h.jsx(s5,{})}const Gn="inline-flex h-[22px] min-w-[52px] items-center justify-center gap-1 rounded-sm border px-2 text-[11.5px] font-medium whitespace-nowrap",cg={draft:{label:"草稿",color:"var(--text-3)",bg:"var(--surface-3)"},ongoing:{label:"进行中",color:"var(--brand-text)",bg:"var(--brand-subtle)"},submitted:{label:"已提交待果",color:"var(--warning)",bg:"var(--warning-subtle)"},finished:{label:"已完结",color:"var(--success)",bg:"var(--success-subtle)"}};function F0({status:n}){const r=cg[n]??cg.draft;return h.jsx("span",{className:Gn+" border-transparent",style:{color:r.color,backgroundColor:r.bg},children:r.label})}const c5={国际级:"#7c3aed",国家级:"#dc2626",省市级:"#ea580c",区县级:"#2563eb",校级:"#16a34a",院级:"#0891b2"};function $0({level:n}){return n?h.jsx(Ii,{color:c5[n]??"var(--text-3)",className:Gn,children:n}):null}const f5={特等奖:"#b45309",一等奖:"#b45309",二等奖:"#ea580c",三等奖:"#2563eb",优秀奖:"#64748b"};function P0({grade:n}){return n?h.jsx(Ii,{color:f5[n]??"var(--text-3)",className:Gn,children:n}):null}function W0({role:n}){return n?h.jsx(F_,{className:Gn,children:n}):null}function I0(){return h.jsx(Ii,{color:"var(--danger)",className:Gn,children:"负面"})}const G5=[{name:"tag",label:"通用"},{name:"graduation-cap",label:"学业"},{name:"trophy",label:"竞赛"},{name:"flask-conical",label:"科研"},{name:"briefcase",label:"实习"},{name:"network",label:"学生工作"},{name:"heart-handshake",label:"志愿"},{name:"palette",label:"文体"},{name:"award",label:"荣誉"},{name:"file-badge",label:"证书"},{name:"star",label:"收藏"},{name:"shield-alert",label:"惩处"},{name:"book-open",label:"阅读"},{name:"code-2",label:"技术"},{name:"languages",label:"语言"},{name:"mic-2",label:"文艺"},{name:"pen-line",label:"发表"},{name:"rocket",label:"项目"},{name:"users",label:"团队"},{name:"building-2",label:"组织"},{name:"dumbbell",label:"体育"}],d5={tag:p0,"graduation-cap":v0,trophy:y4,"flask-conical":fE,briefcase:Q3,network:kE,"heart-handshake":mE,palette:qE,award:H3,"file-badge":sE,star:o4,"shield-alert":a4,"book-open":L3,"code-2":lE,languages:EE,"mic-2":AE,"pen-line":QE,rocket:ZE,users:b4,"building-2":Y3,dumbbell:uE};function h5({name:n,color:r,size:s=14,className:o}){const f=d5[n]??p0;return h.jsx(f,{size:s,color:r,className:o,strokeWidth:2})}const fg=new Map,m5=25*1024*1024;async function y5(n){const r=fg.get(n.id);if(r)return r;const s=await eo(n.id);return(n.size??0)<=m5&&fg.set(n.id,s),s}function dg(n){const r=(n.mime||"").toLowerCase(),s=(n.file_name.split(".").pop()||"").toLowerCase();return r.startsWith("image/")||["png","jpg","jpeg","gif","webp","bmp","svg"].includes(s)?"image":r==="application/pdf"||s==="pdf"?"pdf":s==="docx"||r.includes("wordprocessingml")?"docx":s==="xlsx"||s==="xls"||r.includes("spreadsheetml")||r==="application/vnd.ms-excel"?"xlsx":r.startsWith("audio/")||["mp3","wav","m4a","flac","ogg"].includes(s)?"audio":r.startsWith("video/")||["mp4","mov","webm","mkv"].includes(s)?"video":r.startsWith("text/")||["txt","md","csv","json","log","srt"].includes(s)?"text":"other"}function v5(n){return Uint8Array.from(atob(n),r=>r.charCodeAt(0))}const p5={image:"图片",pdf:"PDF 文档",text:"文本文件",audio:"音频",video:"视频",docx:"Word 文档(.docx)",xlsx:"Excel 表格(.xlsx)",other:"该类型暂不支持在线预览"};function e1({att:n,onClose:r}){const s=oo(),[o,f]=E.useState(!1),[m,d]=E.useState(""),[v,b]=E.useState(null);E.useEffect(()=>{if(!n){b(null),d("");return}let x=!1;const g=[];return f(!0),d(""),b(null),(async()=>{try{const _=dg(n),k=n.remote_url||null;if(k&&(_==="image"||_==="pdf"||_==="audio"||_==="video")){b({kind:_,objectUrl:k}),f(!1);return}let K=n.mime??void 0,q;if(k)q=new Uint8Array(await(await fetch(k)).arrayBuffer());else{const D=await y5(n);K=D.mime,q=v5(D.data_b64)}if(x)return;if(_==="text"){const D=new TextDecoder().decode(q);b({kind:_,text:D.length>4e5?D.slice(0,4e5)+` -…(已截断)`:D})}else if(_==="docx"){const H=(await(await jl(()=>import("./mammoth.browser-vtTTgAGk.js").then(Q=>Q.m),[])).convertToHtml({arrayBuffer:q.buffer})).value;if(x)return;b({kind:_,html:H})}else if(_==="xlsx"){const D=await jl(()=>import("./xlsx-CbTSpprj.js"),[]),H=D.read(q,{type:"array"}),Q=D.utils.sheet_to_html(H.Sheets[H.SheetNames[0]]);if(x)return;b({kind:_,html:Q})}else{const D=URL.createObjectURL(new Blob([q],{type:K||"application/octet-stream"}));if(x){URL.revokeObjectURL(D);return}g.push(D),b({kind:_,objectUrl:D})}}catch(_){x||d(_.message||"预览加载失败")}finally{x||f(!1)}})(),()=>{x=!0,g.forEach(_=>URL.revokeObjectURL(_))}},[n==null?void 0:n.id,n==null?void 0:n.file_name,n==null?void 0:n.remote_url]);const p=n?dg(n):"other";return h.jsxs(so,{open:!!n,onClose:r,width:p==="image"||p==="pdf"?880:680,title:(n?"附件预览 · "+n.file_name:"附件预览")+(n?"("+p5[p]+")":""),footer:n?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"secondary",className:"mr-auto",onClick:()=>{(async()=>{try{const{blob:x,file_name:g}=await j0(n.id),_=URL.createObjectURL(x),k=document.createElement("a");k.href=_,k.download=g,k.click(),setTimeout(()=>URL.revokeObjectURL(_),6e4),s("success","已下载:"+g)}catch(x){s("error","下载失败:"+x.message)}})()},children:[h.jsx(nE,{size:13})," 下载"]}),h.jsx(zt,{variant:"primary",onClick:r,children:"关闭"})]}):null,children:[o&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-16 text-[13px] text-ink-3",children:[h.jsx(TE,{className:"animate-spin",size:16})," 正在加载预览…"]}),!o&&!!m&&h.jsx("div",{className:"py-10 text-center text-[13px] text-danger",children:m}),!o&&!m&&v&&h.jsxs(h.Fragment,{children:[v.kind==="image"&&h.jsx("img",{src:v.objectUrl,alt:n==null?void 0:n.file_name,className:"mx-auto max-h-[72vh] rounded-md"}),v.kind==="pdf"&&h.jsx("iframe",{src:v.objectUrl,title:n==null?void 0:n.file_name,className:"h-[72vh] w-full rounded-md border border-line bg-white"}),v.kind==="audio"&&h.jsx("audio",{controls:!0,src:v.objectUrl,className:"w-full"}),v.kind==="video"&&h.jsx("video",{controls:!0,src:v.objectUrl,className:"max-h-[70vh] w-full rounded-md bg-black"}),v.kind==="text"&&h.jsx("pre",{className:"max-h-[68vh] overflow-auto whitespace-pre-wrap rounded-md bg-surface-2 p-3 text-[12.5px] leading-relaxed text-ink-1",children:v.text}),(v.kind==="docx"||v.kind==="xlsx")&&h.jsx("div",{className:"max-h-[70vh] overflow-auto rounded-md border border-line bg-white p-4 text-[13px] leading-relaxed [&_img]:max-w-full [&_table]:border-collapse [&_td]:border [&_td]:border-line [&_td]:px-2 [&_td]:py-1 [&_th]:border [&_th]:border-line [&_th]:px-2 [&_th]:py-1",dangerouslySetInnerHTML:{__html:v.html||""}}),v.kind==="other"&&h.jsxs("div",{className:"py-10 text-center",children:[h.jsx("p",{className:"text-[13px] text-ink-2",children:"该文件类型暂不支持在线预览"}),h.jsx("p",{className:"mt-1 text-[12px] text-ink-3",children:"请点击左下角「下载」,用本地应用打开"})]})]})]})}function g5({value:n,onChange:r,placeholder:s}){const[o,f]=E.useState(""),m=()=>{const v=o.trim();v&&!n.includes(v)&&r([...n,v]),f("")},d=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),m()):v.key==="Backspace"&&!o&&n.length&&r(n.slice(0,-1))};return h.jsxs("div",{className:pl("flex min-h-8 w-full flex-wrap items-center gap-1 rounded-md border border-line bg-surface px-1.5 py-1","transition-colors hover:border-line-strong focus-within:border-brand"),children:[n.map(v=>h.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-surface-3 px-1.5 text-[12px] text-ink-2",children:[v,h.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==v)),children:h.jsx(g0,{size:11})})]},v)),h.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:o,placeholder:n.length?"":s??"输入后回车添加",onChange:v=>f(v.target.value),onKeyDown:d,onBlur:m})]})}function hg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function b5({fields:n,value:r,onChange:s,taxonomies:o}){if(!n.length)return null;const f=(d,v)=>s({...r,[d]:v}),m=d=>{const v=r[d.key],b=d.required&&(v==null||v==="")?"该项必填":"",p=x=>d.unit?h.jsxs("div",{className:"flex items-center gap-2",children:[x,h.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(wd,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:p(h.jsx(nt,{type:"number",step:"any",className:"num",value:v==null?"":String(v),onChange:x=>f(d.key,x.target.value===""?void 0:Number(x.target.value))}))},d.key);case"date":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{type:"date",value:String(v??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(ml,{value:String(v??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...hg(d,o)]})},d.key);case"multiselect":{const x=hg(d,o),g=Array.isArray(v)?v:[];return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(_=>{const k=g.includes(_.value);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(k?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,k?g.filter(K=>K!==_.value):[...g,_.value]),children:_.label},_.value)}),!x.length&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return h.jsx(De,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:h.jsx(nt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>h.jsx("div",{className:d.widget==="textarea"?"sm:col-span-2":"",children:m(d)},d.key))})}function mg(n){return n?n.slice(0,16).replace("T"," "):""}function x5(n,r){const s=n?n.slice(0,10):"",o=r?r.slice(0,10):"";return s&&o?s+" ~ "+o:s?s+(r===""?"":" 起"):o?"至 "+o:""}function Cd(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function t1(n,r,s=480,o=.82){return new Promise((f,m)=>{const d=new Image;d.onload=()=>{try{const v=Math.min(1,s/Math.max(d.naturalWidth,d.naturalHeight)),b=Math.max(1,Math.round(d.naturalWidth*v)),p=Math.max(1,Math.round(d.naturalHeight*v)),x=document.createElement("canvas");x.width=b,x.height=p;const g=x.getContext("2d");if(!g)return m(new Error("canvas 不可用"));g.drawImage(d,0,0,b,p),f(x.toDataURL("image/webp",o))}catch(v){m(v instanceof Error?v:new Error(String(v)))}},d.onerror=()=>m(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function yg({items:n,pending:r,onPick:s,onDeleteSaved:o,onDeletePending:f,onOpenSaved:m,uploading:d}){const v=E.useRef(null),b=n.length+r.length;return h.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[h.jsx(Kd,{size:13}),"附件(",b,")"]}),h.jsx(zt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var p;return(p=v.current)==null?void 0:p.click()},children:d?"上传中…":"添加文件"}),h.jsx("input",{ref:v,type:"file",multiple:!0,className:"hidden",onChange:p=>{var x;(x=p.target.files)!=null&&x.length&&s(p.target.files),p.target.value=""}})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(p=>h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[h.jsx(y0,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate "+(m?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>m==null?void 0:m(p),title:p.file_name,children:p.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(p.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>o(p.id),"aria-label":"删除附件",children:h.jsx(Ed,{size:13})})]},"s"+p.id)),r.map((p,x)=>{var g;return h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[(g=p.mime)!=null&&g.startsWith("image/")&&p.preview?h.jsx("img",{src:p.preview,alt:p.file_name,className:"size-7 shrink-0 rounded object-cover"}):h.jsx(vE,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate text-ink-1",children:p.file_name}),h.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(p.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:h.jsx(Ed,{size:13})})]},"p"+x)}),!b&&h.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}async function vg(n){var d,v,b,p;let r=n;if(n.type==="image/jpeg"&&n.size>3*1024*1024)try{const x=await createImageBitmap(n),g=Math.min(1,2560/Math.max(x.width,x.height)),_=document.createElement("canvas");_.width=Math.round(x.width*g),_.height=Math.round(x.height*g),(d=_.getContext("2d"))==null||d.drawImage(x,0,0,_.width,_.height);const k=await new Promise(K=>_.toBlob(K,"image/jpeg",.85));k&&k.size{const _=new FileReader;_.onload=()=>x(String(_.result||"")),_.onerror=()=>g(new Error("读取文件失败")),_.readAsDataURL(r)}),o=s.indexOf(","),f=o>=0?s.slice(o+1):s;let m;if((b=n.type)!=null&&b.startsWith("image/")&&!n.type.includes("gif"))try{m=(await t1(f,n.type)).split(",")[1]||void 0}catch{m=void 0}return{file:r,file_name:n.name,mime:r.type||void 0,size:r.size,data_b64:f,thumb_b64:m,preview:(p=n.type)!=null&&p.startsWith("image/")?URL.createObjectURL(n):void 0}}const Ps={竞赛:{core:["level","award_grade","role","organizer"]},科研:{core:["level","role","organizer"]},实习实践:{core:["organizer"]},学生工作:{core:["role","organizer"]},志愿公益:{core:["organizer"]},文体活动:{core:["level","organizer"]},证书技能:{core:["level","organizer"]},荣誉惩处:{core:["award_grade","level","organizer"]},学业:{core:["rank"]}},pg={core:["level","role","award_grade","organizer"]},Y5=[{value:"",label:"通用布局(级别/角色/奖等/组织方)"},...Object.keys(Ps).map(n=>({value:n,label:n+"式布局"}))];function S5(n,r){return r&&Ps[r]?Ps[r]:n?Ps[n]??pg:pg}const gg={type_id:null,title:"",organizer:"",start_date:"",end_date:"",status:"draft",role:"",level:"",award_grade:"",rank:"",polarity:"positive",weight:"3",description:"",result:"",tags:[],dimension_ids:[],group_id:"",parent_id:"",extras:{}},E5=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],bg=80*1024*1024,_5=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function T5({open:n,onClose:r,footprintId:s,onSaved:o}){var ie,Te,re,V,ee;const f=lu(),m=oo(),[d,v]=E.useState(gg),[b,p]=E.useState([]),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(""),D=yl({queryKey:["types"],queryFn:ro,enabled:n}),H=yl({queryKey:["taxonomy-all"],queryFn:()=>E0(),enabled:n}),Q=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),Z=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),J=yl({queryKey:["attachments",s],queryFn:()=>w0(s),enabled:n&&!!s}),Y=E.useMemo(()=>{var R;return(R=D.data)==null?void 0:R.items.find(ae=>ae.id===d.type_id)},[D.data,d.type_id]),de=S5(Y==null?void 0:Y.name,Y==null?void 0:Y.profile),F=yl({queryKey:["parent-candidates",d.type_id],queryFn:()=>_0({types:d.type_id?[d.type_id]:void 0,page_size:200,sort:"date_desc"}),enabled:n&&!!d.type_id});E.useEffect(()=>{if(n)if(q(""),p([]),s&&Z.data){const R=Z.data.item;v({type_id:R.type_id,title:R.title,organizer:R.organizer??"",start_date:(R.start_date??"").slice(0,10),end_date:(R.end_date??"").slice(0,10),status:R.status,role:R.role??"",level:R.level??"",award_grade:R.award_grade??"",rank:R.rank!=null?String(R.rank):"",polarity:R.polarity,weight:String(R.weight??3),description:R.description??"",result:R.result??"",tags:R.tags??[],dimension_ids:R.dimensions??[],group_id:R.group_id??"",parent_id:R.parent_id!=null?String(R.parent_id):"",extras:R.extras??{}})}else v(gg)},[n,s,Z.data]);const U=E.useMemo(()=>{var ae,X;const R={};for(const ke of((ae=H.data)==null?void 0:ae.items)??[])(R[X=ke.kind]??(R[X]=[])).push({value:ke.value,label:ke.value});return R},[H.data]),I=Sd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const R={};for(const ke of(Y==null?void 0:Y.form_template)??[])if(ke.metric&&ke.widget==="number"){const Nt=d.extras[ke.key];typeof Nt=="number"&&!Number.isNaN(Nt)&&(R[ke.metric]=Nt)}const ae={id:s??void 0,type_id:d.type_id,title:d.title.trim(),organizer:d.organizer||null,start_date:d.start_date||null,end_date:d.end_date||null,status:d.status,role:d.role||null,level:d.level||null,award_grade:d.award_grade&&d.award_grade!=="无"?d.award_grade:null,rank:d.rank?Number(d.rank):null,polarity:d.polarity,description:d.description,result:d.result,tags:d.tags,dimension_ids:d.dimension_ids,group_id:d.group_id||null,parent_id:d.parent_id?Number(d.parent_id):null,weight:Number(d.weight)||3,extras:d.extras,metrics:R},X=await T0(ae);for(const ke of b)await Td(X.id,ke.file,ke.thumb_b64);return X.id},onSuccess:R=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",R]}),f.invalidateQueries({queryKey:["types"]}),m("success",s?"记录已更新":"记录已创建"),o==null||o(R),r()},onError:R=>q(R.message)}),le=(R,ae)=>v(X=>({...X,[R]:ae})),Ve=Sd({mutationFn:R=>C0(R),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})}),Fe=R=>R==="organizer"?h.jsx(De,{label:"组织方 / 所在组织",children:h.jsx(nt,{value:d.organizer,onChange:ae=>le("organizer",ae.target.value),placeholder:"如:中国工业与应用数学学会"})},"organizer"):R==="role"?h.jsx(De,{label:"角色",children:h.jsx(ml,{value:d.role,onChange:ae=>le("role",ae.target.value),options:[{value:"",label:"未设置"},...U.role??[]]})},"role"):R==="level"?h.jsx(De,{label:"级别",children:h.jsx(ml,{value:d.level,onChange:ae=>le("level",ae.target.value),options:[{value:"",label:"未设置"},...U.level??[]]})},"level"):R==="award_grade"?h.jsx(De,{label:"奖等",children:h.jsx(ml,{value:d.award_grade,onChange:ae=>le("award_grade",ae.target.value),options:[{value:"",label:"未设置"},...E5.map(ae=>({value:ae,label:ae}))]})},"award_grade"):R==="rank"?h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:ae=>le("rank",ae.target.value),placeholder:"如 2"})},"rank"):null;return h.jsxs(so,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:h.jsxs(h.Fragment,{children:[K&&h.jsx("span",{className:"mr-auto text-[12px] text-danger",children:K}),h.jsx(zt,{variant:"secondary",onClick:r,children:"取消"}),h.jsx(zt,{variant:"primary",onClick:()=>I.mutate(),disabled:I.isPending,children:I.isPending?"保存中…":"保存"})]}),children:[h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"类型",required:!0,children:h.jsx(ml,{value:d.type_id!=null?String(d.type_id):"",onChange:R=>le("type_id",R.target.value?Number(R.target.value):null),options:[{value:"",label:"请选择"},...(((ie=D.data)==null?void 0:ie.items)??[]).map(R=>({value:String(R.id),label:R.name}))]})}),h.jsx(De,{label:"标题",required:!0,children:h.jsx(nt,{value:d.title,onChange:R=>le("title",R.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"开始日期",children:h.jsx(nt,{type:"date",value:d.start_date,onChange:R=>le("start_date",R.target.value)})}),h.jsx(De,{label:"结束日期",children:h.jsx(nt,{type:"date",value:d.end_date,onChange:R=>le("end_date",R.target.value)})}),h.jsx(De,{label:"状态",children:h.jsx(ml,{value:d.status,onChange:R=>le("status",R.target.value),options:_5})})]}),h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2 text-[12px] font-semibold text-ink-2",children:["类型要素",Y?" · "+Y.name:""]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:de.core.map(R=>Fe(R))}),Y&&Y.form_template.length>0&&h.jsxs("div",{className:"mt-3.5",children:[h.jsx("div",{className:"mb-2 text-[11.5px] text-ink-3",children:"专项信息"}),h.jsx(b5,{fields:Y.form_template,value:d.extras,onChange:R=>le("extras",R),taxonomies:U})]})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"工作内容 / 描述",children:h.jsx(wd,{value:d.description,onChange:R=>le("description",R.target.value),placeholder:"具体做了什么、承担什么分工"})}),h.jsx(De,{label:"结果 / 产出",children:h.jsx(wd,{value:d.result,onChange:R=>le("result",R.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"标签",children:h.jsx(g5,{value:d.tags,onChange:R=>le("tags",R)})}),h.jsx(De,{label:"成长维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((Te=Q.data)==null?void 0:Te.items)??[]).map(R=>{const ae=d.dimension_ids.includes(R.id);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(ae?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>le("dimension_ids",ae?d.dimension_ids.filter(X=>X!==R.id):[...d.dimension_ids,R.id]),children:R.name},R.id)}),!((re=Q.data)!=null&&re.items.length)&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),h.jsxs("details",{className:"border-t border-line pt-4",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[12px] text-ink-3 transition-colors hover:text-ink-2",children:"高级选项(重要度 · 名次 · 性质 · 关联)"}),h.jsxs("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"重要度",children:h.jsx(ml,{value:d.weight,onChange:R=>le("weight",R.target.value),options:[1,2,3,4,5].map(R=>({value:String(R),label:String(R)}))})}),!de.core.includes("rank")&&h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:R=>le("rank",R.target.value),placeholder:"如 2"})}),h.jsx(De,{label:"性质",children:h.jsx(ml,{value:d.polarity,onChange:R=>le("polarity",R.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),h.jsx(De,{label:"上级记录",hint:"晋升链",children:h.jsx(ml,{value:d.parent_id,onChange:R=>le("parent_id",R.target.value),options:[{value:"",label:"无"},...(((V=F.data)==null?void 0:V.items)??[]).filter(R=>R.id!==s).map(R=>({value:String(R.id),label:R.title.slice(0,24)}))]})})]}),h.jsx("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:h.jsx(De,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:h.jsx(nt,{value:d.group_id,onChange:R=>le("group_id",R.target.value),placeholder:"如 g2025001(可选)"})})})]}),s?h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:((ee=J.data)==null?void 0:ee.items)??[],pending:b,uploading:x,onPick:async R=>{if(s){g(!0);try{let ae=0;for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}const ke=await vg(X);await Td(s,ke.file,ke.thumb_b64),ae++}ae>0&&(f.invalidateQueries({queryKey:["attachments",s]}),m("success","已上传 "+ae+" 个附件"))}catch(ae){m("error",ae.message)}finally{g(!1)}}},onDeleteSaved:R=>Ve.mutate(R),onDeletePending:()=>{},onOpenSaved:R=>k(R)}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)· 单个文件不超过 80MB"})]}):h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:[],pending:b,onPick:async R=>{const ae=[];for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}ae.push(await vg(X))}p(X=>[...X,...ae])},onDeleteSaved:()=>{},onDeletePending:R=>p(ae=>ae.filter((X,ke)=>ke!==R))}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]}),h.jsx(e1,{att:_,onClose:()=>k(null)})]})}const ki=new Map;function N5({open:n,onClose:r,footprintId:s,onEdit:o}){var U,I,le,Ve,Fe;const f=lu(),m=oo(),d=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),v=yl({queryKey:["types"],queryFn:ro,enabled:n}),b=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),p=(U=d.data)==null?void 0:U.item,x=(I=v.data)==null?void 0:I.items.find(ie=>ie.id===(p==null?void 0:p.type_id)),g=((p==null?void 0:p.dimensions)??[]).map(ie=>{var Te,re;return(re=(Te=b.data)==null?void 0:Te.items.find(V=>V.id===ie))==null?void 0:re.name}).filter(Boolean),[_,k]=E.useState(!1),[K,q]=E.useState(null),D=Sd({mutationFn:()=>jl(()=>Promise.resolve().then(()=>t_),void 0).then(ie=>ie.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),m("success","记录已删除"),k(!1),r()}}),[H,Q]=E.useState({}),Z=(p==null?void 0:p.attachments)??[],J=Z.filter(ie=>{var Te;return(Te=ie.mime)==null?void 0:Te.startsWith("image/")}),Y=Z.filter(ie=>{var Te;return!((Te=ie.mime)!=null&&Te.startsWith("image/"))}),de=Z.map(ie=>ie.id).join(",");E.useEffect(()=>{if(!n||!de)return;let ie=!1;const Te=Z.filter(re=>{var V;return(V=re.mime)==null?void 0:V.startsWith("image/")});return(async()=>{for(const re of Te){if(ie)return;if(ki.has(re.id)){Q(V=>({...V,[re.id]:ki.get(re.id)}));continue}if(re.remote_thumb){ki.set(re.id,re.remote_thumb),Q(V=>({...V,[re.id]:re.remote_thumb}));continue}try{if(re.thumb_rel_path){const V=await z0(re.id);if(ie)return;const ee="data:"+(V.mime||"image/webp")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}else{const V=await eo(re.id);if(ie)return;const ee=await t1(V.data_b64,V.mime||"image/png");ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}}catch{try{const V=await eo(re.id);if(ie)return;const ee="data:"+(V.mime||"image/png")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}catch{}}}})(),()=>{ie=!0}},[n,s,de]);const F=[];if(p&&x)for(const ie of x.form_template??[]){const Te=(p.extras??{})[ie.key];if(Te==null||Te==="")continue;const re=Array.isArray(Te)?Te.join("、"):String(Te);F.push({label:ie.label,value:ie.unit?re+" "+ie.unit:re})}return h.jsxs(so,{open:n,onClose:r,width:680,title:"记录详情",footer:p?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>k(!0),disabled:D.isPending,children:[h.jsx(Ed,{size:13})," 删除"]}),h.jsx(zt,{variant:"secondary",onClick:r,children:"关闭"}),h.jsxs(zt,{variant:"primary",onClick:()=>s&&(o==null?void 0:o(s)),children:[h.jsx(YE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!p?h.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-[20px] font-bold leading-tight tracking-tight text-ink-1",style:{textWrap:"balance"},children:p.title}),h.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[h.jsx(Ii,{color:p.type_color,className:Gn,children:p.type_name}),h.jsx($0,{level:p.level}),h.jsx(P0,{grade:p.award_grade}),h.jsx(W0,{role:p.role}),h.jsx(F0,{status:p.status}),p.polarity==="negative"&&h.jsx(I0,{}),p.rank!=null&&h.jsxs(Ii,{color:"var(--text-3)",className:Gn,children:["第 ",p.rank," 名"]})]})]}),h.jsx(Hi,{title:"事项要素",children:h.jsxs("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px] sm:grid-cols-2",children:[h.jsx(nd,{label:"时间",value:x5(p.start_date,p.end_date)||"—"}),h.jsx(nd,{label:"组织方",value:p.organizer||"—"}),F.map(ie=>h.jsx(nd,{label:ie.label,value:ie.value},ie.label))]})}),(((le=p.attachments)==null?void 0:le.length)??0)>0&&h.jsx(Hi,{title:"附件("+(((Ve=p.attachments)==null?void 0:Ve.length)??0)+")",children:Z.length?h.jsxs("div",{className:"flex flex-col gap-2.5",children:[J.length>0&&h.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:J.map(ie=>h.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>q(ie),title:"点击预览:"+ie.file_name,children:[H[ie.id]?h.jsx("img",{src:H[ie.id],alt:ie.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):h.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),h.jsx("span",{className:"absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/60 to-transparent px-1.5 pb-1 pt-3 text-[10px] text-white opacity-0 transition-opacity group-hover:opacity-100",children:ie.file_name})]},ie.id))}),Y.length>0&&h.jsx("div",{className:"flex flex-col gap-1",children:Y.map(ie=>h.jsxs("button",{className:"flex items-center gap-2 rounded-md border border-line bg-surface px-2.5 py-2 text-left text-[12.5px] transition-colors hover:border-line-strong",onClick:()=>q(ie),children:[h.jsx(y0,{size:14,className:"shrink-0 text-ink-3"}),h.jsx("span",{className:"truncate text-ink-1",children:ie.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(ie.size)}),h.jsx(Kd,{size:12,className:"shrink-0 text-ink-3"})]},ie.id))}),h.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)"})]}):h.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})}),p.description&&h.jsx(Hi,{title:"工作内容 / 描述",children:h.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:p.description})}),p.result&&h.jsx(Hi,{title:"结果 / 产出",children:h.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:p.result})}),p.metrics&&Object.keys(p.metrics).length>0&&h.jsx(Hi,{title:"量化指标",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(p.metrics).map(([ie,Te])=>h.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[ie,": ",h.jsx("span",{className:"font-medium text-ink-1",children:Te})]},ie))})}),((((Fe=p.tags)==null?void 0:Fe.length)??0)>0||g.length>0)&&h.jsx(Hi,{title:"标签与维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[p.tags.map(ie=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:ie},ie)),g.map(ie=>h.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:ie},ie))]})}),h.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 border-t border-line pt-3 text-[11.5px] text-ink-3",children:[h.jsxs("span",{children:["创建于 ",mg(p.created_at)]}),h.jsxs("span",{children:["更新于 ",mg(p.updated_at)]}),p.group_id&&h.jsxs("span",{children:["事件组 ",p.group_id]}),p.parent_id!=null&&h.jsxs("span",{children:["上级 #",p.parent_id]})]})]}),h.jsx(e1,{att:K,onClose:()=>q(null)}),h.jsx(I_,{open:_,title:"删除记录",content:p?"确定删除「"+p.title+"」吗?该操作不可撤销。":"",onCancel:()=>k(!1),onOk:()=>D.mutate(),loading:D.isPending})]})}function nd({label:n,value:r}){return h.jsxs("div",{className:"grid min-w-0 grid-cols-[76px_1fr] gap-x-2.5",children:[h.jsx("span",{className:"shrink-0 text-right text-ink-3",children:n}),h.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function Hi({title:n,children:r}){return h.jsxs("div",{children:[h.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function w5(){var Y,de,F;const[n,r]=E.useState(""),[s,o]=E.useState(""),[f,m]=E.useState(""),[d,v]=E.useState(""),[b,p]=E.useState(null),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(!1),D=yl({queryKey:["types"],queryFn:ro}),H=E.useMemo(()=>({q:n||void 0,types:s?[Number(s)]:void 0,year:f?Number(f):void 0,polarity:d||void 0,sort:"date_desc",page_size:2e3}),[n,s,f,d]),Q=yl({queryKey:["timeline",H],queryFn:()=>N0(H)}),Z=E.useMemo(()=>{var I;const U=new Set;for(const le of((I=Q.data)==null?void 0:I.groups)??[])U.add(le.year);return Array.from(U).sort((le,Ve)=>Ve-le)},[Q.data]),J=U=>{k(U),q(!0)};return h.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[h.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[h.jsx(nt,{className:"w-full sm:w-[220px]",placeholder:"搜索足迹…",value:n,onChange:U=>r(U.target.value)}),h.jsxs("div",{className:"grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:items-center sm:gap-2",children:[h.jsx(ml,{className:"w-full sm:w-[130px]",value:s,onChange:U=>o(U.target.value),options:[{value:"",label:"全部类型"},...(((Y=D.data)==null?void 0:Y.items)??[]).map(U=>({value:String(U.id),label:U.name}))]}),h.jsx(ml,{className:"w-full sm:w-[120px]",value:f,onChange:U=>m(U.target.value),options:[{value:"",label:"全部年份"},...Z.map(U=>({value:String(U),label:U+" 年"}))]}),h.jsx(ml,{className:"w-full sm:w-[110px]",value:d,onChange:U=>v(U.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})]}),h.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((de=Q.data)==null?void 0:de.total)??0," 条"]})]}),Q.isLoading?h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(F=Q.data)!=null&&F.groups.length?h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),Q.data.groups.map(U=>h.jsxs("section",{className:"mb-2",children:[h.jsxs("div",{className:"sticky top-0 z-10 -mx-3 flex items-center gap-2 bg-bg/90 px-3 py-2 backdrop-blur sm:-mx-6 sm:px-6",children:[h.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:U.year}),h.jsxs("span",{className:"text-[12px] text-ink-3",children:[U.count," 条记录"]})]}),U.months.map(I=>h.jsxs("div",{className:"mb-3",children:[h.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[I.month," 月"]}),h.jsx("div",{className:"flex flex-col gap-2",children:I.items.map(le=>h.jsx(C5,{row:le,onClick:()=>J(le.id)},le.id))})]},I.month))]},U.year))]}):h.jsx($_,{icon:h.jsx(m0,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),h.jsx(N5,{open:K,onClose:()=>q(!1),footprintId:_,onEdit:U=>{q(!1),p(U),g(!0)}}),h.jsx(T5,{open:x,onClose:()=>g(!1),footprintId:b})]})}function C5({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return h.jsxs("button",{onClick:r,className:"group relative w-full rounded-lg border border-line bg-surface px-4 py-3 text-left shadow-card transition-all hover:border-line-strong hover:shadow-pop",children:[h.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"num w-[52px] shrink-0 pt-0.5 text-[12px] leading-relaxed text-ink-3",children:[s.slice(5,7),"-",s.slice(8,10)]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),h.jsx(Ii,{color:n.type_color,children:n.type_name}),h.jsx($0,{level:n.level}),h.jsx(P0,{grade:n.award_grade}),h.jsx(W0,{role:n.role}),h.jsx(F0,{status:n.status}),n.polarity==="negative"&&h.jsx(I0,{})]}),n.organizer&&h.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&h.jsx("p",{className:"mt-1 line-clamp-2 text-[12.5px] leading-relaxed text-ink-2",children:n.description}),(n.result||n.tags.length>0||n.attachment_count>0)&&h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11.5px] text-ink-3",children:[n.result&&h.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(o=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:o},o)),n.attachment_count>0&&h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(Kd,{size:11}),n.attachment_count]})]})]}),h.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:h.jsx(h5,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const j5=E.lazy(()=>jl(()=>import("./RecordsPage-C_nMhPms.js"),[]).then(n=>({default:n.RecordsPage}))),z5=E.lazy(()=>jl(()=>import("./DashboardPage-BQmjPh_R.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),O5=E.lazy(()=>jl(()=>import("./GradesPage-DA15g7rj.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),R5=E.lazy(()=>jl(()=>import("./TypesPage-MLRGRNax.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),A5=E.lazy(()=>jl(()=>import("./TaxonomyPage-Bx9s6yCR.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),M5=E.lazy(()=>jl(()=>import("./AdminPage-Br3ZHwTZ.js"),__vite__mapDeps([7,1,8])).then(n=>({default:n.AdminPage}))),D5=E.lazy(()=>jl(()=>import("./ProfilePage-rXdhq-8F.js"),[]).then(n=>({default:n.ProfilePage}))),U5=E.lazy(()=>jl(()=>import("./ResumePage-CO3gtN78.js"),__vite__mapDeps([9,1,8])).then(n=>({default:n.ResumePage})));function Ja(){return h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function k5(){return h.jsx(dS,{children:h.jsxs(tl,{element:h.jsx(o5,{}),children:[h.jsx(tl,{path:"/",element:h.jsx(Vp,{to:"/timeline",replace:!0})}),h.jsx(tl,{path:"/timeline",element:h.jsx(w5,{})}),h.jsx(tl,{path:"/records",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(j5,{})})}),h.jsx(tl,{path:"/grades",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(O5,{})})}),h.jsx(tl,{path:"/dashboard",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(z5,{})})}),h.jsx(tl,{path:"/types",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(R5,{})})}),h.jsx(tl,{path:"/taxonomy",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(A5,{})})}),h.jsx(tl,{path:"/admin",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(M5,{})})}),h.jsx(tl,{path:"/profile",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(D5,{})})}),h.jsx(tl,{path:"/resume",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(U5,{})})}),h.jsx(tl,{path:"*",element:h.jsx(Vp,{to:"/timeline",replace:!0})})]})})}const H5=new b3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:0,gcTime:0}}}),xg=localStorage.getItem("fp-theme");(xg==="dark"||!xg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");function l1(){var r;const n=getComputedStyle(document.documentElement).getPropertyValue("--bg").trim();n&&((r=document.querySelector('meta[name="theme-color"]'))==null||r.setAttribute("content",n))}l1();window.addEventListener("fp-theme-change",l1);"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});o2.createRoot(document.getElementById("root")).render(h.jsx(l2.StrictMode,{children:h.jsx(ZS,{client:H5,children:h.jsx(HS,{children:h.jsx(k5,{})})})}));export{vl as $,U4 as A,zt as B,I_ as C,k4 as D,$_ as E,so as F,P0 as G,De as H,nt as I,H4 as J,D4 as K,$0 as L,h5 as M,_4 as N,G5 as O,XE as P,Y5 as Q,W0 as R,ml as S,Ed as T,T4 as U,N4 as V,w4 as W,C4 as X,j4 as Y,Wd as Z,Ol as _,pl as a,g0 as a0,Cd as a1,K4 as a2,Z4 as a3,J4 as a4,P4 as a5,$4 as a6,F4 as a7,jl as a8,X4 as a9,V4 as aa,p4 as ab,wd as ac,e_ as ad,I4 as ae,W4 as af,nE as ag,L5 as ah,Ag as ai,t_ as aj,KS as b,pe as c,oo as d,B5 as e,yl as f,Sd as g,x5 as h,F0 as i,h as j,mg as k,YE as l,Ii as m,N5 as n,T5 as o,z4 as p,ro as q,E as r,E0 as s,O4 as t,lu as u,_0 as v,v0 as w,L4 as x,B4 as y,q4 as z}; +…(已截断)`:D})}else if(_==="docx"){const H=(await(await jl(()=>import("./mammoth.browser-CcmILf3Q.js").then(Q=>Q.m),[])).convertToHtml({arrayBuffer:q.buffer})).value;if(x)return;b({kind:_,html:H})}else if(_==="xlsx"){const D=await jl(()=>import("./xlsx-CbTSpprj.js"),[]),H=D.read(q,{type:"array"}),Q=D.utils.sheet_to_html(H.Sheets[H.SheetNames[0]]);if(x)return;b({kind:_,html:Q})}else{const D=URL.createObjectURL(new Blob([q],{type:K||"application/octet-stream"}));if(x){URL.revokeObjectURL(D);return}g.push(D),b({kind:_,objectUrl:D})}}catch(_){x||d(_.message||"预览加载失败")}finally{x||f(!1)}})(),()=>{x=!0,g.forEach(_=>URL.revokeObjectURL(_))}},[n==null?void 0:n.id,n==null?void 0:n.file_name,n==null?void 0:n.remote_url]);const p=n?dg(n):"other";return h.jsxs(so,{open:!!n,onClose:r,width:p==="image"||p==="pdf"?880:680,title:(n?"附件预览 · "+n.file_name:"附件预览")+(n?"("+p5[p]+")":""),footer:n?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"secondary",className:"mr-auto",onClick:()=>{(async()=>{try{const{blob:x,file_name:g}=await j0(n.id),_=URL.createObjectURL(x),k=document.createElement("a");k.href=_,k.download=g,k.click(),setTimeout(()=>URL.revokeObjectURL(_),6e4),s("success","已下载:"+g)}catch(x){s("error","下载失败:"+x.message)}})()},children:[h.jsx(nE,{size:13})," 下载"]}),h.jsx(zt,{variant:"primary",onClick:r,children:"关闭"})]}):null,children:[o&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-16 text-[13px] text-ink-3",children:[h.jsx(TE,{className:"animate-spin",size:16})," 正在加载预览…"]}),!o&&!!m&&h.jsx("div",{className:"py-10 text-center text-[13px] text-danger",children:m}),!o&&!m&&v&&h.jsxs(h.Fragment,{children:[v.kind==="image"&&h.jsx("img",{src:v.objectUrl,alt:n==null?void 0:n.file_name,className:"mx-auto max-h-[72vh] rounded-md"}),v.kind==="pdf"&&h.jsx("iframe",{src:v.objectUrl,title:n==null?void 0:n.file_name,className:"h-[72vh] w-full rounded-md border border-line bg-white"}),v.kind==="audio"&&h.jsx("audio",{controls:!0,src:v.objectUrl,className:"w-full"}),v.kind==="video"&&h.jsx("video",{controls:!0,src:v.objectUrl,className:"max-h-[70vh] w-full rounded-md bg-black"}),v.kind==="text"&&h.jsx("pre",{className:"max-h-[68vh] overflow-auto whitespace-pre-wrap rounded-md bg-surface-2 p-3 text-[12.5px] leading-relaxed text-ink-1",children:v.text}),(v.kind==="docx"||v.kind==="xlsx")&&h.jsx("div",{className:"max-h-[70vh] overflow-auto rounded-md border border-line bg-white p-4 text-[13px] leading-relaxed [&_img]:max-w-full [&_table]:border-collapse [&_td]:border [&_td]:border-line [&_td]:px-2 [&_td]:py-1 [&_th]:border [&_th]:border-line [&_th]:px-2 [&_th]:py-1",dangerouslySetInnerHTML:{__html:v.html||""}}),v.kind==="other"&&h.jsxs("div",{className:"py-10 text-center",children:[h.jsx("p",{className:"text-[13px] text-ink-2",children:"该文件类型暂不支持在线预览"}),h.jsx("p",{className:"mt-1 text-[12px] text-ink-3",children:"请点击左下角「下载」,用本地应用打开"})]})]})]})}function g5({value:n,onChange:r,placeholder:s}){const[o,f]=E.useState(""),m=()=>{const v=o.trim();v&&!n.includes(v)&&r([...n,v]),f("")},d=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),m()):v.key==="Backspace"&&!o&&n.length&&r(n.slice(0,-1))};return h.jsxs("div",{className:pl("flex min-h-8 w-full flex-wrap items-center gap-1 rounded-md border border-line bg-surface px-1.5 py-1","transition-colors hover:border-line-strong focus-within:border-brand"),children:[n.map(v=>h.jsxs("span",{className:"inline-flex items-center gap-0.5 rounded-sm bg-surface-3 px-1.5 text-[12px] text-ink-2",children:[v,h.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==v)),children:h.jsx(g0,{size:11})})]},v)),h.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:o,placeholder:n.length?"":s??"输入后回车添加",onChange:v=>f(v.target.value),onKeyDown:d,onBlur:m})]})}function hg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function b5({fields:n,value:r,onChange:s,taxonomies:o}){if(!n.length)return null;const f=(d,v)=>s({...r,[d]:v}),m=d=>{const v=r[d.key],b=d.required&&(v==null||v==="")?"该项必填":"",p=x=>d.unit?h.jsxs("div",{className:"flex items-center gap-2",children:[x,h.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(wd,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:p(h.jsx(nt,{type:"number",step:"any",className:"num",value:v==null?"":String(v),onChange:x=>f(d.key,x.target.value===""?void 0:Number(x.target.value))}))},d.key);case"date":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{type:"date",value:String(v??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(ml,{value:String(v??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...hg(d,o)]})},d.key);case"multiselect":{const x=hg(d,o),g=Array.isArray(v)?v:[];return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(_=>{const k=g.includes(_.value);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(k?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,k?g.filter(K=>K!==_.value):[...g,_.value]),children:_.label},_.value)}),!x.length&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return h.jsx(De,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:h.jsx(nt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return h.jsx(De,{label:d.label,required:d.required,hint:b,children:h.jsx(nt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>h.jsx("div",{className:d.widget==="textarea"?"sm:col-span-2":"",children:m(d)},d.key))})}function mg(n){return n?n.slice(0,16).replace("T"," "):""}function x5(n,r){const s=n?n.slice(0,10):"",o=r?r.slice(0,10):"";return s&&o?s+" ~ "+o:s?s+(r===""?"":" 起"):o?"至 "+o:""}function Cd(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function t1(n,r,s=480,o=.82){return new Promise((f,m)=>{const d=new Image;d.onload=()=>{try{const v=Math.min(1,s/Math.max(d.naturalWidth,d.naturalHeight)),b=Math.max(1,Math.round(d.naturalWidth*v)),p=Math.max(1,Math.round(d.naturalHeight*v)),x=document.createElement("canvas");x.width=b,x.height=p;const g=x.getContext("2d");if(!g)return m(new Error("canvas 不可用"));g.drawImage(d,0,0,b,p),f(x.toDataURL("image/webp",o))}catch(v){m(v instanceof Error?v:new Error(String(v)))}},d.onerror=()=>m(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function yg({items:n,pending:r,onPick:s,onDeleteSaved:o,onDeletePending:f,onOpenSaved:m,uploading:d}){const v=E.useRef(null),b=n.length+r.length;return h.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[h.jsx(Kd,{size:13}),"附件(",b,")"]}),h.jsx(zt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var p;return(p=v.current)==null?void 0:p.click()},children:d?"上传中…":"添加文件"}),h.jsx("input",{ref:v,type:"file",multiple:!0,className:"hidden",onChange:p=>{var x;(x=p.target.files)!=null&&x.length&&s(p.target.files),p.target.value=""}})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(p=>h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[h.jsx(y0,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate "+(m?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>m==null?void 0:m(p),title:p.file_name,children:p.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(p.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>o(p.id),"aria-label":"删除附件",children:h.jsx(Ed,{size:13})})]},"s"+p.id)),r.map((p,x)=>{var g;return h.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[(g=p.mime)!=null&&g.startsWith("image/")&&p.preview?h.jsx("img",{src:p.preview,alt:p.file_name,className:"size-7 shrink-0 rounded object-cover"}):h.jsx(vE,{size:13,className:"text-ink-3 shrink-0"}),h.jsx("span",{className:"truncate text-ink-1",children:p.file_name}),h.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(p.size)}),h.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:h.jsx(Ed,{size:13})})]},"p"+x)}),!b&&h.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}async function vg(n){var d,v,b,p;let r=n;if(n.type==="image/jpeg"&&n.size>3*1024*1024)try{const x=await createImageBitmap(n),g=Math.min(1,2560/Math.max(x.width,x.height)),_=document.createElement("canvas");_.width=Math.round(x.width*g),_.height=Math.round(x.height*g),(d=_.getContext("2d"))==null||d.drawImage(x,0,0,_.width,_.height);const k=await new Promise(K=>_.toBlob(K,"image/jpeg",.85));k&&k.size{const _=new FileReader;_.onload=()=>x(String(_.result||"")),_.onerror=()=>g(new Error("读取文件失败")),_.readAsDataURL(r)}),o=s.indexOf(","),f=o>=0?s.slice(o+1):s;let m;if((b=n.type)!=null&&b.startsWith("image/")&&!n.type.includes("gif"))try{m=(await t1(f,n.type)).split(",")[1]||void 0}catch{m=void 0}return{file:r,file_name:n.name,mime:r.type||void 0,size:r.size,data_b64:f,thumb_b64:m,preview:(p=n.type)!=null&&p.startsWith("image/")?URL.createObjectURL(n):void 0}}const Ps={竞赛:{core:["level","award_grade","role","organizer"]},科研:{core:["level","role","organizer"]},实习实践:{core:["organizer"]},学生工作:{core:["role","organizer"]},志愿公益:{core:["organizer"]},文体活动:{core:["level","organizer"]},证书技能:{core:["level","organizer"]},荣誉惩处:{core:["award_grade","level","organizer"]},学业:{core:["rank"]}},pg={core:["level","role","award_grade","organizer"]},Y5=[{value:"",label:"通用布局(级别/角色/奖等/组织方)"},...Object.keys(Ps).map(n=>({value:n,label:n+"式布局"}))];function S5(n,r){return r&&Ps[r]?Ps[r]:n?Ps[n]??pg:pg}const gg={type_id:null,title:"",organizer:"",start_date:"",end_date:"",status:"draft",role:"",level:"",award_grade:"",rank:"",polarity:"positive",weight:"3",description:"",result:"",tags:[],dimension_ids:[],group_id:"",parent_id:"",extras:{}},E5=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],bg=80*1024*1024,_5=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function T5({open:n,onClose:r,footprintId:s,onSaved:o}){var ie,Te,re,V,ee;const f=lu(),m=oo(),[d,v]=E.useState(gg),[b,p]=E.useState([]),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(""),D=yl({queryKey:["types"],queryFn:ro,enabled:n}),H=yl({queryKey:["taxonomy-all"],queryFn:()=>E0(),enabled:n}),Q=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),Z=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),J=yl({queryKey:["attachments",s],queryFn:()=>w0(s),enabled:n&&!!s}),Y=E.useMemo(()=>{var R;return(R=D.data)==null?void 0:R.items.find(ae=>ae.id===d.type_id)},[D.data,d.type_id]),de=S5(Y==null?void 0:Y.name,Y==null?void 0:Y.profile),F=yl({queryKey:["parent-candidates",d.type_id],queryFn:()=>_0({types:d.type_id?[d.type_id]:void 0,page_size:200,sort:"date_desc"}),enabled:n&&!!d.type_id});E.useEffect(()=>{if(n)if(q(""),p([]),s&&Z.data){const R=Z.data.item;v({type_id:R.type_id,title:R.title,organizer:R.organizer??"",start_date:(R.start_date??"").slice(0,10),end_date:(R.end_date??"").slice(0,10),status:R.status,role:R.role??"",level:R.level??"",award_grade:R.award_grade??"",rank:R.rank!=null?String(R.rank):"",polarity:R.polarity,weight:String(R.weight??3),description:R.description??"",result:R.result??"",tags:R.tags??[],dimension_ids:R.dimensions??[],group_id:R.group_id??"",parent_id:R.parent_id!=null?String(R.parent_id):"",extras:R.extras??{}})}else v(gg)},[n,s,Z.data]);const U=E.useMemo(()=>{var ae,X;const R={};for(const ke of((ae=H.data)==null?void 0:ae.items)??[])(R[X=ke.kind]??(R[X]=[])).push({value:ke.value,label:ke.value});return R},[H.data]),I=Sd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const R={};for(const ke of(Y==null?void 0:Y.form_template)??[])if(ke.metric&&ke.widget==="number"){const Nt=d.extras[ke.key];typeof Nt=="number"&&!Number.isNaN(Nt)&&(R[ke.metric]=Nt)}const ae={id:s??void 0,type_id:d.type_id,title:d.title.trim(),organizer:d.organizer||null,start_date:d.start_date||null,end_date:d.end_date||null,status:d.status,role:d.role||null,level:d.level||null,award_grade:d.award_grade&&d.award_grade!=="无"?d.award_grade:null,rank:d.rank?Number(d.rank):null,polarity:d.polarity,description:d.description,result:d.result,tags:d.tags,dimension_ids:d.dimension_ids,group_id:d.group_id||null,parent_id:d.parent_id?Number(d.parent_id):null,weight:Number(d.weight)||3,extras:d.extras,metrics:R},X=await T0(ae);for(const ke of b)await Td(X.id,ke.file,ke.thumb_b64);return X.id},onSuccess:R=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",R]}),f.invalidateQueries({queryKey:["types"]}),m("success",s?"记录已更新":"记录已创建"),o==null||o(R),r()},onError:R=>q(R.message)}),le=(R,ae)=>v(X=>({...X,[R]:ae})),Ve=Sd({mutationFn:R=>C0(R),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})}),Fe=R=>R==="organizer"?h.jsx(De,{label:"组织方 / 所在组织",children:h.jsx(nt,{value:d.organizer,onChange:ae=>le("organizer",ae.target.value),placeholder:"如:中国工业与应用数学学会"})},"organizer"):R==="role"?h.jsx(De,{label:"角色",children:h.jsx(ml,{value:d.role,onChange:ae=>le("role",ae.target.value),options:[{value:"",label:"未设置"},...U.role??[]]})},"role"):R==="level"?h.jsx(De,{label:"级别",children:h.jsx(ml,{value:d.level,onChange:ae=>le("level",ae.target.value),options:[{value:"",label:"未设置"},...U.level??[]]})},"level"):R==="award_grade"?h.jsx(De,{label:"奖等",children:h.jsx(ml,{value:d.award_grade,onChange:ae=>le("award_grade",ae.target.value),options:[{value:"",label:"未设置"},...E5.map(ae=>({value:ae,label:ae}))]})},"award_grade"):R==="rank"?h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:ae=>le("rank",ae.target.value),placeholder:"如 2"})},"rank"):null;return h.jsxs(so,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:h.jsxs(h.Fragment,{children:[K&&h.jsx("span",{className:"mr-auto text-[12px] text-danger",children:K}),h.jsx(zt,{variant:"secondary",onClick:r,children:"取消"}),h.jsx(zt,{variant:"primary",onClick:()=>I.mutate(),disabled:I.isPending,children:I.isPending?"保存中…":"保存"})]}),children:[h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"类型",required:!0,children:h.jsx(ml,{value:d.type_id!=null?String(d.type_id):"",onChange:R=>le("type_id",R.target.value?Number(R.target.value):null),options:[{value:"",label:"请选择"},...(((ie=D.data)==null?void 0:ie.items)??[]).map(R=>({value:String(R.id),label:R.name}))]})}),h.jsx(De,{label:"标题",required:!0,children:h.jsx(nt,{value:d.title,onChange:R=>le("title",R.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"开始日期",children:h.jsx(nt,{type:"date",value:d.start_date,onChange:R=>le("start_date",R.target.value)})}),h.jsx(De,{label:"结束日期",children:h.jsx(nt,{type:"date",value:d.end_date,onChange:R=>le("end_date",R.target.value)})}),h.jsx(De,{label:"状态",children:h.jsx(ml,{value:d.status,onChange:R=>le("status",R.target.value),options:_5})})]}),h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2 text-[12px] font-semibold text-ink-2",children:["类型要素",Y?" · "+Y.name:""]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:de.core.map(R=>Fe(R))}),Y&&Y.form_template.length>0&&h.jsxs("div",{className:"mt-3.5",children:[h.jsx("div",{className:"mb-2 text-[11.5px] text-ink-3",children:"专项信息"}),h.jsx(b5,{fields:Y.form_template,value:d.extras,onChange:R=>le("extras",R),taxonomies:U})]})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"工作内容 / 描述",children:h.jsx(wd,{value:d.description,onChange:R=>le("description",R.target.value),placeholder:"具体做了什么、承担什么分工"})}),h.jsx(De,{label:"结果 / 产出",children:h.jsx(wd,{value:d.result,onChange:R=>le("result",R.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5 border-t border-line pt-4",children:[h.jsx(De,{label:"标签",children:h.jsx(g5,{value:d.tags,onChange:R=>le("tags",R)})}),h.jsx(De,{label:"成长维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((Te=Q.data)==null?void 0:Te.items)??[]).map(R=>{const ae=d.dimension_ids.includes(R.id);return h.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(ae?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>le("dimension_ids",ae?d.dimension_ids.filter(X=>X!==R.id):[...d.dimension_ids,R.id]),children:R.name},R.id)}),!((re=Q.data)!=null&&re.items.length)&&h.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),h.jsxs("details",{className:"border-t border-line pt-4",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[12px] text-ink-3 transition-colors hover:text-ink-2",children:"高级选项(重要度 · 名次 · 性质 · 关联)"}),h.jsxs("div",{className:"mt-3 grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[h.jsx(De,{label:"重要度",children:h.jsx(ml,{value:d.weight,onChange:R=>le("weight",R.target.value),options:[1,2,3,4,5].map(R=>({value:String(R),label:String(R)}))})}),!de.core.includes("rank")&&h.jsx(De,{label:"名次",children:h.jsx(nt,{type:"number",className:"num",value:d.rank,onChange:R=>le("rank",R.target.value),placeholder:"如 2"})}),h.jsx(De,{label:"性质",children:h.jsx(ml,{value:d.polarity,onChange:R=>le("polarity",R.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),h.jsx(De,{label:"上级记录",hint:"晋升链",children:h.jsx(ml,{value:d.parent_id,onChange:R=>le("parent_id",R.target.value),options:[{value:"",label:"无"},...(((V=F.data)==null?void 0:V.items)??[]).filter(R=>R.id!==s).map(R=>({value:String(R.id),label:R.title.slice(0,24)}))]})})]}),h.jsx("div",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:h.jsx(De,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:h.jsx(nt,{value:d.group_id,onChange:R=>le("group_id",R.target.value),placeholder:"如 g2025001(可选)"})})})]}),s?h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:((ee=J.data)==null?void 0:ee.items)??[],pending:b,uploading:x,onPick:async R=>{if(s){g(!0);try{let ae=0;for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}const ke=await vg(X);await Td(s,ke.file,ke.thumb_b64),ae++}ae>0&&(f.invalidateQueries({queryKey:["attachments",s]}),m("success","已上传 "+ae+" 个附件"))}catch(ae){m("error",ae.message)}finally{g(!1)}}},onDeleteSaved:R=>Ve.mutate(R),onDeletePending:()=>{},onOpenSaved:R=>k(R)}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)· 单个文件不超过 80MB"})]}):h.jsxs("div",{className:"border-t border-line pt-4",children:[h.jsx(yg,{items:[],pending:b,onPick:async R=>{const ae=[];for(const X of Array.from(R)){if(X.size>bg){m("error","「"+X.name+"」超过 80MB,已跳过");continue}ae.push(await vg(X))}p(X=>[...X,...ae])},onDeleteSaved:()=>{},onDeletePending:R=>p(ae=>ae.filter((X,ke)=>ke!==R))}),h.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]}),h.jsx(e1,{att:_,onClose:()=>k(null)})]})}const ki=new Map;function N5({open:n,onClose:r,footprintId:s,onEdit:o}){var U,I,le,Ve,Fe;const f=lu(),m=oo(),d=yl({queryKey:["footprint",s],queryFn:()=>Id(s),enabled:n&&!!s}),v=yl({queryKey:["types"],queryFn:ro,enabled:n}),b=yl({queryKey:["dimensions"],queryFn:Wd,enabled:n}),p=(U=d.data)==null?void 0:U.item,x=(I=v.data)==null?void 0:I.items.find(ie=>ie.id===(p==null?void 0:p.type_id)),g=((p==null?void 0:p.dimensions)??[]).map(ie=>{var Te,re;return(re=(Te=b.data)==null?void 0:Te.items.find(V=>V.id===ie))==null?void 0:re.name}).filter(Boolean),[_,k]=E.useState(!1),[K,q]=E.useState(null),D=Sd({mutationFn:()=>jl(()=>Promise.resolve().then(()=>t_),void 0).then(ie=>ie.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),m("success","记录已删除"),k(!1),r()}}),[H,Q]=E.useState({}),Z=(p==null?void 0:p.attachments)??[],J=Z.filter(ie=>{var Te;return(Te=ie.mime)==null?void 0:Te.startsWith("image/")}),Y=Z.filter(ie=>{var Te;return!((Te=ie.mime)!=null&&Te.startsWith("image/"))}),de=Z.map(ie=>ie.id).join(",");E.useEffect(()=>{if(!n||!de)return;let ie=!1;const Te=Z.filter(re=>{var V;return(V=re.mime)==null?void 0:V.startsWith("image/")});return(async()=>{for(const re of Te){if(ie)return;if(ki.has(re.id)){Q(V=>({...V,[re.id]:ki.get(re.id)}));continue}if(re.remote_thumb){ki.set(re.id,re.remote_thumb),Q(V=>({...V,[re.id]:re.remote_thumb}));continue}try{if(re.thumb_rel_path){const V=await z0(re.id);if(ie)return;const ee="data:"+(V.mime||"image/webp")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}else{const V=await eo(re.id);if(ie)return;const ee=await t1(V.data_b64,V.mime||"image/png");ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}}catch{try{const V=await eo(re.id);if(ie)return;const ee="data:"+(V.mime||"image/png")+";base64,"+V.data_b64;ki.set(re.id,ee),Q(R=>({...R,[re.id]:ee}))}catch{}}}})(),()=>{ie=!0}},[n,s,de]);const F=[];if(p&&x)for(const ie of x.form_template??[]){const Te=(p.extras??{})[ie.key];if(Te==null||Te==="")continue;const re=Array.isArray(Te)?Te.join("、"):String(Te);F.push({label:ie.label,value:ie.unit?re+" "+ie.unit:re})}return h.jsxs(so,{open:n,onClose:r,width:680,title:"记录详情",footer:p?h.jsxs(h.Fragment,{children:[h.jsxs(zt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>k(!0),disabled:D.isPending,children:[h.jsx(Ed,{size:13})," 删除"]}),h.jsx(zt,{variant:"secondary",onClick:r,children:"关闭"}),h.jsxs(zt,{variant:"primary",onClick:()=>s&&(o==null?void 0:o(s)),children:[h.jsx(YE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!p?h.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-[20px] font-bold leading-tight tracking-tight text-ink-1",style:{textWrap:"balance"},children:p.title}),h.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[h.jsx(Ii,{color:p.type_color,className:Gn,children:p.type_name}),h.jsx($0,{level:p.level}),h.jsx(P0,{grade:p.award_grade}),h.jsx(W0,{role:p.role}),h.jsx(F0,{status:p.status}),p.polarity==="negative"&&h.jsx(I0,{}),p.rank!=null&&h.jsxs(Ii,{color:"var(--text-3)",className:Gn,children:["第 ",p.rank," 名"]})]})]}),h.jsx(Hi,{title:"事项要素",children:h.jsxs("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px] sm:grid-cols-2",children:[h.jsx(nd,{label:"时间",value:x5(p.start_date,p.end_date)||"—"}),h.jsx(nd,{label:"组织方",value:p.organizer||"—"}),F.map(ie=>h.jsx(nd,{label:ie.label,value:ie.value},ie.label))]})}),(((le=p.attachments)==null?void 0:le.length)??0)>0&&h.jsx(Hi,{title:"附件("+(((Ve=p.attachments)==null?void 0:Ve.length)??0)+")",children:Z.length?h.jsxs("div",{className:"flex flex-col gap-2.5",children:[J.length>0&&h.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:J.map(ie=>h.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>q(ie),title:"点击预览:"+ie.file_name,children:[H[ie.id]?h.jsx("img",{src:H[ie.id],alt:ie.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):h.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),h.jsx("span",{className:"absolute inset-x-0 bottom-0 truncate bg-gradient-to-t from-black/60 to-transparent px-1.5 pb-1 pt-3 text-[10px] text-white opacity-0 transition-opacity group-hover:opacity-100",children:ie.file_name})]},ie.id))}),Y.length>0&&h.jsx("div",{className:"flex flex-col gap-1",children:Y.map(ie=>h.jsxs("button",{className:"flex items-center gap-2 rounded-md border border-line bg-surface px-2.5 py-2 text-left text-[12.5px] transition-colors hover:border-line-strong",onClick:()=>q(ie),children:[h.jsx(y0,{size:14,className:"shrink-0 text-ink-3"}),h.jsx("span",{className:"truncate text-ink-1",children:ie.file_name}),h.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Cd(ie.size)}),h.jsx(Kd,{size:12,className:"shrink-0 text-ink-3"})]},ie.id))}),h.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)"})]}):h.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})}),p.description&&h.jsx(Hi,{title:"工作内容 / 描述",children:h.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:p.description})}),p.result&&h.jsx(Hi,{title:"结果 / 产出",children:h.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:p.result})}),p.metrics&&Object.keys(p.metrics).length>0&&h.jsx(Hi,{title:"量化指标",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(p.metrics).map(([ie,Te])=>h.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[ie,": ",h.jsx("span",{className:"font-medium text-ink-1",children:Te})]},ie))})}),((((Fe=p.tags)==null?void 0:Fe.length)??0)>0||g.length>0)&&h.jsx(Hi,{title:"标签与维度",children:h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[p.tags.map(ie=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:ie},ie)),g.map(ie=>h.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:ie},ie))]})}),h.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 border-t border-line pt-3 text-[11.5px] text-ink-3",children:[h.jsxs("span",{children:["创建于 ",mg(p.created_at)]}),h.jsxs("span",{children:["更新于 ",mg(p.updated_at)]}),p.group_id&&h.jsxs("span",{children:["事件组 ",p.group_id]}),p.parent_id!=null&&h.jsxs("span",{children:["上级 #",p.parent_id]})]})]}),h.jsx(e1,{att:K,onClose:()=>q(null)}),h.jsx(I_,{open:_,title:"删除记录",content:p?"确定删除「"+p.title+"」吗?该操作不可撤销。":"",onCancel:()=>k(!1),onOk:()=>D.mutate(),loading:D.isPending})]})}function nd({label:n,value:r}){return h.jsxs("div",{className:"grid min-w-0 grid-cols-[76px_1fr] gap-x-2.5",children:[h.jsx("span",{className:"shrink-0 text-right text-ink-3",children:n}),h.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function Hi({title:n,children:r}){return h.jsxs("div",{children:[h.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function w5(){var Y,de,F;const[n,r]=E.useState(""),[s,o]=E.useState(""),[f,m]=E.useState(""),[d,v]=E.useState(""),[b,p]=E.useState(null),[x,g]=E.useState(!1),[_,k]=E.useState(null),[K,q]=E.useState(!1),D=yl({queryKey:["types"],queryFn:ro}),H=E.useMemo(()=>({q:n||void 0,types:s?[Number(s)]:void 0,year:f?Number(f):void 0,polarity:d||void 0,sort:"date_desc",page_size:2e3}),[n,s,f,d]),Q=yl({queryKey:["timeline",H],queryFn:()=>N0(H)}),Z=E.useMemo(()=>{var I;const U=new Set;for(const le of((I=Q.data)==null?void 0:I.groups)??[])U.add(le.year);return Array.from(U).sort((le,Ve)=>Ve-le)},[Q.data]),J=U=>{k(U),q(!0)};return h.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[h.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[h.jsx(nt,{className:"w-full sm:w-[220px]",placeholder:"搜索足迹…",value:n,onChange:U=>r(U.target.value)}),h.jsxs("div",{className:"grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:items-center sm:gap-2",children:[h.jsx(ml,{className:"w-full sm:w-[130px]",value:s,onChange:U=>o(U.target.value),options:[{value:"",label:"全部类型"},...(((Y=D.data)==null?void 0:Y.items)??[]).map(U=>({value:String(U.id),label:U.name}))]}),h.jsx(ml,{className:"w-full sm:w-[120px]",value:f,onChange:U=>m(U.target.value),options:[{value:"",label:"全部年份"},...Z.map(U=>({value:String(U),label:U+" 年"}))]}),h.jsx(ml,{className:"w-full sm:w-[110px]",value:d,onChange:U=>v(U.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})]}),h.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((de=Q.data)==null?void 0:de.total)??0," 条"]})]}),Q.isLoading?h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(F=Q.data)!=null&&F.groups.length?h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),Q.data.groups.map(U=>h.jsxs("section",{className:"mb-2",children:[h.jsxs("div",{className:"sticky top-0 z-10 -mx-3 flex items-center gap-2 bg-bg/90 px-3 py-2 backdrop-blur sm:-mx-6 sm:px-6",children:[h.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:U.year}),h.jsxs("span",{className:"text-[12px] text-ink-3",children:[U.count," 条记录"]})]}),U.months.map(I=>h.jsxs("div",{className:"mb-3",children:[h.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[I.month," 月"]}),h.jsx("div",{className:"flex flex-col gap-2",children:I.items.map(le=>h.jsx(C5,{row:le,onClick:()=>J(le.id)},le.id))})]},I.month))]},U.year))]}):h.jsx($_,{icon:h.jsx(m0,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),h.jsx(N5,{open:K,onClose:()=>q(!1),footprintId:_,onEdit:U=>{q(!1),p(U),g(!0)}}),h.jsx(T5,{open:x,onClose:()=>g(!1),footprintId:b})]})}function C5({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return h.jsxs("button",{onClick:r,className:"group relative w-full rounded-lg border border-line bg-surface px-4 py-3 text-left shadow-card transition-all hover:border-line-strong hover:shadow-pop",children:[h.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsxs("div",{className:"num w-[52px] shrink-0 pt-0.5 text-[12px] leading-relaxed text-ink-3",children:[s.slice(5,7),"-",s.slice(8,10)]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[h.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),h.jsx(Ii,{color:n.type_color,children:n.type_name}),h.jsx($0,{level:n.level}),h.jsx(P0,{grade:n.award_grade}),h.jsx(W0,{role:n.role}),h.jsx(F0,{status:n.status}),n.polarity==="negative"&&h.jsx(I0,{})]}),n.organizer&&h.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&h.jsx("p",{className:"mt-1 line-clamp-2 text-[12.5px] leading-relaxed text-ink-2",children:n.description}),(n.result||n.tags.length>0||n.attachment_count>0)&&h.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11.5px] text-ink-3",children:[n.result&&h.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(o=>h.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:o},o)),n.attachment_count>0&&h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(Kd,{size:11}),n.attachment_count]})]})]}),h.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:h.jsx(h5,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const j5=E.lazy(()=>jl(()=>import("./RecordsPage-Cw1hR-e8.js"),[]).then(n=>({default:n.RecordsPage}))),z5=E.lazy(()=>jl(()=>import("./DashboardPage-D4LhDSa-.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),O5=E.lazy(()=>jl(()=>import("./GradesPage-BA4OWO_9.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),R5=E.lazy(()=>jl(()=>import("./TypesPage-ylNPxGjz.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),A5=E.lazy(()=>jl(()=>import("./TaxonomyPage-Dz7XzeHU.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),M5=E.lazy(()=>jl(()=>import("./AdminPage-Cppzhhx8.js"),__vite__mapDeps([7,1,8])).then(n=>({default:n.AdminPage}))),D5=E.lazy(()=>jl(()=>import("./ProfilePage-TayaPPPy.js"),[]).then(n=>({default:n.ProfilePage}))),U5=E.lazy(()=>jl(()=>import("./ResumePage-DoaIVQ9K.js"),__vite__mapDeps([9,1,8])).then(n=>({default:n.ResumePage})));function Ja(){return h.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function k5(){return h.jsx(dS,{children:h.jsxs(tl,{element:h.jsx(o5,{}),children:[h.jsx(tl,{path:"/",element:h.jsx(Vp,{to:"/timeline",replace:!0})}),h.jsx(tl,{path:"/timeline",element:h.jsx(w5,{})}),h.jsx(tl,{path:"/records",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(j5,{})})}),h.jsx(tl,{path:"/grades",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(O5,{})})}),h.jsx(tl,{path:"/dashboard",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(z5,{})})}),h.jsx(tl,{path:"/types",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(R5,{})})}),h.jsx(tl,{path:"/taxonomy",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(A5,{})})}),h.jsx(tl,{path:"/admin",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(M5,{})})}),h.jsx(tl,{path:"/profile",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(D5,{})})}),h.jsx(tl,{path:"/resume",element:h.jsx(E.Suspense,{fallback:h.jsx(Ja,{}),children:h.jsx(U5,{})})}),h.jsx(tl,{path:"*",element:h.jsx(Vp,{to:"/timeline",replace:!0})})]})})}const H5=new b3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:0,gcTime:0}}}),xg=localStorage.getItem("fp-theme");(xg==="dark"||!xg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");function l1(){var r;const n=getComputedStyle(document.documentElement).getPropertyValue("--bg").trim();n&&((r=document.querySelector('meta[name="theme-color"]'))==null||r.setAttribute("content",n))}l1();window.addEventListener("fp-theme-change",l1);"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});o2.createRoot(document.getElementById("root")).render(h.jsx(l2.StrictMode,{children:h.jsx(ZS,{client:H5,children:h.jsx(HS,{children:h.jsx(k5,{})})})}));export{vl as $,U4 as A,zt as B,I_ as C,k4 as D,$_ as E,so as F,P0 as G,De as H,nt as I,H4 as J,D4 as K,$0 as L,h5 as M,_4 as N,G5 as O,XE as P,Y5 as Q,W0 as R,ml as S,Ed as T,T4 as U,N4 as V,w4 as W,C4 as X,j4 as Y,Wd as Z,Ol as _,pl as a,g0 as a0,Cd as a1,K4 as a2,Z4 as a3,J4 as a4,P4 as a5,$4 as a6,F4 as a7,jl as a8,X4 as a9,V4 as aa,p4 as ab,wd as ac,e_ as ad,I4 as ae,W4 as af,nE as ag,L5 as ah,Ag as ai,t_ as aj,KS as b,pe as c,oo as d,B5 as e,yl as f,Sd as g,x5 as h,F0 as i,h as j,mg as k,YE as l,Ii as m,N5 as n,T5 as o,z4 as p,ro as q,E as r,E0 as s,O4 as t,lu as u,_0 as v,v0 as w,L4 as x,B4 as y,q4 as z}; diff --git a/sync-server/www/assets/mammoth.browser-vtTTgAGk.js b/sync-server/www/assets/mammoth.browser-CcmILf3Q.js similarity index 99% rename from sync-server/www/assets/mammoth.browser-vtTTgAGk.js rename to sync-server/www/assets/mammoth.browser-CcmILf3Q.js index 72ebb10..2c0220c 100644 --- a/sync-server/www/assets/mammoth.browser-vtTTgAGk.js +++ b/sync-server/www/assets/mammoth.browser-CcmILf3Q.js @@ -1,4 +1,4 @@ -import{ah as dt,ai as mn}from"./index-AIpE8C-f.js";function vn(ut,Et){for(var P=0;Poe[R]})}}}return Object.freeze(Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"}))}function bt(ut){throw new Error('Could not dynamically require "'+ut+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xt={exports:{}},hr;function yn(){return hr||(hr=1,(function(ut,Et){(function(P){ut.exports=P()})(function(){return(function P(oe,R,M){function E(p,u){if(!R[p]){if(!oe[p]){var i=typeof bt=="function"&&bt;if(!u&&i)return i(p,!0);if(a)return a(p,!0);var e=new Error("Cannot find module '"+p+"'");throw e.code="MODULE_NOT_FOUND",e}var s=R[p]={exports:{}};oe[p][0].call(s.exports,function(d){var y=oe[p][1][d];return E(y||d)},s,s.exports,P,oe,R,M)}return R[p].exports}for(var a=typeof bt=="function"&&bt,g=0;goe[R]})}}}return Object.freeze(Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"}))}function bt(ut){throw new Error('Could not dynamically require "'+ut+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xt={exports:{}},hr;function yn(){return hr||(hr=1,(function(ut,Et){(function(P){ut.exports=P()})(function(){return(function P(oe,R,M){function E(p,u){if(!R[p]){if(!oe[p]){var i=typeof bt=="function"&&bt;if(!u&&i)return i(p,!0);if(a)return a(p,!0);var e=new Error("Cannot find module '"+p+"'");throw e.code="MODULE_NOT_FOUND",e}var s=R[p]={exports:{}};oe[p][0].call(s.exports,function(d){var y=oe[p][1][d];return E(y||d)},s,s.exports,P,oe,R,M)}return R[p].exports}for(var a=typeof bt=="function"&&bt,g=0;g0&&(Ee=X.concat(Ee),X=[]),r.map(ne(fe),K(Ee),function(Se,Me){return new a.Paragraph(Me,Se)}).insertExtra()},"w:r":function(re){return r.map(ie(re.firstOrEmpty("w:rPr")),K(re.children),function(fe,_e){var Ee=Ie();return Ee!==null&&(_e=[new a.Hyperlink(_e,Ee)]),new a.Run(_e,fe)})},"w:fldChar":be,"w:instrText":Le,"w:t":function(re){return c(new a.Text(re.text()))},"w:tab":function(re){return c(new a.Tab)},"w:noBreakHyphen":function(){return c(new a.Text("‑"))},"w:softHyphen":function(re){return c(new a.Text(""))},"w:sym":Be,"w:hyperlink":function(re){var fe=re.attributes["r:id"],_e=re.attributes["w:anchor"];return K(re.children).map(function(Ee){function Se(Pe){var Fe=re.attributes["w:tgtFrame"]||null;return new a.Hyperlink(Ee,E.extend({targetFrame:Fe},Pe))}if(fe){var Me=x.findTargetByRelationshipId(fe);return _e&&(Me=e.replaceFragment(Me,_e)),Se({href:Me})}else return _e?Se({anchor:_e}):Ee})},"w:tbl":l,"w:tr":o,"w:tc":D,"w:footnoteReference":f("footnote"),"w:endnoteReference":f("endnote"),"w:commentReference":$,"w:br":function(re){var fe=re.attributes["w:type"];return fe==null||fe==="textWrapping"?c(a.lineBreak):fe==="page"?c(a.pageBreak):fe==="column"?c(a.columnBreak):h([p("Unsupported break type: "+fe)])},"w:bookmarkStart":function(re){var fe=re.attributes["w:name"];return fe==="_GoBack"?_():c(new a.BookmarkStart({name:fe}))},"mc:AlternateContent":function(re){return V(re.firstOrEmpty("mc:Fallback"))},"w:sdt":function(re){var fe=K(re.firstOrEmpty("w:sdtContent").children);return fe.map(function(_e){var Ee=re.firstOrEmpty("w:sdtPr").first("wordml:checkbox");if(Ee){var Se=Ee.first("wordml:checked"),Me=!!Se&&Q(Se.attributes["wordml:val"]),Pe=a.checkbox({checked:Me}),Fe=!1,Ze=_e.map(i._elementsOfType(a.types.text,function(N){return N.value.length>0&&!Fe?(Fe=!0,Pe):N}));return Fe?Ze:Pe}else return _e})},"w:customXml":V,"w:ins":V,"w:moveFromRangeEnd":V,"w:moveFromRangeStart":V,"w:moveTo":V,"w:moveToRangeEnd":V,"w:moveToRangeStart":V,"w:object":V,"w:smartTag":V,"w:drawing":V,"w:pict":function(re){return V(re).toExtra()},"v:roundrect":V,"v:shape":V,"v:textbox":V,"w:txbxContent":V,"wp:inline":ae,"wp:anchor":ae,"v:imagedata":Ae,"v:group":V,"v:rect":V};return{readXmlElement:pe,readXmlElements:K};function l(re){var fe=t(re.firstOrEmpty("w:tblPr"));return K(re.children).flatMap(G).flatMap(function(_e){return fe.map(function(Ee){return a.Table(_e,Ee)})})}function t(re){return Re(re).map(function(fe){return{styleId:fe.styleId,styleName:fe.name}})}function o(re){var fe=re.firstOrEmpty("w:trPr"),_e=!!fe.first("w:del");if(_e)return _();var Ee=!!fe.first("w:tblHeader");return K(re.children).map(function(Se){return a.TableRow(Se,{isHeader:Ee})})}function D(re){return K(re.children).map(function(fe){var _e=re.firstOrEmpty("w:tcPr"),Ee=_e.firstOrEmpty("w:gridSpan").attributes["w:val"],Se=Ee?parseInt(Ee,10):1,Me=a.TableCell(fe,{colSpan:Se});return Me._vMerge=C(_e),Me})}function C(re){var fe=re.first("w:vMerge");if(fe){var _e=fe.attributes["w:val"];return _e==="continue"||!_e}else return null}function G(re){var fe=E.any(re,function(Se){return Se.type!==a.types.tableRow});if(fe)return te(re),n(re,[p("unexpected non-row element in table, cell merging may be incorrect")]);var _e=E.any(re,function(Se){return E.any(Se.children,function(Me){return Me.type!==a.types.tableCell})});if(_e)return te(re),n(re,[p("unexpected non-cell element in table row, cell merging may be incorrect")]);var Ee={};return re.forEach(function(Se){var Me=0;Se.children.forEach(function(Pe){Pe._vMerge&&Ee[Me]?Ee[Me].rowSpan++:(Ee[Me]=Pe,Pe._vMerge=!1),Me+=Pe.colSpan})}),re.forEach(function(Se){Se.children=Se.children.filter(function(Me){return!Me._vMerge}),Se.children.forEach(function(Me){delete Me._vMerge})}),c(re)}function te(re){re.forEach(function(fe){var _e=i.getDescendantsOfType(fe,a.types.tableCell);_e.forEach(function(Ee){delete Ee._vMerge})})}function ae(re){var fe=re.getElementsByTagName("a:graphic").getElementsByTagName("a:graphicData").getElementsByTagName("pic:pic").getElementsByTagName("pic:blipFill").getElementsByTagName("a:blip");return m(fe.map(de.bind(null,re)))}function de(re,fe){var _e=re.firstOrEmpty("wp:docPr"),Ee=_e.attributes,Se=Te(Ee.descr)?Ee.title:Ee.descr,Me=me(fe);return Me===null?h([p("Could not find image file for a:blip element")]):ze(Me,Se).map(function(Pe){var Fe=_e.firstOrEmpty("a:hlinkClick"),Ze=Fe.attributes["r:id"];if(Ze){var N=x.findTargetByRelationshipId(Ze);return new a.Hyperlink([Pe],{href:N})}else return Pe})}function Te(re){return re==null||/^\s*$/.test(re)}function me(re){var fe=re.attributes["r:embed"],_e=re.attributes["r:link"];if(fe)return Ue(fe);if(_e){var Ee=x.findTargetByRelationshipId(_e);return{path:Ee,read:B.read.bind(B,Ee)}}else return null}function Ae(re){var fe=re.attributes["r:id"];return fe?ze(Ue(fe),re.attributes["o:title"]):h([p("A v:imagedata element without a relationship ID was ignored")])}function Ue(re){var fe=e.uriToZipEntryName("word",x.findTargetByRelationshipId(re));return{path:fe,read:ee.read.bind(ee,fe)}}function ze(re,fe){var _e=W.findContentType(re.path),Ee=a.Image({readImage:re.read,altText:fe,contentType:_e}),Se=w[_e]?[]:p("Image of type "+_e+" is unlikely to display in web browsers");return n(Ee,Se)}function He(re,fe){return p(re+" style with ID "+fe+" was referenced but not defined in the document")}}function y(k,A,O){var X=A.firstOrEmpty("w:ilvl").attributes["w:val"],x=A.firstOrEmpty("w:numId").attributes["w:val"];if(X!==void 0&&x!==void 0)return O.findLevel(x,X);if(k!=null){var W=O.findLevelByParagraphStyleId(k);if(W!=null)return W}return x!==void 0?O.findLevel(x,"0"):null}var w={"image/png":!0,"image/gif":!0,"image/jpeg":!0,"image/svg+xml":!0,"image/tiff":!0},v={"office-word:wrap":!0,"v:shadow":!0,"v:shapetype":!0,"w:annotationRef":!0,"w:bookmarkEnd":!0,"w:sectPr":!0,"w:proofErr":!0,"w:lastRenderedPageBreak":!0,"w:commentRangeStart":!0,"w:commentRangeEnd":!0,"w:del":!0,"w:footnoteRef":!0,"w:endnoteRef":!0,"w:moveFrom":!0,"w:pPr":!0,"w:rPr":!0,"w:tblPr":!0,"w:tblGrid":!0,"w:trPr":!0,"w:tcPr":!0};function h(k){return new r(null,null,k)}function _(){return new r(null)}function c(k){return new r(k)}function n(k,A){return new r(k,null,A)}function r(k,A,O){this.value=k||[],this.extra=A||[],this._result=new g({element:this.value,extra:A},O),this.messages=this._result.messages}r.prototype.toExtra=function(){return new r(null,I(this.extra,this.value),this.messages)},r.prototype.insertExtra=function(){var k=this.extra;return k&&k.length?new r(I(this.value,k),null,this.messages):this},r.prototype.map=function(k){var A=this._result.map(function(O){return k(O.element)});return new r(A.value,this.extra,A.messages)},r.prototype.flatMap=function(k){var A=this._result.flatMap(function(O){return k(O.element)._result});return new r(A.value.element,I(this.extra,A.value.extra),A.messages)},r.map=function(k,A,O){return new r(O(k.value,A.value),I(k.extra,A.extra),k.messages.concat(A.messages))};function m(k){var A=g.combine(E.pluck(k,"_result"));return new r(E.flatten(E.pluck(A.value,"element")),E.filter(E.flatten(E.pluck(A.value,"extra")),U),A.messages)}function I(k,A){return E.flatten([k,A])}function U(k){return k}},{"../documents":4,"../results":25,"../transforms":30,"../xml":35,"./uris":16,"dingbat-to-unicode":50,underscore:67}],6:[function(P,oe,R){var M=P("../documents"),E=P("../results").Result;function a(g){function p(i){return E.combine(i.getElementsByTagName("w:comment").map(u))}function u(i){var e=i.attributes["w:id"];function s(d){return(i.attributes[d]||"").trim()||null}return g.readXmlElements(i.children).map(function(d){return M.comment({commentId:e,body:d,authorName:s("w:author"),authorInitials:s("w:initials")})})}return p}R.createCommentsReader=a},{"../documents":4,"../results":25}],7:[function(P,oe,R){R.readContentTypesFromXml=E;var M={png:"png",gif:"gif",jpeg:"jpeg",jpg:"jpeg",tif:"tiff",tiff:"tiff",bmp:"bmp"};R.defaultContentTypes=a({},{});function E(g){var p=Object.create(null),u=Object.create(null);return g.children.forEach(function(i){if(i.name==="content-types:Default"&&(p[i.attributes.Extension]=i.attributes.ContentType),i.name==="content-types:Override"){var e=i.attributes.PartName;e.charAt(0)==="/"&&(e=e.substring(1)),u[e]=i.attributes.ContentType}}),a(u,p)}function a(g,p){return{findContentType:function(u){var i=g[u];if(i)return i;var e=u.split("."),s=e[e.length-1];if(Object.prototype.hasOwnProperty.call(p,s))return p[s];var d=M[s.toLowerCase()];return d?"image/"+d:null}}}},{}],8:[function(P,oe,R){R.DocumentXmlReader=a;var M=P("../documents"),E=P("../results").Result;function a(g){var p=g.bodyReader;function u(i){var e=i.first("w:body");if(e==null)throw new Error("Could not find the body element: are you sure this is a docx file?");var s=p.readXmlElements(e.children).map(function(d){return new M.Document(d,{notes:g.notes,comments:g.comments})});return new E(s.value,s.messages)}return{convertXmlToDocument:u}}},{"../documents":4,"../results":25}],9:[function(P,oe,R){R.read=_,R._findPartPaths=c;var M=P("../promises"),E=P("../documents"),a=P("../results").Result,g=P("../zipfile"),p=P("./office-xml-reader").readXmlFromZipFile,u=P("./body-reader").createBodyReader,i=P("./document-xml-reader").DocumentXmlReader,e=P("./relationships-reader"),s=P("./content-types-reader"),d=P("./numbering-xml"),y=P("./styles-reader"),w=P("./notes-reader"),v=P("./comments-reader"),h=P("./files").Files;function _(x,W,ee){W=W||{},ee=ee||{};var B=new h({externalFileAccess:ee.externalFileAccess,relativeToFile:W.path});return M.props({contentTypes:k(x),partPaths:c(x),docxFile:x,files:B}).also(function(Y){return{styles:O(x,Y.partPaths.styles)}}).also(function(Y){return{numbering:A(x,Y.partPaths.numbering,Y.styles)}}).also(function(Y){return{footnotes:I(Y.partPaths.footnotes,Y,function(T,K){return K?w.createFootnotesReader(T)(K):new a([])}),endnotes:I(Y.partPaths.endnotes,Y,function(T,K){return K?w.createEndnotesReader(T)(K):new a([])}),comments:I(Y.partPaths.comments,Y,function(T,K){return K?v.createCommentsReader(T)(K):new a([])})}}).also(function(Y){return{notes:Y.footnotes.flatMap(function(T){return Y.endnotes.map(function(K){return new E.Notes(T.concat(K))})})}}).then(function(Y){return I(Y.partPaths.mainDocument,Y,function(T,K){return Y.notes.flatMap(function(pe){return Y.comments.flatMap(function(ne){var ce=new i({bodyReader:T,notes:pe,comments:ne});return ce.convertXmlToDocument(K)})})})})}function c(x){return X(x).then(function(W){var ee=n({docxFile:x,relationships:W,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",basePath:"",fallbackPath:"word/document.xml"});if(!x.exists(ee))throw new Error("Could not find main document part. Are you sure this is a valid .docx file?");return m({filename:U(ee),readElement:e.readRelationships,defaultValue:e.defaultValue})(x).then(function(B){function Y(T){return n({docxFile:x,relationships:B,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"+T,basePath:g.splitPath(ee).dirname,fallbackPath:"word/"+T+".xml"})}return{mainDocument:ee,comments:Y("comments"),endnotes:Y("endnotes"),footnotes:Y("footnotes"),numbering:Y("numbering"),styles:Y("styles")}})})}function n(x){var W=x.docxFile,ee=x.relationships,B=x.relationshipType,Y=x.basePath,T=x.fallbackPath,K=ee.findTargetsByType(B),pe=K.map(function(ce){return r(g.joinPath(Y,ce),"/")}),ne=pe.filter(function(ce){return W.exists(ce)});return ne.length===0?T:ne[0]}function r(x,W){return x.substring(0,W.length)===W?x.substring(W.length):x}function m(x){return function(W){return p(W,x.filename).then(function(ee){return ee?x.readElement(ee):x.defaultValue})}}function I(x,W,ee){var B=m({filename:U(x),readElement:e.readRelationships,defaultValue:e.defaultValue});return B(W.docxFile).then(function(Y){var T=new u({relationships:Y,contentTypes:W.contentTypes,docxFile:W.docxFile,numbering:W.numbering,styles:W.styles,files:W.files});return p(W.docxFile,x).then(function(K){return ee(T,K)})})}function U(x){var W=g.splitPath(x);return g.joinPath(W.dirname,"_rels",W.basename+".rels")}var k=m({filename:"[Content_Types].xml",readElement:s.readContentTypesFromXml,defaultValue:s.defaultContentTypes});function A(x,W,ee){return m({filename:W,readElement:function(B){return d.readNumberingXml(B,{styles:ee})},defaultValue:d.defaultNumbering})(x)}function O(x,W){return m({filename:W,readElement:y.readStylesXml,defaultValue:y.defaultStyles})(x)}var X=m({filename:"_rels/.rels",readElement:e.readRelationships,defaultValue:e.defaultValue})},{"../documents":4,"../promises":23,"../results":25,"../zipfile":40,"./body-reader":5,"./comments-reader":6,"./content-types-reader":7,"./document-xml-reader":8,"./files":1,"./notes-reader":10,"./numbering-xml":11,"./office-xml-reader":12,"./relationships-reader":13,"./styles-reader":15}],10:[function(P,oe,R){var M=P("../documents"),E=P("../results").Result;R.createFootnotesReader=a.bind(this,"footnote"),R.createEndnotesReader=a.bind(this,"endnote");function a(g,p){function u(s){return E.combine(s.getElementsByTagName("w:"+g).filter(i).map(e))}function i(s){var d=s.attributes["w:type"];return d!=="continuationSeparator"&&d!=="separator"}function e(s){var d=s.attributes["w:id"];return p.readXmlElements(s.children).map(function(y){return M.Note({noteType:g,noteId:d,body:y})})}return u}},{"../documents":4,"../results":25}],11:[function(P,oe,R){var M=P("underscore");R.readNumberingXml=a,R.Numbering=E,R.defaultNumbering=new E({},{});function E(i,e,s){var d=M.flatten(M.values(e).map(function(_){return M.values(_.levels)})),y=M.indexBy(d.filter(function(_){return _.paragraphStyleId!=null}),"paragraphStyleId");function w(_,c){return v(_,c,Object.create(null))}function v(_,c,n){if(n[_])return null;n[_]=!0;var r=i[_];if(!r)return null;var m=e[r.abstractNumId];if(m){if(m.numStyleLink==null)return e[r.abstractNumId].levels[c];var I=s.findNumberingStyleById(m.numStyleLink);return v(I.numId,c,n)}else return null}function h(_){return y[_]||null}return{findLevel:w,findLevelByParagraphStyleId:h}}function a(i,e){if(!e||!e.styles)throw new Error("styles is missing");var s=g(i),d=u(i);return new E(d,s,e.styles)}function g(i){var e=Object.create(null);return i.getElementsByTagName("w:abstractNum").forEach(function(s){var d=s.attributes["w:abstractNumId"];e[d]=p(s)}),e}function p(i){var e=Object.create(null),s=null;i.getElementsByTagName("w:lvl").forEach(function(y){var w=y.attributes["w:ilvl"],v=y.firstOrEmpty("w:numFmt").attributes["w:val"],h=v!=="bullet",_=y.firstOrEmpty("w:pStyle").attributes["w:val"];w===void 0?s={isOrdered:h,level:"0",paragraphStyleId:_}:e[w]={isOrdered:h,level:w,paragraphStyleId:_}}),s!==null&&e[s.level]===void 0&&(e[s.level]=s);var d=i.firstOrEmpty("w:numStyleLink").attributes["w:val"];return{levels:e,numStyleLink:d}}function u(i){var e=Object.create(null);return i.getElementsByTagName("w:num").forEach(function(s){var d=s.attributes["w:numId"],y=s.first("w:abstractNumId").attributes["w:val"];e[d]={abstractNumId:y}}),e}},{underscore:67}],12:[function(P,oe,R){var M=P("underscore"),E=P("../promises"),a=P("../xml");R.read=p,R.readXmlFromZipFile=u;var g={"http://schemas.openxmlformats.org/wordprocessingml/2006/main":"w","http://schemas.openxmlformats.org/officeDocument/2006/relationships":"r","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing":"wp","http://schemas.openxmlformats.org/drawingml/2006/main":"a","http://schemas.openxmlformats.org/drawingml/2006/picture":"pic","http://purl.oclc.org/ooxml/wordprocessingml/main":"w","http://purl.oclc.org/ooxml/officeDocument/relationships":"r","http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing":"wp","http://purl.oclc.org/ooxml/drawingml/main":"a","http://purl.oclc.org/ooxml/drawingml/picture":"pic","http://schemas.openxmlformats.org/package/2006/content-types":"content-types","http://schemas.openxmlformats.org/package/2006/relationships":"relationships","http://schemas.openxmlformats.org/markup-compatibility/2006":"mc","urn:schemas-microsoft-com:vml":"v","urn:schemas-microsoft-com:office:word":"office-word","http://schemas.microsoft.com/office/word/2010/wordml":"wordml"};function p(s){return a.readString(s,g).then(function(d){return e(d)[0]})}function u(s,d){return s.exists(d)?s.read(d,"utf-8").then(i).then(p):E.resolve(null)}function i(s){return s.replace(/^\uFEFF/g,"")}function e(s){return s.type==="element"?s.name==="mc:AlternateContent"?s.firstOrEmpty("mc:Fallback").children:(s.children=M.flatten(s.children.map(e,!0)),[s]):[s]}},{"../promises":23,"../xml":35,underscore:67}],13:[function(P,oe,R){R.readRelationships=M,R.defaultValue=new E([]),R.Relationships=E;function M(a){var g=[];return a.children.forEach(function(p){if(p.name==="relationships:Relationship"){var u={relationshipId:p.attributes.Id,target:p.attributes.Target,type:p.attributes.Type};g.push(u)}}),new E(g)}function E(a){var g=Object.create(null);a.forEach(function(u){g[u.relationshipId]=u.target});var p=Object.create(null);return a.forEach(function(u){p[u.type]||(p[u.type]=[]),p[u.type].push(u.target)}),{findTargetByRelationshipId:function(u){return g[u]},findTargetsByType:function(u){return p[u]||[]}}}},{}],14:[function(P,oe,R){var M=P("underscore"),E=P("../promises"),a=P("../xml");R.writeStyleMap=i,R.readStyleMap=y;var g="http://schemas.zwobble.org/mammoth/style-map",p="mammoth/style-map",u="/"+p;function i(w,v){return w.write(p,v),e(w).then(function(){return s(w)})}function e(w){var v="word/_rels/document.xml.rels",h="http://schemas.openxmlformats.org/package/2006/relationships",_="{"+h+"}Relationship";return w.read(v,"utf8").then(a.readString).then(function(c){var n=c.children;d(n,_,"Id",{Id:"rMammothStyleMap",Type:g,Target:u});var r={"":h};return w.write(v,a.writeString(c,r))})}function s(w){var v="[Content_Types].xml",h="http://schemas.openxmlformats.org/package/2006/content-types",_="{"+h+"}Override";return w.read(v,"utf8").then(a.readString).then(function(c){var n=c.children;d(n,_,"PartName",{PartName:u,ContentType:"text/prs.mammoth.style-map"});var r={"":h};return w.write(v,a.writeString(c,r))})}function d(w,v,h,_){var c=M.find(w,function(n){return n.name===v&&n.attributes[h]===_[h]});c?c.attributes=_:w.push(a.element(v,_))}function y(w){return w.exists(p)?w.read(p,"utf8"):E.resolve(null)}},{"../promises":23,"../xml":35,underscore:67}],15:[function(P,oe,R){R.readStylesXml=E,R.Styles=M,R.defaultStyles=new M({},{});function M(i,e,s,d){return{findParagraphStyleById:function(y){return i[y]},findCharacterStyleById:function(y){return e[y]},findTableStyleById:function(y){return s[y]},findNumberingStyleById:function(y){return d[y]}}}M.EMPTY=new M({},{},{},{});function E(i){var e=Object.create(null),s=Object.create(null),d=Object.create(null),y=Object.create(null);return i.getElementsByTagName("w:style").forEach(function(w){var v=a(w),h;switch(v.type){case"paragraph":h=e;break;case"character":h=s;break;case"table":h=d;break;case"numbering":h=y;break}h&&h[v.styleId]===void 0&&(h[v.styleId]=v)}),new M(e,s,d,y)}function a(i){var e=i.attributes["w:type"];if(e==="numbering")return p(e,i);var s=u(i),d=g(i);return{type:e,styleId:s,name:d}}function g(i){var e=i.first("w:name");return e?e.attributes["w:val"]:null}function p(i,e){var s=u(e),d=e.firstOrEmpty("w:pPr").firstOrEmpty("w:numPr").firstOrEmpty("w:numId").attributes["w:val"];return{type:i,numId:d,styleId:s}}function u(i){return i.attributes["w:styleId"]}},{}],16:[function(P,oe,R){R.uriToZipEntryName=M,R.replaceFragment=E;function M(a,g){return g.charAt(0)==="/"?g.substr(1):a+"/"+g}function E(a,g){var p=a.indexOf("#");return p!==-1&&(a=a.substring(0,p)),a+"#"+g}},{}],17:[function(P,oe,R){var M=P("../styles/html-paths");function E(s,d,y){return g(M.element(s,d,{fresh:!1}),y)}function a(s,d,y){var w=M.element(s,d,{fresh:!0});return g(w,y)}function g(s,d){return{type:"element",tag:s,children:d||[]}}function p(s){return{type:"text",value:s}}var u={type:"forceWrite"};R.freshElement=a,R.nonFreshElement=E,R.elementWithTag=g,R.text=p,R.forceWrite=u;var i={br:!0,hr:!0,img:!0,input:!0};function e(s){return s.children.length===0&&i[s.tag.tagName]}R.isVoidElement=e},{"../styles/html-paths":28}],18:[function(P,oe,R){var M=P("./ast");R.freshElement=M.freshElement,R.nonFreshElement=M.nonFreshElement,R.elementWithTag=M.elementWithTag,R.text=M.text,R.forceWrite=M.forceWrite,R.simplify=P("./simplify");function E(i,e){e.forEach(function(s){a(i,s)})}function a(i,e){g[e.type](i,e)}var g={element:p,text:u,forceWrite:function(){}};function p(i,e){M.isVoidElement(e)?i.selfClosing(e.tag.tagName,e.tag.attributes):(i.open(e.tag.tagName,e.tag.attributes),E(i,e.children),i.close(e.tag.tagName))}function u(i,e){i.text(e.value)}R.write=E},{"./ast":17,"./simplify":19}],19:[function(P,oe,R){var M=P("underscore"),E=P("./ast");function a(c){return g(d(c))}function g(c){var n=[];return c.map(p).forEach(function(r){s(n,r)}),n}function p(c){return u[c.type](c)}var u={element:i,text:e,forceWrite:e};function i(c){return E.elementWithTag(c.tag,g(c.children))}function e(c){return c}function s(c,n){var r=c[c.length-1];n.type==="element"&&!n.tag.fresh&&r&&r.type==="element"&&n.tag.matchesElement(r.tag)?(n.tag.separator&&s(r.children,E.text(n.tag.separator)),n.children.forEach(function(m){s(r.children,m)})):c.push(n)}function d(c){return y(c,function(n){return w[n.type](n)})}function y(c,n){return M.flatten(M.map(c,n),!0)}var w={element:h,text:_,forceWrite:v};function v(c){return[c]}function h(c){var n=d(c.children);return n.length===0&&!E.isVoidElement(c)?[]:[E.elementWithTag(c.tag,n)]}function _(c){return c.value.length===0?[]:[c]}oe.exports=a},{"./ast":17,underscore:67}],20:[function(P,oe,R){var M=P("underscore"),E=P("./promises"),a=P("./html");R.imgElement=g;function g(u){return function(i,e){return E.resolve(u(i)).then(function(s){var d={};return i.altText&&(d.alt=i.altText),M.extend(d,s),[a.freshElement("img",d)]})}}R.inline=R.imgElement,R.dataUri=g(function(u){return u.readAsBase64String().then(function(i){return{src:"data:"+u.contentType+";base64,"+i}})});function p(u){return u.contentType.split(/\/|\\/)[1]}R.imageFilenameExtension=p},{"./html":18,"./promises":23,underscore:67}],21:[function(P,oe,R){(function(M){var E=P("underscore"),a=P("./docx/docx-reader"),g=P("./docx/style-map"),p=P("./document-to-html").DocumentConverter,u=P("./raw-text").convertElementToRawText,i=P("./style-reader").readStyle,e=P("./options-reader").readOptions,s=P("./promises"),d=P("./unzip"),y=P("./results").Result;R.convertToHtml=w,R.convertToMarkdown=v,R.convert=h,R.extractRawText=r,R.images=P("./images"),R.transforms=P("./transforms"),R.underline=P("./underline"),R.embedStyleMap=m,R.readEmbeddedStyleMap=_;function w(I,U){return h(I,U)}function v(I,U){var k=Object.create(U||{});return k.outputFormat="markdown",h(I,k)}function h(I,U){U=e(U);var k=d.openZip(I).then(function(A){return g.readStyleMap(A).then(function(O){return U.embeddedStyleMap=O,A})}).then(function(A){return a.read(A,I,U).then(function(O){return O.map(U.transformDocument)}).then(function(O){return c(O,U)})});return s.toExternalPromise(k)}function _(I){var U=d.openZip(I).then(g.readStyleMap);return s.toExternalPromise(U)}function c(I,U){var k=n(U.readStyleMap()),A=E.extend({},U,{styleMap:k.value}),O=new p(A);return I.flatMapThen(function(X){return k.flatMapThen(function(x){return O.convertToHtml(X)})})}function n(I){return y.combine((I||[]).map(i)).map(function(U){return U.filter(function(k){return!!k})})}function r(I){var U=d.openZip(I).then(a.read).then(function(k){return k.map(u)});return s.toExternalPromise(U)}function m(I,U){var k=d.openZip(I).then(function(A){return g.writeStyleMap(A,U).then(function(){return A})}).then(function(A){return A.toArrayBuffer()}).then(function(A){return{toArrayBuffer:function(){return A},toBuffer:function(){return M.from(A)}}});return s.toExternalPromise(k)}R.styleMapping=function(){throw new Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)}}).call(this,P("buffer").Buffer)},{"./document-to-html":3,"./docx/docx-reader":9,"./docx/style-map":14,"./images":20,"./options-reader":22,"./promises":23,"./raw-text":24,"./results":25,"./style-reader":26,"./transforms":30,"./underline":31,"./unzip":2,buffer:48,underscore:67}],22:[function(P,oe,R){R.readOptions=g;var M=P("underscore"),E=R._defaultStyleMap=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],a=R._standardOptions={externalFileAccess:!1,transformDocument:u,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function g(i){return i=i||{},M.extend({},a,i,{customStyleMap:p(i.styleMap),readStyleMap:function(){var e=this.customStyleMap;return this.includeEmbeddedStyleMap&&(e=e.concat(p(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(e=e.concat(E)),e}})}function p(i){return i?M.isString(i)?i.split(` `).map(function(e){return e.trim()}).filter(function(e){return e!==""&&e.charAt(0)!=="#"}):i:[]}function u(i){return i}},{underscore:67}],23:[function(P,oe,R){(function(M){var E=P("underscore");R.defer=u,R.Promise=Promise,R.resolve=Promise.resolve.bind(Promise),R.reject=Promise.reject.bind(Promise),R.forEachSeries=function(d,y){var w=0,v=u(),h=function(){if(w"u"?!1:{}.toString.call(M).toLowerCase()==="[object process]"}}).call(this,P("_process"))},{_process:66,underscore:67}],24:[function(P,oe,R){var M=P("./documents");function E(a){if(a.type==="text")return a.value;if(a.type===M.types.tab)return" ";var g=a.type==="paragraph"?` diff --git a/sync-server/www/assets/refresh-cw-DydAoMbT.js b/sync-server/www/assets/refresh-cw-DXuKsZdS.js similarity index 91% rename from sync-server/www/assets/refresh-cw-DydAoMbT.js rename to sync-server/www/assets/refresh-cw-DXuKsZdS.js index 010fa36..2c3034d 100644 --- a/sync-server/www/assets/refresh-cw-DydAoMbT.js +++ b/sync-server/www/assets/refresh-cw-DXuKsZdS.js @@ -1,4 +1,4 @@ -import{c as e}from"./index-AIpE8C-f.js";/** +import{c as e}from"./index-T-NGjlrZ.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/useChart-BPFULpBT.js b/sync-server/www/assets/useChart-dAkYJqaV.js similarity index 92% rename from sync-server/www/assets/useChart-BPFULpBT.js rename to sync-server/www/assets/useChart-dAkYJqaV.js index a9ca060..baf1b48 100644 --- a/sync-server/www/assets/useChart-BPFULpBT.js +++ b/sync-server/www/assets/useChart-dAkYJqaV.js @@ -1 +1 @@ -import{r}from"./index-AIpE8C-f.js";import{g as f}from"./echarts-BIWefrIc.js";function p(){const[n,o]=r.useState(0);return r.useEffect(()=>{const s=()=>o(t=>t+1);return window.addEventListener("fp-theme-change",s),()=>window.removeEventListener("fp-theme-change",s)},[]),n}function d(n){return getComputedStyle(document.documentElement).getPropertyValue("--text-"+n).trim()||"#454e5c"}function h(n,o){const s=r.useRef(null),[t,i]=r.useState(null),u=r.useRef(n);return u.current=n,r.useEffect(()=>{if(!t)return;const e=f(t);s.current=e,e.setOption(u.current(),{notMerge:!0});const c=new ResizeObserver(()=>e.resize());return c.observe(t),()=>{c.disconnect(),e.dispose(),s.current=null}},[t]),r.useEffect(()=>{var e;(e=s.current)==null||e.setOption(u.current(),{notMerge:!0})},[t,...o]),e=>i(e)}export{h as a,d as i,p as u}; +import{r}from"./index-T-NGjlrZ.js";import{g as f}from"./echarts-BIWefrIc.js";function p(){const[n,o]=r.useState(0);return r.useEffect(()=>{const s=()=>o(t=>t+1);return window.addEventListener("fp-theme-change",s),()=>window.removeEventListener("fp-theme-change",s)},[]),n}function d(n){return getComputedStyle(document.documentElement).getPropertyValue("--text-"+n).trim()||"#454e5c"}function h(n,o){const s=r.useRef(null),[t,i]=r.useState(null),u=r.useRef(n);return u.current=n,r.useEffect(()=>{if(!t)return;const e=f(t);s.current=e,e.setOption(u.current(),{notMerge:!0});const c=new ResizeObserver(()=>e.resize());return c.observe(t),()=>{c.disconnect(),e.dispose(),s.current=null}},[t]),r.useEffect(()=>{var e;(e=s.current)==null||e.setOption(u.current(),{notMerge:!0})},[t,...o]),e=>i(e)}export{h as a,d as i,p as u}; diff --git a/sync-server/www/index.html b/sync-server/www/index.html index 54e3c2d..1286b4d 100644 --- a/sync-server/www/index.html +++ b/sync-server/www/index.html @@ -9,7 +9,7 @@ 足迹 Footprints - +
'+z(o.text??"").replace(/\n/g,"")+"