From cf4647f706b8232ce1b668839abf3b17bb8a1aa3 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 17 Oct 2026 10:48:52 +0800 Subject: [PATCH] chore: remove dead code (lib/file.ts, unused attachmentAdd export) --- app/src/lib/api.ts | 2 -- app/src/lib/file.ts | 16 ---------------- ...minPage-BFM7DAz_.js => AdminPage-wPERELTD.js} | 6 +++--- ...age-DpbG_p_o.js => DashboardPage-BnvuHs-s.js} | 2 +- ...esPage-BU0at5Lj.js => GradesPage-BEf5WjN8.js} | 2 +- ...sPage-DNub3oYk.js => RecordsPage-CaSiK7db.js} | 2 +- ...Page-ZZI99iD_.js => TaxonomyPage-BbrXpj0c.js} | 2 +- ...pesPage-WQszok7J.js => TypesPage-BzVC52QM.js} | 2 +- .../{card-DIWmzy0c.js => card-CqmYl8IP.js} | 2 +- .../{index-C0Fp67iE.js => index-Dt1VICf1.js} | 10 +++++----- ...r-hXtD3Bwj.js => mammoth.browser-D_fu4i9t.js} | 2 +- ...useChart-BQT9jMdm.js => useChart-BE0AfFzS.js} | 2 +- sync-server/www/index.html | 2 +- 13 files changed, 17 insertions(+), 35 deletions(-) delete mode 100644 app/src/lib/file.ts rename sync-server/www/assets/{AdminPage-BFM7DAz_.js => AdminPage-wPERELTD.js} (97%) rename sync-server/www/assets/{DashboardPage-DpbG_p_o.js => DashboardPage-BnvuHs-s.js} (94%) rename sync-server/www/assets/{GradesPage-BU0at5Lj.js => GradesPage-BEf5WjN8.js} (99%) rename sync-server/www/assets/{RecordsPage-DNub3oYk.js => RecordsPage-CaSiK7db.js} (99%) rename sync-server/www/assets/{TaxonomyPage-ZZI99iD_.js => TaxonomyPage-BbrXpj0c.js} (97%) rename sync-server/www/assets/{TypesPage-WQszok7J.js => TypesPage-BzVC52QM.js} (98%) rename sync-server/www/assets/{card-DIWmzy0c.js => card-CqmYl8IP.js} (89%) rename sync-server/www/assets/{index-C0Fp67iE.js => index-Dt1VICf1.js} (85%) rename sync-server/www/assets/{mammoth.browser-hXtD3Bwj.js => mammoth.browser-D_fu4i9t.js} (99%) rename sync-server/www/assets/{useChart-BQT9jMdm.js => useChart-BE0AfFzS.js} (92%) diff --git a/app/src/lib/api.ts b/app/src/lib/api.ts index caef54a..79de371 100644 --- a/app/src/lib/api.ts +++ b/app/src/lib/api.ts @@ -129,8 +129,6 @@ export const bandUpsert = (p: GradeBand) => call<{ item: { id: number } }>('band export const bandDelete = (id: number) => call<{ ok: true }>('band_delete', { id }); // ---- attachment ---- -export const attachmentAdd = (p: { owner_id: number; file_name: string; mime?: string; size: number; data_b64: string; thumb_b64?: string }) => - call<{ item: Attachment }>('attachment_add', p); export const attachmentList = (owner_id: number) => call<{ items: Attachment[] }>('attachment_list', { owner_id }); export const attachmentDelete = (id: number) => call<{ ok: true }>('attachment_delete', { id }); export const attachmentRead = (id: number) => diff --git a/app/src/lib/file.ts b/app/src/lib/file.ts deleted file mode 100644 index 4ff7a1a..0000000 --- a/app/src/lib/file.ts +++ /dev/null @@ -1,16 +0,0 @@ -// 附件打开/下载:图片与 PDF 新窗口预览,其余触发下载 -export function openOrDownload(fileName: string, mime?: string, b64?: string) { - if (!b64) return; - const bytes = Uint8Array.from(atob(b64), c => c.charCodeAt(0)); - const blob = new Blob([bytes], { type: mime || 'application/octet-stream' }); - const url = URL.createObjectURL(blob); - if (mime?.startsWith('image/') || mime === 'application/pdf') { - window.open(url, '_blank'); - } else { - const a = document.createElement('a'); - a.href = url; - a.download = fileName; - a.click(); - } - setTimeout(() => URL.revokeObjectURL(url), 60_000); -} diff --git a/sync-server/www/assets/AdminPage-BFM7DAz_.js b/sync-server/www/assets/AdminPage-wPERELTD.js similarity index 97% rename from sync-server/www/assets/AdminPage-BFM7DAz_.js rename to sync-server/www/assets/AdminPage-wPERELTD.js index f80fadc..016d242 100644 --- a/sync-server/www/assets/AdminPage-BFM7DAz_.js +++ b/sync-server/www/assets/AdminPage-wPERELTD.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C0Fp67iE.js","assets/index-D6K8zE2F.css"])))=>i.map(i=>d[i]); -import{c as o,u as Z,_ as J,f as _,$ as C,r as n,g as h,j as s,E as w,B as t,a0 as U,P as Y,I as z,k as ee,l as se,T as ae,m as p,a1 as te,a2 as ne,a3 as ie,a4 as re,a5 as ce,a6 as de,a7 as le,a8 as oe}from"./index-C0Fp67iE.js";import{C as $,a as B,b as O}from"./card-DIWmzy0c.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dt1VICf1.js","assets/index-D6K8zE2F.css"])))=>i.map(i=>d[i]); +import{c as o,u as Z,_ as J,f as _,$ as C,r as n,g as h,j as s,E as w,B as t,a0 as U,P as Y,I as z,k as ee,l as se,T as ae,m as p,a1 as te,a2 as ne,a3 as ie,a4 as re,a5 as ce,a6 as de,a7 as le,a8 as oe}from"./index-Dt1VICf1.js";import{C as $,a as B,b as O}from"./card-CqmYl8IP.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,_ as J,f as _,$ as C,r as n,g as h,j as s,E as w,B as t,a0 * * 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=J(),E=_({queryKey:["me-admin"],queryFn:async()=>(await de(()=>import("./index-C0Fp67iE.js").then(a=>a.ab),__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(` + */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-Dt1VICf1.js").then(a=>a.ab),__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-DpbG_p_o.js b/sync-server/www/assets/DashboardPage-BnvuHs-s.js similarity index 94% rename from sync-server/www/assets/DashboardPage-DpbG_p_o.js rename to sync-server/www/assets/DashboardPage-BnvuHs-s.js index 20068fb..11ebdc4 100644 --- a/sync-server/www/assets/DashboardPage-DpbG_p_o.js +++ b/sync-server/www/assets/DashboardPage-BnvuHs-s.js @@ -1 +1 @@ -import{r as g,f as v,j as t,S as j,t as S}from"./index-C0Fp67iE.js";import{C as c,a as d,b as x}from"./card-DIWmzy0c.js";import{u as N,i as u,a as m}from"./useChart-BQT9jMdm.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-Dt1VICf1.js";import{C as c,a as d,b as x}from"./card-CqmYl8IP.js";import{u as N,i as u,a as m}from"./useChart-BE0AfFzS.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-BU0at5Lj.js b/sync-server/www/assets/GradesPage-BEf5WjN8.js similarity index 99% rename from sync-server/www/assets/GradesPage-BU0at5Lj.js rename to sync-server/www/assets/GradesPage-BEf5WjN8.js index f118f07..2417759 100644 --- a/sync-server/www/assets/GradesPage-BU0at5Lj.js +++ b/sync-server/www/assets/GradesPage-BEf5WjN8.js @@ -1,4 +1,4 @@ -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-C0Fp67iE.js";import{C as f,a as z,b as _}from"./card-DIWmzy0c.js";import{u as X,i as M,a as L}from"./useChart-BQT9jMdm.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-Dt1VICf1.js";import{C as f,a as z,b as _}from"./card-CqmYl8IP.js";import{u as X,i as M,a as L}from"./useChart-BE0AfFzS.js";import{u as Z,i as ee,b as se,a as te,c as ae,d as re,e as ne,f as le}from"./echarts-BIWefrIc.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/RecordsPage-DNub3oYk.js b/sync-server/www/assets/RecordsPage-CaSiK7db.js similarity index 99% rename from sync-server/www/assets/RecordsPage-DNub3oYk.js rename to sync-server/www/assets/RecordsPage-CaSiK7db.js index 8d538ec..bb86929 100644 --- a/sync-server/www/assets/RecordsPage-DNub3oYk.js +++ b/sync-server/www/assets/RecordsPage-CaSiK7db.js @@ -1,4 +1,4 @@ -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-C0Fp67iE.js";/** +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-Dt1VICf1.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/TaxonomyPage-ZZI99iD_.js b/sync-server/www/assets/TaxonomyPage-BbrXpj0c.js similarity index 97% rename from sync-server/www/assets/TaxonomyPage-ZZI99iD_.js rename to sync-server/www/assets/TaxonomyPage-BbrXpj0c.js index 01de18a..a8de6d3 100644 --- a/sync-server/www/assets/TaxonomyPage-ZZI99iD_.js +++ b/sync-server/www/assets/TaxonomyPage-BbrXpj0c.js @@ -1 +1 @@ -import{j as e,u as k,d as q,f as z,r as g,g as h,V as F,W as w,B as j,T as D,I as Q,P as T,C as E,X as M,Y as B,s as P,Z as V}from"./index-C0Fp67iE.js";import{C as K,a as S}from"./card-DIWmzy0c.js";const f=["#3056d3","#7c3aed","#0891b2","#16a34a","#d97706","#dc2626","#db2777","#64748b"];function H(){return e.jsxs("div",{className:"mx-auto max-w-[1080px] px-3 py-4 sm:px-6 sm:py-5",children:[e.jsx("p",{className:"mb-4 text-[12px] text-ink-3",children:"字典驱动录入表单中的下拉选项;维度是自定义的成长分类轴,一条记录可挂多个维度。"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(C,{kind:"level",title:"级别字典",description:"国际级、国家级、省市级等,可按学校口径增改"}),e.jsx(C,{kind:"role",title:"角色字典",description:"主导、核心、参加等参与角色"}),e.jsx(I,{})]})]})}function C({kind:r,title:x,description:N}){var v;const l=k(),o=q(),n=(((v=z({queryKey:["taxonomy-all"],queryFn:()=>P()}).data)==null?void 0:v.items)??[]).filter(s=>s.kind===r).sort((s,m)=>s.sort-m.sort),[a,c]=g.useState(""),[u,d]=g.useState(null),t=h({mutationFn:F,onSuccess:()=>void l.invalidateQueries({queryKey:["taxonomy-all"]})}),i=h({mutationFn:s=>w(s),onSuccess:()=>{l.invalidateQueries({queryKey:["taxonomy-all"]}),o("success","已删除"),d(null)},onError:s=>{o("error",s.message),d(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:x,extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:N})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[n.map((s,m)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("input",{type:"color",value:s.color??f[m%f.length],className:"size-5 cursor-pointer rounded border border-line bg-surface",onChange:y=>t.mutate({id:s.id,kind:r,value:s.value,color:y.target.value,sort:s.sort})}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",value:s.value,onChange:()=>{},onBlur:y=>{const b=y.target.value.trim();b&&b!==s.value&&t.mutate({id:s.id,kind:r,value:b,color:s.color,sort:s.sort})},defaultValue:s.value},s.value),e.jsxs("span",{className:"num w-14 text-right text-[11px] text-ink-3",children:["#",s.sort]}),s.is_builtin?e.jsx("span",{className:"w-7 text-center text-[11px] text-ink-3",children:"内置"}):e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>d({id:s.id,value:s.value}),children:e.jsx(D,{size:13})})]},s.id)),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增条目,回车或点击按钮",value:a,onChange:s=>c(s.target.value),onKeyDown:s=>{var m;s.key==="Enter"&&a.trim()&&(t.mutate({kind:r,value:a.trim(),sort:(((m=n.at(-1))==null?void 0:m.sort)??0)+10}),c(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!a.trim(),onClick:()=>{var s;t.mutate({kind:r,value:a.trim(),sort:(((s=n.at(-1))==null?void 0:s.sort)??0)+10}),c("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!u,title:"删除字典条目",content:u?"确定删除「"+u.value+"」吗?":"",onCancel:()=>d(null),onOk:()=>u&&i.mutate(u.id)})]})}function I(){var d;const r=k(),x=q(),l=[...((d=z({queryKey:["dimensions"],queryFn:V}).data)==null?void 0:d.items)??[]].sort((t,i)=>t.sort-i.sort),[o,p]=g.useState(""),[n,a]=g.useState(null),c=h({mutationFn:M,onSuccess:()=>void r.invalidateQueries({queryKey:["dimensions"]})}),u=h({mutationFn:t=>B(t),onSuccess:()=>{r.invalidateQueries({queryKey:["dimensions"]}),x("success","已删除"),a(null)},onError:t=>{x("error",t.message),a(null)}});return e.jsxs(K,{children:[e.jsx(S,{title:"成长维度",extra:e.jsx("span",{className:"text-[11px] text-ink-3",children:"如:学业深造 / 职业发展 / 兴趣生活"})}),e.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[l.map((t,i)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md px-1 py-1 hover:bg-surface-2",children:[e.jsx("span",{className:"size-3 rounded-full",style:{backgroundColor:t.color??f[i%f.length]}}),e.jsx("input",{className:"h-7 flex-1 rounded border border-transparent bg-transparent px-1.5 text-[13px] text-ink-1 hover:border-line focus:border-brand focus:outline-none",defaultValue:t.name,onBlur:v=>{const s=v.target.value.trim();s&&s!==t.name&&c.mutate({id:t.id,name:s,color:t.color,sort:t.sort})}},t.name),e.jsx(j,{variant:"ghost",size:"icon-sm","aria-label":"删除",onClick:()=>a({id:t.id,name:t.name}),children:e.jsx(D,{size:13})})]},t.id)),!l.length&&e.jsx("div",{className:"py-2 text-center text-[12px] text-ink-3",children:"尚未配置维度"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-line pt-2",children:[e.jsx(Q,{className:"flex-1",placeholder:"新增维度名称",value:o,onChange:t=>p(t.target.value),onKeyDown:t=>{var i;t.key==="Enter"&&o.trim()&&(c.mutate({name:o.trim(),sort:(((i=l.at(-1))==null?void 0:i.sort)??0)+10}),p(""))}}),e.jsxs(j,{size:"sm",variant:"secondary",disabled:!o.trim(),onClick:()=>{var t;c.mutate({name:o.trim(),sort:(((t=l.at(-1))==null?void 0:t.sort)??0)+10}),p("")},children:[e.jsx(T,{size:13})," 添加"]})]})]}),e.jsx(E,{open:!!n,title:"删除维度",content:n?"确定删除「"+n.name+"」吗?记录与该维度的关联将一并移除。":"",onCancel:()=>a(null),onOk:()=>n&&u.mutate(n.id)})]})}export{H as TaxonomyPage}; +import{j as e,u as k,d as q,f as z,r as g,g as h,V as F,W as w,B as j,T as D,I as Q,P as T,C as E,X as M,Y as B,s as P,Z as V}from"./index-Dt1VICf1.js";import{C as K,a as S}from"./card-CqmYl8IP.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-WQszok7J.js b/sync-server/www/assets/TypesPage-BzVC52QM.js similarity index 98% rename from sync-server/www/assets/TypesPage-WQszok7J.js rename to sync-server/www/assets/TypesPage-BzVC52QM.js index 4082ce5..530ebfe 100644 --- a/sync-server/www/assets/TypesPage-WQszok7J.js +++ b/sync-server/www/assets/TypesPage-BzVC52QM.js @@ -1,4 +1,4 @@ -import{c as D,u as K,d as F,f as L,r,g as I,j as e,B as p,P as q,M as O,m as _,l as H,T as P,C as R,N as G,F as U,H as i,I as j,O as W,S as z,Q as J,U as V,q as X}from"./index-C0Fp67iE.js";import{C as Y}from"./card-DIWmzy0c.js";/** +import{c as D,u as K,d as F,f as L,r,g as I,j as e,B as p,P as q,M as O,m as _,l as H,T as P,C as R,N as G,F as U,H as i,I as j,O as W,S as z,Q as J,U as V,q as X}from"./index-Dt1VICf1.js";import{C as Y}from"./card-CqmYl8IP.js";/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. diff --git a/sync-server/www/assets/card-DIWmzy0c.js b/sync-server/www/assets/card-CqmYl8IP.js similarity index 89% rename from sync-server/www/assets/card-DIWmzy0c.js rename to sync-server/www/assets/card-CqmYl8IP.js index db741d0..cfed88e 100644 --- a/sync-server/www/assets/card-DIWmzy0c.js +++ b/sync-server/www/assets/card-CqmYl8IP.js @@ -1 +1 @@ -import{j as s,a}from"./index-C0Fp67iE.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-Dt1VICf1.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-C0Fp67iE.js b/sync-server/www/assets/index-Dt1VICf1.js similarity index 85% rename from sync-server/www/assets/index-C0Fp67iE.js rename to sync-server/www/assets/index-Dt1VICf1.js index 164ecce..6f687dd 100644 --- a/sync-server/www/assets/index-C0Fp67iE.js +++ b/sync-server/www/assets/index-Dt1VICf1.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DpbG_p_o.js","assets/card-DIWmzy0c.js","assets/useChart-BQT9jMdm.js","assets/echarts-BIWefrIc.js","assets/GradesPage-BU0at5Lj.js","assets/TypesPage-WQszok7J.js","assets/TaxonomyPage-ZZI99iD_.js","assets/AdminPage-BFM7DAz_.js"])))=>i.map(i=>d[i]); -var Np=n=>{throw TypeError(n)};var Vf=(n,r,s)=>r.has(n)||Np("Cannot "+s);var _=(n,r,s)=>(Vf(n,r,"read from private field"),s?s.call(n):r.get(n)),he=(n,r,s)=>r.has(n)?Np("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),P=(n,r,s,c)=>(Vf(n,r,"write to private field"),c?c.call(n,s):r.set(n,s),s),Se=(n,r,s)=>(Vf(n,r,"access private method"),s);var Qs=(n,r,s,c)=>({set _(f){P(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 j5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ag(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xf={exports:{}},Pu={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-BnvuHs-s.js","assets/card-CqmYl8IP.js","assets/useChart-BE0AfFzS.js","assets/echarts-BIWefrIc.js","assets/GradesPage-BEf5WjN8.js","assets/TypesPage-BzVC52QM.js","assets/TaxonomyPage-BbrXpj0c.js","assets/AdminPage-wPERELTD.js"])))=>i.map(i=>d[i]); +var Np=n=>{throw TypeError(n)};var Vf=(n,r,s)=>r.has(n)||Np("Cannot "+s);var _=(n,r,s)=>(Vf(n,r,"read from private field"),s?s.call(n):r.get(n)),he=(n,r,s)=>r.has(n)?Np("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,s),P=(n,r,s,c)=>(Vf(n,r,"write to private field"),c?c.call(n,s):r.set(n,s),s),Se=(n,r,s)=>(Vf(n,r,"access private method"),s);var Qs=(n,r,s,c)=>({set _(f){P(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 w5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ag(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xf={exports:{}},Pu={};/** * @license React * react-jsx-runtime.production.js * @@ -58,7 +58,7 @@ Error generating stack: `+a.message+` * @license MIT */var jd=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Dg=/^[\\/]{2}/;function o2(n,r){return r+n.replace(/\\/g,"/")}var kp="popstate";function Hp(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function f2(n={}){function r(f,h){let{pathname:d="/",search:v="",hash:b=""}=Qn(f.location.hash.substring(1));return!d.startsWith("/")&&!d.startsWith(".")&&(d="/"+d),ad("",{pathname:d,search:v,hash:b},h.state&&h.state.usr||null,h.state&&h.state.key||"default")}function s(f,h){let d=f.document.querySelector("base"),v="";if(d&&d.getAttribute("href")){let b=f.location.href,p=b.indexOf("#");v=p===-1?b:b.slice(0,p)}return v+"#"+(typeof h=="string"?h:Ln(h))}function c(f,h){tl(f.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(h)})`)}return h2(r,s,c,n)}function We(n,r){if(n===!1||n===null||typeof n>"u")throw new Error(r)}function tl(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function d2(){return Math.random().toString(36).substring(2,10)}function qp(n,r){return{usr:n.state,key:n.key,idx:r,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function ad(n,r,s=null,c,f){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof r=="string"?Qn(r):r,state:s,key:r&&r.key||c||d2(),mask:f}}function Ln({pathname:n="/",search:r="",hash:s=""}){return r&&r!=="?"&&(n+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Qn(n){let r={};if(n){let s=n.indexOf("#");s>=0&&(r.hash=n.substring(s),n=n.substring(0,s));let c=n.indexOf("?");c>=0&&(r.search=n.substring(c),n=n.substring(0,c)),n&&(r.pathname=n)}return r}function h2(n,r,s,c={}){let{window:f=document.defaultView,v5Compat:h=!1}=c,d=f.history,v="POP",b=null,p=x();p==null&&(p=0,d.replaceState({...d.state,idx:p},""));function x(){return(d.state||{idx:null}).idx}function g(){v="POP";let D=x(),H=D==null?null:D-p;p=D,b&&b({action:v,location:k.location,delta:H})}function N(D,H){v="PUSH";let Y=Hp(D)?D:ad(k.location,D,H);s&&s(Y,D),p=x()+1;let Z=qp(Y,p),J=k.createHref(Y.mask||Y);try{d.pushState(Z,"",J)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;f.location.assign(J)}h&&b&&b({action:v,location:k.location,delta:1})}function q(D,H){v="REPLACE";let Y=Hp(D)?D:ad(k.location,D,H);s&&s(Y,D),p=x();let Z=qp(Y,p),J=k.createHref(Y.mask||Y);d.replaceState(Z,"",J),h&&b&&b({action:v,location:k.location,delta:0})}function K(D){return m2(f,D)}let k={get action(){return v},get location(){return n(f,d)},listen(D){if(b)throw new Error("A history only accepts one active listener");return f.addEventListener(kp,g),b=D,()=>{f.removeEventListener(kp,g),b=null}},createHref(D){return r(f,D)},createURL:K,encodeLocation(D){let H=K(D);return{pathname:H.pathname,search:H.search,hash:H.hash}},push:N,replace:q,go(D){return d.go(D)}};return k}function m2(n,r,s=!1){let c="http://localhost";n&&(c=n.location.origin!=="null"?n.location.origin:n.location.href),We(c,"No window.location.(origin|href) available to create URL");let f=typeof r=="string"?r:Ln(r);return f=f.replace(/ $/,"%20"),!s&&Dg.test(f)&&(f=c+f),new URL(f,c)}function Ug(n,r,s="/"){return y2(n,r,s,!1)}function y2(n,r,s,c,f){let h=typeof r=="string"?Qn(r):r,d=ma(h.pathname||"/",s);if(d==null)return null;let v=v2(n),b=null,p=w2(d);for(let x=0;b==null&&x{let x={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:v,route:d};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(c)&&b)return;We(x.relativePath.startsWith(c),`Absolute route path "${x.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(c.length)}let g=Cl([c,x.relativePath]),N=s.concat(x);d.children&&d.children.length>0&&(We(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),kg(d.children,r,N,g,b)),!(d.path==null&&!d.index)&&r.push({path:g,score:T2(g,d.index),routesMeta:N.map((q,K)=>{let[k,D]=Lg(q.relativePath,q.caseSensitive,K===N.length-1);return{...q,matcher:k,compiledParams:D}})})};return n.forEach((d,v)=>{var b;if(d.path===""||!((b=d.path)!=null&&b.includes("?")))h(d,v);else for(let p of Hg(d.path))h(d,v,!0,p)}),r}function Hg(n){let r=n.split("/");if(r.length===0)return[];let[s,...c]=r,f=s.endsWith("?"),h=s.replace(/\?$/,"");if(c.length===0)return f?[h,""]:[h];let d=Hg(c.join("/")),v=[];return v.push(...d.map(b=>b===""?h:[h,b].join("/"))),f&&v.push(...d),v.map(b=>n.startsWith("/")&&b===""?"/":b)}function p2(n){n.sort((r,s)=>r.score!==s.score?s.score-r.score:N2(r.routesMeta.map(c=>c.childrenIndex),s.routesMeta.map(c=>c.childrenIndex)))}var g2=/^:[\w-]+$/,b2=3,x2=2,S2=1,E2=10,_2=-2,Lp=n=>n==="*";function T2(n,r){let s=n.split("/"),c=s.length;return s.some(Lp)&&(c+=_2),r&&(c+=x2),s.filter(f=>!Lp(f)).reduce((f,h)=>f+(g2.test(h)?b2:h===""?S2:E2),c)}function N2(n,r){return n.length===r.length&&n.slice(0,-1).every((c,f)=>c===r[f])?n[n.length-1]-r[r.length-1]:0}function C2(n,r,s=!1){let{routesMeta:c}=n,f={},h="/",d=[];for(let v=0;v{if(x==="*"){let K=v[N]||"";d=$i(h.slice(0,h.length-K.length),1)}const q=v[N];return g&&!q?p[x]=void 0:p[x]=(q||"").replace(/%2F/g,"/"),p},{}),pathname:h,pathnameBase:d,pattern:n}}function Lg(n,r=!1,s=!0){tl(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let c=[],f="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,v,b,p,x)=>{if(c.push({paramName:v,isOptional:b!=null}),b){let g=x.charAt(p+d.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(c.push({paramName:"*"}),f+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?f+="\\/*$":n!==""&&n!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,r?void 0:"i"),c]}function w2(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return tl(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),n}}function ma(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let s=r.endsWith("/")?r.length-1:r.length,c=n.charAt(s);return c&&c!=="/"?null:n.slice(s)||"/"}function j2(n,r="/"){let{pathname:s,search:c="",hash:f=""}=typeof n=="string"?Qn(n):n,h;return s?(s=Bg(s),s.startsWith("/")||s.startsWith("\\")?h=Bp(s.substring(1),"/"):h=Bp(s,r)):h=r,{pathname:h,search:R2(c),hash:A2(f)}}function Bp(n,r){let s=$i(r).split("/");return n.split("/").forEach(f=>{f===".."?s.length>1&&s.pop():f!=="."&&s.push(f)}),s.length>1?s.join("/"):"/"}function Pf(n,r,s,c){return`Cannot include a '${n}' character in a manually specified \`to.${r}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function z2(n){return n.filter((r,s)=>s===0||r.route.path&&r.route.path.length>0)}function zd(n){let r=z2(n);return r.map((s,c)=>c===r.length-1?s.pathname:s.pathnameBase)}function ec(n,r,s,c=!1){let f;typeof n=="string"?f=Qn(n):(f={...n},We(!f.pathname||!f.pathname.includes("?"),Pf("?","pathname","search",f)),We(!f.pathname||!f.pathname.includes("#"),Pf("#","pathname","hash",f)),We(!f.search||!f.search.includes("#"),Pf("#","search","hash",f)));let h=n===""||f.pathname==="",d=h?"/":f.pathname,v;if(d==null)v=s;else{let g=r.length-1;if(!c&&d.startsWith("..")){let N=d.split("/");for(;N[0]==="..";)N.shift(),g-=1;f.pathname=N.join("/")}v=g>=0?r[g]:"/"}let b=j2(f,v),p=d&&d!=="/"&&d.endsWith("/"),x=(h||d===".")&&s.endsWith("/");return!b.pathname.endsWith("/")&&(p||x)&&(b.pathname+="/"),b}var Bg=n=>n.replace(/[\\/]{2,}/g,"/"),Cl=n=>Bg(n.join("/"));function $i(n,r=0){let s=n.length;for(;s>r&&n.charCodeAt(s-1)===47;)s--;return s===n.length?n:n.slice(0,s)}var O2=n=>$i(n).replace(/^\/*/,"/"),R2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,A2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,M2=class{constructor(n,r,s,c=!1){this.status=n,this.statusText=r||"",this.internal=c,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function D2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function U2(n){let r=n.map(s=>s.route.path).filter(Boolean);return Cl(r)||"/"}var Qg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gg(n,r){let s=n;if(typeof s!="string"||!jd.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let c=s,f=!1;if(Qg)try{let h=new URL(window.location.href),d=Dg.test(s)?new URL(o2(s,h.protocol)):new URL(s),v=ma(d.pathname,r);d.origin===h.origin&&v!=null?s=v+d.search+d.hash:f=!0}catch{tl(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:f,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Qp=new URL("http://localhost");function Od(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),Qp)}catch{return Qp}}function Wf(n,r){return n.origin===r.origin&&(n.origin!=="null"||n.protocol===r.protocol&&n.host===r.host)}function k2(n,r){if(n.startsWith("//"))return!0;let s=r.protocol.toLowerCase();return n.toLowerCase().startsWith(s)?r.host===""||n.slice(s.length).startsWith("//"):!1}function Rd(n,r,s,c){let f=null;try{f=n==null?null:new URL(n,s)}catch{}let h=new URL(r,s),d=f!=null&&!Wf(f,s),v=!Wf(h,s);if(c==="reject"){if(d||v)throw new Error("External navigation is not allowed")}else if(v&&(f==null||!k2(n,f)||!Wf(f,h)))throw new Error("External navigation is not allowed")}var Yg=["POST","PUT","PATCH","DELETE"];new Set(Yg);var H2=["GET",...Yg];new Set(H2);var q2=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function L2(n){try{return q2.includes(new URL(n).protocol)}catch{return!1}}var Ii=E.createContext(null);Ii.displayName="DataRouter";var tc=E.createContext(null);tc.displayName="DataRouterState";var Vg=E.createContext(!1);function B2(){return E.useContext(Vg)}var Xg=E.createContext({isTransitioning:!1});Xg.displayName="ViewTransition";var Q2=E.createContext(new Map);Q2.displayName="Fetchers";var G2=E.createContext(null);G2.displayName="Await";var ll=E.createContext(null);ll.displayName="Navigation";var cr=E.createContext(null);cr.displayName="Location";var wl=E.createContext({outlet:null,matches:[],isDataRoute:!1});wl.displayName="Route";var Ad=E.createContext(null);Ad.displayName="RouteError";var Kg="REACT_ROUTER_ERROR",Y2="REDIRECT",V2="ROUTE_ERROR_RESPONSE";function X2(n){if(n.startsWith(`${Kg}:${Y2}:{`))try{let r=JSON.parse(n.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function K2(n){if(n.startsWith(`${Kg}:${V2}:{`))try{let r=JSON.parse(n.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new M2(r.status,r.statusText,r.data)}catch{}}function Z2(n,{relative:r}={}){We(eu(),"useHref() may be used only in the context of a component.");let{basename:s,navigator:c}=E.useContext(ll),{hash:f,pathname:h,search:d}=or(n,{relative:r}),v=h;return s!=="/"&&(v=h==="/"?s:Cl([s,h])),c.createHref({pathname:v,search:d,hash:f})}function eu(){return E.useContext(cr)!=null}function vl(){return We(eu(),"useLocation() may be used only in the context of a component."),E.useContext(cr).location}var Zg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jg(n){E.useContext(ll).static||E.useLayoutEffect(n)}function lc(){let{isDataRoute:n}=E.useContext(wl);return n?sS():J2()}function J2(){We(eu(),"useNavigate() may be used only in the context of a component.");let n=E.useContext(Ii),{basename:r,navigator:s}=E.useContext(ll),{matches:c}=E.useContext(wl),{pathname:f}=vl(),h=JSON.stringify(zd(c)),d=E.useRef(!1);return Jg(()=>{d.current=!0}),E.useCallback((b,p={})=>{if(tl(d.current,Zg),!d.current)return;if(typeof b=="number"){s.go(b);return}let x=ec(b,JSON.parse(h),f,p.relative==="path");n==null&&r!=="/"&&(x.pathname=x.pathname==="/"?r:Cl([r,x.pathname])),Rd(typeof b=="string"?b:Ln(b),s.createHref(x),Od(s),"reject"),(p.replace?s.replace:s.push)(x,p.state,p)},[r,s,h,f,n])}var F2=E.createContext(null);function $2(n){let r=E.useContext(wl).outlet;return E.useMemo(()=>r&&E.createElement(F2.Provider,{value:n},r),[r,n])}function or(n,{relative:r}={}){let{matches:s}=E.useContext(wl),{pathname:c}=vl(),f=JSON.stringify(zd(s));return E.useMemo(()=>ec(n,JSON.parse(f),c,r==="path"),[n,f,c,r])}function P2(n,r){return Fg(n,r)}function Fg(n,r,s){var D;We(eu(),"useRoutes() may be used only in the context of a component.");let{navigator:c}=E.useContext(ll),{matches:f}=E.useContext(wl),h=f[f.length-1],d=h?h.params:{},v=h?h.pathname:"/",b=h?h.pathnameBase:"/",p=h&&h.route;{let H=p&&p.path||"";Pg(v,!p||H.endsWith("*")||H.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${v}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let x=vl(),g;if(r){let H=typeof r=="string"?Qn(r):r;We(b==="/"||((D=H.pathname)==null?void 0:D.startsWith(b)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${b}" but pathname "${H.pathname}" was given in the \`location\` prop.`),g=H}else g=x;let N=g.pathname||"/",q=N;if(b!=="/"){let H=b.replace(/^\//,"").split("/");q="/"+N.replace(/^\//,"").split("/").slice(H.length).join("/")}let K=s&&s.state.matches.length?s.state.matches.map(H=>Object.assign(H,{route:s.manifest[H.route.id]||H.route})):Ug(n,{pathname:q});tl(p||K!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),tl(K==null||K[K.length-1].route.element!==void 0||K[K.length-1].route.Component!==void 0||K[K.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let k=lS(K&&K.map(H=>Object.assign({},H,{params:Object.assign({},d,H.params),pathname:Cl([b,c.encodeLocation?c.encodeLocation(H.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?b:Cl([b,c.encodeLocation?c.encodeLocation(H.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathnameBase])})),f,s);return r&&k?E.createElement(cr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},k):k}function W2(){let n=rS(),r=D2(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,c="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:c},h={padding:"2px 4px",backgroundColor:c},d=null;return console.error("Error handled by React Router default ErrorBoundary:",n),d=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:h},"ErrorBoundary")," or"," ",E.createElement("code",{style:h},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},r),s?E.createElement("pre",{style:f},s):null,d)}var I2=E.createElement(W2,null),$g=class extends E.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,r){return r.location!==n.location||r.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:r.error,location:r.location,revalidation:n.revalidation||r.revalidation}}componentDidCatch(n,r){this.props.onError?this.props.onError(n,r):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=K2(n.digest);s&&(n=s)}let r=n!==void 0?E.createElement(wl.Provider,{value:this.props.routeContext},E.createElement(Ad.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?E.createElement(eS,{error:n},r):r}};$g.contextType=Vg;var If=new WeakMap;function eS({children:n,error:r}){let{basename:s,navigator:c}=E.useContext(ll);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let f=X2(r.digest);if(f){let h=If.get(r);if(h)throw h;let d=Gg(f.location,s),v=d.absoluteURL||d.to;if(Rd(f.location,v,Od(c),"allow-explicit"),L2(v))throw new Error("Invalid redirect location");if(Qg&&!If.get(r))if(d.isExternal||f.reloadDocument)window.location.href=v;else{const b=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:f.replace}));throw If.set(r,b),b}return E.createElement("meta",{httpEquiv:"refresh",content:`0;url=${v}`})}}return n}function tS({routeContext:n,match:r,children:s}){let c=E.useContext(Ii);return c&&c.static&&c.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=r.route.id),E.createElement(wl.Provider,{value:n},s)}function lS(n,r=[],s){let c=s==null?void 0:s.state;if(n==null){if(!c)return null;if(c.errors)n=c.matches;else if(r.length===0&&!c.initialized&&c.matches.length>0)n=c.matches;else return null}let f=n,h=c==null?void 0:c.errors;if(h!=null){let x=f.findIndex(g=>g.route.id&&(h==null?void 0:h[g.route.id])!==void 0);We(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),f=f.slice(0,Math.min(f.length,x+1))}let d=!1,v=-1;if(s&&c){d=c.renderFallback;for(let x=0;x=0?f=f.slice(0,v+1):f=[f[0]];break}}}}let b=s==null?void 0:s.onError,p=c&&b?(x,g)=>{var N,q;b(x,{location:c.location,params:((q=(N=c.matches)==null?void 0:N[0])==null?void 0:q.params)??{},pattern:U2(c.matches),errorInfo:g})}:void 0;return f.reduceRight((x,g,N)=>{let q,K=!1,k=null,D=null;c&&(q=h&&g.route.id?h[g.route.id]:void 0,k=g.route.errorElement||I2,d&&(v<0&&N===0?(Pg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),K=!0,D=null):v===N&&(K=!0,D=g.route.hydrateFallbackElement||null)));let H=r.concat(f.slice(0,N+1)),Y=()=>{let Z;return q?Z=k:K?Z=D:g.route.Component?Z=E.createElement(g.route.Component,null):g.route.element?Z=g.route.element:Z=x,E.createElement(tS,{match:g,routeContext:{outlet:x,matches:H,isDataRoute:c!=null},children:Z})};return c&&(g.route.ErrorBoundary||g.route.errorElement||N===0)?E.createElement($g,{location:c.location,revalidation:c.revalidation,component:k,error:q,children:Y(),routeContext:{outlet:null,matches:H,isDataRoute:!0},onError:p}):Y()},null)}function Md(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function aS(n){let r=E.useContext(Ii);return We(r,Md(n)),r}function nS(n){let r=E.useContext(tc);return We(r,Md(n)),r}function iS(n){let r=E.useContext(wl);return We(r,Md(n)),r}function Dd(n){let r=iS(n),s=r.matches[r.matches.length-1];return We(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function uS(){return Dd("useRouteId")}function rS(){var c;let n=E.useContext(Ad),r=nS("useRouteError"),s=Dd("useRouteError");return n!==void 0?n:(c=r.errors)==null?void 0:c[s]}function sS(){let{router:n}=aS("useNavigate"),r=Dd("useNavigate"),s=E.useRef(!1);return Jg(()=>{s.current=!0}),E.useCallback(async(f,h={})=>{tl(s.current,Zg),s.current&&(typeof f=="number"?await n.navigate(f):await n.navigate(f,{fromRouteId:r,...h}))},[n,r])}var Gp={};function Pg(n,r,s){!r&&!Gp[n]&&(Gp[n]=!0,tl(!1,s))}E.memo(cS);function cS({routes:n,manifest:r,future:s,state:c,isStatic:f,onError:h}){return Fg(n,void 0,{manifest:r,state:c,isStatic:f,onError:h})}function Yp({to:n,replace:r,state:s,relative:c}){We(eu()," may be used only in the context of a component.");let{static:f,navigator:h}=E.useContext(ll);tl(!f," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:d}=E.useContext(wl),{pathname:v}=vl(),b=lc(),p=ec(n,zd(d),v,c==="path");Rd(typeof n=="string"?n:Ln(n),h.createHref(p),Od(h),"reject");let x=JSON.stringify(p);return E.useEffect(()=>{b(JSON.parse(x),{replace:r,state:s,relative:c})},[b,x,c,r,s]),null}function oS(n){return $2(n.context)}function _l(n){We(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function fS({basename:n="/",children:r=null,location:s,navigationType:c="POP",navigator:f,static:h=!1,useTransitions:d}){We(!eu(),"You cannot render a inside another . You should never have more than one in your app.");let v=n.replace(/^\/*/,"/"),b=E.useMemo(()=>({basename:v,navigator:f,static:h,useTransitions:d,future:{}}),[v,f,h,d]);typeof s=="string"&&(s=Qn(s));let{pathname:p="/",search:x="",hash:g="",state:N=null,key:q="default",mask:K}=s,k=E.useMemo(()=>{let D=ma(p,v);return D==null?null:{location:{pathname:D,search:x,hash:g,state:N,key:q,mask:K},navigationType:c}},[v,p,x,g,N,q,c,K]);return tl(k!=null,` is not able to match the URL "${p}${x}${g}" because it does not start with the basename, so the won't render anything.`),k==null?null:E.createElement(ll.Provider,{value:b},E.createElement(cr.Provider,{children:r,value:k}))}function dS({children:n,location:r}){return P2(nd(n),r)}function nd(n,r=[]){let s=[];return E.Children.forEach(n,(c,f)=>{if(!E.isValidElement(c))return;let h=[...r,f];if(c.type===E.Fragment){s.push.apply(s,nd(c.props.children,h));return}We(c.type===_l,`[${typeof c.type=="string"?c.type:c.type.name}] is not a component. All component children of must be a or `),We(!c.props.index||!c.props.children,"An index route cannot have child routes.");let d={id:c.props.id||h.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(d.children=nd(c.props.children,h)),s.push(d)}),s}var Ks="get",Zs="application/x-www-form-urlencoded";function ac(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function hS(n){return ac(n)&&n.tagName.toLowerCase()==="button"}function mS(n){return ac(n)&&n.tagName.toLowerCase()==="form"}function yS(n){return ac(n)&&n.tagName.toLowerCase()==="input"}function vS(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function pS(n,r){return n.button===0&&(!r||r==="_self")&&!vS(n)}function id(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((r,s)=>{let c=n[s];return r.concat(Array.isArray(c)?c.map(f=>[s,f]):[[s,c]])},[]))}function gS(n,r){let s=id(n);return r&&r.forEach((c,f)=>{s.has(f)||r.getAll(f).forEach(h=>{s.append(f,h)})}),s}var Gs=null;function bS(){if(Gs===null)try{new FormData(document.createElement("form"),0),Gs=!1}catch{Gs=!0}return Gs}var xS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ed(n){return n!=null&&!xS.has(n)?(tl(!1,`"${n}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Zs}"`),null):n}function SS(n,r){let s,c,f,h,d;if(mS(n)){let v=n.getAttribute("action");c=v?ma(v,r):null,s=n.getAttribute("method")||Ks,f=ed(n.getAttribute("enctype"))||Zs,h=new FormData(n)}else if(hS(n)||yS(n)&&(n.type==="submit"||n.type==="image")){let v=n.form;if(v==null)throw new Error('Cannot submit a