From 4a73fddd0c48a2ed54e118418bdd6bb503a7bfc3 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 17 Oct 2026 10:18:42 +0800 Subject: [PATCH] ui: portal-based dropdown (no clipping in scroll containers, viewport-aware flip/clamp, close on scroll) --- app/src/components/ui/dropdown.tsx | 57 +++++++++++++++---- ...Page-CrZVvSas.js => AdminPage-CvXqFjxQ.js} | 8 +-- ...-JDr60Xk1.js => DashboardPage-DiCrzien.js} | 2 +- ...age-O03L_FsK.js => GradesPage-NB__ODNR.js} | 4 +- .../www/assets/RecordsPage-Btqncm1G.js | 6 ++ .../www/assets/RecordsPage-Gvh-PxIo.js | 6 -- ...e-7GdxiFCp.js => TaxonomyPage-P178KH9X.js} | 2 +- ...Page-Dvoz4pB9.js => TypesPage-B579jwyf.js} | 4 +- .../{card-BXfIbybL.js => card-DASBiK00.js} | 2 +- sync-server/www/assets/index-B60u283l.css | 1 + .../{index-BFEQKHK8.js => index-BxEr63go.js} | 4 +- sync-server/www/assets/index-CLr4ofF5.css | 1 - ...1BsXqb5.js => mammoth.browser-C7PeojK9.js} | 2 +- ...Chart-BGht3gc0.js => useChart-eUS_Zp3L.js} | 2 +- sync-server/www/index.html | 4 +- 15 files changed, 69 insertions(+), 36 deletions(-) rename sync-server/www/assets/{AdminPage-CrZVvSas.js => AdminPage-CvXqFjxQ.js} (94%) rename sync-server/www/assets/{DashboardPage-JDr60Xk1.js => DashboardPage-DiCrzien.js} (94%) rename sync-server/www/assets/{GradesPage-O03L_FsK.js => GradesPage-NB__ODNR.js} (95%) create mode 100644 sync-server/www/assets/RecordsPage-Btqncm1G.js delete mode 100644 sync-server/www/assets/RecordsPage-Gvh-PxIo.js rename sync-server/www/assets/{TaxonomyPage-7GdxiFCp.js => TaxonomyPage-P178KH9X.js} (88%) rename sync-server/www/assets/{TypesPage-Dvoz4pB9.js => TypesPage-B579jwyf.js} (90%) rename sync-server/www/assets/{card-BXfIbybL.js => card-DASBiK00.js} (89%) create mode 100644 sync-server/www/assets/index-B60u283l.css rename sync-server/www/assets/{index-BFEQKHK8.js => index-BxEr63go.js} (99%) delete mode 100644 sync-server/www/assets/index-CLr4ofF5.css rename sync-server/www/assets/{mammoth.browser-l1BsXqb5.js => mammoth.browser-C7PeojK9.js} (99%) rename sync-server/www/assets/{useChart-BGht3gc0.js => useChart-eUS_Zp3L.js} (92%) diff --git a/app/src/components/ui/dropdown.tsx b/app/src/components/ui/dropdown.tsx index 64abb65..571b278 100644 --- a/app/src/components/ui/dropdown.tsx +++ b/app/src/components/ui/dropdown.tsx @@ -1,6 +1,9 @@ -import { useEffect, useRef, useState, type ReactNode } from 'react'; +import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from 'react'; +import { createPortal } from 'react-dom'; import { cn } from '@/lib/utils'; +// Portal 化下拉菜单:渲染到 body + fixed 定位,不再被表格/滚动容器裁剪; +// 视口边缘自动上翻/收拢;任何滚动即关闭。 export function Dropdown({ trigger, children, align = 'end', className }: { trigger: ReactNode; children: ReactNode | ((close: () => void) => ReactNode); @@ -8,35 +11,65 @@ export function Dropdown({ trigger, children, align = 'end', className }: { className?: string; }) { const [open, setOpen] = useState(false); - const ref = useRef(null); + const [pos, setPos] = useState<{ top: number; left: number } | null>(null); + const triggerRef = useRef(null); + const menuRef = useRef(null); + + const openMenu = () => { + const r = triggerRef.current?.getBoundingClientRect(); + if (!r) return; + setPos({ top: r.bottom + 4, left: align === 'end' ? r.right - 176 : r.left }); + setOpen(true); + }; + + // 渲染后实测菜单尺寸:越界上翻、水平收拢 + useLayoutEffect(() => { + if (!open || !pos) return; + const m = menuRef.current; + const t = triggerRef.current?.getBoundingClientRect(); + if (!m || !t) return; + const rect = m.getBoundingClientRect(); + let top = pos.top; + if (top + rect.height > window.innerHeight - 8) top = Math.max(8, t.top - rect.height - 4); + let left = Math.min(Math.max(8, pos.left), window.innerWidth - rect.width - 8); + if (top !== pos.top || left !== pos.left) setPos({ top, left }); + }, [open, pos]); useEffect(() => { if (!open) return; const onDown = (e: MouseEvent) => { - if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false); + const t = e.target as Node; + if (triggerRef.current?.contains(t) || menuRef.current?.contains(t)) return; + setOpen(false); }; const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') setOpen(false); }; + const onScroll = () => setOpen(false); + const onResize = () => setOpen(false); document.addEventListener('mousedown', onDown); document.addEventListener('keydown', onKey); + window.addEventListener('scroll', onScroll, true); + window.addEventListener('resize', onResize); return () => { document.removeEventListener('mousedown', onDown); document.removeEventListener('keydown', onKey); + window.removeEventListener('scroll', onScroll, true); + window.removeEventListener('resize', onResize); }; }, [open]); return ( -
-
setOpen(v => !v)}>{trigger}
- {open && ( +
+
{trigger}
+ {open && pos && createPortal(
{typeof children === 'function' ? children(() => setOpen(false)) : children} -
+
, + document.body )}
); diff --git a/sync-server/www/assets/AdminPage-CrZVvSas.js b/sync-server/www/assets/AdminPage-CvXqFjxQ.js similarity index 94% rename from sync-server/www/assets/AdminPage-CrZVvSas.js rename to sync-server/www/assets/AdminPage-CvXqFjxQ.js index bc936e8..643ba85 100644 --- a/sync-server/www/assets/AdminPage-CrZVvSas.js +++ b/sync-server/www/assets/AdminPage-CvXqFjxQ.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BFEQKHK8.js","assets/index-CLr4ofF5.css"])))=>i.map(i=>d[i]); -import{c as o,u as Z,Y,e as _,Z as C,r as n,f as h,j as s,E as w,B as t,_ as U,P as J,I as z,i as ee,k as se,T as ae,l as p,$ as te,a0 as ne,a1 as ie,a2 as re,a3 as ce,a4 as de,a5 as le,a6 as oe}from"./index-BFEQKHK8.js";import{C as $,a as B,b as O}from"./card-BXfIbybL.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BxEr63go.js","assets/index-B60u283l.css"])))=>i.map(i=>d[i]); +import{c as o,u as Z,Z as J,f as _,_ as C,r as n,g as h,j as s,E as w,B as t,$ as U,P as Y,I as z,k as ee,l as se,T as ae,m as p,a0 as te,a1 as ne,a2 as ie,a3 as re,a4 as ce,a5 as de,a6 as le,a7 as oe}from"./index-BxEr63go.js";import{C as $,a as B,b as O}from"./card-DASBiK00.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. @@ -24,5 +24,5 @@ import{c as o,u as Z,Y,e as _,Z as C,r as n,f as h,j as s,E as w,B as t,_ as U,P * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ye=[["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"}]],ke=o("UsersRound",ye);function be({i:c}){return c.used_by?s.jsx(p,{color:"var(--text-3)",children:"已使用"}):c.valid?s.jsx(p,{color:"var(--success)",children:"可用"}):s.jsx(p,{color:"var(--warning)",children:"已停用"})}function Ne(){var Q,K,L;const c=Z(),i=Y(),E=_({queryKey:["me-admin"],queryFn:async()=>(await de(()=>import("./index-BFEQKHK8.js").then(a=>a.a9),__vite__mapDeps([0,1]))).serverMe(i),enabled:!!C()}),M=_({queryKey:["admin-users"],queryFn:()=>le(i),enabled:!!C()}),v=_({queryKey:["admin-invites"],queryFn:()=>oe(i),enabled:!!C()}),[I,r]=n.useState(""),[H,S]=n.useState(null),[V,j]=n.useState(!1),[x,y]=n.useState(""),[q,k]=n.useState(""),[G,d]=n.useState(null),[b,f]=n.useState(""),[l,W]=n.useState("all"),m=()=>{c.invalidateQueries({queryKey:["admin-invites"]})},u=e=>r(e.message||"操作失败"),F=h({mutationFn:()=>ne(5,i),onSuccess:e=>{m(),r(""),navigator.clipboard.writeText(e.codes.join(` -`)).catch(()=>{})},onError:u}),g=h({mutationFn:()=>ie(x.trim(),q.trim(),i),onSuccess:()=>{m(),j(!1),y(""),k(""),r("")},onError:u}),N=h({mutationFn:e=>re(e.id,e.patch,i),onSuccess:()=>{m(),d(null),r("")},onError:u}),X=h({mutationFn:e=>ce(e,i),onSuccess:()=>{m(),r("")},onError:u}),T=n.useMemo(()=>{var e;return((e=v.data)==null?void 0:e.invites)??[]},[v.data]),P=((Q=M.data)==null?void 0:Q.users)??[],R=n.useMemo(()=>T.filter(e=>l==="valid"?e.valid&&!e.used_by:l==="used"?!!e.used_by:l==="disabled"?!e.valid&&!e.used_by:!0),[T,l]);if(E.data&&!E.data.is_admin)return s.jsx(w,{title:"需要管理员账号",description:"当前登录账号不是管理员。"});const D=e=>{navigator.clipboard.writeText(e.code),S(e.id),setTimeout(()=>S(a=>a===e.id?null:a),1500)};return s.jsxs("div",{className:"mx-auto max-w-[1080px] px-6 py-5",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[s.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"管理"}),s.jsxs(t,{variant:"secondary",onClick:()=>{c.invalidateQueries()},children:[s.jsx(pe,{size:13})," 刷新"]})]}),I&&s.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:[s.jsx("span",{children:I}),s.jsx("button",{className:"rounded p-0.5 hover:bg-surface-3",onClick:()=>r(""),"aria-label":"关闭",children:s.jsx(U,{size:13})})]}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[s.jsxs($,{children:[s.jsx(B,{title:"邀请码("+(((K=v.data)==null?void 0:K.total)??0)+")",extra:s.jsxs("div",{className:"flex gap-1.5",children:[s.jsxs(t,{size:"sm",variant:"secondary",onClick:()=>{j(e=>!e),r("")},children:[s.jsx(J,{size:13})," 新建"]}),s.jsx(t,{size:"sm",variant:"primary",disabled:F.isPending,onClick:()=>F.mutate(),children:"批量生成 5 个"})]})}),s.jsxs(O,{className:"p-0",children:[V&&s.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b border-line bg-surface-2 px-4 py-3",children:[s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"邀请码(4-32 位字母数字-_)"}),s.jsx(z,{className:"w-[210px]",value:x,placeholder:"如 XIONG-2025",onChange:e=>y(e.target.value)})]}),s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"备注(可选)"}),s.jsx(z,{className:"w-[180px]",value:q,placeholder:"发给谁 / 用途",onChange:e=>k(e.target.value),onKeyDown:e=>{e.key==="Enter"&&x.trim()&&g.mutate()}})]}),s.jsxs("div",{className:"flex gap-1.5 pb-0.5",children:[s.jsx(t,{size:"sm",variant:"primary",disabled:!x.trim()||g.isPending,onClick:()=>g.mutate(),children:"创建"}),s.jsx(t,{size:"sm",variant:"ghost",onClick:()=>{j(!1),y(""),k("")},children:"取消"})]})]}),s.jsx("div",{className:"flex gap-1 border-b border-line px-4 py-2 text-[12px]",children:[["all","全部"],["valid","可用"],["used","已使用"],["disabled","已停用"]].map(([e,a])=>s.jsx("button",{className:"rounded-md px-2.5 py-1 transition-colors "+(l===e?"bg-brand-subtle font-medium text-brand-text":"text-ink-3 hover:bg-surface-3"),onClick:()=>W(e),children:a},e))}),R.length?s.jsx("div",{className:"divide-y divide-line max-h-[430px] overflow-y-auto",children:R.map(e=>s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-[12.5px]",children:[s.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:()=>D(e),children:H===e.id?s.jsxs("span",{className:"inline-flex items-center gap-1 text-success",children:[s.jsx(A,{size:11}),"已复制"]}):e.code}),s.jsx(be,{i:e}),G===e.id?s.jsxs("span",{className:"ml-1 flex min-w-0 flex-1 items-center gap-1",children:[s.jsx(z,{className:"h-7 flex-1 text-[12px]",value:b,autoFocus:!0,placeholder:"备注(64 字以内)",onChange:a=>f(a.target.value),onKeyDown:a=>{a.key==="Enter"&&N.mutate({id:e.id,patch:{remark:b}}),a.key==="Escape"&&d(null)}}),s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"保存备注",className:"text-success",onClick:()=>N.mutate({id:e.id,patch:{remark:b}}),children:s.jsx(A,{size:13})}),s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"取消",className:"text-ink-3",onClick:()=>d(null),children:s.jsx(U,{size:13})})]}):s.jsx("button",{className:"min-w-0 flex-1 truncate text-left text-[12px] text-ink-3 hover:text-ink-2",title:e.remark?"点击编辑备注":e.created_by_name?"由 "+e.created_by_name+" 创建 · 点击添加备注":"点击添加备注",onClick:()=>{d(e.id),f(e.remark??"")},children:e.remark||(e.created_by_name?"由 "+e.created_by_name+" 创建":s.jsx("span",{className:"opacity-60",children:"添加备注…"}))}),e.used_by_name&&s.jsxs("span",{className:"shrink-0 text-ink-3",children:["被 ",e.used_by_name," 使用于 ",ee(e.used_at)]}),s.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"复制",className:"text-ink-3",onClick:()=>D(e),children:s.jsx(ue,{size:13})}),!e.used_by&&s.jsxs(s.Fragment,{children:[s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"编辑备注",className:"text-ink-3",onClick:()=>{d(e.id),f(e.remark??"")},children:s.jsx(se,{size:13})}),s.jsx(t,{size:"sm",variant:"ghost",className:e.valid?"text-ink-3 hover:text-warning":"text-ink-3 hover:text-success",onClick:()=>N.mutate({id:e.id,patch:{valid:!e.valid}}),children:e.valid?"停用":"启用"})]}),s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"删除",className:"text-ink-3 hover:text-danger",onClick:()=>{window.confirm("删除邀请码 "+e.code+"?此操作不可恢复。")&&X.mutate(e.id)},children:s.jsx(ae,{size:13})})]})]},e.id))}):s.jsx(w,{icon:s.jsx(je,{size:32,strokeWidth:1.5}),title:"暂无符合条件的邀请码",description:"新建自定义邀请码,或批量生成后发给需要注册的用户。"})]})]}),s.jsxs($,{children:[s.jsx(B,{title:"用户("+(((L=M.data)==null?void 0:L.total)??0)+")"}),s.jsx(O,{className:"p-0",children:P.length?s.jsx("div",{className:"divide-y divide-line max-h-[520px] overflow-y-auto",children:P.map(e=>s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-[12.5px]",children:[s.jsx("span",{className:"font-medium text-ink-1",children:e.username}),e.is_admin&&s.jsx(p,{color:"var(--brand-text)",children:"管理员"}),s.jsxs("span",{className:"num ml-auto text-ink-3",children:[e.devices," 设备 · ",e.records," 记录 · ",te(e.attachment_bytes)]})]},e.id))}):s.jsx(w,{icon:s.jsx(ke,{size:32,strokeWidth:1.5}),title:"暂无用户"})})]})]})]})}export{Ne as AdminPage}; + */const ye=[["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"}]],ke=o("UsersRound",ye);function be({i:c}){return c.used_by?s.jsx(p,{color:"var(--text-3)",children:"已使用"}):c.valid?s.jsx(p,{color:"var(--success)",children:"可用"}):s.jsx(p,{color:"var(--warning)",children:"已停用"})}function Ne(){var Q,K,L;const c=Z(),i=J(),E=_({queryKey:["me-admin"],queryFn:async()=>(await de(()=>import("./index-BxEr63go.js").then(a=>a.aa),__vite__mapDeps([0,1]))).serverMe(i),enabled:!!C()}),M=_({queryKey:["admin-users"],queryFn:()=>le(i),enabled:!!C()}),v=_({queryKey:["admin-invites"],queryFn:()=>oe(i),enabled:!!C()}),[I,r]=n.useState(""),[H,S]=n.useState(null),[V,j]=n.useState(!1),[x,y]=n.useState(""),[q,k]=n.useState(""),[G,d]=n.useState(null),[b,f]=n.useState(""),[l,W]=n.useState("all"),m=()=>{c.invalidateQueries({queryKey:["admin-invites"]})},u=e=>r(e.message||"操作失败"),F=h({mutationFn:()=>ne(5,i),onSuccess:e=>{m(),r(""),navigator.clipboard.writeText(e.codes.join(` +`)).catch(()=>{})},onError:u}),g=h({mutationFn:()=>ie(x.trim(),q.trim(),i),onSuccess:()=>{m(),j(!1),y(""),k(""),r("")},onError:u}),N=h({mutationFn:e=>re(e.id,e.patch,i),onSuccess:()=>{m(),d(null),r("")},onError:u}),X=h({mutationFn:e=>ce(e,i),onSuccess:()=>{m(),r("")},onError:u}),T=n.useMemo(()=>{var e;return((e=v.data)==null?void 0:e.invites)??[]},[v.data]),P=((Q=M.data)==null?void 0:Q.users)??[],R=n.useMemo(()=>T.filter(e=>l==="valid"?e.valid&&!e.used_by:l==="used"?!!e.used_by:l==="disabled"?!e.valid&&!e.used_by:!0),[T,l]);if(E.data&&!E.data.is_admin)return s.jsx(w,{title:"需要管理员账号",description:"当前登录账号不是管理员。"});const D=e=>{navigator.clipboard.writeText(e.code),S(e.id),setTimeout(()=>S(a=>a===e.id?null:a),1500)};return s.jsxs("div",{className:"mx-auto max-w-[1080px] px-6 py-5",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[s.jsx("h2",{className:"text-[15px] font-semibold text-ink-1",children:"管理"}),s.jsxs(t,{variant:"secondary",onClick:()=>{c.invalidateQueries()},children:[s.jsx(pe,{size:13})," 刷新"]})]}),I&&s.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:[s.jsx("span",{children:I}),s.jsx("button",{className:"rounded p-0.5 hover:bg-surface-3",onClick:()=>r(""),"aria-label":"关闭",children:s.jsx(U,{size:13})})]}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[s.jsxs($,{children:[s.jsx(B,{title:"邀请码("+(((K=v.data)==null?void 0:K.total)??0)+")",extra:s.jsxs("div",{className:"flex gap-1.5",children:[s.jsxs(t,{size:"sm",variant:"secondary",onClick:()=>{j(e=>!e),r("")},children:[s.jsx(Y,{size:13})," 新建"]}),s.jsx(t,{size:"sm",variant:"primary",disabled:F.isPending,onClick:()=>F.mutate(),children:"批量生成 5 个"})]})}),s.jsxs(O,{className:"p-0",children:[V&&s.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b border-line bg-surface-2 px-4 py-3",children:[s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"邀请码(4-32 位字母数字-_)"}),s.jsx(z,{className:"w-[210px]",value:x,placeholder:"如 XIONG-2025",onChange:e=>y(e.target.value)})]}),s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-[11px] font-medium text-ink-3",children:"备注(可选)"}),s.jsx(z,{className:"w-[180px]",value:q,placeholder:"发给谁 / 用途",onChange:e=>k(e.target.value),onKeyDown:e=>{e.key==="Enter"&&x.trim()&&g.mutate()}})]}),s.jsxs("div",{className:"flex gap-1.5 pb-0.5",children:[s.jsx(t,{size:"sm",variant:"primary",disabled:!x.trim()||g.isPending,onClick:()=>g.mutate(),children:"创建"}),s.jsx(t,{size:"sm",variant:"ghost",onClick:()=>{j(!1),y(""),k("")},children:"取消"})]})]}),s.jsx("div",{className:"flex gap-1 border-b border-line px-4 py-2 text-[12px]",children:[["all","全部"],["valid","可用"],["used","已使用"],["disabled","已停用"]].map(([e,a])=>s.jsx("button",{className:"rounded-md px-2.5 py-1 transition-colors "+(l===e?"bg-brand-subtle font-medium text-brand-text":"text-ink-3 hover:bg-surface-3"),onClick:()=>W(e),children:a},e))}),R.length?s.jsx("div",{className:"divide-y divide-line max-h-[430px] overflow-y-auto",children:R.map(e=>s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-[12.5px]",children:[s.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:()=>D(e),children:H===e.id?s.jsxs("span",{className:"inline-flex items-center gap-1 text-success",children:[s.jsx(A,{size:11}),"已复制"]}):e.code}),s.jsx(be,{i:e}),G===e.id?s.jsxs("span",{className:"ml-1 flex min-w-0 flex-1 items-center gap-1",children:[s.jsx(z,{className:"h-7 flex-1 text-[12px]",value:b,autoFocus:!0,placeholder:"备注(64 字以内)",onChange:a=>f(a.target.value),onKeyDown:a=>{a.key==="Enter"&&N.mutate({id:e.id,patch:{remark:b}}),a.key==="Escape"&&d(null)}}),s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"保存备注",className:"text-success",onClick:()=>N.mutate({id:e.id,patch:{remark:b}}),children:s.jsx(A,{size:13})}),s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"取消",className:"text-ink-3",onClick:()=>d(null),children:s.jsx(U,{size:13})})]}):s.jsx("button",{className:"min-w-0 flex-1 truncate text-left text-[12px] text-ink-3 hover:text-ink-2",title:e.remark?"点击编辑备注":e.created_by_name?"由 "+e.created_by_name+" 创建 · 点击添加备注":"点击添加备注",onClick:()=>{d(e.id),f(e.remark??"")},children:e.remark||(e.created_by_name?"由 "+e.created_by_name+" 创建":s.jsx("span",{className:"opacity-60",children:"添加备注…"}))}),e.used_by_name&&s.jsxs("span",{className:"shrink-0 text-ink-3",children:["被 ",e.used_by_name," 使用于 ",ee(e.used_at)]}),s.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"复制",className:"text-ink-3",onClick:()=>D(e),children:s.jsx(ue,{size:13})}),!e.used_by&&s.jsxs(s.Fragment,{children:[s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"编辑备注",className:"text-ink-3",onClick:()=>{d(e.id),f(e.remark??"")},children:s.jsx(se,{size:13})}),s.jsx(t,{size:"sm",variant:"ghost",className:e.valid?"text-ink-3 hover:text-warning":"text-ink-3 hover:text-success",onClick:()=>N.mutate({id:e.id,patch:{valid:!e.valid}}),children:e.valid?"停用":"启用"})]}),s.jsx(t,{size:"icon-sm",variant:"ghost","aria-label":"删除",className:"text-ink-3 hover:text-danger",onClick:()=>{window.confirm("删除邀请码 "+e.code+"?此操作不可恢复。")&&X.mutate(e.id)},children:s.jsx(ae,{size:13})})]})]},e.id))}):s.jsx(w,{icon:s.jsx(je,{size:32,strokeWidth:1.5}),title:"暂无符合条件的邀请码",description:"新建自定义邀请码,或批量生成后发给需要注册的用户。"})]})]}),s.jsxs($,{children:[s.jsx(B,{title:"用户("+(((L=M.data)==null?void 0:L.total)??0)+")"}),s.jsx(O,{className:"p-0",children:P.length?s.jsx("div",{className:"divide-y divide-line max-h-[520px] overflow-y-auto",children:P.map(e=>s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-[12.5px]",children:[s.jsx("span",{className:"font-medium text-ink-1",children:e.username}),e.is_admin&&s.jsx(p,{color:"var(--brand-text)",children:"管理员"}),s.jsxs("span",{className:"num ml-auto text-ink-3",children:[e.devices," 设备 · ",e.records," 记录 · ",te(e.attachment_bytes)]})]},e.id))}):s.jsx(w,{icon:s.jsx(ke,{size:32,strokeWidth:1.5}),title:"暂无用户"})})]})]})]})}export{Ne as AdminPage}; diff --git a/sync-server/www/assets/DashboardPage-JDr60Xk1.js b/sync-server/www/assets/DashboardPage-DiCrzien.js similarity index 94% rename from sync-server/www/assets/DashboardPage-JDr60Xk1.js rename to sync-server/www/assets/DashboardPage-DiCrzien.js index 3f84eb5..e3f3966 100644 --- a/sync-server/www/assets/DashboardPage-JDr60Xk1.js +++ b/sync-server/www/assets/DashboardPage-DiCrzien.js @@ -1 +1 @@ -import{r as g,e as v,j as t,S as j,s as S}from"./index-BFEQKHK8.js";import{C as c,a as d,b as x}from"./card-BXfIbybL.js";import{u as N,i as u,a as m}from"./useChart-BGht3gc0.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:"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-BxEr63go.js";import{C as c,a as d,b as x}from"./card-DASBiK00.js";import{u as N,i as u,a as m}from"./useChart-eUS_Zp3L.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:"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-O03L_FsK.js b/sync-server/www/assets/GradesPage-NB__ODNR.js similarity index 95% rename from sync-server/www/assets/GradesPage-O03L_FsK.js rename to sync-server/www/assets/GradesPage-NB__ODNR.js index 2c53d1b..20cc5e9 100644 --- a/sync-server/www/assets/GradesPage-O03L_FsK.js +++ b/sync-server/www/assets/GradesPage-NB__ODNR.js @@ -1,6 +1,6 @@ -import{c as K,e as I,j as e,E as O,v as $,u as k,b as S,r as u,f as y,w as H,x as W,B as g,P as q,C as Q,y as J,z as T,A as U,l as N,k as G,T as E,I as j,D as Y,F as C,H as B,J as V}from"./index-BFEQKHK8.js";import{C as f,a as z,b as _}from"./card-BXfIbybL.js";import{u as X,i as M,a as L}from"./useChart-BGht3gc0.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 A,f as I,j as e,E as O,w as $,u as k,d as S,r as u,g as y,x as H,y as W,B as g,P as q,C as Q,z as J,A as T,D as U,m as N,l as G,T as E,I as j,F as Y,H as C,J as B,K as V}from"./index-BxEr63go.js";import{C as f,a as z,b as _}from"./card-DASBiK00.js";import{u as X,i as M,a as L}from"./useChart-eUS_Zp3L.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. * See the LICENSE file in the root directory of this source tree. - */const ie=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],D=K("Calculator",ie);Z([ee,se,te,ae,re,ne,le]);function oe(a){const s=/^(\d{4})-(\d{4})/.exec(a);return s?s[1]+"~"+s[2]+" 学年":"其他学期"}function ce(a){const s=a.filter(i=>i.grade_point!=null&&i.credit>0);if(!s.length)return null;const t=s.reduce((i,o)=>i+o.credit,0),l=s.reduce((i,o)=>i+o.grade_point*o.credit,0);return Math.round(l/t*100)/100}function ye(){const a=X(),s=I({queryKey:["grades"],queryFn:V}),t=s.data,l=M("2"),i=M("3"),o=L(()=>{const n=((t==null?void 0:t.overall.tier_dist)??[]).filter(r=>r.count>0);return{tooltip:{trigger:"item"},legend:{orient:"vertical",right:8,top:"middle",itemGap:10,textStyle:{color:l,fontSize:11},itemWidth:10,itemHeight:10},series:[{type:"pie",radius:["48%","72%"],center:["34%","50%"],label:{show:!1},data:n.map(r=>({name:r.label,value:r.count,itemStyle:{color:r.color}}))}]}},[t,a]),m=L(()=>{const n=(t==null?void 0:t.overall.gpa_trend)??[];return{grid:{left:8,right:8,top:36,bottom:6,containLabel:!0},tooltip:{trigger:"axis"},legend:{top:0,left:"center",itemGap:16,textStyle:{color:l,fontSize:11},itemWidth:14,itemHeight:8},xAxis:{type:"category",data:n.map(r=>r.term),axisLine:{lineStyle:{color:i}},axisTick:{show:!1},axisLabel:{color:i,fontSize:10}},yAxis:[{type:"value",min:0,max:100,splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:i,fontSize:10}},{type:"value",min:0,max:5,splitLine:{show:!1},axisLabel:{color:i,fontSize:10}}],series:[{name:"加权平均分",type:"bar",barMaxWidth:18,itemStyle:{color:"#3056d3",borderRadius:[3,3,0,0]},data:n.map(r=>r.avg)},{name:"绩点",type:"line",yAxisIndex:1,smooth:!0,symbolSize:6,itemStyle:{color:"#d97706"},lineStyle:{width:2},data:n.map(r=>r.gpa)}]}},[t,a]);if(s.isLoading)return e.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"});const p=[...(t==null?void 0:t.semesters)??[]].sort((n,r)=>r.term.localeCompare(n.term));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 flex-wrap gap-3",children:[e.jsx(w,{label:"总学分",value:(t==null?void 0:t.overall.credits)??0}),e.jsx(w,{label:"加权平均分",value:(t==null?void 0:t.overall.avg)!=null?t.overall.avg:"—"}),e.jsx(w,{label:"已录课程",value:(t==null?void 0:t.overall.courses)??0}),e.jsx(w,{label:"学期数",value:(t==null?void 0:t.semesters.length)??0})]}),e.jsxs("div",{className:"mb-4 grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(f,{children:[e.jsx(z,{title:"单科成绩等级分布"}),e.jsx(_,{children:e.jsx("div",{ref:o,className:"h-[220px]"})})]}),e.jsxs(f,{children:[e.jsx(z,{title:"学期趋势(加权平均分 / 绩点)"}),e.jsx(_,{children:e.jsx("div",{ref:m,className:"h-[220px]"})})]})]}),e.jsx(xe,{bands:(t==null?void 0:t.bands)??[]}),e.jsxs("div",{className:"mb-3 mt-5 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[14px] font-semibold text-ink-1",children:"学年学科成绩"}),e.jsx(he,{})]}),p.length?e.jsx("div",{className:"flex flex-col gap-5",children:de(p).map(([n,r])=>e.jsxs("section",{children:[e.jsx("div",{className:"mb-2 text-[12px] font-medium text-ink-3",children:n}),e.jsx("div",{className:"flex flex-col gap-3",children:r.map(h=>e.jsx(ue,{sem:h},h.id))})]},n))}):e.jsx(f,{children:e.jsx(O,{icon:e.jsx($,{size:36,strokeWidth:1.5}),title:"暂无学期成绩",description:"新增一个学期(如 2024-2025-1),再录入各科成绩。"})})]})}function de(a){const s=new Map;for(const t of a){const l=oe(t.term);s.has(l)||s.set(l,[]),s.get(l).push(t)}return[...s.entries()]}function w({label:a,value:s}){return e.jsxs("div",{className:"min-w-[128px] flex-1 max-w-[220px] rounded-lg border border-line bg-surface px-4 py-3 shadow-card",children:[e.jsx("div",{className:"text-[12px] text-ink-3",children:a}),e.jsx("div",{className:"num mt-0.5 text-[22px] font-semibold leading-tight text-ink-1",children:s})]})}function xe({bands:a}){const s=k(),t=S(),[l,i]=u.useState(null),[o,m]=u.useState(null),p=y({mutationFn:H,onSuccess:()=>{t("success","梯度已保存"),s.invalidateQueries({queryKey:["grades"]})},onError:r=>t("error",r.message)}),n=y({mutationFn:W,onSuccess:()=>{s.invalidateQueries({queryKey:["grades"]}),m(null)}});return e.jsxs(f,{children:[e.jsx(z,{title:"成绩梯度",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"按 分数 ≥ min 且 < max 定级,满分档含上限"})}),e.jsxs(_,{className:"p-0",children:[e.jsx("div",{className:"divide-y divide-line",children:a.map(r=>e.jsx(P,{band:r,onSave:h=>p.mutate(h),onDelete:()=>m(r)},r.id))}),e.jsx("div",{className:"border-t border-line px-4 py-2.5",children:l?e.jsx(P,{band:l,isNew:!0,onChange:i,onSave:()=>{p.mutate(l),i(null)},onCancel:()=>i(null)}):e.jsxs(g,{size:"sm",variant:"secondary",onClick:()=>{var r;return i({id:0,label:"",color:"#3056d3",min:0,max:60,sort:(((r=a.at(-1))==null?void 0:r.sort)??0)+10})},children:[e.jsx(q,{size:13})," 添加等级"]})})]}),e.jsx(Q,{open:!!o,title:"删除等级",content:o?"确定删除「"+o.label+"」吗?已录成绩将不再显示该等级。":"",onCancel:()=>m(null),onOk:()=>o&&n.mutate(o.id)})]})}function P({band:a,onSave:s,onDelete:t,onChange:l,onCancel:i,isNew:o}){const[m,p]=u.useState(a),n=o&&l?m:a,r=d=>{const x={...n,...d};l?l(x):p(x)},h=o||JSON.stringify({...n,id:0})!==JSON.stringify({...a,id:0});return e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2",children:[e.jsx("input",{type:"color",value:n.color,onChange:d=>r({color:d.target.value}),className:"size-5 shrink-0 cursor-pointer rounded border border-line bg-surface","aria-label":"颜色"}),e.jsx(j,{className:"w-[96px]",value:n.label,onChange:d=>r({label:d.target.value}),placeholder:"等级名"}),e.jsx("span",{className:"text-[12px] text-ink-3",children:"分数"}),e.jsx(j,{type:"number",className:"num w-[72px]",value:String(n.min),onChange:d=>r({min:Number(d.target.value)})}),e.jsx("span",{className:"text-[12px] text-ink-3",children:"至"}),e.jsx(j,{type:"number",className:"num w-[72px]",value:String(n.max),onChange:d=>r({max:Number(d.target.value)})}),o?e.jsxs(e.Fragment,{children:[e.jsx(g,{size:"sm",variant:"primary",onClick:()=>s==null?void 0:s(n),children:"添加"}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>i==null?void 0:i(),children:"取消"})]}):e.jsxs("div",{className:"ml-auto flex gap-1.5",children:[e.jsx(g,{size:"sm",variant:h?"primary":"secondary",disabled:!h,onClick:()=>s==null?void 0:s(n),children:"保存"}),e.jsx(g,{size:"icon-sm",variant:"ghost","aria-label":"删除等级",onClick:()=>t==null?void 0:t(),children:e.jsx(E,{size:13})})]})]})}function ue({sem:a}){const s=k(),t=S(),[l,i]=u.useState(null),[o,m]=u.useState(null),[p,n]=u.useState(!1),r=()=>void s.invalidateQueries({queryKey:["grades"]}),h=y({mutationFn:J,onSuccess:()=>{r(),m(null)}}),d=y({mutationFn:()=>{const c=ce(a.courses);if(c==null)throw new Error("请先为课程填写绩点");return T({id:a.id,term:a.term,gpa:c,rank:a.rank??null,total_students:a.total_students??null})},onSuccess:()=>{t("success","绩点已按课程自动计算"),r()},onError:c=>t("error",c.message)}),x=y({mutationFn:()=>U(a.id),onSuccess:()=>{r(),n(!1),t("success","学期已删除")}});return e.jsxs(f,{children:[e.jsx(z,{title:a.term,extra:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(N,{color:"var(--brand-text)",children:["绩点 ",a.gpa??"—"]}),a.rank!=null&&e.jsxs(N,{color:"var(--success)",children:["排名 ",a.rank,"/",a.total_students??"—"]}),e.jsxs(N,{color:"var(--text-3)",children:["均分 ",a.stats.avg??"—"]}),e.jsxs(N,{color:"var(--text-3)",children:[a.stats.credits," 学分"]}),e.jsxs(g,{size:"sm",variant:"ghost",onClick:()=>d.mutate(),disabled:d.isPending,children:[e.jsx(D,{size:13})," 自动绩点"]}),e.jsx(g,{size:"icon-sm",variant:"ghost","aria-label":"编辑学期",onClick:()=>n(!0),children:e.jsx(G,{size:13})})]})}),e.jsx(_,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsx("div",{className:"-mx-1 overflow-x-auto px-1",children:e.jsxs("table",{className:"w-full border-collapse text-[13px]",children:[e.jsx("thead",{children:e.jsx("tr",{children:["课程","学分","分数","等级","绩点",""].map(c=>e.jsx("th",{className:"border-b border-line bg-surface-2 px-3 py-2 text-left text-[12px] font-semibold text-ink-3",children:c},c))})}),e.jsxs("tbody",{children:[a.courses.map(c=>l===c.id?e.jsx(pe,{sem:a,course:c,onDone:()=>i(null)},c.id):e.jsxs("tr",{className:"transition-colors hover:bg-surface-2",children:[e.jsx("td",{className:"border-b border-line px-3 py-2 font-medium text-ink-1",children:c.course_name}),e.jsx("td",{className:"num border-b border-line px-3 py-2 text-ink-2",children:c.credit}),e.jsx("td",{className:"num border-b border-line px-3 py-2",children:c.score!=null?e.jsx("span",{className:"font-medium",children:c.score}):e.jsx("span",{className:"text-ink-3",children:"未录入"})}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:c.band?e.jsx(N,{color:c.band.color,children:c.band.label}):e.jsx("span",{className:"text-ink-3",children:"—"})}),e.jsx("td",{className:"num border-b border-line px-3 py-2 text-ink-2",children:c.grade_point??"—"}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsxs("div",{className:"flex justify-end gap-1",children:[e.jsx(g,{size:"icon-sm",variant:"ghost","aria-label":"编辑课程",onClick:()=>i(c.id),children:e.jsx(G,{size:13})}),e.jsx(g,{size:"icon-sm",variant:"ghost","aria-label":"删除课程",className:"text-ink-3 hover:text-danger",onClick:()=>m(c),children:e.jsx(E,{size:13})})]})})]},c.id)),e.jsx(me,{sem:a})]})]})})})}),e.jsx(Q,{open:!!o,title:"删除课程",content:o?"确定删除「"+o.course_name+"」吗?":"",onCancel:()=>m(null),onOk:()=>o&&h.mutate(o.id)}),e.jsx(R,{open:p,sem:a,onClose:()=>n(!1),deleteMut:x})]})}function me({sem:a}){const s=k(),t=S(),[l,i]=u.useState(""),[o,m]=u.useState(""),[p,n]=u.useState(""),[r,h]=u.useState(""),d=y({mutationFn:()=>B({semester_id:a.id,course_name:l,credit:Number(o)||0,score:p===""?null:Number(p),grade_point:r===""?null:Number(r)}),onSuccess:()=>{i(""),m(""),n(""),h(""),s.invalidateQueries({queryKey:["grades"]})},onError:x=>t("error",x.message)});return e.jsxs("tr",{className:"bg-surface-2",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{className:"h-7 w-[160px]",placeholder:"课程名称",value:l,onChange:x=>i(x.target.value)})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{type:"number",step:"0.5",className:"num h-7 w-[64px]",placeholder:"0",value:o,onChange:x=>m(x.target.value)})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{type:"number",className:"num h-7 w-[72px]",placeholder:"0-100",value:p,onChange:x=>n(x.target.value)})}),e.jsx("td",{className:"px-3 py-2 text-ink-3",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{type:"number",step:"0.1",className:"num h-7 w-[64px]",placeholder:"选填",value:r,onChange:x=>h(x.target.value)})}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs(g,{size:"sm",variant:"secondary",disabled:!l.trim()||d.isPending,onClick:()=>d.mutate(),children:[e.jsx(q,{size:13})," 添加"]})})]})}function pe({sem:a,course:s,onDone:t}){const l=k(),i=S(),[o,m]=u.useState(s.course_name),[p,n]=u.useState(String(s.credit)),[r,h]=u.useState(s.score!=null?String(s.score):""),[d,x]=u.useState(s.grade_point!=null?String(s.grade_point):""),c=y({mutationFn:()=>B({id:s.id,semester_id:a.id,course_name:o,credit:Number(p)||0,score:r===""?null:Number(r),grade_point:d===""?null:Number(d)}),onSuccess:()=>{l.invalidateQueries({queryKey:["grades"]}),t()},onError:b=>i("error",b.message)});return e.jsxs("tr",{className:"bg-brand-subtle/40",children:[e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsx(j,{className:"h-7 w-[160px]",value:o,onChange:b=>m(b.target.value)})}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsx(j,{type:"number",step:"0.5",className:"num h-7 w-[64px]",value:p,onChange:b=>n(b.target.value)})}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsx(j,{type:"number",className:"num h-7 w-[72px]",value:r,onChange:b=>h(b.target.value)})}),e.jsx("td",{className:"border-b border-line px-3 py-2 text-[12px] text-ink-3",children:"保存后按梯度定级"}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsx(j,{type:"number",step:"0.1",className:"num h-7 w-[64px]",value:d,onChange:b=>x(b.target.value)})}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsxs("div",{className:"flex justify-end gap-1.5",children:[e.jsx(g,{size:"sm",variant:"primary",onClick:()=>c.mutate(),disabled:c.isPending,children:"保存"}),e.jsx(g,{size:"sm",variant:"ghost",onClick:t,children:"取消"})]})})]})}function he(){const[a,s]=u.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs(g,{variant:"primary",size:"md",onClick:()=>s(!0),children:[e.jsx(q,{size:14})," 新增学期"]}),e.jsx(R,{open:a,sem:null,onClose:()=>s(!1)})]})}function R({open:a,sem:s,onClose:t,deleteMut:l}){const i=k(),o=S(),[m,p]=u.useState((s==null?void 0:s.term)??""),[n,r]=u.useState((s==null?void 0:s.gpa)!=null?String(s.gpa):""),[h,d]=u.useState((s==null?void 0:s.rank)!=null?String(s.rank):""),[x,c]=u.useState((s==null?void 0:s.total_students)!=null?String(s.total_students):""),[b,A]=u.useState(""),F=y({mutationFn:()=>T({id:s==null?void 0:s.id,term:m,gpa:n===""?null:Number(n),rank:h===""?null:Number(h),total_students:x===""?null:Number(x)}),onSuccess:()=>{o("success",s?"学期已更新":"学期已新增"),i.invalidateQueries({queryKey:["grades"]}),t()},onError:v=>A(v.message)});return e.jsx(Y,{open:a,onClose:t,width:480,title:s?"编辑学期 · "+s.term:"新增学期",footer:e.jsxs(e.Fragment,{children:[b&&e.jsx("span",{className:"mr-auto text-[12px] text-danger",children:b}),s&&e.jsxs(g,{variant:"danger-ghost",className:"mr-auto",onClick:()=>l==null?void 0:l.mutate(),disabled:l==null?void 0:l.isPending,children:[e.jsx(E,{size:13})," 删除学期"]}),e.jsx(g,{variant:"secondary",onClick:t,children:"取消"}),e.jsx(g,{variant:"primary",onClick:()=>F.mutate(),disabled:F.isPending,children:"保存"})]}),children:e.jsxs("div",{className:"flex flex-col gap-3.5",children:[e.jsx(C,{label:"学期名称",required:!0,hint:"如 2024-2025-1",children:e.jsx(j,{value:m,onChange:v=>p(v.target.value),placeholder:"2024-2025-1"})}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx(C,{label:"绩点",children:e.jsx(j,{type:"number",step:"0.01",className:"num",value:n,onChange:v=>r(v.target.value),placeholder:"选填"})}),e.jsx(C,{label:"排名",children:e.jsx(j,{type:"number",className:"num",value:h,onChange:v=>d(v.target.value),placeholder:"选填"})}),e.jsx(C,{label:"年级人数",children:e.jsx(j,{type:"number",className:"num",value:x,onChange:v=>c(v.target.value),placeholder:"选填"})})]}),e.jsxs("p",{className:"flex items-start gap-1.5 rounded-md bg-surface-2 px-3 py-2 text-[12px] text-ink-3",children:[e.jsx(D,{size:13,className:"mt-0.5 shrink-0"}),"绩点可手动填写,也可在卡片上点「自动绩点」按课程学分加权计算。"]})]})})}export{ye as GradesPage}; + */const ie=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],D=A("Calculator",ie);Z([ee,se,te,ae,re,ne,le]);function oe(a){const s=/^(\d{4})-(\d{4})/.exec(a);return s?s[1]+"~"+s[2]+" 学年":"其他学期"}function ce(a){const s=a.filter(i=>i.grade_point!=null&&i.credit>0);if(!s.length)return null;const t=s.reduce((i,o)=>i+o.credit,0),l=s.reduce((i,o)=>i+o.grade_point*o.credit,0);return Math.round(l/t*100)/100}function ye(){const a=X(),s=I({queryKey:["grades"],queryFn:V}),t=s.data,l=M("2"),i=M("3"),o=L(()=>{const n=((t==null?void 0:t.overall.tier_dist)??[]).filter(r=>r.count>0);return{tooltip:{trigger:"item"},legend:{orient:"vertical",right:8,top:"middle",itemGap:10,textStyle:{color:l,fontSize:11},itemWidth:10,itemHeight:10},series:[{type:"pie",radius:["48%","72%"],center:["34%","50%"],label:{show:!1},data:n.map(r=>({name:r.label,value:r.count,itemStyle:{color:r.color}}))}]}},[t,a]),m=L(()=>{const n=(t==null?void 0:t.overall.gpa_trend)??[];return{grid:{left:8,right:8,top:36,bottom:6,containLabel:!0},tooltip:{trigger:"axis"},legend:{top:0,left:"center",itemGap:16,textStyle:{color:l,fontSize:11},itemWidth:14,itemHeight:8},xAxis:{type:"category",data:n.map(r=>r.term),axisLine:{lineStyle:{color:i}},axisTick:{show:!1},axisLabel:{color:i,fontSize:10}},yAxis:[{type:"value",min:0,max:100,splitLine:{lineStyle:{color:"rgba(128,138,155,0.15)"}},axisLabel:{color:i,fontSize:10}},{type:"value",min:0,max:5,splitLine:{show:!1},axisLabel:{color:i,fontSize:10}}],series:[{name:"加权平均分",type:"bar",barMaxWidth:18,itemStyle:{color:"#3056d3",borderRadius:[3,3,0,0]},data:n.map(r=>r.avg)},{name:"绩点",type:"line",yAxisIndex:1,smooth:!0,symbolSize:6,itemStyle:{color:"#d97706"},lineStyle:{width:2},data:n.map(r=>r.gpa)}]}},[t,a]);if(s.isLoading)return e.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"});const p=[...(t==null?void 0:t.semesters)??[]].sort((n,r)=>r.term.localeCompare(n.term));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 flex-wrap gap-3",children:[e.jsx(w,{label:"总学分",value:(t==null?void 0:t.overall.credits)??0}),e.jsx(w,{label:"加权平均分",value:(t==null?void 0:t.overall.avg)!=null?t.overall.avg:"—"}),e.jsx(w,{label:"已录课程",value:(t==null?void 0:t.overall.courses)??0}),e.jsx(w,{label:"学期数",value:(t==null?void 0:t.semesters.length)??0})]}),e.jsxs("div",{className:"mb-4 grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(f,{children:[e.jsx(z,{title:"单科成绩等级分布"}),e.jsx(_,{children:e.jsx("div",{ref:o,className:"h-[220px]"})})]}),e.jsxs(f,{children:[e.jsx(z,{title:"学期趋势(加权平均分 / 绩点)"}),e.jsx(_,{children:e.jsx("div",{ref:m,className:"h-[220px]"})})]})]}),e.jsx(xe,{bands:(t==null?void 0:t.bands)??[]}),e.jsxs("div",{className:"mb-3 mt-5 flex items-center justify-between",children:[e.jsx("h2",{className:"text-[14px] font-semibold text-ink-1",children:"学年学科成绩"}),e.jsx(he,{})]}),p.length?e.jsx("div",{className:"flex flex-col gap-5",children:de(p).map(([n,r])=>e.jsxs("section",{children:[e.jsx("div",{className:"mb-2 text-[12px] font-medium text-ink-3",children:n}),e.jsx("div",{className:"flex flex-col gap-3",children:r.map(h=>e.jsx(ue,{sem:h},h.id))})]},n))}):e.jsx(f,{children:e.jsx(O,{icon:e.jsx($,{size:36,strokeWidth:1.5}),title:"暂无学期成绩",description:"新增一个学期(如 2024-2025-1),再录入各科成绩。"})})]})}function de(a){const s=new Map;for(const t of a){const l=oe(t.term);s.has(l)||s.set(l,[]),s.get(l).push(t)}return[...s.entries()]}function w({label:a,value:s}){return e.jsxs("div",{className:"min-w-[128px] flex-1 max-w-[220px] rounded-lg border border-line bg-surface px-4 py-3 shadow-card",children:[e.jsx("div",{className:"text-[12px] text-ink-3",children:a}),e.jsx("div",{className:"num mt-0.5 text-[22px] font-semibold leading-tight text-ink-1",children:s})]})}function xe({bands:a}){const s=k(),t=S(),[l,i]=u.useState(null),[o,m]=u.useState(null),p=y({mutationFn:H,onSuccess:()=>{t("success","梯度已保存"),s.invalidateQueries({queryKey:["grades"]})},onError:r=>t("error",r.message)}),n=y({mutationFn:W,onSuccess:()=>{s.invalidateQueries({queryKey:["grades"]}),m(null)}});return e.jsxs(f,{children:[e.jsx(z,{title:"成绩梯度",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"按 分数 ≥ min 且 < max 定级,满分档含上限"})}),e.jsxs(_,{className:"p-0",children:[e.jsx("div",{className:"divide-y divide-line",children:a.map(r=>e.jsx(P,{band:r,onSave:h=>p.mutate(h),onDelete:()=>m(r)},r.id))}),e.jsx("div",{className:"border-t border-line px-4 py-2.5",children:l?e.jsx(P,{band:l,isNew:!0,onChange:i,onSave:()=>{p.mutate(l),i(null)},onCancel:()=>i(null)}):e.jsxs(g,{size:"sm",variant:"secondary",onClick:()=>{var r;return i({id:0,label:"",color:"#3056d3",min:0,max:60,sort:(((r=a.at(-1))==null?void 0:r.sort)??0)+10})},children:[e.jsx(q,{size:13})," 添加等级"]})})]}),e.jsx(Q,{open:!!o,title:"删除等级",content:o?"确定删除「"+o.label+"」吗?已录成绩将不再显示该等级。":"",onCancel:()=>m(null),onOk:()=>o&&n.mutate(o.id)})]})}function P({band:a,onSave:s,onDelete:t,onChange:l,onCancel:i,isNew:o}){const[m,p]=u.useState(a),n=o&&l?m:a,r=d=>{const x={...n,...d};l?l(x):p(x)},h=o||JSON.stringify({...n,id:0})!==JSON.stringify({...a,id:0});return e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2",children:[e.jsx("input",{type:"color",value:n.color,onChange:d=>r({color:d.target.value}),className:"size-5 shrink-0 cursor-pointer rounded border border-line bg-surface","aria-label":"颜色"}),e.jsx(j,{className:"w-[96px]",value:n.label,onChange:d=>r({label:d.target.value}),placeholder:"等级名"}),e.jsx("span",{className:"text-[12px] text-ink-3",children:"分数"}),e.jsx(j,{type:"number",className:"num w-[72px]",value:String(n.min),onChange:d=>r({min:Number(d.target.value)})}),e.jsx("span",{className:"text-[12px] text-ink-3",children:"至"}),e.jsx(j,{type:"number",className:"num w-[72px]",value:String(n.max),onChange:d=>r({max:Number(d.target.value)})}),o?e.jsxs(e.Fragment,{children:[e.jsx(g,{size:"sm",variant:"primary",onClick:()=>s==null?void 0:s(n),children:"添加"}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>i==null?void 0:i(),children:"取消"})]}):e.jsxs("div",{className:"ml-auto flex gap-1.5",children:[e.jsx(g,{size:"sm",variant:h?"primary":"secondary",disabled:!h,onClick:()=>s==null?void 0:s(n),children:"保存"}),e.jsx(g,{size:"icon-sm",variant:"ghost","aria-label":"删除等级",onClick:()=>t==null?void 0:t(),children:e.jsx(E,{size:13})})]})]})}function ue({sem:a}){const s=k(),t=S(),[l,i]=u.useState(null),[o,m]=u.useState(null),[p,n]=u.useState(!1),r=()=>void s.invalidateQueries({queryKey:["grades"]}),h=y({mutationFn:J,onSuccess:()=>{r(),m(null)}}),d=y({mutationFn:()=>{const c=ce(a.courses);if(c==null)throw new Error("请先为课程填写绩点");return T({id:a.id,term:a.term,gpa:c,rank:a.rank??null,total_students:a.total_students??null})},onSuccess:()=>{t("success","绩点已按课程自动计算"),r()},onError:c=>t("error",c.message)}),x=y({mutationFn:()=>U(a.id),onSuccess:()=>{r(),n(!1),t("success","学期已删除")}});return e.jsxs(f,{children:[e.jsx(z,{title:a.term,extra:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(N,{color:"var(--brand-text)",children:["绩点 ",a.gpa??"—"]}),a.rank!=null&&e.jsxs(N,{color:"var(--success)",children:["排名 ",a.rank,"/",a.total_students??"—"]}),e.jsxs(N,{color:"var(--text-3)",children:["均分 ",a.stats.avg??"—"]}),e.jsxs(N,{color:"var(--text-3)",children:[a.stats.credits," 学分"]}),e.jsxs(g,{size:"sm",variant:"ghost",onClick:()=>d.mutate(),disabled:d.isPending,children:[e.jsx(D,{size:13})," 自动绩点"]}),e.jsx(g,{size:"icon-sm",variant:"ghost","aria-label":"编辑学期",onClick:()=>n(!0),children:e.jsx(G,{size:13})})]})}),e.jsx(_,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsx("div",{className:"-mx-1 overflow-x-auto px-1",children:e.jsxs("table",{className:"w-full border-collapse text-[13px]",children:[e.jsx("thead",{children:e.jsx("tr",{children:["课程","学分","分数","等级","绩点",""].map(c=>e.jsx("th",{className:"border-b border-line bg-surface-2 px-3 py-2 text-left text-[12px] font-semibold text-ink-3",children:c},c))})}),e.jsxs("tbody",{children:[a.courses.map(c=>l===c.id?e.jsx(pe,{sem:a,course:c,onDone:()=>i(null)},c.id):e.jsxs("tr",{className:"transition-colors hover:bg-surface-2",children:[e.jsx("td",{className:"border-b border-line px-3 py-2 font-medium text-ink-1",children:c.course_name}),e.jsx("td",{className:"num border-b border-line px-3 py-2 text-ink-2",children:c.credit}),e.jsx("td",{className:"num border-b border-line px-3 py-2",children:c.score!=null?e.jsx("span",{className:"font-medium",children:c.score}):e.jsx("span",{className:"text-ink-3",children:"未录入"})}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:c.band?e.jsx(N,{color:c.band.color,children:c.band.label}):e.jsx("span",{className:"text-ink-3",children:"—"})}),e.jsx("td",{className:"num border-b border-line px-3 py-2 text-ink-2",children:c.grade_point??"—"}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsxs("div",{className:"flex justify-end gap-1",children:[e.jsx(g,{size:"icon-sm",variant:"ghost","aria-label":"编辑课程",onClick:()=>i(c.id),children:e.jsx(G,{size:13})}),e.jsx(g,{size:"icon-sm",variant:"ghost","aria-label":"删除课程",className:"text-ink-3 hover:text-danger",onClick:()=>m(c),children:e.jsx(E,{size:13})})]})})]},c.id)),e.jsx(me,{sem:a})]})]})})})}),e.jsx(Q,{open:!!o,title:"删除课程",content:o?"确定删除「"+o.course_name+"」吗?":"",onCancel:()=>m(null),onOk:()=>o&&h.mutate(o.id)}),e.jsx(K,{open:p,sem:a,onClose:()=>n(!1),deleteMut:x})]})}function me({sem:a}){const s=k(),t=S(),[l,i]=u.useState(""),[o,m]=u.useState(""),[p,n]=u.useState(""),[r,h]=u.useState(""),d=y({mutationFn:()=>B({semester_id:a.id,course_name:l,credit:Number(o)||0,score:p===""?null:Number(p),grade_point:r===""?null:Number(r)}),onSuccess:()=>{i(""),m(""),n(""),h(""),s.invalidateQueries({queryKey:["grades"]})},onError:x=>t("error",x.message)});return e.jsxs("tr",{className:"bg-surface-2",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{className:"h-7 w-[160px]",placeholder:"课程名称",value:l,onChange:x=>i(x.target.value)})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{type:"number",step:"0.5",className:"num h-7 w-[64px]",placeholder:"0",value:o,onChange:x=>m(x.target.value)})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{type:"number",className:"num h-7 w-[72px]",placeholder:"0-100",value:p,onChange:x=>n(x.target.value)})}),e.jsx("td",{className:"px-3 py-2 text-ink-3",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{type:"number",step:"0.1",className:"num h-7 w-[64px]",placeholder:"选填",value:r,onChange:x=>h(x.target.value)})}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs(g,{size:"sm",variant:"secondary",disabled:!l.trim()||d.isPending,onClick:()=>d.mutate(),children:[e.jsx(q,{size:13})," 添加"]})})]})}function pe({sem:a,course:s,onDone:t}){const l=k(),i=S(),[o,m]=u.useState(s.course_name),[p,n]=u.useState(String(s.credit)),[r,h]=u.useState(s.score!=null?String(s.score):""),[d,x]=u.useState(s.grade_point!=null?String(s.grade_point):""),c=y({mutationFn:()=>B({id:s.id,semester_id:a.id,course_name:o,credit:Number(p)||0,score:r===""?null:Number(r),grade_point:d===""?null:Number(d)}),onSuccess:()=>{l.invalidateQueries({queryKey:["grades"]}),t()},onError:b=>i("error",b.message)});return e.jsxs("tr",{className:"bg-brand-subtle/40",children:[e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsx(j,{className:"h-7 w-[160px]",value:o,onChange:b=>m(b.target.value)})}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsx(j,{type:"number",step:"0.5",className:"num h-7 w-[64px]",value:p,onChange:b=>n(b.target.value)})}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsx(j,{type:"number",className:"num h-7 w-[72px]",value:r,onChange:b=>h(b.target.value)})}),e.jsx("td",{className:"border-b border-line px-3 py-2 text-[12px] text-ink-3",children:"保存后按梯度定级"}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsx(j,{type:"number",step:"0.1",className:"num h-7 w-[64px]",value:d,onChange:b=>x(b.target.value)})}),e.jsx("td",{className:"border-b border-line px-3 py-2",children:e.jsxs("div",{className:"flex justify-end gap-1.5",children:[e.jsx(g,{size:"sm",variant:"primary",onClick:()=>c.mutate(),disabled:c.isPending,children:"保存"}),e.jsx(g,{size:"sm",variant:"ghost",onClick:t,children:"取消"})]})})]})}function he(){const[a,s]=u.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs(g,{variant:"primary",size:"md",onClick:()=>s(!0),children:[e.jsx(q,{size:14})," 新增学期"]}),e.jsx(K,{open:a,sem:null,onClose:()=>s(!1)})]})}function K({open:a,sem:s,onClose:t,deleteMut:l}){const i=k(),o=S(),[m,p]=u.useState((s==null?void 0:s.term)??""),[n,r]=u.useState((s==null?void 0:s.gpa)!=null?String(s.gpa):""),[h,d]=u.useState((s==null?void 0:s.rank)!=null?String(s.rank):""),[x,c]=u.useState((s==null?void 0:s.total_students)!=null?String(s.total_students):""),[b,R]=u.useState(""),F=y({mutationFn:()=>T({id:s==null?void 0:s.id,term:m,gpa:n===""?null:Number(n),rank:h===""?null:Number(h),total_students:x===""?null:Number(x)}),onSuccess:()=>{o("success",s?"学期已更新":"学期已新增"),i.invalidateQueries({queryKey:["grades"]}),t()},onError:v=>R(v.message)});return e.jsx(Y,{open:a,onClose:t,width:480,title:s?"编辑学期 · "+s.term:"新增学期",footer:e.jsxs(e.Fragment,{children:[b&&e.jsx("span",{className:"mr-auto text-[12px] text-danger",children:b}),s&&e.jsxs(g,{variant:"danger-ghost",className:"mr-auto",onClick:()=>l==null?void 0:l.mutate(),disabled:l==null?void 0:l.isPending,children:[e.jsx(E,{size:13})," 删除学期"]}),e.jsx(g,{variant:"secondary",onClick:t,children:"取消"}),e.jsx(g,{variant:"primary",onClick:()=>F.mutate(),disabled:F.isPending,children:"保存"})]}),children:e.jsxs("div",{className:"flex flex-col gap-3.5",children:[e.jsx(C,{label:"学期名称",required:!0,hint:"如 2024-2025-1",children:e.jsx(j,{value:m,onChange:v=>p(v.target.value),placeholder:"2024-2025-1"})}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx(C,{label:"绩点",children:e.jsx(j,{type:"number",step:"0.01",className:"num",value:n,onChange:v=>r(v.target.value),placeholder:"选填"})}),e.jsx(C,{label:"排名",children:e.jsx(j,{type:"number",className:"num",value:h,onChange:v=>d(v.target.value),placeholder:"选填"})}),e.jsx(C,{label:"年级人数",children:e.jsx(j,{type:"number",className:"num",value:x,onChange:v=>c(v.target.value),placeholder:"选填"})})]}),e.jsxs("p",{className:"flex items-start gap-1.5 rounded-md bg-surface-2 px-3 py-2 text-[12px] text-ink-3",children:[e.jsx(D,{size:13,className:"mt-0.5 shrink-0"}),"绩点可手动填写,也可在卡片上点「自动绩点」按课程学分加权计算。"]})]})})}export{ye as GradesPage}; diff --git a/sync-server/www/assets/RecordsPage-Btqncm1G.js b/sync-server/www/assets/RecordsPage-Btqncm1G.js new file mode 100644 index 0000000..39a2b9b --- /dev/null +++ b/sync-server/www/assets/RecordsPage-Btqncm1G.js @@ -0,0 +1,6 @@ +import{c as pe,j as e,a as b,r as s,b as fe,u as he,d as ve,e as ge,f as L,g as je,I as ye,S as N,B as k,P as Q,h as ee,L as te,G as se,R as be,i as ae,k as Ne,l as ke,T as we,E as ne,m as Ce,n as Ee,o as Se,C as _e,p as ze,q as qe,s as Le,t as Re,v as De}from"./index-BxEr63go.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 Ie=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Pe=pe("Ellipsis",Ie);function Te({className:n,...a}){return e.jsx("div",{className:b("overflow-x-auto",n),...a})}function Be({className:n,...a}){return e.jsx("table",{className:b("w-full border-collapse text-[13px]",n),...a})}function x({className:n,...a}){return e.jsx("th",{className:b("sticky top-0 z-10 border-b border-line bg-surface-2 px-3 py-2 text-left text-[12px] font-semibold text-ink-3 whitespace-nowrap",n),...a})}function m({className:n,...a}){return e.jsx("td",{className:b("border-b border-line px-3 py-2 align-middle text-ink-1",n),...a})}function Qe({className:n,onClick:a,...c}){return e.jsx("tr",{className:b("group transition-colors",a&&"cursor-pointer hover:bg-surface-2",n),onClick:a,...c})}function Me({trigger:n,children:a,align:c="end",className:E}){const[d,f]=s.useState(!1),[l,S]=s.useState(null),u=s.useRef(null),w=s.useRef(null),j=()=>{var i;const o=(i=u.current)==null?void 0:i.getBoundingClientRect();o&&(S({top:o.bottom+4,left:c==="end"?o.right-176:o.left}),f(!0))};return s.useLayoutEffect(()=>{var p;if(!d||!l)return;const o=w.current,i=(p=u.current)==null?void 0:p.getBoundingClientRect();if(!o||!i)return;const h=o.getBoundingClientRect();let r=l.top;r+h.height>window.innerHeight-8&&(r=Math.max(8,i.top-h.height-4));let v=Math.min(Math.max(8,l.left),window.innerWidth-h.width-8);(r!==l.top||v!==l.left)&&S({top:r,left:v})},[d,l]),s.useEffect(()=>{if(!d)return;const o=v=>{var _,g;const p=v.target;(_=u.current)!=null&&_.contains(p)||(g=w.current)!=null&&g.contains(p)||f(!1)},i=v=>{v.key==="Escape"&&f(!1)},h=()=>f(!1),r=()=>f(!1);return document.addEventListener("mousedown",o),document.addEventListener("keydown",i),window.addEventListener("scroll",h,!0),window.addEventListener("resize",r),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",i),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",r)}},[d]),e.jsxs("div",{ref:u,children:[e.jsx("div",{onClick:j,children:n}),d&&l&&fe.createPortal(e.jsx("div",{ref:w,className:b("fixed z-[60] min-w-[160px] rounded-md border border-line bg-surface py-1 shadow-pop",E),style:{top:l.top,left:l.left},role:"menu",children:typeof a=="function"?a(()=>f(!1)):a}),document.body)]})}function le({className:n,danger:a,...c}){return e.jsx("button",{className:b("flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] transition-colors",a?"text-danger hover:bg-danger-subtle":"text-ink-1 hover:bg-surface-3",n),...c})}const ie=20;function Oe(){var A,H,Y,Z,J,U,V,X,$;const n=he(),a=ve(),[c,E]=ge(),[d,f]=s.useState(c.get("q")??""),[l,S]=s.useState(""),[u,w]=s.useState(""),[j,o]=s.useState(""),[i,h]=s.useState(""),[r,v]=s.useState(""),[p,_]=s.useState("date_desc"),[g,R]=s.useState(1),[re,D]=s.useState(null),[oe,z]=s.useState(!1),[C,I]=s.useState(null),[ce,de]=s.useState(null),[ue,P]=s.useState(!1);s.useEffect(()=>{c.get("new")==="1"&&(D(null),z(!0),c.delete("new"),E(c,{replace:!0}))},[c,E]);const xe=L({queryKey:["types"],queryFn:qe}),M=L({queryKey:["taxonomy-all"],queryFn:()=>Le()}),me=L({queryKey:["stats",void 0],queryFn:()=>Re(void 0)}),K=s.useMemo(()=>({q:d||void 0,types:l?[Number(l)]:void 0,levels:j?[j]:void 0,roles:i?[i]:void 0,statuses:r?[r]:void 0,year:u?Number(u):void 0,sort:p,page:g,page_size:ie}),[d,l,u,j,i,r,p,g]),y=L({queryKey:["footprints",K],queryFn:()=>De(K)});s.useEffect(()=>{R(1)},[d,l,u,j,i,r]);const O=je({mutationFn:t=>ze(t),onSuccess:()=>{a("success","记录已删除"),n.invalidateQueries({queryKey:["footprints"]}),n.invalidateQueries({queryKey:["timeline"]}),n.invalidateQueries({queryKey:["stats"]}),I(null)}}),T=((A=y.data)==null?void 0:A.total)??0,F=Math.max(1,Math.ceil(T/ie)),B=()=>{D(null),z(!0)},G=t=>{D(t),z(!0)},W=t=>{de(t),P(!0)};return e.jsxs("div",{className:"px-3 py-4 sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[e.jsx(ye,{className:"w-[220px]",placeholder:"搜索标题、内容、结果、标签…",value:d,onChange:t=>f(t.target.value)}),e.jsxs("div",{className:"grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:items-center sm:gap-2",children:[e.jsx(N,{className:"w-full sm:w-[130px]",value:l,onChange:t=>S(t.target.value),options:[{value:"",label:"全部类型"},...(((H=xe.data)==null?void 0:H.items)??[]).map(t=>({value:String(t.id),label:t.name}))]}),e.jsx(N,{className:"w-full sm:w-[110px]",value:u,onChange:t=>w(t.target.value),options:[{value:"",label:"全部年份"},...(((Y=me.data)==null?void 0:Y.years)??[]).map(t=>({value:String(t),label:t+" 年"}))]}),e.jsx(N,{className:"w-full sm:w-[110px]",value:j,onChange:t=>o(t.target.value),options:[{value:"",label:"全部级别"},...(((Z=M.data)==null?void 0:Z.items)??[]).filter(t=>t.kind==="level").map(t=>({value:t.value,label:t.value}))]}),e.jsx(N,{className:"w-full sm:w-[100px]",value:i,onChange:t=>h(t.target.value),options:[{value:"",label:"全部角色"},...(((J=M.data)==null?void 0:J.items)??[]).filter(t=>t.kind==="role").map(t=>({value:t.value,label:t.value}))]}),e.jsx(N,{className:"w-full sm:w-[110px]",value:r,onChange:t=>v(t.target.value),options:[{value:"",label:"全部状态"},{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}]}),e.jsx(N,{className:"w-full sm:w-[130px]",value:p,onChange:t=>_(t.target.value),options:[{value:"date_desc",label:"时间从新到旧"},{value:"date_asc",label:"时间从旧到新"},{value:"updated_desc",label:"最近修改"},{value:"weight_desc",label:"重要度优先"}]})]}),e.jsxs("div",{className:"flex w-full items-center justify-between gap-2 sm:contents",children:[e.jsxs("span",{className:"num text-[12px] text-ink-3 sm:ml-auto",children:["共 ",T," 条"]}),e.jsxs(k,{variant:"primary",size:"md",onClick:B,children:[e.jsx(Q,{size:14}),"新建"]})]})]}),e.jsxs("div",{className:"hidden rounded-lg border border-line bg-surface shadow-card md:block",children:[e.jsxs(Te,{className:"max-h-[calc(100vh-260px)] overflow-y-auto",children:[e.jsxs(Be,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(x,{className:"w-[32%]",children:"标题"}),e.jsx(x,{children:"类型"}),e.jsx(x,{children:"时间"}),e.jsx(x,{children:"级别"}),e.jsx(x,{children:"奖等"}),e.jsx(x,{children:"角色"}),e.jsx(x,{children:"状态"}),e.jsx(x,{className:"text-right",children:"附件"}),e.jsx(x,{children:"更新时间"}),e.jsx(x,{className:"w-[52px]"})]})}),e.jsx("tbody",{children:(((U=y.data)==null?void 0:U.items)??[]).map(t=>e.jsxs(Qe,{onClick:()=>W(t.id),children:[e.jsx(m,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:t.type_color}}),e.jsx("span",{className:"truncate font-medium",title:t.title,children:t.title})]})}),e.jsx(m,{className:"whitespace-nowrap text-ink-2",children:t.type_name}),e.jsx(m,{className:"num whitespace-nowrap text-ink-2",children:ee(t.start_date,t.end_date)}),e.jsx(m,{children:e.jsx(te,{level:t.level})}),e.jsx(m,{children:e.jsx(se,{grade:t.award_grade})}),e.jsx(m,{children:e.jsx(be,{role:t.role})}),e.jsx(m,{children:e.jsx(ae,{status:t.status})}),e.jsx(m,{className:"num text-right text-ink-2",children:t.attachment_count>0?t.attachment_count:""}),e.jsx(m,{className:"num whitespace-nowrap text-ink-3",children:Ne(t.updated_at)}),e.jsx(m,{onClick:q=>q.stopPropagation(),children:e.jsx(Me,{trigger:e.jsx(k,{variant:"ghost",size:"icon-sm","aria-label":"更多操作",children:e.jsx(Pe,{size:15})}),children:q=>e.jsxs(e.Fragment,{children:[e.jsxs(le,{onClick:()=>{q(),G(t.id)},children:[e.jsx(ke,{size:13})," 编辑"]}),e.jsxs(le,{danger:!0,onClick:()=>{q(),I(t)},children:[e.jsx(we,{size:13})," 删除"]})]})})})]},t.id))})]}),!y.isLoading&&!((V=y.data)!=null&&V.items.length)&&e.jsx(ne,{title:"没有匹配的记录",description:"调整筛选条件,或新建一条记录。",action:e.jsxs(k,{variant:"primary",onClick:B,children:[e.jsx(Q,{size:14})," 新建记录"]})})]}),e.jsxs("div",{className:"divide-y divide-line rounded-lg border border-line bg-surface md:hidden",children:[(((X=y.data)==null?void 0:X.items)??[]).map(t=>e.jsxs("button",{onClick:()=>W(t.id),className:"block w-full px-3 py-3 text-left transition-colors active:bg-surface-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:t.type_color}}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[13.5px] font-medium text-ink-1",children:t.title}),t.attachment_count>0&&e.jsxs("span",{className:"num shrink-0 text-[11px] text-ink-3",children:[t.attachment_count," 附件"]})]}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.jsx(Ce,{color:t.type_color,children:t.type_name}),e.jsx(ae,{status:t.status}),t.level&&e.jsx(te,{level:t.level}),t.award_grade&&e.jsx(se,{grade:t.award_grade})]}),e.jsx("div",{className:"num mt-1 text-[11.5px] text-ink-3",children:ee(t.start_date,t.end_date)})]},t.id)),!y.isLoading&&!(($=y.data)!=null&&$.items.length)&&e.jsx(ne,{title:"没有匹配的记录",description:"调整筛选条件,或新建一条记录。",action:e.jsxs(k,{variant:"primary",onClick:B,children:[e.jsx(Q,{size:14})," 新建记录"]})})]}),T>0&&e.jsxs("div",{className:"flex h-11 items-center justify-end gap-3 border-t border-line bg-surface px-4 text-[12px] text-ink-3",children:[e.jsxs("span",{className:"num",children:["第 ",g," / ",F," 页"]}),e.jsx(k,{variant:"secondary",size:"sm",disabled:g<=1,onClick:()=>R(t=>t-1),children:"上一页"}),e.jsx(k,{variant:"secondary",size:"sm",disabled:g>=F,onClick:()=>R(t=>t+1),children:"下一页"})]})]}),e.jsx(Ee,{open:ue,onClose:()=>P(!1),footprintId:ce,onEdit:t=>{P(!1),G(t)}}),e.jsx(Se,{open:oe,onClose:()=>z(!1),footprintId:re}),e.jsx(_e,{open:!!C,title:"删除记录",content:C?"确定删除「"+C.title+"」吗?该操作不可撤销。":"",onCancel:()=>I(null),onOk:()=>C&&O.mutate(C.id),loading:O.isPending})]})}export{Oe as RecordsPage}; diff --git a/sync-server/www/assets/RecordsPage-Gvh-PxIo.js b/sync-server/www/assets/RecordsPage-Gvh-PxIo.js deleted file mode 100644 index dd9d2d2..0000000 --- a/sync-server/www/assets/RecordsPage-Gvh-PxIo.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as pe,j as e,a as x,r as t,u as he,b as ve,d as je,e as w,f as fe,I as ge,S as h,B as v,P as L,g as U,L as V,G as X,R as ye,h as $,i as be,k as Ne,T as ke,E as ee,l as _e,m as Ce,n as we,C as Se,o as Ee,p as qe,q as ze,s as Ie,t as De}from"./index-BFEQKHK8.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 Te=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Le=pe("Ellipsis",Te);function Pe({className:l,...a}){return e.jsx("div",{className:x("overflow-x-auto",l),...a})}function Qe({className:l,...a}){return e.jsx("table",{className:x("w-full border-collapse text-[13px]",l),...a})}function i({className:l,...a}){return e.jsx("th",{className:x("sticky top-0 z-10 border-b border-line bg-surface-2 px-3 py-2 text-left text-[12px] font-semibold text-ink-3 whitespace-nowrap",l),...a})}function r({className:l,...a}){return e.jsx("td",{className:x("border-b border-line px-3 py-2 align-middle text-ink-1",l),...a})}function Re({className:l,onClick:a,...n}){return e.jsx("tr",{className:x("group transition-colors",a&&"cursor-pointer hover:bg-surface-2",l),onClick:a,...n})}function Ke({trigger:l,children:a,align:n="end",className:k}){const[d,m]=t.useState(!1),c=t.useRef(null);return t.useEffect(()=>{if(!d)return;const p=j=>{c.current&&!c.current.contains(j.target)&&m(!1)},o=j=>{j.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",p),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",o)}},[d]),e.jsxs("div",{className:"relative",ref:c,children:[e.jsx("div",{onClick:()=>m(p=>!p),children:l}),d&&e.jsx("div",{className:x("absolute z-40 mt-1 min-w-[160px] rounded-md border border-line bg-surface py-1 shadow-pop",n==="end"?"right-0":"left-0",k),children:typeof a=="function"?a(()=>m(!1)):a})]})}function se({className:l,danger:a,...n}){return e.jsx("button",{className:x("flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] transition-colors",a?"text-danger hover:bg-danger-subtle":"text-ink-1 hover:bg-surface-3",l),...n})}const te=20;function Oe(){var F,M,G,A,W,Y,Z,H,J;const l=he(),a=ve(),[n,k]=je(),[d,m]=t.useState(n.get("q")??""),[c,p]=t.useState(""),[o,j]=t.useState(""),[f,ae]=t.useState(""),[g,le]=t.useState(""),[y,ne]=t.useState(""),[S,ie]=t.useState("date_desc"),[b,E]=t.useState(1),[re,q]=t.useState(null),[ce,_]=t.useState(!1),[N,z]=t.useState(null),[de,oe]=t.useState(null),[ue,I]=t.useState(!1);t.useEffect(()=>{n.get("new")==="1"&&(q(null),_(!0),n.delete("new"),k(n,{replace:!0}))},[n,k]);const xe=w({queryKey:["types"],queryFn:qe}),P=w({queryKey:["taxonomy-all"],queryFn:()=>ze()}),me=w({queryKey:["stats",void 0],queryFn:()=>Ie(void 0)}),Q=t.useMemo(()=>({q:d||void 0,types:c?[Number(c)]:void 0,levels:f?[f]:void 0,roles:g?[g]:void 0,statuses:y?[y]:void 0,year:o?Number(o):void 0,sort:S,page:b,page_size:te}),[d,c,o,f,g,y,S,b]),u=w({queryKey:["footprints",Q],queryFn:()=>De(Q)});t.useEffect(()=>{E(1)},[d,c,o,f,g,y]);const R=fe({mutationFn:s=>Ee(s),onSuccess:()=>{a("success","记录已删除"),l.invalidateQueries({queryKey:["footprints"]}),l.invalidateQueries({queryKey:["timeline"]}),l.invalidateQueries({queryKey:["stats"]}),z(null)}}),D=((F=u.data)==null?void 0:F.total)??0,K=Math.max(1,Math.ceil(D/te)),T=()=>{q(null),_(!0)},B=s=>{q(s),_(!0)},O=s=>{oe(s),I(!0)};return e.jsxs("div",{className:"px-3 py-4 sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[e.jsx(ge,{className:"w-[220px]",placeholder:"搜索标题、内容、结果、标签…",value:d,onChange:s=>m(s.target.value)}),e.jsxs("div",{className:"grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:items-center sm:gap-2",children:[e.jsx(h,{className:"w-full sm:w-[130px]",value:c,onChange:s=>p(s.target.value),options:[{value:"",label:"全部类型"},...(((M=xe.data)==null?void 0:M.items)??[]).map(s=>({value:String(s.id),label:s.name}))]}),e.jsx(h,{className:"w-full sm:w-[110px]",value:o,onChange:s=>j(s.target.value),options:[{value:"",label:"全部年份"},...(((G=me.data)==null?void 0:G.years)??[]).map(s=>({value:String(s),label:s+" 年"}))]}),e.jsx(h,{className:"w-full sm:w-[110px]",value:f,onChange:s=>ae(s.target.value),options:[{value:"",label:"全部级别"},...(((A=P.data)==null?void 0:A.items)??[]).filter(s=>s.kind==="level").map(s=>({value:s.value,label:s.value}))]}),e.jsx(h,{className:"w-full sm:w-[100px]",value:g,onChange:s=>le(s.target.value),options:[{value:"",label:"全部角色"},...(((W=P.data)==null?void 0:W.items)??[]).filter(s=>s.kind==="role").map(s=>({value:s.value,label:s.value}))]}),e.jsx(h,{className:"w-full sm:w-[110px]",value:y,onChange:s=>ne(s.target.value),options:[{value:"",label:"全部状态"},{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}]}),e.jsx(h,{className:"w-full sm:w-[130px]",value:S,onChange:s=>ie(s.target.value),options:[{value:"date_desc",label:"时间从新到旧"},{value:"date_asc",label:"时间从旧到新"},{value:"updated_desc",label:"最近修改"},{value:"weight_desc",label:"重要度优先"}]})]}),e.jsxs("div",{className:"flex w-full items-center justify-between gap-2 sm:contents",children:[e.jsxs("span",{className:"num text-[12px] text-ink-3 sm:ml-auto",children:["共 ",D," 条"]}),e.jsxs(v,{variant:"primary",size:"md",onClick:T,children:[e.jsx(L,{size:14}),"新建"]})]})]}),e.jsxs("div",{className:"hidden rounded-lg border border-line bg-surface shadow-card md:block",children:[e.jsxs(Pe,{className:"max-h-[calc(100vh-260px)] overflow-y-auto",children:[e.jsxs(Qe,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx(i,{className:"w-[32%]",children:"标题"}),e.jsx(i,{children:"类型"}),e.jsx(i,{children:"时间"}),e.jsx(i,{children:"级别"}),e.jsx(i,{children:"奖等"}),e.jsx(i,{children:"角色"}),e.jsx(i,{children:"状态"}),e.jsx(i,{className:"text-right",children:"附件"}),e.jsx(i,{children:"更新时间"}),e.jsx(i,{className:"w-[52px]"})]})}),e.jsx("tbody",{children:(((Y=u.data)==null?void 0:Y.items)??[]).map(s=>e.jsxs(Re,{onClick:()=>O(s.id),children:[e.jsx(r,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:s.type_color}}),e.jsx("span",{className:"truncate font-medium",title:s.title,children:s.title})]})}),e.jsx(r,{className:"whitespace-nowrap text-ink-2",children:s.type_name}),e.jsx(r,{className:"num whitespace-nowrap text-ink-2",children:U(s.start_date,s.end_date)}),e.jsx(r,{children:e.jsx(V,{level:s.level})}),e.jsx(r,{children:e.jsx(X,{grade:s.award_grade})}),e.jsx(r,{children:e.jsx(ye,{role:s.role})}),e.jsx(r,{children:e.jsx($,{status:s.status})}),e.jsx(r,{className:"num text-right text-ink-2",children:s.attachment_count>0?s.attachment_count:""}),e.jsx(r,{className:"num whitespace-nowrap text-ink-3",children:be(s.updated_at)}),e.jsx(r,{onClick:C=>C.stopPropagation(),children:e.jsx(Ke,{trigger:e.jsx(v,{variant:"ghost",size:"icon-sm","aria-label":"更多操作",children:e.jsx(Le,{size:15})}),children:C=>e.jsxs(e.Fragment,{children:[e.jsxs(se,{onClick:()=>{C(),B(s.id)},children:[e.jsx(Ne,{size:13})," 编辑"]}),e.jsxs(se,{danger:!0,onClick:()=>{C(),z(s)},children:[e.jsx(ke,{size:13})," 删除"]})]})})})]},s.id))})]}),!u.isLoading&&!((Z=u.data)!=null&&Z.items.length)&&e.jsx(ee,{title:"没有匹配的记录",description:"调整筛选条件,或新建一条记录。",action:e.jsxs(v,{variant:"primary",onClick:T,children:[e.jsx(L,{size:14})," 新建记录"]})})]}),e.jsxs("div",{className:"divide-y divide-line rounded-lg border border-line bg-surface md:hidden",children:[(((H=u.data)==null?void 0:H.items)??[]).map(s=>e.jsxs("button",{onClick:()=>O(s.id),className:"block w-full px-3 py-3 text-left transition-colors active:bg-surface-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:s.type_color}}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[13.5px] font-medium text-ink-1",children:s.title}),s.attachment_count>0&&e.jsxs("span",{className:"num shrink-0 text-[11px] text-ink-3",children:[s.attachment_count," 附件"]})]}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.jsx(_e,{color:s.type_color,children:s.type_name}),e.jsx($,{status:s.status}),s.level&&e.jsx(V,{level:s.level}),s.award_grade&&e.jsx(X,{grade:s.award_grade})]}),e.jsx("div",{className:"num mt-1 text-[11.5px] text-ink-3",children:U(s.start_date,s.end_date)})]},s.id)),!u.isLoading&&!((J=u.data)!=null&&J.items.length)&&e.jsx(ee,{title:"没有匹配的记录",description:"调整筛选条件,或新建一条记录。",action:e.jsxs(v,{variant:"primary",onClick:T,children:[e.jsx(L,{size:14})," 新建记录"]})})]}),D>0&&e.jsxs("div",{className:"flex h-11 items-center justify-end gap-3 border-t border-line bg-surface px-4 text-[12px] text-ink-3",children:[e.jsxs("span",{className:"num",children:["第 ",b," / ",K," 页"]}),e.jsx(v,{variant:"secondary",size:"sm",disabled:b<=1,onClick:()=>E(s=>s-1),children:"上一页"}),e.jsx(v,{variant:"secondary",size:"sm",disabled:b>=K,onClick:()=>E(s=>s+1),children:"下一页"})]})]}),e.jsx(Ce,{open:ue,onClose:()=>I(!1),footprintId:de,onEdit:s=>{I(!1),B(s)}}),e.jsx(we,{open:ce,onClose:()=>_(!1),footprintId:re}),e.jsx(Se,{open:!!N,title:"删除记录",content:N?"确定删除「"+N.title+"」吗?该操作不可撤销。":"",onCancel:()=>z(null),onOk:()=>N&&R.mutate(N.id),loading:R.isPending})]})}export{Oe as RecordsPage}; diff --git a/sync-server/www/assets/TaxonomyPage-7GdxiFCp.js b/sync-server/www/assets/TaxonomyPage-P178KH9X.js similarity index 88% rename from sync-server/www/assets/TaxonomyPage-7GdxiFCp.js rename to sync-server/www/assets/TaxonomyPage-P178KH9X.js index 2ea12bd..4858d9e 100644 --- a/sync-server/www/assets/TaxonomyPage-7GdxiFCp.js +++ b/sync-server/www/assets/TaxonomyPage-P178KH9X.js @@ -1 +1 @@ -import{j as e,u as k,b as q,e as Q,r as g,f as h,Q as F,U as w,B as j,T as z,I as D,P as T,C as E,V as M,W as B,q as P,X as V}from"./index-BFEQKHK8.js";import{C as K,a as S}from"./card-BXfIbybL.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=Q({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(z,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(D,{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=Q({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(z,{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(D,{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,U as F,V as w,B as j,T as D,I as Q,P as T,C as E,W as M,X as B,s as P,Y as V}from"./index-BxEr63go.js";import{C as K,a as S}from"./card-DASBiK00.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-Dvoz4pB9.js b/sync-server/www/assets/TypesPage-B579jwyf.js similarity index 90% rename from sync-server/www/assets/TypesPage-Dvoz4pB9.js rename to sync-server/www/assets/TypesPage-B579jwyf.js index b103e87..67f03d5 100644 --- a/sync-server/www/assets/TypesPage-Dvoz4pB9.js +++ b/sync-server/www/assets/TypesPage-B579jwyf.js @@ -1,6 +1,6 @@ -import{c as A,u as Q,b as z,e as B,r as i,f as T,j as e,B as p,P as F,K as q,l as E,k as D,T as I,C as K,M as L,D as G,F as r,I as j,N as H,S as R,O as W,p as J}from"./index-BFEQKHK8.js";import{C as U}from"./card-BXfIbybL.js";/** +import{c as Q,u as A,d as z,f as B,r as i,g as T,j as e,B as p,P as q,M as F,m as E,l as D,T as I,C as K,N as H,F as L,H as r,I as j,O as G,S as R,Q as W,q as J}from"./index-BxEr63go.js";import{C as U}from"./card-DASBiK00.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 V=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],X=A("EyeOff",V),_=["#3056d3","#7c3aed","#0891b2","#0f766e","#16a34a","#65a30d","#d97706","#dc2626","#db2777","#64748b"],Y=[{value:"text",label:"单行文本"},{value:"textarea",label:"多行文本"},{value:"number",label:"数值"},{value:"date",label:"日期"},{value:"select",label:"单选"},{value:"multiselect",label:"多选"},{value:"link",label:"关联记录"}];function te(){var v;const s=Q(),h=z(),k=B({queryKey:["types"],queryFn:J}),[u,d]=i.useState(null),[m,o]=i.useState(null),f=T({mutationFn:l=>W(l.id),onSuccess:()=>{h("success","类型已删除"),s.invalidateQueries({queryKey:["types"]}),o(null)},onError:l=>{h("error",l.message),o(null)}}),y=((v=k.data)==null?void 0:v.items)??[];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("p",{className:"text-[12px] text-ink-3",children:"每个类型可配置专属字段模板,录入表单、详情页与检索列随之联动。内置类型不可删除,可改名或停用。"}),e.jsxs(p,{variant:"primary",onClick:()=>d("new"),children:[e.jsx(F,{size:14})," 新建类型"]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:y.map(l=>e.jsxs(U,{className:"flex items-center gap-3 px-4 py-3.5",children:[e.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md",style:{backgroundColor:l.color+"18",color:l.color},children:e.jsx(q,{name:l.icon,color:l.color,size:17})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-[13.5px] font-medium text-ink-1",children:l.name}),l.is_builtin&&e.jsx(E,{color:"var(--text-3)",children:"内置"}),l.closed&&e.jsx(E,{color:"var(--warning)",children:"已停用"})]}),e.jsxs("div",{className:"num text-[12px] text-ink-3",children:[l.usage_count??0," 条记录 · ",l.form_template.length," 个类型字段"]})]}),e.jsxs("div",{className:"flex shrink-0 gap-1",children:[e.jsx(p,{variant:"ghost",size:"icon-sm","aria-label":"编辑",onClick:()=>d(l),children:e.jsx(D,{size:14})}),!l.is_builtin&&e.jsx(p,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>o(l),children:e.jsx(I,{size:14})})]})]},l.id))}),u&&e.jsx(Z,{source:u==="new"?null:u,onClose:()=>d(null),onSaved:()=>{d(null),s.invalidateQueries({queryKey:["types"]})}}),e.jsx(K,{open:!!m,title:"删除类型",content:m?"确定删除类型「"+m.name+"」吗?已有该类型的记录需先迁移。":"",onCancel:()=>o(null),onOk:()=>m&&f.mutate(m)})]})}function Z({source:s,onClose:h,onSaved:k}){const u=z(),[d,m]=i.useState((s==null?void 0:s.name)??""),[o,f]=i.useState((s==null?void 0:s.icon)??"tag"),[y,v]=i.useState((s==null?void 0:s.color)??_[0]),[l,M]=i.useState(String((s==null?void 0:s.sort)??100)),[w,O]=i.useState((s==null?void 0:s.closed)??!1),[g,N]=i.useState((s==null?void 0:s.form_template)??[]),[C,P]=i.useState(""),S=T({mutationFn:()=>{if(!d.trim())throw new Error("请填写类型名称");const t=new Set;for(const a of g){if(!a.label.trim()||!a.key.trim())throw new Error("字段标签与键名均不能为空");if(t.has(a.key))throw new Error("字段键名重复:"+a.key);if(t.add(a.key),(a.widget==="select"||a.widget==="multiselect")&&!(Array.isArray(a.options)&&a.options.length))throw new Error("字段「"+a.label+"」需要配置选项")}return L({id:s==null?void 0:s.id,name:d.trim(),icon:o,color:y,sort:Number(l)||100,form_template:g,closed:w})},onSuccess:()=>{u("success",s?"类型已更新":"类型已创建"),k()},onError:t=>P(t.message)}),c=(t,a)=>N(n=>n.map((x,b)=>b===t?{...x,...a}:x));return e.jsx(G,{open:!0,onClose:h,width:720,title:s?"编辑类型 · "+s.name:"新建类型",footer:e.jsxs(e.Fragment,{children:[C&&e.jsx("span",{className:"mr-auto text-[12px] text-danger",children:C}),e.jsx(p,{variant:"secondary",onClick:h,children:"取消"}),e.jsx(p,{variant:"primary",onClick:()=>S.mutate(),disabled:S.isPending,children:"保存"})]}),children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid grid-cols-[1fr_120px_100px] gap-3",children:[e.jsx(r,{label:"名称",required:!0,children:e.jsx(j,{value:d,onChange:t=>m(t.target.value),placeholder:"如:学科竞赛"})}),e.jsx(r,{label:"排序",children:e.jsx(j,{type:"number",className:"num",value:l,onChange:t=>M(t.target.value)})}),e.jsx(r,{label:"停用",children:e.jsxs("button",{type:"button",onClick:()=>O(t=>!t),className:"flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] transition-colors "+(w?"border-warning bg-warning-subtle text-warning":"border-line bg-surface text-ink-2"),children:[e.jsx(X,{size:13}),w?"已停用":"启用中"]})})]}),e.jsx(r,{label:"图标",children:e.jsx("div",{className:"flex flex-wrap gap-1",children:H.map(t=>e.jsx("button",{type:"button",title:t.label,className:"flex size-8 items-center justify-center rounded-md border transition-colors "+(o===t.name?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-3 hover:border-line-strong"),onClick:()=>f(t.name),children:e.jsx(q,{name:t.name,size:15,color:o===t.name?"var(--brand-text)":void 0})},t.name))})}),e.jsx(r,{label:"颜色",children:e.jsx("div",{className:"flex gap-1.5",children:_.map(t=>e.jsx("button",{type:"button",className:"size-6 rounded-md border-2 transition-transform "+(y===t?"scale-110 border-ink-1":"border-transparent hover:scale-105"),style:{backgroundColor:t},onClick:()=>v(t),"aria-label":t},t))})}),e.jsxs("div",{className:"border-t border-line pt-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[12px] font-semibold text-ink-2",children:["字段模板(",g.length,")"]}),e.jsxs(p,{size:"sm",variant:"secondary",onClick:()=>N(t=>[...t,{key:"field_"+(t.length+1),label:"",widget:"text"}]),children:[e.jsx(F,{size:13})," 添加字段"]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[g.map((t,a)=>e.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-2.5",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_130px_120px_1fr_28px] items-end gap-2",children:[e.jsx(r,{label:"标签",children:e.jsx(j,{value:t.label,onChange:n=>c(a,{label:n.target.value}),placeholder:"显示名"})}),e.jsx(r,{label:"键名",children:e.jsx(j,{value:t.key,onChange:n=>c(a,{key:n.target.value})})}),e.jsx(r,{label:"控件",children:e.jsx(R,{value:t.widget,onChange:n=>c(a,{widget:n.target.value}),options:Y})}),e.jsx(r,{label:t.widget==="number"?"单位":t.widget==="select"||t.widget==="multiselect"?"选项(逗号分隔)":"占位提示",children:e.jsx(j,{value:t.widget==="number"?t.unit??"":t.widget==="select"||t.widget==="multiselect"?Array.isArray(t.options)?t.options.join(","):"":t.placeholder??"",onChange:n=>{const x=n.target.value;t.widget==="number"?c(a,{unit:x}):t.widget==="select"||t.widget==="multiselect"?c(a,{options:x?x.split(/[,,]/).map(b=>b.trim()).filter(Boolean):[]}):c(a,{placeholder:x})}})}),e.jsx(p,{variant:"ghost",size:"icon-sm","aria-label":"删除字段",className:"mb-0.5",onClick:()=>N(n=>n.filter((x,b)=>b!==a)),children:e.jsx(I,{size:13})})]}),e.jsxs("label",{className:"mt-1.5 flex cursor-pointer items-center gap-1.5 text-[12px] text-ink-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.required,onChange:n=>c(a,{required:n.target.checked})}),"必填",t.widget==="number"&&e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"checkbox",className:"ml-2",checked:!!t.metric,onChange:n=>c(a,{metric:n.target.checked?t.key:void 0})}),"计入统计指标"]})]})]},a)),!g.length&&e.jsx("div",{className:"rounded-md border border-dashed border-line px-3 py-4 text-center text-[12px] text-ink-3",children:"该类型暂无专属字段,仅使用通用字段(标题、时间、级别、角色等)"})]})]})]})})}export{te as TypesPage}; + */const V=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],X=Q("EyeOff",V),_=["#3056d3","#7c3aed","#0891b2","#0f766e","#16a34a","#65a30d","#d97706","#dc2626","#db2777","#64748b"],Y=[{value:"text",label:"单行文本"},{value:"textarea",label:"多行文本"},{value:"number",label:"数值"},{value:"date",label:"日期"},{value:"select",label:"单选"},{value:"multiselect",label:"多选"},{value:"link",label:"关联记录"}];function te(){var v;const s=A(),h=z(),k=B({queryKey:["types"],queryFn:J}),[u,d]=i.useState(null),[m,o]=i.useState(null),f=T({mutationFn:l=>W(l.id),onSuccess:()=>{h("success","类型已删除"),s.invalidateQueries({queryKey:["types"]}),o(null)},onError:l=>{h("error",l.message),o(null)}}),y=((v=k.data)==null?void 0:v.items)??[];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("p",{className:"text-[12px] text-ink-3",children:"每个类型可配置专属字段模板,录入表单、详情页与检索列随之联动。内置类型不可删除,可改名或停用。"}),e.jsxs(p,{variant:"primary",onClick:()=>d("new"),children:[e.jsx(q,{size:14})," 新建类型"]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:y.map(l=>e.jsxs(U,{className:"flex items-center gap-3 px-4 py-3.5",children:[e.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md",style:{backgroundColor:l.color+"18",color:l.color},children:e.jsx(F,{name:l.icon,color:l.color,size:17})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-[13.5px] font-medium text-ink-1",children:l.name}),l.is_builtin&&e.jsx(E,{color:"var(--text-3)",children:"内置"}),l.closed&&e.jsx(E,{color:"var(--warning)",children:"已停用"})]}),e.jsxs("div",{className:"num text-[12px] text-ink-3",children:[l.usage_count??0," 条记录 · ",l.form_template.length," 个类型字段"]})]}),e.jsxs("div",{className:"flex shrink-0 gap-1",children:[e.jsx(p,{variant:"ghost",size:"icon-sm","aria-label":"编辑",onClick:()=>d(l),children:e.jsx(D,{size:14})}),!l.is_builtin&&e.jsx(p,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>o(l),children:e.jsx(I,{size:14})})]})]},l.id))}),u&&e.jsx(Z,{source:u==="new"?null:u,onClose:()=>d(null),onSaved:()=>{d(null),s.invalidateQueries({queryKey:["types"]})}}),e.jsx(K,{open:!!m,title:"删除类型",content:m?"确定删除类型「"+m.name+"」吗?已有该类型的记录需先迁移。":"",onCancel:()=>o(null),onOk:()=>m&&f.mutate(m)})]})}function Z({source:s,onClose:h,onSaved:k}){const u=z(),[d,m]=i.useState((s==null?void 0:s.name)??""),[o,f]=i.useState((s==null?void 0:s.icon)??"tag"),[y,v]=i.useState((s==null?void 0:s.color)??_[0]),[l,M]=i.useState(String((s==null?void 0:s.sort)??100)),[w,O]=i.useState((s==null?void 0:s.closed)??!1),[g,N]=i.useState((s==null?void 0:s.form_template)??[]),[C,P]=i.useState(""),S=T({mutationFn:()=>{if(!d.trim())throw new Error("请填写类型名称");const t=new Set;for(const a of g){if(!a.label.trim()||!a.key.trim())throw new Error("字段标签与键名均不能为空");if(t.has(a.key))throw new Error("字段键名重复:"+a.key);if(t.add(a.key),(a.widget==="select"||a.widget==="multiselect")&&!(Array.isArray(a.options)&&a.options.length))throw new Error("字段「"+a.label+"」需要配置选项")}return H({id:s==null?void 0:s.id,name:d.trim(),icon:o,color:y,sort:Number(l)||100,form_template:g,closed:w})},onSuccess:()=>{u("success",s?"类型已更新":"类型已创建"),k()},onError:t=>P(t.message)}),c=(t,a)=>N(n=>n.map((x,b)=>b===t?{...x,...a}:x));return e.jsx(L,{open:!0,onClose:h,width:720,title:s?"编辑类型 · "+s.name:"新建类型",footer:e.jsxs(e.Fragment,{children:[C&&e.jsx("span",{className:"mr-auto text-[12px] text-danger",children:C}),e.jsx(p,{variant:"secondary",onClick:h,children:"取消"}),e.jsx(p,{variant:"primary",onClick:()=>S.mutate(),disabled:S.isPending,children:"保存"})]}),children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid grid-cols-[1fr_120px_100px] gap-3",children:[e.jsx(r,{label:"名称",required:!0,children:e.jsx(j,{value:d,onChange:t=>m(t.target.value),placeholder:"如:学科竞赛"})}),e.jsx(r,{label:"排序",children:e.jsx(j,{type:"number",className:"num",value:l,onChange:t=>M(t.target.value)})}),e.jsx(r,{label:"停用",children:e.jsxs("button",{type:"button",onClick:()=>O(t=>!t),className:"flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] transition-colors "+(w?"border-warning bg-warning-subtle text-warning":"border-line bg-surface text-ink-2"),children:[e.jsx(X,{size:13}),w?"已停用":"启用中"]})})]}),e.jsx(r,{label:"图标",children:e.jsx("div",{className:"flex flex-wrap gap-1",children:G.map(t=>e.jsx("button",{type:"button",title:t.label,className:"flex size-8 items-center justify-center rounded-md border transition-colors "+(o===t.name?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-3 hover:border-line-strong"),onClick:()=>f(t.name),children:e.jsx(F,{name:t.name,size:15,color:o===t.name?"var(--brand-text)":void 0})},t.name))})}),e.jsx(r,{label:"颜色",children:e.jsx("div",{className:"flex gap-1.5",children:_.map(t=>e.jsx("button",{type:"button",className:"size-6 rounded-md border-2 transition-transform "+(y===t?"scale-110 border-ink-1":"border-transparent hover:scale-105"),style:{backgroundColor:t},onClick:()=>v(t),"aria-label":t},t))})}),e.jsxs("div",{className:"border-t border-line pt-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[12px] font-semibold text-ink-2",children:["字段模板(",g.length,")"]}),e.jsxs(p,{size:"sm",variant:"secondary",onClick:()=>N(t=>[...t,{key:"field_"+(t.length+1),label:"",widget:"text"}]),children:[e.jsx(q,{size:13})," 添加字段"]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[g.map((t,a)=>e.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-2.5",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_130px_120px_1fr_28px] items-end gap-2",children:[e.jsx(r,{label:"标签",children:e.jsx(j,{value:t.label,onChange:n=>c(a,{label:n.target.value}),placeholder:"显示名"})}),e.jsx(r,{label:"键名",children:e.jsx(j,{value:t.key,onChange:n=>c(a,{key:n.target.value})})}),e.jsx(r,{label:"控件",children:e.jsx(R,{value:t.widget,onChange:n=>c(a,{widget:n.target.value}),options:Y})}),e.jsx(r,{label:t.widget==="number"?"单位":t.widget==="select"||t.widget==="multiselect"?"选项(逗号分隔)":"占位提示",children:e.jsx(j,{value:t.widget==="number"?t.unit??"":t.widget==="select"||t.widget==="multiselect"?Array.isArray(t.options)?t.options.join(","):"":t.placeholder??"",onChange:n=>{const x=n.target.value;t.widget==="number"?c(a,{unit:x}):t.widget==="select"||t.widget==="multiselect"?c(a,{options:x?x.split(/[,,]/).map(b=>b.trim()).filter(Boolean):[]}):c(a,{placeholder:x})}})}),e.jsx(p,{variant:"ghost",size:"icon-sm","aria-label":"删除字段",className:"mb-0.5",onClick:()=>N(n=>n.filter((x,b)=>b!==a)),children:e.jsx(I,{size:13})})]}),e.jsxs("label",{className:"mt-1.5 flex cursor-pointer items-center gap-1.5 text-[12px] text-ink-2",children:[e.jsx("input",{type:"checkbox",checked:!!t.required,onChange:n=>c(a,{required:n.target.checked})}),"必填",t.widget==="number"&&e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"checkbox",className:"ml-2",checked:!!t.metric,onChange:n=>c(a,{metric:n.target.checked?t.key:void 0})}),"计入统计指标"]})]})]},a)),!g.length&&e.jsx("div",{className:"rounded-md border border-dashed border-line px-3 py-4 text-center text-[12px] text-ink-3",children:"该类型暂无专属字段,仅使用通用字段(标题、时间、级别、角色等)"})]})]})]})})}export{te as TypesPage}; diff --git a/sync-server/www/assets/card-BXfIbybL.js b/sync-server/www/assets/card-DASBiK00.js similarity index 89% rename from sync-server/www/assets/card-BXfIbybL.js rename to sync-server/www/assets/card-DASBiK00.js index 2652e47..8b231cc 100644 --- a/sync-server/www/assets/card-BXfIbybL.js +++ b/sync-server/www/assets/card-DASBiK00.js @@ -1 +1 @@ -import{j as s,a}from"./index-BFEQKHK8.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-BxEr63go.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-B60u283l.css b/sync-server/www/assets/index-B60u283l.css new file mode 100644 index 0000000..40e4f8d --- /dev/null +++ b/sync-server/www/assets/index-B60u283l.css @@ -0,0 +1 @@ +/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-tight:1.25;--leading-relaxed:1.625;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.top-0{top:0}.top-1\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.right-2{right:calc(var(--spacing) * 2)}.right-5{right:calc(var(--spacing) * 5)}.bottom-0{bottom:0}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:0}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-\[7px\]{left:7px}.z-10{z-index:10}.z-30{z-index:30}.z-50{z-index:50}.z-\[60\]{z-index:60}.z-\[70\]{z-index:70}.col-span-2{grid-column:span 2/span 2}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-3{margin-inline:calc(var(--spacing) * -3)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-\[34px\]{height:34px}.h-\[60px\]{height:60px}.h-\[72vh\]{height:72vh}.h-\[200px\]{height:200px}.h-\[220px\]{height:220px}.h-full{height:100%}.max-h-\[68vh\]{max-height:68vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[72vh\]{max-height:72vh}.max-h-\[430px\]{max-height:430px}.max-h-\[520px\]{max-height:520px}.max-h-\[calc\(100vh-260px\)\]{max-height:calc(100vh - 260px)}.min-h-0{min-height:0}.min-h-8{min-height:calc(var(--spacing) * 8)}.min-h-11{min-height:calc(var(--spacing) * 11)}.min-h-\[72px\]{min-height:72px}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-14{width:calc(var(--spacing) * 14)}.w-\[3px\]{width:3px}.w-\[32\%\]{width:32%}.w-\[52px\]{width:52px}.w-\[64px\]{width:64px}.w-\[72px\]{width:72px}.w-\[96px\]{width:96px}.w-\[110px\]{width:110px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[160px\]{width:160px}.w-\[180px\]{width:180px}.w-\[210px\]{width:210px}.w-\[220px\]{width:220px}.w-\[236px\]{width:236px}.w-\[240px\]{width:240px}.w-full{width:100%}.w-px{width:1px}.max-w-\[220px\]{max-width:220px}.max-w-\[360px\]{max-width:360px}.max-w-\[380px\]{max-width:380px}.max-w-\[880px\]{max-width:880px}.max-w-\[1080px\]{max-width:1080px}.min-w-0{min-width:0}.min-w-\[80px\]{min-width:80px}.min-w-\[120px\]{min-width:120px}.min-w-\[128px\]{min-width:128px}.min-w-\[160px\]{min-width:160px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-y{resize:vertical}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[1fr_120px_100px\]{grid-template-columns:1fr 120px 100px}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:var(--spacing)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3\.5{row-gap:calc(var(--spacing) * 3.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--border)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:12px}.rounded-md{border-radius:8px}.rounded-sm{border-radius:5px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-brand,.border-brand\/30{border-color:var(--brand)}@supports (color:color-mix(in lab,red,red)){.border-brand\/30{border-color:color-mix(in oklab,var(--brand) 30%,transparent)}}.border-danger\/30{border-color:var(--danger)}@supports (color:color-mix(in lab,red,red)){.border-danger\/30{border-color:color-mix(in oklab,var(--danger) 30%,transparent)}}.border-ink-1{border-color:var(--text-1)}.border-line{border-color:var(--border)}.border-transparent{border-color:#0000}.border-warning{border-color:var(--warning)}.bg-bg,.bg-bg\/90{background-color:var(--bg)}@supports (color:color-mix(in lab,red,red)){.bg-bg\/90{background-color:color-mix(in oklab,var(--bg) 90%,transparent)}}.bg-bg\/95{background-color:var(--bg)}@supports (color:color-mix(in lab,red,red)){.bg-bg\/95{background-color:color-mix(in oklab,var(--bg) 95%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/45{background-color:#00000073}@supports (color:color-mix(in lab,red,red)){.bg-black\/45{background-color:color-mix(in oklab,var(--color-black) 45%,transparent)}}.bg-brand{background-color:var(--brand)}.bg-brand-subtle,.bg-brand-subtle\/40{background-color:var(--brand-subtle)}@supports (color:color-mix(in lab,red,red)){.bg-brand-subtle\/40{background-color:color-mix(in oklab,var(--brand-subtle) 40%,transparent)}}.bg-danger{background-color:var(--danger)}.bg-danger-subtle{background-color:var(--danger-subtle)}.bg-line{background-color:var(--border)}.bg-success-subtle{background-color:var(--success-subtle)}.bg-surface{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-surface-3{background-color:var(--surface-3)}.bg-transparent{background-color:#0000}.bg-warning-subtle{background-color:var(--warning-subtle)}.bg-white{background-color:var(--color-white)}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\/60{--tw-gradient-from:#0009}@supports (color:color-mix(in lab,red,red)){.from-black\/60{--tw-gradient-from:color-mix(in oklab, var(--color-black) 60%, transparent)}}.from-black\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-px{padding-block:1px}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-\[6vh\]{padding-top:6vh}.pr-7{padding-right:calc(var(--spacing) * 7)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:var(--spacing)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11\.5px\]{font-size:11.5px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13\.5px\]{font-size:13.5px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[22px\]{font-size:22px}.leading-\[18px\]{--tw-leading:18px;line-height:18px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\[0\.24em\]{--tw-tracking:.24em;letter-spacing:.24em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-brand{color:var(--brand)}.text-brand-text{color:var(--brand-text)}.text-danger{color:var(--danger)}.text-ink-1{color:var(--text-1)}.text-ink-2{color:var(--text-2)}.text-ink-3{color:var(--text-3)}.text-success{color:var(--success)}.text-warning{color:var(--warning)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.opacity-60{opacity:.6}.shadow-card{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000008), 0 2px 8px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-pop{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000014), 0 16px 48px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:scale-\[1\.04\]:is(:where(.group):hover *){scale:1.04}.group-hover\:text-brand-text:is(:where(.group):hover *){color:var(--brand-text)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-ink-3::placeholder{color:var(--text-3)}.focus-within\:border-brand:focus-within{border-color:var(--brand)}@media(hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:border-brand\/40:hover{border-color:var(--brand)}@supports (color:color-mix(in lab,red,red)){.hover\:border-brand\/40:hover{border-color:color-mix(in oklab,var(--brand) 40%,transparent)}}.hover\:border-line:hover{border-color:var(--border)}.hover\:border-line-strong:hover{border-color:var(--border-strong)}.hover\:bg-brand-hover:hover{background-color:var(--brand-hover)}.hover\:bg-brand-subtle:hover{background-color:var(--brand-subtle)}.hover\:bg-danger-subtle:hover{background-color:var(--danger-subtle)}.hover\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\:bg-surface-3:hover{background-color:var(--surface-3)}.hover\:text-brand-text:hover{color:var(--brand-text)}.hover\:text-danger:hover{color:var(--danger)}.hover\:text-ink-1:hover{color:var(--text-1)}.hover\:text-ink-2:hover{color:var(--text-2)}.hover\:text-success:hover{color:var(--success)}.hover\:text-warning:hover{color:var(--warning)}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-brand:hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#3056d347);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-pop:hover{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000014), 0 16px 48px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:brightness-\[0\.97\]:hover{--tw-brightness:brightness(.97);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:border-brand:focus{border-color:var(--brand)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:bg-surface-2:active{background-color:var(--surface-2)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-45:disabled{opacity:.45}.disabled\:opacity-50:disabled{opacity:.5}@media not all and (min-width:64rem){.max-lg\:fixed{position:fixed}.max-lg\:inset-y-0{inset-block:0}.max-lg\:left-0{left:0}.max-lg\:z-40{z-index:40}.max-lg\:-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.max-lg\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.max-lg\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}@media(min-width:40rem){.sm\:-mx-6{margin-inline:calc(var(--spacing) * -6)}.sm\:ml-auto{margin-left:auto}.sm\:contents{display:contents}.sm\:flex{display:flex}.sm\:inline{display:inline}.sm\:h-14{height:calc(var(--spacing) * 14)}.sm\:w-\[100px\]{width:100px}.sm\:w-\[110px\]{width:110px}.sm\:w-\[130px\]{width:130px}.sm\:w-auto{width:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-\[1fr_130px_120px_1fr_28px\]{grid-template-columns:1fr 130px 120px 1fr 28px}.sm\:grid-cols-\[200px_1fr\]{grid-template-columns:200px 1fr}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:items-center{align-items:center}.sm\:gap-2{gap:calc(var(--spacing) * 2)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:py-0{padding-block:0}.sm\:py-4{padding-block:calc(var(--spacing) * 4)}.sm\:py-5{padding-block:calc(var(--spacing) * 5)}.sm\:pt-\[8vh\]{padding-top:8vh}}@media(min-width:48rem){.md\:block{display:block}.md\:hidden{display:none}}@media(min-width:64rem){.lg\:hidden{display:none}.lg\:w-\[280px\]{width:280px}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&_img\]\:max-w-full img{max-width:100%}.\[\&_table\]\:border-collapse table{border-collapse:collapse}.\[\&_td\]\:border td{border-style:var(--tw-border-style);border-width:1px}.\[\&_td\]\:border-line td{border-color:var(--border)}.\[\&_td\]\:px-2 td{padding-inline:calc(var(--spacing) * 2)}.\[\&_td\]\:py-1 td{padding-block:var(--spacing)}.\[\&_th\]\:border th{border-style:var(--tw-border-style);border-width:1px}.\[\&_th\]\:border-line th{border-color:var(--border)}.\[\&_th\]\:px-2 th{padding-inline:calc(var(--spacing) * 2)}.\[\&_th\]\:py-1 th{padding-block:var(--spacing)}}:root{--bg:#f3f4f6;--surface:#fff;--surface-2:#f8f9fa;--surface-3:#eceef1;--border:#e3e6ea;--border-strong:#c8cdd6;--text-1:#111318;--text-2:#3d434f;--text-3:#747c8a;--brand:#3346d3;--brand-hover:#2a3ab8;--brand-subtle:#eef1ff;--brand-text:#2a3ab8;--success:#177245;--success-subtle:#ebfaf1;--warning:#a86509;--warning-subtle:#fef8eb;--danger:#d5304f;--danger-subtle:#fef0f2;color-scheme:light}.dark{--bg:#0c0d10;--surface:#141519;--surface-2:#1a1c22;--surface-3:#23262e;--border:#262932;--border-strong:#363b47;--text-1:#e9ebf0;--text-2:#a0a8b8;--text-3:#68707e;--brand:#6d8bfa;--brand-hover:#8aa2fb;--brand-subtle:#1a2144;--brand-text:#96adfa;--success:#34d399;--success-subtle:#0d2921;--warning:#fbbf24;--warning-subtle:#2b2109;--danger:#f87171;--danger-subtle:#2d1317;color-scheme:dark}html,body,#root{height:100%}html,body{overflow-x:clip}body{-webkit-tap-highlight-color:transparent;touch-action:manipulation;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}@media(pointer:coarse){button,[role=button],a{min-height:36px}}body{background:var(--bg);color:var(--text-1);letter-spacing:.003em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-feature-settings:"cv02","cv03","cv04","cv11";font-family:Inter Variable,Inter,system-ui,-apple-system,Segoe UI Variable Text,Segoe UI,Microsoft YaHei UI,Microsoft YaHei,PingFang SC,sans-serif;font-size:14px;line-height:1.55}h1,h2,h3{letter-spacing:-.022em;text-wrap:balance}@media(max-width:640px){.hover-lift:hover{transform:none}}.num{font-variant-numeric:tabular-nums lining-nums;font-feature-settings:"tnum" 1,"lnum" 1}::selection{background:var(--brand)}@supports (color:color-mix(in lab,red,red)){::selection{background:color-mix(in srgb,var(--brand) 18%,transparent)}}*{scrollbar-width:thin;scrollbar-color:var(--text-3) transparent}@supports (color:color-mix(in lab,red,red)){*{scrollbar-color:color-mix(in srgb,var(--text-3) 30%,transparent) transparent}}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-thumb{background:var(--text-3)}@supports (color:color-mix(in lab,red,red)){::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--text-3) 25%,transparent)}}::-webkit-scrollbar-thumb{border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--text-3)}@supports (color:color-mix(in lab,red,red)){::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--text-3) 45%,transparent)}}::-webkit-scrollbar-track{background:0 0}:focus-visible{outline:2px solid var(--brand)}@supports (color:color-mix(in lab,red,red)){:focus-visible{outline:2px solid color-mix(in srgb,var(--brand) 50%,transparent)}}:focus-visible{outline-offset:2px;border-radius:inherit}.animate-in{animation:.22s cubic-bezier(.16,1,.3,1) fp-in}@keyframes fp-in{0%{opacity:0;transform:translateY(6px)scale(.98)}to{opacity:1;transform:none}}.animate-fade{animation:.3s ease-out fp-fade}@keyframes fp-fade{0%{opacity:0}to{opacity:1}}input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.hover-lift{transition:transform .2s cubic-bezier(.16,1,.3,1),box-shadow .2s}.hover-lift:hover{transform:translateY(-1px);box-shadow:0 4px 16px #00000014,0 1px 4px #0000000a}.nav-active:before{content:"";background:var(--brand);border-radius:0 3px 3px 0;width:3px;position:absolute;top:6px;bottom:6px;left:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/sync-server/www/assets/index-BFEQKHK8.js b/sync-server/www/assets/index-BxEr63go.js similarity index 99% rename from sync-server/www/assets/index-BFEQKHK8.js rename to sync-server/www/assets/index-BxEr63go.js index 6e52b27..22f117b 100644 --- a/sync-server/www/assets/index-BFEQKHK8.js +++ b/sync-server/www/assets/index-BxEr63go.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-JDr60Xk1.js","assets/card-BXfIbybL.js","assets/useChart-BGht3gc0.js","assets/echarts-BIWefrIc.js","assets/GradesPage-O03L_FsK.js","assets/TypesPage-Dvoz4pB9.js","assets/TaxonomyPage-7GdxiFCp.js","assets/AdminPage-CrZVvSas.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DiCrzien.js","assets/card-DASBiK00.js","assets/useChart-eUS_Zp3L.js","assets/echarts-BIWefrIc.js","assets/GradesPage-NB__ODNR.js","assets/TypesPage-B579jwyf.js","assets/TaxonomyPage-P178KH9X.js","assets/AdminPage-CvXqFjxQ.js"])))=>i.map(i=>d[i]); var Tp=n=>{throw TypeError(n)};var Vf=(n,r,s)=>r.has(n)||Tp("Cannot "+s);var _=(n,r,s)=>(Vf(n,r,"read from private field"),s?s.call(n):r.get(n)),ce=(n,r,s)=>r.has(n)?Tp("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),W=(n,r,s,c)=>(Vf(n,r,"write to private field"),c?c.call(n,s):r.set(n,s),s),Ee=(n,r,s)=>(Vf(n,r,"access private method"),s);var Gs=(n,r,s,c)=>({set _(f){W(n,r,f,s)},get _(){return _(n,r,c)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&c(d)}).observe(document,{childList:!0,subtree:!0});function s(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function c(f){if(f.ep)return;f.ep=!0;const h=s(f);fetch(f.href,h)}})();var N5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Og(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xf={exports:{}},Wu={};/** * @license React * react-jsx-runtime.production.js @@ -319,4 +319,4 @@ Please change the parent to Re("app_info"),v4=()=>Re("sync_status"),ic=()=>Re("type_list"),p4=n=>Re("type_upsert",n),g4=n=>Re("type_delete",{id:n}),x0=n=>Re("taxonomy_list",{kind:n}),b4=n=>Re("taxonomy_upsert",n),x4=n=>Re("taxonomy_delete",{id:n}),Fd=()=>Re("dimension_list"),S4=n=>Re("dimension_upsert",n),E4=n=>Re("dimension_delete",{id:n}),S0=(n={})=>Re("footprint_list",{query:n}),$d=n=>Re("footprint_get",{id:n}),E0=n=>Re("footprint_upsert",{item:n}),_4=n=>Re("footprint_delete",{id:n}),_0=(n={})=>Re("timeline",{query:n}),T4=n=>Re("stats_overview",{year:n}),N4=()=>Re("metric_list"),C4=n=>Re("metric_upsert",n),w4=n=>Re("metric_delete",{key:n}),j4=()=>Re("grades_overview"),z4=n=>Re("semester_upsert",n),O4=n=>Re("semester_delete",{id:n}),R4=n=>Re("course_upsert",n),A4=n=>Re("course_delete",{id:n}),M4=n=>Re("band_upsert",n),D4=n=>Re("band_delete",{id:n}),U4=n=>Re("attachment_add",n),T0=n=>Re("attachment_list",{owner_id:n}),N0=n=>Re("attachment_delete",{id:n}),Ws=n=>Re("attachment_read",{id:n});async function Sd(n,r,s){const c=new URLSearchParams({owner:String(n),name:r.name,mime:r.type||"application/octet-stream"}),f=await fetch(va()+"/sync/attachment/raw?"+c,{method:"PUT",headers:{authorization:"Bearer "+Zl(),"content-type":r.type||"application/octet-stream"},body:r}),h=await f.json().catch(()=>({ok:!1,error:"HTTP "+f.status}));if(!h.ok)throw new Error(h.error||"上传失败");const d=h.data.item;if(s)try{await Re("attachment_set_thumb",{id:d.id,thumb_b64:s})}catch{}return d}const C0=n=>Re("attachment_thumb",{id:n}),k4=()=>Re("view_list"),H4=n=>Re("view_upsert",n),q4=n=>Re("view_delete",{id:n});async function uc(n,r,s){const c=await fetch((s||va())+n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Zl()},body:JSON.stringify(r??{})}),f=await c.json().catch(()=>({ok:!1,error:"HTTP "+c.status}));if(!f.ok)throw new Error(f.error||"请求失败");return f.data}async function w0(n,r){const s=await fetch((r||va())+n,{headers:{Authorization:"Bearer "+Zl()}}),c=await s.json().catch(()=>({ok:!1,error:"HTTP "+s.status}));if(!c.ok)throw new Error(c.error||"请求失败");return c.data}const L4=n=>w0("/admin/invites",n),B4=n=>w0("/admin/users",n),Q4=(n,r)=>uc("/admin/invites/generate",{count:n},r),G4=(n,r,s)=>uc("/admin/invites/create",{code:n,remark:r},s),Y4=(n,r,s)=>uc("/admin/invites/update",{id:n,...r},s),V4=(n,r)=>uc("/admin/invites/delete",{id:n},r),X4=Object.freeze(Object.defineProperty({__proto__:null,AuthError:xd,adminCreateInvite:G4,adminDeleteInvite:V4,adminGenerateInvites:Q4,adminListInvites:L4,adminListUsers:B4,adminUpdateInvite:Y4,appInfo:y4,attachmentAdd:U4,attachmentDelete:N0,attachmentList:T0,attachmentRead:Ws,attachmentThumb:C0,attachmentUploadRaw:Sd,bandDelete:D4,bandUpsert:M4,clearToken:Kd,courseDelete:A4,courseUpsert:R4,deleteDimension:E4,deleteTaxonomy:x4,deleteType:g4,footprintDelete:_4,footprintGet:$d,footprintList:S0,footprintUpsert:E0,getServerUrl:va,getToken:Zl,gradesOverview:j4,listDimensions:Fd,listTaxonomy:x0,listTypes:ic,metricDelete:w4,metricList:N4,metricUpsert:C4,semesterDelete:O4,semesterUpsert:z4,serverLogin:Zd,serverMe:p0,serverRegister:Jd,setServerUrl:b0,setToken:Xd,statsOverview:T4,syncStatus:v4,timeline:_0,upsertDimension:S4,upsertTaxonomy:b4,upsertType:p4,viewDelete:q4,viewList:k4,viewUpsert:H4},Symbol.toStringTag,{value:"Module"}));function j0(n){var r,s,c="";if(typeof n=="string"||typeof n=="number")c+=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,tg=z0,K4=(n,r)=>s=>{var c;if((r==null?void 0:r.variants)==null)return tg(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:f,defaultVariants:h}=r,d=Object.keys(f).map(p=>{const x=s==null?void 0:s[p],g=h==null?void 0:h[p];if(x===null)return null;const N=eg(x)||eg(g);return f[p][N]}),v=s&&Object.entries(s).reduce((p,x)=>{let[g,N]=x;return N===void 0||(p[g]=N),p},{}),b=r==null||(c=r.compoundVariants)===null||c===void 0?void 0:c.reduce((p,x)=>{let{class:g,className:N,...q}=x;return Object.entries(q).every(V=>{let[k,D]=V;return Array.isArray(D)?D.includes({...h,...v}[k]):{...h,...v}[k]===D})?[...p,g,N]:p},[]);return tg(n,d,b,s==null?void 0:s.class,s==null?void 0:s.className)},Z4=(n,r)=>{const s=new Array(n.length+r.length);for(let c=0;c({classGroupId:n,validator:r}),O0=(n=new Map,r=null,s)=>({nextPart:n,validators:r,classGroupId:s}),Is="-",lg=[],F4="arbitrary..",$4=n=>{const r=W4(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:c}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return P4(d);const v=d.split(Is),b=v[0]===""&&v.length>1?1:0;return R0(v,b,r)},getConflictingClassGroupIds:(d,v)=>{if(v){const b=c[d],p=s[d];return b?p?Z4(p,b):b:p||lg}return s[d]||lg}}},R0=(n,r,s)=>{if(n.length-r===0)return s.classGroupId;const f=n[r],h=s.nextPart.get(f);if(h){const p=R0(n,r+1,h);if(p)return p}const d=s.validators;if(d===null)return;const v=r===0?n.join(Is):n.slice(r).join(Is),b=d.length;for(let p=0;pn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),s=r.indexOf(":"),c=r.slice(0,s);return c?F4+c:void 0})(),W4=n=>{const{theme:r,classGroups:s}=n;return I4(s,r)},I4=(n,r)=>{const s=O0();for(const c in n){const f=n[c];Pd(f,s,c,r)}return s},Pd=(n,r,s,c)=>{const f=n.length;for(let h=0;h{if(typeof n=="string"){t_(n,r,s);return}if(typeof n=="function"){l_(n,r,s,c);return}a_(n,r,s,c)},t_=(n,r,s)=>{const c=n===""?r:A0(r,n);c.classGroupId=s},l_=(n,r,s,c)=>{if(n_(n)){Pd(n(c),r,s,c);return}r.validators===null&&(r.validators=[]),r.validators.push(J4(s,n))},a_=(n,r,s,c)=>{const f=Object.entries(n),h=f.length;for(let d=0;d{let s=n;const c=r.split(Is),f=c.length;for(let h=0;h"isThemeGetter"in n&&n.isThemeGetter===!0,i_=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),c=Object.create(null);const f=(h,d)=>{s[h]=d,r++,r>n&&(r=0,c=s,s=Object.create(null))};return{get(h){let d=s[h];if(d!==void 0)return d;if((d=c[h])!==void 0)return f(h,d),d},set(h,d){h in s?s[h]=d:f(h,d)}}},Ed="!",ag=":",u_=[],ng=(n,r,s,c,f)=>({modifiers:n,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:c,isExternal:f}),r_=n=>{const{prefix:r,experimentalParseClassName:s}=n;let c=f=>{const h=[];let d=0,v=0,b=0,p;const x=f.length;for(let k=0;kb?p-b:void 0;return ng(h,q,N,V)};if(r){const f=r+ag,h=c;c=d=>d.startsWith(f)?h(d.slice(f.length)):ng(u_,!1,d,void 0,!0)}if(s){const f=c;c=h=>s({className:h,parseClassName:f})}return c},s_=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((s,c)=>{r.set(s,1e6+c)}),s=>{const c=[];let f=[];for(let h=0;h0&&(f.sort(),c.push(...f),f=[]),c.push(d)):f.push(d)}return f.length>0&&(f.sort(),c.push(...f)),c}},c_=n=>({cache:i_(n.cacheSize),parseClassName:r_(n),sortModifiers:s_(n),postfixLookupClassGroupIds:o_(n),...$4(n)}),o_=n=>{const r=Object.create(null),s=n.postfixLookupClassGroups;if(s)for(let c=0;c{const{parseClassName:s,getClassGroupId:c,getConflictingClassGroupIds:f,sortModifiers:h,postfixLookupClassGroupIds:d}=r,v=[],b=n.trim().split(f_);let p="";for(let x=b.length-1;x>=0;x-=1){const g=b[x],{isExternal:N,modifiers:q,hasImportantModifier:V,baseClassName:k,maybePostfixModifierPosition:D}=s(g);if(N){p=g+(p.length>0?" "+p:p);continue}let H=!!D,G;if(H){const Z=k.substring(0,D);G=c(Z);const U=G&&d[G]?c(k):void 0;U&&U!==G&&(G=U,H=!1)}else G=c(k);if(!G){if(!H){p=g+(p.length>0?" "+p:p);continue}if(G=c(k),!G){p=g+(p.length>0?" "+p:p);continue}H=!1}const X=q.length===0?"":q.length===1?q[0]:h(q).join(":"),K=V?X+Ed:X,Y=K+G;if(v.indexOf(Y)>-1)continue;v.push(Y);const oe=f(G,H);for(let Z=0;Z0?" "+p:p)}return p},h_=(...n)=>{let r=0,s,c,f="";for(;r{if(typeof n=="string")return n;let r,s="";for(let c=0;c{let s,c,f,h;const d=b=>{const p=r.reduce((x,g)=>g(x),n());return s=c_(p),c=s.cache.get,f=s.cache.set,h=v,v(b)},v=b=>{const p=c(b);if(p)return p;const x=d_(b,s);return f(b,x),x};return h=d,(...b)=>h(h_(...b))},y_=[],ct=n=>{const r=s=>s[n]||y_;return r.isThemeGetter=!0,r.themeKey=n,r},D0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,U0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,v_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,p_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,g_=/\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$/,b_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,x_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,S_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Za=n=>v_.test(n),Te=n=>!!n&&!Number.isNaN(Number(n)),Gl=n=>!!n&&Number.isInteger(Number(n)),td=n=>n.endsWith("%")&&Te(n.slice(0,-1)),ca=n=>p_.test(n),k0=()=>!0,E_=n=>g_.test(n)&&!b_.test(n),Wd=()=>!1,__=n=>x_.test(n),T_=n=>S_.test(n),N_=n=>!ae(n)&&!ne(n),C_=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)),w_=n=>an(n,L0,Wd),ae=n=>D0.test(n),jn=n=>an(n,B0,E_),ig=n=>an(n,U_,Te),j_=n=>an(n,G0,k0),z_=n=>an(n,Q0,Wd),ug=n=>an(n,H0,Wd),O_=n=>an(n,q0,T_),Xs=n=>an(n,Y0,__),ne=n=>U0.test(n),tr=n=>Yn(n,B0),R_=n=>Yn(n,Q0),rg=n=>Yn(n,H0),A_=n=>Yn(n,L0),M_=n=>Yn(n,q0),Ks=n=>Yn(n,Y0,!0),D_=n=>Yn(n,G0,!0),an=(n,r,s)=>{const c=D0.exec(n);return c?c[1]?r(c[1]):s(c[2]):!1},Yn=(n,r,s=!1)=>{const c=U0.exec(n);return c?c[1]?r(c[1]):s:!1},H0=n=>n==="position"||n==="percentage",q0=n=>n==="image"||n==="url",L0=n=>n==="length"||n==="size"||n==="bg-size",B0=n=>n==="length",U_=n=>n==="number",Q0=n=>n==="family-name",G0=n=>n==="number"||n==="weight",Y0=n=>n==="shadow",k_=()=>{const n=ct("color"),r=ct("font"),s=ct("text"),c=ct("font-weight"),f=ct("tracking"),h=ct("leading"),d=ct("breakpoint"),v=ct("container"),b=ct("spacing"),p=ct("radius"),x=ct("shadow"),g=ct("inset-shadow"),N=ct("text-shadow"),q=ct("drop-shadow"),V=ct("blur"),k=ct("perspective"),D=ct("aspect"),H=ct("ease"),G=ct("animate"),X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...K(),ne,ae],oe=()=>["auto","hidden","clip","visible","scroll"],Z=()=>["auto","contain","none"],U=()=>[ne,ae,b],$=()=>[Za,"full","auto",...U()],ye=()=>[Gl,"none","subgrid",ne,ae],Ye=()=>["auto",{span:["full",Gl,ne,ae]},Gl,ne,ae],I=()=>[Gl,"auto",ne,ae],Ne=()=>["auto","min","max","fr",ne,ae],be=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],fe=()=>["start","end","center","stretch","center-safe","end-safe"],C=()=>["auto",...U()],F=()=>[Za,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],ee=()=>[v,Za,"screen","full","dvw","lvw","svw","min","max","fit",...U()],ve=()=>[Za,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],J=()=>[n,ne,ae],Ut=()=>[...K(),rg,ug,{position:[ne,ae]}],ll=()=>["no-repeat",{repeat:["","x","y","space","round"]}],jl=()=>["auto","cover","contain",A_,w_,{size:[ne,ae]}],w=()=>[td,tr,jn],Q=()=>["","none","full",p,ne,ae],te=()=>["",Te,tr,jn],re=()=>["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"],de=()=>[Te,td,rg,ug],Me=()=>["","none",V,ne,ae],ie=()=>["none",Te,ne,ae],he=()=>["none",Te,ne,ae],Gt=()=>[Te,ne,ae],pa=()=>[Za,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ca],breakpoint:[ca],color:[k0],container:[ca],"drop-shadow":[ca],ease:["in","out","in-out"],font:[N_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ca],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ca],shadow:[ca],spacing:["px",Te],text:[ca],"text-shadow":[ca],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Za,ae,ne,D]}],container:["container"],"container-type":[{"@container":["","normal","size",ne,ae]}],"container-named":[C_],columns:[{columns:[Te,"auto",ae,ne,v]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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:oe()}],"overflow-x":[{"overflow-x":oe()}],"overflow-y":[{"overflow-y":oe()}],overscroll:[{overscroll:Z()}],"overscroll-x":[{"overscroll-x":Z()}],"overscroll-y":[{"overscroll-y":Z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Gl,"auto",ne,ae]}],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:[Te,Za,"auto","initial","none",ae]}],grow:[{grow:["",Te,ne,ae]}],shrink:[{shrink:["",Te,ne,ae]}],order:[{order:[Gl,"first","last","none",ne,ae]}],"grid-cols":[{"grid-cols":ye()}],"col-start-end":[{col:Ye()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":ye()}],"row-start-end":[{row:Ye()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ne()}],"auto-rows":[{"auto-rows":Ne()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...be(),"normal"]}],"justify-items":[{"justify-items":[...fe(),"normal"]}],"justify-self":[{"justify-self":["auto",...fe()]}],"align-content":[{content:["normal",...be()]}],"align-items":[{items:[...fe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...fe(),{baseline:["","last"]}]}],"place-content":[{"place-content":be()}],"place-items":[{"place-items":[...fe(),"baseline"]}],"place-self":[{"place-self":["auto",...fe()]}],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:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...ee()]}],"min-inline-size":[{"min-inline":["auto",...ee()]}],"max-inline-size":[{"max-inline":["none",...ee()]}],"block-size":[{block:["auto",...ve()]}],"min-block-size":[{"min-block":["auto",...ve()]}],"max-block-size":[{"max-block":["none",...ve()]}],w:[{w:[v,"screen",...F()]}],"min-w":[{"min-w":[v,"screen","none",...F()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[d]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh","none",...F()]}],"font-size":[{text:["base",s,tr,jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,D_,j_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",td,ae]}],"font-family":[{font:[R_,z_,r]}],"font-features":[{"font-features":[ae]}],"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,ne,ae]}],"line-clamp":[{"line-clamp":[Te,"none",ne,ig]}],leading:[{leading:["none",h,...U()]}],"list-image":[{"list-image":["none",ne,ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ne,ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",ne,jn]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[Te,"auto",ne,ae]}],"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:[Gl,ne,ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne,ae]}],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",ne,ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ut()}],"bg-repeat":[{bg:ll()}],"bg-size":[{bg:jl()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Gl,ne,ae],radial:["",ne,ae],conic:["",Gl,ne,ae]},M_,O_]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:w()}],"gradient-via-pos":[{via:w()}],"gradient-to-pos":[{to:w()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-bs":[{"border-bs":J()}],"border-color-be":[{"border-be":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,ne,ae]}],"outline-w":[{outline:["",Te,tr,jn]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","inner","none",x,Ks,Xs]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",g,Ks,Xs]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[Te,jn]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",N,Ks,Xs]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[Te,ne,ae]}],"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":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[ne,ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"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":K()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ut()}],"mask-repeat":[{mask:ll()}],"mask-size":[{mask:jl()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ne,ae]}],filter:[{filter:["","none",ne,ae]}],blur:[{blur:Me()}],brightness:[{brightness:[Te,ne,ae]}],contrast:[{contrast:[Te,ne,ae]}],"drop-shadow":[{"drop-shadow":["","none",q,Ks,Xs]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",Te,ne,ae]}],"hue-rotate":[{"hue-rotate":[Te,ne,ae]}],invert:[{invert:["",Te,ne,ae]}],saturate:[{saturate:[Te,ne,ae]}],sepia:[{sepia:["",Te,ne,ae]}],"backdrop-filter":[{"backdrop-filter":["","none",ne,ae]}],"backdrop-blur":[{"backdrop-blur":Me()}],"backdrop-brightness":[{"backdrop-brightness":[Te,ne,ae]}],"backdrop-contrast":[{"backdrop-contrast":[Te,ne,ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,ne,ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,ne,ae]}],"backdrop-invert":[{"backdrop-invert":["",Te,ne,ae]}],"backdrop-opacity":[{"backdrop-opacity":[Te,ne,ae]}],"backdrop-saturate":[{"backdrop-saturate":[Te,ne,ae]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,ne,ae]}],"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",ne,ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",ne,ae]}],ease:[{ease:["linear","initial",H,ne,ae]}],delay:[{delay:[Te,ne,ae]}],animate:[{animate:["none",G,ne,ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,ne,ae]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:Gt()}],"skew-x":[{"skew-x":Gt()}],"skew-y":[{"skew-y":Gt()}],transform:[{transform:[ne,ae,"","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:[Gl,ne,ae]}],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"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",ne,ae]}],"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":J()}],"scrollbar-track-color":[{"scrollbar-track":J()}],"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",ne,ae]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[Te,tr,jn,ig]}],stroke:[{stroke:["none",...J()]}],"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"]}},H_=m_(k_);function yl(...n){return H_(z0(n))}const q_=K4("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"}}),wt=E.forwardRef(function({className:r,variant:s,size:c,...f},h){return m.jsx("button",{ref:h,className:yl(q_({variant:s,size:c}),r),...f})}),V0="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",rt=E.forwardRef(function({className:r,...s},c){return m.jsx("input",{ref:c,className:yl(V0,"h-8",r),...s})}),_d=E.forwardRef(function({className:r,...s},c){return m.jsx("textarea",{ref:c,className:yl(V0,"py-2 min-h-[72px] resize-y leading-relaxed",r),...s})});function Ue({label:n,required:r,hint:s,className:c,children:f}){return m.jsxs("div",{className:yl("flex flex-col gap-1.5",c),children:[m.jsxs("label",{className:"text-[12px] font-medium text-ink-2",children:[n,r&&m.jsx("span",{className:"text-danger ml-0.5",children:"*"}),s&&m.jsx("span",{className:"text-ink-3 font-normal ml-2",children:s})]}),f]})}const hl=E.forwardRef(function({className:r,options:s,children:c,...f},h){return m.jsxs("div",{className:yl("relative",r?r.split(" ").filter(d=>/^w-|^min-w|^flex-/.test(d)).join(" "):""),children:[m.jsx("select",{ref:h,className:yl("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=>m.jsx("option",{value:d.value,children:d.label},d.value)):c}),m.jsx(K3,{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 m.jsx("span",{className:yl("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 L_({className:n,...r}){return m.jsx("span",{className:yl("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 rc({open:n,onClose:r,title:s,width:c=560,children:f,footer:h}){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?VS.createPortal(m.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-3 pt-[6vh] sm:p-6 sm:pt-[8vh]",children:[m.jsx("div",{className:"fixed inset-0 bg-black/45",onClick:r}),m.jsxs("div",{className:"animate-in relative w-full rounded-lg border border-line bg-surface shadow-pop",style:{maxWidth:c},role:"dialog",children:[m.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-line px-4",children:[m.jsx("div",{className:"text-sm font-semibold text-ink-1",children:s}),m.jsx(wt,{variant:"ghost",size:"icon-sm",onClick:r,"aria-label":"关闭",children:m.jsx(v0,{size:15})})]}),m.jsx("div",{className:"max-h-[70vh] overflow-y-auto px-3 py-3 sm:px-4 sm:py-4",children:f}),h&&m.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:h})]})]}),document.body):null}function B_({icon:n,title:r,description:s,action:c}){return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[m.jsx("div",{className:"text-ink-3",children:n??m.jsx(vE,{size:36,strokeWidth:1.5})}),m.jsx("div",{className:"text-[13px] font-medium text-ink-2",children:r}),s&&m.jsx("div",{className:"max-w-[360px] text-[12px] text-ink-3",children:s}),c&&m.jsx("div",{className:"mt-2",children:c})]})}const X0=E.createContext(()=>{});function Id(){return E.useContext(X0)}const Q_={success:m.jsx($3,{size:15,className:"text-success"}),error:m.jsx(J3,{size:15,className:"text-danger"}),info:m.jsx(gE,{size:15,className:"text-brand"})};function G_({children:n}){const[r,s]=E.useState([]),c=E.useRef(0),f=E.useCallback((h,d)=>{const v=++c.current;s(b=>[...b,{id:v,kind:h,text:d}]),setTimeout(()=>s(b=>b.filter(p=>p.id!==v)),3200)},[]);return m.jsxs(X0.Provider,{value:f,children:[n,m.jsx("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex flex-col gap-2",children:r.map(h=>m.jsxs("div",{className:yl("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:[Q_[h.kind],h.text]},h.id))})]})}function Y_({open:n,title:r,content:s,onCancel:c,onOk:f,loading:h}){return m.jsx(rc,{open:n,onClose:c,title:r,width:420,footer:m.jsxs(m.Fragment,{children:[m.jsx(wt,{variant:"secondary",onClick:c,children:"取消"}),m.jsx(wt,{variant:"danger",onClick:f,disabled:h,children:"确认"})]}),children:m.jsx("p",{className:"text-[13px] text-ink-2",children:s??"该操作不可撤销,请确认。"})})}function V_({size:n=44}){return m.jsxs("svg",{width:n,height:n,viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[m.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),m.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),m.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function X_({open:n,onClose:r,defaultUrl:s}){const c=lu(),f=Id(),[h,d]=E.useState("login"),[v,b]=E.useState(s||"https://footpr.linyux.cn"),[p,x]=E.useState(""),[g,N]=E.useState(""),[q,V]=E.useState(""),[k,D]=E.useState(""),[H,G]=E.useState(!1),X=async()=>{if(!p.trim()||!g){D("请填写账号与密码");return}let K=v.trim();K&&!K.startsWith("http")&&(K="https://"+K),G(!0),D("");try{if(h==="login")await Zd(p.trim(),g,K);else{if(!q.trim())throw new Error("请填写邀请码");await Jd(p.trim(),g,q.trim(),K)}c.invalidateQueries(),f("success",h==="login"?"已登录 · 同步已开启":"已注册登录 · 同步已开启"),r(),setTimeout(()=>window.location.reload(),300)}catch(Y){D(Y.message)}finally{G(!1)}};return n?m.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-bg/95",children:m.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[m.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[m.jsx(V_,{}),m.jsx("div",{className:"text-[17px] font-semibold tracking-tight text-ink-1",children:"足迹"}),m.jsx("div",{className:"text-[10px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),m.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[m.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(h==="login"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{d("login"),D("")},children:"登录"}),m.jsx("button",{className:"flex-1 rounded-sm px-2 py-1 transition-colors "+(h==="register"?"bg-surface font-medium text-ink-1 shadow-card":"text-ink-3"),onClick:()=>{d("register"),D("")},children:"注册"})]}),m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx(Ue,{label:"服务器地址",hint:"与网页版同一账号体系",children:m.jsx(rt,{value:v,onChange:K=>b(K.target.value),placeholder:"https://footpr.linyux.cn"})}),m.jsx(Ue,{label:"用户名",required:!0,children:m.jsx(rt,{value:p,onChange:K=>x(K.target.value),placeholder:"3-32 位字母数字-_"})}),m.jsx(Ue,{label:"密码",required:!0,children:m.jsx(rt,{type:"password",value:g,onChange:K=>N(K.target.value),placeholder:"至少 8 位"})}),h==="register"&&m.jsx(Ue,{label:"邀请码",required:!0,hint:"向管理员索取",children:m.jsx(rt,{value:q,onChange:K=>V(K.target.value),placeholder:"邀请码"})}),k&&m.jsx("div",{className:"text-[12px] text-danger",children:k}),m.jsx(wt,{variant:"primary",size:"lg",onClick:()=>void X(),disabled:H,children:H?"请稍候…":h==="login"?"登录并同步":"注册并同步"}),m.jsx("p",{className:"text-center text-[11px] text-ink-3",children:"登录后本机数据将多端同步"})]})]})}):null}const K_=[{section:"工作区",items:[{to:"/timeline",label:"时间线",icon:d0},{to:"/records",label:"记录",icon:ZE},{to:"/grades",label:"成绩",icon:m0},{to:"/dashboard",label:"统计",icon:V3}]},{section:"配置",items:[{to:"/admin",label:"管理",icon:t4},{to:"/types",label:"记录类型",icon:PE},{to:"/taxonomy",label:"字典与维度",icon:a4}]}];function Z_(){return m.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[m.jsx("defs",{children:m.jsxs("linearGradient",{id:"lg",x1:"0",y1:"0",x2:"0",y2:"26",children:[m.jsx("stop",{stopColor:"#4359e8"}),m.jsx("stop",{offset:"1",stopColor:"#2a3ab8"})]})}),m.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"7",fill:"url(#lg)"}),m.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:".95",transform:"rotate(-18 11 10)"}),m.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:".7"})]})}function J_({open:n,onClose:r}){const s=lu(),f=ml({queryKey:["me",Zl()??""],refetchOnMount:"always",queryFn:()=>p0(),enabled:!!Zl(),retry:0}).data??null,[h,d]=E.useState(!1);return m.jsxs("aside",{className:yl("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:[m.jsx(X_,{open:h,onClose:()=>d(!1),defaultUrl:"https://footpr.linyux.cn"}),m.jsxs("div",{className:"flex h-[60px] items-center gap-3 border-b border-line px-5",children:[m.jsx(Z_,{}),m.jsxs("div",{className:"leading-tight",children:[m.jsx("div",{className:"text-[15px] font-bold tracking-tight text-ink-1",children:"足迹"}),m.jsx("div",{className:"text-[9px] font-medium tracking-[0.24em] text-ink-3",children:"FOOTPRINTS"})]})]}),m.jsx("nav",{className:"flex-1 overflow-y-auto px-2.5 py-4",children:K_.map(v=>m.jsxs("div",{className:"mb-5",children:[m.jsx("div",{className:"px-2.5 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-ink-3",children:v.section}),m.jsx("div",{className:"flex flex-col gap-0.5",children:v.items.map(b=>m.jsxs(Wg,{to:b.to,onClick:r,className:({isActive:p})=>yl("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:[m.jsx(b.icon,{size:16,strokeWidth:1.8}),b.label]},b.to))})]},v.section))}),m.jsx("div",{className:"border-t border-line px-3 py-3",children:Zl()&&f?m.jsxs("div",{className:"rounded-lg bg-surface-2 px-3 py-2.5",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.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()}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"truncate text-[12px] font-semibold text-ink-1",title:f.username,children:f.username}),f.is_admin&&m.jsx("div",{className:"text-[10px] text-brand-text",children:"管理员"})]})]}),m.jsx("button",{className:"shrink-0 rounded p-1 text-ink-3 transition-colors hover:bg-surface-3 hover:text-danger",title:"退出登录",onClick:()=>{Kd(),s.clear(),window.location.reload()},children:m.jsx(CE,{size:13})})]}),m.jsxs("div",{className:"mt-1.5 flex items-center gap-1 text-[10px] text-success",children:[m.jsx(W3,{size:10}),"云端同步已开启"]})]}):m.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:[m.jsx(TE,{size:14}),"登录我的档案"]})})]})}const F_={"/timeline":{title:"时间线",sub:"按学年与月份回顾全部足迹"},"/records":{title:"记录",sub:"全部足迹的检索与管理"},"/grades":{title:"成绩",sub:"学年学科成绩 · 梯度与总览"},"/dashboard":{title:"统计",sub:"量化个人成长收获"},"/types":{title:"记录类型",sub:"类型与字段模板管理"},"/taxonomy":{title:"字典与维度",sub:"级别、角色与成长维度"}};function $_({onMenu:n}){const{pathname:r}=vl(),s=lc(),[c,f]=E.useState(""),[h,d]=E.useState(document.documentElement.classList.contains("dark")),v=F_[r]??{title:""},b=()=>{const p=!h;d(p),document.documentElement.classList.toggle("dark",p),localStorage.setItem("fp-theme",p?"dark":"light"),window.dispatchEvent(new CustomEvent("fp-theme-change"))};return m.jsxs("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b border-line bg-surface px-3 sm:gap-4 sm:px-5",children:[m.jsx(wt,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:n,"aria-label":"打开导航",children:m.jsx(jE,{size:17})}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("h1",{className:"truncate text-[15px] font-semibold leading-tight text-ink-1",children:v.title}),v.sub&&m.jsx("p",{className:"truncate text-[11px] leading-tight text-ink-3",children:v.sub})]}),m.jsxs("div",{className:"relative ml-auto hidden w-[240px] md:block lg:w-[280px]",children:[m.jsx(FE,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-3"}),m.jsx(rt,{className:"pl-8",placeholder:"搜索标题、内容、结果、标签",value:c,onChange:p=>f(p.target.value),onKeyDown:p=>{p.key==="Enter"&&c.trim()&&s("/records?q="+encodeURIComponent(c.trim()))}})]}),m.jsx(wt,{variant:"ghost",size:"icon",onClick:b,"aria-label":"切换主题",children:h?m.jsx(r4,{size:15}):m.jsx(AE,{size:15})}),m.jsxs(wt,{variant:"primary",onClick:()=>s("/records?new=1"),"aria-label":"新建记录",children:[m.jsx(YE,{size:14}),m.jsx("span",{className:"hidden sm:inline",children:"新建记录"})]})]})}function P_(){return m.jsxs("svg",{width:"44",height:"44",viewBox:"0 0 26 26",fill:"none","aria-hidden":!0,children:[m.jsx("rect",{x:"1",y:"1",width:"24",height:"24",rx:"6",fill:"var(--brand)"}),m.jsx("ellipse",{cx:"11",cy:"10",rx:"4.2",ry:"5.2",fill:"#fff",opacity:"0.95",transform:"rotate(-18 11 10)"}),m.jsx("circle",{cx:"17.5",cy:"17.5",r:"3.1",fill:"#fff",opacity:"0.7"})]})}function W_(){const[n,r]=E.useState("login"),[s,c]=E.useState(""),[f,h]=E.useState(""),[d,v]=E.useState(""),[b,p]=E.useState(""),[x,g]=E.useState(!1),N="__TAURI_INTERNALS__"in window,[q,V]=E.useState(va()),k=H=>{V(H),b0(H)},D=async()=>{if(!s.trim()||!f){p("请填写账号与密码");return}g(!0),p("");try{if(n==="login")await Zd(s.trim(),f,q);else{if(!d.trim())throw new Error("请填写邀请码");await Jd(s.trim(),f,d.trim(),q)}setTimeout(()=>window.location.reload(),200)}catch(H){p(H.message)}finally{g(!1)}};return m.jsx("div",{className:"flex h-full items-center justify-center bg-bg px-4",children:m.jsxs("div",{className:"w-full max-w-[380px] rounded-lg border border-line bg-surface p-6 shadow-pop",children:[m.jsxs("div",{className:"flex flex-col items-center gap-1.5 pb-5",children:[m.jsx(P_,{}),m.jsx("div",{className:"text-[18px] font-semibold tracking-tight text-ink-1",children:"足迹"}),m.jsx("div",{className:"text-[11px] font-medium tracking-[0.2em] text-ink-3",children:"FOOTPRINTS"})]}),m.jsxs("div",{className:"mb-4 flex rounded-md border border-line bg-surface-2 p-0.5 text-[12.5px]",children:[m.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:"登录"}),m.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:"注册"})]}),m.jsxs("div",{className:"flex flex-col gap-3",children:[N&&m.jsx(Ue,{label:"服务器地址",hint:"默认即可",children:m.jsx(rt,{value:q,onChange:H=>k(H.target.value),placeholder:"https://footpr.linyux.cn"})}),m.jsx(Ue,{label:"用户名",required:!0,children:m.jsx(rt,{value:s,onChange:H=>c(H.target.value),placeholder:"3-32 位字母数字-_",onKeyDown:H=>{H.key==="Enter"&&D()}})}),m.jsx(Ue,{label:"密码",required:!0,children:m.jsx(rt,{type:"password",value:f,onChange:H=>h(H.target.value),placeholder:"至少 8 位",onKeyDown:H=>{H.key==="Enter"&&D()}})}),n==="register"&&m.jsx(Ue,{label:"邀请码",required:!0,hint:"向管理员索取",children:m.jsx(rt,{value:d,onChange:H=>v(H.target.value),placeholder:"邀请码",onKeyDown:H=>{H.key==="Enter"&&D()}})}),b&&m.jsx("div",{className:"text-[12px] text-danger",children:b}),m.jsx(wt,{variant:"primary",size:"lg",onClick:()=>void D(),disabled:x,children:x?"请稍候…":n==="login"?"进入我的档案":"创建我的档案"}),m.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:()=>{c("demo"),h("demo1234")},children:"演示账号:demo / demo1234(点击填充)"})]})]})})}function I_(){const[n,r]=E.useState(()=>!!Zl()),[s,c]=E.useState(!1);return E.useEffect(()=>{const f=()=>r(!1);return window.addEventListener("fp-auth-required",f),()=>window.removeEventListener("fp-auth-required",f)},[]),n?m.jsx(G_,{children:m.jsxs("div",{className:"flex h-full",children:[s&&m.jsx("div",{className:"fixed inset-0 z-30 bg-black/45 lg:hidden",onClick:()=>c(!1),"aria-hidden":!0}),m.jsx(J_,{open:s,onClose:()=>c(!1)}),m.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[m.jsx($_,{onMenu:()=>c(!0)}),m.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto",children:m.jsx(sS,{})})]})]})}):m.jsx(W_,{})}const sg={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 K0({status:n}){const r=sg[n]??sg.draft;return m.jsx("span",{className:"inline-flex items-center rounded-sm px-1.5 py-px text-[11px] leading-[18px] font-medium whitespace-nowrap",style:{color:r.color,backgroundColor:r.bg},children:r.label})}const e5={国际级:"#7c3aed",国家级:"#dc2626",省市级:"#ea580c",区县级:"#2563eb",校级:"#16a34a",院级:"#0891b2"};function Z0({level:n}){return n?m.jsx(Ii,{color:e5[n]??"var(--text-3)",children:n}):null}const t5={特等奖:"#b45309",一等奖:"#b45309",二等奖:"#ea580c",三等奖:"#2563eb",优秀奖:"#64748b"};function J0({grade:n}){return n?m.jsx(Ii,{color:t5[n]??"var(--text-3)",children:n}):null}function F0({role:n}){return n?m.jsx(L_,{children:n}):null}function $0(){return m.jsx(Ii,{color:"var(--danger)",children:"负面"})}const j5=[{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:"体育"}],l5={tag:y0,"graduation-cap":m0,trophy:f4,"flask-conical":cE,briefcase:L3,network:DE,"heart-handshake":dE,palette:kE,award:U3,"file-badge":uE,star:i4,"shield-alert":IE,"book-open":H3,"code-2":eE,languages:xE,"mic-2":OE,"pen-line":LE,rocket:XE,users:h4,"building-2":Q3,dumbbell:nE};function a5({name:n,color:r,size:s=14,className:c}){const f=l5[n]??y0;return m.jsx(f,{size:s,color:r,className:c,strokeWidth:2})}const cg=new Map,n5=25*1024*1024;async function og(n){const r=cg.get(n.id);if(r)return r;const s=await Ws(n.id);return(n.size??0)<=n5&&cg.set(n.id,s),s}function fg(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 P0(n){return Uint8Array.from(atob(n),r=>r.charCodeAt(0))}function i5(n,r,s){const c=URL.createObjectURL(new Blob([P0(s)],{type:r||"application/octet-stream"})),f=document.createElement("a");f.href=c,f.download=n,f.click(),setTimeout(()=>URL.revokeObjectURL(c),6e4)}const u5={image:"图片",pdf:"PDF 文档",text:"文本文件",audio:"音频",video:"视频",docx:"Word 文档(.docx)",xlsx:"Excel 表格(.xlsx)",other:"该类型暂不支持在线预览"};function W0({att:n,onClose:r}){const[s,c]=E.useState(!1),[f,h]=E.useState(""),[d,v]=E.useState(null);E.useEffect(()=>{if(!n){v(null),h("");return}let p=!1;const x=[];return c(!0),h(""),v(null),(async()=>{try{const g=fg(n),N=n.remote_url||null;if(N&&(g==="image"||g==="pdf"||g==="audio"||g==="video")){v({kind:g,objectUrl:N}),c(!1);return}let q=n.mime??void 0,V;if(N)V=new Uint8Array(await(await fetch(N)).arrayBuffer());else{const k=await og(n);q=k.mime,V=P0(k.data_b64)}if(p)return;if(g==="text"){const k=new TextDecoder().decode(V);v({kind:g,text:k.length>4e5?k.slice(0,4e5)+` -…(已截断)`:k})}else if(g==="docx"){const D=(await(await ya(()=>import("./mammoth.browser-l1BsXqb5.js").then(H=>H.m),[])).convertToHtml({arrayBuffer:V.buffer})).value;if(p)return;v({kind:g,html:D})}else if(g==="xlsx"){const k=await ya(()=>import("./xlsx-CbTSpprj.js"),[]),D=k.read(V,{type:"array"}),H=k.utils.sheet_to_html(D.Sheets[D.SheetNames[0]]);if(p)return;v({kind:g,html:H})}else{const k=URL.createObjectURL(new Blob([V],{type:q||"application/octet-stream"}));if(p){URL.revokeObjectURL(k);return}x.push(k),v({kind:g,objectUrl:k})}}catch(g){p||h(g.message||"预览加载失败")}finally{p||c(!1)}})(),()=>{p=!0,x.forEach(g=>URL.revokeObjectURL(g))}},[n==null?void 0:n.id,n==null?void 0:n.file_name,n==null?void 0:n.remote_url]);const b=n?fg(n):"other";return m.jsxs(rc,{open:!!n,onClose:r,width:b==="image"||b==="pdf"?880:680,title:(n?"附件预览 · "+n.file_name:"附件预览")+(n?"("+u5[b]+")":""),footer:n?m.jsxs(m.Fragment,{children:[m.jsxs(wt,{variant:"secondary",className:"mr-auto",onClick:()=>{og(n).then(p=>i5(n.file_name,n.mime??void 0,p.data_b64))},children:[m.jsx(lE,{size:13})," 下载"]}),m.jsx(wt,{variant:"primary",onClick:r,children:"关闭"})]}):null,children:[s&&m.jsxs("div",{className:"flex items-center justify-center gap-2 py-16 text-[13px] text-ink-3",children:[m.jsx(EE,{className:"animate-spin",size:16})," 正在加载预览…"]}),!s&&!!f&&m.jsx("div",{className:"py-10 text-center text-[13px] text-danger",children:f}),!s&&!f&&d&&m.jsxs(m.Fragment,{children:[d.kind==="image"&&m.jsx("img",{src:d.objectUrl,alt:n==null?void 0:n.file_name,className:"mx-auto max-h-[72vh] rounded-md"}),d.kind==="pdf"&&m.jsx("iframe",{src:d.objectUrl,title:n==null?void 0:n.file_name,className:"h-[72vh] w-full rounded-md border border-line bg-white"}),d.kind==="audio"&&m.jsx("audio",{controls:!0,src:d.objectUrl,className:"w-full"}),d.kind==="video"&&m.jsx("video",{controls:!0,src:d.objectUrl,className:"max-h-[70vh] w-full rounded-md bg-black"}),d.kind==="text"&&m.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:d.text}),(d.kind==="docx"||d.kind==="xlsx")&&m.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:d.html||""}}),d.kind==="other"&&m.jsxs("div",{className:"py-10 text-center",children:[m.jsx("p",{className:"text-[13px] text-ink-2",children:"该文件类型暂不支持在线预览"}),m.jsx("p",{className:"mt-1 text-[12px] text-ink-3",children:"请点击左下角「下载」,用本地应用打开"})]})]})]})}function r5({value:n,onChange:r,placeholder:s}){const[c,f]=E.useState(""),h=()=>{const v=c.trim();v&&!n.includes(v)&&r([...n,v]),f("")},d=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),h()):v.key==="Backspace"&&!c&&n.length&&r(n.slice(0,-1))};return m.jsxs("div",{className:yl("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=>m.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,m.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==v)),children:m.jsx(v0,{size:11})})]},v)),m.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:c,placeholder:n.length?"":s??"输入后回车添加",onChange:v=>f(v.target.value),onKeyDown:d,onBlur:h})]})}function dg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function s5({fields:n,value:r,onChange:s,taxonomies:c}){if(!n.length)return null;const f=(d,v)=>s({...r,[d]:v}),h=d=>{const v=r[d.key],b=d.required&&(v==null||v==="")?"该项必填":"",p=x=>d.unit?m.jsxs("div",{className:"flex items-center gap-2",children:[x,m.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(_d,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:p(m.jsx(rt,{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 m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(rt,{type:"date",value:String(v??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(hl,{value:String(v??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...dg(d,c)]})},d.key);case"multiselect":{const x=dg(d,c),g=Array.isArray(v)?v:[];return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(N=>{const q=g.includes(N.value);return m.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(q?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,q?g.filter(V=>V!==N.value):[...g,N.value]),children:N.label},N.value)}),!x.length&&m.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return m.jsx(Ue,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:m.jsx(rt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(rt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>m.jsx("div",{className:d.widget==="textarea"?"col-span-2":"",children:h(d)},d.key))})}function hg(n){return n?n.slice(0,16).replace("T"," "):""}function c5(n,r){const s=n?n.slice(0,10):"",c=r?r.slice(0,10):"";return s&&c?s+" ~ "+c:s?s+(r===""?"":" 起"):c?"至 "+c:""}function Td(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function I0(n,r,s=480,c=.82){return new Promise((f,h)=>{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 h(new Error("canvas 不可用"));g.drawImage(d,0,0,b,p),f(x.toDataURL("image/webp",c))}catch(v){h(v instanceof Error?v:new Error(String(v)))}},d.onerror=()=>h(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function mg({items:n,pending:r,onPick:s,onDeleteSaved:c,onDeletePending:f,onOpenSaved:h,uploading:d}){const v=E.useRef(null),b=n.length+r.length;return m.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[m.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[m.jsx(Yd,{size:13}),"附件(",b,")"]}),m.jsx(wt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var p;return(p=v.current)==null?void 0:p.click()},children:d?"上传中…":"添加文件"}),m.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=""}})]}),m.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(p=>m.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[m.jsx(h0,{size:13,className:"text-ink-3 shrink-0"}),m.jsx("span",{className:"truncate "+(h?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>h==null?void 0:h(p),title:p.file_name,children:p.file_name}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Td(p.size)}),m.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>c(p.id),"aria-label":"删除附件",children:m.jsx(bd,{size:13})})]},"s"+p.id)),r.map((p,x)=>{var g;return m.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?m.jsx("img",{src:p.preview,alt:p.file_name,className:"size-7 shrink-0 rounded object-cover"}):m.jsx(mE,{size:13,className:"text-ink-3 shrink-0"}),m.jsx("span",{className:"truncate text-ink-1",children:p.file_name}),m.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Td(p.size)}),m.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:m.jsx(bd,{size:13})})]},"p"+x)}),!b&&m.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}async function yg(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)),N=document.createElement("canvas");N.width=Math.round(x.width*g),N.height=Math.round(x.height*g),(d=N.getContext("2d"))==null||d.drawImage(x,0,0,N.width,N.height);const q=await new Promise(V=>N.toBlob(V,"image/jpeg",.85));q&&q.size{const N=new FileReader;N.onload=()=>x(String(N.result||"")),N.onerror=()=>g(new Error("读取文件失败")),N.readAsDataURL(r)}),c=s.indexOf(","),f=c>=0?s.slice(c+1):s;let h;if((b=n.type)!=null&&b.startsWith("image/")&&!n.type.includes("gif"))try{h=(await I0(f,n.type)).split(",")[1]||void 0}catch{h=void 0}return{file:r,file_name:n.name,mime:r.type||void 0,size:r.size,data_b64:f,thumb_b64:h,preview:(p=n.type)!=null&&p.startsWith("image/")?URL.createObjectURL(n):void 0}}const vg={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:{}},o5=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],pg=80*1024*1024,f5=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function d5({open:n,onClose:r,footprintId:s,onSaved:c}){var Ye,I,Ne,be,fe;const f=lu(),h=Id(),[d,v]=E.useState(vg),[b,p]=E.useState([]),[x,g]=E.useState(!1),[N,q]=E.useState(null),[V,k]=E.useState(""),D=ml({queryKey:["types"],queryFn:ic,enabled:n}),H=ml({queryKey:["taxonomy-all"],queryFn:()=>x0(),enabled:n}),G=ml({queryKey:["dimensions"],queryFn:Fd,enabled:n}),X=ml({queryKey:["footprint",s],queryFn:()=>$d(s),enabled:n&&!!s}),K=ml({queryKey:["attachments",s],queryFn:()=>T0(s),enabled:n&&!!s}),Y=E.useMemo(()=>{var C;return(C=D.data)==null?void 0:C.items.find(F=>F.id===d.type_id)},[D.data,d.type_id]),oe=ml({queryKey:["parent-candidates",d.type_id],queryFn:()=>S0({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(k(""),p([]),s&&X.data){const C=X.data.item;v({type_id:C.type_id,title:C.title,organizer:C.organizer??"",start_date:(C.start_date??"").slice(0,10),end_date:(C.end_date??"").slice(0,10),status:C.status,role:C.role??"",level:C.level??"",award_grade:C.award_grade??"",rank:C.rank!=null?String(C.rank):"",polarity:C.polarity,weight:String(C.weight??3),description:C.description??"",result:C.result??"",tags:C.tags??[],dimension_ids:C.dimensions??[],group_id:C.group_id??"",parent_id:C.parent_id!=null?String(C.parent_id):"",extras:C.extras??{}})}else v(vg)},[n,s,X.data]);const Z=E.useMemo(()=>{var F,ee;const C={};for(const ve of((F=H.data)==null?void 0:F.items)??[])(C[ee=ve.kind]??(C[ee]=[])).push({value:ve.value,label:ve.value});return C},[H.data]),U=gd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const C={};for(const ve of(Y==null?void 0:Y.form_template)??[])if(ve.metric&&ve.widget==="number"){const J=d.extras[ve.key];typeof J=="number"&&!Number.isNaN(J)&&(C[ve.metric]=J)}const F={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:C},ee=await E0(F);for(const ve of b)await Sd(ee.id,ve.file,ve.thumb_b64);return ee.id},onSuccess:C=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",C]}),f.invalidateQueries({queryKey:["types"]}),h("success",s?"记录已更新":"记录已创建"),c==null||c(C),r()},onError:C=>k(C.message)}),$=(C,F)=>v(ee=>({...ee,[C]:F})),ye=gd({mutationFn:C=>N0(C),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})});return m.jsxs(rc,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:m.jsxs(m.Fragment,{children:[V&&m.jsx("span",{className:"mr-auto text-[12px] text-danger",children:V}),m.jsx(wt,{variant:"secondary",onClick:r,children:"取消"}),m.jsx(wt,{variant:"primary",onClick:()=>U.mutate(),disabled:U.isPending,children:U.isPending?"保存中…":"保存"})]}),children:[m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"类型",required:!0,children:m.jsx(hl,{value:d.type_id!=null?String(d.type_id):"",onChange:C=>$("type_id",C.target.value?Number(C.target.value):null),options:[{value:"",label:"请选择"},...(((Ye=D.data)==null?void 0:Ye.items)??[]).map(C=>({value:String(C.id),label:C.name}))]})}),m.jsx(Ue,{label:"标题",required:!0,children:m.jsx(rt,{value:d.title,onChange:C=>$("title",C.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"组织方 / 所在组织",children:m.jsx(rt,{value:d.organizer,onChange:C=>$("organizer",C.target.value),placeholder:"如:中国工业与应用数学学会"})}),m.jsx(Ue,{label:"开始日期",children:m.jsx(rt,{type:"date",value:d.start_date,onChange:C=>$("start_date",C.target.value)})}),m.jsx(Ue,{label:"结束日期",children:m.jsx(rt,{type:"date",value:d.end_date,onChange:C=>$("end_date",C.target.value)})})]}),m.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"角色",children:m.jsx(hl,{value:d.role,onChange:C=>$("role",C.target.value),options:[{value:"",label:"未设置"},...Z.role??[]]})}),m.jsx(Ue,{label:"级别",children:m.jsx(hl,{value:d.level,onChange:C=>$("level",C.target.value),options:[{value:"",label:"未设置"},...Z.level??[]]})}),m.jsx(Ue,{label:"状态",children:m.jsx(hl,{value:d.status,onChange:C=>$("status",C.target.value),options:f5})}),m.jsx(Ue,{label:"重要度",children:m.jsx(hl,{value:d.weight,onChange:C=>$("weight",C.target.value),options:[1,2,3,4,5].map(C=>({value:String(C),label:String(C)}))})})]}),m.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"奖等",children:m.jsx(hl,{value:d.award_grade,onChange:C=>$("award_grade",C.target.value),options:[{value:"",label:"未设置"},...o5.map(C=>({value:C,label:C}))]})}),m.jsx(Ue,{label:"名次",children:m.jsx(rt,{type:"number",className:"num",value:d.rank,onChange:C=>$("rank",C.target.value),placeholder:"如 2"})}),m.jsx(Ue,{label:"性质",children:m.jsx(hl,{value:d.polarity,onChange:C=>$("polarity",C.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),m.jsx(Ue,{label:"上级记录",hint:"晋升链",children:m.jsx(hl,{value:d.parent_id,onChange:C=>$("parent_id",C.target.value),options:[{value:"",label:"无"},...(((I=oe.data)==null?void 0:I.items)??[]).filter(C=>C.id!==s).map(C=>({value:String(C.id),label:C.title.slice(0,24)}))]})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"工作内容 / 描述",children:m.jsx(_d,{value:d.description,onChange:C=>$("description",C.target.value),placeholder:"具体做了什么、承担什么分工"})}),m.jsx(Ue,{label:"结果 / 产出",children:m.jsx(_d,{value:d.result,onChange:C=>$("result",C.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"标签",children:m.jsx(r5,{value:d.tags,onChange:C=>$("tags",C)})}),m.jsx(Ue,{label:"成长维度",children:m.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((Ne=G.data)==null?void 0:Ne.items)??[]).map(C=>{const F=d.dimension_ids.includes(C.id);return m.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(F?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>$("dimension_ids",F?d.dimension_ids.filter(ee=>ee!==C.id):[...d.dimension_ids,C.id]),children:C.name},C.id)}),!((be=G.data)!=null&&be.items.length)&&m.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:m.jsx(Ue,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:m.jsx(rt,{value:d.group_id,onChange:C=>$("group_id",C.target.value),placeholder:"如 g2025001(可选)"})})}),Y&&Y.form_template.length>0&&m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsxs("div",{className:"mb-3 text-[12px] font-semibold text-ink-2",children:["类型字段 · ",Y.name]}),m.jsx(s5,{fields:Y.form_template,value:d.extras,onChange:C=>$("extras",C),taxonomies:Z})]}),s?m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsx(mg,{items:((fe=K.data)==null?void 0:fe.items)??[],pending:b,uploading:x,onPick:async C=>{if(s){g(!0);try{let F=0;for(const ee of Array.from(C)){if(ee.size>pg){h("error","「"+ee.name+"」超过 80MB,已跳过");continue}const ve=await yg(ee);await Sd(s,ve.file,ve.thumb_b64),F++}F>0&&(f.invalidateQueries({queryKey:["attachments",s]}),h("success","已上传 "+F+" 个附件"))}catch(F){h("error",F.message)}finally{g(!1)}}},onDeleteSaved:C=>ye.mutate(C),onDeletePending:()=>{},onOpenSaved:C=>q(C)}),m.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)· 单个文件不超过 80MB"})]}):m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsx(mg,{items:[],pending:b,onPick:async C=>{const F=[];for(const ee of Array.from(C)){if(ee.size>pg){h("error","「"+ee.name+"」超过 80MB,已跳过");continue}F.push(await yg(ee))}p(ee=>[...ee,...F])},onDeleteSaved:()=>{},onDeletePending:C=>p(F=>F.filter((ee,ve)=>ve!==C))}),m.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]}),m.jsx(W0,{att:N,onClose:()=>q(null)})]})}const Ui=new Map;function h5({open:n,onClose:r,footprintId:s,onEdit:c}){var U,$,ye,Ye;const f=lu(),h=Id(),d=ml({queryKey:["footprint",s],queryFn:()=>$d(s),enabled:n&&!!s}),v=ml({queryKey:["types"],queryFn:ic,enabled:n}),b=ml({queryKey:["dimensions"],queryFn:Fd,enabled:n}),p=(U=d.data)==null?void 0:U.item,x=($=v.data)==null?void 0:$.items.find(I=>I.id===(p==null?void 0:p.type_id)),g=((p==null?void 0:p.dimensions)??[]).map(I=>{var Ne,be;return(be=(Ne=b.data)==null?void 0:Ne.items.find(fe=>fe.id===I))==null?void 0:be.name}).filter(Boolean),[N,q]=E.useState(!1),[V,k]=E.useState(null),D=gd({mutationFn:()=>ya(()=>Promise.resolve().then(()=>X4),void 0).then(I=>I.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),h("success","记录已删除"),q(!1),r()}}),[H,G]=E.useState({}),X=(p==null?void 0:p.attachments)??[],K=X.filter(I=>{var Ne;return(Ne=I.mime)==null?void 0:Ne.startsWith("image/")}),Y=X.filter(I=>{var Ne;return!((Ne=I.mime)!=null&&Ne.startsWith("image/"))}),oe=X.map(I=>I.id).join(",");E.useEffect(()=>{if(!n||!oe)return;let I=!1;const Ne=X.filter(be=>{var fe;return(fe=be.mime)==null?void 0:fe.startsWith("image/")});return(async()=>{for(const be of Ne){if(I)return;if(Ui.has(be.id)){G(fe=>({...fe,[be.id]:Ui.get(be.id)}));continue}if(be.remote_thumb){Ui.set(be.id,be.remote_thumb),G(fe=>({...fe,[be.id]:be.remote_thumb}));continue}try{if(be.thumb_rel_path){const fe=await C0(be.id);if(I)return;const C="data:"+(fe.mime||"image/webp")+";base64,"+fe.data_b64;Ui.set(be.id,C),G(F=>({...F,[be.id]:C}))}else{const fe=await Ws(be.id);if(I)return;const C=await I0(fe.data_b64,fe.mime||"image/png");Ui.set(be.id,C),G(F=>({...F,[be.id]:C}))}}catch{try{const fe=await Ws(be.id);if(I)return;const C="data:"+(fe.mime||"image/png")+";base64,"+fe.data_b64;Ui.set(be.id,C),G(F=>({...F,[be.id]:C}))}catch{}}}})(),()=>{I=!0}},[n,s,oe]);const Z=[];if(p&&x)for(const I of x.form_template??[]){const Ne=(p.extras??{})[I.key];if(Ne==null||Ne==="")continue;const be=Array.isArray(Ne)?Ne.join("、"):String(Ne);Z.push({label:I.label,value:I.unit?be+" "+I.unit:be})}return m.jsxs(rc,{open:n,onClose:r,width:680,title:p?p.title:"记录详情",footer:p?m.jsxs(m.Fragment,{children:[m.jsxs(wt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>q(!0),disabled:D.isPending,children:[m.jsx(bd,{size:13})," 删除"]}),m.jsx(wt,{variant:"secondary",onClick:r,children:"关闭"}),m.jsxs(wt,{variant:"primary",onClick:()=>s&&(c==null?void 0:c(s)),children:[m.jsx(QE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!p?m.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx(Ii,{color:p.type_color,children:p.type_name}),m.jsx(Z0,{level:p.level}),m.jsx(J0,{grade:p.award_grade}),m.jsx(F0,{role:p.role}),m.jsx(K0,{status:p.status}),p.polarity==="negative"&&m.jsx($0,{}),p.rank!=null&&m.jsxs(Ii,{color:"var(--text-3)",children:["第 ",p.rank," 名"]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px]",children:[m.jsx(zn,{label:"时间",value:c5(p.start_date,p.end_date)||"—"}),m.jsx(zn,{label:"组织方",value:p.organizer||"—"}),p.group_id&&m.jsx(zn,{label:"事件组",value:p.group_id}),p.parent_id!=null&&m.jsx(zn,{label:"上级记录",value:"#"+p.parent_id}),m.jsx(zn,{label:"创建于",value:hg(p.created_at)}),m.jsx(zn,{label:"更新于",value:hg(p.updated_at)})]}),p.description&&m.jsx(ki,{title:"工作内容 / 描述",children:m.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:p.description})}),p.result&&m.jsx(ki,{title:"结果 / 产出",children:m.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:p.result})}),Z.length>0&&m.jsx(ki,{title:x?"类型字段 · "+x.name:"类型字段",children:m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-2",children:Z.map(I=>m.jsx(zn,{label:I.label,value:I.value},I.label))})}),p.metrics&&Object.keys(p.metrics).length>0&&m.jsx(ki,{title:"量化指标",children:m.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(p.metrics).map(([I,Ne])=>m.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[I,": ",m.jsx("span",{className:"font-medium text-ink-1",children:Ne})]},I))})}),((((ye=p.tags)==null?void 0:ye.length)??0)>0||g.length>0)&&m.jsx(ki,{title:"标签与维度",children:m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[p.tags.map(I=>m.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:I},I)),g.map(I=>m.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:I},I))]})}),m.jsx(ki,{title:"附件("+(((Ye=p.attachments)==null?void 0:Ye.length)??0)+")",children:X.length?m.jsxs("div",{className:"flex flex-col gap-2.5",children:[K.length>0&&m.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:K.map(I=>m.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>k(I),title:"点击预览:"+I.file_name,children:[H[I.id]?m.jsx("img",{src:H[I.id],alt:I.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):m.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),m.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:I.file_name})]},I.id))}),Y.length>0&&m.jsx("div",{className:"flex flex-col gap-1",children:Y.map(I=>m.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:()=>k(I),children:[m.jsx(h0,{size:14,className:"shrink-0 text-ink-3"}),m.jsx("span",{className:"truncate text-ink-1",children:I.file_name}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Td(I.size)}),m.jsx(Yd,{size:12,className:"shrink-0 text-ink-3"})]},I.id))}),m.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)"})]}):m.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})})]}),m.jsx(W0,{att:V,onClose:()=>k(null)}),m.jsx(Y_,{open:N,title:"删除记录",content:p?"确定删除「"+p.title+"」吗?该操作不可撤销。":"",onCancel:()=>q(!1),onOk:()=>D.mutate(),loading:D.isPending})]})}function zn({label:n,value:r}){return m.jsxs("div",{className:"flex min-w-0 gap-2",children:[m.jsx("span",{className:"shrink-0 text-ink-3",children:n}),m.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function ki({title:n,children:r}){return m.jsxs("div",{children:[m.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function m5(){var Y,oe,Z;const[n,r]=E.useState(""),[s,c]=E.useState(""),[f,h]=E.useState(""),[d,v]=E.useState(""),[b,p]=E.useState(null),[x,g]=E.useState(!1),[N,q]=E.useState(null),[V,k]=E.useState(!1),D=ml({queryKey:["types"],queryFn:ic}),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]),G=ml({queryKey:["timeline",H],queryFn:()=>_0(H)}),X=E.useMemo(()=>{var $;const U=new Set;for(const ye of(($=G.data)==null?void 0:$.groups)??[])U.add(ye.year);return Array.from(U).sort((ye,Ye)=>Ye-ye)},[G.data]),K=U=>{q(U),k(!0)};return m.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[m.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[m.jsx(rt,{className:"w-[220px]",placeholder:"搜索足迹…",value:n,onChange:U=>r(U.target.value)}),m.jsx(hl,{className:"w-[130px]",value:s,onChange:U=>c(U.target.value),options:[{value:"",label:"全部类型"},...(((Y=D.data)==null?void 0:Y.items)??[]).map(U=>({value:String(U.id),label:U.name}))]}),m.jsx(hl,{className:"w-[120px]",value:f,onChange:U=>h(U.target.value),options:[{value:"",label:"全部年份"},...X.map(U=>({value:String(U),label:U+" 年"}))]}),m.jsx(hl,{className:"w-[110px]",value:d,onChange:U=>v(U.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]}),m.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((oe=G.data)==null?void 0:oe.total)??0," 条"]})]}),G.isLoading?m.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(Z=G.data)!=null&&Z.groups.length?m.jsxs("div",{className:"relative",children:[m.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),G.data.groups.map(U=>m.jsxs("section",{className:"mb-2",children:[m.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:[m.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:U.year}),m.jsxs("span",{className:"text-[12px] text-ink-3",children:[U.count," 条记录"]})]}),U.months.map($=>m.jsxs("div",{className:"mb-3",children:[m.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[$.month," 月"]}),m.jsx("div",{className:"flex flex-col gap-2",children:$.items.map(ye=>m.jsx(y5,{row:ye,onClick:()=>K(ye.id)},ye.id))})]},$.month))]},U.year))]}):m.jsx(B_,{icon:m.jsx(d0,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),m.jsx(h5,{open:V,onClose:()=>k(!1),footprintId:N,onEdit:U=>{k(!1),p(U),g(!0)}}),m.jsx(d5,{open:x,onClose:()=>g(!1),footprintId:b})]})}function y5({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return m.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:[m.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),m.jsxs("div",{className:"flex items-start gap-3",children:[m.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)]}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),m.jsx(Ii,{color:n.type_color,children:n.type_name}),m.jsx(Z0,{level:n.level}),m.jsx(J0,{grade:n.award_grade}),m.jsx(F0,{role:n.role}),m.jsx(K0,{status:n.status}),n.polarity==="negative"&&m.jsx($0,{})]}),n.organizer&&m.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&m.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)&&m.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&&m.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(c=>m.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:c},c)),n.attachment_count>0&&m.jsxs("span",{className:"inline-flex items-center gap-1",children:[m.jsx(Yd,{size:11}),n.attachment_count]})]})]}),m.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:m.jsx(a5,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const v5=E.lazy(()=>ya(()=>import("./RecordsPage-Gvh-PxIo.js"),[]).then(n=>({default:n.RecordsPage}))),p5=E.lazy(()=>ya(()=>import("./DashboardPage-JDr60Xk1.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),g5=E.lazy(()=>ya(()=>import("./GradesPage-O03L_FsK.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),b5=E.lazy(()=>ya(()=>import("./TypesPage-Dvoz4pB9.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),x5=E.lazy(()=>ya(()=>import("./TaxonomyPage-7GdxiFCp.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),S5=E.lazy(()=>ya(()=>import("./AdminPage-CrZVvSas.js"),__vite__mapDeps([7,1])).then(n=>({default:n.AdminPage})));function Hi(){return m.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function E5(){return m.jsx(oS,{children:m.jsxs(_l,{element:m.jsx(I_,{}),children:[m.jsx(_l,{path:"/",element:m.jsx(Gp,{to:"/timeline",replace:!0})}),m.jsx(_l,{path:"/timeline",element:m.jsx(m5,{})}),m.jsx(_l,{path:"/records",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(v5,{})})}),m.jsx(_l,{path:"/grades",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(g5,{})})}),m.jsx(_l,{path:"/dashboard",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(p5,{})})}),m.jsx(_l,{path:"/types",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(b5,{})})}),m.jsx(_l,{path:"/taxonomy",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(x5,{})})}),m.jsx(_l,{path:"/admin",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(S5,{})})}),m.jsx(_l,{path:"*",element:m.jsx(Gp,{to:"/timeline",replace:!0})})]})})}const _5=new p3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:0,gcTime:0}}}),gg=localStorage.getItem("fp-theme");(gg==="dark"||!gg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");function e1(){var r;const n=getComputedStyle(document.documentElement).getPropertyValue("--bg").trim();n&&((r=document.querySelector('meta[name="theme-color"]'))==null||r.setAttribute("content",n))}e1();window.addEventListener("fp-theme-change",e1);"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});r2.createRoot(document.getElementById("root")).render(m.jsx(e2.StrictMode,{children:m.jsx(XS,{client:_5,children:m.jsx(US,{children:m.jsx(E5,{})})})}));export{Td as $,O4 as A,wt as B,Y_ as C,rc as D,B_ as E,Ue as F,J0 as G,R4 as H,rt as I,j4 as J,a5 as K,Z0 as L,p4 as M,j5 as N,g4 as O,YE as P,b4 as Q,F0 as R,hl as S,bd as T,x4 as U,S4 as V,E4 as W,Fd as X,va as Y,Zl as Z,v0 as _,yl as a,Q4 as a0,G4 as a1,Y4 as a2,V4 as a3,ya as a4,B4 as a5,L4 as a6,N5 as a7,Og as a8,X4 as a9,Id as b,pe as c,C5 as d,ml as e,gd as f,c5 as g,K0 as h,hg as i,m as j,QE as k,Ii as l,h5 as m,d5 as n,_4 as o,ic as p,x0 as q,E as r,T4 as s,S0 as t,lu as u,m0 as v,M4 as w,D4 as x,A4 as y,z4 as z}; +…(已截断)`:k})}else if(g==="docx"){const D=(await(await ya(()=>import("./mammoth.browser-C7PeojK9.js").then(H=>H.m),[])).convertToHtml({arrayBuffer:V.buffer})).value;if(p)return;v({kind:g,html:D})}else if(g==="xlsx"){const k=await ya(()=>import("./xlsx-CbTSpprj.js"),[]),D=k.read(V,{type:"array"}),H=k.utils.sheet_to_html(D.Sheets[D.SheetNames[0]]);if(p)return;v({kind:g,html:H})}else{const k=URL.createObjectURL(new Blob([V],{type:q||"application/octet-stream"}));if(p){URL.revokeObjectURL(k);return}x.push(k),v({kind:g,objectUrl:k})}}catch(g){p||h(g.message||"预览加载失败")}finally{p||c(!1)}})(),()=>{p=!0,x.forEach(g=>URL.revokeObjectURL(g))}},[n==null?void 0:n.id,n==null?void 0:n.file_name,n==null?void 0:n.remote_url]);const b=n?fg(n):"other";return m.jsxs(rc,{open:!!n,onClose:r,width:b==="image"||b==="pdf"?880:680,title:(n?"附件预览 · "+n.file_name:"附件预览")+(n?"("+u5[b]+")":""),footer:n?m.jsxs(m.Fragment,{children:[m.jsxs(wt,{variant:"secondary",className:"mr-auto",onClick:()=>{og(n).then(p=>i5(n.file_name,n.mime??void 0,p.data_b64))},children:[m.jsx(lE,{size:13})," 下载"]}),m.jsx(wt,{variant:"primary",onClick:r,children:"关闭"})]}):null,children:[s&&m.jsxs("div",{className:"flex items-center justify-center gap-2 py-16 text-[13px] text-ink-3",children:[m.jsx(EE,{className:"animate-spin",size:16})," 正在加载预览…"]}),!s&&!!f&&m.jsx("div",{className:"py-10 text-center text-[13px] text-danger",children:f}),!s&&!f&&d&&m.jsxs(m.Fragment,{children:[d.kind==="image"&&m.jsx("img",{src:d.objectUrl,alt:n==null?void 0:n.file_name,className:"mx-auto max-h-[72vh] rounded-md"}),d.kind==="pdf"&&m.jsx("iframe",{src:d.objectUrl,title:n==null?void 0:n.file_name,className:"h-[72vh] w-full rounded-md border border-line bg-white"}),d.kind==="audio"&&m.jsx("audio",{controls:!0,src:d.objectUrl,className:"w-full"}),d.kind==="video"&&m.jsx("video",{controls:!0,src:d.objectUrl,className:"max-h-[70vh] w-full rounded-md bg-black"}),d.kind==="text"&&m.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:d.text}),(d.kind==="docx"||d.kind==="xlsx")&&m.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:d.html||""}}),d.kind==="other"&&m.jsxs("div",{className:"py-10 text-center",children:[m.jsx("p",{className:"text-[13px] text-ink-2",children:"该文件类型暂不支持在线预览"}),m.jsx("p",{className:"mt-1 text-[12px] text-ink-3",children:"请点击左下角「下载」,用本地应用打开"})]})]})]})}function r5({value:n,onChange:r,placeholder:s}){const[c,f]=E.useState(""),h=()=>{const v=c.trim();v&&!n.includes(v)&&r([...n,v]),f("")},d=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),h()):v.key==="Backspace"&&!c&&n.length&&r(n.slice(0,-1))};return m.jsxs("div",{className:yl("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=>m.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,m.jsx("button",{type:"button",className:"text-ink-3 hover:text-ink-1",onClick:()=>r(n.filter(b=>b!==v)),children:m.jsx(v0,{size:11})})]},v)),m.jsx("input",{className:"min-w-[80px] flex-1 border-0 bg-transparent text-[13px] outline-none placeholder:text-ink-3",value:c,placeholder:n.length?"":s??"输入后回车添加",onChange:v=>f(v.target.value),onKeyDown:d,onBlur:h})]})}function dg(n,r){return n.options?Array.isArray(n.options)?n.options.map(s=>({value:s,label:s})):r[n.options.taxonomy]??[]:[]}function s5({fields:n,value:r,onChange:s,taxonomies:c}){if(!n.length)return null;const f=(d,v)=>s({...r,[d]:v}),h=d=>{const v=r[d.key],b=d.required&&(v==null||v==="")?"该项必填":"",p=x=>d.unit?m.jsxs("div",{className:"flex items-center gap-2",children:[x,m.jsx("span",{className:"text-[12px] text-ink-3 shrink-0",children:d.unit})]}):x;switch(d.widget){case"textarea":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(_d,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);case"number":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:p(m.jsx(rt,{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 m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(rt,{type:"date",value:String(v??""),onChange:x=>f(d.key,x.target.value)})},d.key);case"select":return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(hl,{value:String(v??""),onChange:x=>f(d.key,x.target.value||void 0),options:[{value:"",label:"请选择"},...dg(d,c)]})},d.key);case"multiselect":{const x=dg(d,c),g=Array.isArray(v)?v:[];return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[x.map(N=>{const q=g.includes(N.value);return m.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(q?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>f(d.key,q?g.filter(V=>V!==N.value):[...g,N.value]),children:N.label},N.value)}),!x.length&&m.jsx("span",{className:"text-[12px] text-ink-3",children:"未配置选项"})]})},d.key)}case"link":return m.jsx(Ue,{label:d.label,required:d.required,hint:b||"关联记录功能规划中,暂以文本记录",children:m.jsx(rt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key);default:return m.jsx(Ue,{label:d.label,required:d.required,hint:b,children:m.jsx(rt,{value:String(v??""),onChange:x=>f(d.key,x.target.value),placeholder:d.placeholder})},d.key)}};return m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:n.map(d=>m.jsx("div",{className:d.widget==="textarea"?"col-span-2":"",children:h(d)},d.key))})}function hg(n){return n?n.slice(0,16).replace("T"," "):""}function c5(n,r){const s=n?n.slice(0,10):"",c=r?r.slice(0,10):"";return s&&c?s+" ~ "+c:s?s+(r===""?"":" 起"):c?"至 "+c:""}function Td(n){return n<1024?n+" B":n<1024*1024?(n/1024).toFixed(1)+" KB":(n/1024/1024).toFixed(1)+" MB"}function I0(n,r,s=480,c=.82){return new Promise((f,h)=>{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 h(new Error("canvas 不可用"));g.drawImage(d,0,0,b,p),f(x.toDataURL("image/webp",c))}catch(v){h(v instanceof Error?v:new Error(String(v)))}},d.onerror=()=>h(new Error("图片解码失败")),d.src="data:"+r+";base64,"+n})}function mg({items:n,pending:r,onPick:s,onDeleteSaved:c,onDeletePending:f,onOpenSaved:h,uploading:d}){const v=E.useRef(null),b=n.length+r.length;return m.jsxs("div",{className:"rounded-md border border-line bg-surface-2 p-3",children:[m.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-ink-2",children:[m.jsx(Yd,{size:13}),"附件(",b,")"]}),m.jsx(wt,{size:"sm",variant:"secondary",disabled:d,onClick:()=>{var p;return(p=v.current)==null?void 0:p.click()},children:d?"上传中…":"添加文件"}),m.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=""}})]}),m.jsxs("div",{className:"flex flex-col gap-1",children:[n.map(p=>m.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-surface px-2 py-1.5 text-[12px]",children:[m.jsx(h0,{size:13,className:"text-ink-3 shrink-0"}),m.jsx("span",{className:"truncate "+(h?"cursor-pointer text-ink-1 hover:text-brand-text hover:underline":"text-ink-1"),onClick:()=>h==null?void 0:h(p),title:p.file_name,children:p.file_name}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Td(p.size)}),m.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>c(p.id),"aria-label":"删除附件",children:m.jsx(bd,{size:13})})]},"s"+p.id)),r.map((p,x)=>{var g;return m.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?m.jsx("img",{src:p.preview,alt:p.file_name,className:"size-7 shrink-0 rounded object-cover"}):m.jsx(mE,{size:13,className:"text-ink-3 shrink-0"}),m.jsx("span",{className:"truncate text-ink-1",children:p.file_name}),m.jsx("span",{className:"text-[11px] text-brand-text",children:"待上传"}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Td(p.size)}),m.jsx("button",{className:"text-ink-3 hover:text-danger shrink-0",onClick:()=>f(x),"aria-label":"移除",children:m.jsx(bd,{size:13})})]},"p"+x)}),!b&&m.jsx("div",{className:"py-1 text-[12px] text-ink-3",children:"证书扫描件、照片、文档等佐证材料"})]})]})}async function yg(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)),N=document.createElement("canvas");N.width=Math.round(x.width*g),N.height=Math.round(x.height*g),(d=N.getContext("2d"))==null||d.drawImage(x,0,0,N.width,N.height);const q=await new Promise(V=>N.toBlob(V,"image/jpeg",.85));q&&q.size{const N=new FileReader;N.onload=()=>x(String(N.result||"")),N.onerror=()=>g(new Error("读取文件失败")),N.readAsDataURL(r)}),c=s.indexOf(","),f=c>=0?s.slice(c+1):s;let h;if((b=n.type)!=null&&b.startsWith("image/")&&!n.type.includes("gif"))try{h=(await I0(f,n.type)).split(",")[1]||void 0}catch{h=void 0}return{file:r,file_name:n.name,mime:r.type||void 0,size:r.size,data_b64:f,thumb_b64:h,preview:(p=n.type)!=null&&p.startsWith("image/")?URL.createObjectURL(n):void 0}}const vg={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:{}},o5=["特等奖","一等奖","二等奖","三等奖","优秀奖","无"],pg=80*1024*1024,f5=[{value:"draft",label:"草稿"},{value:"ongoing",label:"进行中"},{value:"submitted",label:"已提交待果"},{value:"finished",label:"已完结"}];function d5({open:n,onClose:r,footprintId:s,onSaved:c}){var Ye,I,Ne,be,fe;const f=lu(),h=Id(),[d,v]=E.useState(vg),[b,p]=E.useState([]),[x,g]=E.useState(!1),[N,q]=E.useState(null),[V,k]=E.useState(""),D=ml({queryKey:["types"],queryFn:ic,enabled:n}),H=ml({queryKey:["taxonomy-all"],queryFn:()=>x0(),enabled:n}),G=ml({queryKey:["dimensions"],queryFn:Fd,enabled:n}),X=ml({queryKey:["footprint",s],queryFn:()=>$d(s),enabled:n&&!!s}),K=ml({queryKey:["attachments",s],queryFn:()=>T0(s),enabled:n&&!!s}),Y=E.useMemo(()=>{var C;return(C=D.data)==null?void 0:C.items.find(F=>F.id===d.type_id)},[D.data,d.type_id]),oe=ml({queryKey:["parent-candidates",d.type_id],queryFn:()=>S0({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(k(""),p([]),s&&X.data){const C=X.data.item;v({type_id:C.type_id,title:C.title,organizer:C.organizer??"",start_date:(C.start_date??"").slice(0,10),end_date:(C.end_date??"").slice(0,10),status:C.status,role:C.role??"",level:C.level??"",award_grade:C.award_grade??"",rank:C.rank!=null?String(C.rank):"",polarity:C.polarity,weight:String(C.weight??3),description:C.description??"",result:C.result??"",tags:C.tags??[],dimension_ids:C.dimensions??[],group_id:C.group_id??"",parent_id:C.parent_id!=null?String(C.parent_id):"",extras:C.extras??{}})}else v(vg)},[n,s,X.data]);const Z=E.useMemo(()=>{var F,ee;const C={};for(const ve of((F=H.data)==null?void 0:F.items)??[])(C[ee=ve.kind]??(C[ee]=[])).push({value:ve.value,label:ve.value});return C},[H.data]),U=gd({mutationFn:async()=>{if(!d.type_id)throw new Error("请选择记录类型");if(!d.title.trim())throw new Error("请填写标题");const C={};for(const ve of(Y==null?void 0:Y.form_template)??[])if(ve.metric&&ve.widget==="number"){const J=d.extras[ve.key];typeof J=="number"&&!Number.isNaN(J)&&(C[ve.metric]=J)}const F={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:C},ee=await E0(F);for(const ve of b)await Sd(ee.id,ve.file,ve.thumb_b64);return ee.id},onSuccess:C=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),f.invalidateQueries({queryKey:["footprint"]}),f.invalidateQueries({queryKey:["attachments",C]}),f.invalidateQueries({queryKey:["types"]}),h("success",s?"记录已更新":"记录已创建"),c==null||c(C),r()},onError:C=>k(C.message)}),$=(C,F)=>v(ee=>({...ee,[C]:F})),ye=gd({mutationFn:C=>N0(C),onSuccess:()=>void f.invalidateQueries({queryKey:["attachments",s]})});return m.jsxs(rc,{open:n,onClose:r,width:760,title:s?"编辑记录":"新建记录",footer:m.jsxs(m.Fragment,{children:[V&&m.jsx("span",{className:"mr-auto text-[12px] text-danger",children:V}),m.jsx(wt,{variant:"secondary",onClick:r,children:"取消"}),m.jsx(wt,{variant:"primary",onClick:()=>U.mutate(),disabled:U.isPending,children:U.isPending?"保存中…":"保存"})]}),children:[m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[200px_1fr] gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"类型",required:!0,children:m.jsx(hl,{value:d.type_id!=null?String(d.type_id):"",onChange:C=>$("type_id",C.target.value?Number(C.target.value):null),options:[{value:"",label:"请选择"},...(((Ye=D.data)==null?void 0:Ye.items)??[]).map(C=>({value:String(C.id),label:C.name}))]})}),m.jsx(Ue,{label:"标题",required:!0,children:m.jsx(rt,{value:d.title,onChange:C=>$("title",C.target.value),placeholder:"事项名称,如:2025 全国大学生数学建模竞赛"})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"组织方 / 所在组织",children:m.jsx(rt,{value:d.organizer,onChange:C=>$("organizer",C.target.value),placeholder:"如:中国工业与应用数学学会"})}),m.jsx(Ue,{label:"开始日期",children:m.jsx(rt,{type:"date",value:d.start_date,onChange:C=>$("start_date",C.target.value)})}),m.jsx(Ue,{label:"结束日期",children:m.jsx(rt,{type:"date",value:d.end_date,onChange:C=>$("end_date",C.target.value)})})]}),m.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"角色",children:m.jsx(hl,{value:d.role,onChange:C=>$("role",C.target.value),options:[{value:"",label:"未设置"},...Z.role??[]]})}),m.jsx(Ue,{label:"级别",children:m.jsx(hl,{value:d.level,onChange:C=>$("level",C.target.value),options:[{value:"",label:"未设置"},...Z.level??[]]})}),m.jsx(Ue,{label:"状态",children:m.jsx(hl,{value:d.status,onChange:C=>$("status",C.target.value),options:f5})}),m.jsx(Ue,{label:"重要度",children:m.jsx(hl,{value:d.weight,onChange:C=>$("weight",C.target.value),options:[1,2,3,4,5].map(C=>({value:String(C),label:String(C)}))})})]}),m.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"奖等",children:m.jsx(hl,{value:d.award_grade,onChange:C=>$("award_grade",C.target.value),options:[{value:"",label:"未设置"},...o5.map(C=>({value:C,label:C}))]})}),m.jsx(Ue,{label:"名次",children:m.jsx(rt,{type:"number",className:"num",value:d.rank,onChange:C=>$("rank",C.target.value),placeholder:"如 2"})}),m.jsx(Ue,{label:"性质",children:m.jsx(hl,{value:d.polarity,onChange:C=>$("polarity",C.target.value),options:[{value:"positive",label:"正面"},{value:"negative",label:"负面"}]})}),m.jsx(Ue,{label:"上级记录",hint:"晋升链",children:m.jsx(hl,{value:d.parent_id,onChange:C=>$("parent_id",C.target.value),options:[{value:"",label:"无"},...(((I=oe.data)==null?void 0:I.items)??[]).filter(C=>C.id!==s).map(C=>({value:String(C.id),label:C.title.slice(0,24)}))]})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"工作内容 / 描述",children:m.jsx(_d,{value:d.description,onChange:C=>$("description",C.target.value),placeholder:"具体做了什么、承担什么分工"})}),m.jsx(Ue,{label:"结果 / 产出",children:m.jsx(_d,{value:d.result,onChange:C=>$("result",C.target.value),placeholder:"获奖等级、成果、最终产品等"})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-3.5",children:[m.jsx(Ue,{label:"标签",children:m.jsx(r5,{value:d.tags,onChange:C=>$("tags",C)})}),m.jsx(Ue,{label:"成长维度",children:m.jsxs("div",{className:"flex flex-wrap gap-1.5 min-h-8 items-center",children:[(((Ne=G.data)==null?void 0:Ne.items)??[]).map(C=>{const F=d.dimension_ids.includes(C.id);return m.jsx("button",{type:"button",className:"rounded-sm border px-2 py-0.5 text-[12px] transition-colors "+(F?"border-brand bg-brand-subtle text-brand-text":"border-line bg-surface text-ink-2 hover:border-line-strong"),onClick:()=>$("dimension_ids",F?d.dimension_ids.filter(ee=>ee!==C.id):[...d.dimension_ids,C.id]),children:C.name},C.id)}),!((be=G.data)!=null&&be.items.length)&&m.jsx("span",{className:"text-[12px] text-ink-3",children:"尚未配置维度(配置页可添加)"})]})})]}),m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-3",children:m.jsx(Ue,{label:"事件组 ID",hint:"同一场事件的多条记录共享",children:m.jsx(rt,{value:d.group_id,onChange:C=>$("group_id",C.target.value),placeholder:"如 g2025001(可选)"})})}),Y&&Y.form_template.length>0&&m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsxs("div",{className:"mb-3 text-[12px] font-semibold text-ink-2",children:["类型字段 · ",Y.name]}),m.jsx(s5,{fields:Y.form_template,value:d.extras,onChange:C=>$("extras",C),taxonomies:Z})]}),s?m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsx(mg,{items:((fe=K.data)==null?void 0:fe.items)??[],pending:b,uploading:x,onPick:async C=>{if(s){g(!0);try{let F=0;for(const ee of Array.from(C)){if(ee.size>pg){h("error","「"+ee.name+"」超过 80MB,已跳过");continue}const ve=await yg(ee);await Sd(s,ve.file,ve.thumb_b64),F++}F>0&&(f.invalidateQueries({queryKey:["attachments",s]}),h("success","已上传 "+F+" 个附件"))}catch(F){h("error",F.message)}finally{g(!1)}}},onDeleteSaved:C=>ye.mutate(C),onDeletePending:()=>{},onOpenSaved:C=>q(C)}),m.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"点击文件名可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)· 单个文件不超过 80MB"})]}):m.jsxs("div",{className:"border-t border-line pt-4",children:[m.jsx(mg,{items:[],pending:b,onPick:async C=>{const F=[];for(const ee of Array.from(C)){if(ee.size>pg){h("error","「"+ee.name+"」超过 80MB,已跳过");continue}F.push(await yg(ee))}p(ee=>[...ee,...F])},onDeleteSaved:()=>{},onDeletePending:C=>p(F=>F.filter((ee,ve)=>ve!==C))}),m.jsx("div",{className:"mt-1.5 text-[11px] text-ink-3",children:"保存记录时将一并上传 · 单个文件不超过 80MB"})]})]}),m.jsx(W0,{att:N,onClose:()=>q(null)})]})}const Ui=new Map;function h5({open:n,onClose:r,footprintId:s,onEdit:c}){var U,$,ye,Ye;const f=lu(),h=Id(),d=ml({queryKey:["footprint",s],queryFn:()=>$d(s),enabled:n&&!!s}),v=ml({queryKey:["types"],queryFn:ic,enabled:n}),b=ml({queryKey:["dimensions"],queryFn:Fd,enabled:n}),p=(U=d.data)==null?void 0:U.item,x=($=v.data)==null?void 0:$.items.find(I=>I.id===(p==null?void 0:p.type_id)),g=((p==null?void 0:p.dimensions)??[]).map(I=>{var Ne,be;return(be=(Ne=b.data)==null?void 0:Ne.items.find(fe=>fe.id===I))==null?void 0:be.name}).filter(Boolean),[N,q]=E.useState(!1),[V,k]=E.useState(null),D=gd({mutationFn:()=>ya(()=>Promise.resolve().then(()=>X4),void 0).then(I=>I.footprintDelete(s)),onSuccess:()=>{f.invalidateQueries({queryKey:["footprints"]}),f.invalidateQueries({queryKey:["timeline"]}),f.invalidateQueries({queryKey:["stats"]}),h("success","记录已删除"),q(!1),r()}}),[H,G]=E.useState({}),X=(p==null?void 0:p.attachments)??[],K=X.filter(I=>{var Ne;return(Ne=I.mime)==null?void 0:Ne.startsWith("image/")}),Y=X.filter(I=>{var Ne;return!((Ne=I.mime)!=null&&Ne.startsWith("image/"))}),oe=X.map(I=>I.id).join(",");E.useEffect(()=>{if(!n||!oe)return;let I=!1;const Ne=X.filter(be=>{var fe;return(fe=be.mime)==null?void 0:fe.startsWith("image/")});return(async()=>{for(const be of Ne){if(I)return;if(Ui.has(be.id)){G(fe=>({...fe,[be.id]:Ui.get(be.id)}));continue}if(be.remote_thumb){Ui.set(be.id,be.remote_thumb),G(fe=>({...fe,[be.id]:be.remote_thumb}));continue}try{if(be.thumb_rel_path){const fe=await C0(be.id);if(I)return;const C="data:"+(fe.mime||"image/webp")+";base64,"+fe.data_b64;Ui.set(be.id,C),G(F=>({...F,[be.id]:C}))}else{const fe=await Ws(be.id);if(I)return;const C=await I0(fe.data_b64,fe.mime||"image/png");Ui.set(be.id,C),G(F=>({...F,[be.id]:C}))}}catch{try{const fe=await Ws(be.id);if(I)return;const C="data:"+(fe.mime||"image/png")+";base64,"+fe.data_b64;Ui.set(be.id,C),G(F=>({...F,[be.id]:C}))}catch{}}}})(),()=>{I=!0}},[n,s,oe]);const Z=[];if(p&&x)for(const I of x.form_template??[]){const Ne=(p.extras??{})[I.key];if(Ne==null||Ne==="")continue;const be=Array.isArray(Ne)?Ne.join("、"):String(Ne);Z.push({label:I.label,value:I.unit?be+" "+I.unit:be})}return m.jsxs(rc,{open:n,onClose:r,width:680,title:p?p.title:"记录详情",footer:p?m.jsxs(m.Fragment,{children:[m.jsxs(wt,{variant:"danger-ghost",className:"mr-auto",onClick:()=>q(!0),disabled:D.isPending,children:[m.jsx(bd,{size:13})," 删除"]}),m.jsx(wt,{variant:"secondary",onClick:r,children:"关闭"}),m.jsxs(wt,{variant:"primary",onClick:()=>s&&(c==null?void 0:c(s)),children:[m.jsx(QE,{size:13})," 编辑"]})]}):null,children:[d.isLoading||!p?m.jsx("div",{className:"py-10 text-center text-[13px] text-ink-3",children:"加载中…"}):m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx(Ii,{color:p.type_color,children:p.type_name}),m.jsx(Z0,{level:p.level}),m.jsx(J0,{grade:p.award_grade}),m.jsx(F0,{role:p.role}),m.jsx(K0,{status:p.status}),p.polarity==="negative"&&m.jsx($0,{}),p.rank!=null&&m.jsxs(Ii,{color:"var(--text-3)",children:["第 ",p.rank," 名"]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 rounded-md border border-line bg-surface-2 px-3 py-2.5 text-[12.5px]",children:[m.jsx(zn,{label:"时间",value:c5(p.start_date,p.end_date)||"—"}),m.jsx(zn,{label:"组织方",value:p.organizer||"—"}),p.group_id&&m.jsx(zn,{label:"事件组",value:p.group_id}),p.parent_id!=null&&m.jsx(zn,{label:"上级记录",value:"#"+p.parent_id}),m.jsx(zn,{label:"创建于",value:hg(p.created_at)}),m.jsx(zn,{label:"更新于",value:hg(p.updated_at)})]}),p.description&&m.jsx(ki,{title:"工作内容 / 描述",children:m.jsx("p",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-ink-2",children:p.description})}),p.result&&m.jsx(ki,{title:"结果 / 产出",children:m.jsx("p",{className:"whitespace-pre-wrap rounded-md bg-success-subtle px-3 py-2 text-[13px] leading-relaxed text-success",children:p.result})}),Z.length>0&&m.jsx(ki,{title:x?"类型字段 · "+x.name:"类型字段",children:m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-2",children:Z.map(I=>m.jsx(zn,{label:I.label,value:I.value},I.label))})}),p.metrics&&Object.keys(p.metrics).length>0&&m.jsx(ki,{title:"量化指标",children:m.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(p.metrics).map(([I,Ne])=>m.jsxs("span",{className:"num rounded-sm border border-line bg-surface-2 px-2 py-0.5 text-[12px] text-ink-2",children:[I,": ",m.jsx("span",{className:"font-medium text-ink-1",children:Ne})]},I))})}),((((ye=p.tags)==null?void 0:ye.length)??0)>0||g.length>0)&&m.jsx(ki,{title:"标签与维度",children:m.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[p.tags.map(I=>m.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-0.5 text-[12px] text-ink-2",children:I},I)),g.map(I=>m.jsx("span",{className:"rounded-sm border border-brand/30 bg-brand-subtle px-1.5 py-0.5 text-[12px] text-brand-text",children:I},I))]})}),m.jsx(ki,{title:"附件("+(((Ye=p.attachments)==null?void 0:Ye.length)??0)+")",children:X.length?m.jsxs("div",{className:"flex flex-col gap-2.5",children:[K.length>0&&m.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4",children:K.map(I=>m.jsxs("button",{className:"group relative aspect-square overflow-hidden rounded-md border border-line bg-surface-2",onClick:()=>k(I),title:"点击预览:"+I.file_name,children:[H[I.id]?m.jsx("img",{src:H[I.id],alt:I.file_name,loading:"lazy",className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.04]"}):m.jsx("div",{className:"h-full w-full animate-pulse bg-surface-3"}),m.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:I.file_name})]},I.id))}),Y.length>0&&m.jsx("div",{className:"flex flex-col gap-1",children:Y.map(I=>m.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:()=>k(I),children:[m.jsx(h0,{size:14,className:"shrink-0 text-ink-3"}),m.jsx("span",{className:"truncate text-ink-1",children:I.file_name}),m.jsx("span",{className:"num ml-auto shrink-0 text-ink-3",children:Td(I.size)}),m.jsx(Yd,{size:12,className:"shrink-0 text-ink-3"})]},I.id))}),m.jsx("div",{className:"text-[11px] text-ink-3",children:"点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)"})]}):m.jsx("p",{className:"text-[12px] text-ink-3",children:"暂无佐证附件"})})]}),m.jsx(W0,{att:V,onClose:()=>k(null)}),m.jsx(Y_,{open:N,title:"删除记录",content:p?"确定删除「"+p.title+"」吗?该操作不可撤销。":"",onCancel:()=>q(!1),onOk:()=>D.mutate(),loading:D.isPending})]})}function zn({label:n,value:r}){return m.jsxs("div",{className:"flex min-w-0 gap-2",children:[m.jsx("span",{className:"shrink-0 text-ink-3",children:n}),m.jsx("span",{className:"min-w-0 truncate font-medium text-ink-1",title:r,children:r})]})}function ki({title:n,children:r}){return m.jsxs("div",{children:[m.jsx("div",{className:"mb-1.5 text-[12px] font-semibold text-ink-2",children:n}),r]})}function m5(){var Y,oe,Z;const[n,r]=E.useState(""),[s,c]=E.useState(""),[f,h]=E.useState(""),[d,v]=E.useState(""),[b,p]=E.useState(null),[x,g]=E.useState(!1),[N,q]=E.useState(null),[V,k]=E.useState(!1),D=ml({queryKey:["types"],queryFn:ic}),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]),G=ml({queryKey:["timeline",H],queryFn:()=>_0(H)}),X=E.useMemo(()=>{var $;const U=new Set;for(const ye of(($=G.data)==null?void 0:$.groups)??[])U.add(ye.year);return Array.from(U).sort((ye,Ye)=>Ye-ye)},[G.data]),K=U=>{q(U),k(!0)};return m.jsxs("div",{className:"mx-auto max-w-[880px] px-3 py-4 sm:px-6 sm:py-5",children:[m.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[m.jsx(rt,{className:"w-[220px]",placeholder:"搜索足迹…",value:n,onChange:U=>r(U.target.value)}),m.jsx(hl,{className:"w-[130px]",value:s,onChange:U=>c(U.target.value),options:[{value:"",label:"全部类型"},...(((Y=D.data)==null?void 0:Y.items)??[]).map(U=>({value:String(U.id),label:U.name}))]}),m.jsx(hl,{className:"w-[120px]",value:f,onChange:U=>h(U.target.value),options:[{value:"",label:"全部年份"},...X.map(U=>({value:String(U),label:U+" 年"}))]}),m.jsx(hl,{className:"w-[110px]",value:d,onChange:U=>v(U.target.value),options:[{value:"",label:"全部性质"},{value:"positive",label:"正面"},{value:"negative",label:"负面"}]}),m.jsxs("span",{className:"num ml-auto text-[12px] text-ink-3",children:["共 ",((oe=G.data)==null?void 0:oe.total)??0," 条"]})]}),G.isLoading?m.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"}):(Z=G.data)!=null&&Z.groups.length?m.jsxs("div",{className:"relative",children:[m.jsx("div",{className:"absolute bottom-0 left-[7px] top-0 w-px bg-line","aria-hidden":!0}),G.data.groups.map(U=>m.jsxs("section",{className:"mb-2",children:[m.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:[m.jsx("span",{className:"num text-[16px] font-semibold text-ink-1",children:U.year}),m.jsxs("span",{className:"text-[12px] text-ink-3",children:[U.count," 条记录"]})]}),U.months.map($=>m.jsxs("div",{className:"mb-3",children:[m.jsxs("div",{className:"mb-2 pl-6 text-[12px] font-medium text-ink-3",children:[$.month," 月"]}),m.jsx("div",{className:"flex flex-col gap-2",children:$.items.map(ye=>m.jsx(y5,{row:ye,onClick:()=>K(ye.id)},ye.id))})]},$.month))]},U.year))]}):m.jsx(B_,{icon:m.jsx(d0,{size:36,strokeWidth:1.5}),title:"暂无足迹",description:"点击右上角「新建记录」,开始记录你的第一段足迹。"}),m.jsx(h5,{open:V,onClose:()=>k(!1),footprintId:N,onEdit:U=>{k(!1),p(U),g(!0)}}),m.jsx(d5,{open:x,onClose:()=>g(!1),footprintId:b})]})}function y5({row:n,onClick:r}){const s=(n.start_date??n.created_at).slice(0,10);return m.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:[m.jsx("span",{className:"absolute left-0 top-3 bottom-3 w-[3px] rounded-full",style:{backgroundColor:n.type_color},"aria-hidden":!0}),m.jsxs("div",{className:"flex items-start gap-3",children:[m.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)]}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("span",{className:"text-[13.5px] font-medium text-ink-1 group-hover:text-brand-text",children:n.title}),m.jsx(Ii,{color:n.type_color,children:n.type_name}),m.jsx(Z0,{level:n.level}),m.jsx(J0,{grade:n.award_grade}),m.jsx(F0,{role:n.role}),m.jsx(K0,{status:n.status}),n.polarity==="negative"&&m.jsx($0,{})]}),n.organizer&&m.jsx("div",{className:"mt-0.5 text-[12px] text-ink-3",children:n.organizer}),n.description&&m.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)&&m.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&&m.jsxs("span",{className:"text-success",children:["结果:",n.result]}),n.tags.map(c=>m.jsx("span",{className:"rounded-sm bg-surface-3 px-1.5 py-px",children:c},c)),n.attachment_count>0&&m.jsxs("span",{className:"inline-flex items-center gap-1",children:[m.jsx(Yd,{size:11}),n.attachment_count]})]})]}),m.jsx("div",{className:"shrink-0 pt-1 text-ink-3",children:m.jsx(a5,{name:n.type_icon,color:n.type_color,size:16})})]})]})}const v5=E.lazy(()=>ya(()=>import("./RecordsPage-Btqncm1G.js"),[]).then(n=>({default:n.RecordsPage}))),p5=E.lazy(()=>ya(()=>import("./DashboardPage-DiCrzien.js"),__vite__mapDeps([0,1,2,3])).then(n=>({default:n.DashboardPage}))),g5=E.lazy(()=>ya(()=>import("./GradesPage-NB__ODNR.js"),__vite__mapDeps([4,1,2,3])).then(n=>({default:n.GradesPage}))),b5=E.lazy(()=>ya(()=>import("./TypesPage-B579jwyf.js"),__vite__mapDeps([5,1])).then(n=>({default:n.TypesPage}))),x5=E.lazy(()=>ya(()=>import("./TaxonomyPage-P178KH9X.js"),__vite__mapDeps([6,1])).then(n=>({default:n.TaxonomyPage}))),S5=E.lazy(()=>ya(()=>import("./AdminPage-CvXqFjxQ.js"),__vite__mapDeps([7,1])).then(n=>({default:n.AdminPage})));function Hi(){return m.jsx("div",{className:"py-16 text-center text-[13px] text-ink-3",children:"加载中…"})}function E5(){return m.jsx(oS,{children:m.jsxs(_l,{element:m.jsx(I_,{}),children:[m.jsx(_l,{path:"/",element:m.jsx(Gp,{to:"/timeline",replace:!0})}),m.jsx(_l,{path:"/timeline",element:m.jsx(m5,{})}),m.jsx(_l,{path:"/records",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(v5,{})})}),m.jsx(_l,{path:"/grades",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(g5,{})})}),m.jsx(_l,{path:"/dashboard",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(p5,{})})}),m.jsx(_l,{path:"/types",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(b5,{})})}),m.jsx(_l,{path:"/taxonomy",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(x5,{})})}),m.jsx(_l,{path:"/admin",element:m.jsx(E.Suspense,{fallback:m.jsx(Hi,{}),children:m.jsx(S5,{})})}),m.jsx(_l,{path:"*",element:m.jsx(Gp,{to:"/timeline",replace:!0})})]})})}const _5=new p3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0,staleTime:0,gcTime:0}}}),gg=localStorage.getItem("fp-theme");(gg==="dark"||!gg&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&document.documentElement.classList.add("dark");function e1(){var r;const n=getComputedStyle(document.documentElement).getPropertyValue("--bg").trim();n&&((r=document.querySelector('meta[name="theme-color"]'))==null||r.setAttribute("content",n))}e1();window.addEventListener("fp-theme-change",e1);"serviceWorker"in navigator&&!("__TAURI_INTERNALS__"in window)&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});r2.createRoot(document.getElementById("root")).render(m.jsx(e2.StrictMode,{children:m.jsx(XS,{client:_5,children:m.jsx(US,{children:m.jsx(E5,{})})})}));export{v0 as $,z4 as A,wt as B,Y_ as C,O4 as D,B_ as E,rc as F,J0 as G,Ue as H,rt as I,R4 as J,j4 as K,Z0 as L,a5 as M,p4 as N,j5 as O,YE as P,g4 as Q,F0 as R,hl as S,bd as T,b4 as U,x4 as V,S4 as W,E4 as X,Fd as Y,va as Z,Zl as _,yl as a,Td as a0,Q4 as a1,G4 as a2,Y4 as a3,V4 as a4,ya as a5,B4 as a6,L4 as a7,N5 as a8,Og as a9,X4 as aa,VS as b,pe as c,Id as d,C5 as e,ml as f,gd as g,c5 as h,K0 as i,m as j,hg as k,QE as l,Ii as m,h5 as n,d5 as o,_4 as p,ic as q,E as r,x0 as s,T4 as t,lu as u,S0 as v,m0 as w,M4 as x,D4 as y,A4 as z}; diff --git a/sync-server/www/assets/index-CLr4ofF5.css b/sync-server/www/assets/index-CLr4ofF5.css deleted file mode 100644 index fd840d6..0000000 --- a/sync-server/www/assets/index-CLr4ofF5.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-tight:1.25;--leading-relaxed:1.625;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.top-0{top:0}.top-1\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.right-0{right:0}.right-2{right:calc(var(--spacing) * 2)}.right-5{right:calc(var(--spacing) * 5)}.bottom-0{bottom:0}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:0}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-\[7px\]{left:7px}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[60\]{z-index:60}.z-\[70\]{z-index:70}.col-span-2{grid-column:span 2/span 2}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-3{margin-inline:calc(var(--spacing) * -3)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-\[34px\]{height:34px}.h-\[60px\]{height:60px}.h-\[72vh\]{height:72vh}.h-\[200px\]{height:200px}.h-\[220px\]{height:220px}.h-full{height:100%}.max-h-\[68vh\]{max-height:68vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[72vh\]{max-height:72vh}.max-h-\[430px\]{max-height:430px}.max-h-\[520px\]{max-height:520px}.max-h-\[calc\(100vh-260px\)\]{max-height:calc(100vh - 260px)}.min-h-0{min-height:0}.min-h-8{min-height:calc(var(--spacing) * 8)}.min-h-11{min-height:calc(var(--spacing) * 11)}.min-h-\[72px\]{min-height:72px}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-14{width:calc(var(--spacing) * 14)}.w-\[3px\]{width:3px}.w-\[32\%\]{width:32%}.w-\[52px\]{width:52px}.w-\[64px\]{width:64px}.w-\[72px\]{width:72px}.w-\[96px\]{width:96px}.w-\[110px\]{width:110px}.w-\[120px\]{width:120px}.w-\[130px\]{width:130px}.w-\[160px\]{width:160px}.w-\[180px\]{width:180px}.w-\[210px\]{width:210px}.w-\[220px\]{width:220px}.w-\[236px\]{width:236px}.w-\[240px\]{width:240px}.w-full{width:100%}.w-px{width:1px}.max-w-\[220px\]{max-width:220px}.max-w-\[360px\]{max-width:360px}.max-w-\[380px\]{max-width:380px}.max-w-\[880px\]{max-width:880px}.max-w-\[1080px\]{max-width:1080px}.min-w-0{min-width:0}.min-w-\[80px\]{min-width:80px}.min-w-\[120px\]{min-width:120px}.min-w-\[128px\]{min-width:128px}.min-w-\[160px\]{min-width:160px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-110{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[1fr_120px_100px\]{grid-template-columns:1fr 120px 100px}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:var(--spacing)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3\.5{row-gap:calc(var(--spacing) * 3.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--border)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:12px}.rounded-md{border-radius:8px}.rounded-sm{border-radius:5px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-brand,.border-brand\/30{border-color:var(--brand)}@supports (color:color-mix(in lab,red,red)){.border-brand\/30{border-color:color-mix(in oklab,var(--brand) 30%,transparent)}}.border-danger\/30{border-color:var(--danger)}@supports (color:color-mix(in lab,red,red)){.border-danger\/30{border-color:color-mix(in oklab,var(--danger) 30%,transparent)}}.border-ink-1{border-color:var(--text-1)}.border-line{border-color:var(--border)}.border-transparent{border-color:#0000}.border-warning{border-color:var(--warning)}.bg-bg,.bg-bg\/90{background-color:var(--bg)}@supports (color:color-mix(in lab,red,red)){.bg-bg\/90{background-color:color-mix(in oklab,var(--bg) 90%,transparent)}}.bg-bg\/95{background-color:var(--bg)}@supports (color:color-mix(in lab,red,red)){.bg-bg\/95{background-color:color-mix(in oklab,var(--bg) 95%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/45{background-color:#00000073}@supports (color:color-mix(in lab,red,red)){.bg-black\/45{background-color:color-mix(in oklab,var(--color-black) 45%,transparent)}}.bg-brand{background-color:var(--brand)}.bg-brand-subtle,.bg-brand-subtle\/40{background-color:var(--brand-subtle)}@supports (color:color-mix(in lab,red,red)){.bg-brand-subtle\/40{background-color:color-mix(in oklab,var(--brand-subtle) 40%,transparent)}}.bg-danger{background-color:var(--danger)}.bg-danger-subtle{background-color:var(--danger-subtle)}.bg-line{background-color:var(--border)}.bg-success-subtle{background-color:var(--success-subtle)}.bg-surface{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-surface-3{background-color:var(--surface-3)}.bg-transparent{background-color:#0000}.bg-warning-subtle{background-color:var(--warning-subtle)}.bg-white{background-color:var(--color-white)}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\/60{--tw-gradient-from:#0009}@supports (color:color-mix(in lab,red,red)){.from-black\/60{--tw-gradient-from:color-mix(in oklab, var(--color-black) 60%, transparent)}}.from-black\/60{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-px{padding-block:1px}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-\[6vh\]{padding-top:6vh}.pr-7{padding-right:calc(var(--spacing) * 7)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:var(--spacing)}.pb-1\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11\.5px\]{font-size:11.5px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13\.5px\]{font-size:13.5px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[22px\]{font-size:22px}.leading-\[18px\]{--tw-leading:18px;line-height:18px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.08em\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\[0\.24em\]{--tw-tracking:.24em;letter-spacing:.24em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-brand{color:var(--brand)}.text-brand-text{color:var(--brand-text)}.text-danger{color:var(--danger)}.text-ink-1{color:var(--text-1)}.text-ink-2{color:var(--text-2)}.text-ink-3{color:var(--text-3)}.text-success{color:var(--success)}.text-warning{color:var(--warning)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.opacity-60{opacity:.6}.shadow-card{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000008), 0 2px 8px var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-pop{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000014), 0 16px 48px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:scale-\[1\.04\]:is(:where(.group):hover *){scale:1.04}.group-hover\:text-brand-text:is(:where(.group):hover *){color:var(--brand-text)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-ink-3::placeholder{color:var(--text-3)}.focus-within\:border-brand:focus-within{border-color:var(--brand)}@media(hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:border-brand\/40:hover{border-color:var(--brand)}@supports (color:color-mix(in lab,red,red)){.hover\:border-brand\/40:hover{border-color:color-mix(in oklab,var(--brand) 40%,transparent)}}.hover\:border-line:hover{border-color:var(--border)}.hover\:border-line-strong:hover{border-color:var(--border-strong)}.hover\:bg-brand-hover:hover{background-color:var(--brand-hover)}.hover\:bg-brand-subtle:hover{background-color:var(--brand-subtle)}.hover\:bg-danger-subtle:hover{background-color:var(--danger-subtle)}.hover\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\:bg-surface-3:hover{background-color:var(--surface-3)}.hover\:text-brand-text:hover{color:var(--brand-text)}.hover\:text-danger:hover{color:var(--danger)}.hover\:text-ink-1:hover{color:var(--text-1)}.hover\:text-ink-2:hover{color:var(--text-2)}.hover\:text-success:hover{color:var(--success)}.hover\:text-warning:hover{color:var(--warning)}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-brand:hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#3056d347);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-pop:hover{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000014), 0 16px 48px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:brightness-\[0\.97\]:hover{--tw-brightness:brightness(.97);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:border-brand:focus{border-color:var(--brand)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:bg-surface-2:active{background-color:var(--surface-2)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-45:disabled{opacity:.45}.disabled\:opacity-50:disabled{opacity:.5}@media not all and (min-width:64rem){.max-lg\:fixed{position:fixed}.max-lg\:inset-y-0{inset-block:0}.max-lg\:left-0{left:0}.max-lg\:z-40{z-index:40}.max-lg\:-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.max-lg\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.max-lg\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}@media(min-width:40rem){.sm\:-mx-6{margin-inline:calc(var(--spacing) * -6)}.sm\:ml-auto{margin-left:auto}.sm\:contents{display:contents}.sm\:flex{display:flex}.sm\:inline{display:inline}.sm\:h-14{height:calc(var(--spacing) * 14)}.sm\:w-\[100px\]{width:100px}.sm\:w-\[110px\]{width:110px}.sm\:w-\[130px\]{width:130px}.sm\:w-auto{width:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-\[1fr_130px_120px_1fr_28px\]{grid-template-columns:1fr 130px 120px 1fr 28px}.sm\:grid-cols-\[200px_1fr\]{grid-template-columns:200px 1fr}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:items-center{align-items:center}.sm\:gap-2{gap:calc(var(--spacing) * 2)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:py-0{padding-block:0}.sm\:py-4{padding-block:calc(var(--spacing) * 4)}.sm\:py-5{padding-block:calc(var(--spacing) * 5)}.sm\:pt-\[8vh\]{padding-top:8vh}}@media(min-width:48rem){.md\:block{display:block}.md\:hidden{display:none}}@media(min-width:64rem){.lg\:hidden{display:none}.lg\:w-\[280px\]{width:280px}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&_img\]\:max-w-full img{max-width:100%}.\[\&_table\]\:border-collapse table{border-collapse:collapse}.\[\&_td\]\:border td{border-style:var(--tw-border-style);border-width:1px}.\[\&_td\]\:border-line td{border-color:var(--border)}.\[\&_td\]\:px-2 td{padding-inline:calc(var(--spacing) * 2)}.\[\&_td\]\:py-1 td{padding-block:var(--spacing)}.\[\&_th\]\:border th{border-style:var(--tw-border-style);border-width:1px}.\[\&_th\]\:border-line th{border-color:var(--border)}.\[\&_th\]\:px-2 th{padding-inline:calc(var(--spacing) * 2)}.\[\&_th\]\:py-1 th{padding-block:var(--spacing)}}:root{--bg:#f3f4f6;--surface:#fff;--surface-2:#f8f9fa;--surface-3:#eceef1;--border:#e3e6ea;--border-strong:#c8cdd6;--text-1:#111318;--text-2:#3d434f;--text-3:#747c8a;--brand:#3346d3;--brand-hover:#2a3ab8;--brand-subtle:#eef1ff;--brand-text:#2a3ab8;--success:#177245;--success-subtle:#ebfaf1;--warning:#a86509;--warning-subtle:#fef8eb;--danger:#d5304f;--danger-subtle:#fef0f2;color-scheme:light}.dark{--bg:#0c0d10;--surface:#141519;--surface-2:#1a1c22;--surface-3:#23262e;--border:#262932;--border-strong:#363b47;--text-1:#e9ebf0;--text-2:#a0a8b8;--text-3:#68707e;--brand:#6d8bfa;--brand-hover:#8aa2fb;--brand-subtle:#1a2144;--brand-text:#96adfa;--success:#34d399;--success-subtle:#0d2921;--warning:#fbbf24;--warning-subtle:#2b2109;--danger:#f87171;--danger-subtle:#2d1317;color-scheme:dark}html,body,#root{height:100%}html,body{overflow-x:clip}body{-webkit-tap-highlight-color:transparent;touch-action:manipulation;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}@media(pointer:coarse){button,[role=button],a{min-height:36px}}body{background:var(--bg);color:var(--text-1);letter-spacing:.003em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-feature-settings:"cv02","cv03","cv04","cv11";font-family:Inter Variable,Inter,system-ui,-apple-system,Segoe UI Variable Text,Segoe UI,Microsoft YaHei UI,Microsoft YaHei,PingFang SC,sans-serif;font-size:14px;line-height:1.55}h1,h2,h3{letter-spacing:-.022em;text-wrap:balance}@media(max-width:640px){.hover-lift:hover{transform:none}}.num{font-variant-numeric:tabular-nums lining-nums;font-feature-settings:"tnum" 1,"lnum" 1}::selection{background:var(--brand)}@supports (color:color-mix(in lab,red,red)){::selection{background:color-mix(in srgb,var(--brand) 18%,transparent)}}*{scrollbar-width:thin;scrollbar-color:var(--text-3) transparent}@supports (color:color-mix(in lab,red,red)){*{scrollbar-color:color-mix(in srgb,var(--text-3) 30%,transparent) transparent}}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-thumb{background:var(--text-3)}@supports (color:color-mix(in lab,red,red)){::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--text-3) 25%,transparent)}}::-webkit-scrollbar-thumb{border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--text-3)}@supports (color:color-mix(in lab,red,red)){::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--text-3) 45%,transparent)}}::-webkit-scrollbar-track{background:0 0}:focus-visible{outline:2px solid var(--brand)}@supports (color:color-mix(in lab,red,red)){:focus-visible{outline:2px solid color-mix(in srgb,var(--brand) 50%,transparent)}}:focus-visible{outline-offset:2px;border-radius:inherit}.animate-in{animation:.22s cubic-bezier(.16,1,.3,1) fp-in}@keyframes fp-in{0%{opacity:0;transform:translateY(6px)scale(.98)}to{opacity:1;transform:none}}.animate-fade{animation:.3s ease-out fp-fade}@keyframes fp-fade{0%{opacity:0}to{opacity:1}}input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.hover-lift{transition:transform .2s cubic-bezier(.16,1,.3,1),box-shadow .2s}.hover-lift:hover{transform:translateY(-1px);box-shadow:0 4px 16px #00000014,0 1px 4px #0000000a}.nav-active:before{content:"";background:var(--brand);border-radius:0 3px 3px 0;width:3px;position:absolute;top:6px;bottom:6px;left:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/sync-server/www/assets/mammoth.browser-l1BsXqb5.js b/sync-server/www/assets/mammoth.browser-C7PeojK9.js similarity index 99% rename from sync-server/www/assets/mammoth.browser-l1BsXqb5.js rename to sync-server/www/assets/mammoth.browser-C7PeojK9.js index 193e693..5443b95 100644 --- a/sync-server/www/assets/mammoth.browser-l1BsXqb5.js +++ b/sync-server/www/assets/mammoth.browser-C7PeojK9.js @@ -1,4 +1,4 @@ -import{a7 as dt,a8 as mn}from"./index-BFEQKHK8.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/useChart-BGht3gc0.js b/sync-server/www/assets/useChart-eUS_Zp3L.js similarity index 92% rename from sync-server/www/assets/useChart-BGht3gc0.js rename to sync-server/www/assets/useChart-eUS_Zp3L.js index e856bd7..a496be5 100644 --- a/sync-server/www/assets/useChart-BGht3gc0.js +++ b/sync-server/www/assets/useChart-eUS_Zp3L.js @@ -1 +1 @@ -import{r}from"./index-BFEQKHK8.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-BxEr63go.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 64046b0..1dc29f8 100644 --- a/sync-server/www/index.html +++ b/sync-server/www/index.html @@ -8,8 +8,8 @@ 足迹 Footprints - - + +