diff --git a/assets/AiDeadlinesView-M2ihfYd-.js b/assets/AiDeadlinesView-DiE8i5uI.js similarity index 97% rename from assets/AiDeadlinesView-M2ihfYd-.js rename to assets/AiDeadlinesView-DiE8i5uI.js index ce60df6ff68b0cbefff42682ac14ad7a6ed1cc88..b3ecae97f40f0d0c425b3629e36f2be7bce1edf7 100644 --- a/assets/AiDeadlinesView-M2ihfYd-.js +++ b/assets/AiDeadlinesView-DiE8i5uI.js @@ -1,3 +1,3 @@ -import{r as x,j as t,b as E}from"./index-BHOUC_Zu.js";import{u as A}from"./useQuery-BLoDQBYX.js";import{S as B}from"./switch-CEN8Rv4w.js";import{S as U}from"./skeleton-D99KO90d.js";import{A as W,a as O}from"./alert-pE5EZBRN.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-S5NgAS91.js";import"./index-Del2ukvi.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` +import{r as x,j as t,b as E}from"./index-gsUrUwg6.js";import{u as A}from"./useQuery-CPia3mbp.js";import{S as B}from"./switch-CnhcVUVf.js";import{S as U}from"./skeleton-CF5-g5gI.js";import{A as W,a as O}from"./alert-DCRuvdIl.js";import{D as V,a as P,b as G,c as Y,d as K}from"./dialog-Bil4Ya0L.js";import"./index-Dov-h1--.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),H=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(H).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),z=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},I=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>I(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=I(e);return a.length?a[a.length-1]:null},Q=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},X=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=z(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),Z=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`;window.open(s,"_blank","noopener,noreferrer")},ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(` `),g=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(g),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},te=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?I(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),g=e?z(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,p=s?new Date(s.deadline_at).getTime():null;return t.jsx(V,{open:a,onOpenChange:n,children:t.jsx(P,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(G,{children:[t.jsx(Y,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[g&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:g})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),p!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(p,r)},children:J(p,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,m)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,u=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:u&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(u?null:y,r)},children:X(y,r)})]},`${d.type??"deadline"}-${m}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>Z(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},M=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(B,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ne=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),g=s?new Date(s.deadline_at).getTime():null,c=_(i?g:null,a),p=z(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:m=>m.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:g!=null?Q(g,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[p&&t.jsx("span",{children:p}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(m=>{const y=n.has(m);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(m)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(m)},m)})})]})},ce=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,g]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),p=A({queryKey:["conference-deadlines"],queryFn:()=>E.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(u=>{const h=new Set(u);return h.has(l)?h.delete(l):h.add(l),h})},m=x.useMemo(()=>{var u;const l=new Map;return(u=p.data)==null||u.results.forEach(h=>{D(h).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((h,j)=>j[1]-h[1]).map(([h])=>h)},[p.data]),y=x.useMemo(()=>{var j;const u=(((j=p.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),h=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...u].sort((f,w)=>{const v=h(f),N=h(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[p.data,e,n,o,c]);return p.error?t.jsx("div",{className:"page",children:t.jsx(W,{variant:"destructive",children:t.jsx(O,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(M,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(M,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),m.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[m.map(l=>{const u=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:u?"var(--ink)":"var(--bg-subtle)",color:u?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:p.isLoading?"…":`${y.length} conferences`})}),p.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,u)=>t.jsx(U,{className:"h-44"},u))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ne,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:g},l.id))}),t.jsx(te,{conf:s,open:s!==null,onOpenChange:l=>{l||g(null)}})]})};export{ce as default}; diff --git a/assets/BenchmarkDetailView-CFx9rlgB.js b/assets/BenchmarkDetailView-Bi4Pfrh0.js similarity index 98% rename from assets/BenchmarkDetailView-CFx9rlgB.js rename to assets/BenchmarkDetailView-Bi4Pfrh0.js index fb64beecd93464096018578d620edffa6f20e54b..2db76427107f732491bfec353853a9d591205ceb 100644 --- a/assets/BenchmarkDetailView-CFx9rlgB.js +++ b/assets/BenchmarkDetailView-Bi4Pfrh0.js @@ -1,2 +1,2 @@ -import{e as vt,u as jt,a0 as _t,r as w,j as n,L as me,a5 as ne,t as kt,a as St,b as ee}from"./index-BHOUC_Zu.js";import{u as te}from"./useQuery-BLoDQBYX.js";import{S as xe}from"./skeleton-D99KO90d.js";import{S as Je}from"./switch-CEN8Rv4w.js";import{A as Ct,a as Et}from"./alert-pE5EZBRN.js";import{L as ye}from"./LatexTitle-R8V-03ZY.js";import{I as Nt}from"./components-CgNSGcDY.js";import{C as Rt,E as Tt}from"./ExternalSourceEvalBadge-CuyDncpX.js";import{B as $t}from"./BenchmarkTrendSparkline-097gkkLo.js";import"./index-Del2ukvi.js";import"./katex.min-BSBacQyE.js";import"./transform-BaQjfqPg.js";import"./hover-card-CYqiITh9.js";function Mt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Ft=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;rD||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Dt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Bt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ht(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Bt(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Vt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ot(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Ut(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Vt(r):Ot(r,s);return document.createTextNode(`${a}{${i}}`)}function Ze(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Ft();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Ut(c,r,a,s)),t.appendChild(l)}function Wt(e,t,r){Ze(e,t,":before",r),Ze(e,t,":after",r)}const et="application/font-woff",tt="image/jpeg",qt={woff:et,woff2:et,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:tt,jpeg:tt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function zt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=zt(e).toLowerCase();return qt[t]||""}function Gt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Kt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ce={};function Qt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Qt(e,t,r.includeQueryParams);if(Ce[s]!=null)return Ce[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Gt(l)));a=Kt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ce[s]=a,a}async function Xt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function Yt(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function Jt(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zt(e,t){return P(e,HTMLCanvasElement)?Xt(e):P(e,HTMLVideoElement)?Yt(e,t):P(e,HTMLIFrameElement)?Jt(e,t):e.cloneNode(ht(e))}const er=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function tr(e,t,r){var s,a;if(ht(t))return t;let i=[];return er(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function rr(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function sr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function nr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function ar(e,t,r){return P(t,Element)&&(rr(e,t,r),Wt(e,t,r),sr(e,t),nr(e,t)),t}async function ir(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;iZt(s,t)).then(s=>tr(e,s,t)).then(s=>ar(e,s,t)).then(s=>ir(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,cr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function or(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function dr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function ur(e,t,r,s,a){try{const i=r?Mt(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(or(t),`$1${l}$3`)}catch{}return e}function mr(e,{preferredFontFormat:t}){return t?e.replace(lr,r=>{for(;;){const[s,,a]=cr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=mr(e,r);return dr(s).reduce((i,c)=>i.then(l=>ur(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function hr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function fr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function pr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await hr(e,t),await fr(e,t),await pr(e,t))}function gr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const rt={};async function st(e){let t=rt[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},rt[e]=t,t}async function nt(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function at(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function xr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=st(u).then(f=>nt(f,t)).then(f=>at(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(st(a.href).then(l=>nt(l,t)).then(l=>at(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function br(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function yr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await xr(r,t);return br(s)}function bt(e){return e.trim().replace(/["']/g,"")}function wr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function vr(e,t){const r=await yr(e,t),s=wr(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(` +import{e as vt,u as jt,a1 as _t,r as w,j as n,L as me,a6 as ne,v as kt,a as St,b as ee}from"./index-gsUrUwg6.js";import{u as te}from"./useQuery-CPia3mbp.js";import{S as xe}from"./skeleton-CF5-g5gI.js";import{S as Je}from"./switch-CnhcVUVf.js";import{A as Ct,a as Et}from"./alert-DCRuvdIl.js";import{L as ye}from"./LatexTitle-BsZuFMnA.js";import{I as Nt}from"./components-f5SMGslj.js";import{C as Rt,E as Tt}from"./ExternalSourceEvalBadge-B_j6-Fi4.js";import{B as $t}from"./BenchmarkTrendSparkline-CQYwfeti.js";import"./index-Dov-h1--.js";import"./katex.min-BSBacQyE.js";import"./transform-6AvXXXHk.js";import"./hover-card-BmN6fO7d.js";function Mt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),t&&(s.href=t),a.href=e,a.href}const Ft=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function q(e){const t=[];for(let r=0,s=e.length;rD||e.height>D)&&(e.width>D&&e.height>D?e.width>e.height?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D):e.width>D?(e.height*=D/e.width,e.width=D):(e.width*=D/e.height,e.height=D))}function Dt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=s.length,i=new Uint8Array(a);for(let c=0;c{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Bt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ht(e,t,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(e),Bt(a)}const P=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||P(r,t)};function Vt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ot(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Ut(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?Vt(r):Ot(r,s);return document.createTextNode(`${a}{${i}}`)}function Ze(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Ft();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Ut(c,r,a,s)),t.appendChild(l)}function Wt(e,t,r){Ze(e,t,":before",r),Ze(e,t,":after",r)}const et="application/font-woff",tt="image/jpeg",qt={woff:et,woff2:et,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:tt,jpeg:tt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function zt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=zt(e).toLowerCase();return qt[t]||""}function Gt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Kt(e,t){return`data:${t};base64,${e}`}async function mt(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((i,c)=>{const l=new FileReader;l.onerror=c,l.onloadend=()=>{try{i(r({res:s,result:l.result}))}catch(u){c(u)}},l.readAsDataURL(a)})}const Ce={};function Qt(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Me(e,t,r){const s=Qt(e,t,r.includeQueryParams);if(Ce[s]!=null)return Ce[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const i=await mt(e,r.fetchRequestInit,({res:c,result:l})=>(t||(t=c.headers.get("Content-Type")||""),Gt(l)));a=Kt(i,t)}catch(i){a=r.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return Ce[s]=a,a}async function Xt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function Yt(e,t){if(e.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,c==null||c.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return ve(l)}const r=e.poster,s=$e(r),a=await Me(r,s,t);return ve(a)}async function Jt(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await je(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zt(e,t){return P(e,HTMLCanvasElement)?Xt(e):P(e,HTMLVideoElement)?Yt(e,t):P(e,HTMLIFrameElement)?Jt(e,t):e.cloneNode(ht(e))}const er=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function tr(e,t,r){var s,a;if(ht(t))return t;let i=[];return er(e)&&e.assignedNodes?i=q(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=q(e.contentDocument.body.childNodes):i=q(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),i.length===0||P(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function rr(e,t,r){const s=t.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):dt(r).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&t.getAttribute("d")&&(c=`path(${t.getAttribute("d")})`),s.setProperty(i,c,a.getPropertyPriority(i))})}function sr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function nr(e,t){if(P(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function ar(e,t,r){return P(t,Element)&&(rr(e,t,r),Wt(e,t,r),sr(e,t),nr(e,t)),t}async function ir(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;iZt(s,t)).then(s=>tr(e,s,t)).then(s=>ar(e,s,t)).then(s=>ir(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,cr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function or(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function dr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function ur(e,t,r,s,a){try{const i=r?Mt(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(or(t),`$1${l}$3`)}catch{}return e}function mr(e,{preferredFontFormat:t}){return t?e.replace(lr,r=>{for(;;){const[s,,a]=cr.exec(r)||[];if(!a)return"";if(a===t)return`src: ${s};`}}):e}function pt(e){return e.search(ft)!==-1}async function gt(e,t,r){if(!pt(e))return e;const s=mr(e,r);return dr(s).reduce((i,c)=>i.then(l=>ur(l,c,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const a=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const i=await gt(a,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function hr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function fr(e,t){const r=P(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(P(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,$e(s),t);await new Promise((i,c)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(p){c(p)}}:c;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function pr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){P(e,Element)&&(await hr(e,t),await fr(e,t),await pr(e,t))}function gr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const rt={};async function st(e){let t=rt[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},rt[e]=t,t}async function nt(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async c=>{let l=c.replace(s,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),mt(l,t.fetchRequestInit,({result:u})=>(r=r.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>r)}function at(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(s);if(u===null)break;t.push(u[0])}s=s.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(c,"gi");for(;;){let u=i.exec(s);if(u===null){if(u=l.exec(s),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function xr(e,t){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let l=c+1;const u=i.href,p=st(u).then(f=>nt(f,t)).then(f=>at(f).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?l+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(f=>{console.error("Error loading remote css",f.toString())});s.push(p)}})}catch(i){const c=e.find(l=>l.href==null)||document.styleSheets[0];a.href!=null&&s.push(st(a.href).then(l=>nt(l,t)).then(l=>at(l).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{q(a.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),r))}function br(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function yr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await xr(r,t);return br(s)}function bt(e){return e.trim().replace(/["']/g,"")}function wr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(bt(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function vr(e,t){const r=await yr(e,t),s=wr(e);return(await Promise.all(r.filter(i=>s.has(bt(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return gt(i.cssText,c,t)}))).join(` `)}async function jr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await vr(e,t);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function _r(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await jr(a,t),await xt(a,t),gr(a,t),await Ht(a,r,s)}async function kr(e,t={}){const{width:r,height:s}=ut(e,t),a=await _r(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Pt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||At(c),c.style.width=`${p}`,c.style.height=`${f}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height),c}async function Sr(e,t={}){const r=await kr(e,t);return await Dt(r)}const Te="#ffffff";function Cr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function Er(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Cr():t}async function Nr(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Sr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Er(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}function Rr(e,t,r){const s=t?(e??[]).filter(c=>c.task_id===t):e??[],a=s.filter(c=>c.is_open===!1),i=a.reduce((c,l)=>c?(l.best_rank??Number.POSITIVE_INFINITY)<(c.best_rank??Number.POSITIVE_INFINITY)?l:c:l,null);return{visible:r?s.filter(c=>c.is_open!==!1):s,hiddenClosed:a,topHiddenClosed:i}}const Tr=5;function $r(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function be(e,t){return e?n.jsx(ye,{title:e}):t||"—"}function it(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ne(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Mr(e,t){if(e===t){const{year:u,month:p}=Ne(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ee[p]} ${u}`}]}const r=Ne(e),s=Ne(t);if(r.year===s.year){const u=s.month-r.month+1;let p=1;const f=12;u>f&&(p=Math.ceil(u/f));const y=[];for(let x=r.month;x<=s.month;x+=p)y.push({timestamp:new Date(r.year,x,1).getTime(),key:`${r.year}-${x}`,label:u<=3?`${Ee[x]} ${r.year}`:Ee[x]});return y}const a=s.year-r.year+1;let i=1;const c=12;a>c&&(i=Math.ceil(a/c));const l=[];for(let u=r.year;u<=s.year;u+=i)l.push({timestamp:new Date(u,0,1).getTime(),key:String(u),label:String(u)});return l}const Fr=({points:e,metric:t})=>{const r=St(),[s,a]=w.useState(null),i=880,c=320,l=60,u=30,p=40,f=50,y=e.map(o=>o.value),x=Math.min(...y),U=Math.max(...y)-x||1,ae=i-l-u,L=c-p-f,$=e.map(o=>it(o.date)),z=Math.min(...$),I=Math.max(...$),ie=I-z||1,Y=o=>z===I?l+ae/2:l+(o-z)/ie*ae,G=e.map((o,m)=>{const k=Y(it(o.date)),v=(o.value-x)/U,M=p+L*(1-v);return{x:k,y:M,data:o,idx:m}}),N=G.filter(o=>o.data.isSota);let O="";if(N.length>=2){O=`M${N[0].x},${N[0].y}`;for(let o=1;o{const m=o.data.modelName||o.data.paperTitle||"";if(!m)return null;const k=m.length>22?m.slice(0,21)+"…":m,v=k.length*H;let M=o.x-v/2,C=o.x+v/2,V="middle";return Mi-u&&(C=i-u,M=C-v,V="end"),{x:V==="start"?l:V==="end"?i-u:o.x,y:o.y-J,text:k,anchor:V,left:M,right:C}},ce=[],b=N.length>0?A(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ce.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ce.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=Mr(z,I),W=5,le=o=>a(m=>m===o?null:m),oe=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${ne(o.data.value)} on ${o.data.dateLabel}`,M=!!o.data.paperRouteId;return n.jsxs("g",{children:[m,n.jsx("circle",{cx:o.x,cy:o.y,r:"10",fill:"transparent",style:{cursor:M?"pointer":"default",outline:"none"},tabIndex:0,role:M?"link":"img","aria-label":v,onMouseEnter:()=>a(o.idx),onMouseLeave:()=>le(o.idx),onFocus:()=>a(o.idx),onBlur:()=>le(o.idx),onClick:()=>oe(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),oe(o.data.paperRouteId))},children:n.jsx("title",{children:v})})]},o.idx)};return n.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${c}`,style:{display:"block"},children:[n.jsx("text",{x:l-38,y:p+L/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${l-38} ${p+L/2})`,children:t}),Array.from({length:W}).map((o,m)=>{const k=m/(W-1),v=p+L*(1-k),M=x+U*k;return n.jsxs("g",{children:[n.jsx("line",{x1:l,y1:v,x2:i-u,y2:v,stroke:"var(--hairline)",strokeWidth:"1"}),n.jsx("text",{x:l-10,y:v+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:ne(M)})]},m)}),K.map(o=>{const m=Y(o.timestamp);return n.jsx("text",{x:m,y:c-f+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:o.label},o.key)}),G.filter(o=>!o.data.isSota).map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),O&&n.jsx("path",{d:O,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),N.map(o=>{const m=s===o.idx;return pe(o,n.jsx("circle",{cx:o.x,cy:o.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ce.map((o,m)=>n.jsx("text",{x:o.x,y:o.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:o.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:o.text},`label-${m}`)),s!==null&&G[s]&&(()=>{const o=G[s],m=o.data.modelName||o.data.paperTitle||"Unknown model",v=`${m.length>40?m.slice(0,39)+"…":m}: ${ne(o.data.value)}`,C=Math.max(120,Math.min(340,v.length*6.6+24)),V=30;let B=o.x-C/2;Bi-u&&(B=i-u-C);const Q=o.y-V-14>=p?o.y-V-12:o.y+12;return n.jsxs("g",{pointerEvents:"none",children:[n.jsx("rect",{x:B,y:Q,width:C,height:V,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),n.jsx("text",{x:B+12,y:Q+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:v})]})})()]})};function he(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}function Lr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Ir(e){const t=new Map;for(const r of e){const s=Lr(r),a=t.get(s);if(!a){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{}});continue}a.metrics={...a.metrics,...r.metrics||{}},a.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(a.ranksByMetric[r.best_metric]=r.best_rank)}return Array.from(t.values())}function ct(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function lt(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Pr(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=e.map(f=>{var E;const y=he((E=f.metrics)==null?void 0:E[t]),x=f.paper_published_date||"";return{eval:f,value:y,date:x}}).filter(f=>f.value!==null&&!!f.date).sort((f,y)=>f.date.localeCompare(y.date)),a=[];let i=null;for(const f of s){const y=i==null?!0:r==="↓"?f.valuei;y&&(i=f.value),a.push({value:f.value,date:f.date,dateLabel:f.date.slice(0,7),modelName:f.eval.model_name||"",paperTitle:f.eval.paper_title||"",paperRouteId:f.eval.paper_arxiv_id||f.eval.paper_id||null,isSota:y})}const l=e.map(f=>{var y;return{eval:f,value:he((y=f.metrics)==null?void 0:y[t])}}).filter(f=>f.value!==null).sort((f,y)=>r==="↓"?f.value-y.value:y.value-f.value)[0],u=(l==null?void 0:l.value)??0,p=(l==null?void 0:l.eval.model_name)||(l==null?void 0:l.eval.paper_title)||"";return{points:a,sota:u,sotaModel:p}}const ot=({targetRef:e,label:t})=>{const{toast:r}=kt(),[s,a]=w.useState("idle"),i=w.useRef(null);w.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const c=w.useCallback(async()=>{const u=e.current;if(u){a("copying"),u.classList.add("is-capturing"),u.offsetHeight,await new Promise(p=>window.requestAnimationFrame(()=>p()));try{await Nr(u),a("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>a("idle"),1500)}catch(p){a("idle"),r({title:"Copy failed",description:p instanceof Error&&p.message?p.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{u.classList.remove("is-capturing")}}},[e,t,r]),l=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return n.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:c,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[n.jsx(Nt,{name:"copy",size:11}),l]})},Xr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=vt(),[t]=jt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=_t(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=te({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>ee.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=te({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>ee.getEvaluationsByDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=te({queryKey:["dataset-tasks",(Pe=x.data)==null?void 0:Pe.id],queryFn:()=>ee.getDatasetTasks(x.data.id),enabled:!!((Ae=x.data)!=null&&Ae.id),staleTime:10*60*1e3}),ae=te({queryKey:["metric-directions"],queryFn:()=>ee.getMetricDirections(),staleTime:60*60*1e3}),L=w.useMemo(()=>{var d;return!s||!((d=E.data)!=null&&d.length)?null:E.data.find(g=>g.id===s)||null},[s,E.data]),$=w.useMemo(()=>{const d=U.data||[];if(d.length===0)return null;if(L!=null&&L.task_id&&d.some(h=>h.id===L.task_id))return L.task_id;if(r){const h=d.find(S=>S.slug===r);if(h)return h.id}if(d.length===1)return d[0].id;const g=E.data||[];if(g.length>0){const h=new Map;for(const j of g)h.set(j.task_id,(h.get(j.task_id)||0)+1);let S=null,T=-1;for(const j of d){const ue=h.get(j.id)||0;ue>T&&(T=ue,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=te({queryKey:["task-benchmark-trends",$,a.hide_closed_source_evals?!0:void 0],queryFn:()=>ee.getTrendingBenchmarks($,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!$&&!!((De=x.data)!=null&&De.id),staleTime:10*60*1e3}),I=w.useMemo(()=>{var d;return(((d=z.data)==null?void 0:d.results)||[]).find(g=>{var h;return g.id===((h=x.data)==null?void 0:h.id)})||null},[z.data,(Be=x.data)==null?void 0:Be.id]),ie=te({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,$],queryFn:()=>ee.getLeaderboardMetrics(x.data.id,$),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!$,staleTime:10*60*1e3}),Y=w.useMemo(()=>Rr(E.data,$,a.hide_closed_source_evals),[E.data,$,a.hide_closed_source_evals]),G=Y.visible,N=Y.hiddenClosed,O=Y.topHiddenClosed,H=w.useMemo(()=>Ir(G),[G]),fe=w.useMemo(()=>{const d=new Set;return H.forEach(g=>{g.best_metric&&d.add(g.best_metric),Object.keys(g.metrics||{}).forEach(h=>d.add(h))}),Array.from(d)},[H]),J=w.useMemo(()=>(ie.data||[]).map(d=>d.metric_name),[ie.data]),A=J.length?J:fe,ce=w.useMemo(()=>{var S;if(H.length===0)return A[0]||"";const d=new Map;for(const T of H)for(const j of Object.keys(T.metrics||{}))J.length&&!A.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[T,j]of d)j>h&&(h=j,g=T);return g||A[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,A,J]),b=c||(L==null?void 0:L.best_metric)||ce,K=(((Ue=(Oe=ae.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!A.includes(b)?A:[b,...A.filter(d=>d!==b)],[A,b]),le=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Tr),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Pr(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ae.isSuccess&&(!$||ie.isSuccess),v=k?b:m==null?void 0:m.metric,M=k?pe:m==null?void 0:m.value,C=k?o:m==null?void 0:m.model_name,V=!k&&!m;w.useEffect(()=>{if(p.current||!s||!E.data||E.data.length===0)return;const d=u.current;d&&(p.current=!0,d.scrollIntoView({behavior:"smooth",block:"start"}))},[s,E.data]);const B=w.useMemo(()=>{const d=U.data||[];return $?d.find(g=>g.id===$)||d[0]||null:d[0]||null},[U.data,$]);if(x.isLoading)return n.jsxs("div",{className:"page",children:[n.jsx(xe,{className:"h-12 w-1/2 mb-6"}),n.jsx(xe,{className:"h-64 w-full"})]});if(x.error||!x.data)return n.jsx("div",{className:"page",children:n.jsx(Ct,{variant:"destructive",children:n.jsx(Et,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var T,j;const h=he((T=d.metrics)==null?void 0:T[b]),S=he((j=g.metrics)==null?void 0:j[b]);return h!==null&&S!==null?K==="↓"?h-S:S-h:h!==null?-1:S!==null?1:lt(d,b)-lt(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>ct(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||$r(_.paper_url),X=(F==null?void 0:F.title)||_.introducing_paper_title||null,Z=((qe=F==null?void 0:F.published)==null?void 0:qe.slice(0,4))||_.introduced_year||null,yt=!!de||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${de}`:`Paper ${de}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(me,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(me,{to:`/tasks/${B.slug||B.id}`,children:B.name})]}),n.jsx("span",{className:"sep",children:"/"}),n.jsx("span",{style:{color:"var(--accent-text)"},children:_.name})]}),n.jsxs("div",{className:"bm-title-row",children:[n.jsx("h1",{className:"bm-title",children:_.name}),I&&n.jsxs("div",{className:"bm-title-trend","aria-label":`${_.name} reporting trend`,children:[n.jsx($t,{history:I.history,benchmarkName:I.name}),n.jsxs("span",{className:"bm-title-trend-summary",children:[n.jsx("strong",{children:I.recent_paper_count})," ",I.recent_paper_count===1?"paper":"papers",I.rate_change==null?I.recent_paper_count>0&&n.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):n.jsxs("span",{className:`benchmark-trend-change ${I.rate_change>=1?"is-up":"is-down"}`,children:[I.rate_change>=1?"↑":"↓"," ",I.rate_change.toFixed(1),"×"]})]})]})]}),n.jsxs("div",{className:"bm-subtitle",children:[V?n.jsx(xe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):n.jsxs("span",{children:[v&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"metric-tag",children:v}),n.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),C?n.jsxs("span",{children:["Best: ",n.jsx("span",{className:"best-name",children:ne(M)})," by ",n.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:C})]}):n.jsxs("span",{children:[Q.length," evaluations"]})]}),_.hf_url&&n.jsxs("a",{className:"bm-action-btn",href:_.hf_url,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),_.description&&n.jsx("p",{className:"bm-description",children:_.description}),a.hide_closed_source_evals&&N.length>0&&n.jsxs("div",{className:"bm-hidden-closed-notice",children:[n.jsxs("span",{children:[N.length," closed-source ",N.length===1?"row is":"rows are"," hidden",O!=null&&O.model_name?n.jsxs(n.Fragment,{children:[", including ",n.jsx("strong",{children:O.model_name})]}):null,"."]}),n.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{i(!1)},children:"Show closed-source"})]}),yt&&n.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[n.jsx("span",{className:"method-source-label",children:"Source"}),de?n.jsxs(me,{to:`/paper/${de}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):wt}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):_.paper_url?n.jsxs("a",{href:_.paper_url,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):_.paper_url}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]}):n.jsxs("div",{className:"method-source-link is-static",children:[n.jsx("span",{className:"method-source-title",children:X?n.jsx(ye,{title:X}):null}),Z&&n.jsx("span",{className:"method-source-meta",children:Z})]})]}),oe.filter(d=>d.isSota).length>=2&&n.jsxs("div",{className:"bm-card",ref:f,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ot,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(Fr,{points:oe,metric:b})}),n.jsxs("div",{className:"bm-chart-foot",children:[n.jsx("span",{className:"legend-dot"}),"All models over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]}),R&&(()=>{var T,j;const d=R.paper_arxiv_id||R.paper_id,g=R.paper_title||(R.paper_arxiv_id?`arXiv:${R.paper_arxiv_id}`:null),h=R.best_metric&&((T=R.metrics)==null?void 0:T[R.best_metric])!==void 0?R.best_metric:b,S=(j=R.metrics)==null?void 0:j[h];return n.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[n.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),n.jsxs("div",{className:"bm-highlight-text",children:[n.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),n.jsxs("span",{className:"bm-highlight-paper",children:[R.model_name||g||"—",R.harness?` · ${R.harness}`:""]}),n.jsxs("span",{className:"bm-highlight-meta",children:[S!==void 0&&h?n.jsxs(n.Fragment,{children:[h,": ",ne(S),g?" · ":""]}):null,d?n.jsx(me,{to:`/paper/${d}`,children:be(R.paper_title,g)}):be(R.paper_title,g)]})]})]})})(),n.jsxs("div",{className:"bm-card",ref:y,children:[n.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[n.jsxs("div",{className:"bm-card-screenshot-title",children:[n.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),n.jsx("span",{className:"bm-card-screenshot-name",children:_.name})]}),n.jsxs("div",{className:"bm-card-screenshot-brand",children:[n.jsxs("span",{className:"brand",children:[n.jsx("span",{className:"brand-mark"}),n.jsxs("span",{className:"brand-name",children:["Papers ",n.jsx("em",{children:"With Code"})]})]}),n.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),n.jsxs("div",{className:"bm-card-head",children:[n.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),n.jsxs("div",{className:"bm-card-actions",children:[A.length>1&&n.jsxs("label",{className:"bm-view-select",children:[n.jsx("span",{className:"bm-view-select-label",children:"View"}),n.jsx("select",{value:b,onChange:d=>l(d.target.value),children:W.map(d=>n.jsx("option",{value:d,children:d},d))})]}),n.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[n.jsx(Je,{className:"bm-closed-toggle-switch",checked:!a.hide_closed_source_evals,onCheckedChange:d=>{i(!d)},"aria-label":"Show closed-source models"}),n.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),n.jsx(ot,{targetRef:y,label:"leaderboard"})]})]}),E.isLoading?n.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((d,g)=>n.jsx(xe,{className:"h-10 w-full mb-2"},g))}):Q.length===0?n.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):n.jsx("div",{className:"bm-table-scroll",children:n.jsxs("table",{className:"bm-table",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:"col-rank",children:"Rank"}),n.jsx("th",{className:"col-model",children:"Model"}),Fe&&n.jsx("th",{className:"col-harness",children:"Harness"}),le.map(d=>{const g=d===b;return n.jsx("th",{className:`col-value ${g?"is-active":""}`,"aria-sort":g?K==="↓"?"ascending":"descending":"none",children:n.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>l(d),"aria-pressed":g,title:`Sort by ${d}`,children:[d,g?` ${K}`:""]})},d)}),n.jsx("th",{className:"col-paper",children:"Paper"}),n.jsx("th",{className:"col-year",children:"Year"})]})}),n.jsx("tbody",{children:(()=>{let d=null,g=0;return Q.map((h,S)=>{var Ke,Qe;const T=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;T!==null&&((d===null||T!==d)&&(g=S+1,d=T),j=g);const ue=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=ct(h,s);return n.jsxs("tr",{ref:ke?u:void 0,className:ke?"is-highlighted":void 0,children:[n.jsx("td",{className:"col-rank",children:j??"—"}),n.jsxs("td",{className:"col-model",children:[ke&&n.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),h.hf_model_url?n.jsx("a",{href:h.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${h.model_name||"model"} on Hugging Face`,children:h.model_name||"—"}):h.model_name||"—",h.is_open===!1&&n.jsx(Rt,{}),(h.external??h.is_external)&&n.jsx(Tt,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),le.map(Se=>{var Ye;const Xe=Se===b,ge=(Ye=h.metrics)==null?void 0:Ye[Se];return n.jsx("td",{className:`col-value${Xe?" is-active":""}${Xe&&j===1?" is-best":""}`,children:ge!=null&&ge!==""?ne(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:ue?n.jsx(me,{to:`/paper/${ue}`,children:be(h.paper_title,Ge)}):be(h.paper_title,Ge)}),n.jsx("td",{className:"col-year",children:((Qe=h.paper_published_date)==null?void 0:Qe.slice(0,4))||"—"})]},h.id)})})()})]})})]})]})})};export{Xr as default}; diff --git a/assets/BenchmarkTrendSparkline-097gkkLo.js b/assets/BenchmarkTrendSparkline-CQYwfeti.js similarity index 97% rename from assets/BenchmarkTrendSparkline-097gkkLo.js rename to assets/BenchmarkTrendSparkline-CQYwfeti.js index 1ebef680b9e2c07bc50817a474cbde6cbcedf0ca..595308b4d4b432baaeeaf32a967a23b8dec71a29 100644 --- a/assets/BenchmarkTrendSparkline-097gkkLo.js +++ b/assets/BenchmarkTrendSparkline-CQYwfeti.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-BHOUC_Zu.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; +import{r as C,j as t}from"./index-gsUrUwg6.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; diff --git a/assets/ChatView-BMNQRO1E.js b/assets/ChatView-BMNQRO1E.js deleted file mode 100644 index 8fd5f391eed61a12024b11f1c40fed1cf5f9c971..0000000000000000000000000000000000000000 --- a/assets/ChatView-BMNQRO1E.js +++ /dev/null @@ -1,11 +0,0 @@ -import{r as u,j as e,L as We,R as be,c as Be,d as Ce,e as He,a as qe,u as Ve,f as Ke}from"./index-BHOUC_Zu.js";import{M as Ge,S as X,A as Xe,C as ze,a as Se,b as Je,r as Qe,F as Ze,D as et,l as tt,c as ve,d as je,e as we,f as st,g as at,h as G,t as Q,P as nt,i as _e,j as rt,T as ot,u as Ne,k as it}from"./chatSessions-DxE8uXe5.js";import"./katex.min-BSBacQyE.js";import{H as ct,a as lt,b as dt}from"./hover-card-CYqiITh9.js";import{M as ut,r as ht,d as mt}from"./index-Ybm9YyT5.js";import{r as pt,a as ft}from"./index-BYJflHqW.js";const Oe=({onSend:t,busy:a,placeholder:r,autoFocus:m,draft:c,onDraftChange:d,onStop:h,models:f=[],selectedModel:y,onModelChange:w})=>{const[j,_]=u.useState(""),N=u.useRef(null);u.useEffect(()=>{const g=N.current;g&&(g.style.height="auto",g.style.height=`${Math.min(g.scrollHeight,200)}px`)},[j]),u.useEffect(()=>{var g;m&&((g=N.current)==null||g.focus())},[m]),u.useEffect(()=>{c!==void 0&&_(c)},[c]);const R=()=>{const g=j.trim();!g||a||(_(""),d==null||d(""),t(g))};return e.jsxs("div",{className:"chat-composer",children:[e.jsx("textarea",{ref:N,rows:1,value:j,placeholder:r||"Ask anything about research…",onChange:g=>{_(g.target.value),d==null||d(g.target.value)},onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),R())}}),e.jsxs("div",{className:"chat-composer-row",children:[e.jsxs("div",{className:"chat-composer-tools",children:[f.length>0&&y&&w&&e.jsx(Ge,{models:f,selectedModel:y,onModelChange:w,disabled:a}),e.jsx("span",{className:"chat-composer-hint",children:"Enter to send · Shift+Enter for newline"})]}),e.jsx("button",{type:"button",className:`chat-send${a||j.trim()?" chat-send-on":""}`,onClick:a?h:R,disabled:a?!h:!j.trim(),"aria-label":a?"Stop generating":"Send message",children:a?h?e.jsx("span",{"aria-hidden":"true",children:"■"}):e.jsx(X,{light:!0}):e.jsx(Xe,{})})]})]})};function se(t){if(!t.authors.length)return"";const a=t.authors.slice(0,3).map(r=>r.name).join(", ");return t.authors.length>3?`${a}, et al.`:a}function De(t){var r;if(t.conference)return t.conference;const a=(r=t.published)==null?void 0:r.slice(0,4);if(t.arxiv_id)return a?`arXiv ${a}`:"arXiv";if(t.source_url)try{return new URL(t.source_url).hostname.replace(/^www\./,"")}catch{}return a??"external"}function gt(t,a=240){const r=t.content.trim();return r.length<=a?r:`${r.slice(0,a).trimEnd()}…`}const xt=({seed:t=0})=>e.jsxs("div",{className:"chat-thumb","aria-hidden":"true",children:[e.jsxs("div",{className:"chat-thumb-title",children:[e.jsx("span",{}),e.jsx("span",{})]}),e.jsx("div",{className:"chat-thumb-auth"}),e.jsxs("div",{className:"chat-thumb-cols",children:[e.jsx("div",{className:"chat-thumb-col"}),e.jsx("div",{className:"chat-thumb-col"})]}),e.jsx("div",{className:"chat-thumb-fig",style:{top:62+t%3*8}})]}),yt=({paper:t,seed:a})=>{const[r,m]=be.useState(!1),c=Be(t.metadata.thumbnail_url);return be.useEffect(()=>m(!1),[c]),!c||r?e.jsx(xt,{seed:a}):e.jsx("div",{className:"chat-thumb chat-thumb-real",children:e.jsx("img",{src:c,alt:"",loading:"lazy",decoding:"async",onError:()=>m(!0)})})},ae=({routeId:t,paper:a,className:r="chat-paper-link",children:m})=>{const c=e.jsx(We,{className:r,to:`/paper/${t}`,target:"_blank",rel:"noopener noreferrer",children:m});if(!a)return c;const d=a.metadata,h=t.split("").reduce((f,y)=>f+y.charCodeAt(0),0);return e.jsxs(ct,{openDelay:150,closeDelay:100,children:[e.jsx(lt,{asChild:!0,children:c}),e.jsx(dt,{className:"chat-paper-pop",side:"bottom",align:"start",children:e.jsxs("div",{className:"chat-paper-pop-inner",children:[e.jsx(yt,{paper:a,seed:h}),e.jsxs("div",{className:"chat-paper-pop-meta",children:[e.jsx("div",{className:"chat-paper-pop-title",children:a.title}),se(d)&&e.jsx("div",{className:"chat-paper-pop-auth",children:se(d)}),e.jsxs("div",{className:"chat-paper-pop-venue",children:[De(d),d.arxiv_id&&e.jsxs(e.Fragment,{children:[" · arXiv:",d.arxiv_id]}),d.citation_count!=null&&e.jsxs(e.Fragment,{children:[" · ↑ ",d.citation_count.toLocaleString()]})]}),d.tasks.length>0&&e.jsx("div",{className:"chat-paper-pop-tags",children:d.tasks.map(f=>e.jsx("span",{className:"chat-pp-tag",children:f.name},f.slug))})]})]})})]})};function bt(t){const a=t.lastIndexOf("[");if(a===-1)return t;const r=t.slice(a);return/^\[[^\]]*(\]\(?[^)\s]*)?$/.test(r)?t.slice(0,a):t}const vt=t=>t.startsWith("paper:")?t:mt(t),jt=({text:t,streaming:a,papers:r,validCitationIds:m})=>{const c=a?bt(t):t;return e.jsx(ut,{remarkPlugins:[ht,ft],rehypePlugins:[pt],urlTransform:vt,components:{a:({href:d,children:h})=>{if(d!=null&&d.startsWith("paper:")){const f=d.slice(6);return!r[f]&&!(m!=null&&m.has(f))?e.jsx("span",{className:"chat-invalid-citation",children:h}):e.jsx(ae,{routeId:f,paper:r[f],children:h})}return e.jsx("span",{children:h})}},children:c})},Ae=()=>e.jsx("span",{className:"chat-caret"}),wt=({text:t,papers:a,validCitationIds:r})=>{const m=[],c=/\[([^\]\n]+)\]\(paper:([^) \t\n]+)\)/g;let d=0;for(const h of t.matchAll(c)){const f=h.index??0;m.push(t.slice(d,f));const[,y,w]=h;m.push(r.has(w)||a[w]?e.jsx(ae,{routeId:w,paper:a[w],children:y},`${f}-${w}`):e.jsx("span",{children:y},`${f}-${w}`)),d=f+h[0].length}return m.push(t.slice(d)),e.jsx(e.Fragment,{children:m})},_t=({block:t,papers:a,validCitationIds:r,onToggle:m})=>t.active?e.jsxs("div",{className:"chat-reason-live",children:[e.jsxs("div",{className:"chat-reason-live-head",children:[e.jsx(X,{})," ",e.jsx("span",{children:"Thinking…"})]}),e.jsxs("div",{className:"chat-reason-live-body",children:[t.text,e.jsx(Ae,{})]})]}):e.jsxs("div",{className:"chat-reason-done",children:[e.jsxs("button",{type:"button",className:"chat-reason-done-head",onClick:m,children:[e.jsx(ze,{}),e.jsx("span",{children:"Thought for a few seconds"}),e.jsx(Se,{open:t.open})]}),t.open&&e.jsx("div",{className:"chat-reason-done-body",children:e.jsx(wt,{text:t.text,papers:a,validCitationIds:r})})]}),Nt=({block:t,papers:a,onToggle:r})=>{var j,_,N,R;const m=t.status==="running",c=t.schema_version===2||!!t.content,d=t.status==="error"||t.status==="denied",h=typeof t.args.query=="string"?t.args.query:"",f=typeof t.args.command=="string"?t.args.command:typeof t.args.file_path=="string"?t.args.file_path:h,y=((j=t.content)==null?void 0:j.map(g=>g.text).join(""))??"",w=m?"running…":c?`${t.status} · ${t.took_ms??0} ms`:`${t.hits} results · ${t.took_ms} ms`;return e.jsxs("div",{className:`chat-tool${m?" chat-tool-running":""}${d?" chat-tool-failed":""}`,children:[e.jsxs("button",{type:"button",className:"chat-tool-head",onClick:r,disabled:m,"aria-expanded":m?void 0:t.open,children:[e.jsxs("span",{className:"chat-tool-head-left",children:[m?e.jsx(X,{}):e.jsx(Je,{}),e.jsx("code",{className:"chat-tool-name",children:t.name}),e.jsx("span",{className:"chat-tool-query",children:c?f:`("${h}")`})]}),e.jsxs("span",{className:"chat-tool-head-right",children:[e.jsx("span",{className:"chat-tool-status",children:w}),!m&&e.jsx(Se,{open:t.open})]})]}),!m&&t.open&&e.jsxs("div",{className:"chat-tool-body",children:[e.jsxs("div",{className:"chat-tool-args",children:[e.jsx("span",{className:"chat-tool-label",children:"arguments"}),e.jsx("pre",{children:JSON.stringify(t.args,null,2)})]}),c?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"chat-tool-output-head",children:[e.jsx("span",{className:"chat-tool-label",children:"result"}),e.jsx("button",{type:"button",className:"chat-tool-copy",onClick:()=>void navigator.clipboard.writeText(y),children:"Copy"})]}),e.jsx("pre",{className:"chat-tool-output",children:e.jsx("code",{children:y})}),((_=t.metadata)==null?void 0:_.output_truncated)&&e.jsx("div",{className:"chat-tool-truncated",children:"Output was truncated."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"chat-tool-label chat-tool-results-label",children:["returned ",((N=t.results)==null?void 0:N.length)??0," papers"]}),e.jsx("ol",{className:"chat-tool-results",children:(R=t.results)==null?void 0:R.map(g=>e.jsxs("li",{className:"chat-hit",children:[e.jsx("div",{className:"chat-hit-top",children:e.jsx(ae,{routeId:g.route_id,paper:a[g.route_id],className:"chat-hit-title",children:g.title})}),e.jsx("div",{className:"chat-hit-meta",children:[se(g.metadata),De(g.metadata)].filter(Boolean).join(" · ")}),e.jsxs("div",{className:"chat-hit-snippet",children:[gt(g),g.content_truncated&&e.jsx("span",{className:"chat-hit-truncated",children:" (truncated)"})]})]},g.route_id))})]})]})]})},Ot=({block:t,papers:a,validCitationIds:r})=>e.jsxs("div",{className:"chat-answer",children:[e.jsx(jt,{text:t.text,streaming:!t.done,papers:a,validCitationIds:r}),!t.done&&!!t.text.trim()&&e.jsx(Ae,{})]}),Rt=({text:t})=>e.jsx("div",{className:"chat-msg chat-msg-user",children:e.jsx("div",{className:"chat-bubble",children:t})}),Tt=({msg:t,papers:a,onToggleBlock:r})=>{var m,c;return e.jsx("div",{className:"chat-msg chat-msg-assistant",children:e.jsxs("div",{className:"chat-msg-blocks",children:[t.streaming&&(((m=t.blocks)==null?void 0:m.length)??0)===0&&e.jsxs("div",{className:"chat-reason-live-head",children:[e.jsx(X,{})," ",e.jsx("span",{children:"Thinking…"})]}),(c=t.blocks)==null?void 0:c.map((d,h)=>{const f=`${t.id}-${h}`,y="citations"in d&&d.citations!==void 0?d.citations:t.citations??[],w=new Set(y.map(j=>j.route_id));return d.kind==="reasoning"?e.jsx(_t,{block:d,papers:a,validCitationIds:w,onToggle:()=>r(t.id,h)},f):d.kind==="tool"?e.jsx(Nt,{block:d,papers:a,onToggle:()=>r(t.id,h)},f):e.jsx(Ot,{block:d,papers:a,validCitationIds:w},f)}),t.error&&e.jsxs("div",{className:"chat-error",children:["The assistant hit an error: ",t.error]}),!t.streaming&&t.finishReason&&t.finishReason!=="success"&&e.jsx("div",{className:"chat-finish-note",children:["tool_limit","max_turns"].includes(t.finishReason)?"The assistant stopped at the execution limit.":`The assistant stopped early (${t.finishReason.replace(/_/g," ")}).`})]})})},E=(t,a)=>new Promise(r=>{const m=setTimeout(c,t);function c(){a==null||a.removeEventListener("abort",c),clearTimeout(m),r()}a==null||a.addEventListener("abort",c)}),A=t=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...t}),P={name:"Object Detection",slug:"object-detection"},I={name:"Real-Time Object Detection",slug:"real-time-object-detection"},kt={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:A({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[P,I],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:A({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[P,I],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:A({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[P,I],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:A({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[P,I],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:A({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[P,I],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:A({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[P,I],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:A({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},P],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:A({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[P,I],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},Pe=t=>t.map(a=>kt[a]),Re=Pe(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),Te=Pe(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),ke="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",Ee="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",Le=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve. - -**At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency. - -**At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost. - -**My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,Et=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*Lt(t,a){const r=()=>(a==null?void 0:a.aborted)===!0,m=t.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await E(350,a),!r()){yield{type:"reasoning_start"};for(let c=0;c{const a=String("0").trim().toLowerCase();return a==="1"||a==="true"||a==="yes"};function Ct(t,a={}){return Ie()?St(t,a.signal):Lt(t.message,a.signal)}async function*St(t,a){const r=await fetch(Ce("/api/v1/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"include",body:JSON.stringify(t),signal:a});if(!r.ok||!r.body){const h=await r.json().catch(()=>null),f=h==null?void 0:h.detail;throw new Error((f==null?void 0:f.message)||f||`Chat stream failed (${r.status})`)}const m=r.body.getReader(),c=new TextDecoder;let d="";try{for(;;){const{done:h,value:f}=await m.read();if(h)break;d+=c.decode(f,{stream:!0});let y;for(;(y=d.indexOf(` - -`))!==-1;){const w=d.slice(0,y);d=d.slice(y+2);const j=w.split(` -`).filter(_=>_.startsWith("data:")).map(_=>_.slice(5).trimStart()).join(` -`);!j||j==="[DONE]"||(yield JSON.parse(j))}}}finally{m.releaseLock()}}function Dt(t){const[a,r]=u.useState([]),[m,c]=u.useState(!1),d=u.useRef(!1),h=u.useRef(null),f=u.useRef([]),y=u.useRef(t),w=u.useRef(""),j=u.useRef(""),_=u.useRef(0);y.current=t,f.current=a,u.useEffect(()=>()=>{var l;return(l=h.current)==null?void 0:l.abort()},[]);const N=u.useMemo(()=>{const l={};for(const o of a)for(const x of o.blocks??[])if(x.kind==="tool")for(const p of x.results??[])l[p.route_id]=p;return l},[a]),R=()=>`m${++_.current}_${Date.now().toString(36)}`,g=l=>r(o=>{if(!o.length)return o;const x=o.slice();return x[x.length-1]=l(x[x.length-1]),x}),z=l=>g(o=>({...o,blocks:[...o.blocks??[],l]})),Y=(l,o)=>g(x=>({...x,blocks:(x.blocks??[]).map((p,T,b)=>l(p,T,b)?o(p):p)})),B=l=>(o,x,p)=>o.kind===l&&p.findLastIndex(T=>T.kind===l)===x,H=l=>{switch(l.type){case"stream_start":l.session_id&&y.current.onSessionId(l.session_id);break;case"sandbox_start":case"sandbox_ready":break;case"session_title_start":j.current="";break;case"session_title_delta":j.current+=l.text,y.current.onTitle(j.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":j.current=l.title,y.current.onTitle(l.title);break;case"reasoning_start":z({kind:"reasoning",text:"",active:!0,open:!0});break;case"reasoning_delta":Y(B("reasoning"),o=>o.kind==="reasoning"?{...o,text:o.text+l.text}:o);break;case"reasoning_end":Y(B("reasoning"),o=>o.kind==="reasoning"?{...o,active:!1,open:!1}:o);break;case"tool_call":z({kind:"tool",id:l.id,name:l.name,args:l.args,status:"running",open:!1});break;case"tool_result":Y(o=>o.kind==="tool"&&o.id===l.id,o=>o.kind==="tool"?l.status?{...o,schema_version:2,status:l.status,took_ms:l.took_ms,content:l.content,metadata:l.metadata,open:l.status!=="success"}:{...o,status:"done",hits:l.hits,took_ms:l.took_ms,results:l.results}:o);break;case"answer_delta":g(o=>{const x=o.blocks??[],p=x.at(-1);return(p==null?void 0:p.kind)==="answer"&&!p.done?{...o,blocks:[...x.slice(0,-1),{...p,text:p.text+l.text}]}:{...o,blocks:[...x,{kind:"answer",text:l.text,done:!1}]}});break;case"done":g(o=>({...o,streaming:!1,followups:l.followups,finishReason:l.finish_reason,citations:l.citations,blocks:(o.blocks??[]).map(x=>x.kind==="answer"?{...x,done:!0}:x)}));break;case"error":g(o=>({...o,streaming:!1,error:l.message}));break}},Z=u.useCallback(l=>{const o=l.trim();if(!o||d.current)return!1;d.current=!0;const x=new AbortController;h.current=x,w.current=o;const p=[...f.current].reverse().find(b=>b.role==="user"),T=p!=null&&p.status&&p.status!=="complete"&&p.revision?{replace_message_id:p.id,prior_revision:p.revision}:null;return r(b=>{const L={id:R(),role:"user",text:o},F={id:R(),role:"assistant",streaming:!0,blocks:[]};if(!T)return[...b,L,F];const $=b.findLastIndex(D=>D.id===p.id);return $<0?[...b,L,F]:[...b.slice(0,$),L,F]}),c(!0),(async()=>{try{for await(const b of Ct({message:o,session_id:y.current.sessionId,client_message_id:crypto.randomUUID(),...!y.current.sessionId&&y.current.initialModel?{initial_model:y.current.initialModel}:{},...T??{}},{signal:x.signal}))x.signal.aborted||H(b)}catch(b){x.signal.aborted||H({type:"error",message:b instanceof Error?b.message:"The assistant stream failed."})}finally{h.current===x&&(d.current=!1,c(!1),g(b=>b.streaming?{...b,streaming:!1}:b),y.current.onSettled())}})(),!0},[]),C=u.useCallback(()=>{h.current&&(h.current.abort(),h.current=null,d.current=!1,c(!1),r(l=>{const o=l.at(-1);if((o==null?void 0:o.role)!=="assistant")return l;const x=(o.blocks??[]).flatMap(p=>p.kind==="tool"&&p.status==="running"?[]:p.kind==="reasoning"&&p.active?[]:p.kind==="answer"?[{...p,done:!0}]:[p]);return[...l.slice(0,-1),{...o,blocks:x,streaming:!1,finishReason:"stopped"}]}),y.current.onInterrupted(w.current),window.setTimeout(y.current.onSettled,250))},[]),S=u.useCallback((l,o)=>r(x=>x.map(p=>{var T;return p.id!==l?p:{...p,blocks:(T=p.blocks)==null?void 0:T.map((b,L)=>L===o&&(b.kind==="reasoning"||b.kind==="tool")?{...b,open:!b.open}:b)}})),[]),ee=u.useCallback(()=>{var l;(l=h.current)==null||l.abort(),h.current=null,d.current=!1,r([]),c(!1)},[]),M=u.useCallback(l=>{var o;(o=h.current)==null||o.abort(),h.current=null,d.current=!1,r(l),c(!1)},[]);return{messages:a,busy:m,papers:N,send:Z,stop:C,toggleBlock:S,reset:ee,load:M}}const At=["What's the state of the art for real-time object detection?","Recommend recent papers on retrieval-augmented generation","Which open LLMs are best for on-device inference?"],Ut=()=>{var ye;const{sessionId:t}=He(),a=qe(),[r,m]=Ve(),{user:c,isLoading:d}=Ke(),[h,f]=u.useState([]),[y,w]=u.useState(!1),[j,_]=u.useState(""),[N,R]=u.useState(()=>t?{id:t,status:"loading"}:null),[g,z]=u.useState(0),Y=u.useRef(Qe()),B=u.useRef(r.get("model")||((ye=Y.current)==null?void 0:ye.model)),[H,Z]=u.useState(Ze),[C,S]=u.useState(B.current||et),[ee,M]=u.useState(""),[l,o]=u.useState(""),[x,p]=u.useState(()=>{var s,n;return((s=r.get("q"))==null?void 0:s.trim())||((n=Y.current)==null?void 0:n.prompt)||""}),T=u.useRef(!1),[b,L]=u.useState(null),[F,$]=u.useState(""),[D,q]=u.useState(null),[ne,re]=u.useState(()=>typeof window>"u"||window.innerWidth>900),oe=u.useRef(new Set),ie=u.useRef(!1),ce=u.useRef(t),V=u.useRef(null);ce.current=t;const U=u.useCallback(async()=>{if(!c)return;const s=!ie.current;s&&w(!0);try{f(await tt()),ie.current=!0,_("")}catch(n){_(n instanceof Error?n.message:"Could not load chats")}finally{s&&w(!1)}},[c]),v=Dt({sessionId:t??null,initialModel:C,onSessionId:s=>{V.current=s,R({id:s,status:"loaded"}),a(`/chat/${s}`,{replace:!0})},onTitle:s=>{t&&!oe.current.has(t)&&(M(s),f(n=>n.map(i=>i.id===t?{...i,title:s}:i)))},onSettled:()=>{U(),t&&G(t).then(s=>v.load(Q(s)))},onInterrupted:s=>{o(s),t&&window.setTimeout(()=>{G(t).then(n=>v.load(Q(n)))},450)}}),le=v.load,de=v.send,K=u.useCallback(s=>{if(!c){sessionStorage.setItem(ve,s),sessionStorage.setItem(je,C),sessionStorage.setItem(we,"1"),window.location.href=Ce(`/api/v1/auth/hf/login?return_to=${encodeURIComponent("/chat")}`);return}de(s)&&(st(),o(""))},[C,de,c]);u.useEffect(()=>{if(d||!c)return;const s=sessionStorage.getItem(je);s&&S(s),U(),at().then(O=>{if(Z(O.items),!ce.current){const k=B.current||s;S(k&&O.items.some(Ue=>Ue.id===k)?k:O.default_model)}});const n=sessionStorage.getItem(ve),i=sessionStorage.getItem(we)==="1";n&&(i?p(n):o(n))},[d,U,c]),u.useEffect(()=>{if(!t){V.current!==null&&(V.current=null,v.reset()),R(null);return}if(V.current===t||(R(n=>(n==null?void 0:n.id)===t&&n.status==="loading"?n:{id:t,status:"loading"}),d||!c||v.busy))return;let s=!1;return _(""),G(t).then(n=>{s||(v.load(Q(n)),S(n.selected_model),M(n.title),V.current=t,R({id:t,status:"loaded"}))}).catch(n=>{if(s)return;const i=n instanceof Error?n.message:"Chat not found";v.reset(),_(i),R({id:t,status:"error",error:i})}),()=>{s=!0}},[d,t,c,v.busy,g]),u.useEffect(()=>{var O;const s=(O=r.get("q"))==null?void 0:O.trim();if(!s)return;T.current=!1;const n=r.get("model");n&&S(n),p(s);const i=new URLSearchParams(r);i.delete("q"),i.delete("model"),m(i,{replace:!0})},[r,m]),u.useEffect(()=>{if(d||v.busy||!x||T.current)return;const s=window.setTimeout(()=>{if(T.current)return;T.current=!0;const n=x;p(""),K(n)},0);return()=>window.clearTimeout(s)},[d,v.busy,x,K]),u.useEffect(()=>{const s=()=>{!c||v.busy||(U(),t&&G(t).then(n=>le(Q(n))))};return window.addEventListener("focus",s),()=>window.removeEventListener("focus",s)},[v.busy,le,U,t,c]),u.useEffect(()=>{if(!D)return;const s=()=>q(null),n=i=>{i.key==="Escape"&&s()};return window.addEventListener("click",s),window.addEventListener("keydown",n),()=>{window.removeEventListener("click",s),window.removeEventListener("keydown",n)}},[D]);const ue=()=>{v.reset(),o(""),M(""),a("/chat")},he=async s=>{const n=F.trim();if(n)try{const i=await Ne(s,{title:n});oe.current.add(s),s===t&&M(i.title),f(O=>O.map(k=>k.id===s?i:k)),L(null)}catch(i){_(i instanceof Error?i.message:"Rename failed")}},Ye=async s=>{const n=s===t&&v.busy;if(window.confirm(n?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){n&&v.stop();try{if(n){const i=Date.now()+3e3;for(;(await G(s)).is_busy;){if(Date.now()>=i)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(k=>window.setTimeout(k,150))}}await it(s),s===t&&ue(),await U()}catch(i){_(i instanceof Error?i.message:"Delete failed")}}},me=async s=>{const n=C;if(S(s),!!t)try{const i=await Ne(t,{selected_model:s});f(O=>O.map(k=>k.id===t?{...k,selected_model:i.selected_model}:k)),_("")}catch(i){S(n),_(i instanceof Error?i.message:"Model change failed")}},[Me,Fe]=u.useState(60);u.useLayoutEffect(()=>{const s=document.querySelector(".app-header");if(!s)return;const n=()=>Fe(s.offsetHeight);n();const i=new ResizeObserver(n);return i.observe(s),()=>i.disconnect()},[]);const te=u.useRef(null),J=u.useRef(null),$e=(s,n)=>{var i;J.current=((i=te.current)==null?void 0:i.scrollTop)??null,v.toggleBlock(s,n)};u.useLayoutEffect(()=>{const s=te.current;if(s){if(J.current!==null){s.scrollTop=J.current,J.current=null;return}s.scrollTop=s.scrollHeight}},[v.messages]);const W=h.find(s=>s.id===t),pe=v.messages.length===0,fe=(N==null?void 0:N.id)===t,ge=!!(t&&(d||c&&(!fe||(N==null?void 0:N.status)==="loading"))),xe=fe&&(N==null?void 0:N.status)==="error"?N.error:void 0;return e.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${Me}px)`},children:[e.jsxs("aside",{className:`chat-sidebar${ne?"":" chat-sidebar-closed"}`,children:[e.jsxs("div",{className:"chat-sidebar-top",children:[e.jsxs("button",{type:"button",className:"chat-new-chat",onClick:ue,children:[e.jsx(nt,{})," New chat"]}),e.jsx("button",{type:"button",className:"icon-btn",onClick:()=>re(!1),title:"Collapse sidebar",children:e.jsx(_e,{})})]}),e.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[y&&e.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!y&&j&&e.jsx("div",{className:"chat-sessions-empty",children:j}),!y&&!j&&h.length===0&&e.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),rt(h).map(s=>e.jsxs("div",{className:"chat-session-group",children:[e.jsx("div",{className:"chat-session-group-label",children:s.label}),s.items.map(n=>e.jsxs("div",{className:`chat-session${n.id===t?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>a(`/chat/${n.id}`),onKeyDown:i=>{if(i.key==="Enter"&&a(`/chat/${n.id}`),i.key==="F2"&&(L(n.id),$(n.title)),i.key==="ContextMenu"||i.shiftKey&&i.key==="F10"){i.preventDefault();const O=i.currentTarget.getBoundingClientRect();q({id:n.id,x:O.right-150,y:O.bottom})}},onContextMenu:i=>{i.preventDefault(),q({id:n.id,x:i.clientX,y:i.clientY})},children:[b===n.id?e.jsx("input",{className:"chat-session-title-input",value:F,autoFocus:!0,maxLength:80,onClick:i=>i.stopPropagation(),onChange:i=>$(i.target.value),onBlur:()=>void he(n.id),onKeyDown:i=>{i.stopPropagation(),i.key==="Enter"&&he(n.id),i.key==="Escape"&&L(null)}}):e.jsx("span",{className:"chat-session-title",children:n.title}),e.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:i=>{i.stopPropagation();const O=i.currentTarget.getBoundingClientRect();q({id:n.id,x:O.right-150,y:O.bottom})},children:"⋯"}),e.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:i=>{i.stopPropagation(),Ye(n.id)},children:e.jsx(ot,{})})]},n.id))]},s.label))]}),D&&e.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:D.x,top:D.y},onClick:s=>s.stopPropagation(),children:e.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const s=h.find(n=>n.id===D.id);s&&(L(s.id),$(s.title)),q(null)},children:"Rename chat"})})]}),e.jsxs("section",{className:"chat-main",children:[e.jsxs("div",{className:"chat-topbar",children:[!ne&&e.jsx("button",{type:"button",className:"icon-btn",onClick:()=>re(!0),title:"Open sidebar",children:e.jsx(_e,{})}),e.jsx("span",{className:"chat-topbar-title",children:ge?(W==null?void 0:W.title)||"":ee||(W==null?void 0:W.title)||(pe?"":"New chat")})]}),ge?e.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[e.jsx(X,{}),e.jsx("span",{children:"Loading conversation…"})]}):xe?e.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[e.jsx("p",{children:xe}),e.jsx("button",{type:"button",onClick:()=>{R({id:t,status:"loading"}),z(s=>s+1)},children:"Try again"})]}):pe?e.jsx("div",{className:"chat-empty",children:e.jsxs("div",{className:"chat-empty-inner",children:[e.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),e.jsxs("h1",{className:"chat-empty-title",children:["Ask ",e.jsx("em",{children:"Papers With Code"})]}),e.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),e.jsx(Oe,{onSend:K,busy:v.busy,onStop:v.stop,autoFocus:!0,draft:l,onDraftChange:o,models:H,selectedModel:C,onModelChange:s=>void me(s)}),e.jsx("div",{className:"chat-examples",children:At.map(s=>e.jsx("button",{type:"button",className:"chat-example",onClick:()=>K(s),children:s},s))})]})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"chat-conversation",ref:te,children:e.jsx("div",{className:"chat-conversation-inner",children:v.messages.map(s=>s.role==="user"?e.jsx(Rt,{text:s.text??""},s.id):e.jsx(Tt,{msg:s,papers:v.papers,onToggleBlock:$e},s.id))})}),e.jsx("div",{className:"chat-composer-wrap",children:e.jsxs("div",{className:"chat-composer-inner",children:[e.jsx(Oe,{onSend:K,busy:v.busy,onStop:v.stop,placeholder:l?"Edit and send again…":"Ask a follow-up…",draft:l,onDraftChange:o,models:H,selectedModel:C,onModelChange:s=>void me(s)}),e.jsx("div",{className:"chat-composer-foot",children:Ie()?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),e.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):e.jsx(e.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]})]})};export{Ut as default}; diff --git a/assets/ChatView-Cn8694zt.js b/assets/ChatView-Cn8694zt.js new file mode 100644 index 0000000000000000000000000000000000000000..8678e226aafa0fee2bef8c55c6855969fdbf64cb --- /dev/null +++ b/assets/ChatView-Cn8694zt.js @@ -0,0 +1,11 @@ +import{r as d,j as t,R as se,L as We,c as qe,g as Be,d as Ce,e as He,a as Ke,u as Ve,f as Ge}from"./index-gsUrUwg6.js";import{M as Xe,S as X,A as ze,C as Je,a as Se,b as Qe,r as Ze,F as et,D as tt,l as st,c as ve,d as je,e as we,f as at,g as nt,h as G,t as Q,P as rt,i as _e,j as ot,T as it,u as Oe,k as ct}from"./chatSessions-DgD7qgsg.js";import"./katex.min-BSBacQyE.js";import{H as lt,a as dt,b as ut}from"./hover-card-BmN6fO7d.js";import{u as ht}from"./useQuery-CPia3mbp.js";import{M as mt,r as pt,d as ft}from"./index-7RUPpdcZ.js";import{r as gt,a as xt}from"./index-B6ekb6Wc.js";const Ne=({onSend:e,busy:s,placeholder:n,autoFocus:h,draft:c,onDraftChange:u,onStop:m,models:f=[],selectedModel:b,onModelChange:y})=>{const[v,O]=d.useState(""),_=d.useRef(null);d.useEffect(()=>{const g=_.current;g&&(g.style.height="auto",g.style.height=`${Math.min(g.scrollHeight,200)}px`)},[v]),d.useEffect(()=>{var g;h&&((g=_.current)==null||g.focus())},[h]),d.useEffect(()=>{c!==void 0&&O(c)},[c]);const N=()=>{const g=v.trim();!g||s||(O(""),u==null||u(""),e(g))};return t.jsxs("div",{className:"chat-composer",children:[t.jsx("textarea",{ref:_,rows:1,value:v,placeholder:n||"Ask anything about research…",onChange:g=>{O(g.target.value),u==null||u(g.target.value)},onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),N())}}),t.jsxs("div",{className:"chat-composer-row",children:[t.jsxs("div",{className:"chat-composer-tools",children:[f.length>0&&b&&y&&t.jsx(Xe,{models:f,selectedModel:b,onModelChange:y,disabled:s}),t.jsx("span",{className:"chat-composer-hint",children:"Enter to send · Shift+Enter for newline"})]}),t.jsx("button",{type:"button",className:`chat-send${s||v.trim()?" chat-send-on":""}`,onClick:s?m:N,disabled:s?!m:!v.trim(),"aria-label":s?"Stop generating":"Send message",children:s?m?t.jsx("span",{"aria-hidden":"true",children:"■"}):t.jsx(X,{light:!0}):t.jsx(ze,{})})]})]})};function ae(e){if(!e.authors.length)return"";const s=e.authors.slice(0,3).map(n=>n.name).join(", ");return e.authors.length>3?`${s}, et al.`:s}function De(e){var n;if(e.conference)return e.conference;const s=(n=e.published)==null?void 0:n.slice(0,4);if(e.arxiv_id)return s?`arXiv ${s}`:"arXiv";if(e.source_url)try{return new URL(e.source_url).hostname.replace(/^www\./,"")}catch{}return s??"external"}function yt(e,s=240){const n=e.content.trim();return n.length<=s?n:`${n.slice(0,s).trimEnd()}…`}const bt=({seed:e=0})=>t.jsxs("div",{className:"chat-thumb","aria-hidden":"true",children:[t.jsxs("div",{className:"chat-thumb-title",children:[t.jsx("span",{}),t.jsx("span",{})]}),t.jsx("div",{className:"chat-thumb-auth"}),t.jsxs("div",{className:"chat-thumb-cols",children:[t.jsx("div",{className:"chat-thumb-col"}),t.jsx("div",{className:"chat-thumb-col"})]}),t.jsx("div",{className:"chat-thumb-fig",style:{top:62+e%3*8}})]}),vt=({thumbnailUrl:e,seed:s})=>{const[n,h]=se.useState(!1),c=qe(e);return se.useEffect(()=>h(!1),[c]),!c||n?t.jsx(bt,{seed:s}):t.jsx("div",{className:"chat-thumb chat-thumb-real",children:t.jsx("img",{src:c,alt:"",loading:"lazy",decoding:"async",onError:()=>h(!0)})})};function jt(e){return{arxiv_id:e.arxiv_id,source:e.source??(e.arxiv_id?"arxiv":"external"),source_url:e.source_url??e.url_abs,thumbnail_url:e.thumbnail_url??null,authors:e.authors.map(s=>({name:s})),published:e.published,conference:e.conference_name??e.conference??null,citation_count:e.citation_count,tasks:(e.tasks??[]).map(s=>({name:s.name,slug:s.slug??""})),methods:[],repositories:[],project_pages:[]}}function wt(e){return{arxiv_id:e.arxiv_id??null,source:e.arxiv_id?"arxiv":"external",source_url:e.source_url,thumbnail_url:e.thumbnail_url??null,authors:(e.authors??[]).map(s=>({name:s})),published:e.published??null,conference:e.conference??null,citation_count:e.citation_count??null,tasks:[],methods:[],repositories:[],project_pages:[]}}const ne=({routeId:e,paper:s,citation:n,className:h="chat-paper-link",children:c})=>{const[u,m]=se.useState(!1),{data:f}=ht({queryKey:["chat-paper-preview",e],queryFn:()=>Be(e,!1),enabled:u&&!s&&!(n!=null&&n.thumbnail_url),staleTime:5*60*1e3,retry:!1}),b=t.jsx(We,{className:h,to:`/paper/${e}`,target:"_blank",rel:"noopener noreferrer",children:c});if(!s&&!n)return b;const y=(s==null?void 0:s.metadata)??(f?jt(f):wt(n)),v=(s==null?void 0:s.title)??(f==null?void 0:f.title)??n.title,O=e.split("").reduce((_,N)=>_+N.charCodeAt(0),0);return t.jsxs(lt,{open:u,onOpenChange:m,openDelay:150,closeDelay:100,children:[t.jsx(dt,{asChild:!0,children:b}),t.jsx(ut,{className:"chat-paper-pop",side:"bottom",align:"start",children:t.jsxs("div",{className:"chat-paper-pop-inner",children:[t.jsx(vt,{thumbnailUrl:y.thumbnail_url,seed:O}),t.jsxs("div",{className:"chat-paper-pop-meta",children:[t.jsx("div",{className:"chat-paper-pop-title",children:v}),ae(y)&&t.jsx("div",{className:"chat-paper-pop-auth",children:ae(y)}),t.jsxs("div",{className:"chat-paper-pop-venue",children:[De(y),y.arxiv_id&&t.jsxs(t.Fragment,{children:[" · arXiv:",y.arxiv_id]}),y.citation_count!=null&&t.jsxs(t.Fragment,{children:[" · ↑ ",y.citation_count.toLocaleString()]})]}),y.tasks.length>0&&t.jsx("div",{className:"chat-paper-pop-tags",children:y.tasks.map(_=>t.jsx("span",{className:"chat-pp-tag",children:_.name},_.slug))})]})]})})]})};function _t(e){const s=e.lastIndexOf("[");if(s===-1)return e;const n=e.slice(s);return/^\[[^\]]*(\]\(?[^)\s]*)?$/.test(n)?e.slice(0,s):e}const Ot=e=>e.startsWith("paper:")?e:ft(e),Nt=({text:e,streaming:s,papers:n,citations:h})=>{const c=s?_t(e):e;return t.jsx(mt,{remarkPlugins:[pt,xt],rehypePlugins:[gt],urlTransform:Ot,components:{a:({href:u,children:m})=>{if(u!=null&&u.startsWith("paper:")){const f=u.slice(6);return!n[f]&&!(h!=null&&h[f])?t.jsx("span",{className:"chat-invalid-citation",children:m}):t.jsx(ne,{routeId:f,paper:n[f],citation:h==null?void 0:h[f],children:m})}return t.jsx("span",{children:m})}},children:c})},Ae=()=>t.jsx("span",{className:"chat-caret"}),Rt=({text:e,papers:s,citations:n})=>{const h=[],c=/\[([^\]\n]+)\]\(paper:([^) \t\n]+)\)/g;let u=0;for(const m of e.matchAll(c)){const f=m.index??0;h.push(e.slice(u,f));const[,b,y]=m;h.push(n[y]||s[y]?t.jsx(ne,{routeId:y,paper:s[y],citation:n[y],children:b},`${f}-${y}`):t.jsx("span",{children:b},`${f}-${y}`)),u=f+m[0].length}return h.push(e.slice(u)),t.jsx(t.Fragment,{children:h})},Tt=({block:e,papers:s,citations:n,onToggle:h})=>e.active?t.jsxs("div",{className:"chat-reason-live",children:[t.jsxs("div",{className:"chat-reason-live-head",children:[t.jsx(X,{})," ",t.jsx("span",{children:"Thinking…"})]}),t.jsxs("div",{className:"chat-reason-live-body",children:[e.text,t.jsx(Ae,{})]})]}):t.jsxs("div",{className:"chat-reason-done",children:[t.jsxs("button",{type:"button",className:"chat-reason-done-head",onClick:h,children:[t.jsx(Je,{}),t.jsx("span",{children:"Thought for a few seconds"}),t.jsx(Se,{open:e.open})]}),e.open&&t.jsx("div",{className:"chat-reason-done-body",children:t.jsx(Rt,{text:e.text,papers:s,citations:n})})]}),kt=({block:e,papers:s,onToggle:n})=>{var v,O,_,N;const h=e.status==="running",c=e.schema_version===2||!!e.content,u=e.status==="error"||e.status==="denied",m=typeof e.args.query=="string"?e.args.query:"",f=typeof e.args.command=="string"?e.args.command:typeof e.args.file_path=="string"?e.args.file_path:m,b=((v=e.content)==null?void 0:v.map(g=>g.text).join(""))??"",y=h?"running…":c?`${e.status} · ${e.took_ms??0} ms`:`${e.hits} results · ${e.took_ms} ms`;return t.jsxs("div",{className:`chat-tool${h?" chat-tool-running":""}${u?" chat-tool-failed":""}`,children:[t.jsxs("button",{type:"button",className:"chat-tool-head",onClick:n,disabled:h,"aria-expanded":h?void 0:e.open,children:[t.jsxs("span",{className:"chat-tool-head-left",children:[h?t.jsx(X,{}):t.jsx(Qe,{}),t.jsx("code",{className:"chat-tool-name",children:e.name}),t.jsx("span",{className:"chat-tool-query",children:c?f:`("${m}")`})]}),t.jsxs("span",{className:"chat-tool-head-right",children:[t.jsx("span",{className:"chat-tool-status",children:y}),!h&&t.jsx(Se,{open:e.open})]})]}),!h&&e.open&&t.jsxs("div",{className:"chat-tool-body",children:[t.jsxs("div",{className:"chat-tool-args",children:[t.jsx("span",{className:"chat-tool-label",children:"arguments"}),t.jsx("pre",{children:JSON.stringify(e.args,null,2)})]}),c?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-output-head",children:[t.jsx("span",{className:"chat-tool-label",children:"result"}),t.jsx("button",{type:"button",className:"chat-tool-copy",onClick:()=>void navigator.clipboard.writeText(b),children:"Copy"})]}),t.jsx("pre",{className:"chat-tool-output",children:t.jsx("code",{children:b})}),((O=e.metadata)==null?void 0:O.output_truncated)&&t.jsx("div",{className:"chat-tool-truncated",children:"Output was truncated."})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"chat-tool-label chat-tool-results-label",children:["returned ",((_=e.results)==null?void 0:_.length)??0," papers"]}),t.jsx("ol",{className:"chat-tool-results",children:(N=e.results)==null?void 0:N.map(g=>t.jsxs("li",{className:"chat-hit",children:[t.jsx("div",{className:"chat-hit-top",children:t.jsx(ne,{routeId:g.route_id,paper:s[g.route_id],className:"chat-hit-title",children:g.title})}),t.jsx("div",{className:"chat-hit-meta",children:[ae(g.metadata),De(g.metadata)].filter(Boolean).join(" · ")}),t.jsxs("div",{className:"chat-hit-snippet",children:[yt(g),g.content_truncated&&t.jsx("span",{className:"chat-hit-truncated",children:" (truncated)"})]})]},g.route_id))})]})]})]})},Et=({block:e,papers:s,citations:n})=>t.jsxs("div",{className:"chat-answer",children:[t.jsx(Nt,{text:e.text,streaming:!e.done,papers:s,citations:n}),!e.done&&!!e.text.trim()&&t.jsx(Ae,{})]}),Lt=({text:e})=>t.jsx("div",{className:"chat-msg chat-msg-user",children:t.jsx("div",{className:"chat-bubble",children:e})}),Ct=({msg:e,papers:s,onToggleBlock:n})=>{var h,c;return t.jsx("div",{className:"chat-msg chat-msg-assistant",children:t.jsxs("div",{className:"chat-msg-blocks",children:[e.streaming&&(((h=e.blocks)==null?void 0:h.length)??0)===0&&t.jsxs("div",{className:"chat-reason-live-head",children:[t.jsx(X,{})," ",t.jsx("span",{children:"Thinking…"})]}),(c=e.blocks)==null?void 0:c.map((u,m)=>{const f=`${e.id}-${m}`,b="citations"in u&&u.citations!==void 0?u.citations:e.citations??[],y=Object.fromEntries(b.map(v=>[v.route_id,v]));return u.kind==="reasoning"?t.jsx(Tt,{block:u,papers:s,citations:y,onToggle:()=>n(e.id,m)},f):u.kind==="tool"?t.jsx(kt,{block:u,papers:s,onToggle:()=>n(e.id,m)},f):t.jsx(Et,{block:u,papers:s,citations:y},f)}),e.error&&t.jsxs("div",{className:"chat-error",children:["The assistant hit an error: ",e.error]}),!e.streaming&&e.finishReason&&e.finishReason!=="success"&&t.jsx("div",{className:"chat-finish-note",children:["tool_limit","max_turns"].includes(e.finishReason)?"The assistant stopped at the execution limit.":`The assistant stopped early (${e.finishReason.replace(/_/g," ")}).`})]})})},E=(e,s)=>new Promise(n=>{const h=setTimeout(c,e);function c(){s==null||s.removeEventListener("abort",c),clearTimeout(h),n()}s==null||s.addEventListener("abort",c)}),A=e=>({arxiv_id:null,source:"arxiv",source_url:null,thumbnail_url:null,authors:[],published:null,conference:null,citation_count:null,tasks:[],methods:[],repositories:[],project_pages:[],...e}),P={name:"Object Detection",slug:"object-detection"},I={name:"Real-Time Object Detection",slug:"real-time-object-detection"},St={"2502.12524":{route_id:"2502.12524",title:"YOLOv12: Attention-Centric Real-Time Object Detectors",content:"Enhancing the network architecture of the YOLO framework has been crucial for a long time. This work introduces an attention-centric YOLO framework, namely YOLOv12, built around area attention and residual efficient layer aggregation networks (R-ELAN). YOLOv12-N reaches 40.6 mAP at 1.64 ms on a T4 GPU, closing the gap to attention-based detectors without the usual latency penalty and surpassing YOLOv10/YOLOv11 by +1.2–1.6 mAP at matched latency.",content_truncated:!1,metadata:A({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[P,I],methods:[{name:"Area Attention",slug:"area-attention"}],repositories:[{url:"https://github.com/sunsmarterjie/yolov12",stars:18700}]})},"2407.17140":{route_id:"2407.17140",title:"RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection",content:"RT-DETRv2 improves the real-time DETR baseline with selective multi-scale feature extraction, a discrete sampling operator to ease deployment, and training-only 'bag-of-freebies' that add no inference cost. RT-DETRv2-R18/R50/R101 reach 47.9 / 53.4 / 54.3 mAP on COCO at 217 / 108 / 74 FPS on T4 TensorRT FP16, remaining NMS-free end to end.",content_truncated:!1,metadata:A({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[P,I],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2410.13842":{route_id:"2410.13842",title:"D-FINE: Redefining Regression as Fine-grained Distribution Refinement",content:"D-FINE reformulates bounding-box regression in DETR-style detectors as iterative refinement of probability distributions (FDR) and adds a localization self-distillation scheme (GO-LSD). D-FINE-L reaches 54.0 mAP at ~9 ms and D-FINE-X 55.8 mAP on COCO while staying real-time on modern GPUs, dominating RT-DETRv2 and YOLOv10 on the accuracy–latency Pareto front.",content_truncated:!1,metadata:A({arxiv_id:"2410.13842",authors:[{name:"Y. Peng"},{name:"H. Li"},{name:"P. Wu"}],published:"2024-10-17",conference:"ICLR 2025",citation_count:187,tasks:[P,I],methods:[{name:"Knowledge Distillation",slug:"knowledge-distillation"}],repositories:[{url:"https://github.com/Peterande/D-FINE",stars:12100}]})},"2406.03459":{route_id:"2406.03459",title:"LW-DETR: A Transformer Replacement to YOLO for Real-Time Detection",content:"LW-DETR pairs a plain ViT encoder with a lightweight DETR decoder and shows the combination outperforms YOLOv8 and YOLO-NAS at comparable latency, arguing transformer detectors are viable even at the fast end of the accuracy–latency curve. Uses multi-level feature aggregation, window-attention interleaving, and IoU-aware classification.",content_truncated:!1,metadata:A({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[P,I],methods:[{name:"Vision Transformer",slug:"vision-transformer"}],repositories:[{url:"https://github.com/Atten4Vis/LW-DETR",stars:5200}]})},"2304.08069":{route_id:"2304.08069",title:"DETRs Beat YOLOs on Real-time Object Detection",content:"RT-DETR is the first real-time end-to-end object detector, built on an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, plus IoU-aware query selection. RT-DETR-R50 achieves 53.1 mAP at 108 FPS on COCO, beating comparably sized YOLO detectors in both speed and accuracy while eliminating NMS entirely; its Figure 1 accuracy–latency plot became the reference for later real-time detectors.",content_truncated:!1,metadata:A({arxiv_id:"2304.08069",authors:[{name:"Y. Zhao"},{name:"W. Lv"},{name:"S. Xu"}],published:"2023-04-17",conference:"CVPR 2024",citation_count:2310,tasks:[P,I],methods:[{name:"DETR",slug:"detr"}],repositories:[{url:"https://github.com/lyuwenyu/RT-DETR",stars:9400}]})},"2405.14458":{route_id:"2405.14458",title:"YOLOv10: Real-Time End-to-End Object Detection",content:"YOLOv10 removes NMS from the YOLO pipeline via consistent dual assignments during training and applies a holistic efficiency–accuracy driven design across the architecture. YOLOv10-S is 1.8x faster than RT-DETR-R18 at similar COCO accuracy; the family spans 46.3–54.4 mAP with substantially lower end-to-end latency than prior YOLOs because post-processing disappears.",content_truncated:!1,metadata:A({arxiv_id:"2405.14458",authors:[{name:"A. Wang"},{name:"H. Chen"},{name:"L. Liu"}],published:"2024-05-23",conference:"NeurIPS 2024",citation_count:1650,tasks:[P,I],methods:[{name:"NMS-free Training",slug:"nms-free-training"}],repositories:[{url:"https://github.com/THU-MIG/yolov10",stars:44200}]})},"2401.17270":{route_id:"2401.17270",title:"YOLO-World: Real-Time Open-Vocabulary Object Detection",content:"YOLO-World extends the YOLO paradigm to open-vocabulary detection through vision-language modeling with a re-parameterizable vision-language path aggregation network (RepVL-PAN) and region-text contrastive pretraining. It detects categories never seen at training time while running at 35+ FPS, and its prompt-then-detect deployment re-parameterizes text embeddings for zero runtime text-encoder cost.",content_truncated:!1,metadata:A({arxiv_id:"2401.17270",authors:[{name:"T. Cheng"},{name:"L. Song"},{name:"Y. Ge"}],published:"2024-01-30",conference:"CVPR 2024",citation_count:890,tasks:[{name:"Open-Vocabulary Object Detection",slug:"open-vocabulary-object-detection"},P],methods:[{name:"Contrastive Learning",slug:"contrastive-learning"}],repositories:[{url:"https://github.com/AILab-CVC/YOLO-World",stars:16800}]})},158342:{route_id:"158342",title:"Ultralytics YOLO: real-time detection framework and model zoo",content:"Official Ultralytics framework release covering YOLO11 and YOLOv12 deployment: pretrained COCO checkpoints from nano to x-large, TensorRT/ONNX/CoreML export paths, and reproducible latency benchmarks on T4, Jetson Orin, and CPU targets. Widely used as the practical baseline for real-time detection deployments.",content_truncated:!1,metadata:A({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[P,I],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},Pe=e=>e.map(s=>St[s]),Re=Pe(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),Te=Pe(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),ke="The user wants the current state-of-the-art for real-time object detection. That's a moving target split across two lineages — the YOLO family (fast CNN one-stage detectors) and the DETR family (transformer, end-to-end, NMS-free). I should ground the answer in recent papers benchmarked on COCO with reported latency or FPS, not just accuracy. Let me start with a broad hybrid search, see which papers surface, then run a second, narrower query to pin down the head-to-head COCO mAP vs latency trade-offs before I write anything.",Ee="Good — both lineages are well represented. YOLOv12, YOLOv10 and RT-DETRv2 / D-FINE keep coming up. To actually rank them I need the accuracy-vs-latency numbers side by side on the same COCO val2017 protocol, so let me narrow the query to the benchmark comparison specifically.",Le=`There isn't a single winner — real-time object detection in 2026 is a two-horse race between the [YOLO family](paper:2502.12524) (fast one-stage CNNs) and the end-to-end [DETR family](paper:2304.08069) (NMS-free transformers). Which one is “SOTA” depends entirely on where you sit on the accuracy-vs-latency curve. + +**At the fast / edge end**, [YOLOv12](paper:2502.12524) is the current leader. Its area-attention design pushes attention into the YOLO backbone without the usual latency hit — YOLOv12-N reaches 40.6 mAP at ~1.6 ms on a T4, roughly +1.5 mAP over [YOLOv10](paper:2405.14458) at matched speed. [YOLOv10](paper:2405.14458) is still very relevant because it made the YOLO head NMS-free, cutting real end-to-end latency. + +**At the high-accuracy end**, the transformer detectors win. [D-FINE](paper:2410.13842) currently holds the accuracy-latency Pareto front, reporting 55.8 mAP by reformulating box regression as fine-grained distribution refinement with self-distillation. It builds on [RT-DETRv2](paper:2407.17140), which hardened the [original RT-DETR](paper:2304.08069) recipe (the paper that first showed DETRs beating YOLOs in real time) with training-only “bag-of-freebies” that add no inference cost. + +**My recommendation:** for edge or high-FPS deployment, start with [YOLOv12](paper:2502.12524) — the [Ultralytics framework](paper:158342) has ready-made checkpoints and export paths. If you have GPU headroom and want maximum accuracy while staying real-time, use [D-FINE](paper:2410.13842) or [RT-DETRv2](paper:2407.17140). And if you need open-vocabulary detection rather than fixed COCO classes, [YOLO-World](paper:2401.17270) is the one to look at.`,Dt=["How do these compare on edge devices like Jetson?","Show me open-vocabulary detectors","What about small-object detection?"];async function*At(e,s){const n=()=>(s==null?void 0:s.aborted)===!0,h=e.trim().slice(0,90)||"state-of-the-art real-time object detection";if(yield{type:"stream_start",request_id:"req_mock",session_id:null},await E(350,s),!n()){yield{type:"reasoning_start"};for(let c=0;c{const s=String("0").trim().toLowerCase();return s==="1"||s==="true"||s==="yes"};function Pt(e,s={}){return Ie()?It(e,s.signal):At(e.message,s.signal)}async function*It(e,s){const n=await fetch(Ce("/api/v1/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},credentials:"include",body:JSON.stringify(e),signal:s});if(!n.ok||!n.body){const m=await n.json().catch(()=>null),f=m==null?void 0:m.detail;throw new Error((f==null?void 0:f.message)||f||`Chat stream failed (${n.status})`)}const h=n.body.getReader(),c=new TextDecoder;let u="";try{for(;;){const{done:m,value:f}=await h.read();if(m)break;u+=c.decode(f,{stream:!0});let b;for(;(b=u.indexOf(` + +`))!==-1;){const y=u.slice(0,b);u=u.slice(b+2);const v=y.split(` +`).filter(O=>O.startsWith("data:")).map(O=>O.slice(5).trimStart()).join(` +`);!v||v==="[DONE]"||(yield JSON.parse(v))}}}finally{h.releaseLock()}}function Mt(e){const[s,n]=d.useState([]),[h,c]=d.useState(!1),u=d.useRef(!1),m=d.useRef(null),f=d.useRef([]),b=d.useRef(e),y=d.useRef(""),v=d.useRef(""),O=d.useRef(0);b.current=e,f.current=s,d.useEffect(()=>()=>{var l;return(l=m.current)==null?void 0:l.abort()},[]);const _=d.useMemo(()=>{const l={};for(const o of s)for(const x of o.blocks??[])if(x.kind==="tool")for(const p of x.results??[])l[p.route_id]=p;return l},[s]),N=()=>`m${++O.current}_${Date.now().toString(36)}`,g=l=>n(o=>{if(!o.length)return o;const x=o.slice();return x[x.length-1]=l(x[x.length-1]),x}),z=l=>g(o=>({...o,blocks:[...o.blocks??[],l]})),M=(l,o)=>g(x=>({...x,blocks:(x.blocks??[]).map((p,T,j)=>l(p,T,j)?o(p):p)})),q=l=>(o,x,p)=>o.kind===l&&p.findLastIndex(T=>T.kind===l)===x,B=l=>{switch(l.type){case"stream_start":l.session_id&&b.current.onSessionId(l.session_id);break;case"sandbox_start":case"sandbox_ready":break;case"session_title_start":v.current="";break;case"session_title_delta":v.current+=l.text,b.current.onTitle(v.current.replace(/\s+/g," ").slice(0,80));break;case"session_title_done":v.current=l.title,b.current.onTitle(l.title);break;case"reasoning_start":z({kind:"reasoning",text:"",active:!0,open:!0});break;case"reasoning_delta":M(q("reasoning"),o=>o.kind==="reasoning"?{...o,text:o.text+l.text}:o);break;case"reasoning_end":M(q("reasoning"),o=>o.kind==="reasoning"?{...o,active:!1,open:!1}:o);break;case"tool_call":z({kind:"tool",id:l.id,name:l.name,args:l.args,status:"running",open:!1});break;case"tool_result":M(o=>o.kind==="tool"&&o.id===l.id,o=>o.kind==="tool"?l.status?{...o,schema_version:2,status:l.status,took_ms:l.took_ms,content:l.content,metadata:l.metadata,open:l.status!=="success"}:{...o,status:"done",hits:l.hits,took_ms:l.took_ms,results:l.results}:o);break;case"answer_delta":g(o=>{const x=o.blocks??[],p=x.at(-1);return(p==null?void 0:p.kind)==="answer"&&!p.done?{...o,blocks:[...x.slice(0,-1),{...p,text:p.text+l.text}]}:{...o,blocks:[...x,{kind:"answer",text:l.text,done:!1}]}});break;case"done":g(o=>({...o,streaming:!1,followups:l.followups,finishReason:l.finish_reason,citations:l.citations,blocks:(o.blocks??[]).map(x=>x.kind==="answer"?{...x,done:!0}:x)}));break;case"error":g(o=>({...o,streaming:!1,error:l.message}));break}},Z=d.useCallback(l=>{const o=l.trim();if(!o||u.current)return!1;u.current=!0;const x=new AbortController;m.current=x,y.current=o;const p=[...f.current].reverse().find(j=>j.role==="user"),T=p!=null&&p.status&&p.status!=="complete"&&p.revision?{replace_message_id:p.id,prior_revision:p.revision}:null;return n(j=>{const L={id:N(),role:"user",text:o},F={id:N(),role:"assistant",streaming:!0,blocks:[]};if(!T)return[...j,L,F];const $=j.findLastIndex(D=>D.id===p.id);return $<0?[...j,L,F]:[...j.slice(0,$),L,F]}),c(!0),(async()=>{try{for await(const j of Pt({message:o,session_id:b.current.sessionId,client_message_id:crypto.randomUUID(),...!b.current.sessionId&&b.current.initialModel?{initial_model:b.current.initialModel}:{},...T??{}},{signal:x.signal}))x.signal.aborted||B(j)}catch(j){x.signal.aborted||B({type:"error",message:j instanceof Error?j.message:"The assistant stream failed."})}finally{m.current===x&&(u.current=!1,c(!1),g(j=>j.streaming?{...j,streaming:!1}:j),b.current.onSettled())}})(),!0},[]),C=d.useCallback(()=>{m.current&&(m.current.abort(),m.current=null,u.current=!1,c(!1),n(l=>{const o=l.at(-1);if((o==null?void 0:o.role)!=="assistant")return l;const x=(o.blocks??[]).flatMap(p=>p.kind==="tool"&&p.status==="running"?[]:p.kind==="reasoning"&&p.active?[]:p.kind==="answer"?[{...p,done:!0}]:[p]);return[...l.slice(0,-1),{...o,blocks:x,streaming:!1,finishReason:"stopped"}]}),b.current.onInterrupted(y.current),window.setTimeout(b.current.onSettled,250))},[]),S=d.useCallback((l,o)=>n(x=>x.map(p=>{var T;return p.id!==l?p:{...p,blocks:(T=p.blocks)==null?void 0:T.map((j,L)=>L===o&&(j.kind==="reasoning"||j.kind==="tool")?{...j,open:!j.open}:j)}})),[]),ee=d.useCallback(()=>{var l;(l=m.current)==null||l.abort(),m.current=null,u.current=!1,n([]),c(!1)},[]),Y=d.useCallback(l=>{var o;(o=m.current)==null||o.abort(),m.current=null,u.current=!1,n(l),c(!1)},[]);return{messages:s,busy:h,papers:_,send:Z,stop:C,toggleBlock:S,reset:ee,load:Y}}const Yt=["What's the state of the art for real-time object detection?","Recommend recent papers on retrieval-augmented generation","Which open LLMs are best for on-device inference?"],Kt=()=>{var be;const{sessionId:e}=He(),s=Ke(),[n,h]=Ve(),{user:c,isLoading:u}=Ge(),[m,f]=d.useState([]),[b,y]=d.useState(!1),[v,O]=d.useState(""),[_,N]=d.useState(()=>e?{id:e,status:"loading"}:null),[g,z]=d.useState(0),M=d.useRef(Ze()),q=d.useRef(n.get("model")||((be=M.current)==null?void 0:be.model)),[B,Z]=d.useState(et),[C,S]=d.useState(q.current||tt),[ee,Y]=d.useState(""),[l,o]=d.useState(""),[x,p]=d.useState(()=>{var a,r;return((a=n.get("q"))==null?void 0:a.trim())||((r=M.current)==null?void 0:r.prompt)||""}),T=d.useRef(!1),[j,L]=d.useState(null),[F,$]=d.useState(""),[D,H]=d.useState(null),[re,oe]=d.useState(()=>typeof window>"u"||window.innerWidth>900),ie=d.useRef(new Set),ce=d.useRef(!1),le=d.useRef(e),K=d.useRef(null);le.current=e;const U=d.useCallback(async()=>{if(!c)return;const a=!ce.current;a&&y(!0);try{f(await st()),ce.current=!0,O("")}catch(r){O(r instanceof Error?r.message:"Could not load chats")}finally{a&&y(!1)}},[c]),w=Mt({sessionId:e??null,initialModel:C,onSessionId:a=>{K.current=a,N({id:a,status:"loaded"}),s(`/chat/${a}`,{replace:!0})},onTitle:a=>{e&&!ie.current.has(e)&&(Y(a),f(r=>r.map(i=>i.id===e?{...i,title:a}:i)))},onSettled:()=>{U(),e&&G(e).then(a=>w.load(Q(a)))},onInterrupted:a=>{o(a),e&&window.setTimeout(()=>{G(e).then(r=>w.load(Q(r)))},450)}}),de=w.load,ue=w.send,V=d.useCallback(a=>{if(!c){sessionStorage.setItem(ve,a),sessionStorage.setItem(je,C),sessionStorage.setItem(we,"1"),window.location.href=Ce(`/api/v1/auth/hf/login?return_to=${encodeURIComponent("/chat")}`);return}ue(a)&&(at(),o(""))},[C,ue,c]);d.useEffect(()=>{if(u||!c)return;const a=sessionStorage.getItem(je);a&&S(a),U(),nt().then(R=>{if(Z(R.items),!le.current){const k=q.current||a;S(k&&R.items.some(Ue=>Ue.id===k)?k:R.default_model)}});const r=sessionStorage.getItem(ve),i=sessionStorage.getItem(we)==="1";r&&(i?p(r):o(r))},[u,U,c]),d.useEffect(()=>{if(!e){K.current!==null&&(K.current=null,w.reset()),N(null);return}if(K.current===e||(N(r=>(r==null?void 0:r.id)===e&&r.status==="loading"?r:{id:e,status:"loading"}),u||!c||w.busy))return;let a=!1;return O(""),G(e).then(r=>{a||(w.load(Q(r)),S(r.selected_model),Y(r.title),K.current=e,N({id:e,status:"loaded"}))}).catch(r=>{if(a)return;const i=r instanceof Error?r.message:"Chat not found";w.reset(),O(i),N({id:e,status:"error",error:i})}),()=>{a=!0}},[u,e,c,w.busy,g]),d.useEffect(()=>{var R;const a=(R=n.get("q"))==null?void 0:R.trim();if(!a)return;T.current=!1;const r=n.get("model");r&&S(r),p(a);const i=new URLSearchParams(n);i.delete("q"),i.delete("model"),h(i,{replace:!0})},[n,h]),d.useEffect(()=>{if(u||w.busy||!x||T.current)return;const a=window.setTimeout(()=>{if(T.current)return;T.current=!0;const r=x;p(""),V(r)},0);return()=>window.clearTimeout(a)},[u,w.busy,x,V]),d.useEffect(()=>{const a=()=>{!c||w.busy||(U(),e&&G(e).then(r=>de(Q(r))))};return window.addEventListener("focus",a),()=>window.removeEventListener("focus",a)},[w.busy,de,U,e,c]),d.useEffect(()=>{if(!D)return;const a=()=>H(null),r=i=>{i.key==="Escape"&&a()};return window.addEventListener("click",a),window.addEventListener("keydown",r),()=>{window.removeEventListener("click",a),window.removeEventListener("keydown",r)}},[D]);const he=()=>{w.reset(),o(""),Y(""),s("/chat")},me=async a=>{const r=F.trim();if(r)try{const i=await Oe(a,{title:r});ie.current.add(a),a===e&&Y(i.title),f(R=>R.map(k=>k.id===a?i:k)),L(null)}catch(i){O(i instanceof Error?i.message:"Rename failed")}},Me=async a=>{const r=a===e&&w.busy;if(window.confirm(r?"Stop and delete this chat? This cannot be undone.":"Delete this chat? This cannot be undone.")){r&&w.stop();try{if(r){const i=Date.now()+3e3;for(;(await G(a)).is_busy;){if(Date.now()>=i)throw new Error("Generation is still stopping. The chat was not deleted.");await new Promise(k=>window.setTimeout(k,150))}}await ct(a),a===e&&he(),await U()}catch(i){O(i instanceof Error?i.message:"Delete failed")}}},pe=async a=>{const r=C;if(S(a),!!e)try{const i=await Oe(e,{selected_model:a});f(R=>R.map(k=>k.id===e?{...k,selected_model:i.selected_model}:k)),O("")}catch(i){S(r),O(i instanceof Error?i.message:"Model change failed")}},[Ye,Fe]=d.useState(60);d.useLayoutEffect(()=>{const a=document.querySelector(".app-header");if(!a)return;const r=()=>Fe(a.offsetHeight);r();const i=new ResizeObserver(r);return i.observe(a),()=>i.disconnect()},[]);const te=d.useRef(null),J=d.useRef(null),$e=(a,r)=>{var i;J.current=((i=te.current)==null?void 0:i.scrollTop)??null,w.toggleBlock(a,r)};d.useLayoutEffect(()=>{const a=te.current;if(a){if(J.current!==null){a.scrollTop=J.current,J.current=null;return}a.scrollTop=a.scrollHeight}},[w.messages]);const W=m.find(a=>a.id===e),fe=w.messages.length===0,ge=(_==null?void 0:_.id)===e,xe=!!(e&&(u||c&&(!ge||(_==null?void 0:_.status)==="loading"))),ye=ge&&(_==null?void 0:_.status)==="error"?_.error:void 0;return t.jsxs("div",{className:"chat-page",style:{height:`calc(100dvh - ${Ye}px)`},children:[t.jsxs("aside",{className:`chat-sidebar${re?"":" chat-sidebar-closed"}`,children:[t.jsxs("div",{className:"chat-sidebar-top",children:[t.jsxs("button",{type:"button",className:"chat-new-chat",onClick:he,children:[t.jsx(rt,{})," New chat"]}),t.jsx("button",{type:"button",className:"icon-btn",onClick:()=>oe(!1),title:"Collapse sidebar",children:t.jsx(_e,{})})]}),t.jsxs("nav",{className:"chat-sessions","aria-label":"Chat history",children:[b&&t.jsx("div",{className:"chat-sessions-empty",children:"Loading chats…"}),!b&&v&&t.jsx("div",{className:"chat-sessions-empty",children:v}),!b&&!v&&m.length===0&&t.jsx("div",{className:"chat-sessions-empty",children:"Conversations you start will show up here."}),ot(m).map(a=>t.jsxs("div",{className:"chat-session-group",children:[t.jsx("div",{className:"chat-session-group-label",children:a.label}),a.items.map(r=>t.jsxs("div",{className:`chat-session${r.id===e?" chat-session-active":""}`,role:"button",tabIndex:0,onClick:()=>s(`/chat/${r.id}`),onKeyDown:i=>{if(i.key==="Enter"&&s(`/chat/${r.id}`),i.key==="F2"&&(L(r.id),$(r.title)),i.key==="ContextMenu"||i.shiftKey&&i.key==="F10"){i.preventDefault();const R=i.currentTarget.getBoundingClientRect();H({id:r.id,x:R.right-150,y:R.bottom})}},onContextMenu:i=>{i.preventDefault(),H({id:r.id,x:i.clientX,y:i.clientY})},children:[j===r.id?t.jsx("input",{className:"chat-session-title-input",value:F,autoFocus:!0,maxLength:80,onClick:i=>i.stopPropagation(),onChange:i=>$(i.target.value),onBlur:()=>void me(r.id),onKeyDown:i=>{i.stopPropagation(),i.key==="Enter"&&me(r.id),i.key==="Escape"&&L(null)}}):t.jsx("span",{className:"chat-session-title",children:r.title}),t.jsx("button",{type:"button",className:"chat-session-menu","aria-label":"Chat actions","aria-haspopup":"menu",title:"Chat actions",onClick:i=>{i.stopPropagation();const R=i.currentTarget.getBoundingClientRect();H({id:r.id,x:R.right-150,y:R.bottom})},children:"⋯"}),t.jsx("button",{type:"button",className:"chat-session-delete","aria-label":"Delete conversation",onClick:i=>{i.stopPropagation(),Me(r.id)},children:t.jsx(it,{})})]},r.id))]},a.label))]}),D&&t.jsx("div",{className:"chat-session-context-menu",role:"menu",style:{left:D.x,top:D.y},onClick:a=>a.stopPropagation(),children:t.jsx("button",{type:"button",role:"menuitem",autoFocus:!0,onClick:()=>{const a=m.find(r=>r.id===D.id);a&&(L(a.id),$(a.title)),H(null)},children:"Rename chat"})})]}),t.jsxs("section",{className:"chat-main",children:[t.jsxs("div",{className:"chat-topbar",children:[!re&&t.jsx("button",{type:"button",className:"icon-btn",onClick:()=>oe(!0),title:"Open sidebar",children:t.jsx(_e,{})}),t.jsx("span",{className:"chat-topbar-title",children:xe?(W==null?void 0:W.title)||"":ee||(W==null?void 0:W.title)||(fe?"":"New chat")})]}),xe?t.jsxs("div",{className:"chat-session-loading",role:"status","aria-live":"polite",children:[t.jsx(X,{}),t.jsx("span",{children:"Loading conversation…"})]}):ye?t.jsxs("div",{className:"chat-session-load-error",role:"alert",children:[t.jsx("p",{children:ye}),t.jsx("button",{type:"button",onClick:()=>{N({id:e,status:"loading"}),z(a=>a+1)},children:"Try again"})]}):fe?t.jsx("div",{className:"chat-empty",children:t.jsxs("div",{className:"chat-empty-inner",children:[t.jsx("div",{className:"chat-empty-eyebrow",children:"AI research assistant · Staging preview"}),t.jsxs("h1",{className:"chat-empty-title",children:["Ask ",t.jsx("em",{children:"Papers With Code"})]}),t.jsx("p",{className:"chat-empty-sub",children:"Answers are grounded in a live hybrid search over papers, tasks, and benchmarks — with citations you can follow."}),t.jsx(Ne,{onSend:V,busy:w.busy,onStop:w.stop,autoFocus:!0,draft:l,onDraftChange:o,models:B,selectedModel:C,onModelChange:a=>void pe(a)}),t.jsx("div",{className:"chat-examples",children:Yt.map(a=>t.jsx("button",{type:"button",className:"chat-example",onClick:()=>V(a),children:a},a))})]})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"chat-conversation",ref:te,children:t.jsx("div",{className:"chat-conversation-inner",children:w.messages.map(a=>a.role==="user"?t.jsx(Lt,{text:a.text??""},a.id):t.jsx(Ct,{msg:a,papers:w.papers,onToggleBlock:$e},a.id))})}),t.jsx("div",{className:"chat-composer-wrap",children:t.jsxs("div",{className:"chat-composer-inner",children:[t.jsx(Ne,{onSend:V,busy:w.busy,onStop:w.stop,placeholder:l?"Edit and send again…":"Ask a follow-up…",draft:l,onDraftChange:o,models:B,selectedModel:C,onModelChange:a=>void pe(a)}),t.jsx("div",{className:"chat-composer-foot",children:Ie()?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"chat-provider-attribution",children:["Powered by 🤗 ",t.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"}),"."]}),t.jsx("span",{children:"The AI assistant can make mistakes. Double-check responses."})]}):t.jsx(t.Fragment,{children:"Assistant preview — responses are simulated."})})]})})]})]})]})};export{Kt as default}; diff --git a/assets/ConferenceDetailView-hzsHLbhD.js b/assets/ConferenceDetailView-qTh5wHQs.js similarity index 94% rename from assets/ConferenceDetailView-hzsHLbhD.js rename to assets/ConferenceDetailView-qTh5wHQs.js index f3b86413c71900d065d6dac9c901171b4a76e1d7..c08c1d7bc435d5660b29a9eb8696c4a8a54e4a05 100644 --- a/assets/ConferenceDetailView-hzsHLbhD.js +++ b/assets/ConferenceDetailView-qTh5wHQs.js @@ -1 +1 @@ -import{e as L,r as D,j as e,L as p,b as C}from"./index-BHOUC_Zu.js";import{u as T}from"./useQuery-BLoDQBYX.js";import{M as F}from"./MarkdownText-CNmqxPO9.js";import{e as B,h as A,d as E}from"./transform-BaQjfqPg.js";import{S as f}from"./skeleton-D99KO90d.js";import{A as P,a as z}from"./alert-pE5EZBRN.js";import"./katex.min-BSBacQyE.js";import"./index-Ybm9YyT5.js";import"./index-BYJflHqW.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},Y=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{Y as default}; +import{e as L,r as D,j as e,L as p,b as C}from"./index-gsUrUwg6.js";import{u as T}from"./useQuery-CPia3mbp.js";import{M as F}from"./MarkdownText-1fpxqyMR.js";import{e as B,h as A,d as E}from"./transform-6AvXXXHk.js";import{S as f}from"./skeleton-CF5-g5gI.js";import{A as P,a as z}from"./alert-DCRuvdIl.js";import"./katex.min-BSBacQyE.js";import"./index-7RUPpdcZ.js";import"./index-B6ekb6Wc.js";const M=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},Y=()=>{var k,b,S,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>C.getConferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const r={general:0,vision:1,video:2,language:3,audio:4,other:5},n=o=>r[M(o)]??999;return[...t.data.results].sort((o,l)=>{const d=n(o.name),x=n(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((b=t.data)==null?void 0:b.total_paper_count)??0,m=((S=t.data)==null?void 0:S.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((r,n)=>r+n.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?R(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:r=>{var n,o;(o=(n=r.currentTarget.parentElement)==null?void 0:n.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((r,n)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},n))}):i.map(r=>{const n=r.tasks;if(n.length===0)return null;const o=n.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:r.name}),r.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:r.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[n.length," ",n.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:n.map(l=>{const d=l.slug||"",x=B(A(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},r.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(r=>r.tasks.length>0).length," areas."]})]})};export{Y as default}; diff --git a/assets/ConferenceTaskView-Bbye1dhE.js b/assets/ConferenceTaskView-BJz7eqBS.js similarity index 90% rename from assets/ConferenceTaskView-Bbye1dhE.js rename to assets/ConferenceTaskView-BJz7eqBS.js index 74ab3fffb9b6407258b6540634c38da1b7833ce4..ab112c57401385f5343857b699da59ab53041b7e 100644 --- a/assets/ConferenceTaskView-Bbye1dhE.js +++ b/assets/ConferenceTaskView-BJz7eqBS.js @@ -1 +1 @@ -import{e as Q,u as K,r as u,j as e,L as P,R as V,b as L}from"./index-BHOUC_Zu.js";import{u as E}from"./useQuery-BLoDQBYX.js";import{P as $}from"./components-CgNSGcDY.js";import{M as g}from"./MarkdownText-CNmqxPO9.js";import{t as D,d as U}from"./transform-BaQjfqPg.js";import{c as W}from"./usePapers-CShAZvOx.js";import{u as G}from"./useIntersectionObserver-FWZA_Lvo.js";import{S as J}from"./skeleton-D99KO90d.js";import{A as X,a as Y}from"./alert-pE5EZBRN.js";import"./LatexTitle-R8V-03ZY.js";import"./katex.min-BSBacQyE.js";import"./index-Ybm9YyT5.js";import"./index-BYJflHqW.js";import"./useInfiniteQuery-Cme8RlvF.js";const Z=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=s=>s==="trending"||s==="date_published"||s==="citation_count"?s:"trending",ue=()=>{var w,R,F,C,O,T;const{confSlug:s,taskSlug:r}=Q(),[v,M]=K(),b=ee(v.get("order_by")),z=n=>{const a=new URLSearchParams(v);a.set("order_by",n),M(a)},y=r==="all",x=r==="oral",f=r==="spotlight",c=r==="outstanding",l=r==="best-paper-finalists",S=c||l,d=y||x||f||c||l,I=d?void 0:r,q=x?"oral":f?"spotlight":c?"outstanding":l?"best_paper_finalist":void 0,p=E({queryKey:["conference",s],queryFn:()=>L.getConference(s),enabled:!!s,staleTime:10*60*1e3}),h=E({queryKey:["task",r],queryFn:()=>L.getTask(r),enabled:!!r&&!d,staleTime:10*60*1e3}),i=W({conferenceSlug:s||"",taskSlug:I,presentation:q,page_size:12,order_by:b,order_dir:"desc",include_resources:!0,enabled:!!s}),{targetRef:H,isIntersecting:_}=G({rootMargin:"200px"});u.useEffect(()=>{_&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[_,i.hasNextPage,i.isFetchingNextPage]),u.useEffect(()=>{window.scrollTo(0,0)},[s,r]);const j=u.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(o=>o.results)},[i.data]),N=u.useMemo(()=>j.map(D),[j]),m=y?"All papers":x?"Oral papers":f?"Spotlight papers":c?"Outstanding papers":l?"Best paper finalists":U(((w=h.data)==null?void 0:w.name)||r||"",((R=h.data)==null?void 0:R.slug)||r),k=((C=(F=i.data)==null?void 0:F.pages[0])==null?void 0:C.count)??((O=p.data)==null?void 0:O.paper_count)??0,t=h.data;return p.error||h.error||i.error?e.jsx("div",{className:"page",children:e.jsx(X,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(P,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(P,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(P,{to:`/conferences/${s}`,children:((T=p.data)==null?void 0:T.name)??s}),e.jsx("span",{children:" / "}),e.jsx("span",{children:m})]}),e.jsxs("div",{className:!d&&(t!=null&&t.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:d?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:m}),c&&s==="iclr-2026"&&e.jsx(g,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),c&&s==="icml-2026"&&e.jsx(g,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),l&&s==="cvpr-2026"&&e.jsx(g,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!d&&(t==null?void 0:t.description)&&e.jsx(g,{className:"task-explainer",text:t.description}),p.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:k.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:p.data.name})]})]}),!d&&(t==null?void 0:t.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:t.image_url,alt:`${m} schematic`,onError:n=>{var a,o;(o=(a=n.currentTarget.parentElement)==null?void 0:a.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",m,t.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(g,{className:"task-image-credit",text:t.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:S?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",k.toLocaleString(),"]"]})]})]}),!S&&e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:Z.map(([n,a])=>e.jsx("button",{className:`sort-btn ${b===n?"active":""}`,onClick:()=>z(n),children:a},n))}),e.jsxs("div",{className:"results-count",children:[N.length," loaded in ",e.jsx("span",{children:m})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((n,a)=>e.jsx(J,{className:"h-40 w-full"},a))}):N.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((n,a)=>{var B;const o=(B=j[a])==null?void 0:B.conference_award,A=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!l?"Best Paper Finalist":null;return e.jsxs(V.Fragment,{children:[A&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:A}),e.jsx($,{paper:n,rank:a+1})]},n.id)})}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ue as default}; +import{e as Q,u as K,r as u,j as e,L as P,R as V,b as L}from"./index-gsUrUwg6.js";import{u as E}from"./useQuery-CPia3mbp.js";import{P as $}from"./components-f5SMGslj.js";import{M as g}from"./MarkdownText-1fpxqyMR.js";import{t as D,d as U}from"./transform-6AvXXXHk.js";import{c as W}from"./usePapers-BgUiIfcw.js";import{u as G}from"./useIntersectionObserver-Jkfl_qWv.js";import{S as J}from"./skeleton-CF5-g5gI.js";import{A as X,a as Y}from"./alert-DCRuvdIl.js";import"./LatexTitle-BsZuFMnA.js";import"./katex.min-BSBacQyE.js";import"./index-7RUPpdcZ.js";import"./index-B6ekb6Wc.js";import"./useInfiniteQuery-DNCGoDeK.js";const Z=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=s=>s==="trending"||s==="date_published"||s==="citation_count"?s:"trending",ue=()=>{var w,R,F,C,O,T;const{confSlug:s,taskSlug:r}=Q(),[v,M]=K(),b=ee(v.get("order_by")),z=n=>{const a=new URLSearchParams(v);a.set("order_by",n),M(a)},y=r==="all",x=r==="oral",f=r==="spotlight",c=r==="outstanding",l=r==="best-paper-finalists",S=c||l,d=y||x||f||c||l,I=d?void 0:r,q=x?"oral":f?"spotlight":c?"outstanding":l?"best_paper_finalist":void 0,p=E({queryKey:["conference",s],queryFn:()=>L.getConference(s),enabled:!!s,staleTime:10*60*1e3}),h=E({queryKey:["task",r],queryFn:()=>L.getTask(r),enabled:!!r&&!d,staleTime:10*60*1e3}),i=W({conferenceSlug:s||"",taskSlug:I,presentation:q,page_size:12,order_by:b,order_dir:"desc",include_resources:!0,enabled:!!s}),{targetRef:H,isIntersecting:_}=G({rootMargin:"200px"});u.useEffect(()=>{_&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[_,i.hasNextPage,i.isFetchingNextPage]),u.useEffect(()=>{window.scrollTo(0,0)},[s,r]);const j=u.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(o=>o.results)},[i.data]),N=u.useMemo(()=>j.map(D),[j]),m=y?"All papers":x?"Oral papers":f?"Spotlight papers":c?"Outstanding papers":l?"Best paper finalists":U(((w=h.data)==null?void 0:w.name)||r||"",((R=h.data)==null?void 0:R.slug)||r),k=((C=(F=i.data)==null?void 0:F.pages[0])==null?void 0:C.count)??((O=p.data)==null?void 0:O.paper_count)??0,t=h.data;return p.error||h.error||i.error?e.jsx("div",{className:"page",children:e.jsx(X,{variant:"destructive",children:e.jsx(Y,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(P,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(P,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(P,{to:`/conferences/${s}`,children:((T=p.data)==null?void 0:T.name)??s}),e.jsx("span",{children:" / "}),e.jsx("span",{children:m})]}),e.jsxs("div",{className:!d&&(t!=null&&t.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:d?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:m}),c&&s==="iclr-2026"&&e.jsx(g,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),c&&s==="icml-2026"&&e.jsx(g,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),l&&s==="cvpr-2026"&&e.jsx(g,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!d&&(t==null?void 0:t.description)&&e.jsx(g,{className:"task-explainer",text:t.description}),p.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:k.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:p.data.name})]})]}),!d&&(t==null?void 0:t.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:t.image_url,alt:`${m} schematic`,onError:n=>{var a,o;(o=(a=n.currentTarget.parentElement)==null?void 0:a.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",m,t.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(g,{className:"task-image-credit",text:t.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:S?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",k.toLocaleString(),"]"]})]})]}),!S&&e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:Z.map(([n,a])=>e.jsx("button",{className:`sort-btn ${b===n?"active":""}`,onClick:()=>z(n),children:a},n))}),e.jsxs("div",{className:"results-count",children:[N.length," loaded in ",e.jsx("span",{children:m})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((n,a)=>e.jsx(J,{className:"h-40 w-full"},a))}):N.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((n,a)=>{var B;const o=(B=j[a])==null?void 0:B.conference_award,A=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!l?"Best Paper Finalist":null;return e.jsxs(V.Fragment,{children:[A&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:A}),e.jsx($,{paper:n,rank:a+1})]},n.id)})}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ue as default}; diff --git a/assets/ConferencesIndexView-C2rc9N0P.js b/assets/ConferencesIndexView-B3HCMmrn.js similarity index 87% rename from assets/ConferencesIndexView-C2rc9N0P.js rename to assets/ConferencesIndexView-B3HCMmrn.js index 655016446092820b27673f1d7b1666cdcb050154..e7814be2350c77076d47be88b09274522b724b00 100644 --- a/assets/ConferencesIndexView-C2rc9N0P.js +++ b/assets/ConferencesIndexView-B3HCMmrn.js @@ -1 +1 @@ -import{r as m,j as e,L as p,b as u}from"./index-BHOUC_Zu.js";import{u as h}from"./useQuery-BLoDQBYX.js";import{S as d}from"./skeleton-D99KO90d.js";import{A as g,a as f}from"./alert-pE5EZBRN.js";import{T as x}from"./TaxonomySuggestionTile-DeKWtuEn.js";import"./SignInToEditDialog-DzcyeLv5.js";import"./button-BKNKi_tx.js";import"./textarea-dXuRCXp_.js";import"./dialog-S5NgAS91.js";import"./useMutation-B-QOtIkd.js";import"./loader-circle-MkVnaQiB.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},y=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},v=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},B=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=m.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=y(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(v)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(f,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(d,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(d,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(p,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{B as default}; +import{r as m,j as e,L as p,b as u}from"./index-gsUrUwg6.js";import{u as h}from"./useQuery-CPia3mbp.js";import{S as d}from"./skeleton-CF5-g5gI.js";import{A as g,a as f}from"./alert-DCRuvdIl.js";import{T as x}from"./TaxonomySuggestionTile-CWfaWHsI.js";import"./SignInToEditDialog-DeRdsNO0.js";import"./button-CJ4HWE-U.js";import"./textarea-lhvg1Jzz.js";import"./dialog-Bil4Ya0L.js";import"./useMutation-CQieGF4K.js";import"./loader-circle-BgGrBUVx.js";const j=(r,n)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),a=n?new Date(`${n}T00:00:00`):null,s=l=>l.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return a&&a.getTime()!==t.getTime()?t.getMonth()===a.getMonth()?`${s(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${a.getDate()}, ${i}`:`${s(t)} – ${s(a)}, ${i}`:`${s(t)}, ${i}`},y=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const n=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return n?Number(n):0},v=(r,n)=>{if(r.start_date&&n.start_date){const t=r.start_date.localeCompare(n.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(n.start_date)return 1}return r.name.localeCompare(n.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},B=()=>{const r=h({queryKey:["conferences"],queryFn:()=>u.getConferences(),staleTime:6e5}),n=m.useMemo(()=>{var a;if(!((a=r.data)!=null&&a.results))return null;const t={};return r.data.results.forEach(s=>{const i=y(s);(t[i]||(t[i]=[])).push(s)}),Object.values(t).forEach(s=>s.sort(v)),Object.keys(t).map(Number).sort((s,i)=>i-s).map(s=>({year:s,conferences:t[s]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(f,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,a)=>e.jsxs("div",{children:[e.jsx(d,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((s,i)=>e.jsx(d,{className:"h-32"},i))})]},a))}):n==null?void 0:n.map(({year:t,conferences:a})=>{const s=a.reduce((l,o)=>l+(o.paper_count??0),0),i=t>0?String(t):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," ",a.length===1?"conference":"conferences"," ·"," ",s.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(l=>{const o=j(l.start_date,l.end_date),c=[l.venue,l.location].filter(Boolean).join(", ");return e.jsxs(p,{to:`/conferences/${l.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:l.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[o&&e.jsx("span",{children:o}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})]})]},l.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{B as default}; diff --git a/assets/CronDashboard-Clvh_kJa.js b/assets/CronDashboard-Dk0srJbz.js similarity index 94% rename from assets/CronDashboard-Clvh_kJa.js rename to assets/CronDashboard-Dk0srJbz.js index cd73a4d1821366e3b1e4a565477ce18974a67166..213bc7cddd0761feecf5fd9469c154c8ef6d6843 100644 --- a/assets/CronDashboard-Clvh_kJa.js +++ b/assets/CronDashboard-Dk0srJbz.js @@ -1,4 +1,4 @@ -import{g as h,r as l,j as e,q as u,a9 as ye,l as ve,k as D,G as be,al as we,am as ke,n as I,P as Ce,p as _e,an as W,L as Te,f as Re,b as Se}from"./index-BHOUC_Zu.js";import{u as K}from"./useQuery-BLoDQBYX.js";import{B as k,D as B,f as Me}from"./codexAddEvals-DsGqXQP5.js";import{B as O}from"./button-BKNKi_tx.js";import{C as Ae}from"./chevron-down-ZivE930n.js";import{C as M,a as E,R as z,S as Fe}from"./shield-alert-DCaALQgN.js";import{L as R}from"./loader-circle-MkVnaQiB.js";/** +import{h,r as l,j as e,s as u,aa as ye,m as ve,l as D,H as be,am as we,an as ke,o as I,P as Ce,q as _e,ao as W,L as Te,f as Re,b as Se}from"./index-gsUrUwg6.js";import{u as K}from"./useQuery-CPia3mbp.js";import{B as k,D as B,f as Me}from"./codexAddEvals-CHZ35FuP.js";import{B as O}from"./button-CJ4HWE-U.js";import{C as Ae}from"./chevron-down-C0S2yejG.js";import{C as M,a as E,R as z,S as Fe}from"./shield-alert-CJqoAF0o.js";import{L as R}from"./loader-circle-BgGrBUVx.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -28,12 +28,12 @@ import{g as h,r as l,j as e,q as u,a9 as ye,l as ve,k as D,G as be,al as we,am a * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $e=h("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** + */const He=h("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const He=h("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** + */const $e=h("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -58,4 +58,4 @@ import{g as h,r as l,j as e,q as u,a9 as ye,l as ve,k as D,G as be,al as we,am a * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Je=h("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),f=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:u("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));f.displayName="Card";const b=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:u("flex flex-col space-y-1.5 p-6",s),...a}));b.displayName="CardHeader";const w=l.forwardRef(({className:s,...a},t)=>e.jsx("h3",{ref:t,className:u("text-2xl font-semibold leading-none tracking-tight",s),...a}));w.displayName="CardTitle";const F=l.forwardRef(({className:s,...a},t)=>e.jsx("p",{ref:t,className:u("text-sm text-muted-foreground",s),...a}));F.displayName="CardDescription";const g=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:u("p-6 pt-0",s),...a}));g.displayName="CardContent";const Be=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:u("flex items-center p-6 pt-0",s),...a}));Be.displayName="CardFooter";var L="Tabs",[Oe]=_e(L,[W]),X=W(),[ze,P]=Oe(L),Z=l.forwardRef((s,a)=>{const{__scopeTabs:t,value:i,onValueChange:o,defaultValue:d,orientation:c="horizontal",dir:r,activationMode:p="automatic",...j}=s,m=ye(r),[x,y]=ve({prop:i,onChange:o,defaultProp:d??"",caller:L});return e.jsx(ze,{scope:t,baseId:be(),value:x,onValueChange:y,orientation:c,dir:m,activationMode:p,children:e.jsx(D.div,{dir:m,"data-orientation":c,...j,ref:a})})});Z.displayName=L;var Y="TabsList",ee=l.forwardRef((s,a)=>{const{__scopeTabs:t,loop:i=!0,...o}=s,d=P(Y,t),c=X(t);return e.jsx(we,{asChild:!0,...c,orientation:d.orientation,dir:d.dir,loop:i,children:e.jsx(D.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});ee.displayName=Y;var se="TabsTrigger",ae=l.forwardRef((s,a)=>{const{__scopeTabs:t,value:i,disabled:o=!1,...d}=s,c=P(se,t),r=X(t),p=ne(c.baseId,i),j=ie(c.baseId,i),m=i===c.value;return e.jsx(ke,{asChild:!0,...r,focusable:!o,active:m,children:e.jsx(D.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":j,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:p,...d,ref:a,onMouseDown:I(s.onMouseDown,x=>{!o&&x.button===0&&x.ctrlKey===!1?c.onValueChange(i):x.preventDefault()}),onKeyDown:I(s.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(i)}),onFocus:I(s.onFocus,()=>{const x=c.activationMode!=="manual";!m&&!o&&x&&c.onValueChange(i)})})})});ae.displayName=se;var te="TabsContent",re=l.forwardRef((s,a)=>{const{__scopeTabs:t,value:i,forceMount:o,children:d,...c}=s,r=P(te,t),p=ne(r.baseId,i),j=ie(r.baseId,i),m=i===r.value,x=l.useRef(m);return l.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),e.jsx(Ce,{present:o||m,children:({present:y})=>e.jsx(D.div,{"data-state":m?"active":"inactive","data-orientation":r.orientation,role:"tabpanel","aria-labelledby":p,hidden:!y,id:j,tabIndex:0,...c,ref:a,style:{...s.style,animationDuration:x.current?"0s":void 0},children:y&&d})})});re.displayName=te;function ne(s,a){return`${s}-trigger-${a}`}function ie(s,a){return`${s}-content-${a}`}var Ue=Z,ce=ee,le=ae,oe=re;const Ve=Ue,de=l.forwardRef(({className:s,...a},t)=>e.jsx(ce,{ref:t,className:u("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));de.displayName=ce.displayName;const q=l.forwardRef(({className:s,...a},t)=>e.jsx(le,{ref:t,className:u("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));q.displayName=le.displayName;const $=l.forwardRef(({className:s,...a},t)=>e.jsx(oe,{ref:t,className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));$.displayName=oe.displayName;function T(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const t=Date.now()-a.getTime(),i=Math.floor(t/6e4),o=Math.floor(t/36e5),d=Math.floor(t/864e5);return i<1?"Just now":i<60?`${i}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Ge(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function me(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function We(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const Ke={healthy:E,degraded:Je,broken:M,running:R,stuck:M,unknown:Ie};function Qe({status:s,isRunning:a}){const t=a?"running":s,i=Ke[t];return e.jsx(i,{className:`cron-status-icon cron-status--${t}${t==="running"?" animate-spin":""}`})}function V({icon:s,title:a,metrics:t}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(t).map(([i,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:We(i)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},i))})]})}function Xe({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(A,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",me(s)],...s.updated_at?[["Updated",T(s.updated_at)]]:[]].map(([a,t])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:t})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(k,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,t])=>e.jsxs(k,{variant:"outline",children:[a,": ",t??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function Ze({job:s,expanded:a,onToggle:t}){const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),d=i||o||!!s.workflow_status;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:t,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(Qe,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(k,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(k,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),d&&(a?e.jsx(Le,{className:"h-4 w-4 cron-muted"}):e.jsx(Ae,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Q,{}),"Log: ",T(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(B,{}),"DB: ",T(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Pe,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(A,{}),"Duration: ",Ge(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(De,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(U,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(A,{}),"Actions: ",me(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(k,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&d&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&i&&e.jsx(V,{icon:U,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(V,{icon:B,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(Xe,{workflow:s.workflow_status})]})})]})}const ue=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:t,className:u("w-full caption-bottom text-sm",s),...a})}));ue.displayName="Table";const xe=l.forwardRef(({className:s,...a},t)=>e.jsx("thead",{ref:t,className:u("[&_tr]:border-b",s),...a}));xe.displayName="TableHeader";const he=l.forwardRef(({className:s,...a},t)=>e.jsx("tbody",{ref:t,className:u("[&_tr:last-child]:border-0",s),...a}));he.displayName="TableBody";const Ye=l.forwardRef(({className:s,...a},t)=>e.jsx("tfoot",{ref:t,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));Ye.displayName="TableFooter";const H=l.forwardRef(({className:s,...a},t)=>e.jsx("tr",{ref:t,className:u("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));H.displayName="TableRow";const C=l.forwardRef(({className:s,...a},t)=>e.jsx("th",{ref:t,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));C.displayName="TableHead";const _=l.forwardRef(({className:s,...a},t)=>e.jsx("td",{ref:t,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));_.displayName="TableCell";const es=l.forwardRef(({className:s,...a},t)=>e.jsx("caption",{ref:t,className:u("mt-4 text-sm text-muted-foreground",s),...a}));es.displayName="TableCaption";const ss={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},as={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ts={queued:He,dispatching:R,running:qe,completed:E,failed:M,canceled:$e};function rs({status:s}){const a=ts[s];return e.jsxs(k,{variant:"outline",className:ss[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function ns(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function is({autoRefresh:s,refreshToken:a}){const{data:t,isLoading:i,isFetching:o,error:d}=K({queryKey:["codexPaperJobs",a],queryFn:()=>Me(100),refetchInterval:s?1e4:!1,retry:!1}),c=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(f,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(w,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(F,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!i&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(g,{children:[i&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&c!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),c===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(r=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:r}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:t.summary[r]})]},r)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:t.summary.total})]})]}),t.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsxs(H,{children:[e.jsx(C,{children:"Status"}),e.jsx(C,{children:"Paper"}),e.jsx(C,{children:"Action"}),e.jsx(C,{children:"Requested"}),e.jsx(C,{children:"Execution"})]})}),e.jsx(he,{children:t.jobs.map(r=>{const p=ns(r);return e.jsxs(H,{children:[e.jsx(_,{className:"align-top",children:e.jsx(rs,{status:r.status})}),e.jsxs(_,{className:"min-w-[260px] align-top",children:[e.jsx(Te,{to:`/paper/${encodeURIComponent(r.paper_route)}`,className:"font-medium hover:underline",children:r.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",r.paper_id]})]}),e.jsxs(_,{className:"whitespace-nowrap align-top",children:[as[r.kind],r.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(E,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(_,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:T(r.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",r.requested_by]})]}),e.jsxs(_,{className:"max-w-[360px] align-top",children:[r.hf_job_url?e.jsxs("a",{href:r.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Ee,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),p&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${r.error?"text-red-700":"cron-muted"}`,title:p,children:p})]})]},r.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",T(t.timestamp)]})]})]})]})}const G={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},ps=()=>{const[s,a]=l.useState(!0),[t,i]=l.useState(0),[o,d]=l.useState(new Set),{user:c}=Re(),{data:r,isLoading:p,isFetching:j,error:m,refetch:x}=K({queryKey:["cronStatus",c==null?void 0:c.username],queryFn:()=>Se.getCronStatus(),enabled:!!(c!=null&&c.is_admin),refetchInterval:s?3e4:!1,retry:!1}),pe=(m&&typeof m=="object"&&"status"in m?m.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":m instanceof Error?m.message:void 0,fe=n=>{d(N=>{const v=new Set(N);return v.has(n)?v.delete(n):v.add(n),v})},ge=(r==null?void 0:r.jobs.filter(n=>n.critical))??[],S=((r==null?void 0:r.jobs.filter(n=>!n.critical))??[]).reduce((n,N)=>(n[N.category]||(n[N.category]=[]),n[N.category].push(N),n),{}),je=Object.keys(S).sort((n,N)=>{const v=["hourly","daily","weekly"];return v.indexOf(n)-v.indexOf(N)}),J=n=>e.jsx(Ze,{job:n,expanded:o.has(n.job_name),onToggle:()=>fe(n.job_name)},n.job_name),Ne=()=>{i(n=>n+1),x()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(A,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(O,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(z,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(O,{variant:"outline",size:"sm",onClick:Ne,disabled:j,children:[e.jsx(z,{className:`h-4 w-4 mr-2 ${j?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(f,{className:"mb-6",children:e.jsx(g,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",c==null?void 0:c.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(Ve,{defaultValue:"critical-jobs",children:[e.jsxs(de,{className:"grid w-full grid-cols-2 sm:w-auto",children:[e.jsx(q,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(q,{value:"codex-paper-jobs",children:"Codex Paper Jobs"})]}),e.jsxs($,{value:"critical-jobs",className:"mt-6",children:[p&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),m&&e.jsx(f,{className:"cron-status--broken",children:e.jsx(g,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{className:"h-5 w-5"}),e.jsx("p",{children:pe??"Failed to load CRON jobs status. Please try again."})]})})}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(n=>e.jsxs(f,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(w,{className:"text-sm font-medium cron-muted capitalize",children:n})}),e.jsx(g,{children:e.jsx("div",{className:"text-2xl font-bold",children:r.summary[n]})})]},n))}),r.summary.critical_issues.length>0&&e.jsxs(f,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(g,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:r.summary.critical_issues.map(n=>e.jsx("li",{children:n},n))})})]}),e.jsxs(f,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(w,{className:"text-base",children:"What to check next"})}),e.jsxs(g,{children:[e.jsx("p",{className:"text-sm cron-muted",children:r.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Q,{className:"h-4 w-4"}),"Last updated: ",T(r.timestamp)," · Health score:"," ",r.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(f,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(w,{className:"text-xl",children:"Critical jobs"}),e.jsx(F,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(g,{className:"space-y-4",children:ge.map(J)})]}),e.jsx("div",{className:"space-y-6",children:je.map(n=>e.jsxs(f,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(w,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(k,{className:G[n]??G.hourly,children:n}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(F,{children:[S[n].length," job",S[n].length!==1?"s":""]})]})}),e.jsx(g,{className:"space-y-4",children:S[n].map(J)})]},n))})]})]}),e.jsx($,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(is,{autoRefresh:s,refreshToken:t})})]})]})})};export{ps as default}; + */const Je=h("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),f=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:u("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));f.displayName="Card";const b=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:u("flex flex-col space-y-1.5 p-6",s),...a}));b.displayName="CardHeader";const w=l.forwardRef(({className:s,...a},t)=>e.jsx("h3",{ref:t,className:u("text-2xl font-semibold leading-none tracking-tight",s),...a}));w.displayName="CardTitle";const F=l.forwardRef(({className:s,...a},t)=>e.jsx("p",{ref:t,className:u("text-sm text-muted-foreground",s),...a}));F.displayName="CardDescription";const g=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:u("p-6 pt-0",s),...a}));g.displayName="CardContent";const Be=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:u("flex items-center p-6 pt-0",s),...a}));Be.displayName="CardFooter";var L="Tabs",[Oe]=_e(L,[W]),X=W(),[ze,P]=Oe(L),Z=l.forwardRef((s,a)=>{const{__scopeTabs:t,value:i,onValueChange:o,defaultValue:d,orientation:c="horizontal",dir:r,activationMode:p="automatic",...j}=s,m=ye(r),[x,y]=ve({prop:i,onChange:o,defaultProp:d??"",caller:L});return e.jsx(ze,{scope:t,baseId:be(),value:x,onValueChange:y,orientation:c,dir:m,activationMode:p,children:e.jsx(D.div,{dir:m,"data-orientation":c,...j,ref:a})})});Z.displayName=L;var Y="TabsList",ee=l.forwardRef((s,a)=>{const{__scopeTabs:t,loop:i=!0,...o}=s,d=P(Y,t),c=X(t);return e.jsx(we,{asChild:!0,...c,orientation:d.orientation,dir:d.dir,loop:i,children:e.jsx(D.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})});ee.displayName=Y;var se="TabsTrigger",ae=l.forwardRef((s,a)=>{const{__scopeTabs:t,value:i,disabled:o=!1,...d}=s,c=P(se,t),r=X(t),p=ne(c.baseId,i),j=ie(c.baseId,i),m=i===c.value;return e.jsx(ke,{asChild:!0,...r,focusable:!o,active:m,children:e.jsx(D.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":j,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:p,...d,ref:a,onMouseDown:I(s.onMouseDown,x=>{!o&&x.button===0&&x.ctrlKey===!1?c.onValueChange(i):x.preventDefault()}),onKeyDown:I(s.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(i)}),onFocus:I(s.onFocus,()=>{const x=c.activationMode!=="manual";!m&&!o&&x&&c.onValueChange(i)})})})});ae.displayName=se;var te="TabsContent",re=l.forwardRef((s,a)=>{const{__scopeTabs:t,value:i,forceMount:o,children:d,...c}=s,r=P(te,t),p=ne(r.baseId,i),j=ie(r.baseId,i),m=i===r.value,x=l.useRef(m);return l.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),e.jsx(Ce,{present:o||m,children:({present:y})=>e.jsx(D.div,{"data-state":m?"active":"inactive","data-orientation":r.orientation,role:"tabpanel","aria-labelledby":p,hidden:!y,id:j,tabIndex:0,...c,ref:a,style:{...s.style,animationDuration:x.current?"0s":void 0},children:y&&d})})});re.displayName=te;function ne(s,a){return`${s}-trigger-${a}`}function ie(s,a){return`${s}-content-${a}`}var Ue=Z,ce=ee,le=ae,oe=re;const Ve=Ue,de=l.forwardRef(({className:s,...a},t)=>e.jsx(ce,{ref:t,className:u("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));de.displayName=ce.displayName;const q=l.forwardRef(({className:s,...a},t)=>e.jsx(le,{ref:t,className:u("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",s),...a}));q.displayName=le.displayName;const H=l.forwardRef(({className:s,...a},t)=>e.jsx(oe,{ref:t,className:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));H.displayName=oe.displayName;function T(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const t=Date.now()-a.getTime(),i=Math.floor(t/6e4),o=Math.floor(t/36e5),d=Math.floor(t/864e5);return i<1?"Just now":i<60?`${i}m ago`:o<24?`${o}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Ge(s){return s==null?"N/A":s<60?`${s.toFixed(1)}s`:s<3600?`${(s/60).toFixed(1)}m`:`${(s/3600).toFixed(1)}h`}function me(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function We(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const Ke={healthy:E,degraded:Je,broken:M,running:R,stuck:M,unknown:Ie};function Qe({status:s,isRunning:a}){const t=a?"running":s,i=Ke[t];return e.jsx(i,{className:`cron-status-icon cron-status--${t}${t==="running"?" animate-spin":""}`})}function V({icon:s,title:a,metrics:t}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(s,{className:"h-4 w-4"}),e.jsx("h4",{children:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(t).map(([i,o])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:We(i)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof o=="number"?o.toLocaleString():o})]},i))})]})}function Xe({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(A,{className:"h-4 w-4"}),e.jsx("h4",{children:"GitHub Actions"})]}),e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[[["Workflow",s.workflow_file],["Run",s.run_id??"N/A"],["Status",me(s)],...s.updated_at?[["Updated",T(s.updated_at)]]:[]].map(([a,t])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:t})]},a)),s.failed_jobs&&s.failed_jobs.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Failed jobs"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:s.failed_jobs.map(a=>e.jsx(k,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),s.job_conclusions&&Object.keys(s.job_conclusions).length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"cron-label mb-1",children:"Job conclusions"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(s.job_conclusions).map(([a,t])=>e.jsxs(k,{variant:"outline",children:[a,": ",t??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function Ze({job:s,expanded:a,onToggle:t}){const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),d=i||o||!!s.workflow_status;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:t,"aria-expanded":a,children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(Qe,{status:s.status,isRunning:s.is_running}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("h3",{className:"font-semibold",children:s.display_name}),s.critical&&e.jsx(k,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(k,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),d&&(a?e.jsx(Le,{className:"h-4 w-4 cron-muted"}):e.jsx(Ae,{className:"h-4 w-4 cron-muted"}))]}),e.jsx("p",{className:"text-sm cron-muted mb-2",children:s.status_reason}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-2 text-sm cron-muted",children:[e.jsxs("span",{className:"cron-fact",children:[e.jsx(Q,{}),"Log: ",T(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(B,{}),"DB: ",T(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(Pe,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(A,{}),"Duration: ",Ge(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(De,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(U,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(A,{}),"Actions: ",me(s.workflow_status)]})]}),s.work_summary&&e.jsx("div",{className:"cron-message",children:s.work_summary}),s.error&&e.jsxs("div",{className:"cron-message cron-message--error",children:[e.jsx("strong",{children:"Error: "}),s.error]}),s.diagnostics&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.diagnostics})]})]}),e.jsx(k,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&d&&e.jsx("div",{className:"cron-job-details",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.work_metrics&&i&&e.jsx(V,{icon:U,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(V,{icon:B,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(Xe,{workflow:s.workflow_status})]})})]})}const ue=l.forwardRef(({className:s,...a},t)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:t,className:u("w-full caption-bottom text-sm",s),...a})}));ue.displayName="Table";const xe=l.forwardRef(({className:s,...a},t)=>e.jsx("thead",{ref:t,className:u("[&_tr]:border-b",s),...a}));xe.displayName="TableHeader";const he=l.forwardRef(({className:s,...a},t)=>e.jsx("tbody",{ref:t,className:u("[&_tr:last-child]:border-0",s),...a}));he.displayName="TableBody";const Ye=l.forwardRef(({className:s,...a},t)=>e.jsx("tfoot",{ref:t,className:u("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));Ye.displayName="TableFooter";const $=l.forwardRef(({className:s,...a},t)=>e.jsx("tr",{ref:t,className:u("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));$.displayName="TableRow";const C=l.forwardRef(({className:s,...a},t)=>e.jsx("th",{ref:t,className:u("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));C.displayName="TableHead";const _=l.forwardRef(({className:s,...a},t)=>e.jsx("td",{ref:t,className:u("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));_.displayName="TableCell";const es=l.forwardRef(({className:s,...a},t)=>e.jsx("caption",{ref:t,className:u("mt-4 text-sm text-muted-foreground",s),...a}));es.displayName="TableCaption";const ss={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},as={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ts={queued:$e,dispatching:R,running:qe,completed:E,failed:M,canceled:He};function rs({status:s}){const a=ts[s];return e.jsxs(k,{variant:"outline",className:ss[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function ns(s){return s.error?s.error:s.report?s.report:s.status==="completed"&&s.applied_at?"Changes applied to the paper.":s.status==="completed"?"Completed without a recorded mutation.":null}function is({autoRefresh:s,refreshToken:a}){const{data:t,isLoading:i,isFetching:o,error:d}=K({queryKey:["codexPaperJobs",a],queryFn:()=>Me(100),refetchInterval:s?1e4:!1,retry:!1}),c=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(f,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(w,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(F,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),o&&!i&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(g,{children:[i&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&c!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),c===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-7",children:[["queued","dispatching","running","completed","failed","canceled"].map(r=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:r}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:t.summary[r]})]},r)),e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:"Total"}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:t.summary.total})]})]}),t.jobs.length===0?e.jsx("p",{className:"py-8 text-center text-sm cron-muted",children:"No paper curation jobs have been submitted yet."}):e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsxs($,{children:[e.jsx(C,{children:"Status"}),e.jsx(C,{children:"Paper"}),e.jsx(C,{children:"Action"}),e.jsx(C,{children:"Requested"}),e.jsx(C,{children:"Execution"})]})}),e.jsx(he,{children:t.jobs.map(r=>{const p=ns(r);return e.jsxs($,{children:[e.jsx(_,{className:"align-top",children:e.jsx(rs,{status:r.status})}),e.jsxs(_,{className:"min-w-[260px] align-top",children:[e.jsx(Te,{to:`/paper/${encodeURIComponent(r.paper_route)}`,className:"font-medium hover:underline",children:r.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",r.paper_id]})]}),e.jsxs(_,{className:"whitespace-nowrap align-top",children:[as[r.kind],r.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(E,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(_,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:T(r.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",r.requested_by]})]}),e.jsxs(_,{className:"max-w-[360px] align-top",children:[r.hf_job_url?e.jsxs("a",{href:r.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(Ee,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),p&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${r.error?"text-red-700":"cron-muted"}`,title:p,children:p})]})]},r.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",T(t.timestamp)]})]})]})]})}const G={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},ps=()=>{const[s,a]=l.useState(!0),[t,i]=l.useState(0),[o,d]=l.useState(new Set),{user:c}=Re(),{data:r,isLoading:p,isFetching:j,error:m,refetch:x}=K({queryKey:["cronStatus",c==null?void 0:c.username],queryFn:()=>Se.getCronStatus(),enabled:!!(c!=null&&c.is_admin),refetchInterval:s?3e4:!1,retry:!1}),pe=(m&&typeof m=="object"&&"status"in m?m.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":m instanceof Error?m.message:void 0,fe=n=>{d(N=>{const v=new Set(N);return v.has(n)?v.delete(n):v.add(n),v})},ge=(r==null?void 0:r.jobs.filter(n=>n.critical))??[],S=((r==null?void 0:r.jobs.filter(n=>!n.critical))??[]).reduce((n,N)=>(n[N.category]||(n[N.category]=[]),n[N.category].push(N),n),{}),je=Object.keys(S).sort((n,N)=>{const v=["hourly","daily","weekly"];return v.indexOf(n)-v.indexOf(N)}),J=n=>e.jsx(Ze,{job:n,expanded:o.has(n.job_name),onToggle:()=>fe(n.job_name)},n.job_name),Ne=()=>{i(n=>n+1),x()};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(A,{className:"h-8 w-8 cron-info-text"}),"Admin Dashboard"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Paper curation queue and operational health for scheduled jobs"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(O,{variant:"outline",size:"sm",onClick:()=>a(!s),className:s?"cron-status--running":"",children:[e.jsx(z,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"Auto-refresh ",s?"ON":"OFF"]}),e.jsxs(O,{variant:"outline",size:"sm",onClick:Ne,disabled:j,children:[e.jsx(z,{className:`h-4 w-4 mr-2 ${j?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(f,{className:"mb-6",children:e.jsx(g,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",c==null?void 0:c.username]}),". Health checks prefer database freshness over log completion so silent no-work failures surface as degraded or broken."]})})}),e.jsxs(Ve,{defaultValue:"critical-jobs",children:[e.jsxs(de,{className:"grid w-full grid-cols-2 sm:w-auto",children:[e.jsx(q,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(q,{value:"codex-paper-jobs",children:"Codex Paper Jobs"})]}),e.jsxs(H,{value:"critical-jobs",className:"mt-6",children:[p&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),m&&e.jsx(f,{className:"cron-status--broken",children:e.jsx(g,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{className:"h-5 w-5"}),e.jsx("p",{children:pe??"Failed to load CRON jobs status. Please try again."})]})})}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4 mb-6",children:["healthy","degraded","broken","running","stuck","unknown"].map(n=>e.jsxs(f,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(w,{className:"text-sm font-medium cron-muted capitalize",children:n})}),e.jsx(g,{children:e.jsx("div",{className:"text-2xl font-bold",children:r.summary[n]})})]},n))}),r.summary.critical_issues.length>0&&e.jsxs(f,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(g,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:r.summary.critical_issues.map(n=>e.jsx("li",{children:n},n))})})]}),e.jsxs(f,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(w,{className:"text-base",children:"What to check next"})}),e.jsxs(g,{children:[e.jsx("p",{className:"text-sm cron-muted",children:r.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(Q,{className:"h-4 w-4"}),"Last updated: ",T(r.timestamp)," · Health score:"," ",r.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(f,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(w,{className:"text-xl",children:"Critical jobs"}),e.jsx(F,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(g,{className:"space-y-4",children:ge.map(J)})]}),e.jsx("div",{className:"space-y-6",children:je.map(n=>e.jsxs(f,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(w,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(k,{className:G[n]??G.hourly,children:n}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(F,{children:[S[n].length," job",S[n].length!==1?"s":""]})]})}),e.jsx(g,{className:"space-y-4",children:S[n].map(J)})]},n))})]})]}),e.jsx(H,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(is,{autoRefresh:s,refreshToken:t})})]})]})})};export{ps as default}; diff --git a/assets/ExternalSourceEvalBadge-CuyDncpX.js b/assets/ExternalSourceEvalBadge-B_j6-Fi4.js similarity index 92% rename from assets/ExternalSourceEvalBadge-CuyDncpX.js rename to assets/ExternalSourceEvalBadge-B_j6-Fi4.js index 19235b4d17b691f21c311c177319603c551e9ef6..adedb96df5c999bad5548c5646440099b82e1f75 100644 --- a/assets/ExternalSourceEvalBadge-CuyDncpX.js +++ b/assets/ExternalSourceEvalBadge-B_j6-Fi4.js @@ -1 +1 @@ -import{j as e,L as l}from"./index-BHOUC_Zu.js";import{H as t,a as n,b as o}from"./hover-card-CYqiITh9.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E}; +import{j as e,L as l}from"./index-gsUrUwg6.js";import{H as t,a as n,b as o}from"./hover-card-BmN6fO7d.js";const u=()=>e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",e.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function i(a){if(!a)return"Evaluation sourced outside this paper";const r=a.toLowerCase();if(r.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(r.includes("arcprize.org"))return"ARC Prize Leaderboard";if(r.includes("frontierswe.com"))return"FrontierSWE";if(r.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const s=new URL(a,"https://paperswithcode.co");return s.pathname.startsWith("/paper/")?"Source paper":s.hostname.replace(/^www\./,"")}catch{return a}}const p=({sourceUrl:a})=>{const r=i(a);return e.jsxs(t,{openDelay:120,closeDelay:120,children:[e.jsx(n,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),e.jsxs(o,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",a?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e.jsxs(e.Fragment,{children:[" ",r,"."]})]})]})};export{u as C,p as E}; diff --git a/assets/FeedView-BioyKnFQ.js b/assets/FeedView-DBPKjNq3.js similarity index 90% rename from assets/FeedView-BioyKnFQ.js rename to assets/FeedView-DBPKjNq3.js index 1147c7c3454beefb188cc8e012d32c25d781c10e..a0749dd90ba685e2888523ea3b57be7736871c25 100644 --- a/assets/FeedView-BioyKnFQ.js +++ b/assets/FeedView-DBPKjNq3.js @@ -1 +1 @@ -import{u as M,r as o,j as e,L as u,i as S,a as C,b as T}from"./index-BHOUC_Zu.js";import{P as D}from"./components-CgNSGcDY.js";import{D as E,M as F,F as O,A as I,q as R}from"./chatSessions-DxE8uXe5.js";import{t as q,d as _}from"./transform-BaQjfqPg.js";import{u as $}from"./usePapers-CShAZvOx.js";import{u as K}from"./useIntersectionObserver-FWZA_Lvo.js";import{P as B}from"./usePeriodFilter-DmE7oYz7.js";import{S as l}from"./skeleton-D99KO90d.js";import{A as H,a as U}from"./alert-pE5EZBRN.js";import{u as k}from"./useQuery-BLoDQBYX.js";import"./LatexTitle-R8V-03ZY.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-Cme8RlvF.js";const W=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],z={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},Q={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},V=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",X=t=>t==="today"||t==="week"||t==="month"||t==="all_time"?t:"all_time",G=()=>{const t=C(),[n,d]=o.useState(""),[c,x]=o.useState(E),m=o.useRef(null);o.useEffect(()=>{const i=m.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,160)}px`)},[n]);const h=()=>{const i=n.trim();i&&(R(i,c),t("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:m,rows:1,value:n,placeholder:"Ask the assistant about papers, tasks, methods, or benchmarks…",onChange:i=>d(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),h())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(F,{models:O,selectedModel:c,onModelChange:x}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:h,disabled:!n.trim(),"aria-label":"Ask the assistant",children:e.jsx(I,{})})]})]})},de=()=>{var j,N,y,b,v;const[t,n]=M(),d=V(t.get("order_by")),c=X(t.get("time")),x=Q[c],m=s=>{const a=new URLSearchParams(t);a.set("order_by",s),n(a)},h=s=>{const a=new URLSearchParams(t);a.set("time",z[s]),n(a)},i=k({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),p=k({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),r=$({page_size:30,order_by:d,order_dir:"desc",time:c,include_resources:!0}),g=o.useMemo(()=>{var a;return(((a=r.data)==null?void 0:a.pages.flatMap(L=>L.results))||[]).map(q)},[r.data]),{targetRef:P,isIntersecting:f}=K({rootMargin:"400px"});o.useEffect(()=>{f&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[f,r.hasNextPage,r.isFetchingNextPage]);const w=r.isLoading,A=r.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),i.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(l,{className:"h-5 w-full"},a))}),(j=i.data)==null?void 0:j.map(s=>e.jsxs(u,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(u,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),p.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(l,{className:"h-5 w-full"},a))}),((y=(N=p.data)==null?void 0:N.results)==null?void 0:y.length)===0&&!p.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(v=(b=p.data)==null?void 0:b.results)==null?void 0:v.map(s=>e.jsxs(u,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[S()&&e.jsx(G,{}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:W.map(([s,a])=>e.jsx("button",{className:`sort-btn ${d===s?"active":""}`,onClick:()=>m(s),children:a},s))}),e.jsx("div",{className:"sort-options sort-options-time",children:B.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${x===s?"active":""}`,onClick:()=>h(s),children:s},s))})]}),A&&e.jsx(H,{variant:"destructive",className:"mb-4",children:e.jsx(U,{children:"Failed to load papers. Please try again."})}),w?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(l,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(l,{className:"h-6 w-3/4"}),e.jsx(l,{className:"h-4 w-1/2"}),e.jsx(l,{className:"h-12 w-full"})]})]},a))}):g.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:g.map((s,a)=>e.jsx(D,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:P,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{de as default}; +import{u as M,r as o,j as e,L as u,i as S,a as C,b as T}from"./index-gsUrUwg6.js";import{P as D}from"./components-f5SMGslj.js";import{D as E,M as F,F as O,A as I,q as R}from"./chatSessions-DgD7qgsg.js";import{t as q,d as _}from"./transform-6AvXXXHk.js";import{u as $}from"./usePapers-BgUiIfcw.js";import{u as K}from"./useIntersectionObserver-Jkfl_qWv.js";import{P as B}from"./usePeriodFilter-CfsBKHc9.js";import{S as l}from"./skeleton-CF5-g5gI.js";import{A as H,a as U}from"./alert-DCRuvdIl.js";import{u as k}from"./useQuery-CPia3mbp.js";import"./LatexTitle-BsZuFMnA.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DNCGoDeK.js";const W=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],z={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},Q={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},V=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",X=t=>t==="today"||t==="week"||t==="month"||t==="all_time"?t:"all_time",G=()=>{const t=C(),[n,d]=o.useState(""),[c,x]=o.useState(E),m=o.useRef(null);o.useEffect(()=>{const i=m.current;i&&(i.style.height="auto",i.style.height=`${Math.min(i.scrollHeight,160)}px`)},[n]);const h=()=>{const i=n.trim();i&&(R(i,c),t("/chat"))};return e.jsxs("div",{className:"ask-home",children:[e.jsx("textarea",{ref:m,rows:1,value:n,placeholder:"Ask the assistant about papers, tasks, methods, or benchmarks…",onChange:i=>d(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),h())}}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(F,{models:O,selectedModel:c,onModelChange:x}),e.jsxs("span",{className:"ask-home-hint",children:["Via 🤗"," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]})]}),e.jsx("button",{type:"button",className:`chat-send${n.trim()?" chat-send-on":""}`,onClick:h,disabled:!n.trim(),"aria-label":"Ask the assistant",children:e.jsx(I,{})})]})]})},de=()=>{var j,N,y,b,v;const[t,n]=M(),d=V(t.get("order_by")),c=X(t.get("time")),x=Q[c],m=s=>{const a=new URLSearchParams(t);a.set("order_by",s),n(a)},h=s=>{const a=new URLSearchParams(t);a.set("time",z[s]),n(a)},i=k({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),p=k({queryKey:["trending-tasks-sidebar"],queryFn:()=>T.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),r=$({page_size:30,order_by:d,order_dir:"desc",time:c,include_resources:!0}),g=o.useMemo(()=>{var a;return(((a=r.data)==null?void 0:a.pages.flatMap(L=>L.results))||[]).map(q)},[r.data]),{targetRef:P,isIntersecting:f}=K({rootMargin:"400px"});o.useEffect(()=>{f&&r.hasNextPage&&!r.isFetchingNextPage&&r.fetchNextPage()},[f,r.hasNextPage,r.isFetchingNextPage]);const w=r.isLoading,A=r.error;return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Trending ",e.jsx("em",{children:"Research"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar",children:[e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),i.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(l,{className:"h-5 w-full"},a))}),(j=i.data)==null?void 0:j.map(s=>e.jsxs(u,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(u,{to:"/tasks",className:"sidebar-link",style:{marginTop:8,fontStyle:"italic"},children:"all domains →"})]}),e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Trending Domains"}),p.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(l,{className:"h-5 w-full"},a))}),((y=(N=p.data)==null?void 0:N.results)==null?void 0:y.length)===0&&!p.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(v=(b=p.data)==null?void 0:b.results)==null?void 0:v.map(s=>e.jsxs(u,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[_(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[S()&&e.jsx(G,{}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:W.map(([s,a])=>e.jsx("button",{className:`sort-btn ${d===s?"active":""}`,onClick:()=>m(s),children:a},s))}),e.jsx("div",{className:"sort-options sort-options-time",children:B.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${x===s?"active":""}`,onClick:()=>h(s),children:s},s))})]}),A&&e.jsx(H,{variant:"destructive",className:"mb-4",children:e.jsx(U,{children:"Failed to load papers. Please try again."})}),w?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,a)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx(l,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(l,{className:"h-6 w-3/4"}),e.jsx(l,{className:"h-4 w-1/2"}),e.jsx(l,{className:"h-12 w-full"})]})]},a))}):g.length===0?e.jsx("div",{className:"no-results",children:"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:g.map((s,a)=>e.jsx(D,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:P,style:{height:1}}),r.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{de as default}; diff --git a/assets/FrameworksIndexView-Bt1QXuSZ.js b/assets/FrameworksIndexView-CU8V9Ap8.js similarity index 98% rename from assets/FrameworksIndexView-Bt1QXuSZ.js rename to assets/FrameworksIndexView-CU8V9Ap8.js index e7570938ae7cf54723799399ea02c08fd6073c2d..27c5f24d02c0c991161f207b502cf556b7dbc461 100644 --- a/assets/FrameworksIndexView-Bt1QXuSZ.js +++ b/assets/FrameworksIndexView-CU8V9Ap8.js @@ -1 +1 @@ -import{j as e,L as t}from"./index-BHOUC_Zu.js";import{I as l}from"./components-CgNSGcDY.js";import{e as c,h as g}from"./transform-BaQjfqPg.js";import"./LatexTitle-R8V-03ZY.js";import"./katex.min-BSBacQyE.js";const d={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},s=[{id:"llm",name:"Large Language Models",blurb:"Frameworks for running, serving, fine-tuning, and post-training LLMs — from local CPU inference to large-scale GPU serving and RL.",categories:[{id:"inference",name:"Inference & Serving",blurb:"Pick your inference engine based on hardware: GPU servers for throughput, CPU or Apple silicon for local/offline use.",guideUrl:"https://x.com/TheAhmadOsman/status/2057183854444843202",guideLabel:"2026 inference engine guide",frameworks:[{slug:"vllm",name:"vLLM",org:"vLLM Project",description:"High-throughput LLM serving with PagedAttention and continuous batching.",whenToUse:"Best when you have NVIDIA GPU compute and need production-grade throughput.",platforms:["gpu"],github:"https://github.com/vllm-project/vllm",url:"https://docs.vllm.ai/",paperId:"2309.06180"},{slug:"sglang",name:"SGLang",org:"SGLang Project",description:"Fast structured generation and multi-model serving for LLMs and VLMs.",whenToUse:"Strong choice for GPU clusters, agentic workloads, and structured outputs.",platforms:["gpu"],github:"https://github.com/sgl-project/sglang",url:"https://sgl-project.github.io/",paperId:"2312.07104"},{slug:"llama-cpp",name:"llama.cpp",org:"ggml-org",description:"Portable C/C++ inference for LLMs with broad quantization support.",whenToUse:"Run models locally on CPU or Apple silicon without a GPU.",platforms:["cpu","apple"],github:"https://github.com/ggml-org/llama.cpp"},{slug:"mlx-lm",name:"MLX-LM",org:"Apple MLX",description:"Run and fine-tune LLMs on Apple silicon using the MLX array framework.",whenToUse:"Native Mac inference and lightweight fine-tuning on M-series chips.",platforms:["apple"],github:"https://github.com/ml-explore/mlx-lm",url:"https://ml-explore.github.io/mlx/build/html/index.html"},{slug:"mlx-vlm",name:"MLX-VLM",org:"Blaizzy",description:"Inference and fine-tuning for vision-language models on Mac via MLX.",whenToUse:"Multimodal models (image + text) on Apple silicon.",platforms:["apple"],github:"https://github.com/Blaizzy/mlx-vlm"},{slug:"ollama",name:"Ollama",org:"Ollama",description:"Easy local model pulling, quantization, and chat API for developers.",whenToUse:"Quick local prototyping — abstracts away model download and runtime setup.",platforms:["cpu","apple","gpu"],github:"https://github.com/ollama/ollama",url:"https://ollama.com/"}]},{id:"training",name:"Training & Fine-tuning",blurb:"Libraries for supervised fine-tuning (SFT), preference optimization (RLHF), and reinforcement learning from verifiable rewards (RLVR).",frameworks:[{slug:"trl",name:"TRL",org:"Hugging Face",description:"Transformer Reinforcement Learning — SFT, DPO, PPO, GRPO, and reward modeling.",whenToUse:"The standard Hugging Face stack for both SFT and RL-style post-training.",platforms:["gpu"],github:"https://github.com/huggingface/trl",url:"https://huggingface.co/docs/trl/"},{slug:"unsloth",name:"Unsloth",org:"Unsloth AI",description:"Memory-efficient, fast fine-tuning and RL for LLMs with optimized kernels.",whenToUse:"Fast iteration on SFT and RL when VRAM or training speed is the bottleneck.",platforms:["gpu"],github:"https://github.com/unslothai/unsloth",url:"https://docs.unsloth.ai/"},{slug:"prime-rl",name:"prime-rl",org:"Prime Intellect",description:"Agentic RL training at scale with distributed rollout and training loops.",whenToUse:"Large-scale RL for agents and tool-use when you need custom distributed training.",platforms:["gpu"],github:"https://github.com/PrimeIntellect-ai/prime-rl"},{slug:"verl",name:"verl",org:"HybridFlow",description:"Flexible RL post-training framework (HybridFlow) for LLM alignment at scale.",whenToUse:"Production RL post-training pipelines — PPO, GRPO, and custom reward functions.",platforms:["gpu"],github:"https://github.com/verl-project/verl",url:"https://verl.readthedocs.io/",paperId:"2409.19256"}]}]},{id:"image-video-generation",name:"Image and video generation",blurb:"Frameworks for building, running, and accelerating image and video generation workflows.",categories:[{id:"generation-inference",name:"Generation & Inference",blurb:"Libraries, interfaces, and inference engines for diffusion and diffusion-transformer models.",frameworks:[{slug:"diffusers",name:"Diffusers",org:"Hugging Face",description:"A modular PyTorch library for pretrained diffusion models across image, video, and audio generation.",whenToUse:"Build or train customizable generation pipelines with a broad model ecosystem.",platforms:["gpu"],github:"https://github.com/huggingface/diffusers",url:"https://huggingface.co/docs/diffusers/"},{slug:"comfyui",name:"ComfyUI",org:"Comfy Org",description:"A node-based interface, API, and backend for composing diffusion generation workflows.",whenToUse:"Design and share visual generation pipelines without wiring every step in code.",platforms:["gpu"],github:"https://github.com/comfy-org/comfyui"},{slug:"sglang-diffusion",name:"SGLang Diffusion",org:"SGLang Project",description:"A high-performance serving framework for image and video generation models.",whenToUse:"Serve diffusion models with production-oriented throughput and distributed execution.",platforms:["gpu"],github:"https://github.com/sgl-project/sglang",url:"https://docs.sglang.io/docs/sglang-diffusion/index"},{slug:"cache-dit",name:"Cache-DiT",org:"Vipshop",description:"A PyTorch-native inference engine with caching, parallelism, quantization, and CPU offload for DiTs.",whenToUse:"Speed up diffusion-transformer inference with composable acceleration techniques.",platforms:["gpu"],github:"https://github.com/vipshop/cache-dit"},{slug:"fastvideo",name:"FastVideo",org:"Hao AI Lab",description:"A unified inference and post-training framework for accelerated video generation.",whenToUse:"Train, fine-tune, or serve video generation models in one optimized framework.",platforms:["gpu"],github:"https://github.com/hao-ai-lab/FastVideo"},{slug:"xdit",name:"xDiT",org:"xDiT Project",description:"A scalable inference engine for diffusion transformers using multiple parallelism strategies.",whenToUse:"Scale large image and video diffusion transformers across multiple GPUs.",platforms:["gpu"],github:"https://github.com/xdit-project/xDiT"}]}]}],m={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},u={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},p={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},h={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},f=({platform:i})=>{const r=c(g(i));return e.jsx("span",{className:"framework-platform-chip",style:{background:r.bg,color:r.text},children:d[i]})},b=({framework:i})=>e.jsxs("article",{className:"framework-card",children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:i.name}),i.org&&e.jsx("div",{className:"framework-card-org",children:i.org})]}),i.platforms&&i.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:i.platforms.map(r=>e.jsx(f,{platform:r},r))})]}),e.jsx("p",{className:"framework-card-desc",children:i.description}),i.whenToUse&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),i.whenToUse]}),(i.github||i.url||i.paperId)&&e.jsxs("div",{className:"framework-card-links",children:[i.paperId&&e.jsx(t,{to:`/paper/${i.paperId}`,className:"framework-link",children:"Paper"}),i.github&&e.jsxs("a",{href:i.github,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(l,{name:"github",size:13}),"GitHub"]}),i.url&&i.url!==i.github&&e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]}),k=()=>{const i=s.reduce((r,n)=>r+n.categories.reduce((o,a)=>o+a.frameworks.length,0),0);return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),s.map(r=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:m,children:[e.jsxs("div",{children:[e.jsx("h2",{style:u,children:r.name}),e.jsx("div",{style:p,children:r.blurb})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.categories.length," ",r.categories.length===1?"category":"categories"," ·"," ",r.categories.reduce((n,o)=>n+o.frameworks.length,0)," frameworks"]})]}),r.categories.map(n=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:h,children:n.name}),n.blurb&&e.jsx("p",{className:"framework-category-blurb",children:n.blurb}),n.guideUrl&&e.jsxs("a",{href:n.guideUrl,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[n.guideLabel??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[n.frameworks.length," ",n.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:n.frameworks.map(o=>e.jsx(b,{framework:o},o.slug))})]},n.id))]},r.id)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[i," frameworks across ",s.length," ",s.length===1?"domain":"domains",". More areas coming soon."]})]})};export{k as default}; +import{j as e,L as t}from"./index-gsUrUwg6.js";import{I as l}from"./components-f5SMGslj.js";import{e as c,h as g}from"./transform-6AvXXXHk.js";import"./LatexTitle-BsZuFMnA.js";import"./katex.min-BSBacQyE.js";const d={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},s=[{id:"llm",name:"Large Language Models",blurb:"Frameworks for running, serving, fine-tuning, and post-training LLMs — from local CPU inference to large-scale GPU serving and RL.",categories:[{id:"inference",name:"Inference & Serving",blurb:"Pick your inference engine based on hardware: GPU servers for throughput, CPU or Apple silicon for local/offline use.",guideUrl:"https://x.com/TheAhmadOsman/status/2057183854444843202",guideLabel:"2026 inference engine guide",frameworks:[{slug:"vllm",name:"vLLM",org:"vLLM Project",description:"High-throughput LLM serving with PagedAttention and continuous batching.",whenToUse:"Best when you have NVIDIA GPU compute and need production-grade throughput.",platforms:["gpu"],github:"https://github.com/vllm-project/vllm",url:"https://docs.vllm.ai/",paperId:"2309.06180"},{slug:"sglang",name:"SGLang",org:"SGLang Project",description:"Fast structured generation and multi-model serving for LLMs and VLMs.",whenToUse:"Strong choice for GPU clusters, agentic workloads, and structured outputs.",platforms:["gpu"],github:"https://github.com/sgl-project/sglang",url:"https://sgl-project.github.io/",paperId:"2312.07104"},{slug:"llama-cpp",name:"llama.cpp",org:"ggml-org",description:"Portable C/C++ inference for LLMs with broad quantization support.",whenToUse:"Run models locally on CPU or Apple silicon without a GPU.",platforms:["cpu","apple"],github:"https://github.com/ggml-org/llama.cpp"},{slug:"mlx-lm",name:"MLX-LM",org:"Apple MLX",description:"Run and fine-tune LLMs on Apple silicon using the MLX array framework.",whenToUse:"Native Mac inference and lightweight fine-tuning on M-series chips.",platforms:["apple"],github:"https://github.com/ml-explore/mlx-lm",url:"https://ml-explore.github.io/mlx/build/html/index.html"},{slug:"mlx-vlm",name:"MLX-VLM",org:"Blaizzy",description:"Inference and fine-tuning for vision-language models on Mac via MLX.",whenToUse:"Multimodal models (image + text) on Apple silicon.",platforms:["apple"],github:"https://github.com/Blaizzy/mlx-vlm"},{slug:"ollama",name:"Ollama",org:"Ollama",description:"Easy local model pulling, quantization, and chat API for developers.",whenToUse:"Quick local prototyping — abstracts away model download and runtime setup.",platforms:["cpu","apple","gpu"],github:"https://github.com/ollama/ollama",url:"https://ollama.com/"}]},{id:"training",name:"Training & Fine-tuning",blurb:"Libraries for supervised fine-tuning (SFT), preference optimization (RLHF), and reinforcement learning from verifiable rewards (RLVR).",frameworks:[{slug:"trl",name:"TRL",org:"Hugging Face",description:"Transformer Reinforcement Learning — SFT, DPO, PPO, GRPO, and reward modeling.",whenToUse:"The standard Hugging Face stack for both SFT and RL-style post-training.",platforms:["gpu"],github:"https://github.com/huggingface/trl",url:"https://huggingface.co/docs/trl/"},{slug:"unsloth",name:"Unsloth",org:"Unsloth AI",description:"Memory-efficient, fast fine-tuning and RL for LLMs with optimized kernels.",whenToUse:"Fast iteration on SFT and RL when VRAM or training speed is the bottleneck.",platforms:["gpu"],github:"https://github.com/unslothai/unsloth",url:"https://docs.unsloth.ai/"},{slug:"prime-rl",name:"prime-rl",org:"Prime Intellect",description:"Agentic RL training at scale with distributed rollout and training loops.",whenToUse:"Large-scale RL for agents and tool-use when you need custom distributed training.",platforms:["gpu"],github:"https://github.com/PrimeIntellect-ai/prime-rl"},{slug:"verl",name:"verl",org:"HybridFlow",description:"Flexible RL post-training framework (HybridFlow) for LLM alignment at scale.",whenToUse:"Production RL post-training pipelines — PPO, GRPO, and custom reward functions.",platforms:["gpu"],github:"https://github.com/verl-project/verl",url:"https://verl.readthedocs.io/",paperId:"2409.19256"}]}]},{id:"image-video-generation",name:"Image and video generation",blurb:"Frameworks for building, running, and accelerating image and video generation workflows.",categories:[{id:"generation-inference",name:"Generation & Inference",blurb:"Libraries, interfaces, and inference engines for diffusion and diffusion-transformer models.",frameworks:[{slug:"diffusers",name:"Diffusers",org:"Hugging Face",description:"A modular PyTorch library for pretrained diffusion models across image, video, and audio generation.",whenToUse:"Build or train customizable generation pipelines with a broad model ecosystem.",platforms:["gpu"],github:"https://github.com/huggingface/diffusers",url:"https://huggingface.co/docs/diffusers/"},{slug:"comfyui",name:"ComfyUI",org:"Comfy Org",description:"A node-based interface, API, and backend for composing diffusion generation workflows.",whenToUse:"Design and share visual generation pipelines without wiring every step in code.",platforms:["gpu"],github:"https://github.com/comfy-org/comfyui"},{slug:"sglang-diffusion",name:"SGLang Diffusion",org:"SGLang Project",description:"A high-performance serving framework for image and video generation models.",whenToUse:"Serve diffusion models with production-oriented throughput and distributed execution.",platforms:["gpu"],github:"https://github.com/sgl-project/sglang",url:"https://docs.sglang.io/docs/sglang-diffusion/index"},{slug:"cache-dit",name:"Cache-DiT",org:"Vipshop",description:"A PyTorch-native inference engine with caching, parallelism, quantization, and CPU offload for DiTs.",whenToUse:"Speed up diffusion-transformer inference with composable acceleration techniques.",platforms:["gpu"],github:"https://github.com/vipshop/cache-dit"},{slug:"fastvideo",name:"FastVideo",org:"Hao AI Lab",description:"A unified inference and post-training framework for accelerated video generation.",whenToUse:"Train, fine-tune, or serve video generation models in one optimized framework.",platforms:["gpu"],github:"https://github.com/hao-ai-lab/FastVideo"},{slug:"xdit",name:"xDiT",org:"xDiT Project",description:"A scalable inference engine for diffusion transformers using multiple parallelism strategies.",whenToUse:"Scale large image and video diffusion transformers across multiple GPUs.",platforms:["gpu"],github:"https://github.com/xdit-project/xDiT"}]}]}],m={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},u={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},p={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},h={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},f=({platform:i})=>{const r=c(g(i));return e.jsx("span",{className:"framework-platform-chip",style:{background:r.bg,color:r.text},children:d[i]})},b=({framework:i})=>e.jsxs("article",{className:"framework-card",children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:i.name}),i.org&&e.jsx("div",{className:"framework-card-org",children:i.org})]}),i.platforms&&i.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:i.platforms.map(r=>e.jsx(f,{platform:r},r))})]}),e.jsx("p",{className:"framework-card-desc",children:i.description}),i.whenToUse&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),i.whenToUse]}),(i.github||i.url||i.paperId)&&e.jsxs("div",{className:"framework-card-links",children:[i.paperId&&e.jsx(t,{to:`/paper/${i.paperId}`,className:"framework-link",children:"Paper"}),i.github&&e.jsxs("a",{href:i.github,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(l,{name:"github",size:13}),"GitHub"]}),i.url&&i.url!==i.github&&e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]}),k=()=>{const i=s.reduce((r,n)=>r+n.categories.reduce((o,a)=>o+a.frameworks.length,0),0);return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),s.map(r=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:m,children:[e.jsxs("div",{children:[e.jsx("h2",{style:u,children:r.name}),e.jsx("div",{style:p,children:r.blurb})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.categories.length," ",r.categories.length===1?"category":"categories"," ·"," ",r.categories.reduce((n,o)=>n+o.frameworks.length,0)," frameworks"]})]}),r.categories.map(n=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:h,children:n.name}),n.blurb&&e.jsx("p",{className:"framework-category-blurb",children:n.blurb}),n.guideUrl&&e.jsxs("a",{href:n.guideUrl,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[n.guideLabel??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[n.frameworks.length," ",n.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:n.frameworks.map(o=>e.jsx(b,{framework:o},o.slug))})]},n.id))]},r.id)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[i," frameworks across ",s.length," ",s.length===1?"domain":"domains",". More areas coming soon."]})]})};export{k as default}; diff --git a/assets/LatexTitle-R8V-03ZY.js b/assets/LatexTitle-BsZuFMnA.js similarity index 98% rename from assets/LatexTitle-R8V-03ZY.js rename to assets/LatexTitle-BsZuFMnA.js index ef48bd0fdea4d9446d6c10ec6863e6e51342a0a5..950fd3f66e89adfc7cf64c53739b9d69180ecb0d 100644 --- a/assets/LatexTitle-R8V-03ZY.js +++ b/assets/LatexTitle-BsZuFMnA.js @@ -1 +1 @@ -import{j as o,r as g}from"./index-BHOUC_Zu.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;ii&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a}; +import{j as o,r as g}from"./index-gsUrUwg6.js";import{k as T}from"./katex.min-BSBacQyE.js";const j=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),C={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},M={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},_={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},b={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},O={"'":C,"`":M,"^":_,'"':b,"~":{n:"ñ",N:"Ñ"}},E={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function S(e,s){var n;return((n=O[e])==null?void 0:n[s])??null}function N(e){const s=[];let n=0,i="";const l=()=>{i&&(s.push({type:"text",content:i}),i="")};for(;n=e.length)return{name:"",end:n};if(!/[a-zA-Z]/.test(e[n]))return{name:e[n],end:n+1};const i=n;for(;n=e.length)return null;if(e[s+1]==="{"){const i=d(e,s+1);return i?{end:i.end}:null}return/[A-Za-z0-9+\-=.]/.test(e[s+1])?{end:s+2}:null}function y(e,s){let n=s;if(e[n]==="\\"){const{name:t,end:a}=$(e,n);if(!t)return null;if(n=a,e[n]==="{"){const f=d(e,n);f&&(n=f.end)}}else if(/[A-Za-z0-9]/.test(e[n])){let t=n+1;for(;t`${s}-${l++}`,a=(f,u)=>f==="strong"?o.jsx("strong",{children:u},t()):o.jsx("em",{children:u},t());for(;ii&&n.push(e.slice(i,u)),i=u}return n}function A({latex:e,display:s}){const n=g.useMemo(()=>{try{return T.renderToString(e.trim(),{displayMode:s,throwOnError:!1})}catch{return null}},[e,s]);return n?o.jsx("span",{className:s?"katex-display":void 0,dangerouslySetInnerHTML:{__html:n}}):o.jsx(o.Fragment,{children:s?`$$${e}$$`:`$${e}$`})}function k(e){const s=N(e),n=[];return s.forEach((i,l)=>{const t=`latex-${l}`;if(i.type==="text"){const a=p(i.content,t);a.length===1?n.push(a[0]):a.length>1&&n.push(o.jsx(g.Fragment,{children:a},t));return}if(i.type==="display"){n.push(o.jsx(A,{latex:i.content,display:!0},t));return}n.push(o.jsx(A,{latex:i.content,display:!1},t))}),n.length===1?n[0]:o.jsx(o.Fragment,{children:n})}const U=({text:e,className:s=""})=>{const n=g.useMemo(()=>k(e),[e]);return o.jsx("span",{className:s,children:n})},X=({title:e,className:s=""})=>o.jsx(U,{text:e,className:s});export{X as L,U as a}; diff --git a/assets/MarkdownText-CNmqxPO9.js b/assets/MarkdownText-1fpxqyMR.js similarity index 80% rename from assets/MarkdownText-CNmqxPO9.js rename to assets/MarkdownText-1fpxqyMR.js index 70ebbdd58e0d3cf587fd441c2c9865af7be4405f..28c440ca054592b665c741888a855fbef39f93ae 100644 --- a/assets/MarkdownText-CNmqxPO9.js +++ b/assets/MarkdownText-1fpxqyMR.js @@ -1 +1 @@ -import{j as s,L as l}from"./index-BHOUC_Zu.js";import"./katex.min-BSBacQyE.js";import{M as c,r as m}from"./index-Ybm9YyT5.js";import{r as u,a as h}from"./index-BYJflHqW.js";const p=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),i=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"],w=t=>{if(!t)return null;if(t.startsWith("/"))return i.some(r=>t===r||t.startsWith(`${r}/`))?t:null;try{const r=new URL(t,window.location.origin);if(!p.has(r.hostname))return null;const n=`${r.pathname}${r.search}${r.hash}`;return i.some(e=>n===e||n.startsWith(`${e}/`))?n:null}catch{return null}},P=({text:t,className:r=""})=>s.jsx("div",{className:r,children:s.jsx(c,{remarkPlugins:[m,h],rehypePlugins:[u],components:{a:({href:n,children:e,...a})=>{const o=w(n);return o?s.jsx(l,{to:o,...a,children:e}):s.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:t})});export{P as M}; +import{j as s,L as l}from"./index-gsUrUwg6.js";import"./katex.min-BSBacQyE.js";import{M as c,r as m}from"./index-7RUPpdcZ.js";import{r as u,a as h}from"./index-B6ekb6Wc.js";const p=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),i=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"],w=t=>{if(!t)return null;if(t.startsWith("/"))return i.some(r=>t===r||t.startsWith(`${r}/`))?t:null;try{const r=new URL(t,window.location.origin);if(!p.has(r.hostname))return null;const n=`${r.pathname}${r.search}${r.hash}`;return i.some(e=>n===e||n.startsWith(`${e}/`))?n:null}catch{return null}},P=({text:t,className:r=""})=>s.jsx("div",{className:r,children:s.jsx(c,{remarkPlugins:[m,h],rehypePlugins:[u],components:{a:({href:n,children:e,...a})=>{const o=w(n);return o?s.jsx(l,{to:o,...a,children:e}):s.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:t})});export{P as M}; diff --git a/assets/MethodDetailView-U8lMdR1i.js b/assets/MethodDetailView-Bgd2_gNk.js similarity index 95% rename from assets/MethodDetailView-U8lMdR1i.js rename to assets/MethodDetailView-Bgd2_gNk.js index e2960aebb92cf3bf5fa2fa6de0638ee501a1cb28..779bd4321df7625e84da82750d95730c75332635 100644 --- a/assets/MethodDetailView-U8lMdR1i.js +++ b/assets/MethodDetailView-Bgd2_gNk.js @@ -1 +1 @@ -import{j as e,e as E,r as y,L as M,b as g,ae as D}from"./index-BHOUC_Zu.js";import{u as F}from"./useQuery-BLoDQBYX.js";import{u as B}from"./useInfiniteQuery-Cme8RlvF.js";import{M as L,P as C}from"./components-CgNSGcDY.js";import{M as b}from"./MarkdownText-CNmqxPO9.js";import{t as P}from"./transform-BaQjfqPg.js";import{u as T}from"./useIntersectionObserver-FWZA_Lvo.js";import{S as u}from"./skeleton-D99KO90d.js";import{A as $,a as I}from"./alert-pE5EZBRN.js";import"./LatexTitle-R8V-03ZY.js";import"./katex.min-BSBacQyE.js";import"./index-Ybm9YyT5.js";import"./index-BYJflHqW.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},o=({x:i,y:s,w:r,h:l,fill:x,stroke:d,label:m,fontSize:h=10,multiline:f})=>e.jsxs("g",{children:[e.jsx("rect",{x:i,y:s,width:r,height:l,rx:"3",ry:"3",fill:x,stroke:d,strokeWidth:"1"}),f?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:i+r/2,y:s+l/2-2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[0]}),e.jsx("text",{x:i+r/2,y:s+l/2+h-1,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[1]})]}):e.jsx("text",{x:i+r/2,y:s+l/2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:m})]}),N=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(o,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(o,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(o,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(o,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(o,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(o,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(o,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(o,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),R=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const s=30+i*75,r=60-i*8,l=240-i*30;return e.jsx("g",{children:e.jsx("rect",{x:s,y:(420-l)/2,width:r,height:l,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][i],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][i],strokeWidth:"1"})},i)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),A=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:50,y:r,width:l,height:x,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${i}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:210,y:r,width:l,height:x,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${i}`)}),[0,1,2,3].map(i=>{const s=60+i*80+(50-i*6)/2,r=50+(100-i*12);return e.jsx("path",{d:`M${r} ${s} L210 ${s}`,stroke:t.faint,strokeDasharray:"4 3"},`s${i}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(i=>[0,1,2].map(s=>e.jsx("rect",{x:20+s*40,y:40+i*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][i*3+s],stroke:t.faint},`${i}-${s}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(o,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(o,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),_=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(i=>{const s=25+i*56,r=(5-i)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:s,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-r*.1} 0.04 250)`,stroke:t.faint}),r<.4&&e.jsx("circle",{cx:s+25,cy:115,r:12-r*16,fill:t.orange,opacity:1-r*1.5})]},i)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),K=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],Q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),K.map(([i,s],r)=>{const l=92+r*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:i}),s?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:s}):null]},i)})]}),V={attention:N,"self-attention":N,cnn:R,"u-net":A,unet:A,vit:O,diffusion:_,ddpm:_,gan:G,vae:q,"agent-skills":Q},W=({method:i})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:i.name||"method"}),e.jsx(o,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(o,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:i.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(o,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),U=({method:i})=>{const s=(i.slug||"").toLowerCase(),r=V[s];if(r)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(r,{})});if(i.image_url){const l=s==="transformer"||s==="gpt-4"||s==="gpt-4o"?" method-figure-svg--compact":s==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:i.image_url,alt:`${i.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(W,{method:i})})},H=[["trending","trending"],["new","newest"],["cited","most cited"]],z={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},de=()=>{var k,S,v,w;const{methodSlug:i}=E(),[s,r]=y.useState("trending"),l=F({queryKey:["method",i],queryFn:()=>g.getMethod(i),enabled:!!i,staleTime:10*60*1e3}),x=s==="trending"?"trending":s==="cited"?"citation_count":"date_published",d=B({queryKey:["method-papers-infinite",i,x],queryFn:({pageParam:a=1})=>g.getMethodPapers(i,{page:a,page_size:20,order_by:x,order_dir:"desc",include_resources:!0}),getNextPageParam:a=>a.next_page,initialPageParam:1,enabled:!!i,staleTime:5*60*1e3,placeholderData:D}),m=F({queryKey:["related-methods",(k=l.data)==null?void 0:k.slug,(S=l.data)==null?void 0:S.area_id,(v=l.data)==null?void 0:v.id],queryFn:async()=>{const a=z[l.data.slug];return a?Promise.all(a.map(p=>g.getMethod(p))):(await g.getMethods({area_id:l.data.area_id,exclude_id:l.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!l.data&&(!!z[l.data.slug]||!!l.data.area_id),staleTime:10*60*1e3}),h=y.useMemo(()=>{var c;return(((c=d.data)==null?void 0:c.pages.flatMap(p=>p.results))||[]).map(P)},[d.data]),{targetRef:f,isIntersecting:j}=T({rootMargin:"200px"});if(y.useEffect(()=>{j&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[j,d.hasNextPage,d.isFetchingNextPage]),l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(u,{className:"h-12 w-1/2 mb-4"}),e.jsx(u,{className:"h-64 w-full"})]});if(l.error||!l.data)return e.jsx("div",{className:"page",children:e.jsx($,{variant:"destructive",children:e.jsx(I,{children:"Method not found."})})});const n=l.data;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(M,{to:"/methods",children:"Methods"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:n.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${n.slug==="grokking"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:n.name}),n.full_name&&n.full_name!==n.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:n.full_name}),n.description&&e.jsx(b,{className:"method-description",text:n.description}),n.source_url&&n.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:n.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:n.source_title}),n.introduced_year&&e.jsx("span",{className:"method-source-meta",children:n.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers using"}),e.jsx("span",{className:"value",children:(n.paper_count??0).toLocaleString()})]}),n.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:n.introduced_year})]})]})]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(U,{method:n}),n.image_credit&&e.jsx("figcaption",{children:e.jsx(b,{className:"method-image-credit",text:n.image_credit})})]})]}),(((w=m.data)==null?void 0:w.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(a=>e.jsx(L,{method:{slug:a.slug,name:a.name}},a.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:H.map(([a,c])=>e.jsx("button",{className:`sort-btn ${s===a?"active":""}`,onClick:()=>r(a),children:c},a))}),e.jsxs("div",{className:"results-count",children:[h.length," papers using ",n.name]})]}),d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,c)=>e.jsx(u,{className:"h-40 w-full"},c))}):h.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:h.map((a,c)=>e.jsx(C,{paper:a,rank:c+1},a.id))}),e.jsx("div",{ref:f,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{de as default}; +import{j as e,e as E,r as y,L as M,b as g,af as D}from"./index-gsUrUwg6.js";import{u as F}from"./useQuery-CPia3mbp.js";import{u as B}from"./useInfiniteQuery-DNCGoDeK.js";import{M as L,P as C}from"./components-f5SMGslj.js";import{M as b}from"./MarkdownText-1fpxqyMR.js";import{t as P}from"./transform-6AvXXXHk.js";import{u as T}from"./useIntersectionObserver-Jkfl_qWv.js";import{S as u}from"./skeleton-CF5-g5gI.js";import{A as $,a as I}from"./alert-DCRuvdIl.js";import"./LatexTitle-BsZuFMnA.js";import"./katex.min-BSBacQyE.js";import"./index-7RUPpdcZ.js";import"./index-B6ekb6Wc.js";const t={pink:"#F8D7D9",pinkS:"#D9B0B3",yellow:"#FBEFC2",yellowS:"#C9B97D",orange:"#F8D7B3",orangeS:"#C99466",blue:"#CDE2EE",blueS:"#7FA4BA",purple:"#D4D2EA",purpleS:"#8E8AC0",green:"#CCE2C5",greenS:"#7DA475",ink:"#1A1814",faint:"#8E8678"},o=({x:i,y:s,w:r,h:l,fill:x,stroke:d,label:m,fontSize:h=10,multiline:f})=>e.jsxs("g",{children:[e.jsx("rect",{x:i,y:s,width:r,height:l,rx:"3",ry:"3",fill:x,stroke:d,strokeWidth:"1"}),f?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:i+r/2,y:s+l/2-2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[0]}),e.jsx("text",{x:i+r/2,y:s+l/2+h-1,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:f[1]})]}):e.jsx("text",{x:i+r/2,y:s+l/2,fontSize:h,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:m})]}),N=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(o,{x:140,y:40,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:t.ink}),e.jsx(o,{x:140,y:80,w:80,h:26,fill:t.green,stroke:t.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:t.ink}),e.jsx(o,{x:140,y:120,w:80,h:26,fill:t.purple,stroke:t.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:t.ink}),e.jsx(o,{x:140,y:160,w:80,h:26,fill:t.blue,stroke:t.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:t.ink}),e.jsx(o,{x:140,y:200,w:80,h:26,fill:t.yellow,stroke:t.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:t.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:t.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:t.ink}),e.jsx(o,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(o,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(o,{x:220,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),R=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const s=30+i*75,r=60-i*8,l=240-i*30;return e.jsx("g",{children:e.jsx("rect",{x:s,y:(420-l)/2,width:r,height:l,rx:"2",fill:[t.blue,t.green,t.orange,t.purple][i],stroke:[t.blueS,t.greenS,t.orangeS,t.purpleS][i],strokeWidth:"1"})},i)}),e.jsx("text",{x:"60",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"135",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"210",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"conv"}),e.jsx("text",{x:"285",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"fc"})]}),A=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:50,y:r,width:l,height:x,rx:"2",fill:t.blue,stroke:t.blueS,strokeWidth:"1"},`e${i}`)}),e.jsx("rect",{x:"155",y:"320",width:"50",height:"40",rx:"2",fill:t.purple,stroke:t.purpleS}),[0,1,2,3].map(i=>{const r=60+i*80,l=100-i*12,x=50-i*6;return e.jsx("rect",{x:210,y:r,width:l,height:x,rx:"2",fill:t.green,stroke:t.greenS,strokeWidth:"1"},`d${i}`)}),[0,1,2,3].map(i=>{const s=60+i*80+(50-i*6)/2,r=50+(100-i*12);return e.jsx("path",{d:`M${r} ${s} L210 ${s}`,stroke:t.faint,strokeDasharray:"4 3"},`s${i}`)}),e.jsx("text",{x:"100",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"encoder"}),e.jsx("text",{x:"260",y:"40",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"decoder"}),e.jsx("text",{x:"180",y:"395",fontSize:"9",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"skip connections preserve high-res features"})]}),O=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[[0,1,2].map(i=>[0,1,2].map(s=>e.jsx("rect",{x:20+s*40,y:40+i*40,width:"38",height:"38",fill:["#F8D7D9","#FBEFC2","#CDE2EE","#CCE2C5","#D4D2EA","#F8D7B3","#F8D7D9","#FBEFC2","#CDE2EE"][i*3+s],stroke:t.faint},`${i}-${s}`))),e.jsx("rect",{x:"40",y:"245",width:"280",height:"120",rx:"4",fill:"#EFEBE0",stroke:t.faint,strokeDasharray:"3 2"}),e.jsx(o,{x:70,y:258,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:282,w:220,h:28,fill:t.orange,stroke:t.orangeS,label:"Multi-Head Attention"}),e.jsx(o,{x:70,y:314,w:220,h:20,fill:t.yellow,stroke:t.yellowS,label:"Norm"}),e.jsx(o,{x:70,y:338,w:220,h:20,fill:t.blue,stroke:t.blueS,label:"MLP"}),e.jsx("text",{x:"180",y:"385",fontSize:"10",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"Transformer Encoder · L×"})]}),_=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"50",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Reverse process: pure noise → sample"}),[0,1,2,3,4,5].map(i=>{const s=25+i*56,r=(5-i)/5;return e.jsxs("g",{children:[e.jsx("rect",{x:s,y:90,width:50,height:50,rx:"3",fill:`oklch(${.85-r*.1} 0.04 250)`,stroke:t.faint}),r<.4&&e.jsx("circle",{cx:s+25,cy:115,r:12-r*16,fill:t.orange,opacity:1-r*1.5})]},i)}),e.jsx("rect",{x:"60",y:"240",width:"240",height:"120",rx:"4",fill:"#FFF9EE",stroke:t.faint}),e.jsx("text",{x:"180",y:"260",fontSize:"11",fontFamily:"var(--mono)",fill:t.faint,textAnchor:"middle",children:"TRAINING OBJECTIVE"}),e.jsx("text",{x:"180",y:"295",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"L = E[‖ε − ε_θ(x_t, t)‖²]"})]}),G=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Generator vs. Discriminator"}),e.jsx("circle",{cx:"50",cy:"120",r:"22",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"50",y:"125",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"110",y:"92",width:"80",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"150",y:"124",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"G"}),e.jsx("rect",{x:"225",y:"100",width:"40",height:"40",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("rect",{x:"225",y:"195",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"290",y:"140",width:"50",height:"50",rx:"3",fill:t.pink,stroke:t.pinkS}),e.jsx("text",{x:"315",y:"170",fontSize:"14",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"D"})]}),q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Variational Autoencoder"}),e.jsx("rect",{x:"30",y:"100",width:"40",height:"40",rx:"3",fill:t.green,stroke:t.greenS}),e.jsx("rect",{x:"100",y:"92",width:"60",height:"56",rx:"3",fill:t.blue,stroke:t.blueS}),e.jsx("text",{x:"130",y:"124",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Encoder"}),e.jsx("circle",{cx:"270",cy:"120",r:"14",fill:t.purple,stroke:t.purpleS}),e.jsx("text",{x:"270",y:"124",fontSize:"13",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.ink,textAnchor:"middle",children:"z"}),e.jsx("rect",{x:"100",y:"200",width:"60",height:"56",rx:"3",fill:t.orange,stroke:t.orangeS}),e.jsx("text",{x:"130",y:"232",fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,textAnchor:"middle",children:"Decoder"}),e.jsx("rect",{x:"30",y:"210",width:"40",height:"40",rx:"3",fill:t.pink,stroke:t.pinkS})]}),K=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],Q=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:t.faint,strokeWidth:"1"}),K.map(([i,s],r)=>{const l=92+r*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:i}),s?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:s}):null]},i)})]}),V={attention:N,"self-attention":N,cnn:R,"u-net":A,unet:A,vit:O,diffusion:_,ddpm:_,gan:G,vae:q,"agent-skills":Q},W=({method:i})=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:i.name||"method"}),e.jsx(o,{x:80,y:70,w:200,h:50,fill:t.blue,stroke:t.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:t.ink}),e.jsx(o,{x:80,y:150,w:200,h:70,fill:t.orange,stroke:t.orangeS,label:i.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:t.ink}),e.jsx(o,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),U=({method:i})=>{const s=(i.slug||"").toLowerCase(),r=V[s];if(r)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(r,{})});if(i.image_url){const l=s==="transformer"||s==="gpt-4"||s==="gpt-4o"?" method-figure-svg--compact":s==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${l}`,children:e.jsx("img",{className:"method-figure-img",src:i.image_url,alt:`${i.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(W,{method:i})})},H=[["trending","trending"],["new","newest"],["cited","most cited"]],z={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},de=()=>{var k,S,v,w;const{methodSlug:i}=E(),[s,r]=y.useState("trending"),l=F({queryKey:["method",i],queryFn:()=>g.getMethod(i),enabled:!!i,staleTime:10*60*1e3}),x=s==="trending"?"trending":s==="cited"?"citation_count":"date_published",d=B({queryKey:["method-papers-infinite",i,x],queryFn:({pageParam:a=1})=>g.getMethodPapers(i,{page:a,page_size:20,order_by:x,order_dir:"desc",include_resources:!0}),getNextPageParam:a=>a.next_page,initialPageParam:1,enabled:!!i,staleTime:5*60*1e3,placeholderData:D}),m=F({queryKey:["related-methods",(k=l.data)==null?void 0:k.slug,(S=l.data)==null?void 0:S.area_id,(v=l.data)==null?void 0:v.id],queryFn:async()=>{const a=z[l.data.slug];return a?Promise.all(a.map(p=>g.getMethod(p))):(await g.getMethods({area_id:l.data.area_id,exclude_id:l.data.id,ordering:"-paper_count",page_size:8})).results},enabled:!!l.data&&(!!z[l.data.slug]||!!l.data.area_id),staleTime:10*60*1e3}),h=y.useMemo(()=>{var c;return(((c=d.data)==null?void 0:c.pages.flatMap(p=>p.results))||[]).map(P)},[d.data]),{targetRef:f,isIntersecting:j}=T({rootMargin:"200px"});if(y.useEffect(()=>{j&&d.hasNextPage&&!d.isFetchingNextPage&&d.fetchNextPage()},[j,d.hasNextPage,d.isFetchingNextPage]),l.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(u,{className:"h-12 w-1/2 mb-4"}),e.jsx(u,{className:"h-64 w-full"})]});if(l.error||!l.data)return e.jsx("div",{className:"page",children:e.jsx($,{variant:"destructive",children:e.jsx(I,{children:"Method not found."})})});const n=l.data;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(M,{to:"/methods",children:"Methods"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:n.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${n.slug==="grokking"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:n.name}),n.full_name&&n.full_name!==n.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:n.full_name}),n.description&&e.jsx(b,{className:"method-description",text:n.description}),n.source_url&&n.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),e.jsxs("a",{className:"method-source-link",href:n.source_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:n.source_title}),n.introduced_year&&e.jsx("span",{className:"method-source-meta",children:n.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers using"}),e.jsx("span",{className:"value",children:(n.paper_count??0).toLocaleString()})]}),n.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:n.introduced_year})]})]})]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(U,{method:n}),n.image_credit&&e.jsx("figcaption",{children:e.jsx(b,{className:"method-image-credit",text:n.image_credit})})]})]}),(((w=m.data)==null?void 0:w.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),m.data.map(a=>e.jsx(L,{method:{slug:a.slug,name:a.name}},a.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:H.map(([a,c])=>e.jsx("button",{className:`sort-btn ${s===a?"active":""}`,onClick:()=>r(a),children:c},a))}),e.jsxs("div",{className:"results-count",children:[h.length," papers using ",n.name]})]}),d.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,c)=>e.jsx(u,{className:"h-40 w-full"},c))}):h.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:h.map((a,c)=>e.jsx(C,{paper:a,rank:c+1},a.id))}),e.jsx("div",{ref:f,style:{height:1}}),d.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{de as default}; diff --git a/assets/MethodsIndexView-BcMT_V5E.js b/assets/MethodsIndexView-CJcZiURr.js similarity index 85% rename from assets/MethodsIndexView-BcMT_V5E.js rename to assets/MethodsIndexView-CJcZiURr.js index 67e47d0188080db35d0ec48486e95c44860dc12d..f3b7e359b2802e37ee0b69c1c61ac6dbbf626e69 100644 --- a/assets/MethodsIndexView-BcMT_V5E.js +++ b/assets/MethodsIndexView-CJcZiURr.js @@ -1 +1 @@ -import{r as u,j as e,L as x,b as c}from"./index-BHOUC_Zu.js";import{u as m}from"./useQuery-BLoDQBYX.js";import{S as h}from"./skeleton-D99KO90d.js";import{A as g,a as j}from"./alert-pE5EZBRN.js";import{T as f}from"./TaxonomySuggestionTile-DeKWtuEn.js";import"./SignInToEditDialog-DzcyeLv5.js";import"./button-BKNKi_tx.js";import"./textarea-dXuRCXp_.js";import"./dialog-S5NgAS91.js";import"./useMutation-B-QOtIkd.js";import"./loader-circle-MkVnaQiB.js";const z=()=>{var l,d;const i=m({queryKey:["areas-all"],queryFn:()=>c.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=m({queryKey:["methods-all"],queryFn:async()=>(await c.getMethods({page:1,page_size:500,ordering:"-paper_count"})).results,staleTime:10*60*1e3}),o=u.useMemo(()=>{if(!n.data||!i.data)return null;const a={};return n.data.forEach(t=>{const r=t.area_id??"_unassigned";(a[r]||(a[r]=[])).push(t)}),Object.values(a).forEach(t=>t.sort((r,s)=>(s.paper_count||0)-(r.paper_count||0))),a},[n.data,i.data]);return i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(j,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research, with the papers that use them."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((a,t)=>e.jsxs("div",{children:[e.jsx(h,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((r,s)=>e.jsx(h,{className:"h-20"},s))})]},t))}):(d=(l=i.data)==null?void 0:l.results)==null?void 0:d.map(a=>{const t=(o==null?void 0:o[a.id])||[];if(t.length===0)return null;const r=t.reduce((s,p)=>s+(p.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:a.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," methods · ",r.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(s=>e.jsxs(x,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsx("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:s.name}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id)),e.jsx(f,{kind:"method"})]})]},a.id)})]})};export{z as default}; +import{r as u,j as e,L as x,b as c}from"./index-gsUrUwg6.js";import{u as m}from"./useQuery-CPia3mbp.js";import{S as h}from"./skeleton-CF5-g5gI.js";import{A as g,a as j}from"./alert-DCRuvdIl.js";import{T as f}from"./TaxonomySuggestionTile-CWfaWHsI.js";import"./SignInToEditDialog-DeRdsNO0.js";import"./button-CJ4HWE-U.js";import"./textarea-lhvg1Jzz.js";import"./dialog-Bil4Ya0L.js";import"./useMutation-CQieGF4K.js";import"./loader-circle-BgGrBUVx.js";const z=()=>{var l,d;const i=m({queryKey:["areas-all"],queryFn:()=>c.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=m({queryKey:["methods-all"],queryFn:async()=>(await c.getMethods({page:1,page_size:500,ordering:"-paper_count"})).results,staleTime:10*60*1e3}),o=u.useMemo(()=>{if(!n.data||!i.data)return null;const a={};return n.data.forEach(t=>{const r=t.area_id??"_unassigned";(a[r]||(a[r]=[])).push(t)}),Object.values(a).forEach(t=>t.sort((r,s)=>(s.paper_count||0)-(r.paper_count||0))),a},[n.data,i.data]);return i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(g,{variant:"destructive",children:e.jsx(j,{children:"Failed to load methods."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Methods ",e.jsx("em",{children:"library"})]}),e.jsx("div",{className:"feed-subtitle",children:"Common techniques used across AI research, with the papers that use them."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((a,t)=>e.jsxs("div",{children:[e.jsx(h,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:8}).map((r,s)=>e.jsx(h,{className:"h-20"},s))})]},t))}):(d=(l=i.data)==null?void 0:l.results)==null?void 0:d.map(a=>{const t=(o==null?void 0:o[a.id])||[];if(t.length===0)return null;const r=t.reduce((s,p)=>s+(p.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:a.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," methods · ",r.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(s=>e.jsxs(x,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsx("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:s.name}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id)),e.jsx(f,{kind:"method"})]})]},a.id)})]})};export{z as default}; diff --git a/assets/NotFound-qaYOxGzN.js b/assets/NotFound-DntriyTH.js similarity index 89% rename from assets/NotFound-qaYOxGzN.js rename to assets/NotFound-DntriyTH.js index bea16fc5ad78c0d043dee3603651fe72bfdc20d7..0787b1e6adbfec87cba420ad26266b8c560d190e 100644 --- a/assets/NotFound-qaYOxGzN.js +++ b/assets/NotFound-DntriyTH.js @@ -1 +1 @@ -import{aH as o,r as a,j as t,L as s}from"./index-BHOUC_Zu.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; +import{aH as o,r as a,j as t,L as s}from"./index-gsUrUwg6.js";const r=()=>{const e=o();return a.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),t.jsxs("div",{className:"page",style:{textAlign:"center",paddingTop:96},children:[t.jsx("h1",{className:"detail-title",style:{fontSize:96,marginBottom:8},children:"404"}),t.jsx("p",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-soft)",marginBottom:24},children:"That route isn't on the map."}),t.jsx(s,{to:"/",className:"action-btn",children:"Return home"})]})};export{r as default}; diff --git a/assets/OrganizationDetailView-Cm6pGlQi.js b/assets/OrganizationDetailView-DVGr7EZ1.js similarity index 91% rename from assets/OrganizationDetailView-Cm6pGlQi.js rename to assets/OrganizationDetailView-DVGr7EZ1.js index a1039262352538aeefed0139df15d080792c5a90..adf6cda26084621c4d021d998080baa2c5499b98 100644 --- a/assets/OrganizationDetailView-Cm6pGlQi.js +++ b/assets/OrganizationDetailView-DVGr7EZ1.js @@ -1 +1 @@ -import{e as j,r as y,j as e,L as f,b as v}from"./index-BHOUC_Zu.js";import{u as b}from"./useQuery-BLoDQBYX.js";import{M as k}from"./MarkdownText-CNmqxPO9.js";import{e as N,h as S,d as _}from"./transform-BaQjfqPg.js";import{S as p}from"./skeleton-D99KO90d.js";import{A as w,a as F}from"./alert-pE5EZBRN.js";import A from"./NotFound-qaYOxGzN.js";import"./katex.min-BSBacQyE.js";import"./index-Ybm9YyT5.js";import"./index-BYJflHqW.js";const B=i=>(i==null?void 0:i.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",z=()=>{var g,x;const{orgSlug:i}=j(),n=b({queryKey:["organization-areas-with-tasks",i],queryFn:()=>v.getOrganizationAreasWithTasks(i),enabled:!!i,staleTime:10*60*1e3}),m=y.useMemo(()=>{if(!n.data)return[];const t={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>t[B(o)]??999;return[...n.data.results].sort((o,a)=>{const l=r(o.name),d=r(a.name);return l!==d?l-d:o.name.localeCompare(a.name)})},[n.data]),s=(g=n.data)==null?void 0:g.organization,c=((x=n.data)==null?void 0:x.total_paper_count)??0,h=m.reduce((t,r)=>t+r.tasks.length,0);if(n.error)return n.error.status===404?e.jsx(A,{}):e.jsx("div",{className:"page",children:e.jsx(w,{variant:"destructive",children:e.jsx(F,{children:"Failed to load organization. Please try again."})})});const u=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title",style:{display:"flex",alignItems:"center",gap:12},children:[(s==null?void 0:s.logo_url)&&e.jsx("img",{src:s.logo_url,alt:"",style:{height:"0.9em",width:"auto",borderRadius:4,objectFit:"contain"},onError:t=>{t.currentTarget.style.display="none"}}),u??e.jsx(p,{className:"h-10 w-64 inline-block"})]}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsxs("span",{children:[c.toLocaleString()," papers"]}),(s==null?void 0:s.website_url)&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.website_url.replace(/^https?:\/\//,"").replace(/\/$/,"")}),(s==null?void 0:s.github_url)&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.github_url.replace(/^https?:\/\//,"").replace(/\/$/,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(k,{className:"method-description",text:s.description})]}),!n.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All papers attributed to this organization."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:e.jsxs(f,{to:`/${i}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]})})]}),n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,r)=>e.jsxs("div",{children:[e.jsx(p,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,a)=>e.jsx(p,{className:"h-24"},a))})]},r))}):m.map(t=>{const r=t.tasks;if(r.length===0)return null;const o=r.reduce((a,l)=>a+(l.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:t.name}),t.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:t.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(a=>{const l=a.slug||"",d=N(S(l));return e.jsxs(f,{to:`/${i}/${l}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:d.dot}}),_(a.name,l)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)})})]},t.id)}),h>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[h," tasks across ",m.filter(t=>t.tasks.length>0).length," areas."]})]})};export{z as default}; +import{e as j,r as y,j as e,L as f,b as v}from"./index-gsUrUwg6.js";import{u as b}from"./useQuery-CPia3mbp.js";import{M as k}from"./MarkdownText-1fpxqyMR.js";import{e as N,h as S,d as _}from"./transform-6AvXXXHk.js";import{S as p}from"./skeleton-CF5-g5gI.js";import{A as w,a as F}from"./alert-DCRuvdIl.js";import A from"./NotFound-DntriyTH.js";import"./katex.min-BSBacQyE.js";import"./index-7RUPpdcZ.js";import"./index-B6ekb6Wc.js";const B=i=>(i==null?void 0:i.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",z=()=>{var g,x;const{orgSlug:i}=j(),n=b({queryKey:["organization-areas-with-tasks",i],queryFn:()=>v.getOrganizationAreasWithTasks(i),enabled:!!i,staleTime:10*60*1e3}),m=y.useMemo(()=>{if(!n.data)return[];const t={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>t[B(o)]??999;return[...n.data.results].sort((o,a)=>{const l=r(o.name),d=r(a.name);return l!==d?l-d:o.name.localeCompare(a.name)})},[n.data]),s=(g=n.data)==null?void 0:g.organization,c=((x=n.data)==null?void 0:x.total_paper_count)??0,h=m.reduce((t,r)=>t+r.tasks.length,0);if(n.error)return n.error.status===404?e.jsx(A,{}):e.jsx("div",{className:"page",children:e.jsx(w,{variant:"destructive",children:e.jsx(F,{children:"Failed to load organization. Please try again."})})});const u=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title",style:{display:"flex",alignItems:"center",gap:12},children:[(s==null?void 0:s.logo_url)&&e.jsx("img",{src:s.logo_url,alt:"",style:{height:"0.9em",width:"auto",borderRadius:4,objectFit:"contain"},onError:t=>{t.currentTarget.style.display="none"}}),u??e.jsx(p,{className:"h-10 w-64 inline-block"})]}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsxs("span",{children:[c.toLocaleString()," papers"]}),(s==null?void 0:s.website_url)&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.website_url.replace(/^https?:\/\//,"").replace(/\/$/,"")}),(s==null?void 0:s.github_url)&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.github_url.replace(/^https?:\/\//,"").replace(/\/$/,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(k,{className:"method-description",text:s.description})]}),!n.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All papers attributed to this organization."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:e.jsxs(f,{to:`/${i}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]})})]}),n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,r)=>e.jsxs("div",{children:[e.jsx(p,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,a)=>e.jsx(p,{className:"h-24"},a))})]},r))}):m.map(t=>{const r=t.tasks;if(r.length===0)return null;const o=r.reduce((a,l)=>a+(l.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:t.name}),t.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:t.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(a=>{const l=a.slug||"",d=N(S(l));return e.jsxs(f,{to:`/${i}/${l}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:d.dot}}),_(a.name,l)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)})})]},t.id)}),h>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[h," tasks across ",m.filter(t=>t.tasks.length>0).length," areas."]})]})};export{z as default}; diff --git a/assets/OrganizationTaskView-Bysl0j3X.js b/assets/OrganizationTaskView-7B863H2d.js similarity index 85% rename from assets/OrganizationTaskView-Bysl0j3X.js rename to assets/OrganizationTaskView-7B863H2d.js index 13ed616fae855b3baf85995c33d0408ff494f83b..43fedd210e35f017404d94afe778556523a4b999 100644 --- a/assets/OrganizationTaskView-Bysl0j3X.js +++ b/assets/OrganizationTaskView-7B863H2d.js @@ -1 +1 @@ -import{e as w,u as R,r as m,j as e,L as p,b}from"./index-BHOUC_Zu.js";import{u as k}from"./useQuery-BLoDQBYX.js";import{P as B}from"./components-CgNSGcDY.js";import{t as E,d as L}from"./transform-BaQjfqPg.js";import{d as q}from"./usePapers-CShAZvOx.js";import{u as C}from"./useIntersectionObserver-FWZA_Lvo.js";import{S as I}from"./skeleton-D99KO90d.js";import{A as Q,a as K}from"./alert-pE5EZBRN.js";import M from"./NotFound-qaYOxGzN.js";import"./LatexTitle-R8V-03ZY.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-Cme8RlvF.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],D=s=>s==="trending"||s==="date_published"||s==="citation_count"?s:"trending",re=()=>{var j,f,N,y,P,v,S;const{orgSlug:s,taskSlug:n}=w(),[g,_]=R(),h=D(g.get("order_by")),z=t=>{const r=new URLSearchParams(g);r.set("order_by",t),_(r)},o=n==="all",O=o?void 0:n,i=k({queryKey:["organization",s],queryFn:()=>b.getOrganization(s),enabled:!!s,staleTime:10*60*1e3}),c=k({queryKey:["task",n],queryFn:()=>b.getTask(n),enabled:!!n&&!o,staleTime:10*60*1e3}),a=q({organizationSlug:s||"",taskSlug:O,page_size:12,order_by:h,order_dir:"desc",include_resources:!0,enabled:!!s}),{targetRef:T,isIntersecting:u}=C({rootMargin:"200px"});m.useEffect(()=>{u&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[u,a.hasNextPage,a.isFetchingNextPage]),m.useEffect(()=>{window.scrollTo(0,0)},[s,n]);const l=m.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(F=>F.results.map(E))},[a.data]),d=o?"All papers":L(((j=c.data)==null?void 0:j.name)||n||"",((f=c.data)==null?void 0:f.slug)||n),x=((y=(N=a.data)==null?void 0:N.pages[0])==null?void 0:y.count)??((P=i.data)==null?void 0:P.paper_count)??0,A=((v=i.data)==null?void 0:v.name)??s;return i.error||c.error||a.error?((S=i.error)==null?void 0:S.status)===404?e.jsx(M,{}):e.jsx("div",{className:"page",children:e.jsx(Q,{variant:"destructive",children:e.jsx(K,{children:"Failed to load organization papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(p,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(p,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx(p,{to:`/${s}`,children:A}),e.jsx("span",{children:" / "}),e.jsx("span",{children:d})]}),e.jsxs("div",{style:{marginTop:16,marginBottom:28},children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:o?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:d}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:x.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:"Organization papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",x.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([t,r])=>e.jsx("button",{className:`sort-btn ${h===t?"active":""}`,onClick:()=>z(t),children:r},t))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded in ",e.jsx("span",{children:d})]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,r)=>e.jsx(I,{className:"h-40 w-full"},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((t,r)=>e.jsx(B,{paper:t,rank:r+1},t.id))}),e.jsx("div",{ref:T,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{re as default}; +import{e as w,u as R,r as m,j as e,L as p,b}from"./index-gsUrUwg6.js";import{u as k}from"./useQuery-CPia3mbp.js";import{P as B}from"./components-f5SMGslj.js";import{t as E,d as L}from"./transform-6AvXXXHk.js";import{d as q}from"./usePapers-BgUiIfcw.js";import{u as C}from"./useIntersectionObserver-Jkfl_qWv.js";import{S as I}from"./skeleton-CF5-g5gI.js";import{A as Q,a as K}from"./alert-DCRuvdIl.js";import M from"./NotFound-DntriyTH.js";import"./LatexTitle-BsZuFMnA.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DNCGoDeK.js";const $=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],D=s=>s==="trending"||s==="date_published"||s==="citation_count"?s:"trending",re=()=>{var j,f,N,y,P,v,S;const{orgSlug:s,taskSlug:n}=w(),[g,_]=R(),h=D(g.get("order_by")),z=t=>{const r=new URLSearchParams(g);r.set("order_by",t),_(r)},o=n==="all",O=o?void 0:n,i=k({queryKey:["organization",s],queryFn:()=>b.getOrganization(s),enabled:!!s,staleTime:10*60*1e3}),c=k({queryKey:["task",n],queryFn:()=>b.getTask(n),enabled:!!n&&!o,staleTime:10*60*1e3}),a=q({organizationSlug:s||"",taskSlug:O,page_size:12,order_by:h,order_dir:"desc",include_resources:!0,enabled:!!s}),{targetRef:T,isIntersecting:u}=C({rootMargin:"200px"});m.useEffect(()=>{u&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[u,a.hasNextPage,a.isFetchingNextPage]),m.useEffect(()=>{window.scrollTo(0,0)},[s,n]);const l=m.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages)??[]).flatMap(F=>F.results.map(E))},[a.data]),d=o?"All papers":L(((j=c.data)==null?void 0:j.name)||n||"",((f=c.data)==null?void 0:f.slug)||n),x=((y=(N=a.data)==null?void 0:N.pages[0])==null?void 0:y.count)??((P=i.data)==null?void 0:P.paper_count)??0,A=((v=i.data)==null?void 0:v.name)??s;return i.error||c.error||a.error?((S=i.error)==null?void 0:S.status)===404?e.jsx(M,{}):e.jsx("div",{className:"page",children:e.jsx(Q,{variant:"destructive",children:e.jsx(K,{children:"Failed to load organization papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(p,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(p,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx(p,{to:`/${s}`,children:A}),e.jsx("span",{children:" / "}),e.jsx("span",{children:d})]}),e.jsxs("div",{style:{marginTop:16,marginBottom:28},children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:o?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:d}),i.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:x.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:i.data.name})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:"Organization papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",x.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:$.map(([t,r])=>e.jsx("button",{className:`sort-btn ${h===t?"active":""}`,onClick:()=>z(t),children:r},t))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded in ",e.jsx("span",{children:d})]})]}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,r)=>e.jsx(I,{className:"h-40 w-full"},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((t,r)=>e.jsx(B,{paper:t,rank:r+1},t.id))}),e.jsx("div",{ref:T,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{re as default}; diff --git a/assets/OrganizationsIndexView-6mCxurDk.js b/assets/OrganizationsIndexView-D8tV0kaA.js similarity index 91% rename from assets/OrganizationsIndexView-6mCxurDk.js rename to assets/OrganizationsIndexView-D8tV0kaA.js index a2d299d1e3da3dc35bde4e75b7f1ef7f15e5e833..9b3ec78e408e975242c57d6b14b39829bef231de 100644 --- a/assets/OrganizationsIndexView-6mCxurDk.js +++ b/assets/OrganizationsIndexView-D8tV0kaA.js @@ -1 +1 @@ -import{j as e,L as l,b as o}from"./index-BHOUC_Zu.js";import{u as d}from"./useQuery-BLoDQBYX.js";import{S as c}from"./skeleton-D99KO90d.js";import{A as m,a as h}from"./alert-pE5EZBRN.js";const g={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},f=()=>{var n;const t=d({queryKey:["organizations"],queryFn:()=>o.getOrganizations(),staleTime:6e5});if(t.error)return e.jsx("div",{className:"page",children:e.jsx(m,{variant:"destructive",children:e.jsx(h,{children:"Failed to load organizations. Please try again."})})});const i=((n=t.data)==null?void 0:n.results)??[],r=i.reduce((a,s)=>a+(s.paper_count??0),0);return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research papers grouped by the labs and companies behind them."})]})}),t.isLoading?e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,s)=>e.jsx(c,{className:"h-24"},s))}):e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:g,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Organizations"})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.length," ",i.length===1?"organization":"organizations"," ·"," ",r.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:i.map(a=>e.jsxs(l,{to:`/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{display:"flex",alignItems:"center",gap:10},children:[a.logo_url&&e.jsx("img",{src:a.logo_url,alt:"",width:24,height:24,style:{borderRadius:4,objectFit:"contain",flexShrink:0},onError:s=>{s.currentTarget.style.display="none"}}),a.name]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id))})]})]})};export{f as default}; +import{j as e,L as l,b as o}from"./index-gsUrUwg6.js";import{u as d}from"./useQuery-CPia3mbp.js";import{S as c}from"./skeleton-CF5-g5gI.js";import{A as m,a as h}from"./alert-DCRuvdIl.js";const g={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},f=()=>{var n;const t=d({queryKey:["organizations"],queryFn:()=>o.getOrganizations(),staleTime:6e5});if(t.error)return e.jsx("div",{className:"page",children:e.jsx(m,{variant:"destructive",children:e.jsx(h,{children:"Failed to load organizations. Please try again."})})});const i=((n=t.data)==null?void 0:n.results)??[],r=i.reduce((a,s)=>a+(s.paper_count??0),0);return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research papers grouped by the labs and companies behind them."})]})}),t.isLoading?e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((a,s)=>e.jsx(c,{className:"h-24"},s))}):e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:g,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Organizations"})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.length," ",i.length===1?"organization":"organizations"," ·"," ",r.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:i.map(a=>e.jsxs(l,{to:`/${a.slug}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{display:"flex",alignItems:"center",gap:10},children:[a.logo_url&&e.jsx("img",{src:a.logo_url,alt:"",width:24,height:24,style:{borderRadius:4,objectFit:"contain",flexShrink:0},onError:s=>{s.currentTarget.style.display="none"}}),a.name]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id))})]})]})};export{f as default}; diff --git a/assets/PaperDetailView-B7xj9C7Q.js b/assets/PaperDetailView-BR6DDoza.js similarity index 98% rename from assets/PaperDetailView-B7xj9C7Q.js rename to assets/PaperDetailView-BR6DDoza.js index 8bcaa943d17b75fad1816cb9666d120d5707c379..e35b07b5060fd7c6ea300dcffaa28563363f4587 100644 --- a/assets/PaperDetailView-B7xj9C7Q.js +++ b/assets/PaperDetailView-BR6DDoza.js @@ -1,4 +1,4 @@ -import{g as Ve,h as Er,r as i,j as e,P as Pt,k as te,l as ks,m as lt,n as xe,o as Sr,p as _s,C as me,q as ae,s as je,t as ye,X as ws,v as De,w as Pr,x as Ns,y as Rr,z as Ir,A as Ar,B as Fr,D as $r,E as Le,F as Tr,G as ve,H as Cs,I as Es,J as Lr,K as Mr,M as Dr,N as Ur,O as qr,Q as Br,S as Or,T as Hr,U as ls,V as Kr,W as zr,Y as Qr,Z as Vr,f as ct,R as Rt,b as ot,_ as Ss,d as Ps,e as Gr,$ as Wr,a as Jr,a0 as Xr,L as ge,a1 as Yr,a2 as Zr,a3 as ea,a4 as ta,c as sa,a5 as ra,a6 as aa}from"./index-BHOUC_Zu.js";import{u as oe}from"./useQuery-BLoDQBYX.js";import{I as ee,S as na,a as ia,T as oa,M as la}from"./components-CgNSGcDY.js";import{C as ca,E as da}from"./ExternalSourceEvalBadge-CuyDncpX.js";import{L as st,a as ua}from"./LatexTitle-R8V-03ZY.js";import{c as ma}from"./transform-BaQjfqPg.js";import{f as pa,D as ha}from"./latexPlainText-ChVkH0gY.js";import{a as fa}from"./usePapers-CShAZvOx.js";import{S as Ke}from"./skeleton-D99KO90d.js";import{A as ga,a as xa}from"./alert-pE5EZBRN.js";import{B as K}from"./button-BKNKi_tx.js";import{u as va}from"./index-Del2ukvi.js";import{I as ie}from"./textarea-dXuRCXp_.js";import{D as ke,a as _e,b as we,c as Ne,d as Ce,e as Ee,R as ba,P as ja,O as ya,C as ka}from"./dialog-S5NgAS91.js";import{u as Se}from"./useMutation-B-QOtIkd.js";import{S as It,P as At,a as _a}from"./SignInToEditDialog-DzcyeLv5.js";import{L as le}from"./loader-circle-MkVnaQiB.js";import{B as Rs,D as wa,c as Na,g as Ca,s as Ea,a as Sa,b as Pa,d as Ra,i as Ia,e as Aa}from"./codexAddEvals-DsGqXQP5.js";import{G as cs}from"./github-Du_zsyOo.js";import{M as Fa,r as $a}from"./index-Ybm9YyT5.js";import"./hover-card-CYqiITh9.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-Cme8RlvF.js";/** +import{h as Ve,k as Er,r as i,j as e,P as Pt,l as te,m as ks,n as lt,o as xe,p as Sr,q as _s,C as me,s as ae,t as je,v as ye,X as ws,w as De,x as Pr,y as Ns,z as Rr,A as Ir,B as Ar,D as Fr,E as $r,F as Le,G as Tr,H as ve,I as Cs,J as Es,K as Lr,M as Mr,N as Dr,O as Ur,Q as qr,S as Br,T as Or,U as Hr,V as ls,W as Kr,Y as zr,Z as Qr,_ as Vr,f as ct,R as Rt,b as ot,$ as Ss,d as Ps,e as Gr,a0 as Wr,a as Jr,a1 as Xr,L as ge,a2 as Yr,a3 as Zr,a4 as ea,a5 as ta,c as sa,a6 as ra,a7 as aa}from"./index-gsUrUwg6.js";import{u as oe}from"./useQuery-CPia3mbp.js";import{I as ee,S as na,a as ia,T as oa,M as la}from"./components-f5SMGslj.js";import{C as ca,E as da}from"./ExternalSourceEvalBadge-B_j6-Fi4.js";import{L as st,a as ua}from"./LatexTitle-BsZuFMnA.js";import{c as ma}from"./transform-6AvXXXHk.js";import{f as pa,D as ha}from"./latexPlainText-ChVkH0gY.js";import{a as fa}from"./usePapers-BgUiIfcw.js";import{S as Ke}from"./skeleton-CF5-g5gI.js";import{A as ga,a as xa}from"./alert-DCRuvdIl.js";import{B as K}from"./button-CJ4HWE-U.js";import{u as va}from"./index-Dov-h1--.js";import{I as ie}from"./textarea-lhvg1Jzz.js";import{D as ke,a as _e,b as we,c as Ne,d as Ce,e as Ee,R as ba,P as ja,O as ya,C as ka}from"./dialog-Bil4Ya0L.js";import{u as Se}from"./useMutation-CQieGF4K.js";import{S as It,P as At,a as _a}from"./SignInToEditDialog-DeRdsNO0.js";import{L as le}from"./loader-circle-BgGrBUVx.js";import{B as Rs,D as wa,c as Na,g as Ca,s as Ea,a as Sa,b as Pa,d as Ra,i as Ia,e as Aa}from"./codexAddEvals-CHZ35FuP.js";import{G as cs}from"./github-BR_-AwyS.js";import{M as Fa,r as $a}from"./index-7RUPpdcZ.js";import"./hover-card-BmN6fO7d.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DNCGoDeK.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/PapersListView-BO6EFz71.js b/assets/PapersListView-CEKrrz6_.js similarity index 84% rename from assets/PapersListView-BO6EFz71.js rename to assets/PapersListView-CEKrrz6_.js index 1a5fb2ca52c23c73860550a8b8811ff64e084e99..d72d792bc2c11dab001e38b78f01d694f5b78d38 100644 --- a/assets/PapersListView-BO6EFz71.js +++ b/assets/PapersListView-CEKrrz6_.js @@ -1 +1 @@ -import{u as A,r as i,j as e,L as I,b as T}from"./index-BHOUC_Zu.js";import{I as F,P as L}from"./components-CgNSGcDY.js";import{t as C,d as R}from"./transform-BaQjfqPg.js";import{u as k}from"./usePapers-CShAZvOx.js";import{u as D}from"./useDebounce-CZDogMbl.js";import{u as E,P as O}from"./usePeriodFilter-DmE7oYz7.js";import{u as B}from"./useIntersectionObserver-FWZA_Lvo.js";import{S as c}from"./skeleton-D99KO90d.js";import{A as $,a as M}from"./alert-pE5EZBRN.js";import{u as q}from"./useQuery-BLoDQBYX.js";import"./LatexTitle-R8V-03ZY.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-Cme8RlvF.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],re=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{re as default}; +import{u as A,r as i,j as e,L as I,b as T}from"./index-gsUrUwg6.js";import{I as F,P as L}from"./components-f5SMGslj.js";import{t as C,d as R}from"./transform-6AvXXXHk.js";import{u as k}from"./usePapers-BgUiIfcw.js";import{u as D}from"./useDebounce-DMdZcc3h.js";import{u as E,P as O}from"./usePeriodFilter-CfsBKHc9.js";import{u as B}from"./useIntersectionObserver-Jkfl_qWv.js";import{S as c}from"./skeleton-CF5-g5gI.js";import{A as $,a as M}from"./alert-DCRuvdIl.js";import{u as q}from"./useQuery-CPia3mbp.js";import"./LatexTitle-BsZuFMnA.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-DNCGoDeK.js";const z=[["trending","trending"],["new","newest"],["cited","most cited"]],re=()=>{var x,g,j,f;const[d,N]=A(),o=d.get("search")||"",[p,v]=i.useState(o),t=D(p,300);i.useEffect(()=>{if(t===o)return;const s=new URLSearchParams(d);t?s.set("search",t):s.delete("search"),N(s,{replace:!0})},[t]);const[n,b]=i.useState("new"),{period:P,setPeriod:y,publishedAfter:S}=E("All Time"),a=k({page_size:20,order_by:n==="trending"?"trending":n==="cited"?"citation_count":"date_published",order_dir:"desc",search:t||void 0,published_after:S,include_resources:!0}),m=q({queryKey:["top-tasks-sidebar"],queryFn:()=>T.getTopTasks({limit:8}),staleTime:10*60*1e3}),l=i.useMemo(()=>{var r;return(((r=a.data)==null?void 0:r.pages.flatMap(_=>_.results))||[]).map(C)},[a.data]),{targetRef:w,isIntersecting:h}=B({rootMargin:"200px"});i.useEffect(()=>{h&&a.hasNextPage&&!a.isFetchingNextPage&&a.fetchNextPage()},[h,a.hasNextPage,a.isFetchingNextPage]);const u=((j=(g=(x=a.data)==null?void 0:x.pages)==null?void 0:g[0])==null?void 0:j.count)??0;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:["Search the full corpus. ",u>0&&`${u.toLocaleString()} papers indexed.`]})]}),e.jsx("div",{className:"period-switch",children:O.map(s=>e.jsx("button",{className:`period-btn ${P===s?"active":""}`,onClick:()=>y(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(F,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:p,onChange:s=>v(s.target.value)})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),m.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,r)=>e.jsx(c,{className:"h-5 w-full"},r))}),(f=m.data)==null?void 0:f.map(s=>e.jsxs(I,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[R(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsx("div",{className:"sort-options",children:z.map(([s,r])=>e.jsx("button",{className:`sort-btn ${n===s?"active":""}`,onClick:()=>b(s),children:r},s))}),e.jsxs("div",{className:"results-count",children:[l.length," loaded"]})]}),a.error&&e.jsx($,{variant:"destructive",className:"mb-4",children:e.jsx(M,{children:"Failed to load papers. Please try again."})}),a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,r)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(c,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(c,{className:"h-6 w-3/4"}),e.jsx(c,{className:"h-4 w-1/2"}),e.jsx(c,{className:"h-12 w-full"})]})]},r))}):l.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:l.map((s,r)=>e.jsx(L,{paper:s,rank:r+1},s.id))}),e.jsx("div",{ref:w,style:{height:1}}),a.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{re as default}; diff --git a/assets/SavedPapersView-D3n8Gad0.js b/assets/SavedPapersView-B5Dv-0u7.js similarity index 86% rename from assets/SavedPapersView-D3n8Gad0.js rename to assets/SavedPapersView-B5Dv-0u7.js index 17cc36b413885b075bbea76d7d1a03c01a6c20d0..f2c1c6214b31fabb665c8eda5024fb64c84dcac8 100644 --- a/assets/SavedPapersView-D3n8Gad0.js +++ b/assets/SavedPapersView-B5Dv-0u7.js @@ -1 +1 @@ -import{f as o,j as s,ac as m,L as p,b as h}from"./index-BHOUC_Zu.js";import{u as x}from"./useQuery-BLoDQBYX.js";import{T as u,P as j}from"./components-CgNSGcDY.js";import{S as r}from"./skeleton-D99KO90d.js";import{A as v,a as N}from"./alert-pE5EZBRN.js";import{t as g}from"./transform-BaQjfqPg.js";import"./LatexTitle-R8V-03ZY.js";import"./katex.min-BSBacQyE.js";const L=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{L as default}; +import{f as o,j as s,ad as m,L as p,b as h}from"./index-gsUrUwg6.js";import{u as x}from"./useQuery-CPia3mbp.js";import{T as u,P as j}from"./components-f5SMGslj.js";import{S as r}from"./skeleton-CF5-g5gI.js";import{A as v,a as N}from"./alert-DCRuvdIl.js";import{t as g}from"./transform-6AvXXXHk.js";import"./LatexTitle-BsZuFMnA.js";import"./katex.min-BSBacQyE.js";const L=()=>{var l;const{user:d,isLoading:c}=o(),a=x({queryKey:["my-bookmarks"],queryFn:()=>h.getMyBookmarks(),enabled:!!d,staleTime:30*1e3,refetchOnWindowFocus:!1});return c?s.jsxs("div",{className:"page",children:[s.jsx(r,{className:"h-10 w-1/3 mb-4"}),s.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):d?s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:(l=a.data)!=null&&l.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain."})]})}),a.error&&s.jsx(v,{variant:"destructive",className:"mb-4",children:s.jsx(N,{children:"Failed to load your saved papers. Please try again."})}),a.isLoading?s.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,e)=>s.jsxs("div",{className:"paper-card",children:[s.jsx(r,{className:"h-[220px] w-[160px]"}),s.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[s.jsx(r,{className:"h-6 w-3/4"}),s.jsx(r,{className:"h-4 w-1/2"}),s.jsx(r,{className:"h-12 w-full"})]})]},e))}):!a.data||a.data.count===0?s.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",s.jsx(p,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>s.jsxs("section",{className:"saved-area-section",children:[s.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(e=>{const n=e.papers.length;return s.jsxs("div",{className:"saved-task-block",children:[s.jsxs("div",{className:"saved-task-row",children:[e.slug?s.jsx(u,{slug:e.slug,label:e.name}):s.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:e.name}),s.jsxs("span",{className:"saved-task-count",children:[n," ",n===1?"paper":"papers"]})]}),s.jsx("div",{className:"paper-list",children:e.papers.map(t=>s.jsx(j,{paper:g(t),rank:1},t.id))})]},`task-${i.id??"other"}-${e.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["Saved ",s.jsx("em",{children:"Papers"})]}),s.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),s.jsx("div",{className:"saved-signin-panel",children:s.jsx(m,{returnTo:"/saved"})})]})};export{L as default}; diff --git a/assets/SearchOverlay-BcJrWg54.js b/assets/SearchOverlay-IwrYUcEL.js similarity index 93% rename from assets/SearchOverlay-BcJrWg54.js rename to assets/SearchOverlay-IwrYUcEL.js index c4b1e469787facbc9aff1ccf785ff7171ccd3323..2059a27f904194720da986ef4c038258c73646b3 100644 --- a/assets/SearchOverlay-BcJrWg54.js +++ b/assets/SearchOverlay-IwrYUcEL.js @@ -1 +1 @@ -import{r as C,a as L,R as T,i as $,j as s,b as m}from"./index-BHOUC_Zu.js";import{u as p}from"./useQuery-BLoDQBYX.js";import{L as A}from"./LatexTitle-R8V-03ZY.js";import{u as D}from"./useDebounce-CZDogMbl.js";import{e as z,h as M,d as B}from"./transform-BaQjfqPg.js";import"./katex.min-BSBacQyE.js";const I=10,H=({open:n,onClose:l})=>{var _,f,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6,ordering:"-paper_count",min_eval_count:2}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((_=k.data)==null?void 0:_.results)||[],d=((f=y.data)==null?void 0:f.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{H as default}; +import{r as C,a as L,R as T,i as $,j as s,b as m}from"./index-gsUrUwg6.js";import{u as p}from"./useQuery-CPia3mbp.js";import{L as A}from"./LatexTitle-BsZuFMnA.js";import{u as D}from"./useDebounce-DMdZcc3h.js";import{e as z,h as M,d as B}from"./transform-6AvXXXHk.js";import"./katex.min-BSBacQyE.js";const I=10,H=({open:n,onClose:l})=>{var _,f,F,q,E,P;const v=C.useRef(null),w=L(),[c,R]=T.useState(""),[h,g]=T.useState(1),a=D(c,200),x=$();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=K=>{K.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=p({queryKey:["search-papers",a,h],queryFn:()=>m.searchPapers(a,h,I),enabled:n&&a.length>=2,staleTime:6e4}),k=p({queryKey:["search-tasks",a],queryFn:()=>m.getTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=p({queryKey:["search-methods",a],queryFn:()=>m.getMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=p({queryKey:["search-benchmarks",a],queryFn:()=>m.getDatasets({q:a,page_size:6,ordering:"-paper_count",min_eval_count:2}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((_=k.data)==null?void 0:_.results)||[],d=((f=y.data)==null?void 0:f.results)||[],u=((F=N.data)==null?void 0:F.results)||[],j=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||j.length||d.length||u.length,i=e=>{l(),w(e)},b=()=>{const e=c.trim();e&&i(`/chat?q=${encodeURIComponent(e)}`)};return s.jsx("div",{className:"search-overlay",onClick:l,children:s.jsxs("div",{className:"search-modal",onClick:e=>e.stopPropagation(),children:[s.jsx("input",{ref:v,className:"search-modal-input",placeholder:"Search papers, tasks, methods, or benchmarks…",value:c,onChange:e=>{R(e.target.value),g(1)},onKeyDown:e=>{x&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[x&&c.trim()&&s.jsxs("button",{type:"button",className:"search-ask-row",onClick:b,children:[s.jsx("span",{className:"search-ask-chip",children:"assistant"}),s.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),s.jsx("kbd",{children:"↵"})]}),!a&&s.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",x&&s.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!Q&&!S&&s.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(e=>{const r=z(M(e.slug||""));return s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/tasks/${e.slug}`),children:[s.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:r.dot}}),s.jsx("span",{className:"name",children:B(e.name,e.slug)}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id)})]}),d.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/methods/${e.slug||e.id}`),children:[s.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:e.name}),e.paper_count!=null&&s.jsxs("span",{className:"count",children:[e.paper_count," papers"]})]},e.id))]}),u.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(e=>s.jsxs("div",{className:"search-result-tag",onClick:()=>i(`/benchmark/${e.slug||e.id}`),children:[s.jsx("span",{className:"name",children:e.name}),e.paper_count!=null&&e.paper_count>0&&s.jsxs("span",{className:"count",children:[e.paper_count," entries"]})]},e.id))]}),j.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),j.map(e=>{var r;return s.jsxs("div",{className:"search-result",onClick:()=>i(`/paper/${e.arxiv_id||e.id}`),children:[s.jsx("div",{className:"search-result-title",children:s.jsx(A,{title:e.title})}),s.jsxs("div",{className:"search-result-meta",children:[s.jsx("span",{children:e.arxiv_id?`arXiv:${e.arxiv_id}`:"External resource"}),((r=e.authors)==null?void 0:r[0])&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:[e.authors[0],e.authors.length>1?" et al.":""]})]}),e.citation_count!=null&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{children:["↑ ",e.citation_count.toLocaleString()]})]})]})]},e.id)}),(((E=t.data)==null?void 0:E.previous_page)||((P=t.data)==null?void 0:P.next_page))&&s.jsxs("div",{className:"search-paper-pagination",children:[s.jsx("button",{type:"button",disabled:!t.data.previous_page||t.isFetching,onClick:()=>{var e;return g(((e=t.data)==null?void 0:e.previous_page)||1)},children:"Previous"}),s.jsxs("span",{children:["Page ",h]}),s.jsx("button",{type:"button",disabled:!t.data.next_page||t.isFetching,onClick:()=>{var e;(e=t.data)!=null&&e.next_page&&g(t.data.next_page)},children:"Next"})]})]})]})]})})};export{H as default}; diff --git a/assets/SettingsView-CkIvxrcP.js b/assets/SettingsView-avOWZkJc.js similarity index 92% rename from assets/SettingsView-CkIvxrcP.js rename to assets/SettingsView-avOWZkJc.js index 322a5905d59845b02849d9c63d521a01124135c1..4920e159f92ae1f5fbceaf9321779b1b1a7c9c8a 100644 --- a/assets/SettingsView-CkIvxrcP.js +++ b/assets/SettingsView-avOWZkJc.js @@ -1,4 +1,4 @@ -import{g as t,f as m,a0 as u,aj as p,R as x,j as e,ac as j}from"./index-BHOUC_Zu.js";import{S as y}from"./switch-CEN8Rv4w.js";import{f as g,D as v}from"./latexPlainText-ChVkH0gY.js";import"./index-Del2ukvi.js";/** +import{h as t,f as m,a1 as u,ak as p,R as x,j as e,ad as y}from"./index-gsUrUwg6.js";import{S as j}from"./switch-CnhcVUVf.js";import{f as g,D as v}from"./latexPlainText-ChVkH0gY.js";import"./index-Dov-h1--.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -13,4 +13,4 @@ import{g as t,f as m,a0 as u,aj as p,R as x,j as e,ac as j}from"./index-BHOUC_Zu * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const N=t("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),A=()=>{const{user:i}=m(),{preferences:n,setHideClosedSourceEvals:c,canPersist:l}=u(),{theme:o,setTheme:r}=p(),d=o??"system";return x.useEffect(()=>(document.title=g("Settings"),()=>{document.title=v}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:k},{value:"light",label:"Light",description:"Always use light mode",icon:N},{value:"dark",label:"Dark",description:"Always use dark mode",icon:f}].map(s=>{const h=s.icon,a=d===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${a?"is-selected":""}`,"aria-pressed":a,onClick:()=>r(s.value),children:[e.jsx(h,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(y,{id:"hide-closed-source-evals",checked:n.hide_closed_source_evals,onCheckedChange:s=>{c(!!s)}})]}),!l&&!i&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(j,{returnTo:"/settings"})})]})]})]})};export{A as default}; + */const N=t("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),A=()=>{const{user:i}=m(),{preferences:n,setHideClosedSourceEvals:c,canPersist:l}=u(),{theme:o,setTheme:r}=p(),d=o??"system";return x.useEffect(()=>(document.title=g("Settings"),()=>{document.title=v}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Control how papers and benchmarks are displayed across the site."})]})}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:k},{value:"light",label:"Light",description:"Always use light mode",icon:N},{value:"dark",label:"Dark",description:"Always use dark mode",icon:f}].map(s=>{const h=s.icon,a=d===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${a?"is-selected":""}`,"aria-pressed":a,onClick:()=>r(s.value),children:[e.jsx(h,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:s.label}),e.jsx("span",{className:"theme-option-desc",children:s.description})]})]},s.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(j,{id:"hide-closed-source-evals",checked:n.hide_closed_source_evals,onCheckedChange:s=>{c(!!s)}})]}),!l&&!i&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(y,{returnTo:"/settings"})})]})]})]})};export{A as default}; diff --git a/assets/SignInToEditDialog-DzcyeLv5.js b/assets/SignInToEditDialog-DeRdsNO0.js similarity index 95% rename from assets/SignInToEditDialog-DzcyeLv5.js rename to assets/SignInToEditDialog-DeRdsNO0.js index e5dc3ae6976416f7fa847337665145dd26a7de32..1f3a4fa3437fcd613f80f6a35599e2d9ee87f2df 100644 --- a/assets/SignInToEditDialog-DzcyeLv5.js +++ b/assets/SignInToEditDialog-DeRdsNO0.js @@ -1,4 +1,4 @@ -import{g as X,r as i,j as e,aa as W,q,ab as Q,t as Z,v as ee,X as te,C as se,ac as ae}from"./index-BHOUC_Zu.js";import{B as D}from"./button-BKNKi_tx.js";import{I as h,T as re}from"./textarea-dXuRCXp_.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-S5NgAS91.js";import{u as oe}from"./useMutation-B-QOtIkd.js";import{L as ie}from"./loader-circle-MkVnaQiB.js";/** +import{h as X,r as i,j as e,ab as W,s as q,ac as Q,v as Z,w as ee,X as te,C as se,ad as ae}from"./index-gsUrUwg6.js";import{B as D}from"./button-CJ4HWE-U.js";import{I as h,T as re}from"./textarea-lhvg1Jzz.js";import{D as U,a as H,b as O,c as V,d as $,e as ne}from"./dialog-Bil4Ya0L.js";import{u as oe}from"./useMutation-CQieGF4K.js";import{L as ie}from"./loader-circle-BgGrBUVx.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/SubmissionsDashboard-Dep2ppOa.js b/assets/SubmissionsDashboard-9D45gT9z.js similarity index 78% rename from assets/SubmissionsDashboard-Dep2ppOa.js rename to assets/SubmissionsDashboard-9D45gT9z.js index c41218564912010d61d4b76fdf98affddf45e453..df4ed33a2234209b9fd10469bcc902a85e5814d9 100644 --- a/assets/SubmissionsDashboard-Dep2ppOa.js +++ b/assets/SubmissionsDashboard-9D45gT9z.js @@ -1,6 +1,6 @@ -var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{ap as Ae,aq as ee,ar as Oe,as as Me,s as ke,r as $,at as qe,g as Fe,j as e,au as Se,av as Qe,R as N,q as Q,aw as Ie,c as Ue,f as De,t as we,ax as Le,ay as $e,az as Te,aA as Be,aB as ze,aC as He,aD as se}from"./index-BHOUC_Zu.js";import{Q as Ee,b as Ke,c as Pe,e as Je,d as We,f as Ve,s as pe,g as Ye,h as Ge,u as ge}from"./useQuery-BLoDQBYX.js";import{u as be}from"./useMutation-B-QOtIkd.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-DCaALQgN.js";import{L as B}from"./loader-circle-MkVnaQiB.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,L,U,w,F,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,F);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,F=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,F)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,F,Me(p(this,F),i(t)))),p(this,F)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,F),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ve(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):qe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ye(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ge({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/** +var fe=s=>{throw TypeError(s)};var X=(s,t,i)=>t.has(s)||fe("Cannot "+i);var p=(s,t,i)=>(X(s,t,"read from private field"),i?i.call(s):t.get(s)),E=(s,t,i)=>t.has(s)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),_=(s,t,i,n)=>(X(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(X(s,t,"access private method"),i);import{aq as Ae,ar as ee,as as Oe,at as Me,t as ke,r as $,au as Fe,h as Qe,j as e,av as Se,aw as qe,R as N,s as q,ax as Ie,c as Ue,f as De,v as we,g as Le,ay as $e,az as Te,aA as Be,aB as ze,aC as He,aD as se}from"./index-gsUrUwg6.js";import{Q as Ee,b as Ke,c as Pe,e as Je,d as We,f as Ve,s as pe,g as Ye,h as Ge,u as ge}from"./useQuery-CPia3mbp.js";import{u as be}from"./useMutation-CQieGF4K.js";import{R as Xe,S as Ze,C as es,a as ss}from"./shield-alert-CJqoAF0o.js";import{L as B}from"./loader-circle-BgGrBUVx.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ts(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,L,U,w,Q,z,H,K,P,v,te,ie,Ce,ne,re,ae,_e,is=(_e=class extends Ae{constructor(t,i,n){super();E(this,v);E(this,D);E(this,S);E(this,L);E(this,U);E(this,w);E(this,Q);E(this,z);E(this,H);E(this,K);E(this,P,[]);_(this,D,t),_(this,U,n),_(this,L,[]),_(this,w,[]),_(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&p(this,w).forEach(t=>{t.subscribe(i=>{C(this,v,re).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,p(this,w).forEach(t=>{t.destroy()})}setQueries(t,i){_(this,L,t),_(this,U,i),ee.batch(()=>{const n=p(this,w),r=C(this,v,ne).call(this,p(this,L));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const c=r.map(a=>a.observer),l=c.map(a=>a.getCurrentResult()),d=n.length!==c.length,m=c.some((a,o)=>a!==n[o]),b=d||m,x=b?!0:l.some((a,o)=>{const u=p(this,S)[o];return!u||!Oe(a,u)});!b&&!x||(b&&(_(this,P,r),_(this,w,c)),_(this,S,l),this.hasListeners()&&(b&&(je(n,c).forEach(a=>{a.destroy()}),je(c,n).forEach(a=>{a.subscribe(o=>{C(this,v,re).call(this,a,o)})})),C(this,v,ae).call(this)))})}getCurrentResult(){return p(this,S)}getQueries(){return p(this,w).map(t=>t.getCurrentQuery())}getObservers(){return p(this,w)}getOptimisticResult(t,i){const n=C(this,v,ne).call(this,t),r=n.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),c=n.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>C(this,v,ie).call(this,l??r,i,c),()=>C(this,v,te).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,L=new WeakMap,U=new WeakMap,w=new WeakMap,Q=new WeakMap,z=new WeakMap,H=new WeakMap,K=new WeakMap,P=new WeakMap,v=new WeakSet,te=function(t,i){return i.map((n,r)=>{const c=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?c:n.observer.trackResult(c,l=>{i.forEach(d=>{d.observer.trackProp(l)})})})},ie=function(t,i,n){if(i){const r=p(this,K),c=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((l,d)=>l!==r[d]));return(!p(this,Q)||p(this,S)!==p(this,H)||c||i!==p(this,z))&&(_(this,z,i),_(this,H,p(this,S)),n!==void 0&&_(this,K,n),_(this,Q,Me(p(this,Q),i(t)))),p(this,Q)}return t},Ce=function(){var t;return((t=p(this,U))==null?void 0:t.combine)!==void 0&&p(this,w).some((i,n)=>{var r;return i.options.suspense&&((r=p(this,S)[n])==null?void 0:r.data)===void 0})},ne=function(t){const i=new Map;p(this,w).forEach(r=>{const c=r.options.queryHash;if(!c)return;const l=i.get(c);l?l.push(r):i.set(c,[r])});const n=[];return t.forEach(r=>{var m;const c=p(this,D).defaultQueryOptions(r),d=((m=i.get(c.queryHash))==null?void 0:m.shift())??new Ee(p(this,D),c);n.push({defaultedQueryOptions:c,observer:d})}),n},re=function(t,i){const n=p(this,w).indexOf(t);n!==-1&&(_(this,S,ts(p(this,S),n,i)),C(this,v,ae).call(this))},ae=function(){var t;if(this.hasListeners()){const i=C(this,v,te).call(this,p(this,S),p(this,P)),n=C(this,v,Ce).call(this),r=p(this,Q),c=n?r:C(this,v,ie).call(this,i,(t=p(this,U))==null?void 0:t.combine);(n||r!==c)&&ee.batch(()=>{this.listeners.forEach(l=>{l(p(this,S))})})}},_e);function Y({queries:s,...t},i){const n=ke(),r=Ke(),c=Pe(),l=$.useMemo(()=>s.map(h=>{const y=n.defaultQueryOptions(h);return y._optimisticResults=r?"isRestoring":"optimistic",y}),[s,n,r]);l.forEach(h=>{Je(h);const y=n.getQueryCache().get(h.queryHash);We(h,c,y)}),Ve(c);const[d]=$.useState(()=>new is(n,l,t)),[m,b,x]=d.getOptimisticResult(l,t.combine),a=!r&&t.subscribed!==!1;$.useSyncExternalStore($.useCallback(h=>a?d.subscribe(ee.batchCalls(h)):Fe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,t)},[l,t,d]);const u=m.some((h,y)=>pe(l[y],h))?m.flatMap((h,y)=>{const f=l[y];if(f&&pe(f,h)){const I=new Ee(n,f);return Ye(f,I,c)}return[]}):[];if(u.length>0)throw Promise.all(u);const j=m.find((h,y)=>{const f=l[y];return f&&Ge({result:h,errorResetBoundary:c,throwOnError:f.throwOnError,query:n.getQueryCache().get(f.queryHash),suspense:f.suspense})});if(j!=null&&j.error)throw j.error;return b(x())}/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ns=Fe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),M=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},xe=s=>Array.isArray(s)?s.map(t=>{const i=M(t),n=Number(i.id);return Number.isFinite(n)?{id:n,name:typeof i.name=="string"?i.name:`#${n}`,slug:typeof i.slug=="string"?i.slug:void 0}:null}).filter(t=>!!t):[],ve=s=>Array.isArray(s)?s.map(Number).filter(t=>Number.isFinite(t)):[],W=s=>Array.isArray(s)?s.map(t=>{const i=M(t);return typeof i.url!="string"?null:{url:i.url,is_official:!!i.is_official}}).filter(t=>!!t):[],rs=s=>Array.isArray(s)?s.map(t=>M(t)):[],as=s=>Array.isArray(s)?s.map(t=>M(t)):[],os=s=>s.replace(/_/g," ");function cs({currentPayload:s,proposedPayload:t}){const[i,n]=N.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(r=>!r),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(oe,{title:"Current payload",value:s??{}}),e.jsx(oe,{title:"Proposed payload",value:t})]})]})}function oe({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function Ne({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n}){const r=N.useMemo(()=>Array.from(new Set([...s.map(o=>o.id),...t])).sort((o,u)=>o-u),[s,t]),c=Y({queries:r.map(o=>({queryKey:[i,String(o)],queryFn:()=>n(String(o)),staleTime:5*60*1e3}))}),l=N.useMemo(()=>{const o=new Map;return s.forEach(u=>o.set(u.id,u.name)),c.forEach(u=>{const j=u.data;if(!j)return;const h=Number(j.id);Number.isFinite(h)&&o.set(h,j.name)}),o},[s,c]),d=new Set(s.map(o=>o.id)),m=new Set(t),b=r.filter(o=>d.has(o)&&!m.has(o)),x=r.filter(o=>!d.has(o)&&m.has(o)),a=(o,u)=>{const j=u==="current"&&b.includes(o),h=u==="proposed"&&x.includes(o);return e.jsx("span",{className:Q("submission-diff-pill",j&&"removed",h&&"added"),children:l.get(o)??`#${o}`},o)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(o=>a(o.id,"current")):e.jsx(k,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:t.length>0?t.map(o=>a(o,"proposed")):e.jsx(k,{children:"No proposed tags"})})]})}function ce({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(l=>[l.url,l])),r=new Map(i.map(l=>[l.url,l])),c=Array.from(new Set([...n.keys(),...r.keys()])).sort();return c.length===0?e.jsxs(k,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(l=>{var o;const d=n.get(l),m=r.get(l),b=!d&&m,x=d&&!m,a=d&&m&&d.is_official!==m.is_official;return e.jsx("div",{className:Q("submission-url-row",b&&"added",x&&"removed",a&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:Q("submission-url-link",x&&"removed"),children:l}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),x&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),a&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(m.is_official)]}),((o=m??d)==null?void 0:o.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},l)})})}function ls({currentPayload:s,proposedPayload:t}){const i=rs(M(s).evaluations),n=as(t.operations),r=N.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.task_id&&a.add(Number(o.task_id))}),n.forEach(o=>{const u=o.data;u!=null&&u.task_id&&a.add(Number(u.task_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),c=N.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.dataset_id&&a.add(Number(o.dataset_id))}),n.forEach(o=>{const u=o.data;u!=null&&u.dataset_id&&a.add(Number(u.dataset_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),l=Y({queries:r.map(a=>({queryKey:["task",String(a)],queryFn:()=>Se(String(a)),staleTime:5*60*1e3}))}),d=Y({queries:c.map(a=>({queryKey:["dataset",String(a)],queryFn:()=>Ie(String(a)),staleTime:5*60*1e3}))}),m=N.useMemo(()=>{const a=new Map;return l.forEach(o=>{const u=o.data;if(!u)return;const j=Number(u.id);Number.isFinite(j)&&a.set(j,u.name)}),a},[l]),b=N.useMemo(()=>{const a=new Map;return d.forEach(o=>{const u=o.data;if(!u)return;const j=Number(u.id);Number.isFinite(j)&&a.set(j,u.name)}),a},[d]),x=new Map(i.filter(a=>a.id!=null).map(a=>[Number(a.id),a]));return n.length===0?e.jsx(k,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((a,o)=>{const u=a.evaluation_id?x.get(a.evaluation_id):void 0,h=(a.op==="update"?{...u,...a.data}:a.data??u)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:Q("submission-pill status",a.op==="create"&&"approved",a.op==="update"&&"changed",a.op==="delete"&&"rejected"),children:a.op??"unknown"}),a.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",a.evaluation_id]})]}),a.op&&["create","update","delete"].includes(a.op)?e.jsx(ds,{evaluation:h,taskNames:m,datasetNames:b}):e.jsx(oe,{title:"Unsupported operation",value:a})]},`${a.op}-${a.evaluation_id??o}`)})})}function ds({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(q,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(q,{label:"Dataset",value:r?i.get(r)??`#${r}`:null}),e.jsx(q,{label:"Model",value:s.model_name||null}),e.jsx(q,{label:"Harness",value:s.harness||null}),e.jsx(q,{label:"Best rank",value:s.best_rank??null}),e.jsx(q,{label:"Parameters",value:s.num_parameters??null}),e.jsx(q,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(q,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([l,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[l,": ",String(d)]},l))}):e.jsx(k,{children:"No metrics"})]})]})}function q({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function us({currentPayload:s,proposedPayload:t}){const i=M(s).source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:i,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(k,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(k,{children:"No proposed URL"})})]})}function T({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",r=typeof t.dates=="string"?t.dates:"",c=typeof t.venue=="string"?t.venue:"",l=typeof t.url=="string"?t.url:"",d=M(t.image),m=typeof d.data_url=="string"&&d.data_url.startsWith("data:image/")?d.data_url:"",b=typeof d.url=="string"?Ue(d.url)??"":m,x=typeof d.file_name=="string"?d.file_name:"Suggested image",a=typeof t.image_credit=="string"?t.image_credit:"",o=typeof t.source=="string"?t.source:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(k,{children:"No name provided"})}),e.jsx(R,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(k,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Image",children:b?e.jsx("img",{src:b,alt:x,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(k,{children:"No image provided"})}),e.jsx(R,{title:"Image source",children:a||e.jsx(k,{children:"No image source provided"})})]}),s==="method"&&e.jsx(R,{title:"Source",children:o?o.startsWith("http://")||o.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:o,target:"_blank",rel:"noopener noreferrer",children:o}):e.jsx("span",{className:"submission-field-value",children:o}):e.jsx(k,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Dates",children:r||e.jsx(k,{children:"No dates provided"})}),e.jsx(R,{title:"Venue",children:c||e.jsx(k,{children:"No venue provided"})}),e.jsx(R,{title:"URL",children:l?e.jsx("a",{className:"submission-url-link",href:l,target:"_blank",rel:"noopener noreferrer",children:l}):e.jsx(k,{children:"No URL provided"})})]})]})}function R({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function k({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ms({currentPayload:s,proposedPayload:t}){const i=M(s),n=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:n.map(({key:r,label:c})=>{const l=Array.isArray(i[r])?i[r].filter(m=>typeof m=="string"):[],d=Array.isArray(t[r])?t[r].filter(m=>typeof m=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:c}),e.jsx(ce,{label:c.toLowerCase(),currentItems:l.map(m=>({url:m,is_official:!1})),proposedItems:d.map(m=>({url:m,is_official:!1}))})]},r)})})}function hs({editType:s,currentPayload:t,proposedPayload:i}){const n=M(t);let r;return s==="tasks"?r=e.jsx(Ne,{currentItems:xe(n.tasks),proposedIds:ve(i.task_ids),queryPrefix:"task",fetchEntity:Se}):s==="methods"?r=e.jsx(Ne,{currentItems:xe(n.methods),proposedIds:ve(i.method_ids),queryPrefix:"method",fetchEntity:Qe}):s==="repositories"?r=e.jsx(ce,{label:"repositories",currentItems:W(n.repositories),proposedItems:W(i.repositories)}):s==="project_pages"?r=e.jsx(ce,{label:"project pages",currentItems:W(n.project_pages),proposedItems:W(i.project_pages)}):s==="evaluations"?r=e.jsx(ls,{currentPayload:t,proposedPayload:i}):s==="source_url"?r=e.jsx(us,{currentPayload:t,proposedPayload:i}):s==="hf_artifacts"?r=e.jsx(ms,{currentPayload:t,proposedPayload:i}):s==="new_task"?r=e.jsx(T,{kind:"task",proposedPayload:i}):s==="new_method"?r=e.jsx(T,{kind:"method",proposedPayload:i}):s==="new_benchmark"?r=e.jsx(T,{kind:"benchmark",proposedPayload:i}):s==="new_metric"?r=e.jsx(T,{kind:"metric",proposedPayload:i}):s==="new_conference"?r=e.jsx(T,{kind:"conference",proposedPayload:i}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",os(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(cs,{currentPayload:t,proposedPayload:i})]})}const Z=25,fs=["pending","approved","rejected","all"],ps=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference"],le=["pending","approved","rejected"];function gs(s){return s.slice(0,2).toUpperCase()}function V(s){return s.replace(/_/g," ")}function ye(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),n=Math.floor(i/6e4),r=Math.floor(i/36e5),c=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:r<24?`${r}h ago`:c<14?`${c}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function de(s,t){var n;const i=s;if(i.response)try{const r=JSON.parse(i.response);if(typeof(r==null?void 0:r.detail)=="string")return r.detail;if(Array.isArray(r==null?void 0:r.detail)&&((n=r.detail[0])!=null&&n.msg))return r.detail[0].msg}catch{return i.response}return i.message||t}function bs(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function js(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function xs(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function vs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return se({status:s,edit_type:n,limit:i,offset:0});const r=await Promise.all(le.map(c=>se({status:c,edit_type:n,limit:i,offset:0})));return{count:r.reduce((c,l)=>c+l.count,0),results:xs(r.flatMap(c=>c.results)).slice(0,i)}}function Ns(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Ze,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function ys(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(B,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function _s({submission:s,paper:t}){const[i,n]=N.useState(s.admin_note??""),r=ke(),{toast:c}=we(),l=s.paper_id==null,d=l?null:js(t,s.paper_id),m=l?"Taxonomy directory":(t==null?void 0:t.title)||`Paper #${s.paper_id}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,x=s.status==="pending";N.useEffect(()=>{n(s.admin_note??"")},[s.admin_note,s.id]);const a=N.useCallback(f=>{r.invalidateQueries({queryKey:["pendingPaperEdits"]}),r.invalidateQueries({queryKey:["pendingPaperEdit",f.id]}),f.paper_id!=null&&(r.invalidateQueries({queryKey:["paper",String(f.paper_id)]}),r.invalidateQueries({queryKey:["paper-summary",String(f.paper_id)]})),t!=null&&t.arxiv_id&&r.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),f.edit_type==="evaluations"&&f.paper_id!=null&&r.invalidateQueries({queryKey:["evaluations","paper",String(f.paper_id)]})},[t==null?void 0:t.arxiv_id,r]),o=be({mutationFn:()=>ze(s.id,{admin_note:i.trim()||void 0}),onSuccess:f=>{a(f),c({title:"Submission approved",description:`Applied ${V(s.edit_type)} changes for ${m}.`})},onError:f=>{c({title:"Could not approve submission",description:de(f,"Approval failed. Please try again."),variant:"destructive"})}}),u=be({mutationFn:()=>He(s.id,{admin_note:i.trim()||void 0}),onSuccess:f=>{a(f),c({title:"Submission rejected",description:`Rejected ${V(s.edit_type)} changes for ${m}.`})},onError:f=>{c({title:"Could not reject submission",description:de(f,"Rejection failed. Please try again."),variant:"destructive"})}}),j=o.isPending,h=u.isPending,y=j||h;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:m}):e.jsx("div",{className:"submission-title",children:m}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?"Directory suggestion":`Paper #${s.paper_id}`}),e.jsx("span",{children:ye(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:V(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:Q("submission-pill status",bs(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs($e,{className:"h-6 w-6",children:[e.jsx(Te,{src:b,alt:s.hf_username}),e.jsx(Be,{className:"text-[10px]",children:gs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(hs,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:x?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:i,onChange:f=>n(f.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:y}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>u.mutate(),disabled:y,className:"submission-action-btn reject",children:[h?e.jsx(B,{className:"spin",size:14}):e.jsx(es,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>o.mutate(),disabled:y,className:"submission-action-btn approve",children:[j?e.jsx(B,{className:"spin",size:14}):e.jsx(ss,{size:14}),"Approve"]})]})]}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${ye(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]})]})})]})}function As(){var ue,me,he;const{user:s,isLoading:t}=De(),{toast:i}=we(),[n,r]=N.useState("pending"),[c,l]=N.useState("all"),[d,m]=N.useState(Z),b=!!(s!=null&&s.is_admin);N.useEffect(()=>{m(Z)},[n,c]);const x=ge({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const g=c==="all"?void 0:c,A=await Promise.all(le.map(O=>se({status:O,edit_type:g,limit:1,offset:0})));return Object.fromEntries(A.map((O,J)=>[le[J],O.count]))},enabled:b,staleTime:30*1e3}),a=ge({queryKey:["pendingPaperEdits",{status:n,editType:c,visibleLimit:d}],queryFn:()=>vs(n,c,d),enabled:b,retry:!1}),o=N.useMemo(()=>{var g;return Array.from(new Set((((g=a.data)==null?void 0:g.results)??[]).map(A=>A.paper_id).filter(A=>A!=null))).sort((A,O)=>A-O)},[(ue=a.data)==null?void 0:ue.results]),u=Y({queries:o.map(g=>({queryKey:["paper-summary",String(g)],queryFn:()=>Le(String(g),!1),enabled:b,staleTime:5*60*1e3}))}),j=N.useMemo(()=>{const g=new Map;return u.forEach(A=>{const O=A.data;if(!O)return;const J=Number(O.id);Number.isFinite(J)&&g.set(J,O)}),g},[u]);if(N.useEffect(()=>{a.error&&i({title:"Could not load submissions",description:de(a.error,"Failed to load pending paper edits."),variant:"destructive"})},[a.error,i]),t)return e.jsx(ys,{});if(!b)return e.jsx(Ns,{});const h=x.data,y=h?h.pending+h.approved+h.rejected:void 0,f={pending:h==null?void 0:h.pending,approved:h==null?void 0:h.approved,rejected:h==null?void 0:h.rejected,all:y},I=((me=a.data)==null?void 0:me.results)??[],G=((he=a.data)==null?void 0:he.count)??0,Re=I.length{x.refetch(),a.refetch()},disabled:a.isFetching||x.isFetching,children:[e.jsx(Xe,{className:Q((a.isFetching||x.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:fs.map(g=>e.jsxs("button",{type:"button",className:Q("period-btn",n===g&&"active"),onClick:()=>r(g),children:[g,f[g]!=null&&e.jsx("span",{className:"submission-count",children:f[g]})]},g))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:ps.map(g=>e.jsx("button",{type:"button",className:Q("sort-btn",c===g&&"active"),onClick:()=>l(g),children:V(g)},g))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:a.isFetching?"refreshing":`${G} submissions`})})})}),a.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(B,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):I.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ns,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:I.map(g=>e.jsx(_s,{submission:g,paper:g.paper_id==null?void 0:j.get(g.paper_id)},g.id))}),I.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",I.length," of ",G," submissions"]}),Re&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(g=>g+Z),disabled:a.isFetching,children:[a.isFetching&&e.jsx(B,{className:"spin",size:14}),"Load more"]})]})]})]})}export{As as default}; + */const ns=Qe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),M=s=>s&&typeof s=="object"&&!Array.isArray(s)?s:{},xe=s=>Array.isArray(s)?s.map(t=>{const i=M(t),n=Number(i.id);return Number.isFinite(n)?{id:n,name:typeof i.name=="string"?i.name:`#${n}`,slug:typeof i.slug=="string"?i.slug:void 0}:null}).filter(t=>!!t):[],ve=s=>Array.isArray(s)?s.map(Number).filter(t=>Number.isFinite(t)):[],W=s=>Array.isArray(s)?s.map(t=>{const i=M(t);return typeof i.url!="string"?null:{url:i.url,is_official:!!i.is_official}}).filter(t=>!!t):[],rs=s=>Array.isArray(s)?s.map(t=>M(t)):[],as=s=>Array.isArray(s)?s.map(t=>M(t)):[],os=s=>s.replace(/_/g," ");function cs({currentPayload:s,proposedPayload:t}){const[i,n]=N.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(r=>!r),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(oe,{title:"Current payload",value:s??{}}),e.jsx(oe,{title:"Proposed payload",value:t})]})]})}function oe({title:s,value:t}){return e.jsxs("div",{className:"submission-json-block",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function Ne({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n}){const r=N.useMemo(()=>Array.from(new Set([...s.map(o=>o.id),...t])).sort((o,u)=>o-u),[s,t]),c=Y({queries:r.map(o=>({queryKey:[i,String(o)],queryFn:()=>n(String(o)),staleTime:5*60*1e3}))}),l=N.useMemo(()=>{const o=new Map;return s.forEach(u=>o.set(u.id,u.name)),c.forEach(u=>{const j=u.data;if(!j)return;const h=Number(j.id);Number.isFinite(h)&&o.set(h,j.name)}),o},[s,c]),d=new Set(s.map(o=>o.id)),m=new Set(t),b=r.filter(o=>d.has(o)&&!m.has(o)),x=r.filter(o=>!d.has(o)&&m.has(o)),a=(o,u)=>{const j=u==="current"&&b.includes(o),h=u==="proposed"&&x.includes(o);return e.jsx("span",{className:q("submission-diff-pill",j&&"removed",h&&"added"),children:l.get(o)??`#${o}`},o)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Currently tagged",children:s.length>0?s.map(o=>a(o.id,"current")):e.jsx(k,{children:"No current tags"})}),e.jsx(R,{title:"Will be tagged",children:t.length>0?t.map(o=>a(o,"proposed")):e.jsx(k,{children:"No proposed tags"})})]})}function ce({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(l=>[l.url,l])),r=new Map(i.map(l=>[l.url,l])),c=Array.from(new Set([...n.keys(),...r.keys()])).sort();return c.length===0?e.jsxs(k,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:c.map(l=>{var o;const d=n.get(l),m=r.get(l),b=!d&&m,x=d&&!m,a=d&&m&&d.is_official!==m.is_official;return e.jsx("div",{className:q("submission-url-row",b&&"added",x&&"removed",a&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:q("submission-url-link",x&&"removed"),children:l}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),x&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),a&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(m.is_official)]}),((o=m??d)==null?void 0:o.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},l)})})}function ls({currentPayload:s,proposedPayload:t}){const i=rs(M(s).evaluations),n=as(t.operations),r=N.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.task_id&&a.add(Number(o.task_id))}),n.forEach(o=>{const u=o.data;u!=null&&u.task_id&&a.add(Number(u.task_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),c=N.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.dataset_id&&a.add(Number(o.dataset_id))}),n.forEach(o=>{const u=o.data;u!=null&&u.dataset_id&&a.add(Number(u.dataset_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),l=Y({queries:r.map(a=>({queryKey:["task",String(a)],queryFn:()=>Se(String(a)),staleTime:5*60*1e3}))}),d=Y({queries:c.map(a=>({queryKey:["dataset",String(a)],queryFn:()=>Ie(String(a)),staleTime:5*60*1e3}))}),m=N.useMemo(()=>{const a=new Map;return l.forEach(o=>{const u=o.data;if(!u)return;const j=Number(u.id);Number.isFinite(j)&&a.set(j,u.name)}),a},[l]),b=N.useMemo(()=>{const a=new Map;return d.forEach(o=>{const u=o.data;if(!u)return;const j=Number(u.id);Number.isFinite(j)&&a.set(j,u.name)}),a},[d]),x=new Map(i.filter(a=>a.id!=null).map(a=>[Number(a.id),a]));return n.length===0?e.jsx(k,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((a,o)=>{const u=a.evaluation_id?x.get(a.evaluation_id):void 0,h=(a.op==="update"?{...u,...a.data}:a.data??u)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:q("submission-pill status",a.op==="create"&&"approved",a.op==="update"&&"changed",a.op==="delete"&&"rejected"),children:a.op??"unknown"}),a.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",a.evaluation_id]})]}),a.op&&["create","update","delete"].includes(a.op)?e.jsx(ds,{evaluation:h,taskNames:m,datasetNames:b}):e.jsx(oe,{title:"Unsupported operation",value:a})]},`${a.op}-${a.evaluation_id??o}`)})})}function ds({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,c=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(F,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(F,{label:"Dataset",value:r?i.get(r)??`#${r}`:null}),e.jsx(F,{label:"Model",value:s.model_name||null}),e.jsx(F,{label:"Harness",value:s.harness||null}),e.jsx(F,{label:"Best rank",value:s.best_rank??null}),e.jsx(F,{label:"Parameters",value:s.num_parameters??null}),e.jsx(F,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(F,{label:"Open source",value:s.is_open===void 0?null:s.is_open?"Yes":"No"}),e.jsxs("div",{className:"submission-eval-metrics",children:[e.jsx("div",{className:"submission-diff-label",children:"Metrics"}),Object.keys(c).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(c).map(([l,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[l,": ",String(d)]},l))}):e.jsx(k,{children:"No metrics"})]})]})}function F({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-field-value",children:t??e.jsx("span",{className:"submission-muted",children:"Not set"})})]})}function us({currentPayload:s,proposedPayload:t}){const i=M(s).source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:i,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(k,{children:"No current URL"})}),e.jsx(R,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(k,{children:"No proposed URL"})})]})}function T({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",r=typeof t.dates=="string"?t.dates:"",c=typeof t.venue=="string"?t.venue:"",l=typeof t.url=="string"?t.url:"",d=M(t.image),m=typeof d.data_url=="string"&&d.data_url.startsWith("data:image/")?d.data_url:"",b=typeof d.url=="string"?Ue(d.url)??"":m,x=typeof d.file_name=="string"?d.file_name:"Suggested image",a=typeof t.image_credit=="string"?t.image_credit:"",o=typeof t.source=="string"?t.source:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(R,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(k,{children:"No name provided"})}),e.jsx(R,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(k,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Image",children:b?e.jsx("img",{src:b,alt:x,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(k,{children:"No image provided"})}),e.jsx(R,{title:"Image source",children:a||e.jsx(k,{children:"No image source provided"})})]}),s==="method"&&e.jsx(R,{title:"Source",children:o?o.startsWith("http://")||o.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:o,target:"_blank",rel:"noopener noreferrer",children:o}):e.jsx("span",{className:"submission-field-value",children:o}):e.jsx(k,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(R,{title:"Dates",children:r||e.jsx(k,{children:"No dates provided"})}),e.jsx(R,{title:"Venue",children:c||e.jsx(k,{children:"No venue provided"})}),e.jsx(R,{title:"URL",children:l?e.jsx("a",{className:"submission-url-link",href:l,target:"_blank",rel:"noopener noreferrer",children:l}):e.jsx(k,{children:"No URL provided"})})]})]})}function R({title:s,children:t}){return e.jsxs("div",{className:"submission-diff-column",children:[e.jsx("div",{className:"submission-diff-label",children:s}),e.jsx("div",{className:"submission-diff-pills",children:t})]})}function k({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ms({currentPayload:s,proposedPayload:t}){const i=M(s),n=[{key:"hf_models",label:"Models"},{key:"hf_datasets",label:"Datasets"},{key:"hf_spaces",label:"Spaces"}];return e.jsx("div",{className:"submission-hf-artifacts-diff",children:n.map(({key:r,label:c})=>{const l=Array.isArray(i[r])?i[r].filter(m=>typeof m=="string"):[],d=Array.isArray(t[r])?t[r].filter(m=>typeof m=="string"):[];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:c}),e.jsx(ce,{label:c.toLowerCase(),currentItems:l.map(m=>({url:m,is_official:!1})),proposedItems:d.map(m=>({url:m,is_official:!1}))})]},r)})})}function hs({editType:s,currentPayload:t,proposedPayload:i}){const n=M(t);let r;return s==="tasks"?r=e.jsx(Ne,{currentItems:xe(n.tasks),proposedIds:ve(i.task_ids),queryPrefix:"task",fetchEntity:Se}):s==="methods"?r=e.jsx(Ne,{currentItems:xe(n.methods),proposedIds:ve(i.method_ids),queryPrefix:"method",fetchEntity:qe}):s==="repositories"?r=e.jsx(ce,{label:"repositories",currentItems:W(n.repositories),proposedItems:W(i.repositories)}):s==="project_pages"?r=e.jsx(ce,{label:"project pages",currentItems:W(n.project_pages),proposedItems:W(i.project_pages)}):s==="evaluations"?r=e.jsx(ls,{currentPayload:t,proposedPayload:i}):s==="source_url"?r=e.jsx(us,{currentPayload:t,proposedPayload:i}):s==="hf_artifacts"?r=e.jsx(ms,{currentPayload:t,proposedPayload:i}):s==="new_task"?r=e.jsx(T,{kind:"task",proposedPayload:i}):s==="new_method"?r=e.jsx(T,{kind:"method",proposedPayload:i}):s==="new_benchmark"?r=e.jsx(T,{kind:"benchmark",proposedPayload:i}):s==="new_metric"?r=e.jsx(T,{kind:"metric",proposedPayload:i}):s==="new_conference"?r=e.jsx(T,{kind:"conference",proposedPayload:i}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",os(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(cs,{currentPayload:t,proposedPayload:i})]})}const Z=25,fs=["pending","approved","rejected","all"],ps=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference"],le=["pending","approved","rejected"];function gs(s){return s.slice(0,2).toUpperCase()}function V(s){return s.replace(/_/g," ")}function ye(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),n=Math.floor(i/6e4),r=Math.floor(i/36e5),c=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:r<24?`${r}h ago`:c<14?`${c}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function de(s,t){var n;const i=s;if(i.response)try{const r=JSON.parse(i.response);if(typeof(r==null?void 0:r.detail)=="string")return r.detail;if(Array.isArray(r==null?void 0:r.detail)&&((n=r.detail[0])!=null&&n.msg))return r.detail[0].msg}catch{return i.response}return i.message||t}function bs(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function js(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function xs(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function vs(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return se({status:s,edit_type:n,limit:i,offset:0});const r=await Promise.all(le.map(c=>se({status:c,edit_type:n,limit:i,offset:0})));return{count:r.reduce((c,l)=>c+l.count,0),results:xs(r.flatMap(c=>c.results)).slice(0,i)}}function Ns(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(Ze,{size:22}),e.jsx("h1",{children:"Admin access required"}),e.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to review paper edit submissions."})]})})}function ys(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(B,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function _s({submission:s,paper:t}){const[i,n]=N.useState(s.admin_note??""),r=ke(),{toast:c}=we(),l=s.paper_id==null,d=l?null:js(t,s.paper_id),m=l?"Taxonomy directory":(t==null?void 0:t.title)||`Paper #${s.paper_id}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,x=s.status==="pending";N.useEffect(()=>{n(s.admin_note??"")},[s.admin_note,s.id]);const a=N.useCallback(f=>{r.invalidateQueries({queryKey:["pendingPaperEdits"]}),r.invalidateQueries({queryKey:["pendingPaperEdit",f.id]}),f.paper_id!=null&&(r.invalidateQueries({queryKey:["paper",String(f.paper_id)]}),r.invalidateQueries({queryKey:["paper-summary",String(f.paper_id)]})),t!=null&&t.arxiv_id&&r.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),f.edit_type==="evaluations"&&f.paper_id!=null&&r.invalidateQueries({queryKey:["evaluations","paper",String(f.paper_id)]})},[t==null?void 0:t.arxiv_id,r]),o=be({mutationFn:()=>ze(s.id,{admin_note:i.trim()||void 0}),onSuccess:f=>{a(f),c({title:"Submission approved",description:`Applied ${V(s.edit_type)} changes for ${m}.`})},onError:f=>{c({title:"Could not approve submission",description:de(f,"Approval failed. Please try again."),variant:"destructive"})}}),u=be({mutationFn:()=>He(s.id,{admin_note:i.trim()||void 0}),onSuccess:f=>{a(f),c({title:"Submission rejected",description:`Rejected ${V(s.edit_type)} changes for ${m}.`})},onError:f=>{c({title:"Could not reject submission",description:de(f,"Rejection failed. Please try again."),variant:"destructive"})}}),j=o.isPending,h=u.isPending,y=j||h;return e.jsxs("article",{id:`submission-${s.id}`,className:"submission-card",children:[e.jsxs("header",{className:"submission-card-header",children:[e.jsxs("div",{className:"submission-card-top",children:[e.jsxs("div",{children:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:m}):e.jsx("div",{className:"submission-title",children:m}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?"Directory suggestion":`Paper #${s.paper_id}`}),e.jsx("span",{children:ye(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:V(s.edit_type)}),s.is_author&&e.jsx("span",{className:"submission-pill author",children:"Linked author"}),e.jsx("span",{className:q("submission-pill status",bs(s.status)),children:s.status})]})]}),e.jsxs("a",{href:`https://huggingface.co/${encodeURIComponent(s.hf_username)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-user",children:[e.jsxs($e,{className:"h-6 w-6",children:[e.jsx(Te,{src:b,alt:s.hf_username}),e.jsx(Be,{className:"text-[10px]",children:gs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(hs,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),e.jsx("footer",{className:"submission-actions",children:x?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:i,onChange:f=>n(f.target.value),placeholder:"Optional admin note",className:"submission-note",disabled:y}),e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>u.mutate(),disabled:y,className:"submission-action-btn reject",children:[h?e.jsx(B,{className:"spin",size:14}):e.jsx(es,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>o.mutate(),disabled:y,className:"submission-action-btn approve",children:[j?e.jsx(B,{className:"spin",size:14}):e.jsx(ss,{size:14}),"Approve"]})]})]}):e.jsxs("div",{className:"submission-reviewed",children:[e.jsxs("span",{children:["Reviewed by ",e.jsx("strong",{children:s.reviewed_by||"unknown"}),s.reviewed_at?` ${ye(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]})]})})]})}function As(){var ue,me,he;const{user:s,isLoading:t}=De(),{toast:i}=we(),[n,r]=N.useState("pending"),[c,l]=N.useState("all"),[d,m]=N.useState(Z),b=!!(s!=null&&s.is_admin);N.useEffect(()=>{m(Z)},[n,c]);const x=ge({queryKey:["pendingPaperEdits","counts",c],queryFn:async()=>{const g=c==="all"?void 0:c,A=await Promise.all(le.map(O=>se({status:O,edit_type:g,limit:1,offset:0})));return Object.fromEntries(A.map((O,J)=>[le[J],O.count]))},enabled:b,staleTime:30*1e3}),a=ge({queryKey:["pendingPaperEdits",{status:n,editType:c,visibleLimit:d}],queryFn:()=>vs(n,c,d),enabled:b,retry:!1}),o=N.useMemo(()=>{var g;return Array.from(new Set((((g=a.data)==null?void 0:g.results)??[]).map(A=>A.paper_id).filter(A=>A!=null))).sort((A,O)=>A-O)},[(ue=a.data)==null?void 0:ue.results]),u=Y({queries:o.map(g=>({queryKey:["paper-summary",String(g)],queryFn:()=>Le(String(g),!1),enabled:b,staleTime:5*60*1e3}))}),j=N.useMemo(()=>{const g=new Map;return u.forEach(A=>{const O=A.data;if(!O)return;const J=Number(O.id);Number.isFinite(J)&&g.set(J,O)}),g},[u]);if(N.useEffect(()=>{a.error&&i({title:"Could not load submissions",description:de(a.error,"Failed to load pending paper edits."),variant:"destructive"})},[a.error,i]),t)return e.jsx(ys,{});if(!b)return e.jsx(Ns,{});const h=x.data,y=h?h.pending+h.approved+h.rejected:void 0,f={pending:h==null?void 0:h.pending,approved:h==null?void 0:h.approved,rejected:h==null?void 0:h.rejected,all:y},I=((me=a.data)==null?void 0:me.results)??[],G=((he=a.data)==null?void 0:he.count)??0,Re=I.length{x.refetch(),a.refetch()},disabled:a.isFetching||x.isFetching,children:[e.jsx(Xe,{className:q((a.isFetching||x.isFetching)&&"spin"),size:14}),"Refresh"]})]}),e.jsxs("div",{className:"submissions-filter-panel",children:[e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Status"}),e.jsx("div",{className:"period-switch",children:fs.map(g=>e.jsxs("button",{type:"button",className:q("period-btn",n===g&&"active"),onClick:()=>r(g),children:[g,f[g]!=null&&e.jsx("span",{className:"submission-count",children:f[g]})]},g))})]}),e.jsxs("div",{className:"submission-filter-block",children:[e.jsx("div",{className:"sidebar-label",children:"Edit Type"}),e.jsx("div",{className:"sort-options submissions-type-options",children:ps.map(g=>e.jsx("button",{type:"button",className:q("sort-btn",c===g&&"active"),onClick:()=>l(g),children:V(g)},g))})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"sort-bar submissions-sort-bar",children:e.jsx("div",{children:e.jsx("div",{className:"sort-options",children:e.jsx("span",{className:"results-count",children:a.isFetching?"refreshing":`${G} submissions`})})})}),a.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(B,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):I.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ns,{size:28}),e.jsx("h2",{children:"No pending submissions."}),e.jsxs("p",{children:["The SQL and curl fallback is still documented in"," ",e.jsx("a",{href:"https://github.com/huggingface/paperswithcode/blob/main/docs/operations.md",target:"_blank",rel:"noopener noreferrer",children:"operations.md"}),"."]})]}):e.jsx("div",{className:"submission-list",children:I.map(g=>e.jsx(_s,{submission:g,paper:g.paper_id==null?void 0:j.get(g.paper_id)},g.id))}),I.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",I.length," of ",G," submissions"]}),Re&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(g=>g+Z),disabled:a.isFetching,children:[a.isFetching&&e.jsx(B,{className:"spin",size:14}),"Load more"]})]})]})]})}export{As as default}; diff --git a/assets/SubmitView-CTzPaVJS.js b/assets/SubmitView-Dj01AAbq.js similarity index 92% rename from assets/SubmitView-CTzPaVJS.js rename to assets/SubmitView-Dj01AAbq.js index 5c374fa272ad4cc471d5f50f1f7c8dcfff17e274..b3ae872e7af76d719900f0ca4f7f68da99fd4342 100644 --- a/assets/SubmitView-CTzPaVJS.js +++ b/assets/SubmitView-Dj01AAbq.js @@ -1 +1 @@ -import{a as R,s as T,t as _,R as n,j as e,ak as k}from"./index-BHOUC_Zu.js";import{u as D}from"./useMutation-B-QOtIkd.js";import{A as w,a as C}from"./alert-pE5EZBRN.js";import{B as j}from"./button-BKNKi_tx.js";import{I as h,T as z}from"./textarea-dXuRCXp_.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(x=>x.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,x]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,g]=n.useState(null),u=S(d),v=u==="external",c=D({mutationFn:t=>k(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{g(q(t))}}),P=t=>{if(t.preventDefault(),g(null),u==="empty"){g("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:P,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:d,onChange:t=>s(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),v&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:l,onChange:t=>p(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(z,{id:"submit-abstract",value:o,onChange:t=>x(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:f,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default}; +import{a as R,t as T,v as _,R as n,j as e,al as D}from"./index-gsUrUwg6.js";import{u as k}from"./useMutation-CQieGF4K.js";import{A as w,a as C}from"./alert-DCRuvdIl.js";import{B as j}from"./button-CJ4HWE-U.js";import{I as h,T as z}from"./textarea-lhvg1Jzz.js";const E=/^\d{4}\.\d{4,5}(v\d+)?$/i,F=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,X=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function S(r){const a=r.trim();return a?E.test(a)||F.test(a)||X.test(a)?"arxiv":/^https?:\/\//i.test(a)?"external":"arxiv":"empty"}function L(r,a){const i=r.trim();if(S(i)==="arxiv")return/^https?:\/\//i.test(i)?{source_url:i}:{arxiv_id:i};const s={source_url:i},l=a.title.trim();l&&(s.title=l);const p=a.abstract.trim();p&&(s.abstract=p);const o=a.authors.split(/[,\n]/).map(x=>x.trim()).filter(Boolean);return o.length>0&&(s.authors=o),a.datePublished&&(s.date_published=a.datePublished),s}function q(r){const a=r;if(!a)return"Submission failed";if(a.response)try{const i=JSON.parse(a.response);if(typeof i.detail=="string")return i.detail}catch{return a.response}return a.message||"Submission failed"}const Q=()=>{const r=R(),a=T(),{toast:i}=_(),[d,s]=n.useState(""),[l,p]=n.useState(""),[o,x]=n.useState(""),[f,I]=n.useState(""),[y,A]=n.useState(""),[b,g]=n.useState(null),u=S(d),v=u==="external",c=k({mutationFn:t=>D(t),onSuccess:t=>{a.invalidateQueries({queryKey:["papers"],refetchType:"none"}),a.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),a.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const m=t.refreshed&&t.created&&t.latest_version;i({title:m?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:m?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),r(`/paper/${t.route_identifier}`)},onError:t=>{g(q(t))}}),P=t=>{if(t.preventDefault(),g(null),u==="empty"){g("Enter an arXiv ID or a paper URL to submit.");return}const m=L(d,{title:l,abstract:o,authors:f,datePublished:y});c.mutate(m)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsx("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:"Index an arXiv paper or add a non-arXiv paper (blog post, technical report, model release page). Submissions are public and appear in the feed immediately."}),e.jsxs("form",{onSubmit:P,style:{marginTop:28,display:"grid",gap:20},children:[e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-input",style:{fontWeight:600,fontSize:14},children:"arXiv ID or paper URL"}),e.jsx(h,{id:"submit-input",value:d,onChange:t=>s(t.target.value),placeholder:"2501.12345 · https://arxiv.org/abs/2501.12345 · https://blog.example.com/release",autoFocus:!0,required:!0}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)",minHeight:18},children:u==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":u==="external"?"Detected: external URL — we'll extract metadata and you can override below.":"Paste an arXiv ID like 2501.12345 or any paper/blog URL."})]}),v&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(h,{id:"submit-title",value:l,onChange:t=>p(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(z,{id:"submit-abstract",value:o,onChange:t=>x(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(h,{id:"submit-authors",value:f,onChange:t=>I(t.target.value),placeholder:"Jane Smith, John Doe"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-date",style:{fontSize:13},children:"Publication date"}),e.jsx(h,{id:"submit-date",type:"date",value:y,onChange:t=>A(t.target.value),style:{maxWidth:220}}),e.jsx("div",{style:{fontSize:12,color:"var(--ink-soft)"},children:"Required only if we cannot infer a date from the page."})]})]}),b&&e.jsx(w,{variant:"destructive",children:e.jsx(C,{children:b})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(j,{type:"submit",disabled:c.isPending,children:c.isPending?v?"Fetching & indexing…":"Indexing…":"Submit paper"}),e.jsx(j,{type:"button",variant:"outline",onClick:()=>r(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{Q as default}; diff --git a/assets/TagBrowseView-BHDwjPvv.js b/assets/TagBrowseView-DEjLjywI.js similarity index 95% rename from assets/TagBrowseView-BHDwjPvv.js rename to assets/TagBrowseView-DEjLjywI.js index 73ee5d7e093e897397cbc4bf08490c77ae9f5ed9..84bd262f729411594991b8aad713c0d8da993bab 100644 --- a/assets/TagBrowseView-BHDwjPvv.js +++ b/assets/TagBrowseView-DEjLjywI.js @@ -1,4 +1,4 @@ -import{g as ze,r as h,l as Y,j as e,k as B,G as xe,n as ge,P as Ge,p as be,m as je,a7 as Qe,R as v,a8 as We,a9 as Ye,q as Z,e as Ze,a as Je,u as Xe,a0 as es,L as R,c as ss,b as he}from"./index-BHOUC_Zu.js";import{u as ue}from"./useQuery-BLoDQBYX.js";import{P as as,M as ns}from"./components-CgNSGcDY.js";import{B as ts}from"./BenchmarkTrendSparkline-097gkkLo.js";import{M as G}from"./MarkdownText-CNmqxPO9.js";import{t as rs,d as F}from"./transform-BaQjfqPg.js";import{b as os}from"./usePapers-CShAZvOx.js";import{u as cs}from"./useIntersectionObserver-FWZA_Lvo.js";import{S as L}from"./skeleton-D99KO90d.js";import{A as is,a as ls}from"./alert-pE5EZBRN.js";import{C as ds}from"./chevron-down-ZivE930n.js";import{G as ms}from"./github-Du_zsyOo.js";import"./LatexTitle-R8V-03ZY.js";import"./katex.min-BSBacQyE.js";import"./index-Ybm9YyT5.js";import"./index-BYJflHqW.js";import"./useInfiniteQuery-Cme8RlvF.js";/** +import{h as ze,r as h,m as Y,j as e,l as B,H as xe,o as ge,P as Ge,q as be,n as je,a8 as Qe,R as v,a9 as We,aa as Ye,s as Z,e as Ze,a as Je,u as Xe,a1 as es,L as R,c as ss,b as he}from"./index-gsUrUwg6.js";import{u as ue}from"./useQuery-CPia3mbp.js";import{P as as,M as ns}from"./components-f5SMGslj.js";import{B as ts}from"./BenchmarkTrendSparkline-CQYwfeti.js";import{M as G}from"./MarkdownText-1fpxqyMR.js";import{t as rs,d as F}from"./transform-6AvXXXHk.js";import{b as os}from"./usePapers-BgUiIfcw.js";import{u as cs}from"./useIntersectionObserver-Jkfl_qWv.js";import{S as L}from"./skeleton-CF5-g5gI.js";import{A as is,a as ls}from"./alert-DCRuvdIl.js";import{C as ds}from"./chevron-down-C0S2yejG.js";import{G as ms}from"./github-BR_-AwyS.js";import"./LatexTitle-BsZuFMnA.js";import"./katex.min-BSBacQyE.js";import"./index-7RUPpdcZ.js";import"./index-B6ekb6Wc.js";import"./useInfiniteQuery-DNCGoDeK.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TagsIndexView-Coa5ZifW.js b/assets/TagsIndexView-BSr7Xyd4.js similarity index 84% rename from assets/TagsIndexView-Coa5ZifW.js rename to assets/TagsIndexView-BSr7Xyd4.js index 49d46b9b78b9b8c67878e292ef9df1161a1ddde0..472b78f0348ac18289f4078613181046812f0277 100644 --- a/assets/TagsIndexView-Coa5ZifW.js +++ b/assets/TagsIndexView-BSr7Xyd4.js @@ -1 +1 @@ -import{r as d,j as e,L as p,b as h}from"./index-BHOUC_Zu.js";import{u as g}from"./useQuery-BLoDQBYX.js";import{e as x,h as f,d as u}from"./transform-BaQjfqPg.js";import{S as m}from"./skeleton-D99KO90d.js";import{A as j,a as y}from"./alert-pE5EZBRN.js";import{T as k}from"./TaxonomySuggestionTile-DeKWtuEn.js";import"./SignInToEditDialog-DzcyeLv5.js";import"./button-BKNKi_tx.js";import"./textarea-dXuRCXp_.js";import"./dialog-S5NgAS91.js";import"./useMutation-B-QOtIkd.js";import"./loader-circle-MkVnaQiB.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",D=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>s[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,t)=>s+t.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,t)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>e.jsx(m,{className:"h-24"},a))})]},t))}):o.map(s=>{const t=s.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return e.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),e.jsx(k,{kind:"task"})]})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{D as default}; +import{r as d,j as e,L as p,b as h}from"./index-gsUrUwg6.js";import{u as g}from"./useQuery-CPia3mbp.js";import{e as x,h as f,d as u}from"./transform-6AvXXXHk.js";import{S as m}from"./skeleton-CF5-g5gI.js";import{A as j,a as y}from"./alert-DCRuvdIl.js";import{T as k}from"./TaxonomySuggestionTile-CWfaWHsI.js";import"./SignInToEditDialog-DeRdsNO0.js";import"./button-CJ4HWE-U.js";import"./textarea-lhvg1Jzz.js";import"./dialog-Bil4Ya0L.js";import"./useMutation-CQieGF4K.js";import"./loader-circle-BgGrBUVx.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",D=()=>{const r=g({queryKey:["areas-with-tasks"],queryFn:()=>h.getAreasWithTasks(),staleTime:6e5}),o=d.useMemo(()=>{if(!r.data)return[];const s={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>s[v(n)]??999;return[...r.data.results].sort((n,a)=>{const i=t(n.name),l=t(a.name);return i!==l?i-l:n.name.localeCompare(a.name)})},[r.data]),c=d.useMemo(()=>o.reduce((s,t)=>s+t.tasks.length,0),[o]);return r.error?e.jsx("div",{className:"page",children:e.jsx(j,{variant:"destructive",children:e.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Domains"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((s,t)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>e.jsx(m,{className:"h-24"},a))})]},t))}):o.map(s=>{const t=s.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:s.name}),s.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:s.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[t.length," ",t.length===1?"task":"tasks"," · ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return e.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),e.jsx(k,{kind:"task"})]})]},s.id)}),c>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(s=>s.tasks.length>0).length," areas."]})]})};export{D as default}; diff --git a/assets/TaxonomySuggestionTile-DeKWtuEn.js b/assets/TaxonomySuggestionTile-CWfaWHsI.js similarity index 83% rename from assets/TaxonomySuggestionTile-DeKWtuEn.js rename to assets/TaxonomySuggestionTile-CWfaWHsI.js index ecb0f71960d249914405f5664081184e8e83f946..73b8b66e75fb5d755fd6b37bbd99849937d818e2 100644 --- a/assets/TaxonomySuggestionTile-DeKWtuEn.js +++ b/assets/TaxonomySuggestionTile-CWfaWHsI.js @@ -1 +1 @@ -import{f as u,r as o,j as e}from"./index-BHOUC_Zu.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-DzcyeLv5.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T}; +import{f as u,r as o,j as e}from"./index-gsUrUwg6.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-DeRdsNO0.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),r=`Suggest a new ${s}...`,g=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),r]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(m,{open:i,onOpenChange:n,kind:s}),e.jsx(p,{open:l,onOpenChange:t,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{h as T}; diff --git a/assets/TrendsView-bBL_-M78.js b/assets/TrendsView-BHSTAeEu.js similarity index 97% rename from assets/TrendsView-bBL_-M78.js rename to assets/TrendsView-BHSTAeEu.js index 1f82a34641ece5214c75e66344a43375323a3260..d8b0232e0f9d03af4bcb58c652cec0997360778a 100644 --- a/assets/TrendsView-bBL_-M78.js +++ b/assets/TrendsView-BHSTAeEu.js @@ -1 +1 @@ -import{b as X,R as G,j as e}from"./index-BHOUC_Zu.js";import{u as J}from"./useQuery-BLoDQBYX.js";import{A as q,a as E}from"./alert-pE5EZBRN.js";import{S as P}from"./skeleton-D99KO90d.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},te=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{te as default}; +import{b as X,R as G,j as e}from"./index-gsUrUwg6.js";import{u as J}from"./useQuery-CPia3mbp.js";import{A as q,a as E}from"./alert-DCRuvdIl.js";import{S as P}from"./skeleton-CF5-g5gI.js";const m=t=>{const i=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!i)return t;const[,r,l]=i;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${r.slice(2)}`},Q=()=>X.getResearchTrends(),f=980,j=400,x=62,R=26,g=30,V=58,u=f-x-R,F=j-g-V,v=g+F,Y=t=>{if(t.length<3)return t.map((r,l)=>`${l?"L":"M"}${r[0]} ${r[1]}`).join(" ");let i=`M${t[0][0]} ${t[0][1]}`;for(let r=0;r{const[a,y]=G.useState(null),s=i.length,b=l[l.length-1],d=n=>x+u*(s===1?0:n/(s-1)),p=n=>g+F*(1-n/b);if(s===0)return null;const B=i.map((n,h)=>[d(h),p(n.percent)]),A=Y(B),_=`${A} L ${d(s-1)} ${v} L ${x} ${v} Z`,w=s<=12?1:Math.ceil(s/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=s>1?u/(s-1):u,I=Math.max(0,Math.min(s-1,Math.round((S-x)/k)));y(I)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(i[0].month)} (${i[0].percent}%) to ${m(i[s-1].month)} (${i[s-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:r,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:r,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-R,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:A,fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),i.map((n,h)=>{const S=h===s-1,k=h%w===0&&s-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+F/2}) rotate(-90)`,textAnchor:"middle",style:z,children:c}),a!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:d(a),x2:d(a),y1:g,y2:v,stroke:r,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(i[a].percent),r:5,fill:"var(--bg)",stroke:r,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(i[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(i[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r,display:"inline-block"}}),i[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:i.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},L={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},M={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},te=()=>{const t=J({queryKey:["research-trends"],queryFn:Q,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(q,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:L,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:L,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(C,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:M,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{te as default}; diff --git a/assets/alert-pE5EZBRN.js b/assets/alert-DCRuvdIl.js similarity index 70% rename from assets/alert-pE5EZBRN.js rename to assets/alert-DCRuvdIl.js index efa30e04bb36d890b66f37f85972ac8a6706cf65..1c12a817a8553bb6a1988970e39847fbdf343c6a 100644 --- a/assets/alert-pE5EZBRN.js +++ b/assets/alert-DCRuvdIl.js @@ -1 +1 @@ -import{r as a,j as s,q as l,ab as i}from"./index-BHOUC_Zu.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; +import{r as a,j as s,s as l,ac as i}from"./index-gsUrUwg6.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));c.displayName="AlertTitle";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));v.displayName="AlertDescription";export{n as A,v as a}; diff --git a/assets/button-BKNKi_tx.js b/assets/button-CJ4HWE-U.js similarity index 73% rename from assets/button-BKNKi_tx.js rename to assets/button-CJ4HWE-U.js index 21dfee4af1bde44b2c435222a345bd25fd071c35..04f603df84d667829c76ccf8f48d621b2a60d7e7 100644 --- a/assets/button-BKNKi_tx.js +++ b/assets/button-CJ4HWE-U.js @@ -1 +1 @@ -import{r as a,j as d,ao as u,q as c,ab as f}from"./index-BHOUC_Zu.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:o=!1,...n},s)=>{const i=o?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...n})});v.displayName="Button";export{v as B}; +import{r as a,j as d,ap as c,s as u,ac as f}from"./index-gsUrUwg6.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?c:"button";return d.jsx(i,{className:u(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; diff --git a/assets/chatSessions-DxE8uXe5.js b/assets/chatSessions-DgD7qgsg.js similarity index 98% rename from assets/chatSessions-DxE8uXe5.js rename to assets/chatSessions-DgD7qgsg.js index 9660209439fdb3dea0f184effaa52d3e7b7c1a92..928670fb6dd0e765e3743211750ef3d6da82feed 100644 --- a/assets/chatSessions-DxE8uXe5.js +++ b/assets/chatSessions-DgD7qgsg.js @@ -1 +1 @@ -import{j as n,d as p}from"./index-BHOUC_Zu.js";const g=({light:t})=>n.jsx("span",{className:`chat-spinner${t?" chat-spinner-light":""}`}),m=({open:t})=>n.jsx("svg",{className:`chat-chev${t?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"m6 9 6 6 6-6"})}),x=()=>n.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("circle",{cx:"12",cy:"12",r:"9"}),n.jsx("path",{d:"m9 12 2 2 4-4"})]}),w=({size:t=14})=>n.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("circle",{cx:"11",cy:"11",r:"7"}),n.jsx("path",{d:"m21 21-4.3-4.3"})]}),j=()=>n.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:n.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),C=()=>n.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M12 5v14M5 12h14"})}),y=()=>n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[n.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),n.jsx("path",{d:"M9 4v16"})]}),S=()=>n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),_=({models:t,selectedModel:r,onModelChange:o,disabled:e})=>{var i;const s=((i=t.find(a=>a.id===r))==null?void 0:i.label)??`${r} (unavailable)`,c=Math.min(Math.max(s.length+5,12),32);return n.jsxs("select",{className:"chat-model-select",style:{width:`${c}ch`},value:r,disabled:e,onChange:a=>o(a.target.value),"aria-label":"Research model",children:[!t.some(a=>a.id===r)&&n.jsx("option",{value:r,disabled:!0,children:s}),t.map(a=>n.jsx("option",{value:a.id,children:a.label},a.id))]})},h="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",d="pwc:chat-oauth-auto-send";function k(t,r){const o=t.trim();o&&(sessionStorage.setItem(h,o),sessionStorage.setItem(d,"1"),r&&sessionStorage.setItem(l,r))}function T(){var r;if(typeof window>"u"||sessionStorage.getItem(d)!=="1")return null;const t=(r=sessionStorage.getItem(h))==null?void 0:r.trim();return t?{prompt:t,model:sessionStorage.getItem(l)}:null}function M(){sessionStorage.removeItem(h),sessionStorage.removeItem(l),sessionStorage.removeItem(d)}const f="deepseek-ai/DeepSeek-V4-Flash",D=[{id:f,label:"DeepSeek V4 Flash"},{id:"zai-org/GLM-5.2",label:"GLM 5.2"}];async function u(t,r){const o=await fetch(p(t),{credentials:"include",headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(!o.ok){const e=await o.json().catch(()=>null),s=e==null?void 0:e.detail;throw new Error((s==null?void 0:s.message)||s||`Chat request failed (${o.status})`)}return o.status===204?void 0:o.json()}async function I(){const t=[];let r=null;do{const o=new URLSearchParams({limit:"50"});r&&o.set("cursor",r);const e=await u(`/api/v1/chat/sessions?${o.toString()}`);t.push(...e.items),r=e.next_cursor}while(r&&t.length<100);return t}function L(t){return u(`/api/v1/chat/sessions/${t}`)}function A(t,r){return u(`/api/v1/chat/sessions/${t}`,{method:"PATCH",body:JSON.stringify(r)})}function E(t){return u(`/api/v1/chat/sessions/${t}`,{method:"DELETE"})}async function b(){return u("/api/v1/chat/models")}function $(t){const r=e=>e.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:s.status==="error"||s.status==="denied"||s.status==="running"}:{...s,done:!0}),o=e=>e==="provider_error"?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return t.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:r(e.display_blocks),followups:e.followups,citations:e.citations,streaming:!1}];const s={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};return e.status!=="error"?[s]:[s,{id:`${e.id}-error`,role:"assistant",blocks:r(e.display_blocks),streaming:!1,error:o(e.error_code)}]})}function q(t){const r=Date.now(),o=new Date().setHours(0,0,0,0),e=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const s of[...t].sort((c,i)=>Date.parse(i.updated_at)-Date.parse(c.updated_at))){const c=Date.parse(s.updated_at),i=r-c;c>=o?e[0].items.push(s):i<7*864e5?e[1].items.push(s):i<30*864e5?e[2].items.push(s):e[3].items.push(s)}return e.filter(s=>s.items.length>0)}export{j as A,x as C,f as D,D as F,_ as M,C as P,g as S,S as T,m as a,w as b,h as c,l as d,d as e,M as f,b as g,L as h,y as i,q as j,E as k,I as l,k as q,T as r,$ as t,A as u}; +import{j as n,d as p}from"./index-gsUrUwg6.js";const g=({light:t})=>n.jsx("span",{className:`chat-spinner${t?" chat-spinner-light":""}`}),m=({open:t})=>n.jsx("svg",{className:`chat-chev${t?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"m6 9 6 6 6-6"})}),x=()=>n.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("circle",{cx:"12",cy:"12",r:"9"}),n.jsx("path",{d:"m9 12 2 2 4-4"})]}),w=({size:t=14})=>n.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("circle",{cx:"11",cy:"11",r:"7"}),n.jsx("path",{d:"m21 21-4.3-4.3"})]}),j=()=>n.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:n.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),C=()=>n.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M12 5v14M5 12h14"})}),y=()=>n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[n.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),n.jsx("path",{d:"M9 4v16"})]}),S=()=>n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:n.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M6 6l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14"})}),_=({models:t,selectedModel:r,onModelChange:o,disabled:e})=>{var i;const s=((i=t.find(a=>a.id===r))==null?void 0:i.label)??`${r} (unavailable)`,c=Math.min(Math.max(s.length+5,12),32);return n.jsxs("select",{className:"chat-model-select",style:{width:`${c}ch`},value:r,disabled:e,onChange:a=>o(a.target.value),"aria-label":"Research model",children:[!t.some(a=>a.id===r)&&n.jsx("option",{value:r,disabled:!0,children:s}),t.map(a=>n.jsx("option",{value:a.id,children:a.label},a.id))]})},h="pwc:chat-oauth-draft",l="pwc:chat-oauth-model",d="pwc:chat-oauth-auto-send";function k(t,r){const o=t.trim();o&&(sessionStorage.setItem(h,o),sessionStorage.setItem(d,"1"),r&&sessionStorage.setItem(l,r))}function T(){var r;if(typeof window>"u"||sessionStorage.getItem(d)!=="1")return null;const t=(r=sessionStorage.getItem(h))==null?void 0:r.trim();return t?{prompt:t,model:sessionStorage.getItem(l)}:null}function M(){sessionStorage.removeItem(h),sessionStorage.removeItem(l),sessionStorage.removeItem(d)}const f="deepseek-ai/DeepSeek-V4-Flash",D=[{id:f,label:"DeepSeek V4 Flash"},{id:"zai-org/GLM-5.2",label:"GLM 5.2"}];async function u(t,r){const o=await fetch(p(t),{credentials:"include",headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(!o.ok){const e=await o.json().catch(()=>null),s=e==null?void 0:e.detail;throw new Error((s==null?void 0:s.message)||s||`Chat request failed (${o.status})`)}return o.status===204?void 0:o.json()}async function I(){const t=[];let r=null;do{const o=new URLSearchParams({limit:"50"});r&&o.set("cursor",r);const e=await u(`/api/v1/chat/sessions?${o.toString()}`);t.push(...e.items),r=e.next_cursor}while(r&&t.length<100);return t}function L(t){return u(`/api/v1/chat/sessions/${t}`)}function A(t,r){return u(`/api/v1/chat/sessions/${t}`,{method:"PATCH",body:JSON.stringify(r)})}function E(t){return u(`/api/v1/chat/sessions/${t}`,{method:"DELETE"})}async function b(){return u("/api/v1/chat/models")}function $(t){const r=e=>e.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:s.status==="error"||s.status==="denied"||s.status==="running"}:{...s,done:!0}),o=e=>e==="provider_error"?"The model provider failed before completing the response. You can edit and retry your question.":e==="persistence_error"?"The response could not be saved. You can edit and retry your question.":e==="transcript_mirror_error"?"The conversation could not be saved. Please try again in a new chat.":"The response did not complete. You can edit and retry your question.";return t.messages.flatMap(e=>{if(e.role==="assistant")return[{id:e.id,role:"assistant",blocks:r(e.display_blocks),followups:e.followups,citations:e.citations,streaming:!1}];const s={id:e.id,role:"user",text:e.content,revision:e.revision,status:e.status,error:e.status==="complete"?void 0:e.error_code||e.status};return e.status!=="error"?[s]:[s,{id:`${e.id}-error`,role:"assistant",blocks:r(e.display_blocks),streaming:!1,error:o(e.error_code)}]})}function q(t){const r=Date.now(),o=new Date().setHours(0,0,0,0),e=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const s of[...t].sort((c,i)=>Date.parse(i.updated_at)-Date.parse(c.updated_at))){const c=Date.parse(s.updated_at),i=r-c;c>=o?e[0].items.push(s):i<7*864e5?e[1].items.push(s):i<30*864e5?e[2].items.push(s):e[3].items.push(s)}return e.filter(s=>s.items.length>0)}export{j as A,x as C,f as D,D as F,_ as M,C as P,g as S,S as T,m as a,w as b,h as c,l as d,d as e,M as f,b as g,L as h,y as i,q as j,E as k,I as l,k as q,T as r,$ as t,A as u}; diff --git a/assets/chevron-down-ZivE930n.js b/assets/chevron-down-C0S2yejG.js similarity index 85% rename from assets/chevron-down-ZivE930n.js rename to assets/chevron-down-C0S2yejG.js index 593d86d7d90f7153cb0a4c77a5d7508144e4f03d..fee666ff68909adf21271abd9c3cfd486c3b2930 100644 --- a/assets/chevron-down-ZivE930n.js +++ b/assets/chevron-down-C0S2yejG.js @@ -1,4 +1,4 @@ -import{g as o}from"./index-BHOUC_Zu.js";/** +import{h as o}from"./index-gsUrUwg6.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codexAddEvals-DsGqXQP5.js b/assets/codexAddEvals-CHZ35FuP.js similarity index 90% rename from assets/codexAddEvals-DsGqXQP5.js rename to assets/codexAddEvals-CHZ35FuP.js index e4b18ba68b7e8c180767bc11e0deb393ecc57309..b23fd95e5d163c1353afa9d9b0ee416375e1c029 100644 --- a/assets/codexAddEvals-DsGqXQP5.js +++ b/assets/codexAddEvals-CHZ35FuP.js @@ -1,6 +1,6 @@ -import{g as o,j as i,q as c,ab as d,d as n}from"./index-BHOUC_Zu.js";/** +import{h as o,j as i,s as c,ac as d,d as n}from"./index-gsUrUwg6.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const p=o("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),u=d("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function f({className:e,variant:a,...t}){return i.jsx("div",{className:c(u({variant:a}),e),...t})}function b(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function x(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var s;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((s=a==null?void 0:a.detail)==null?void 0:s.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function h(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function v(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function g(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function y(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function m(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function E(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function w(e=100){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs?limit=${e}`),{credentials:"include",cache:"no-store"});if(a.ok)return await a.json();const t=new Error(`Could not load Codex jobs (${a.status}).`);throw Object.assign(t,{status:a.status}),t}export{f as B,p as D,g as a,v as b,E as c,h as d,b as e,w as f,m as g,x as i,y as s}; + */const p=o("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),u=d("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function f({className:e,variant:a,...t}){return i.jsx("div",{className:c(u({variant:a}),e),...t})}function x(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function b(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var s;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((s=a==null?void 0:a.detail)==null?void 0:s.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function h(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function v(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function g(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function y(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function m(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function E(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function w(e=100){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs?limit=${e}`),{credentials:"include",cache:"no-store"});if(a.ok)return await a.json();const t=new Error(`Could not load Codex jobs (${a.status}).`);throw Object.assign(t,{status:a.status}),t}export{f as B,p as D,g as a,v as b,E as c,h as d,x as e,w as f,m as g,b as i,y as s}; diff --git a/assets/components-CgNSGcDY.js b/assets/components-f5SMGslj.js similarity index 98% rename from assets/components-CgNSGcDY.js rename to assets/components-f5SMGslj.js index a2f144918ee197494f289fa490fa9f2df74c3bfd..6adf4c601e99858bf66e15c6bdac32a90595c4fb 100644 --- a/assets/components-CgNSGcDY.js +++ b/assets/components-f5SMGslj.js @@ -1 +1 @@ -import{s as R,R as g,b as T,j as e,L,a as w}from"./index-BHOUC_Zu.js";import{L as E,a as z}from"./LatexTitle-R8V-03ZY.js";import{h as P,d as Z,f as B,e as H}from"./transform-BaQjfqPg.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:N[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),K=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(z,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a}; +import{t as R,R as g,b as T,j as e,L,a as w}from"./index-gsUrUwg6.js";import{L as E,a as z}from"./LatexTitle-BsZuFMnA.js";import{h as P,d as Z,f as B,e as H}from"./transform-6AvXXXHk.js";const D=({slug:t,label:s,onClick:r})=>{const l=w(),x=P(t),o=H(x),h=i=>{if(i.stopPropagation(),r){r(t);return}l(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:h,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),Z(s||B(t),t)]})},G=({method:t,onClick:s})=>{const r=w(),l=t.slug||t.id||"";if(!l)return null;const x=o=>{if(o.stopPropagation(),s){s(l);return}r(`/methods/${l}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},N={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=g.useRef(null),l=g.useRef(null),[x,o]=g.useState(t.length);if(g.useLayoutEffect(()=>{const n=r.current,a=l.current;if(!n||!a||t.length===0)return;const m=f=>(a.textContent=f,a.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let c=0,d=0;for(const C of t){const p=m(C.measureText);if(c+p<=f)c+=p,d+=1;else break}if(d0&&c+m(` · +${t.length-d} more`)>f;)d-=1,c-=m(t[d].measureText);d===0&&(d=1)}o(d)};M();const u=new ResizeObserver(M);return u.observe(n),()=>u.disconnect()},[t]),t.length===0)return null;const h=t.slice(0,Math.max(1,Math.min(x,t.length))),i=t.length-h.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:l,className:"paper-sota-measure","aria-hidden":"true"}),h.map((n,a)=>e.jsxs(g.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[a>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:N[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.slug?e.jsx(L,{to:`/benchmark/${n.slug}`,className:"paper-sota-name",onClick:m=>m.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${a}`)),i>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const l=g.useMemo(()=>{const o=[];let h=!0;for(const i of[1,2,3]){const n=t.filter(a=>a.rank===i);n.forEach((a,m)=>{const M=m===0,u=M?`${h?"":" · "}${N[i]} on `:", ";o.push({name:a.name,slug:a.slug,rank:i,isGroupStart:M,measureText:u+a.name})}),n.length>0&&(h=!1)}return o},[t]),x=g.useMemo(()=>[1,2,3].map(o=>t.filter(i=>i.rank===o).map((i,n)=>({name:i.name,slug:i.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${N[o]} on `:", ")+i.name}))).filter(o=>o.length>0),[t]);return r?x.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:x.map(o=>e.jsx(F,{units:o,paperHref:s},o[0].rank))}):l.length===0?null:e.jsx(F,{units:l,paperHref:s})},O=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},U=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),K=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},_=({paperId:t})=>{const s=K(t),r=160,l=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,h=[],i=9+Math.floor(s()*3);for(let k=0;k.3,a=Math.floor(s()*3),m=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:c+(r-c*2)*(1-k)/2,y:S+v*2.4,width:(r-c*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-o)/2,y:W,width:(r-c*2)*o,height:.9,fill:u,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:A,width:6,height:1,fill:f,opacity:.6}),h.map((k,v)=>{const y=j+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:C,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:j,width:d,height:14,fill:"#F0EBE0",stroke:u,strokeWidth:.3,opacity:.9}),a===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${j+11} ${p+6},${j+8} ${p+10},${j+9} ${p+14},${j+5} ${p+18},${j+6} ${p+22},${j+3}`})}),a===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:p+2,y:j+11,width:d-4,height:1.5,fill:u})]}),a===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:j+5,width:d-6,height:1,fill:f}),e.jsx("rect",{x:p+6,y:j+8,width:d-12,height:.8,fill:f})]})]}),m.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>l-c-1?null:e.jsx("rect",{x:p,y,width:d*k,height:.8,fill:u,opacity:.55,rx:.2},`r${v}`)})]})})},V=({paperId:t,title:s,thumbnailUrl:r,priority:l=!1})=>{const[x,o]=g.useState(!1),[h,i]=g.useState(0),[n,a]=g.useState(l),m=g.useRef(null);g.useEffect(()=>{o(!1),i(0)},[r]);const M=g.useMemo(()=>{if(!r)return null;if(h===0)return r;const u=r.includes("?")?"&":"?";return`${r}${u}retry=${h}`},[r,h]);return g.useEffect(()=>{if(l||n)return;const u=m.current;if(!u)return;const f=new IntersectionObserver(([c])=>{c.isIntersecting&&(a(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(u),()=>f.disconnect()},[l,n]),r&&!x?e.jsx("div",{ref:m,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(l||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:l?"eager":"lazy",decoding:"async",fetchPriority:l?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(h<1){i(u=>u+1);return}o(!0)}},M)}):e.jsx(_,{paperId:t})},q="language-modeling";function $(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Y(t){return $(t.slug)==="large language model"||$(t.name)==="large language model"}function Q(t){return t.tags.includes(q)?t.methods.filter(s=>!Y(s)):t.methods}const se=({paper:t,rank:s,onClickTag:r})=>{const l=R(),x=`/paper/${t.id}`,o=g.useCallback(()=>{l.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>T.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,l]),h=t.authors.slice(0,3).join(", "),i=t.authors.length,n=Q(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:x,className:"paper-thumb-wrap",onFocus:o,onMouseEnter:o,children:e.jsx(V,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[e.jsx("h3",{className:"paper-title",children:e.jsx(L,{to:x,onFocus:o,onMouseEnter:o,children:e.jsx(E,{title:t.title})})}),e.jsxs("div",{className:"paper-authors",children:[h,i>3&&e.jsxs("span",{children:[", ","+",i-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[i>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[i>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(z,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:x}),(t.tags.length>0||n.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(a=>e.jsx(D,{slug:a,onClick:r},a)),n.map(a=>e.jsx(G,{method:a},a.id||a.slug||a.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[t.githubUrl&&e.jsxs("a",{className:"paper-resource is-link",href:t.githubUrl,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:a=>a.stopPropagation(),children:[e.jsx(O,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),J(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),t.hfUrl&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:t.hfUrl,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:a=>a.stopPropagation(),children:[e.jsx(U,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function J(t){return t.toFixed(1)}export{O as I,G as M,se as P,I as S,D as T,V as a}; diff --git a/assets/dialog-Bil4Ya0L.js b/assets/dialog-Bil4Ya0L.js new file mode 100644 index 0000000000000000000000000000000000000000..a907539e40d491f6161f269023fd2ac9847c84c5 --- /dev/null +++ b/assets/dialog-Bil4Ya0L.js @@ -0,0 +1,5 @@ +import{r as s,j as i,F as K,m as Z,H as R,P as N,K as Q,l as D,o as x,q as U,n as h,M as X,N as Y,O as J,Q as ee,S as te,ae as oe,X as ne,s as p}from"./index-gsUrUwg6.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?K(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=U(C),[de,f]=b(C),O=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=Z({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};O.displayName=C;var P="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(P,o),r=h(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=P;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),w=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:n}=e,r=f(E,t);return i.jsx(fe,{scope:t,forceMount:o,children:s.Children.map(a,l=>i.jsx(N,{present:o||r.open,children:i.jsx(Q,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(N,{present:a||r.open,children:i.jsx(pe,{...n,ref:t})}):null});A.displayName=y;var ge=ae("DialogOverlay.RemoveScroll"),pe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(y,o);return i.jsx(Y,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(N,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=h(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return X(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return J(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",F=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});F.displayName=_;var M="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(M,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=M;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ve="DialogDescriptionWarning",ye=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ve).contentName}}.`;return s.useEffect(()=>{var r;const n=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ce=O,Re=w,V=A,H=T,B=F,z=W,Ne=k;const we=Ce,he=Re,q=s.forwardRef(({className:e,...t},o)=>i.jsx(V,{ref:o,className:p("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));q.displayName=V.displayName;const Ee=s.forwardRef(({className:e,children:t,...o},a)=>i.jsxs(he,{children:[i.jsx(q,{}),i.jsxs(H,{ref:a,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,i.jsxs(Ne,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(ne,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ee.displayName=H.displayName;const _e=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_e.displayName="DialogHeader";const je=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});je.displayName="DialogFooter";const be=s.forwardRef(({className:e,...t},o)=>i.jsx(B,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));be.displayName=B.displayName;const Oe=s.forwardRef(({className:e,...t},o)=>i.jsx(z,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));Oe.displayName=z.displayName;export{H as C,we as D,V as O,Re as P,Ce as R,Ee as a,_e as b,be as c,Oe as d,je as e}; diff --git a/assets/dialog-S5NgAS91.js b/assets/dialog-S5NgAS91.js deleted file mode 100644 index 6c63b156905aed89829e09659a5f9187c56c0efd..0000000000000000000000000000000000000000 --- a/assets/dialog-S5NgAS91.js +++ /dev/null @@ -1,5 +0,0 @@ -import{r as s,j as i,E as K,l as Z,G as R,P as N,J,k as D,n as x,p as Q,m as h,K as U,M as X,N as Y,O as ee,Q as te,ad as oe,X as ne,q as p}from"./index-BHOUC_Zu.js";function ae(e){const t=re(e),o=s.forwardRef((a,n)=>{const{children:r,...l}=a,c=s.Children.toArray(r),d=c.find(ie);if(d){const u=d.props.children,m=c.map(v=>v===d?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:v);return i.jsx(t,{...l,ref:n,children:s.isValidElement(u)?s.cloneElement(u,void 0,m):null})}return i.jsx(t,{...l,ref:n,children:r})});return o.displayName=`${e}.Slot`,o}function re(e){const t=s.forwardRef((o,a)=>{const{children:n,...r}=o;if(s.isValidElement(n)){const l=ce(n),c=le(r,n.props);return n.type!==s.Fragment&&(c.ref=a?K(a,l):l),s.cloneElement(n,c)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ie(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function le(e,t){const o={...t};for(const a in t){const n=e[a],r=t[a];/^on[A-Z]/.test(a)?n&&r?o[a]=(...c)=>{const d=r(...c);return n(...c),d}:n&&(o[a]=n):a==="style"?o[a]={...n,...r}:a==="className"&&(o[a]=[n,r].filter(Boolean).join(" "))}return{...e,...o}}function ce(e){var a,n;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var C="Dialog",[b]=Q(C),[de,f]=b(C),O=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:n,onOpenChange:r,modal:l=!0}=e,c=s.useRef(null),d=s.useRef(null),[u,m]=Z({prop:a,defaultProp:n??!1,onChange:r,caller:C});return i.jsx(de,{scope:t,triggerRef:c,contentRef:d,contentId:R(),titleId:R(),descriptionId:R(),open:u,onOpenChange:m,onOpenToggle:s.useCallback(()=>m(v=>!v),[m]),modal:l,children:o})};O.displayName=C;var P="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(P,o),r=h(t,n.triggerRef);return i.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":j(n.open),...a,ref:r,onClick:x(e.onClick,n.onOpenToggle)})});ue.displayName=P;var E="DialogPortal",[fe,I]=b(E,{forceMount:void 0}),w=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:n}=e,r=f(E,t);return i.jsx(fe,{scope:t,forceMount:o,children:s.Children.map(a,l=>i.jsx(N,{present:o||r.open,children:i.jsx(J,{asChild:!0,container:n,children:l})}))})};w.displayName=E;var y="DialogOverlay",A=s.forwardRef((e,t)=>{const o=I(y,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(y,e.__scopeDialog);return r.modal?i.jsx(N,{present:a||r.open,children:i.jsx(pe,{...n,ref:t})}):null});A.displayName=y;var ge=ae("DialogOverlay.RemoveScroll"),pe=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(y,o);return i.jsx(X,{as:ge,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(D.div,{"data-state":j(n.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),g="DialogContent",T=s.forwardRef((e,t)=>{const o=I(g,e.__scopeDialog),{forceMount:a=o.forceMount,...n}=e,r=f(g,e.__scopeDialog);return i.jsx(N,{present:a||r.open,children:r.modal?i.jsx(me,{...n,ref:t}):i.jsx(xe,{...n,ref:t})})});T.displayName=g;var me=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(null),n=h(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return U(r)},[]),i.jsx(S,{...e,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,r=>{var l;r.preventDefault(),(l=o.triggerRef.current)==null||l.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,r=>{const l=r.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&r.preventDefault()}),onFocusOutside:x(e.onFocusOutside,r=>r.preventDefault())})}),xe=s.forwardRef((e,t)=>{const o=f(g,e.__scopeDialog),a=s.useRef(!1),n=s.useRef(!1);return i.jsx(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var l,c;(l=e.onCloseAutoFocus)==null||l.call(e,r),r.defaultPrevented||(a.current||(c=o.triggerRef.current)==null||c.focus(),r.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:r=>{var d,u;(d=e.onInteractOutside)==null||d.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=r.target;((u=o.triggerRef.current)==null?void 0:u.contains(l))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&n.current&&r.preventDefault()}})}),S=s.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:r,...l}=e,c=f(g,o),d=s.useRef(null),u=h(t,d);return Y(),i.jsxs(i.Fragment,{children:[i.jsx(ee,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:r,children:i.jsx(te,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":j(c.open),...l,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(De,{titleId:c.titleId}),i.jsx(ye,{contentRef:d,descriptionId:c.descriptionId})]})]})}),_="DialogTitle",M=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(_,o);return i.jsx(D.h2,{id:n.titleId,...a,ref:t})});M.displayName=_;var F="DialogDescription",W=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(F,o);return i.jsx(D.p,{id:n.descriptionId,...a,ref:t})});W.displayName=F;var $="DialogClose",k=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f($,o);return i.jsx(D.button,{type:"button",...a,ref:t,onClick:x(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=$;function j(e){return e?"open":"closed"}var L="DialogTitleWarning",[Ie,G]=oe(L,{contentName:g,titleName:_,docsSlug:"dialog"}),De=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},ve="DialogDescriptionWarning",ye=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(ve).contentName}}.`;return s.useEffect(()=>{var r;const n=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Ce=O,Re=w,V=A,H=T,B=M,z=W,Ne=k;const we=Ce,he=Re,q=s.forwardRef(({className:e,...t},o)=>i.jsx(V,{ref:o,className:p("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));q.displayName=V.displayName;const Ee=s.forwardRef(({className:e,children:t,...o},a)=>i.jsxs(he,{children:[i.jsx(q,{}),i.jsxs(H,{ref:a,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,i.jsxs(Ne,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(ne,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ee.displayName=H.displayName;const _e=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_e.displayName="DialogHeader";const je=({className:e,...t})=>i.jsx("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});je.displayName="DialogFooter";const be=s.forwardRef(({className:e,...t},o)=>i.jsx(B,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));be.displayName=B.displayName;const Oe=s.forwardRef(({className:e,...t},o)=>i.jsx(z,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));Oe.displayName=z.displayName;export{H as C,we as D,V as O,Re as P,Ce as R,Ee as a,_e as b,be as c,Oe as d,je as e}; diff --git a/assets/github-Du_zsyOo.js b/assets/github-BR_-AwyS.js similarity index 92% rename from assets/github-Du_zsyOo.js rename to assets/github-BR_-AwyS.js index 791ae7711989914ffabcae079c802fadc366624d..68dde99f0d1d3e7f051c447dc48748e21d3da635 100644 --- a/assets/github-Du_zsyOo.js +++ b/assets/github-BR_-AwyS.js @@ -1,4 +1,4 @@ -import{g as c}from"./index-BHOUC_Zu.js";/** +import{h as c}from"./index-gsUrUwg6.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-CYqiITh9.js b/assets/hover-card-BmN6fO7d.js similarity index 85% rename from assets/hover-card-CYqiITh9.js rename to assets/hover-card-BmN6fO7d.js index 9599ee92d979df221054f88416862c941b9f0acc..101766e911a535b10847c26b705b1e8200705db2 100644 --- a/assets/hover-card-CYqiITh9.js +++ b/assets/hover-card-BmN6fO7d.js @@ -1 +1 @@ -import{r as n,l as F,j as c,F as M,H as I,k as U,n as l,I as T,P as O,J as $,p as W,m as z,Q as B,S as G,T as K,q}from"./index-BHOUC_Zu.js";var E,b="HoverCard",[y]=W(b,[T]),g=T(),[J,w]=y(b),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=g(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=F({prop:s,defaultProp:a??!1,onChange:i,caller:b}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),k=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(J,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:k,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(M,{...d,children:r})})};N.displayName=b;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(_,r),i=g(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,S(a.onOpen)),onPointerLeave:l(e.onPointerLeave,S(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[Q,V]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=w(H,o);return c.jsx(Q,{scope:o,forceMount:r,children:c.jsx(O,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=V(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=w(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,S(i.onOpen)),onPointerLeave:l(e.onPointerLeave,S(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=w(R,r),C=g(r),u=n.useRef(null),h=z(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),c.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=g(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function S(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:q("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; +import{r as n,m as k,j as c,G as F,I,l as U,o as l,J as H,P as O,K as $,q as W,n as z,S as B,T as G,U as K,s as q}from"./index-gsUrUwg6.js";var E,b="HoverCard",[y]=W(b,[H]),g=H(),[J,w]=y(b),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=g(o),C=n.useRef(0),u=n.useRef(0),h=n.useRef(!1),p=n.useRef(!1),[m,t]=k({prop:s,defaultProp:a??!1,onChange:i,caller:b}),x=n.useCallback(()=>{clearTimeout(u.current),C.current=window.setTimeout(()=>t(!0),f)},[f,t]),P=n.useCallback(()=>{clearTimeout(C.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),M=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(J,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:M,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=b;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(_,r),i=g(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,S(a.onOpen)),onPointerLeave:l(e.onPointerLeave,S(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var T="HoverCardPortal",[V,Q]=y(T,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=w(T,o);return c.jsx(V,{scope:o,forceMount:r,children:c.jsx(O,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=T;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=w(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,S(i.onOpen)),onPointerLeave:l(e.onPointerLeave,S(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=w(R,r),C=g(r),u=n.useRef(null),h=z(o,u),[p,m]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return E=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=E,t.style.webkitUserSelect=E}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{m(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var P;((P=document.getSelection())==null?void 0:P.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),n.useEffect(()=>{u.current&&ee(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),c.jsx(B,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(G,{...C,...v,onPointerDown:l(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&m(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=g(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function S(e){return o=>o.pointerType==="touch"?void 0:e()}function ee(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var te=N,oe=D,re=j,L=A;const se=te,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.jsx(L,{ref:a,align:o,sideOffset:r,className:q("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ne.displayName=L.displayName;export{se as H,ce as a,ne as b}; diff --git a/assets/index-Ybm9YyT5.js b/assets/index-7RUPpdcZ.js similarity index 99% rename from assets/index-Ybm9YyT5.js rename to assets/index-7RUPpdcZ.js index 0131bbcb9e843a890f6f40f1fc14d5be8d261772..f45b8b20683938bf0855b33eeb098cad0bcd423d 100644 --- a/assets/index-Ybm9YyT5.js +++ b/assets/index-7RUPpdcZ.js @@ -1,4 +1,4 @@ -import{af as nn,ag as or,j as pn}from"./index-BHOUC_Zu.js";function pf(){}function mf(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function wi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Si=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ci=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ei={};function ft(e,t){return(Ei.jsx?Ci:Si).test(e)}const Ii=/[ \t\n\f\r]/g;function Ai(e){return typeof e=="object"?e.type==="text"?ht(e.value):!1:ht(e)}function ht(e){return e.replace(Ii,"")===""}class qe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qe.prototype.normal={};qe.prototype.property={};qe.prototype.space=void 0;function ar(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new qe(n,r,t)}function vn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ti=0;const D=Ie(),W=Ie(),zn=Ie(),S=Ie(),V=Ie(),De=Ie(),te=Ie();function Ie(){return 2**++Ti}const Dn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:W,commaOrSpaceSeparated:te,commaSeparated:De,number:S,overloadedBoolean:zn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),mn=Object.keys(Dn);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Li.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,_i);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Di,Ri);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ri(e){return"-"+e.toLowerCase()}function _i(e){return e.charAt(1).toUpperCase()}const Oi=ar([ur,Pi,fr,hr,pr],"html"),Un=ar([ur,vi,fr,hr,pr],"svg");function gf(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Mi(e){return e.join(" ").trim()}var Vn={},gt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ni=/\n/g,Bi=/^\s*/,ji=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hi=/^:\s*/,Ui=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Vi=/^[;\s]*/,$i=/^\s+|\s+$/g,qi=` +import{ag as nn,ah as or,j as pn}from"./index-gsUrUwg6.js";function pf(){}function mf(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function wi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Si=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ci=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ei={};function ft(e,t){return(Ei.jsx?Ci:Si).test(e)}const Ii=/[ \t\n\f\r]/g;function Ai(e){return typeof e=="object"?e.type==="text"?ht(e.value):!1:ht(e)}function ht(e){return e.replace(Ii,"")===""}class qe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}qe.prototype.normal={};qe.prototype.property={};qe.prototype.space=void 0;function ar(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new qe(n,r,t)}function vn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ti=0;const D=Ie(),W=Ie(),zn=Ie(),S=Ie(),V=Ie(),De=Ie(),te=Ie();function Ie(){return 2**++Ti}const Dn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:W,commaOrSpaceSeparated:te,commaSeparated:De,number:S,overloadedBoolean:zn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),mn=Object.keys(Dn);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Li.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,_i);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Di,Ri);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ri(e){return"-"+e.toLowerCase()}function _i(e){return e.charAt(1).toUpperCase()}const Oi=ar([ur,Pi,fr,hr,pr],"html"),Un=ar([ur,vi,fr,hr,pr],"svg");function gf(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Mi(e){return e.join(" ").trim()}var Vn={},gt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ni=/\n/g,Bi=/^\s*/,ji=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hi=/^:\s*/,Ui=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Vi=/^[;\s]*/,$i=/^\s+|\s+$/g,qi=` `,dt="/",yt="*",Ce="",Wi="comment",Yi="declaration";function Xi(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(d){var x=d.match(Ni);x&&(n+=x.length);var C=d.lastIndexOf(qi);r=~C?d.length-C:r+d.length}function o(){var d={line:n,column:r};return function(x){return x.position=new l(d),s(),x}}function l(d){this.start=d,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(d){var x=new Error(t.source+":"+n+":"+r+": "+d);if(x.reason=d,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(d){var x=d.exec(e);if(x){var C=x[0];return i(C),e=e.slice(C.length),x}}function s(){u(Bi)}function f(d){var x;for(d=d||[];x=c();)x!==!1&&d.push(x);return d}function c(){var d=o();if(!(dt!=e.charAt(0)||yt!=e.charAt(1))){for(var x=2;Ce!=e.charAt(x)&&(yt!=e.charAt(x)||dt!=e.charAt(x+1));)++x;if(x+=2,Ce===e.charAt(x-1))return a("End of comment missing");var C=e.slice(2,x-2);return r+=2,i(C),e=e.slice(x),r+=2,d({type:Wi,comment:C})}}function p(){var d=o(),x=u(ji);if(x){if(c(),!u(Hi))return a("property missing ':'");var C=u(Ui),y=d({type:Yi,property:kt(x[0].replace(gt,Ce)),value:C?kt(C[0].replace(gt,Ce)):Ce});return u(Vi),y}}function h(){var d=[];f(d);for(var x;x=p();)x!==!1&&(d.push(x),f(d));return d}return s(),h()}function kt(e){return e?e.replace($i,Ce):Ce}var Qi=Xi,Gi=nn&&nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.default=Ji;const Ki=Gi(Qi);function Ji(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Ki.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:a}=o;i?t(l,a,o):a&&(n=n||{},n[l]=a)}),n}var an={};Object.defineProperty(an,"__esModule",{value:!0});an.camelCase=void 0;var Zi=/^--[a-zA-Z0-9_-]+$/,el=/-([a-z])/g,nl=/^[^-]+$/,tl=/^-(webkit|moz|ms|o|khtml)-/,rl=/^-(ms)-/,il=function(e){return!e||nl.test(e)||Zi.test(e)},ll=function(e,t){return t.toUpperCase()},xt=function(e,t){return"".concat(t,"-")},ol=function(e,t){return t===void 0&&(t={}),il(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(rl,xt):e=e.replace(tl,xt),e.replace(el,ll))};an.camelCase=ol;var al=nn&&nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ul=al(Vn),sl=an;function Ln(e,t){var n={};return!e||typeof e!="string"||(0,ul.default)(e,function(r,i){r&&i&&(n[(0,sl.camelCase)(r,t)]=i)}),n}Ln.default=Ln;var cl=Ln;const fl=or(cl),mr=gr("end"),$n=gr("start");function gr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function hl(e){const t=$n(e),n=mr(e);if(t&&n)return{start:t,end:n}}function je(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bt(e.position):"start"in e||"end"in e?bt(e):"line"in e||"column"in e?Fn(e):""}function Fn(e){return wt(e&&e.line)+":"+wt(e&&e.column)}function bt(e){return Fn(e&&e.start)+"-"+Fn(e&&e.end)}function wt(e){return e&&typeof e=="number"?e:1}class K extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=je(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const qn={}.hasOwnProperty,pl=new Map,ml=/[A-Z]/g,gl=new Set(["table","tbody","thead","tfoot","tr"]),dl=new Set(["td","th"]),dr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yl(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Il(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=El(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Un:Oi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=yr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function yr(e,t,n){if(t.type==="element")return kl(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return xl(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return wl(e,t,n);if(t.type==="mdxjsEsm")return bl(e,t);if(t.type==="root")return Sl(e,t,n);if(t.type==="text")return Cl(e,t)}function kl(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=xr(e,t.tagName,!1),l=Al(e,t);let a=Yn(e,t);return gl.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Ai(u):!0})),kr(e,l,o,t),Wn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function xl(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ve(e,t.position)}function bl(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ve(e,t.position)}function wl(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:xr(e,t.name,!0),l=Tl(e,t),a=Yn(e,t);return kr(e,l,o,t),Wn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Sl(e,t,n){const r={};return Wn(r,Yn(e,t)),e.create(t,e.Fragment,r,n)}function Cl(e,t){return t.value}function kr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function El(e,t,n){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?n:t;return a?s(o,l,a):s(o,l)}}function Il(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=$n(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Al(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&qn.call(t.properties,i)){const o=Pl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&dl.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Tl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ve(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Ve(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Yn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:pl;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(re(e,e.length,0,t),e):t}const Et={}.hasOwnProperty;function wr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function se(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=xe(/[A-Za-z]/),G=xe(/[\dA-Za-z]/),Ml=xe(/[#-'*+\--9=?A-Z^-~]/);function tn(e){return e!==null&&(e<32||e===127)}const Rn=xe(/\d/),Nl=xe(/[\dA-Fa-f]/),Bl=xe(/[!-/:-@[-`{-~]/);function v(e){return e!==null&&e<-2}function U(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}const un=xe(new RegExp("\\p{P}|\\p{S}","u")),Ee=xe(/\s/);function xe(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Re(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function O(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return R(u)?(e.enter(n),a(u)):t(u)}function a(u){return R(u)&&o++l))return;const M=t.events.length;let $=M,B,k;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(B){k=t.events[$][1].end;break}B=!0}for(y(r),w=M;wE;){const F=n[L];t.containerState=F[1],F[0].exit.call(t,e)}n.length=E}function A(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function $l(e,t,n){return O(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Le(e){if(e===null||U(e)||Ee(e))return 1;if(un(e))return 2}function sn(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};At(c,-u),At(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ie(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=ie(s,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),s=ie(s,sn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=ie(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,s=ie(s,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,re(e,r-1,n-r+3,s),n=r+s.length-f-2;break}}for(n=-1;++n0&&R(w)?O(e,A,"linePrefix",o+1)(w):A(w)}function A(w){return w===null||v(w)?e.check(Tt,x,L)(w):(e.enter("codeFlowValue"),E(w))}function E(w){return w===null||v(w)?(e.exit("codeFlowValue"),A(w)):(e.consume(w),E)}function L(w){return e.exit("codeFenced"),t(w)}function F(w,M,$){let B=0;return k;function k(N){return w.enter("lineEnding"),w.consume(N),w.exit("lineEnding"),T}function T(N){return w.enter("codeFencedFence"),R(N)?O(w,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):P(N)}function P(N){return N===a?(w.enter("codeFencedFenceSequence"),j(N)):$(N)}function j(N){return N===a?(B++,w.consume(N),j):B>=l?(w.exit("codeFencedFenceSequence"),R(N)?O(w,q,"whitespace")(N):q(N)):$(N)}function q(N){return N===null||v(N)?(w.exit("codeFencedFence"),M(N)):$(N)}}}function to(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const dn={name:"codeIndented",tokenize:io},ro={partial:!0,tokenize:lo};function io(e,t,n){const r=this;return i;function i(s){return e.enter("codeIndented"),O(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):n(s)}function l(s){return s===null?u(s):v(s)?e.attempt(ro,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||v(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),t(s)}}function lo(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):O(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):v(l)?i(l):n(l)}}const oo={name:"codeText",previous:uo,resolve:ao,tokenize:so};function ao(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ne(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ne(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ne(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Tr(e,t,n,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||tn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||v(y)?n(y):(e.consume(y),y===92?d:h)}function d(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function x(y){return!f&&(y===null||y===41||U(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):v(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||v(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!R(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function vr(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?n(p):v(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),O(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||v(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function He(e,t){let n;return r;function r(i){return v(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):R(i)?O(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ko={name:"definition",tokenize:bo},xo={partial:!0,tokenize:wo};function bo(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return Pr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return U(h)?He(e,s)(h):s(h)}function s(h){return Tr(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(xo,c,c)(h)}function c(h){return R(h)?O(e,p,"whitespace")(h):p(h)}function p(h){return h===null||v(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function wo(e,t,n){return r;function r(a){return U(a)?He(e,i)(a):n(a)}function i(a){return vr(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return R(a)?O(e,l,"whitespace")(a):l(a)}function l(a){return a===null||v(a)?t(a):n(a)}}const So={name:"hardBreakEscape",tokenize:Co};function Co(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return v(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Eo={name:"headingAtx",resolve:Io,tokenize:Ao};function Io(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},re(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ao(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||U(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||v(f)?(e.exit("atxHeading"),t(f)):R(f)?O(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||U(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const To=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vt=["pre","script","style","textarea"],Po={concrete:!0,name:"htmlFlow",resolveTo:Do,tokenize:Lo},vo={partial:!0,tokenize:Ro},zo={partial:!0,tokenize:Fo};function Do(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Lo(e,t,n){const r=this;let i,o,l,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),o=!0,x):g===63?(e.consume(g),i=3,r.interrupt?t:m):J(g)?(e.consume(g),l=String.fromCharCode(g),C):n(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,a=0,d):J(g)?(e.consume(g),i=4,r.interrupt?t:m):n(g)}function h(g){return g===45?(e.consume(g),r.interrupt?t:m):n(g)}function d(g){const ae="CDATA[";return g===ae.charCodeAt(a++)?(e.consume(g),a===ae.length?r.interrupt?t:P:d):n(g)}function x(g){return J(g)?(e.consume(g),l=String.fromCharCode(g),C):n(g)}function C(g){if(g===null||g===47||g===62||U(g)){const ae=g===47,be=l.toLowerCase();return!ae&&!o&&vt.includes(be)?(i=1,r.interrupt?t(g):P(g)):To.includes(l.toLowerCase())?(i=6,ae?(e.consume(g),y):r.interrupt?t(g):P(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?A(g):E(g))}return g===45||G(g)?(e.consume(g),l+=String.fromCharCode(g),C):n(g)}function y(g){return g===62?(e.consume(g),r.interrupt?t:P):n(g)}function A(g){return R(g)?(e.consume(g),A):k(g)}function E(g){return g===47?(e.consume(g),k):g===58||g===95||J(g)?(e.consume(g),L):R(g)?(e.consume(g),E):k(g)}function L(g){return g===45||g===46||g===58||g===95||G(g)?(e.consume(g),L):F(g)}function F(g){return g===61?(e.consume(g),w):R(g)?(e.consume(g),F):E(g)}function w(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,M):R(g)?(e.consume(g),w):$(g)}function M(g){return g===u?(e.consume(g),u=null,B):g===null||v(g)?n(g):(e.consume(g),M)}function $(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||U(g)?F(g):(e.consume(g),$)}function B(g){return g===47||g===62||R(g)?E(g):n(g)}function k(g){return g===62?(e.consume(g),T):n(g)}function T(g){return g===null||v(g)?P(g):R(g)?(e.consume(g),T):n(g)}function P(g){return g===45&&i===2?(e.consume(g),Q):g===60&&i===1?(e.consume(g),Y):g===62&&i===4?(e.consume(g),oe):g===63&&i===3?(e.consume(g),m):g===93&&i===5?(e.consume(g),he):v(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(vo,pe,j)(g)):g===null||v(g)?(e.exit("htmlFlowData"),j(g)):(e.consume(g),P)}function j(g){return e.check(zo,q,pe)(g)}function q(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),N}function N(g){return g===null||v(g)?j(g):(e.enter("htmlFlowData"),P(g))}function Q(g){return g===45?(e.consume(g),m):P(g)}function Y(g){return g===47?(e.consume(g),l="",le):P(g)}function le(g){if(g===62){const ae=l.toLowerCase();return vt.includes(ae)?(e.consume(g),oe):P(g)}return J(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),le):P(g)}function he(g){return g===93?(e.consume(g),m):P(g)}function m(g){return g===62?(e.consume(g),oe):g===45&&i===2?(e.consume(g),m):P(g)}function oe(g){return g===null||v(g)?(e.exit("htmlFlowData"),pe(g)):(e.consume(g),oe)}function pe(g){return e.exit("htmlFlow"),t(g)}}function Fo(e,t,n){const r=this;return i;function i(l){return v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Ro(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(We,t,n)}}const _o={name:"htmlText",tokenize:Oo};function Oo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),F):m===63?(e.consume(m),E):J(m)?(e.consume(m),$):n(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,d):J(m)?(e.consume(m),A):n(m)}function f(m){return m===45?(e.consume(m),h):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):v(m)?(l=c,Y(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?Q(m):m===45?p(m):c(m)}function d(m){const oe="CDATA[";return m===oe.charCodeAt(o++)?(e.consume(m),o===oe.length?x:d):n(m)}function x(m){return m===null?n(m):m===93?(e.consume(m),C):v(m)?(l=x,Y(m)):(e.consume(m),x)}function C(m){return m===93?(e.consume(m),y):x(m)}function y(m){return m===62?Q(m):m===93?(e.consume(m),y):x(m)}function A(m){return m===null||m===62?Q(m):v(m)?(l=A,Y(m)):(e.consume(m),A)}function E(m){return m===null?n(m):m===63?(e.consume(m),L):v(m)?(l=E,Y(m)):(e.consume(m),E)}function L(m){return m===62?Q(m):E(m)}function F(m){return J(m)?(e.consume(m),w):n(m)}function w(m){return m===45||G(m)?(e.consume(m),w):M(m)}function M(m){return v(m)?(l=M,Y(m)):R(m)?(e.consume(m),M):Q(m)}function $(m){return m===45||G(m)?(e.consume(m),$):m===47||m===62||U(m)?B(m):n(m)}function B(m){return m===47?(e.consume(m),Q):m===58||m===95||J(m)?(e.consume(m),k):v(m)?(l=B,Y(m)):R(m)?(e.consume(m),B):Q(m)}function k(m){return m===45||m===46||m===58||m===95||G(m)?(e.consume(m),k):T(m)}function T(m){return m===61?(e.consume(m),P):v(m)?(l=T,Y(m)):R(m)?(e.consume(m),T):B(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,j):v(m)?(l=P,Y(m)):R(m)?(e.consume(m),P):(e.consume(m),q)}function j(m){return m===i?(e.consume(m),i=void 0,N):m===null?n(m):v(m)?(l=j,Y(m)):(e.consume(m),j)}function q(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||U(m)?B(m):(e.consume(m),q)}function N(m){return m===47||m===62||U(m)?B(m):n(m)}function Q(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function Y(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),le}function le(m){return R(m)?O(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):he(m)}function he(m){return e.enter("htmlTextData"),l(m)}}const Gn={name:"labelEnd",resolveAll:jo,resolveTo:Ho,tokenize:Uo},Mo={tokenize:Vo},No={tokenize:$o},Bo={tokenize:qo};function jo(e){let t=-1;const n=[];for(;++t=3&&(s===null||v(s))?(e.exit("thematicBreak"),t(s)):n(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),R(s)?O(e,a,"whitespace")(s):a(s))}}const Z={continuation:{tokenize:na},exit:ra,name:"list",tokenize:ea},Jo={partial:!0,tokenize:ia},Zo={partial:!0,tokenize:ta};function ea(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const d=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Rn(h)){if(r.containerState.type||(r.containerState.type=d,e.enter(d,{_container:!0})),d==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Ze,n,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return Rn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):n(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(We,r.interrupt?n:f,e.attempt(Jo,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return R(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function na(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(We,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,O(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!R(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Zo,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,O(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ta(e,t,n){const r=this;return O(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function ra(e){e.exit(this.containerState.type)}function ia(e,t,n){const r=this;return O(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!R(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const zt={name:"setextUnderline",resolveTo:la,tokenize:oa};function la(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function oa(e,t,n){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):n(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),R(s)?O(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||v(s)?(e.exit("setextHeadingLine"),t(s)):n(s)}}const aa={tokenize:ua};function ua(e){const t=this,n=e.attempt(We,r,e.attempt(this.parser.constructs.flowInitial,i,O(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ho,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const sa={resolveAll:Dr()},ca=zr("string"),fa=zr("text");function zr(e){return{resolveAll:Dr(e==="text"?ha:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return s(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Ia(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=z.tokenStack[z.tokenStack.length-1];(ue[1]||Lt).call(z,void 0,ue[0])}for(I.position={start:ke(b.length>0?b[0][1].start:{line:1,column:1,offset:0}),end:ke(b.length>0?b[b.length-2][1].end:{line:1,column:1,offset:0})},H=-1;++H(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; +import{r as u}from"./index-gsUrUwg6.js";function o(r){const e=u.useRef({value:r,previous:r});return u.useMemo(()=>(e.current.value!==r&&(e.current.previous=e.current.value,e.current.value=r),e.current.previous),[r])}export{o as u}; diff --git a/assets/index-BHOUC_Zu.js b/assets/index-gsUrUwg6.js similarity index 97% rename from assets/index-BHOUC_Zu.js rename to assets/index-gsUrUwg6.js index 2eba6257d36be641c01660a59a1d414dfb305c0c..e5679c4f5b0888ef8f01eeb1232cdbaad4201266 100644 --- a/assets/index-BHOUC_Zu.js +++ b/assets/index-gsUrUwg6.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-BioyKnFQ.js","assets/components-CgNSGcDY.js","assets/LatexTitle-R8V-03ZY.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-BaQjfqPg.js","assets/chatSessions-DxE8uXe5.js","assets/usePapers-CShAZvOx.js","assets/useQuery-BLoDQBYX.js","assets/useInfiniteQuery-Cme8RlvF.js","assets/useIntersectionObserver-FWZA_Lvo.js","assets/usePeriodFilter-DmE7oYz7.js","assets/skeleton-D99KO90d.js","assets/alert-pE5EZBRN.js","assets/ChatView-BMNQRO1E.js","assets/hover-card-CYqiITh9.js","assets/index-Ybm9YyT5.js","assets/index-BYJflHqW.js","assets/PapersListView-BO6EFz71.js","assets/useDebounce-CZDogMbl.js","assets/PaperDetailView-B7xj9C7Q.js","assets/ExternalSourceEvalBadge-CuyDncpX.js","assets/latexPlainText-ChVkH0gY.js","assets/button-BKNKi_tx.js","assets/index-Del2ukvi.js","assets/textarea-dXuRCXp_.js","assets/dialog-S5NgAS91.js","assets/useMutation-B-QOtIkd.js","assets/SignInToEditDialog-DzcyeLv5.js","assets/loader-circle-MkVnaQiB.js","assets/codexAddEvals-DsGqXQP5.js","assets/github-Du_zsyOo.js","assets/TagsIndexView-Coa5ZifW.js","assets/TaxonomySuggestionTile-DeKWtuEn.js","assets/TagBrowseView-BHDwjPvv.js","assets/BenchmarkTrendSparkline-097gkkLo.js","assets/MarkdownText-CNmqxPO9.js","assets/chevron-down-ZivE930n.js","assets/MethodsIndexView-BcMT_V5E.js","assets/FrameworksIndexView-Bt1QXuSZ.js","assets/TrendsView-bBL_-M78.js","assets/ConferencesIndexView-C2rc9N0P.js","assets/AiDeadlinesView-M2ihfYd-.js","assets/switch-CEN8Rv4w.js","assets/ConferenceDetailView-hzsHLbhD.js","assets/ConferenceTaskView-Bbye1dhE.js","assets/OrganizationsIndexView-6mCxurDk.js","assets/OrganizationDetailView-Cm6pGlQi.js","assets/NotFound-qaYOxGzN.js","assets/OrganizationTaskView-Bysl0j3X.js","assets/MethodDetailView-U8lMdR1i.js","assets/BenchmarkDetailView-CFx9rlgB.js","assets/SavedPapersView-D3n8Gad0.js","assets/SettingsView-CkIvxrcP.js","assets/SubmitView-CTzPaVJS.js","assets/CronDashboard-Clvh_kJa.js","assets/shield-alert-DCaALQgN.js","assets/CronDashboard-55WCoakE.css","assets/SubmissionsDashboard-Dep2ppOa.js","assets/SearchOverlay-BcJrWg54.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-DBPKjNq3.js","assets/components-f5SMGslj.js","assets/LatexTitle-BsZuFMnA.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-6AvXXXHk.js","assets/chatSessions-DgD7qgsg.js","assets/usePapers-BgUiIfcw.js","assets/useQuery-CPia3mbp.js","assets/useInfiniteQuery-DNCGoDeK.js","assets/useIntersectionObserver-Jkfl_qWv.js","assets/usePeriodFilter-CfsBKHc9.js","assets/skeleton-CF5-g5gI.js","assets/alert-DCRuvdIl.js","assets/ChatView-Cn8694zt.js","assets/hover-card-BmN6fO7d.js","assets/index-7RUPpdcZ.js","assets/index-B6ekb6Wc.js","assets/PapersListView-CEKrrz6_.js","assets/useDebounce-DMdZcc3h.js","assets/PaperDetailView-BR6DDoza.js","assets/ExternalSourceEvalBadge-B_j6-Fi4.js","assets/latexPlainText-ChVkH0gY.js","assets/button-CJ4HWE-U.js","assets/index-Dov-h1--.js","assets/textarea-lhvg1Jzz.js","assets/dialog-Bil4Ya0L.js","assets/useMutation-CQieGF4K.js","assets/SignInToEditDialog-DeRdsNO0.js","assets/loader-circle-BgGrBUVx.js","assets/codexAddEvals-CHZ35FuP.js","assets/github-BR_-AwyS.js","assets/TagsIndexView-BSr7Xyd4.js","assets/TaxonomySuggestionTile-CWfaWHsI.js","assets/TagBrowseView-DEjLjywI.js","assets/BenchmarkTrendSparkline-CQYwfeti.js","assets/MarkdownText-1fpxqyMR.js","assets/chevron-down-C0S2yejG.js","assets/MethodsIndexView-CJcZiURr.js","assets/FrameworksIndexView-CU8V9Ap8.js","assets/TrendsView-BHSTAeEu.js","assets/ConferencesIndexView-B3HCMmrn.js","assets/AiDeadlinesView-DiE8i5uI.js","assets/switch-CnhcVUVf.js","assets/ConferenceDetailView-qTh5wHQs.js","assets/ConferenceTaskView-BJz7eqBS.js","assets/OrganizationsIndexView-D8tV0kaA.js","assets/OrganizationDetailView-DVGr7EZ1.js","assets/NotFound-DntriyTH.js","assets/OrganizationTaskView-7B863H2d.js","assets/MethodDetailView-Bgd2_gNk.js","assets/BenchmarkDetailView-Bi4Pfrh0.js","assets/SavedPapersView-B5Dv-0u7.js","assets/SettingsView-avOWZkJc.js","assets/SubmitView-Dj01AAbq.js","assets/CronDashboard-Dk0srJbz.js","assets/shield-alert-CJqoAF0o.js","assets/CronDashboard-55WCoakE.css","assets/SubmissionsDashboard-9D45gT9z.js","assets/SearchOverlay-IwrYUcEL.js"])))=>i.map(i=>d[i]); var m0=Object.defineProperty;var rf=e=>{throw TypeError(e)};var v0=(e,t,n)=>t in e?m0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var of=(e,t,n)=>v0(e,typeof t!="symbol"?t+"":t,n),pa=(e,t,n)=>t.has(e)||rf("Cannot "+n);var N=(e,t,n)=>(pa(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>t.has(e)?rf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(pa(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Me=(e,t,n)=>(pa(e,t,"access private method"),n);var es=(e,t,n,r)=>({set _(o){W(e,t,o,n)},get _(){return N(e,t,r)}});function y0(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var NN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mh={exports:{}},_l={},Oh={exports:{}},Z={};/** * @license React * react.production.min.js @@ -154,4 +154,4 @@ Error generating stack: `+i.message+` * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nT=oa("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rT=qk,oT=Gk,iT=f.forwardRef(({className:e,inset:t,children:n,...r},o)=>v.jsxs(Sw,{ref:o,className:Ne("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,v.jsx(eT,{className:"ml-auto h-4 w-4"})]}));iT.displayName=Sw.displayName;const sT=f.forwardRef(({className:e,...t},n)=>v.jsx(Ew,{ref:n,className:Ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));sT.displayName=Ew.displayName;const bw=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(Qk,{children:v.jsx(hw,{ref:r,sideOffset:t,className:Ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));bw.displayName=hw.displayName;const Cn=f.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(mw,{ref:r,className:Ne("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));Cn.displayName=mw.displayName;const lT=f.forwardRef(({className:e,children:t,checked:n,...r},o)=>v.jsxs(vw,{ref:o,className:Ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(ww,{children:v.jsx(Zk,{className:"h-4 w-4"})})}),t]}));lT.displayName=vw.displayName;const aT=f.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(yw,{ref:r,className:Ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(ww,{children:v.jsx(tT,{className:"h-2 w-2 fill-current"})})}),t]}));aT.displayName=yw.displayName;const Pw=f.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(gw,{ref:r,className:Ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Pw.displayName=gw.displayName;const hc=f.forwardRef(({className:e,...t},n)=>v.jsx(xw,{ref:n,className:Ne("-mx-1 my-1 h-px bg-muted",e),...t}));hc.displayName=xw.displayName;function uT(e){const n=(e.name||e.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const cT=({user:e,onLogout:t})=>v.jsxs(rT,{children:[v.jsx(oT,{asChild:!0,children:v.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:v.jsxs(Lv,{className:"h-8 w-8",children:[e.avatar_url&&v.jsx(Dv,{src:e.avatar_url,alt:e.username}),v.jsx($v,{className:"text-xs",children:uT(e)})]})})}),v.jsxs(bw,{align:"end",className:"w-56",children:[v.jsxs(Pw,{className:"flex flex-col gap-0.5 py-2",children:[v.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),v.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&v.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"})]}),v.jsx(hc,{}),v.jsx(Cn,{asChild:!0,children:v.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),v.jsx(Cn,{asChild:!0,children:v.jsx(zr,{to:"/frameworks",children:"Frameworks"})}),v.jsx(Cn,{asChild:!0,children:v.jsx(zr,{to:"/trends",children:"Trends"})}),e.is_admin&&v.jsxs(v.Fragment,{children:[v.jsx(Cn,{asChild:!0,children:v.jsx(zr,{to:"/admin-dashboard",children:"Admin dashboard"})}),v.jsx(Cn,{asChild:!0,children:v.jsx(zr,{to:"/submissions",children:"Review submissions"})})]}),v.jsx(Cn,{asChild:!0,children:v.jsx(zr,{to:"/settings",children:"Settings"})}),v.jsx(hc,{}),v.jsx(Cn,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),_w=R.createContext(null),ah="pwc:auth-stale";async function dT(){if(Hi())return null;const e=await fetch(io("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return e.status===401||!e.ok?null:await e.json()}const fT=({children:e})=>{const[t,n]=R.useState(null),[r,o]=R.useState(!0),i=R.useCallback(async()=>{o(!0);const a=await dT();n(a),o(!1)},[]),s=R.useCallback(async()=>{await fetch(io("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);R.useEffect(()=>{i()},[i]),R.useEffect(()=>{const a=()=>n(null);return window.addEventListener(ah,a),()=>window.removeEventListener(ah,a)},[]);const l=R.useMemo(()=>({user:t,isLoading:r,refresh:i,logout:s}),[t,r,i,s]);return v.jsx(_w.Provider,{value:l,children:e})};function Kd(){const e=R.useContext(_w);if(!e)throw new Error("useAuth must be used inside an ");return e}const Qo=({name:e,size:t=14})=>{const n={search:v.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:v.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:v.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:v.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return v.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},uh="https://github.com/huggingface/paperswithcode-feedback/issues",ch=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/submit",label:"Submit",end:!1}],pT=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgentData,t=(e==null?void 0:e.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(t)},hT=()=>{const[e,t]=R.useState(!1);return R.useEffect(()=>{t(pT())},[]),v.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},gT=({onOpenSearch:e})=>{const[t,n]=R.useState(!1),r=()=>n(!1),{user:o,logout:i}=Kd(),s=dn(),l=hv()&&(s.pathname==="/chat"||s.pathname.startsWith("/chat/")),a=`${s.pathname}${s.search}`||"/",u=Hi();return v.jsxs(v.Fragment,{children:[v.jsx("header",{className:`app-header${l?" app-header-chat":""}`,children:v.jsxs("div",{className:"app-header-inner",children:[v.jsxs(Lr,{to:"/",className:"brand",onClick:r,children:[v.jsx("span",{className:"brand-mark"}),v.jsxs("span",{className:"brand-name",children:["Papers ",v.jsx("em",{children:"With Code"})]})]}),v.jsx("nav",{className:"nav",children:ch.map(({to:d,label:c,end:h})=>v.jsx(Lr,{to:d,end:h,className:({isActive:p})=>`nav-item ${p?"active":""}`,children:c},d))}),v.jsx("div",{className:"header-spacer"}),v.jsx("a",{className:"feedback-link header-feedback-link",href:uh,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),v.jsxs("button",{className:"search-trigger",onClick:e,children:[v.jsx(Qo,{name:"search",size:13}),v.jsx("span",{children:"Search papers, authors, domains…"}),v.jsx(hT,{})]}),v.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:v.jsx(Qo,{name:"search",size:14})}),!u&&v.jsx(Lr,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:v.jsx(Qo,{name:"bookmark",size:13})}),u?null:o?v.jsx(cT,{user:o,onLogout:i}):v.jsx(gv,{returnTo:a}),v.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(d=>!d),children:v.jsx(Qo,{name:t?"close":"menu",size:14})})]})}),t&&v.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:v.jsxs("div",{className:"mobile-nav-panel",onClick:d=>d.stopPropagation(),children:[v.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),e()},children:[v.jsx(Qo,{name:"search",size:14}),v.jsx("span",{children:"Search papers, authors, domains…"})]}),ch.map(({to:d,label:c,end:h})=>v.jsx(Lr,{to:d,end:h,className:"mobile-nav-link",onClick:r,children:c},d)),v.jsx("a",{className:"mobile-nav-link",href:uh,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!u&&v.jsx(Lr,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),!u&&(o==null?void 0:o.is_admin)&&v.jsx(Lr,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:r,children:"Admin dashboard"})]})})]})},mT=1,vT=1e6;let eu=0;function yT(){return eu=(eu+1)%Number.MAX_SAFE_INTEGER,eu.toString()}const tu=new Map,dh=e=>{if(tu.has(e))return;const t=setTimeout(()=>{tu.delete(e),ci({type:"REMOVE_TOAST",toastId:e})},vT);tu.set(e,t)},wT=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,mT)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?dh(n):e.toasts.forEach(r=>{dh(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Bs=[];let Vs={toasts:[]};function ci(e){Vs=wT(Vs,e),Bs.forEach(t=>{t(Vs)})}function xT({...e}){const t=yT(),n=o=>ci({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>ci({type:"DISMISS_TOAST",toastId:t});return ci({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function ST(){const[e,t]=f.useState(Vs);return f.useEffect(()=>(Bs.push(t),()=>{const n=Bs.indexOf(t);n>-1&&Bs.splice(n,1)}),[e]),{...e,toast:xT,dismiss:n=>ci({type:"DISMISS_TOAST",toastId:n})}}var ET=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),CT="VisuallyHidden",ia=f.forwardRef((e,t)=>v.jsx(ve.span,{...e,ref:t,style:{...ET,...e.style}}));ia.displayName=CT;var bT=ia,qd="ToastProvider",[Gd,PT,_T]=Rd("Toast"),[kw]=_r("Toast",[_T]),[kT,sa]=kw(qd),Tw=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[l,a]=f.useState(null),[u,d]=f.useState(0),c=f.useRef(!1),h=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${qd}\`. Expected non-empty \`string\`.`),v.jsx(Gd.Provider,{scope:t,children:v.jsx(kT,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:a,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:c,isClosePausedRef:h,children:s})})};Tw.displayName=qd;var Rw="ToastViewport",TT=["F8"],gc="toast.viewportPause",mc="toast.viewportResume",Nw=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=TT,label:o="Notifications ({hotkey})",...i}=e,s=sa(Rw,n),l=PT(n),a=f.useRef(null),u=f.useRef(null),d=f.useRef(null),c=f.useRef(null),h=Re(t,c,s.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=s.toastCount>0;f.useEffect(()=>{const x=m=>{var w;r.length!==0&&r.every(S=>m[S]||m.code===S)&&((w=c.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=a.current,m=c.current;if(E&&x&&m){const g=()=>{if(!s.isClosePausedRef.current){const b=new CustomEvent(gc);m.dispatchEvent(b),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const b=new CustomEvent(mc);m.dispatchEvent(b),s.isClosePausedRef.current=!1}},S=b=>{!x.contains(b.relatedTarget)&&w()},C=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",g),x.addEventListener("focusout",S),x.addEventListener("pointermove",g),x.addEventListener("pointerleave",C),window.addEventListener("blur",g),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",g),x.removeEventListener("focusout",S),x.removeEventListener("pointermove",g),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",g),window.removeEventListener("focus",w)}}},[E,s.isClosePausedRef]);const y=f.useCallback(({tabbingDirection:x})=>{const g=l().map(w=>{const S=w.ref.current,C=[S,...UT(S)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?g.reverse():g).flat()},[l]);return f.useEffect(()=>{const x=c.current;if(x){const m=g=>{var C,b,P;const w=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!w){const T=document.activeElement,j=g.shiftKey;if(g.target===x&&j){(C=u.current)==null||C.focus();return}const D=y({tabbingDirection:j?"backwards":"forwards"}),K=D.findIndex(L=>L===T);nu(D.slice(K+1))?g.preventDefault():j?(b=u.current)==null||b.focus():(P=d.current)==null||P.focus()}};return x.addEventListener("keydown",m),()=>x.removeEventListener("keydown",m)}},[l,y]),v.jsxs(ab,{ref:a,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&v.jsx(vc,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});nu(x)}}),v.jsx(Gd.Slot,{scope:n,children:v.jsx(ve.ol,{tabIndex:-1,...i,ref:h})}),E&&v.jsx(vc,{ref:d,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});nu(x)}})]})});Nw.displayName=Rw;var Mw="ToastFocusProxy",vc=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=sa(Mw,n);return v.jsx(ia,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const l=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(l))&&r()}})});vc.displayName=Mw;var Yi="Toast",RT="toast.swipeStart",NT="toast.swipeMove",MT="toast.swipeCancel",OT="toast.swipeEnd",Ow=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[l,a]=kd({prop:r,defaultProp:o??!0,onChange:i,caller:Yi});return v.jsx(kr,{present:n||l,children:v.jsx(IT,{open:l,...s,ref:t,onClose:()=>a(!1),onPause:Je(e.onPause),onResume:Je(e.onResume),onSwipeStart:V(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:V(e.onSwipeMove,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${c}px`)}),onSwipeCancel:V(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:V(e.onSwipeEnd,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${c}px`),a(!1)})})})});Ow.displayName=Yi;var[AT,jT]=kw(Yi,{onClose(){}}),IT=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:l,onPause:a,onResume:u,onSwipeStart:d,onSwipeMove:c,onSwipeCancel:h,onSwipeEnd:p,...E}=e,y=sa(Yi,n),[x,m]=f.useState(null),g=Re(t,L=>m(L)),w=f.useRef(null),S=f.useRef(null),C=o||y.duration,b=f.useRef(0),P=f.useRef(C),T=f.useRef(0),{onToastAdd:j,onToastRemove:A}=y,z=Je(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=y.viewport)==null||Y.focus()),s()}),D=f.useCallback(L=>{!L||L===1/0||(window.clearTimeout(T.current),b.current=new Date().getTime(),T.current=window.setTimeout(z,L))},[z]);f.useEffect(()=>{const L=y.viewport;if(L){const Y=()=>{D(P.current),u==null||u()},U=()=>{const H=new Date().getTime()-b.current;P.current=P.current-H,window.clearTimeout(T.current),a==null||a()};return L.addEventListener(gc,U),L.addEventListener(mc,Y),()=>{L.removeEventListener(gc,U),L.removeEventListener(mc,Y)}}},[y.viewport,C,a,u,D]),f.useEffect(()=>{i&&!y.isClosePausedRef.current&&D(C)},[i,C,y.isClosePausedRef,D]),f.useEffect(()=>(j(),()=>A()),[j,A]);const K=f.useMemo(()=>x?Fw(x):null,[x]);return y.viewport?v.jsxs(v.Fragment,{children:[K&&v.jsx(LT,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:K}),v.jsx(AT,{scope:n,onClose:z,children:Wi.createPortal(v.jsx(Gd.ItemSlot,{scope:n,children:v.jsx(lb,{asChild:!0,onEscapeKeyDown:V(l,()=>{y.isFocusedToastEscapeKeyDownRef.current||z(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:v.jsx(ve.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...E,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:V(e.onKeyDown,L=>{L.key==="Escape"&&(l==null||l(L.nativeEvent),L.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:V(e.onPointerDown,L=>{L.button===0&&(w.current={x:L.clientX,y:L.clientY})}),onPointerMove:V(e.onPointerMove,L=>{if(!w.current)return;const Y=L.clientX-w.current.x,U=L.clientY-w.current.y,H=!!S.current,M=["left","right"].includes(y.swipeDirection),k=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,I=M?k(0,Y):0,B=M?0:k(0,U),F=L.pointerType==="touch"?10:2,G={x:I,y:B},X={originalEvent:L,delta:G};H?(S.current=G,Ps(NT,c,X,{discrete:!1})):fh(G,y.swipeDirection,F)?(S.current=G,Ps(RT,d,X,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(Y)>F||Math.abs(U)>F)&&(w.current=null)}),onPointerUp:V(e.onPointerUp,L=>{const Y=S.current,U=L.target;if(U.hasPointerCapture(L.pointerId)&&U.releasePointerCapture(L.pointerId),S.current=null,w.current=null,Y){const H=L.currentTarget,M={originalEvent:L,delta:Y};fh(Y,y.swipeDirection,y.swipeThreshold)?Ps(OT,p,M,{discrete:!0}):Ps(MT,h,M,{discrete:!0}),H.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),LT=e=>{const{__scopeToast:t,children:n,...r}=e,o=sa(Yi,t),[i,s]=f.useState(!1),[l,a]=f.useState(!1);return FT(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>a(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:v.jsx($d,{asChild:!0,children:v.jsx(ia,{...r,children:i&&v.jsxs(v.Fragment,{children:[o.label," ",n]})})})},DT="ToastTitle",Aw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return v.jsx(ve.div,{...r,ref:t})});Aw.displayName=DT;var $T="ToastDescription",jw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return v.jsx(ve.div,{...r,ref:t})});jw.displayName=$T;var Iw="ToastAction",Lw=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?v.jsx($w,{altText:n,asChild:!0,children:v.jsx(Qd,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Iw}\`. Expected non-empty \`string\`.`),null)});Lw.displayName=Iw;var Dw="ToastClose",Qd=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=jT(Dw,n);return v.jsx($w,{asChild:!0,children:v.jsx(ve.button,{type:"button",...r,ref:t,onClick:V(e.onClick,o.onClose)})})});Qd.displayName=Dw;var $w=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return v.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Fw(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),zT(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Fw(r))}}),t}function Ps(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Td(o,i):o.dispatchEvent(i)}var fh=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function FT(e=()=>{}){const t=Je(e);vt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function zT(e){return e.nodeType===e.ELEMENT_NODE}function UT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nu(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var BT=Tw,zw=Nw,Uw=Ow,Bw=Aw,Vw=jw,Ww=Lw,Hw=Qd;const ph=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hh=Nv,VT=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return hh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],c=i==null?void 0:i[u];if(d===null)return null;const h=ph(d)||ph(c);return o[u][h]}),l=n&&Object.entries(n).reduce((u,d)=>{let[c,h]=d;return h===void 0||(u[c]=h),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:h,...p}=d;return Object.entries(p).every(E=>{let[y,x]=E;return Array.isArray(x)?x.includes({...i,...l}[y]):{...i,...l}[y]===x})?[...u,c,h]:u},[]);return hh(e,s,a,n==null?void 0:n.class,n==null?void 0:n.className)},WT=BT,Kw=f.forwardRef(({className:e,...t},n)=>v.jsx(zw,{ref:n,className:Ne("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Kw.displayName=zw.displayName;const HT=VT("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),qw=f.forwardRef(({className:e,variant:t,...n},r)=>v.jsx(Uw,{ref:r,className:Ne(HT({variant:t}),e),...n}));qw.displayName=Uw.displayName;const KT=f.forwardRef(({className:e,...t},n)=>v.jsx(Ww,{ref:n,className:Ne("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));KT.displayName=Ww.displayName;const Gw=f.forwardRef(({className:e,...t},n)=>v.jsx(Hw,{ref:n,className:Ne("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:v.jsx(nT,{className:"h-4 w-4"})}));Gw.displayName=Hw.displayName;const Qw=f.forwardRef(({className:e,...t},n)=>v.jsx(Bw,{ref:n,className:Ne("text-sm font-semibold",e),...t}));Qw.displayName=Bw.displayName;const Yw=f.forwardRef(({className:e,...t},n)=>v.jsx(Vw,{ref:n,className:Ne("text-sm opacity-90",e),...t}));Yw.displayName=Vw.displayName;function qT(){const{toasts:e}=ST();return v.jsxs(WT,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return v.jsxs(qw,{...i,children:[v.jsxs("div",{className:"grid gap-1",children:[n&&v.jsx(Qw,{children:n}),r&&v.jsx(Yw,{children:r})]}),o,v.jsx(Gw,{})]},t)}),v.jsx(Kw,{})]})}var GT=e=>{switch(e){case"success":return XT;case"info":return ZT;case"warning":return JT;case"error":return eR;default:return null}},QT=Array(12).fill(0),YT=({visible:e,className:t})=>R.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},R.createElement("div",{className:"sonner-spinner"},QT.map((n,r)=>R.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),XT=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),JT=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ZT=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),eR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),tR=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},R.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),R.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),nR=()=>{let[e,t]=R.useState(document.hidden);return R.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},yc=1,rR=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:yc++,i=this.toasts.find(l=>l.id===o),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(l=>l.id===o?(this.publish({...l,...e,id:o,title:n}),{...l,...e,id:o,dismissible:s,title:n}):l):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,i,s=r.then(async a=>{if(i=["resolve",a],R.isValidElement(a))o=!1,this.create({id:n,type:"default",message:a});else if(iR(a)&&!a.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${a.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${a.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(a):t.success,d=typeof t.description=="function"?await t.description(a):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async a=>{if(i=["reject",a],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(a):t.error,d=typeof t.description=="function"?await t.description(a):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var a;o&&(this.dismiss(n),n=void 0),(a=t.finally)==null||a.call(t)}),l=()=>new Promise((a,u)=>s.then(()=>i[0]==="reject"?u(i[1]):a(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||yc++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ke=new rR,oR=(e,t)=>{let n=(t==null?void 0:t.id)||yc++;return Ke.addToast({title:e,...t,id:n}),n},iR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",sR=oR,lR=()=>Ke.toasts,aR=()=>Ke.getActiveToasts();Object.assign(sR,{success:Ke.success,info:Ke.info,warning:Ke.warning,error:Ke.error,custom:Ke.custom,message:Ke.message,promise:Ke.promise,dismiss:Ke.dismiss,loading:Ke.loading},{getHistory:lR,getToasts:aR});function uR(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}uR(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function _s(e){return e.label!==void 0}var cR=3,dR="32px",fR="16px",gh=4e3,pR=356,hR=14,gR=20,mR=200;function Et(...e){return e.filter(Boolean).join(" ")}function vR(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var yR=e=>{var t,n,r,o,i,s,l,a,u,d,c;let{invert:h,toast:p,unstyled:E,interacting:y,setHeights:x,visibleToasts:m,heights:g,index:w,toasts:S,expanded:C,removeToast:b,defaultRichColors:P,closeButton:T,style:j,cancelButtonStyle:A,actionButtonStyle:z,className:D="",descriptionClassName:K="",duration:L,position:Y,gap:U,loadingIcon:H,expandByDefault:M,classNames:k,icons:I,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:F}=e,[G,X]=R.useState(null),[fe,ye]=R.useState(null),[J,Kt]=R.useState(!1),[Pe,At]=R.useState(!1),[pn,Nr]=R.useState(!1),[hn,Xi]=R.useState(!1),[ua,Ji]=R.useState(!1),[ca,Do]=R.useState(0),[Mr,Xd]=R.useState(0),$o=R.useRef(p.duration||L||gh),Jd=R.useRef(null),er=R.useRef(null),l0=w===0,a0=w+1<=m,at=p.type,Or=p.dismissible!==!1,u0=p.className||"",c0=p.descriptionClassName||"",Zi=R.useMemo(()=>g.findIndex(q=>q.toastId===p.id)||0,[g,p.id]),d0=R.useMemo(()=>{var q;return(q=p.closeButton)!=null?q:T},[p.closeButton,T]),Zd=R.useMemo(()=>p.duration||L||gh,[p.duration,L]),da=R.useRef(0),Ar=R.useRef(0),ef=R.useRef(0),jr=R.useRef(null),[f0,p0]=Y.split("-"),tf=R.useMemo(()=>g.reduce((q,oe,ce)=>ce>=Zi?q:q+oe.height,0),[g,Zi]),nf=nR(),h0=p.invert||h,fa=at==="loading";Ar.current=R.useMemo(()=>Zi*U+tf,[Zi,tf]),R.useEffect(()=>{$o.current=Zd},[Zd]),R.useEffect(()=>{Kt(!0)},[]),R.useEffect(()=>{let q=er.current;if(q){let oe=q.getBoundingClientRect().height;return Xd(oe),x(ce=>[{toastId:p.id,height:oe,position:p.position},...ce]),()=>x(ce=>ce.filter(yt=>yt.toastId!==p.id))}},[x,p.id]),R.useLayoutEffect(()=>{if(!J)return;let q=er.current,oe=q.style.height;q.style.height="auto";let ce=q.getBoundingClientRect().height;q.style.height=oe,Xd(ce),x(yt=>yt.find(wt=>wt.toastId===p.id)?yt.map(wt=>wt.toastId===p.id?{...wt,height:ce}:wt):[{toastId:p.id,height:ce,position:p.position},...yt])},[J,p.title,p.description,x,p.id]);let gn=R.useCallback(()=>{At(!0),Do(Ar.current),x(q=>q.filter(oe=>oe.toastId!==p.id)),setTimeout(()=>{b(p)},mR)},[p,b,x,Ar]);R.useEffect(()=>{if(p.promise&&at==="loading"||p.duration===1/0||p.type==="loading")return;let q;return C||y||F&&nf?(()=>{if(ef.current{var oe;(oe=p.onAutoClose)==null||oe.call(p,p),gn()},$o.current)),()=>clearTimeout(q)},[C,y,p,at,F,nf,gn]),R.useEffect(()=>{p.delete&&gn()},[gn,p.delete]);function g0(){var q,oe,ce;return I!=null&&I.loading?R.createElement("div",{className:Et(k==null?void 0:k.loader,(q=p==null?void 0:p.classNames)==null?void 0:q.loader,"sonner-loader"),"data-visible":at==="loading"},I.loading):H?R.createElement("div",{className:Et(k==null?void 0:k.loader,(oe=p==null?void 0:p.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":at==="loading"},H):R.createElement(YT,{className:Et(k==null?void 0:k.loader,(ce=p==null?void 0:p.classNames)==null?void 0:ce.loader),visible:at==="loading"})}return R.createElement("li",{tabIndex:0,ref:er,className:Et(D,u0,k==null?void 0:k.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[at],(n=p==null?void 0:p.classNames)==null?void 0:n[at]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:P,"data-styled":!(p.jsx||p.unstyled||E),"data-mounted":J,"data-promise":!!p.promise,"data-swiped":ua,"data-removed":Pe,"data-visible":a0,"data-y-position":f0,"data-x-position":p0,"data-index":w,"data-front":l0,"data-swiping":pn,"data-dismissible":Or,"data-type":at,"data-invert":h0,"data-swipe-out":hn,"data-swipe-direction":fe,"data-expanded":!!(C||M&&J),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${Pe?ca:Ar.current}px`,"--initial-height":M?"auto":`${Mr}px`,...j,...p.style},onDragEnd:()=>{Nr(!1),X(null),jr.current=null},onPointerDown:q=>{fa||!Or||(Jd.current=new Date,Do(Ar.current),q.target.setPointerCapture(q.pointerId),q.target.tagName!=="BUTTON"&&(Nr(!0),jr.current={x:q.clientX,y:q.clientY}))},onPointerUp:()=>{var q,oe,ce,yt;if(hn||!Or)return;jr.current=null;let wt=Number(((q=er.current)==null?void 0:q.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),mn=Number(((oe=er.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),tr=new Date().getTime()-((ce=Jd.current)==null?void 0:ce.getTime()),xt=G==="x"?wt:mn,vn=Math.abs(xt)/tr;if(Math.abs(xt)>=gR||vn>.11){Do(Ar.current),(yt=p.onDismiss)==null||yt.call(p,p),ye(G==="x"?wt>0?"right":"left":mn>0?"down":"up"),gn(),Xi(!0),Ji(!1);return}Nr(!1),X(null)},onPointerMove:q=>{var oe,ce,yt,wt;if(!jr.current||!Or||((oe=window.getSelection())==null?void 0:oe.toString().length)>0)return;let mn=q.clientY-jr.current.y,tr=q.clientX-jr.current.x,xt=(ce=e.swipeDirections)!=null?ce:vR(Y);!G&&(Math.abs(tr)>1||Math.abs(mn)>1)&&X(Math.abs(tr)>Math.abs(mn)?"x":"y");let vn={x:0,y:0};G==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&mn<0||xt.includes("bottom")&&mn>0)&&(vn.y=mn):G==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&tr<0||xt.includes("right")&&tr>0)&&(vn.x=tr),(Math.abs(vn.x)>0||Math.abs(vn.y)>0)&&Ji(!0),(yt=er.current)==null||yt.style.setProperty("--swipe-amount-x",`${vn.x}px`),(wt=er.current)==null||wt.style.setProperty("--swipe-amount-y",`${vn.y}px`)}},d0&&!p.jsx?R.createElement("button",{"aria-label":B,"data-disabled":fa,"data-close-button":!0,onClick:fa||!Or?()=>{}:()=>{var q;gn(),(q=p.onDismiss)==null||q.call(p,p)},className:Et(k==null?void 0:k.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(i=I==null?void 0:I.close)!=null?i:tR):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:R.createElement(R.Fragment,null,at||p.icon||p.promise?R.createElement("div",{"data-icon":"",className:Et(k==null?void 0:k.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||g0():null,p.type!=="loading"?p.icon||(I==null?void 0:I[at])||GT(at):null):null,R.createElement("div",{"data-content":"",className:Et(k==null?void 0:k.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},R.createElement("div",{"data-title":"",className:Et(k==null?void 0:k.title,(a=p==null?void 0:p.classNames)==null?void 0:a.title)},typeof p.title=="function"?p.title():p.title),p.description?R.createElement("div",{"data-description":"",className:Et(K,c0,k==null?void 0:k.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),f.isValidElement(p.cancel)?p.cancel:p.cancel&&_s(p.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:q=>{var oe,ce;_s(p.cancel)&&Or&&((ce=(oe=p.cancel).onClick)==null||ce.call(oe,q),gn())},className:Et(k==null?void 0:k.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&_s(p.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||z,onClick:q=>{var oe,ce;_s(p.action)&&((ce=(oe=p.action).onClick)==null||ce.call(oe,q),!q.defaultPrevented&&gn())},className:Et(k==null?void 0:k.actionButton,(c=p==null?void 0:p.classNames)==null?void 0:c.actionButton)},p.action.label):null))};function mh(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function wR(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",l=i?fR:dR;function a(u){["top","right","bottom","left"].forEach(d=>{n[`${s}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?a(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=l:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):a(l)}),n}var xR=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:l,offset:a,mobileOffset:u,theme:d="light",richColors:c,duration:h,style:p,visibleToasts:E=cR,toastOptions:y,dir:x=mh(),gap:m=hR,loadingIcon:g,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[b,P]=R.useState([]),T=R.useMemo(()=>Array.from(new Set([r].concat(b.filter(F=>F.position).map(F=>F.position)))),[b,r]),[j,A]=R.useState([]),[z,D]=R.useState(!1),[K,L]=R.useState(!1),[Y,U]=R.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=R.useRef(null),M=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=R.useRef(null),I=R.useRef(!1),B=R.useCallback(F=>{P(G=>{var X;return(X=G.find(fe=>fe.id===F.id))!=null&&X.delete||Ke.dismiss(F.id),G.filter(({id:fe})=>fe!==F.id)})},[]);return R.useEffect(()=>Ke.subscribe(F=>{if(F.dismiss){P(G=>G.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{Vm.flushSync(()=>{P(G=>{let X=G.findIndex(fe=>fe.id===F.id);return X!==-1?[...G.slice(0,X),{...G[X],...F},...G.slice(X+1)]:[F,...G]})})})}),[]),R.useEffect(()=>{if(d!=="system"){U(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:G})=>{U(G?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(fe){console.error(fe)}})}},[d]),R.useEffect(()=>{b.length<=1&&D(!1)},[b]),R.useEffect(()=>{let F=G=>{var X,fe;o.every(ye=>G[ye]||G.code===ye)&&(D(!0),(X=H.current)==null||X.focus()),G.code==="Escape"&&(document.activeElement===H.current||(fe=H.current)!=null&&fe.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),R.useEffect(()=>{if(H.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,I.current=!1)}},[H.current]),R.createElement("section",{ref:t,"aria-label":`${S} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((F,G)=>{var X;let[fe,ye]=F.split("-");return b.length?R.createElement("ol",{key:F,dir:x==="auto"?mh():x,tabIndex:-1,ref:H,className:l,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":fe,"data-lifted":z&&b.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((X=j[0])==null?void 0:X.height)||0}px`,"--width":`${pR}px`,"--gap":`${m}px`,...p,...wR(a,u)},onBlur:J=>{I.current&&!J.currentTarget.contains(J.relatedTarget)&&(I.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||I.current||(I.current=!0,k.current=J.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{K||D(!1)},onDragEnd:()=>D(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},b.filter(J=>!J.position&&G===0||J.position===F).map((J,Kt)=>{var Pe,At;return R.createElement(yR,{key:J.id,icons:w,index:Kt,toast:J,defaultRichColors:c,duration:(Pe=y==null?void 0:y.duration)!=null?Pe:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:E,closeButton:(At=y==null?void 0:y.closeButton)!=null?At:s,interacting:K,position:F,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:B,toasts:b.filter(pn=>pn.position==J.position),heights:j.filter(pn=>pn.position==J.position),setHeights:A,expandByDefault:i,gap:m,loadingIcon:g,expanded:z,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const SR=({...e})=>{const{theme:t="system"}=KS();return v.jsx(xR,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var ER=Symbol("radix.slottable");function CR(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ER,t}var[la]=_r("Tooltip",[Zl]),Yd=Zl(),Xw="TooltipProvider",bR=700,vh="tooltip.open",[PR,Jw]=la(Xw),Zw=e=>{const{__scopeTooltip:t,delayDuration:n=bR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),l=f.useRef(!1),a=f.useRef(0);return f.useEffect(()=>{const u=a.current;return()=>window.clearTimeout(u)},[]),v.jsx(PR,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(a.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};Zw.displayName=Xw;var e0="Tooltip",[WN,aa]=la(e0),wc="TooltipTrigger",_R=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=aa(wc,n),i=Jw(wc,n),s=Yd(n),l=f.useRef(null),a=Re(t,l,o.onTriggerChange),u=f.useRef(!1),d=f.useRef(!1),c=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),v.jsx(fy,{asChild:!0,...s,children:v.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:a,onPointerMove:V(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});_R.displayName=wc;var kR="TooltipPortal",[HN,TR]=la(kR,{forceMount:void 0}),Ro="TooltipContent",t0=f.forwardRef((e,t)=>{const n=TR(Ro,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=aa(Ro,e.__scopeTooltip);return v.jsx(kr,{present:r||s.open,children:s.disableHoverableContent?v.jsx(n0,{side:o,...i,ref:t}):v.jsx(RR,{side:o,...i,ref:t})})}),RR=f.forwardRef((e,t)=>{const n=aa(Ro,e.__scopeTooltip),r=Jw(Ro,e.__scopeTooltip),o=f.useRef(null),i=Re(t,o),[s,l]=f.useState(null),{trigger:a,onClose:u}=n,d=o.current,{onPointerInTransitChange:c}=r,h=f.useCallback(()=>{l(null),c(!1)},[c]),p=f.useCallback((E,y)=>{const x=E.currentTarget,m={x:E.clientX,y:E.clientY},g=jR(m,x.getBoundingClientRect()),w=IR(m,g),S=LR(y.getBoundingClientRect()),C=$R([...w,...S]);l(C),c(!0)},[c]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(a&&d){const E=x=>p(x,d),y=x=>p(x,a);return a.addEventListener("pointerleave",E),d.addEventListener("pointerleave",y),()=>{a.removeEventListener("pointerleave",E),d.removeEventListener("pointerleave",y)}}},[a,d,p,h]),f.useEffect(()=>{if(s){const E=y=>{const x=y.target,m={x:y.clientX,y:y.clientY},g=(a==null?void 0:a.contains(x))||(d==null?void 0:d.contains(x)),w=!DR(m,s);g?h():w&&(h(),u())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[a,d,s,u,h]),v.jsx(n0,{...e,ref:i})}),[NR,MR]=la(e0,{isInside:!1}),OR=CR("TooltipContent"),n0=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=e,a=aa(Ro,n),u=Yd(n),{onClose:d}=a;return f.useEffect(()=>(document.addEventListener(vh,d),()=>document.removeEventListener(vh,d)),[d]),f.useEffect(()=>{if(a.trigger){const c=h=>{const p=h.target;p!=null&&p.contains(a.trigger)&&d()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[a.trigger,d]),v.jsx(Gl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c=>c.preventDefault(),onDismiss:d,children:v.jsxs(py,{"data-state":a.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(OR,{children:r}),v.jsx(NR,{scope:n,isInside:!0,children:v.jsx(bT,{id:a.contentId,role:"tooltip",children:o||r})})]})})});t0.displayName=Ro;var r0="TooltipArrow",AR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Yd(n);return MR(r0,n).isInside?null:v.jsx(hy,{...o,...r,ref:t})});AR.displayName=r0;function jR(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function IR(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function LR(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function DR(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=h>r&&n<(c-u)*(r-d)/(h-d)+u&&(o=!o)}return o}function $R(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),FR(t)}function FR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var zR=Zw,o0=t0;const UR=zR,BR=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(o0,{ref:r,sideOffset:t,className:Ne("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));BR.displayName=o0.displayName;function VR(){const{pathname:e,search:t,hash:n}=dn();f.useEffect(()=>{n||window.scrollTo(0,0)},[e,t,n])}const WR="cronAdminToken";function HR(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(WR))==null?void 0:e.trim())??""}const KR=`${Cd()}/api/v1`,yh=!1;class qR{constructor(t=KR){of(this,"baseUrl");this.baseUrl=t}async request(t,n){const r=`${this.baseUrl}${t}`;try{const{headers:o,...i}=n??{},s=HR(),a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",u=await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:{"Content-Type":"application/json",...s?{"X-Admin-Token":s}:{},...o}});if(!u.ok){const c=await u.text();console.error("[API] Error response:",c),u.status===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"));const h=new Error(`API request failed: ${u.status} ${u.statusText}`);throw h.status=u.status,h.statusText=u.statusText,h.response=c,h}return u.status===204?void 0:await u.json()}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}async getPapers(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir),t!=null&&t.time&&n.append("time",t.time),t!=null&&t.published_after&&n.append("published_after",t.published_after),t!=null&&t.published_before&&n.append("published_before",t.published_before),t!=null&&t.conference&&n.append("conference",t.conference),(t==null?void 0:t.latest_only)!==void 0&&n.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&n.append("include_resources",t.include_resources.toString());const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(t,n=1,r=10,o){const i=new URLSearchParams;return i.append("q",t),i.append("page",n.toString()),i.append("page_size",r.toString()),o&&i.append("mode",o),this.request(`/papers/search?${i.toString()}`)}async getPaper(t,n=!0){const r=`/papers/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getPaperByArxivId(t,n=!0){const r=`/papers/arxiv/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getRelatedPapers(t,n=4){const r=new URLSearchParams({limit:n.toString()});return this.request(`/papers/${encodeURIComponent(t)}/related?${r.toString()}`)}async indexPaperFromArxiv(t){const n=`/papers/index/${t}`;return this.request(n,{method:"POST"})}async submitPaper(t){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(t)})}async updatePaperTasks(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("task_ids",i.toString()));const o=`/papers/${t}/tasks?${r.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperMethods(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("method_ids",i.toString()));const o=`/papers/${t}/methods?${r.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperRepositories(t,n){const r=`/papers/${t}/repositories`;return this.request(r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(t,n){const r=`/papers/${t}/project-pages`;return this.request(r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(t,n){const r=`/papers/${t}/source-url`;return this.request(r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(t,n){const r=`/papers/${t}/hf-artifacts`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async getTrendingPapers(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.max_age_days&&n.append("max_age_days",t.max_age_days.toString()),(t==null?void 0:t.min_velocity)!==void 0&&n.append("min_velocity",t.min_velocity.toString());const r=`/papers/trending${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getRepositoriesForPaper(t){return this.request(`/papers/${t}/repositories`)}async getRepositories(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.owner&&n.append("owner",t.owner),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.min_stars&&n.append("min_stars",t.min_stars.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/repositories/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getProjectPagesForPaper(t){return this.request(`/papers/${t}/project-pages`)}async getProjectPages(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/project-pages/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthors(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.sort_by&&n.append("sort_by",t.sort_by),t!=null&&t.sort_order&&n.append("sort_order",t.sort_order);const r=`/authors${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthor(t){return this.request(`/authors/${t}`)}async getAreas(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/areas/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getArea(t){return this.request(`/areas/${t}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(t){return this.request(`/conferences/${t}`)}async getConferenceAreasWithTasks(t){return this.request(`/conferences/${t}/areas-with-tasks`)}async getConferencePapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.presentation&&r.append("presentation",n.presentation),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true");const o=r.toString(),i=o?`/conferences/${t}/papers?${o}`:`/conferences/${t}/papers`;return this.request(i)}async getOrganizations(){return this.request("/organizations/")}async getOrganization(t){return this.request(`/organizations/${t}`)}async getOrganizationAreasWithTasks(t){return this.request(`/organizations/${t}/areas-with-tasks`)}async getOrganizationPapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true");const o=r.toString(),i=o?`/organizations/${t}/papers?${o}`:`/organizations/${t}/papers`;return this.request(i)}async getAreaTasks(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/areas/${t}/tasks${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTasks(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.area_id&&n.append("area_id",t.area_id.toString()),t!=null&&t.parent_id&&n.append("parent_id",t.parent_id.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),t!=null&&t.visible_only&&n.append("visible_only","true"),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/tasks/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getTask(t){return this.request(`/tasks/${t}`)}async getTopTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString());const r=n.toString(),o=r?`/tasks/top?${r}`:"/tasks/top";return this.request(o)}async getTrendingTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.recent_days&&n.append("recent_days",t.recent_days.toString()),t!=null&&t.baseline_days&&n.append("baseline_days",t.baseline_days.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),(t==null?void 0:t.min_recent_papers)!==void 0&&n.append("min_recent_papers",t.min_recent_papers.toString()),(t==null?void 0:t.min_baseline_papers)!==void 0&&n.append("min_baseline_papers",t.min_baseline_papers.toString()),(t==null?void 0:t.min_share_lift)!==void 0&&n.append("min_share_lift",t.min_share_lift.toString());const r=n.toString(),o=r?`/tasks/trending?${r}`:"/tasks/trending";return this.request(o)}async getTaskChildren(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.visible_only&&r.append("visible_only","true");const o=`/tasks/${t}/children${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTaskParents(t){return this.request(`/tasks/${t}/parents`)}async getTaskPage(t,n){const r=new URLSearchParams;(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=`/tasks/${t}/page${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(t,n){const r=new URLSearchParams;(n==null?void 0:n.limit)!==void 0&&r.append("limit",n.limit.toString()),(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.min_recent_papers)!==void 0&&r.append("min_recent_papers",n.min_recent_papers.toString()),(n==null?void 0:n.include_descendants)!==void 0&&r.append("include_descendants",n.include_descendants.toString()),(n==null?void 0:n.bucket_days)!==void 0&&r.append("bucket_days",n.bucket_days.toString()),(n==null?void 0:n.history_buckets)!==void 0&&r.append("history_buckets",n.history_buckets.toString()),(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=r.toString(),i=`/tasks/${encodeURIComponent(t)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(i)}async getTaskPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString());const o=r.toString(),i=o?`/tasks/${t}/papers?${o}`:`/tasks/${t}/papers`;return this.request(i)}async getMethods(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.introduced_year&&n.append("introduced_year",t.introduced_year.toString()),(t==null?void 0:t.area_id)!==void 0&&n.append("area_id",t.area_id.toString()),(t==null?void 0:t.exclude_id)!==void 0&&n.append("exclude_id",t.exclude_id.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/methods/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMethod(t){return this.request(`/methods/${encodeURIComponent(t)}`)}async getMethodPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString());const o=r.toString(),i=o?`/methods/${encodeURIComponent(t)}/papers?${o}`:`/methods/${encodeURIComponent(t)}/papers`;return this.request(i)}async getDatasets(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.task&&n.append("task",t.task),t!=null&&t.task_id&&n.append("task",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),(t==null?void 0:t.min_eval_count)!==void 0&&n.append("min_eval_count",t.min_eval_count.toString()),(t==null?void 0:t.is_open)!==void 0&&n.append("is_open",t.is_open.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/datasets/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getDataset(t){return this.request(`/datasets/${t}`)}async getDatasetBySlug(t,n){const r=new URLSearchParams;n!=null&&n.include_paper&&r.set("include_paper","true"),n!=null&&n.task&&r.set("task",n.task),(n==null?void 0:n.is_open)!==void 0&&r.set("is_open",String(n.is_open));const o=r.size?`?${r.toString()}`:"";return this.request(`/datasets/${t}${o}`)}async getDatasetTasks(t){return(await this.request(`/datasets/${t}/tasks/`)).results}async getLeaderboardMetrics(t,n){return(await this.request(`/datasets/${t}/tasks/${n}/metrics`)).metrics}async getEvaluations(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.task_id&&n.append("task_id",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),t!=null&&t.dataset_id&&n.append("dataset_id",t.dataset_id.toString()),t!=null&&t.best_metric&&n.append("best_metric",t.best_metric),(t==null?void 0:t.external)!==void 0&&n.append("external",String(t.external)),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/evaluations/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getEvaluation(t){return this.request(`/evaluations/${t}`)}async getEvaluationsByPaper(t){const r=parseInt(t),o=await this.getEvaluations({paper_id:r,page_size:100,ordering:"-benchmark_popularity"}),i=[...o.results];let s=o.next_page;for(;s;){const l=await this.getEvaluations({paper_id:r,page:s,page_size:100,ordering:"-benchmark_popularity"});i.push(...l.results),s=l.next_page}return i}async getEvaluationsByDataset(t,n){const o=parseInt(t),i=await this.getEvaluations({dataset_id:o,best_metric:n,page_size:100,ordering:"best_rank"}),s=[...i.results];let l=i.next_page;for(;l;){const a=await this.getEvaluations({dataset_id:o,best_metric:n,page:l,page_size:100,ordering:"best_rank"});s.push(...a.results),l=a.next_page}return s}async createEvaluation(t){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(t)})}async updateEvaluation(t,n){const r=`/evaluations/${t}`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async deleteEvaluation(t){const n=`/evaluations/${t}`;return this.request(n,{method:"DELETE"})}async generateThumbnail(t){const n=io(`/api/thumbnails/generate/${t}`),r=await fetch(n,{method:"POST"});if(!r.ok)throw new Error(`Thumbnail generation failed: ${r.status}`);return await r.json()}async getThumbnailStatus(t){const n=io(`/api/thumbnails/status/${t}`),r=await fetch(n);if(!r.ok)throw new Error(`Thumbnail status check failed: ${r.status}`);return await r.json()}async healthCheck(){const t=io("/health"),n=await fetch(t);if(!n.ok)throw new Error(`Health check failed: ${n.status}`);return await n.json()}async getMetrics(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.direction&&n.append("direction",t.direction),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/metrics/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMetric(t){return this.request(`/metrics/${t}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(t){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(t)})}async listPendingPaperEdits(t){const n=new URLSearchParams;t!=null&&t.status&&n.append("status",t.status),t!=null&&t.edit_type&&n.append("edit_type",t.edit_type),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString());const r=`/admin/paper-edits${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getPendingPaperEdit(t){return this.request(`/admin/paper-edits/${t}`)}async approvePendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/approve`,{method:"POST",body:JSON.stringify(n??{})})}async rejectPendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/reject`,{method:"POST",body:JSON.stringify(n??{})})}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"POST"})}async removeBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"DELETE"})}async getMyPreferences(){return this.request("/me/preferences")}async updateMyPreferences(t){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(t)})}async getCronStatus(){return this.request("/cron/status",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}}const _=new qR;_.getPapers.bind(_);const KN=_.getPaper.bind(_);_.getPaperByArxivId.bind(_);const qN=_.indexPaperFromArxiv.bind(_),GN=_.submitPaper.bind(_),QN=_.updatePaperTasks.bind(_),YN=_.updatePaperMethods.bind(_),XN=_.updatePaperRepositories.bind(_),JN=_.updatePaperProjectPages.bind(_),ZN=_.updatePaperSourceUrl.bind(_);_.updatePaperHfArtifacts.bind(_);_.getTrendingPapers.bind(_);_.getRepositoriesForPaper.bind(_);_.getRepositories.bind(_);_.getProjectPagesForPaper.bind(_);_.getProjectPages.bind(_);_.getAuthors.bind(_);_.getAuthor.bind(_);_.getAreas.bind(_);_.getArea.bind(_);_.getAreasWithTasks.bind(_);_.getConferences.bind(_);_.getConferenceDeadlines.bind(_);_.getConference.bind(_);_.getConferenceAreasWithTasks.bind(_);_.getConferencePapers.bind(_);_.getOrganizations.bind(_);_.getOrganization.bind(_);_.getOrganizationAreasWithTasks.bind(_);_.getOrganizationPapers.bind(_);_.getAreaTasks.bind(_);const eM=_.getTasks.bind(_),tM=_.getTask.bind(_);_.getTopTasks.bind(_);_.getTrendingTasks.bind(_);_.getTaskChildren.bind(_);_.getTaskParents.bind(_);_.getTaskPage.bind(_);_.getTaskPapers.bind(_);const nM=_.getMethods.bind(_),rM=_.getMethod.bind(_);_.getMethodPapers.bind(_);const oM=_.getDatasets.bind(_),iM=_.getDataset.bind(_);_.getDatasetBySlug.bind(_);_.getDatasetTasks.bind(_);const sM=_.getLeaderboardMetrics.bind(_);_.getEvaluations.bind(_);_.getEvaluation.bind(_);const lM=_.getEvaluationsByPaper.bind(_);_.getEvaluationsByDataset.bind(_);const aM=_.createEvaluation.bind(_),uM=_.updateEvaluation.bind(_),cM=_.deleteEvaluation.bind(_);_.generateThumbnail.bind(_);_.getThumbnailStatus.bind(_);_.getMetrics.bind(_);_.getMetric.bind(_);_.getMetricDirections.bind(_);_.getResearchTrends.bind(_);_.healthCheck.bind(_);_.getMyBookmarkIds.bind(_);_.getMyBookmarks.bind(_);_.addBookmark.bind(_);_.getMyPreferences.bind(_);_.updateMyPreferences.bind(_);const dM=_.submitPendingPaperEdit.bind(_),fM=_.listPendingPaperEdits.bind(_);_.getPendingPaperEdit.bind(_);const pM=_.approvePendingPaperEdit.bind(_),hM=_.rejectPendingPaperEdit.bind(_);_.removeBookmark.bind(_);const ru={hide_closed_source_evals:!1},i0=R.createContext(null),GR=({children:e})=>{const{user:t}=Kd(),[n,r]=R.useState(ru),[o,i]=R.useState(!1);R.useEffect(()=>{let a=!1;if(!t){r(ru);return}return i(!0),_.getMyPreferences().then(u=>{a||r(u)}).catch(()=>{a||r(ru)}).finally(()=>{a||i(!1)}),()=>{a=!0}},[t]);const s=R.useCallback(async a=>{const u={...n,hide_closed_source_evals:a};if(r(u),!!t)try{const d=await _.updateMyPreferences(u);r(d)}catch{r(n)}},[n,t]),l=R.useMemo(()=>({preferences:n,canPersist:!!t,isLoading:o,setHideClosedSourceEvals:s}),[n,t,o,s]);return v.jsx(i0.Provider,{value:l,children:e})};function gM(){const e=R.useContext(i0);if(!e)throw new Error("usePreferences must be used inside a ");return e}const s0=OE(),QR=s0?X1:Y1;if(!s0&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const YR=R.lazy(()=>ue(()=>import("./FeedView-BioyKnFQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),XR=R.lazy(()=>ue(()=>import("./ChatView-BMNQRO1E.js"),__vite__mapDeps([14,6,3,4,15,16,17]))),JR=R.lazy(()=>ue(()=>import("./PapersListView-BO6EFz71.js"),__vite__mapDeps([18,1,2,3,4,5,7,8,9,19,11,10,12,13]))),ZR=R.lazy(()=>ue(()=>import("./PaperDetailView-B7xj9C7Q.js"),__vite__mapDeps([20,8,1,2,3,4,5,21,15,22,7,9,12,13,23,24,25,26,27,28,29,30,31,16]))),eN=R.lazy(()=>ue(()=>import("./TagsIndexView-Coa5ZifW.js"),__vite__mapDeps([32,8,5,12,13,33,28,23,25,26,27,29]))),tN=R.lazy(()=>ue(()=>import("./TagBrowseView-BHDwjPvv.js"),__vite__mapDeps([34,8,1,2,3,4,5,35,36,16,17,7,9,10,12,13,37,31]))),nN=R.lazy(()=>ue(()=>import("./MethodsIndexView-BcMT_V5E.js"),__vite__mapDeps([38,8,12,13,33,28,23,25,26,27,29]))),rN=R.lazy(()=>ue(()=>import("./FrameworksIndexView-Bt1QXuSZ.js"),__vite__mapDeps([39,1,2,3,4,5]))),oN=R.lazy(()=>ue(()=>import("./TrendsView-bBL_-M78.js"),__vite__mapDeps([40,8,13,12]))),iN=R.lazy(()=>ue(()=>import("./ConferencesIndexView-C2rc9N0P.js"),__vite__mapDeps([41,8,12,13,33,28,23,25,26,27,29]))),sN=R.lazy(()=>ue(()=>import("./AiDeadlinesView-M2ihfYd-.js"),__vite__mapDeps([42,8,43,24,12,13,26]))),lN=R.lazy(()=>ue(()=>import("./ConferenceDetailView-hzsHLbhD.js"),__vite__mapDeps([44,8,36,3,4,16,17,5,12,13]))),aN=R.lazy(()=>ue(()=>import("./ConferenceTaskView-Bbye1dhE.js"),__vite__mapDeps([45,8,1,2,3,4,5,36,16,17,7,9,10,12,13]))),uN=R.lazy(()=>ue(()=>import("./OrganizationsIndexView-6mCxurDk.js"),__vite__mapDeps([46,8,12,13]))),cN=R.lazy(()=>ue(()=>import("./OrganizationDetailView-Cm6pGlQi.js"),__vite__mapDeps([47,8,36,3,4,16,17,5,12,13,48]))),dN=R.lazy(()=>ue(()=>import("./OrganizationTaskView-Bysl0j3X.js"),__vite__mapDeps([49,8,1,2,3,4,5,7,9,10,12,13,48]))),fN=R.lazy(()=>ue(()=>import("./MethodDetailView-U8lMdR1i.js"),__vite__mapDeps([50,8,9,1,2,3,4,5,36,16,17,10,12,13]))),pN=R.lazy(()=>ue(()=>import("./BenchmarkDetailView-CFx9rlgB.js"),__vite__mapDeps([51,8,12,43,24,13,2,3,4,1,5,21,15,35]))),hN=R.lazy(()=>ue(()=>import("./SavedPapersView-D3n8Gad0.js"),__vite__mapDeps([52,8,1,2,3,4,5,12,13]))),gN=R.lazy(()=>ue(()=>import("./SettingsView-CkIvxrcP.js"),__vite__mapDeps([53,43,24,22]))),mN=R.lazy(()=>ue(()=>import("./SubmitView-CTzPaVJS.js"),__vite__mapDeps([54,27,13,23,25]))),vN=R.lazy(()=>ue(()=>import("./CronDashboard-Clvh_kJa.js"),__vite__mapDeps([55,8,30,23,37,56,29,57]))),yN=R.lazy(()=>ue(()=>import("./SubmissionsDashboard-Dep2ppOa.js"),__vite__mapDeps([58,8,27,56,29]))),wN=R.lazy(()=>ue(()=>import("./NotFound-qaYOxGzN.js"),[])),xN=R.lazy(()=>ue(()=>import("./SearchOverlay-BcJrWg54.js"),__vite__mapDeps([59,8,2,3,4,19,5]))),SN=()=>v.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),v.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),EN=new NE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),CN=()=>{const{arxivId:e}=xd();return v.jsx(Gn,{to:e?`/paper/${e}`:"/papers",replace:!0})},bN=()=>{const{taskSlug:e}=xd();return v.jsx(Gn,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},wh=()=>{const{orgSlug:e,taskSlug:t}=xd();return e?v.jsx(Gn,{to:t?`/${e}/${t}`:`/${e}`,replace:!0}):v.jsx(Gn,{to:"/organizations",replace:!0})},xh=({element:e})=>Hi()?v.jsx(Gn,{to:"/",replace:!0}):v.jsx(v.Fragment,{children:e}),PN=({element:e})=>{const{user:t,isLoading:n}=Kd();return Hi()?v.jsx(Gn,{to:"/",replace:!0}):n?v.jsx("div",{className:"page",children:v.jsx("div",{className:"submission-loading",children:v.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?v.jsx(v.Fragment,{children:e}):v.jsx("div",{className:"page",children:v.jsxs("div",{className:"submission-empty submission-empty-warn",children:[v.jsx("h1",{children:"Admin access required"}),v.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):v.jsx("div",{className:"page",children:v.jsxs("div",{className:"submission-empty submission-empty-warn",children:[v.jsx("h1",{children:"Sign in required"}),v.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),v.jsx(gv,{returnTo:"/admin-dashboard"})]})})},_N=()=>{const[e,t]=R.useState(!1);return VR(),R.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="k"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),v.jsxs(v.Fragment,{children:[v.jsx(gT,{onOpenSearch:()=>t(!0)}),v.jsx("main",{children:v.jsx(R.Suspense,{fallback:v.jsx(SN,{}),children:v.jsxs(U1,{children:[v.jsx(ne,{path:"/",element:v.jsx(YR,{})}),v.jsx(ne,{path:"/chat/:sessionId?",element:hv()?v.jsx(XR,{}):v.jsx(Gn,{to:"/",replace:!0})}),v.jsx(ne,{path:"/papers",element:v.jsx(JR,{})}),v.jsx(ne,{path:"/papers/:arxivId",element:v.jsx(CN,{})}),v.jsx(ne,{path:"/paper/:arxivId",element:v.jsx(ZR,{})}),v.jsx(ne,{path:"/tasks",element:v.jsx(eN,{})}),v.jsx(ne,{path:"/tasks/:taskSlug",element:v.jsx(tN,{})}),v.jsx(ne,{path:"/task/:taskSlug",element:v.jsx(bN,{})}),v.jsx(ne,{path:"/methods",element:v.jsx(nN,{})}),v.jsx(ne,{path:"/methods/:methodSlug",element:v.jsx(fN,{})}),v.jsx(ne,{path:"/frameworks",element:v.jsx(rN,{})}),v.jsx(ne,{path:"/trends",element:v.jsx(oN,{})}),v.jsx(ne,{path:"/conferences",element:v.jsx(iN,{})}),v.jsx(ne,{path:"/ai-deadlines",element:v.jsx(sN,{})}),v.jsx(ne,{path:"/conferences/:confSlug",element:v.jsx(lN,{})}),v.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:v.jsx(aN,{})}),v.jsx(ne,{path:"/organizations",element:v.jsx(uN,{})}),v.jsx(ne,{path:"/organizations/:orgSlug",element:v.jsx(wh,{})}),v.jsx(ne,{path:"/organizations/:orgSlug/:taskSlug",element:v.jsx(wh,{})}),v.jsx(ne,{path:"/benchmark/:datasetSlug",element:v.jsx(pN,{})}),v.jsx(ne,{path:"/submit",element:v.jsx(mN,{})}),v.jsx(ne,{path:"/saved",element:v.jsx(xh,{element:v.jsx(hN,{})})}),v.jsx(ne,{path:"/settings",element:v.jsx(gN,{})}),v.jsx(ne,{path:"/admin-dashboard",element:v.jsx(PN,{element:v.jsx(vN,{})})}),v.jsx(ne,{path:"/cron-dashboard",element:v.jsx(Gn,{to:"/admin-dashboard",replace:!0})}),v.jsx(ne,{path:"/submissions",element:v.jsx(xh,{element:v.jsx(yN,{})})}),v.jsx(ne,{path:"/:orgSlug",element:v.jsx(cN,{})}),v.jsx(ne,{path:"/:orgSlug/:taskSlug",element:v.jsx(dN,{})}),v.jsx(ne,{path:"*",element:v.jsx(wN,{})})]})})}),e&&v.jsx(R.Suspense,{fallback:null,children:v.jsx(xN,{open:e,onClose:()=>t(!1)})})]})},kN=()=>v.jsx(ME,{client:EN,children:v.jsx(fT,{children:v.jsx(GR,{children:v.jsxs(UR,{children:[v.jsx(QR,{children:v.jsx(_N,{})}),v.jsx(qT,{}),v.jsx(SR,{}),!1]})})})}),TN=Wm(document.getElementById("root"));TN.render(v.jsx(R.StrictMode,{children:v.jsx(qS,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:v.jsx(kN,{})})}));export{zN as $,XN as A,JN as B,Zk as C,ZN as D,Pr as E,OP as F,lc as G,fy as H,Zl as I,$d as J,o_ as K,zr as L,Ry as M,ub as N,Vv as O,kr as P,Gl as Q,R,py as S,hy as T,oM as U,cM as V,aM as W,nT as X,uM as Y,sM as Z,Hi as _,wd as a,gM as a0,rT as a1,oT as a2,bw as a3,Cn as a4,UN as a5,qN as a6,vt as a7,Rd as a8,Fv as a9,$v as aA,pM as aB,hM as aC,fM as aD,Mi as aE,kE as aF,jN as aG,dn as aH,yE as aI,dE as aJ,tc as aK,lv as aL,uE as aM,cE as aN,ec as aO,ov as aP,PE as aQ,hE as aR,vv as aa,VT as ab,gv as ac,BN as ad,AN as ae,NN as af,Nh as ag,LN as ah,IN as ai,KS as aj,GN as ak,qP as al,GP as am,my as an,FN as ao,ql as ap,Ue as aq,ON as ar,iv as as,bt as at,tM as au,rM as av,iM as aw,KN as ax,Lv as ay,Dv as az,_ as b,$N as c,io as d,xd as e,Kd as f,oa as g,lM as h,hv as i,v as j,ve as k,kd as l,Re as m,V as n,PP as o,_r as p,Ne as q,f as r,DN as s,ST as t,MN as u,dM as v,QN as w,eM as x,YN as y,nM as z}; +`);function _s(e){return e.label!==void 0}var cR=3,dR="32px",fR="16px",gh=4e3,pR=356,hR=14,gR=20,mR=200;function Et(...e){return e.filter(Boolean).join(" ")}function vR(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var yR=e=>{var t,n,r,o,i,s,l,a,u,d,c;let{invert:h,toast:p,unstyled:E,interacting:y,setHeights:x,visibleToasts:m,heights:g,index:w,toasts:S,expanded:C,removeToast:b,defaultRichColors:P,closeButton:T,style:j,cancelButtonStyle:A,actionButtonStyle:z,className:D="",descriptionClassName:K="",duration:L,position:Y,gap:U,loadingIcon:H,expandByDefault:M,classNames:k,icons:I,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:F}=e,[G,X]=R.useState(null),[fe,ye]=R.useState(null),[J,Kt]=R.useState(!1),[Pe,At]=R.useState(!1),[pn,Nr]=R.useState(!1),[hn,Xi]=R.useState(!1),[ua,Ji]=R.useState(!1),[ca,Do]=R.useState(0),[Mr,Xd]=R.useState(0),$o=R.useRef(p.duration||L||gh),Jd=R.useRef(null),er=R.useRef(null),l0=w===0,a0=w+1<=m,at=p.type,Or=p.dismissible!==!1,u0=p.className||"",c0=p.descriptionClassName||"",Zi=R.useMemo(()=>g.findIndex(q=>q.toastId===p.id)||0,[g,p.id]),d0=R.useMemo(()=>{var q;return(q=p.closeButton)!=null?q:T},[p.closeButton,T]),Zd=R.useMemo(()=>p.duration||L||gh,[p.duration,L]),da=R.useRef(0),Ar=R.useRef(0),ef=R.useRef(0),jr=R.useRef(null),[f0,p0]=Y.split("-"),tf=R.useMemo(()=>g.reduce((q,oe,ce)=>ce>=Zi?q:q+oe.height,0),[g,Zi]),nf=nR(),h0=p.invert||h,fa=at==="loading";Ar.current=R.useMemo(()=>Zi*U+tf,[Zi,tf]),R.useEffect(()=>{$o.current=Zd},[Zd]),R.useEffect(()=>{Kt(!0)},[]),R.useEffect(()=>{let q=er.current;if(q){let oe=q.getBoundingClientRect().height;return Xd(oe),x(ce=>[{toastId:p.id,height:oe,position:p.position},...ce]),()=>x(ce=>ce.filter(yt=>yt.toastId!==p.id))}},[x,p.id]),R.useLayoutEffect(()=>{if(!J)return;let q=er.current,oe=q.style.height;q.style.height="auto";let ce=q.getBoundingClientRect().height;q.style.height=oe,Xd(ce),x(yt=>yt.find(wt=>wt.toastId===p.id)?yt.map(wt=>wt.toastId===p.id?{...wt,height:ce}:wt):[{toastId:p.id,height:ce,position:p.position},...yt])},[J,p.title,p.description,x,p.id]);let gn=R.useCallback(()=>{At(!0),Do(Ar.current),x(q=>q.filter(oe=>oe.toastId!==p.id)),setTimeout(()=>{b(p)},mR)},[p,b,x,Ar]);R.useEffect(()=>{if(p.promise&&at==="loading"||p.duration===1/0||p.type==="loading")return;let q;return C||y||F&&nf?(()=>{if(ef.current{var oe;(oe=p.onAutoClose)==null||oe.call(p,p),gn()},$o.current)),()=>clearTimeout(q)},[C,y,p,at,F,nf,gn]),R.useEffect(()=>{p.delete&&gn()},[gn,p.delete]);function g0(){var q,oe,ce;return I!=null&&I.loading?R.createElement("div",{className:Et(k==null?void 0:k.loader,(q=p==null?void 0:p.classNames)==null?void 0:q.loader,"sonner-loader"),"data-visible":at==="loading"},I.loading):H?R.createElement("div",{className:Et(k==null?void 0:k.loader,(oe=p==null?void 0:p.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":at==="loading"},H):R.createElement(YT,{className:Et(k==null?void 0:k.loader,(ce=p==null?void 0:p.classNames)==null?void 0:ce.loader),visible:at==="loading"})}return R.createElement("li",{tabIndex:0,ref:er,className:Et(D,u0,k==null?void 0:k.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[at],(n=p==null?void 0:p.classNames)==null?void 0:n[at]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:P,"data-styled":!(p.jsx||p.unstyled||E),"data-mounted":J,"data-promise":!!p.promise,"data-swiped":ua,"data-removed":Pe,"data-visible":a0,"data-y-position":f0,"data-x-position":p0,"data-index":w,"data-front":l0,"data-swiping":pn,"data-dismissible":Or,"data-type":at,"data-invert":h0,"data-swipe-out":hn,"data-swipe-direction":fe,"data-expanded":!!(C||M&&J),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${Pe?ca:Ar.current}px`,"--initial-height":M?"auto":`${Mr}px`,...j,...p.style},onDragEnd:()=>{Nr(!1),X(null),jr.current=null},onPointerDown:q=>{fa||!Or||(Jd.current=new Date,Do(Ar.current),q.target.setPointerCapture(q.pointerId),q.target.tagName!=="BUTTON"&&(Nr(!0),jr.current={x:q.clientX,y:q.clientY}))},onPointerUp:()=>{var q,oe,ce,yt;if(hn||!Or)return;jr.current=null;let wt=Number(((q=er.current)==null?void 0:q.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),mn=Number(((oe=er.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),tr=new Date().getTime()-((ce=Jd.current)==null?void 0:ce.getTime()),xt=G==="x"?wt:mn,vn=Math.abs(xt)/tr;if(Math.abs(xt)>=gR||vn>.11){Do(Ar.current),(yt=p.onDismiss)==null||yt.call(p,p),ye(G==="x"?wt>0?"right":"left":mn>0?"down":"up"),gn(),Xi(!0),Ji(!1);return}Nr(!1),X(null)},onPointerMove:q=>{var oe,ce,yt,wt;if(!jr.current||!Or||((oe=window.getSelection())==null?void 0:oe.toString().length)>0)return;let mn=q.clientY-jr.current.y,tr=q.clientX-jr.current.x,xt=(ce=e.swipeDirections)!=null?ce:vR(Y);!G&&(Math.abs(tr)>1||Math.abs(mn)>1)&&X(Math.abs(tr)>Math.abs(mn)?"x":"y");let vn={x:0,y:0};G==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&mn<0||xt.includes("bottom")&&mn>0)&&(vn.y=mn):G==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&tr<0||xt.includes("right")&&tr>0)&&(vn.x=tr),(Math.abs(vn.x)>0||Math.abs(vn.y)>0)&&Ji(!0),(yt=er.current)==null||yt.style.setProperty("--swipe-amount-x",`${vn.x}px`),(wt=er.current)==null||wt.style.setProperty("--swipe-amount-y",`${vn.y}px`)}},d0&&!p.jsx?R.createElement("button",{"aria-label":B,"data-disabled":fa,"data-close-button":!0,onClick:fa||!Or?()=>{}:()=>{var q;gn(),(q=p.onDismiss)==null||q.call(p,p)},className:Et(k==null?void 0:k.closeButton,(o=p==null?void 0:p.classNames)==null?void 0:o.closeButton)},(i=I==null?void 0:I.close)!=null?i:tR):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:R.createElement(R.Fragment,null,at||p.icon||p.promise?R.createElement("div",{"data-icon":"",className:Et(k==null?void 0:k.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||g0():null,p.type!=="loading"?p.icon||(I==null?void 0:I[at])||GT(at):null):null,R.createElement("div",{"data-content":"",className:Et(k==null?void 0:k.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},R.createElement("div",{"data-title":"",className:Et(k==null?void 0:k.title,(a=p==null?void 0:p.classNames)==null?void 0:a.title)},typeof p.title=="function"?p.title():p.title),p.description?R.createElement("div",{"data-description":"",className:Et(K,c0,k==null?void 0:k.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),f.isValidElement(p.cancel)?p.cancel:p.cancel&&_s(p.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:q=>{var oe,ce;_s(p.cancel)&&Or&&((ce=(oe=p.cancel).onClick)==null||ce.call(oe,q),gn())},className:Et(k==null?void 0:k.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&_s(p.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||z,onClick:q=>{var oe,ce;_s(p.action)&&((ce=(oe=p.action).onClick)==null||ce.call(oe,q),!q.defaultPrevented&&gn())},className:Et(k==null?void 0:k.actionButton,(c=p==null?void 0:p.classNames)==null?void 0:c.actionButton)},p.action.label):null))};function mh(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function wR(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",l=i?fR:dR;function a(u){["top","right","bottom","left"].forEach(d=>{n[`${s}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?a(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=l:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):a(l)}),n}var xR=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:l,offset:a,mobileOffset:u,theme:d="light",richColors:c,duration:h,style:p,visibleToasts:E=cR,toastOptions:y,dir:x=mh(),gap:m=hR,loadingIcon:g,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[b,P]=R.useState([]),T=R.useMemo(()=>Array.from(new Set([r].concat(b.filter(F=>F.position).map(F=>F.position)))),[b,r]),[j,A]=R.useState([]),[z,D]=R.useState(!1),[K,L]=R.useState(!1),[Y,U]=R.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=R.useRef(null),M=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=R.useRef(null),I=R.useRef(!1),B=R.useCallback(F=>{P(G=>{var X;return(X=G.find(fe=>fe.id===F.id))!=null&&X.delete||Ke.dismiss(F.id),G.filter(({id:fe})=>fe!==F.id)})},[]);return R.useEffect(()=>Ke.subscribe(F=>{if(F.dismiss){P(G=>G.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{Vm.flushSync(()=>{P(G=>{let X=G.findIndex(fe=>fe.id===F.id);return X!==-1?[...G.slice(0,X),{...G[X],...F},...G.slice(X+1)]:[F,...G]})})})}),[]),R.useEffect(()=>{if(d!=="system"){U(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:G})=>{U(G?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(fe){console.error(fe)}})}},[d]),R.useEffect(()=>{b.length<=1&&D(!1)},[b]),R.useEffect(()=>{let F=G=>{var X,fe;o.every(ye=>G[ye]||G.code===ye)&&(D(!0),(X=H.current)==null||X.focus()),G.code==="Escape"&&(document.activeElement===H.current||(fe=H.current)!=null&&fe.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[o]),R.useEffect(()=>{if(H.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,I.current=!1)}},[H.current]),R.createElement("section",{ref:t,"aria-label":`${S} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((F,G)=>{var X;let[fe,ye]=F.split("-");return b.length?R.createElement("ol",{key:F,dir:x==="auto"?mh():x,tabIndex:-1,ref:H,className:l,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":fe,"data-lifted":z&&b.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((X=j[0])==null?void 0:X.height)||0}px`,"--width":`${pR}px`,"--gap":`${m}px`,...p,...wR(a,u)},onBlur:J=>{I.current&&!J.currentTarget.contains(J.relatedTarget)&&(I.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||I.current||(I.current=!0,k.current=J.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{K||D(!1)},onDragEnd:()=>D(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},b.filter(J=>!J.position&&G===0||J.position===F).map((J,Kt)=>{var Pe,At;return R.createElement(yR,{key:J.id,icons:w,index:Kt,toast:J,defaultRichColors:c,duration:(Pe=y==null?void 0:y.duration)!=null?Pe:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:E,closeButton:(At=y==null?void 0:y.closeButton)!=null?At:s,interacting:K,position:F,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:B,toasts:b.filter(pn=>pn.position==J.position),heights:j.filter(pn=>pn.position==J.position),setHeights:A,expandByDefault:i,gap:m,loadingIcon:g,expanded:z,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const SR=({...e})=>{const{theme:t="system"}=KS();return v.jsx(xR,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var ER=Symbol("radix.slottable");function CR(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ER,t}var[la]=_r("Tooltip",[Zl]),Yd=Zl(),Xw="TooltipProvider",bR=700,vh="tooltip.open",[PR,Jw]=la(Xw),Zw=e=>{const{__scopeTooltip:t,delayDuration:n=bR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),l=f.useRef(!1),a=f.useRef(0);return f.useEffect(()=>{const u=a.current;return()=>window.clearTimeout(u)},[]),v.jsx(PR,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(a.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};Zw.displayName=Xw;var e0="Tooltip",[WN,aa]=la(e0),wc="TooltipTrigger",_R=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=aa(wc,n),i=Jw(wc,n),s=Yd(n),l=f.useRef(null),a=Re(t,l,o.onTriggerChange),u=f.useRef(!1),d=f.useRef(!1),c=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),v.jsx(fy,{asChild:!0,...s,children:v.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:a,onPointerMove:V(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});_R.displayName=wc;var kR="TooltipPortal",[HN,TR]=la(kR,{forceMount:void 0}),Ro="TooltipContent",t0=f.forwardRef((e,t)=>{const n=TR(Ro,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=aa(Ro,e.__scopeTooltip);return v.jsx(kr,{present:r||s.open,children:s.disableHoverableContent?v.jsx(n0,{side:o,...i,ref:t}):v.jsx(RR,{side:o,...i,ref:t})})}),RR=f.forwardRef((e,t)=>{const n=aa(Ro,e.__scopeTooltip),r=Jw(Ro,e.__scopeTooltip),o=f.useRef(null),i=Re(t,o),[s,l]=f.useState(null),{trigger:a,onClose:u}=n,d=o.current,{onPointerInTransitChange:c}=r,h=f.useCallback(()=>{l(null),c(!1)},[c]),p=f.useCallback((E,y)=>{const x=E.currentTarget,m={x:E.clientX,y:E.clientY},g=jR(m,x.getBoundingClientRect()),w=IR(m,g),S=LR(y.getBoundingClientRect()),C=$R([...w,...S]);l(C),c(!0)},[c]);return f.useEffect(()=>()=>h(),[h]),f.useEffect(()=>{if(a&&d){const E=x=>p(x,d),y=x=>p(x,a);return a.addEventListener("pointerleave",E),d.addEventListener("pointerleave",y),()=>{a.removeEventListener("pointerleave",E),d.removeEventListener("pointerleave",y)}}},[a,d,p,h]),f.useEffect(()=>{if(s){const E=y=>{const x=y.target,m={x:y.clientX,y:y.clientY},g=(a==null?void 0:a.contains(x))||(d==null?void 0:d.contains(x)),w=!DR(m,s);g?h():w&&(h(),u())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[a,d,s,u,h]),v.jsx(n0,{...e,ref:i})}),[NR,MR]=la(e0,{isInside:!1}),OR=CR("TooltipContent"),n0=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=e,a=aa(Ro,n),u=Yd(n),{onClose:d}=a;return f.useEffect(()=>(document.addEventListener(vh,d),()=>document.removeEventListener(vh,d)),[d]),f.useEffect(()=>{if(a.trigger){const c=h=>{const p=h.target;p!=null&&p.contains(a.trigger)&&d()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[a.trigger,d]),v.jsx(Gl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c=>c.preventDefault(),onDismiss:d,children:v.jsxs(py,{"data-state":a.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(OR,{children:r}),v.jsx(NR,{scope:n,isInside:!0,children:v.jsx(bT,{id:a.contentId,role:"tooltip",children:o||r})})]})})});t0.displayName=Ro;var r0="TooltipArrow",AR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Yd(n);return MR(r0,n).isInside?null:v.jsx(hy,{...o,...r,ref:t})});AR.displayName=r0;function jR(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function IR(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function LR(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function DR(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=h>r&&n<(c-u)*(r-d)/(h-d)+u&&(o=!o)}return o}function $R(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),FR(t)}function FR(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var zR=Zw,o0=t0;const UR=zR,BR=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(o0,{ref:r,sideOffset:t,className:Ne("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));BR.displayName=o0.displayName;function VR(){const{pathname:e,search:t,hash:n}=dn();f.useEffect(()=>{n||window.scrollTo(0,0)},[e,t,n])}const WR="cronAdminToken";function HR(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(WR))==null?void 0:e.trim())??""}const KR=`${Cd()}/api/v1`,yh=!1;class qR{constructor(t=KR){of(this,"baseUrl");this.baseUrl=t}async request(t,n){const r=`${this.baseUrl}${t}`;try{const{headers:o,...i}=n??{},s=HR(),a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",u=await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:{"Content-Type":"application/json",...s?{"X-Admin-Token":s}:{},...o}});if(!u.ok){const c=await u.text();console.error("[API] Error response:",c),u.status===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"));const h=new Error(`API request failed: ${u.status} ${u.statusText}`);throw h.status=u.status,h.statusText=u.statusText,h.response=c,h}return u.status===204?void 0:await u.json()}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}async getPapers(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir),t!=null&&t.time&&n.append("time",t.time),t!=null&&t.published_after&&n.append("published_after",t.published_after),t!=null&&t.published_before&&n.append("published_before",t.published_before),t!=null&&t.conference&&n.append("conference",t.conference),(t==null?void 0:t.latest_only)!==void 0&&n.append("latest_only",t.latest_only.toString()),(t==null?void 0:t.include_resources)!==void 0&&n.append("include_resources",t.include_resources.toString());const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(t,n=1,r=10,o){const i=new URLSearchParams;return i.append("q",t),i.append("page",n.toString()),i.append("page_size",r.toString()),o&&i.append("mode",o),this.request(`/papers/search?${i.toString()}`)}async getPaper(t,n=!0){const r=`/papers/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getPaperByArxivId(t,n=!0){const r=`/papers/arxiv/${t}${n?"?include_resources=true":""}`;return this.request(r)}async getRelatedPapers(t,n=4){const r=new URLSearchParams({limit:n.toString()});return this.request(`/papers/${encodeURIComponent(t)}/related?${r.toString()}`)}async indexPaperFromArxiv(t){const n=`/papers/index/${t}`;return this.request(n,{method:"POST"})}async submitPaper(t){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(t)})}async updatePaperTasks(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("task_ids",i.toString()));const o=`/papers/${t}/tasks?${r.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperMethods(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("method_ids",i.toString()));const o=`/papers/${t}/methods?${r.toString()}`;return this.request(o,{method:"PUT"})}async updatePaperRepositories(t,n){const r=`/papers/${t}/repositories`;return this.request(r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(t,n){const r=`/papers/${t}/project-pages`;return this.request(r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(t,n){const r=`/papers/${t}/source-url`;return this.request(r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(t,n){const r=`/papers/${t}/hf-artifacts`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async getTrendingPapers(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.max_age_days&&n.append("max_age_days",t.max_age_days.toString()),(t==null?void 0:t.min_velocity)!==void 0&&n.append("min_velocity",t.min_velocity.toString());const r=`/papers/trending${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getRepositoriesForPaper(t){return this.request(`/papers/${t}/repositories`)}async getRepositories(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.owner&&n.append("owner",t.owner),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.min_stars&&n.append("min_stars",t.min_stars.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/repositories/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getProjectPagesForPaper(t){return this.request(`/papers/${t}/project-pages`)}async getProjectPages(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.official_only&&n.append("official_only",t.official_only.toString()),t!=null&&t.source&&n.append("source",t.source),t!=null&&t.order_by&&n.append("order_by",t.order_by),t!=null&&t.order_dir&&n.append("order_dir",t.order_dir);const r=`/project-pages/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthors(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString()),t!=null&&t.search&&n.append("search",t.search),t!=null&&t.sort_by&&n.append("sort_by",t.sort_by),t!=null&&t.sort_order&&n.append("sort_order",t.sort_order);const r=`/authors${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getAuthor(t){return this.request(`/authors/${t}`)}async getAreas(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/areas/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getArea(t){return this.request(`/areas/${t}`)}async getAreasWithTasks(){return this.request("/areas/with-tasks/")}async getConferences(){return this.request("/conferences/")}async getConferenceDeadlines(){return this.request("/conferences/deadlines")}async getConference(t){return this.request(`/conferences/${t}`)}async getConferenceAreasWithTasks(t){return this.request(`/conferences/${t}/areas-with-tasks`)}async getConferencePapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.presentation&&r.append("presentation",n.presentation),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true");const o=r.toString(),i=o?`/conferences/${t}/papers?${o}`:`/conferences/${t}/papers`;return this.request(i)}async getOrganizations(){return this.request("/organizations/")}async getOrganization(t){return this.request(`/organizations/${t}`)}async getOrganizationAreasWithTasks(t){return this.request(`/organizations/${t}/areas-with-tasks`)}async getOrganizationPapers(t,n){const r=new URLSearchParams;n!=null&&n.task&&r.append("task",n.task),n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),n!=null&&n.include_resources&&r.append("include_resources","true");const o=r.toString(),i=o?`/organizations/${t}/papers?${o}`:`/organizations/${t}/papers`;return this.request(i)}async getAreaTasks(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString());const o=`/areas/${t}/tasks${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTasks(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.area_id&&n.append("area_id",t.area_id.toString()),t!=null&&t.parent_id&&n.append("parent_id",t.parent_id.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),t!=null&&t.visible_only&&n.append("visible_only","true"),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/tasks/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getTask(t){return this.request(`/tasks/${t}`)}async getTopTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString());const r=n.toString(),o=r?`/tasks/top?${r}`:"/tasks/top";return this.request(o)}async getTrendingTasks(t){const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.recent_days&&n.append("recent_days",t.recent_days.toString()),t!=null&&t.baseline_days&&n.append("baseline_days",t.baseline_days.toString()),(t==null?void 0:t.level)!==void 0&&n.append("level",t.level.toString()),(t==null?void 0:t.min_recent_papers)!==void 0&&n.append("min_recent_papers",t.min_recent_papers.toString()),(t==null?void 0:t.min_baseline_papers)!==void 0&&n.append("min_baseline_papers",t.min_baseline_papers.toString()),(t==null?void 0:t.min_share_lift)!==void 0&&n.append("min_share_lift",t.min_share_lift.toString());const r=n.toString(),o=r?`/tasks/trending?${r}`:"/tasks/trending";return this.request(o)}async getTaskChildren(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.visible_only&&r.append("visible_only","true");const o=`/tasks/${t}/children${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTaskParents(t){return this.request(`/tasks/${t}/parents`)}async getTaskPage(t,n){const r=new URLSearchParams;(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=`/tasks/${t}/page${r.toString()?`?${r.toString()}`:""}`;return this.request(o)}async getTrendingBenchmarks(t,n){const r=new URLSearchParams;(n==null?void 0:n.limit)!==void 0&&r.append("limit",n.limit.toString()),(n==null?void 0:n.recent_days)!==void 0&&r.append("recent_days",n.recent_days.toString()),(n==null?void 0:n.baseline_days)!==void 0&&r.append("baseline_days",n.baseline_days.toString()),(n==null?void 0:n.min_recent_papers)!==void 0&&r.append("min_recent_papers",n.min_recent_papers.toString()),(n==null?void 0:n.include_descendants)!==void 0&&r.append("include_descendants",n.include_descendants.toString()),(n==null?void 0:n.bucket_days)!==void 0&&r.append("bucket_days",n.bucket_days.toString()),(n==null?void 0:n.history_buckets)!==void 0&&r.append("history_buckets",n.history_buckets.toString()),(n==null?void 0:n.is_open)!==void 0&&r.append("is_open",n.is_open.toString());const o=r.toString(),i=`/tasks/${encodeURIComponent(t)}/trending-benchmarks${o?`?${o}`:""}`;return this.request(i)}async getTaskPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString());const o=r.toString(),i=o?`/tasks/${t}/papers?${o}`:`/tasks/${t}/papers`;return this.request(i)}async getMethods(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.introduced_year&&n.append("introduced_year",t.introduced_year.toString()),(t==null?void 0:t.area_id)!==void 0&&n.append("area_id",t.area_id.toString()),(t==null?void 0:t.exclude_id)!==void 0&&n.append("exclude_id",t.exclude_id.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/methods/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMethod(t){return this.request(`/methods/${encodeURIComponent(t)}`)}async getMethodPapers(t,n){const r=new URLSearchParams;n!=null&&n.page&&r.append("page",n.page.toString()),n!=null&&n.page_size&&r.append("page_size",n.page_size.toString()),n!=null&&n.order_by&&r.append("order_by",n.order_by),n!=null&&n.order_dir&&r.append("order_dir",n.order_dir),(n==null?void 0:n.latest_only)!==void 0&&r.append("latest_only",n.latest_only.toString()),(n==null?void 0:n.include_resources)!==void 0&&r.append("include_resources",n.include_resources.toString());const o=r.toString(),i=o?`/methods/${encodeURIComponent(t)}/papers?${o}`:`/methods/${encodeURIComponent(t)}/papers`;return this.request(i)}async getDatasets(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.name&&n.append("name",t.name),t!=null&&t.full_name&&n.append("full_name",t.full_name),t!=null&&t.task&&n.append("task",t.task),t!=null&&t.task_id&&n.append("task",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),(t==null?void 0:t.min_eval_count)!==void 0&&n.append("min_eval_count",t.min_eval_count.toString()),(t==null?void 0:t.is_open)!==void 0&&n.append("is_open",t.is_open.toString()),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/datasets/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getDataset(t){return this.request(`/datasets/${t}`)}async getDatasetBySlug(t,n){const r=new URLSearchParams;n!=null&&n.include_paper&&r.set("include_paper","true"),n!=null&&n.task&&r.set("task",n.task),(n==null?void 0:n.is_open)!==void 0&&r.set("is_open",String(n.is_open));const o=r.size?`?${r.toString()}`:"";return this.request(`/datasets/${t}${o}`)}async getDatasetTasks(t){return(await this.request(`/datasets/${t}/tasks/`)).results}async getLeaderboardMetrics(t,n){return(await this.request(`/datasets/${t}/tasks/${n}/metrics`)).metrics}async getEvaluations(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.task_id&&n.append("task_id",t.task_id.toString()),t!=null&&t.include_descendants&&n.append("include_descendants","true"),t!=null&&t.dataset_id&&n.append("dataset_id",t.dataset_id.toString()),t!=null&&t.best_metric&&n.append("best_metric",t.best_metric),(t==null?void 0:t.external)!==void 0&&n.append("external",String(t.external)),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/evaluations/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-store"})}async getEvaluation(t){return this.request(`/evaluations/${t}`)}async getEvaluationsByPaper(t){const r=parseInt(t),o=await this.getEvaluations({paper_id:r,page_size:100,ordering:"-benchmark_popularity"}),i=[...o.results];let s=o.next_page;for(;s;){const l=await this.getEvaluations({paper_id:r,page:s,page_size:100,ordering:"-benchmark_popularity"});i.push(...l.results),s=l.next_page}return i}async getEvaluationsByDataset(t,n){const o=parseInt(t),i=await this.getEvaluations({dataset_id:o,best_metric:n,page_size:100,ordering:"best_rank"}),s=[...i.results];let l=i.next_page;for(;l;){const a=await this.getEvaluations({dataset_id:o,best_metric:n,page:l,page_size:100,ordering:"best_rank"});s.push(...a.results),l=a.next_page}return s}async createEvaluation(t){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(t)})}async updateEvaluation(t,n){const r=`/evaluations/${t}`;return this.request(r,{method:"PUT",body:JSON.stringify(n)})}async deleteEvaluation(t){const n=`/evaluations/${t}`;return this.request(n,{method:"DELETE"})}async generateThumbnail(t){const n=io(`/api/thumbnails/generate/${t}`),r=await fetch(n,{method:"POST"});if(!r.ok)throw new Error(`Thumbnail generation failed: ${r.status}`);return await r.json()}async getThumbnailStatus(t){const n=io(`/api/thumbnails/status/${t}`),r=await fetch(n);if(!r.ok)throw new Error(`Thumbnail status check failed: ${r.status}`);return await r.json()}async healthCheck(){const t=io("/health"),n=await fetch(t);if(!n.ok)throw new Error(`Health check failed: ${n.status}`);return await n.json()}async getMetrics(t){const n=new URLSearchParams;t!=null&&t.page&&n.append("page",t.page.toString()),t!=null&&t.page_size&&n.append("page_size",t.page_size.toString()),t!=null&&t.q&&n.append("q",t.q),t!=null&&t.direction&&n.append("direction",t.direction),t!=null&&t.ordering&&n.append("ordering",t.ordering);const r=`/metrics/${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getMetric(t){return this.request(`/metrics/${t}`)}async getMetricDirections(){return this.request("/metrics/directions")}async submitPendingPaperEdit(t){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(t)})}async listPendingPaperEdits(t){const n=new URLSearchParams;t!=null&&t.status&&n.append("status",t.status),t!=null&&t.edit_type&&n.append("edit_type",t.edit_type),t!=null&&t.paper_id&&n.append("paper_id",t.paper_id.toString()),t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString());const r=`/admin/paper-edits${n.toString()?`?${n.toString()}`:""}`;return this.request(r)}async getPendingPaperEdit(t){return this.request(`/admin/paper-edits/${t}`)}async approvePendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/approve`,{method:"POST",body:JSON.stringify(n??{})})}async rejectPendingPaperEdit(t,n){return this.request(`/admin/paper-edits/${t}/reject`,{method:"POST",body:JSON.stringify(n??{})})}async getMyBookmarkIds(){return this.request("/me/bookmarks/ids")}async getMyBookmarks(){return this.request("/me/bookmarks")}async addBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"POST"})}async removeBookmark(t){await this.request(`/me/bookmarks/${t}`,{method:"DELETE"})}async getMyPreferences(){return this.request("/me/preferences")}async updateMyPreferences(t){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(t)})}async getCronStatus(){return this.request("/cron/status",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}}const _=new qR;_.getPapers.bind(_);const KN=_.getPaper.bind(_);_.getPaperByArxivId.bind(_);const qN=_.indexPaperFromArxiv.bind(_),GN=_.submitPaper.bind(_),QN=_.updatePaperTasks.bind(_),YN=_.updatePaperMethods.bind(_),XN=_.updatePaperRepositories.bind(_),JN=_.updatePaperProjectPages.bind(_),ZN=_.updatePaperSourceUrl.bind(_);_.updatePaperHfArtifacts.bind(_);_.getTrendingPapers.bind(_);_.getRepositoriesForPaper.bind(_);_.getRepositories.bind(_);_.getProjectPagesForPaper.bind(_);_.getProjectPages.bind(_);_.getAuthors.bind(_);_.getAuthor.bind(_);_.getAreas.bind(_);_.getArea.bind(_);_.getAreasWithTasks.bind(_);_.getConferences.bind(_);_.getConferenceDeadlines.bind(_);_.getConference.bind(_);_.getConferenceAreasWithTasks.bind(_);_.getConferencePapers.bind(_);_.getOrganizations.bind(_);_.getOrganization.bind(_);_.getOrganizationAreasWithTasks.bind(_);_.getOrganizationPapers.bind(_);_.getAreaTasks.bind(_);const eM=_.getTasks.bind(_),tM=_.getTask.bind(_);_.getTopTasks.bind(_);_.getTrendingTasks.bind(_);_.getTaskChildren.bind(_);_.getTaskParents.bind(_);_.getTaskPage.bind(_);_.getTaskPapers.bind(_);const nM=_.getMethods.bind(_),rM=_.getMethod.bind(_);_.getMethodPapers.bind(_);const oM=_.getDatasets.bind(_),iM=_.getDataset.bind(_);_.getDatasetBySlug.bind(_);_.getDatasetTasks.bind(_);const sM=_.getLeaderboardMetrics.bind(_);_.getEvaluations.bind(_);_.getEvaluation.bind(_);const lM=_.getEvaluationsByPaper.bind(_);_.getEvaluationsByDataset.bind(_);const aM=_.createEvaluation.bind(_),uM=_.updateEvaluation.bind(_),cM=_.deleteEvaluation.bind(_);_.generateThumbnail.bind(_);_.getThumbnailStatus.bind(_);_.getMetrics.bind(_);_.getMetric.bind(_);_.getMetricDirections.bind(_);_.getResearchTrends.bind(_);_.healthCheck.bind(_);_.getMyBookmarkIds.bind(_);_.getMyBookmarks.bind(_);_.addBookmark.bind(_);_.getMyPreferences.bind(_);_.updateMyPreferences.bind(_);const dM=_.submitPendingPaperEdit.bind(_),fM=_.listPendingPaperEdits.bind(_);_.getPendingPaperEdit.bind(_);const pM=_.approvePendingPaperEdit.bind(_),hM=_.rejectPendingPaperEdit.bind(_);_.removeBookmark.bind(_);const ru={hide_closed_source_evals:!1},i0=R.createContext(null),GR=({children:e})=>{const{user:t}=Kd(),[n,r]=R.useState(ru),[o,i]=R.useState(!1);R.useEffect(()=>{let a=!1;if(!t){r(ru);return}return i(!0),_.getMyPreferences().then(u=>{a||r(u)}).catch(()=>{a||r(ru)}).finally(()=>{a||i(!1)}),()=>{a=!0}},[t]);const s=R.useCallback(async a=>{const u={...n,hide_closed_source_evals:a};if(r(u),!!t)try{const d=await _.updateMyPreferences(u);r(d)}catch{r(n)}},[n,t]),l=R.useMemo(()=>({preferences:n,canPersist:!!t,isLoading:o,setHideClosedSourceEvals:s}),[n,t,o,s]);return v.jsx(i0.Provider,{value:l,children:e})};function gM(){const e=R.useContext(i0);if(!e)throw new Error("usePreferences must be used inside a ");return e}const s0=OE(),QR=s0?X1:Y1;if(!s0&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const YR=R.lazy(()=>ue(()=>import("./FeedView-DBPKjNq3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),XR=R.lazy(()=>ue(()=>import("./ChatView-Cn8694zt.js"),__vite__mapDeps([14,6,3,4,15,8,16,17]))),JR=R.lazy(()=>ue(()=>import("./PapersListView-CEKrrz6_.js"),__vite__mapDeps([18,1,2,3,4,5,7,8,9,19,11,10,12,13]))),ZR=R.lazy(()=>ue(()=>import("./PaperDetailView-BR6DDoza.js"),__vite__mapDeps([20,8,1,2,3,4,5,21,15,22,7,9,12,13,23,24,25,26,27,28,29,30,31,16]))),eN=R.lazy(()=>ue(()=>import("./TagsIndexView-BSr7Xyd4.js"),__vite__mapDeps([32,8,5,12,13,33,28,23,25,26,27,29]))),tN=R.lazy(()=>ue(()=>import("./TagBrowseView-DEjLjywI.js"),__vite__mapDeps([34,8,1,2,3,4,5,35,36,16,17,7,9,10,12,13,37,31]))),nN=R.lazy(()=>ue(()=>import("./MethodsIndexView-CJcZiURr.js"),__vite__mapDeps([38,8,12,13,33,28,23,25,26,27,29]))),rN=R.lazy(()=>ue(()=>import("./FrameworksIndexView-CU8V9Ap8.js"),__vite__mapDeps([39,1,2,3,4,5]))),oN=R.lazy(()=>ue(()=>import("./TrendsView-BHSTAeEu.js"),__vite__mapDeps([40,8,13,12]))),iN=R.lazy(()=>ue(()=>import("./ConferencesIndexView-B3HCMmrn.js"),__vite__mapDeps([41,8,12,13,33,28,23,25,26,27,29]))),sN=R.lazy(()=>ue(()=>import("./AiDeadlinesView-DiE8i5uI.js"),__vite__mapDeps([42,8,43,24,12,13,26]))),lN=R.lazy(()=>ue(()=>import("./ConferenceDetailView-qTh5wHQs.js"),__vite__mapDeps([44,8,36,3,4,16,17,5,12,13]))),aN=R.lazy(()=>ue(()=>import("./ConferenceTaskView-BJz7eqBS.js"),__vite__mapDeps([45,8,1,2,3,4,5,36,16,17,7,9,10,12,13]))),uN=R.lazy(()=>ue(()=>import("./OrganizationsIndexView-D8tV0kaA.js"),__vite__mapDeps([46,8,12,13]))),cN=R.lazy(()=>ue(()=>import("./OrganizationDetailView-DVGr7EZ1.js"),__vite__mapDeps([47,8,36,3,4,16,17,5,12,13,48]))),dN=R.lazy(()=>ue(()=>import("./OrganizationTaskView-7B863H2d.js"),__vite__mapDeps([49,8,1,2,3,4,5,7,9,10,12,13,48]))),fN=R.lazy(()=>ue(()=>import("./MethodDetailView-Bgd2_gNk.js"),__vite__mapDeps([50,8,9,1,2,3,4,5,36,16,17,10,12,13]))),pN=R.lazy(()=>ue(()=>import("./BenchmarkDetailView-Bi4Pfrh0.js"),__vite__mapDeps([51,8,12,43,24,13,2,3,4,1,5,21,15,35]))),hN=R.lazy(()=>ue(()=>import("./SavedPapersView-B5Dv-0u7.js"),__vite__mapDeps([52,8,1,2,3,4,5,12,13]))),gN=R.lazy(()=>ue(()=>import("./SettingsView-avOWZkJc.js"),__vite__mapDeps([53,43,24,22]))),mN=R.lazy(()=>ue(()=>import("./SubmitView-Dj01AAbq.js"),__vite__mapDeps([54,27,13,23,25]))),vN=R.lazy(()=>ue(()=>import("./CronDashboard-Dk0srJbz.js"),__vite__mapDeps([55,8,30,23,37,56,29,57]))),yN=R.lazy(()=>ue(()=>import("./SubmissionsDashboard-9D45gT9z.js"),__vite__mapDeps([58,8,27,56,29]))),wN=R.lazy(()=>ue(()=>import("./NotFound-DntriyTH.js"),[])),xN=R.lazy(()=>ue(()=>import("./SearchOverlay-IwrYUcEL.js"),__vite__mapDeps([59,8,2,3,4,19,5]))),SN=()=>v.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),v.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),v.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),EN=new NE({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),CN=()=>{const{arxivId:e}=xd();return v.jsx(Gn,{to:e?`/paper/${e}`:"/papers",replace:!0})},bN=()=>{const{taskSlug:e}=xd();return v.jsx(Gn,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},wh=()=>{const{orgSlug:e,taskSlug:t}=xd();return e?v.jsx(Gn,{to:t?`/${e}/${t}`:`/${e}`,replace:!0}):v.jsx(Gn,{to:"/organizations",replace:!0})},xh=({element:e})=>Hi()?v.jsx(Gn,{to:"/",replace:!0}):v.jsx(v.Fragment,{children:e}),PN=({element:e})=>{const{user:t,isLoading:n}=Kd();return Hi()?v.jsx(Gn,{to:"/",replace:!0}):n?v.jsx("div",{className:"page",children:v.jsx("div",{className:"submission-loading",children:v.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?v.jsx(v.Fragment,{children:e}):v.jsx("div",{className:"page",children:v.jsxs("div",{className:"submission-empty submission-empty-warn",children:[v.jsx("h1",{children:"Admin access required"}),v.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):v.jsx("div",{className:"page",children:v.jsxs("div",{className:"submission-empty submission-empty-warn",children:[v.jsx("h1",{children:"Sign in required"}),v.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),v.jsx(gv,{returnTo:"/admin-dashboard"})]})})},_N=()=>{const[e,t]=R.useState(!1);return VR(),R.useEffect(()=>{const n=r=>{(r.metaKey||r.ctrlKey)&&r.key==="k"&&(r.preventDefault(),t(!0))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),v.jsxs(v.Fragment,{children:[v.jsx(gT,{onOpenSearch:()=>t(!0)}),v.jsx("main",{children:v.jsx(R.Suspense,{fallback:v.jsx(SN,{}),children:v.jsxs(U1,{children:[v.jsx(ne,{path:"/",element:v.jsx(YR,{})}),v.jsx(ne,{path:"/chat/:sessionId?",element:hv()?v.jsx(XR,{}):v.jsx(Gn,{to:"/",replace:!0})}),v.jsx(ne,{path:"/papers",element:v.jsx(JR,{})}),v.jsx(ne,{path:"/papers/:arxivId",element:v.jsx(CN,{})}),v.jsx(ne,{path:"/paper/:arxivId",element:v.jsx(ZR,{})}),v.jsx(ne,{path:"/tasks",element:v.jsx(eN,{})}),v.jsx(ne,{path:"/tasks/:taskSlug",element:v.jsx(tN,{})}),v.jsx(ne,{path:"/task/:taskSlug",element:v.jsx(bN,{})}),v.jsx(ne,{path:"/methods",element:v.jsx(nN,{})}),v.jsx(ne,{path:"/methods/:methodSlug",element:v.jsx(fN,{})}),v.jsx(ne,{path:"/frameworks",element:v.jsx(rN,{})}),v.jsx(ne,{path:"/trends",element:v.jsx(oN,{})}),v.jsx(ne,{path:"/conferences",element:v.jsx(iN,{})}),v.jsx(ne,{path:"/ai-deadlines",element:v.jsx(sN,{})}),v.jsx(ne,{path:"/conferences/:confSlug",element:v.jsx(lN,{})}),v.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:v.jsx(aN,{})}),v.jsx(ne,{path:"/organizations",element:v.jsx(uN,{})}),v.jsx(ne,{path:"/organizations/:orgSlug",element:v.jsx(wh,{})}),v.jsx(ne,{path:"/organizations/:orgSlug/:taskSlug",element:v.jsx(wh,{})}),v.jsx(ne,{path:"/benchmark/:datasetSlug",element:v.jsx(pN,{})}),v.jsx(ne,{path:"/submit",element:v.jsx(mN,{})}),v.jsx(ne,{path:"/saved",element:v.jsx(xh,{element:v.jsx(hN,{})})}),v.jsx(ne,{path:"/settings",element:v.jsx(gN,{})}),v.jsx(ne,{path:"/admin-dashboard",element:v.jsx(PN,{element:v.jsx(vN,{})})}),v.jsx(ne,{path:"/cron-dashboard",element:v.jsx(Gn,{to:"/admin-dashboard",replace:!0})}),v.jsx(ne,{path:"/submissions",element:v.jsx(xh,{element:v.jsx(yN,{})})}),v.jsx(ne,{path:"/:orgSlug",element:v.jsx(cN,{})}),v.jsx(ne,{path:"/:orgSlug/:taskSlug",element:v.jsx(dN,{})}),v.jsx(ne,{path:"*",element:v.jsx(wN,{})})]})})}),e&&v.jsx(R.Suspense,{fallback:null,children:v.jsx(xN,{open:e,onClose:()=>t(!1)})})]})},kN=()=>v.jsx(ME,{client:EN,children:v.jsx(fT,{children:v.jsx(GR,{children:v.jsxs(UR,{children:[v.jsx(QR,{children:v.jsx(_N,{})}),v.jsx(qT,{}),v.jsx(SR,{}),!1]})})})}),TN=Wm(document.getElementById("root"));TN.render(v.jsx(R.StrictMode,{children:v.jsx(qS,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:v.jsx(kN,{})})}));export{Hi as $,nM as A,XN as B,Zk as C,JN as D,ZN as E,Pr as F,OP as G,lc as H,fy as I,Zl as J,$d as K,zr as L,o_ as M,Ry as N,ub as O,kr as P,Vv as Q,R,Gl as S,py as T,hy as U,oM as V,cM as W,nT as X,aM as Y,uM as Z,sM as _,wd as a,zN as a0,gM as a1,rT as a2,oT as a3,bw as a4,Cn as a5,UN as a6,qN as a7,vt as a8,Rd as a9,$v as aA,pM as aB,hM as aC,fM as aD,Mi as aE,kE as aF,jN as aG,dn as aH,yE as aI,dE as aJ,tc as aK,lv as aL,uE as aM,cE as aN,ec as aO,ov as aP,PE as aQ,hE as aR,Fv as aa,vv as ab,VT as ac,gv as ad,BN as ae,AN as af,NN as ag,Nh as ah,LN as ai,IN as aj,KS as ak,GN as al,qP as am,GP as an,my as ao,FN as ap,ql as aq,Ue as ar,ON as as,iv as at,bt as au,tM as av,rM as aw,iM as ax,Lv as ay,Dv as az,_ as b,$N as c,io as d,xd as e,Kd as f,KN as g,oa as h,hv as i,v as j,lM as k,ve as l,kd as m,Re as n,V as o,PP as p,_r as q,f as r,Ne as s,DN as t,MN as u,ST as v,dM as w,QN as x,eM as y,YN as z}; diff --git a/assets/loader-circle-MkVnaQiB.js b/assets/loader-circle-BgGrBUVx.js similarity index 85% rename from assets/loader-circle-MkVnaQiB.js rename to assets/loader-circle-BgGrBUVx.js index a7c3221d50673537e2b9c59d4fcd254b413f07d8..e1eb06413c6ca397b4f021f435382e429d8a0ac7 100644 --- a/assets/loader-circle-MkVnaQiB.js +++ b/assets/loader-circle-BgGrBUVx.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-BHOUC_Zu.js";/** +import{h as e}from"./index-gsUrUwg6.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/shield-alert-DCaALQgN.js b/assets/shield-alert-CJqoAF0o.js similarity index 85% rename from assets/shield-alert-DCaALQgN.js rename to assets/shield-alert-CJqoAF0o.js index 8d66ca4b162df708d3fef91e9356ecb406f195bd..e4f279ed135ea0d487a1dc56098fcf11daffcb2e 100644 --- a/assets/shield-alert-DCaALQgN.js +++ b/assets/shield-alert-CJqoAF0o.js @@ -1,4 +1,4 @@ -import{g as e}from"./index-BHOUC_Zu.js";/** +import{h as e}from"./index-gsUrUwg6.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,14 +8,14 @@ import{g as e}from"./index-BHOUC_Zu.js";/** * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const t=e("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + */const h=e("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const h=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const t=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const r=e("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);export{t as C,h as R,r as S,c as a}; + */const r=e("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);export{h as C,t as R,r as S,c as a}; diff --git a/assets/skeleton-D99KO90d.js b/assets/skeleton-CF5-g5gI.js similarity index 62% rename from assets/skeleton-D99KO90d.js rename to assets/skeleton-CF5-g5gI.js index 90bf00db8999538aa4027f00bb63131245753609..d8164c71f5f3633e04892ace38961b915a69e33e 100644 --- a/assets/skeleton-D99KO90d.js +++ b/assets/skeleton-CF5-g5gI.js @@ -1 +1 @@ -import{j as t,q as n}from"./index-BHOUC_Zu.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; +import{j as t,s as n}from"./index-gsUrUwg6.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; diff --git a/assets/switch-CEN8Rv4w.js b/assets/switch-CEN8Rv4w.js deleted file mode 100644 index 42574718a5dce3148fbe76aa462f39e0ed55c668..0000000000000000000000000000000000000000 --- a/assets/switch-CEN8Rv4w.js +++ /dev/null @@ -1 +0,0 @@ -import{r as o,m as C,l as I,j as a,k as y,n as M,o as H,p as q,q as x}from"./index-BHOUC_Zu.js";import{u as A}from"./index-Del2ukvi.js";var b="Switch",[U]=q(b),[z,L]=U(b),P=o.forwardRef((t,s)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:l="on",onCheckedChange:v,form:i,...w}=t,[u,p]=o.useState(null),k=C(s,h=>p(h)),S=o.useRef(!1),g=u?i||!!u.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(z,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:l,...w,ref:k,onClick:M(t.onClick,h=>{B(T=>!T),g&&(S.current=h.isPropagationStopped(),S.current||h.stopPropagation())})}),g&&a.jsx(N,{control:u,bubbles:!S.current,name:n,value:l,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=o.forwardRef((t,s)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:s})});R.displayName=E;var O="SwitchBubbleInput",N=o.forwardRef(({__scopeSwitch:t,control:s,checked:e,bubbles:n=!0,...r},m)=>{const d=o.useRef(null),c=C(d,m),l=A(e),v=H(s);return o.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(l!==e&&p){const k=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(k)}},[l,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=o.forwardRef(({className:t,...s},e)=>a.jsx(_,{className:x("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...s,ref:e,children:a.jsx(D,{className:x("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; diff --git a/assets/switch-CnhcVUVf.js b/assets/switch-CnhcVUVf.js new file mode 100644 index 0000000000000000000000000000000000000000..c9258d55b2c8006127d3f826bc4a5b16826f99d7 --- /dev/null +++ b/assets/switch-CnhcVUVf.js @@ -0,0 +1 @@ +import{r as s,n as C,m as I,j as a,l as y,o as M,p as H,q,s as x}from"./index-gsUrUwg6.js";import{u as A}from"./index-Dov-h1--.js";var b="Switch",[U]=q(b),[z,L]=U(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:l="on",onCheckedChange:v,form:i,...w}=t,[u,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),g=u?i||!!u.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(z,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:l,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),g&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),g&&a.jsx(N,{control:u,bubbles:!k.current,name:n,value:l,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),l=A(e),v=H(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(l!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[l,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:x("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(D,{className:x("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; diff --git a/assets/textarea-dXuRCXp_.js b/assets/textarea-lhvg1Jzz.js similarity index 93% rename from assets/textarea-dXuRCXp_.js rename to assets/textarea-lhvg1Jzz.js index b33e1b637074cad7008b3e1cb9dcfcf741b32db5..2c22d0e637a7772b9b354deb0950d3b42b060f78 100644 --- a/assets/textarea-dXuRCXp_.js +++ b/assets/textarea-lhvg1Jzz.js @@ -1 +1 @@ -import{r as s,j as i,q as t}from"./index-BHOUC_Zu.js";const a=s.forwardRef(({className:e,type:r,...o},n)=>i.jsx("input",{type:r,className:t("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...o}));a.displayName="Input";const d=s.forwardRef(({className:e,...r},o)=>i.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));d.displayName="Textarea";export{a as I,d as T}; +import{r as s,j as i,s as t}from"./index-gsUrUwg6.js";const a=s.forwardRef(({className:e,type:r,...o},n)=>i.jsx("input",{type:r,className:t("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...o}));a.displayName="Input";const d=s.forwardRef(({className:e,...r},o)=>i.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));d.displayName="Textarea";export{a as I,d as T}; diff --git a/assets/transform-BaQjfqPg.js b/assets/transform-6AvXXXHk.js similarity index 99% rename from assets/transform-BaQjfqPg.js rename to assets/transform-6AvXXXHk.js index 7a13f93e0cfeb0fad0a46e626ef27a012e7ef4b4..ec3d0c4386aa756c0f61e78bf241ca131589349f 100644 --- a/assets/transform-BaQjfqPg.js +++ b/assets/transform-6AvXXXHk.js @@ -1 +1 @@ -import{c as $}from"./index-BHOUC_Zu.js";function pe(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function _(t){const e=w(t);return e.setHours(0,0,0,0),e}function F(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=_(t),r=_(e),a=+n-F(n),i=+r-F(r);return Math.round((a-i)/z)}function K(t){const e=A(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function Z(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!Z(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Y(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:Y({formats:at,defaultWidth:"full"}),time:Y({formats:it,defaultWidth:"full"}),dateTime:Y({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function k(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:k({values:dt,defaultWidth:"wide"}),quarter:k({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:k({values:ft,defaultWidth:"wide"}),day:k({values:ht,defaultWidth:"wide"}),dayPeriod:k({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Ot=/^(\d+)(th|st|nd|rd)?/i,kt=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:Ot,parsePattern:kt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+T(e)-+K(e);return Math.round(n/H)+1}function j(t,e){var f,g,l,O;const n=w(t),r=n.getFullYear(),a=S(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((O=(l=a.locale)==null?void 0:l.options)==null?void 0:O.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=x(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=x(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lt(t,e){var s,u,d,f;const n=S(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=j(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),x(i,e)}function Ut(t,e){const n=w(t),r=+x(n,e)-+Lt(n,e);return Math.round(r/H)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=j(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ut(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Q=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",Q(a,e))},It={p:Q,P:Ht},Rt=/^D+$/,At=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return Rt.test(t)}function Xt(t){return At.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Kt=/[a-zA-Z]/;function Zt(t,e,n){var f,g,l,O;const r=S(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((O=(l=r.locale)==null?void 0:l.options)==null?void 0:O.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const W=It[h];return W(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(E[h])return{isToken:!0,value:m};if(h.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const W=E[h[0]];return W(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function X(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const v={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(v.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],v.timeZoneDelimiter.test(e.date)&&(e.date=t.split(v.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=v.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function B(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(B(t)?29:28))}function fe(t,e){return e>=1&&e<=(B(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?X(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return X(t).getFullYear()}catch{return null}}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=(t.leaderboard_ranks||[]).filter(l=>l.best_rank>=1&&l.best_rank<=3).map(l=>({name:l.dataset_name,slug:l.dataset_slug||null,rank:l.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:s,methods:u,citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:$(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=G.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),G=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function Te(t,e){const n=t||Oe(e||""),r=G.get((e==null?void 0:e.toLowerCase())||ke(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function ke(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{w as a,x as b,be as c,Te as d,xe as e,Oe as f,pe as h,_ as s,ve as t}; +import{c as $}from"./index-gsUrUwg6.js";function pe(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function _(t){const e=w(t);return e.setHours(0,0,0,0),e}function F(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=_(t),r=_(e),a=+n-F(n),i=+r-F(r);return Math.round((a-i)/z)}function K(t){const e=A(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),T(n)}function Z(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!Z(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Y(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:Y({formats:at,defaultWidth:"full"}),time:Y({formats:it,defaultWidth:"full"}),dateTime:Y({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function k(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:k({values:dt,defaultWidth:"wide"}),quarter:k({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:k({values:ft,defaultWidth:"wide"}),day:k({values:ht,defaultWidth:"wide"}),dayPeriod:k({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const Ot=/^(\d+)(th|st|nd|rd)?/i,kt=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ct={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:Ot,parsePattern:kt,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Nt,defaultMatchWidth:"any",parsePatterns:Ct,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+T(e)-+K(e);return Math.round(n/H)+1}function j(t,e){var f,g,l,O;const n=w(t),r=n.getFullYear(),a=S(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((O=(l=a.locale)==null?void 0:l.options)==null?void 0:O.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=x(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=x(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Lt(t,e){var s,u,d,f;const n=S(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=j(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),x(i,e)}function Ut(t,e){const n=w(t),r=+x(n,e)-+Lt(n,e);return Math.round(r/H)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},E={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=j(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=A(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Ut(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function q(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const U=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Q=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return U(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",U(r,e)).replace("{{time}}",Q(a,e))},It={p:Q,P:Ht},Rt=/^D+$/,At=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return Rt.test(t)}function Xt(t){return At.test(t)}function Bt(t,e,n){const r=Gt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Gt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $t=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Kt=/[a-zA-Z]/;function Zt(t,e,n){var f,g,l,O;const r=S(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((O=(l=r.locale)==null?void 0:l.options)==null?void 0:O.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const W=It[h];return W(m,a.formatLong)}return m}).join("").match($t).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(E[h])return{isToken:!0,value:m};if(h.match(Kt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&Bt(h,e,String(t));const W=E[h[0]];return W(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function X(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const v={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(v.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],v.timeZoneDelimiter.test(e.date)&&(e.date=t.split(v.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=v.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function B(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(B(t)?29:28))}function fe(t,e){return e>=1&&e<=(B(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?X(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return X(t).getFullYear()}catch{return null}}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=(t.leaderboard_ranks||[]).filter(l=>l.best_rank>=1&&l.best_rank<=3).map(l=>({name:l.dataset_name,slug:l.dataset_slug||null,rank:l.best_rank}));return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],tags:s,methods:u,citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:$(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=G.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return C.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const C=new Set(["OCR"]),G=new Map([["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function Te(t,e){const n=t||Oe(e||""),r=G.get((e==null?void 0:e.toLowerCase())||ke(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&C.has(a)||C.has(i)?i:n.toLowerCase().replace(/\b\w/g,s=>s.toUpperCase())}function ke(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}export{w as a,x as b,be as c,Te as d,xe as e,Oe as f,pe as h,_ as s,ve as t}; diff --git a/assets/useDebounce-CZDogMbl.js b/assets/useDebounce-DMdZcc3h.js similarity index 66% rename from assets/useDebounce-CZDogMbl.js rename to assets/useDebounce-DMdZcc3h.js index 9b74dae5a01cf2b14872ca3635ca79261f79b5c9..ba1fdff9550795382eeb32a862deecc12bf7fabc 100644 --- a/assets/useDebounce-CZDogMbl.js +++ b/assets/useDebounce-DMdZcc3h.js @@ -1 +1 @@ -import{r as o}from"./index-BHOUC_Zu.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; +import{r as o}from"./index-gsUrUwg6.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; diff --git a/assets/useInfiniteQuery-Cme8RlvF.js b/assets/useInfiniteQuery-DNCGoDeK.js similarity index 89% rename from assets/useInfiniteQuery-Cme8RlvF.js rename to assets/useInfiniteQuery-DNCGoDeK.js index e4ab7f9420d59898183ec32ed15f206962e41e56..e08192005c0a76bb9d3739def932e08e715428ca 100644 --- a/assets/useInfiniteQuery-Cme8RlvF.js +++ b/assets/useInfiniteQuery-DNCGoDeK.js @@ -1 +1 @@ -import{Q as v,a as p}from"./useQuery-BLoDQBYX.js";import{ah as x,ai as b}from"./index-BHOUC_Zu.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function w(e,t){return p(e,l)}export{w as u}; +import{Q as v,a as p}from"./useQuery-CPia3mbp.js";import{ai as x,aj as b}from"./index-gsUrUwg6.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function w(e,t){return p(e,l)}export{w as u}; diff --git a/assets/useIntersectionObserver-FWZA_Lvo.js b/assets/useIntersectionObserver-Jkfl_qWv.js similarity index 86% rename from assets/useIntersectionObserver-FWZA_Lvo.js rename to assets/useIntersectionObserver-Jkfl_qWv.js index b7f5e8ff636383dcd8cbdc1c441797afaf9b749a..cb4ee6cef3500c6e89c769b11c18474d829eda6a 100644 --- a/assets/useIntersectionObserver-FWZA_Lvo.js +++ b/assets/useIntersectionObserver-Jkfl_qWv.js @@ -1 +1 @@ -import{r}from"./index-BHOUC_Zu.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u}; +import{r}from"./index-gsUrUwg6.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u}; diff --git a/assets/useMutation-B-QOtIkd.js b/assets/useMutation-CQieGF4K.js similarity index 95% rename from assets/useMutation-B-QOtIkd.js rename to assets/useMutation-CQieGF4K.js index 70cb213f9278bbde81eb633a7d626df45dc111f0..2678290ce6fd27ca0165df1ce3f6c56017fc4f34 100644 --- a/assets/useMutation-B-QOtIkd.js +++ b/assets/useMutation-CQieGF4K.js @@ -1 +1 @@ -var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{ap as q,ar as U,aE as j,aF as k,aq as P,s as L,r as v,at as A,aG as D}from"./index-BHOUC_Zu.js";var a,c,o,h,n,C,S,w,F=(w=class extends q{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),U(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??k();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function Q(i,t){const s=L(),[r]=v.useState(()=>new F(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{Q as u}; +var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{aq as q,as as U,aE as j,aF as k,ar as P,t as L,r as v,au as A,aG as D}from"./index-gsUrUwg6.js";var a,c,o,h,n,C,S,w,F=(w=class extends q{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),U(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&j(s.mutationKey)!==j(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??k();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function Q(i,t){const s=L(),[r]=v.useState(()=>new F(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(A)},[r]);if(u.error&&D(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{Q as u}; diff --git a/assets/usePapers-CShAZvOx.js b/assets/usePapers-BgUiIfcw.js similarity index 92% rename from assets/usePapers-CShAZvOx.js rename to assets/usePapers-BgUiIfcw.js index bd1051846290668fc5da471fcd9662d673588b77..c49c0ef35852305e06e477bea27b9fcd6ef1c8c2 100644 --- a/assets/usePapers-CShAZvOx.js +++ b/assets/usePapers-BgUiIfcw.js @@ -1 +1 @@ -import{b as d,ae as c}from"./index-BHOUC_Zu.js";import{u as P}from"./useQuery-BLoDQBYX.js";import{u as g}from"./useInfiniteQuery-Cme8RlvF.js";function h(a,e=!0){return P({queryKey:["paper",a],queryFn:()=>d.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function q(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:n="desc",time:s,published_after:i,published_before:o,conference:u,latest_only:l=!0,include_resources:p=!1,enabled:_=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:n,time:s,published_after:i,published_before:o,conference:u,latest_only:l,include_resources:p}],queryFn:({pageParam:f=1})=>d.getPapers({page:f,page_size:e,search:r,order_by:t,order_dir:n,time:s,published_after:i,published_before:o,conference:u,latest_only:l,include_resources:p}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:_,staleTime:5*60*1e3,placeholderData:c,refetchOnWindowFocus:!1})}function F(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:n="desc",latest_only:s=!0,include_resources:i=!0,enabled:o=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:n,latest_only:s,include_resources:i}],queryFn:({pageParam:u=1})=>d.getTaskPapers(e,{page:u,page_size:r,order_by:t,order_dir:n,latest_only:s,include_resources:i}),getNextPageParam:u=>u.next_page,initialPageParam:1,enabled:o&&!!e,staleTime:5*60*1e3,placeholderData:c,refetchOnWindowFocus:!1})}function k(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:n=20,order_by:s="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:u=!0,enabled:l=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:n,order_by:s,order_dir:i,latest_only:o,include_resources:u}],queryFn:({pageParam:p=1})=>d.getConferencePapers(e,{task:r,presentation:t,page:p,page_size:n,order_by:s,order_dir:i,latest_only:o,include_resources:u}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:c,refetchOnWindowFocus:!1})}function x(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:n="date_published",order_dir:s="desc",latest_only:i=!0,include_resources:o=!0,enabled:u=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:n,order_dir:s,latest_only:i,include_resources:o}],queryFn:({pageParam:l=1})=>d.getOrganizationPapers(e,{task:r,page:l,page_size:t,order_by:n,order_dir:s,latest_only:i,include_resources:o}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:u&&!!e,staleTime:5*60*1e3,placeholderData:c,refetchOnWindowFocus:!1})}export{h as a,F as b,k as c,x as d,q as u}; +import{b as d,af as c}from"./index-gsUrUwg6.js";import{u as P}from"./useQuery-CPia3mbp.js";import{u as g}from"./useInfiniteQuery-DNCGoDeK.js";function h(a,e=!0){return P({queryKey:["paper",a],queryFn:()=>d.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function q(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:n="desc",time:s,published_after:i,published_before:o,conference:u,latest_only:l=!0,include_resources:p=!1,enabled:_=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:n,time:s,published_after:i,published_before:o,conference:u,latest_only:l,include_resources:p}],queryFn:({pageParam:f=1})=>d.getPapers({page:f,page_size:e,search:r,order_by:t,order_dir:n,time:s,published_after:i,published_before:o,conference:u,latest_only:l,include_resources:p}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:_,staleTime:5*60*1e3,placeholderData:c,refetchOnWindowFocus:!1})}function F(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:n="desc",latest_only:s=!0,include_resources:i=!0,enabled:o=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:n,latest_only:s,include_resources:i}],queryFn:({pageParam:u=1})=>d.getTaskPapers(e,{page:u,page_size:r,order_by:t,order_dir:n,latest_only:s,include_resources:i}),getNextPageParam:u=>u.next_page,initialPageParam:1,enabled:o&&!!e,staleTime:5*60*1e3,placeholderData:c,refetchOnWindowFocus:!1})}function k(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:n=20,order_by:s="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:u=!0,enabled:l=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:n,order_by:s,order_dir:i,latest_only:o,include_resources:u}],queryFn:({pageParam:p=1})=>d.getConferencePapers(e,{task:r,presentation:t,page:p,page_size:n,order_by:s,order_dir:i,latest_only:o,include_resources:u}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:c,refetchOnWindowFocus:!1})}function x(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:n="date_published",order_dir:s="desc",latest_only:i=!0,include_resources:o=!0,enabled:u=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:n,order_dir:s,latest_only:i,include_resources:o}],queryFn:({pageParam:l=1})=>d.getOrganizationPapers(e,{task:r,page:l,page_size:t,order_by:n,order_dir:s,latest_only:i,include_resources:o}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:u&&!!e,staleTime:5*60*1e3,placeholderData:c,refetchOnWindowFocus:!1})}export{h as a,F as b,k as c,x as d,q as u}; diff --git a/assets/usePeriodFilter-DmE7oYz7.js b/assets/usePeriodFilter-CfsBKHc9.js similarity index 74% rename from assets/usePeriodFilter-DmE7oYz7.js rename to assets/usePeriodFilter-CfsBKHc9.js index a56f42ca19b7f5fa18711c31678d5eca566dc83c..71d4b359aaafa004d87c7dae942747d25035b03c 100644 --- a/assets/usePeriodFilter-DmE7oYz7.js +++ b/assets/usePeriodFilter-CfsBKHc9.js @@ -1 +1 @@ -import{r}from"./index-BHOUC_Zu.js";import{a as n,s as f,b as u}from"./transform-BaQjfqPg.js";function l(s){const t=n(s);return t.setDate(1),t.setHours(0,0,0,0),t}const h=["Today","This Week","This Month","All Time"];function T(s="All Time"){const[t,a]=r.useState(s),i=r.useMemo(()=>{const o=new Date;let e=null;return t==="Today"?e=f(o):t==="This Week"?e=u(o,{weekStartsOn:1}):t==="This Month"&&(e=l(o)),e?e.toISOString():void 0},[t]);return{period:t,setPeriod:a,publishedAfter:i}}export{h as P,T as u}; +import{r}from"./index-gsUrUwg6.js";import{a as n,s as f,b as u}from"./transform-6AvXXXHk.js";function l(s){const t=n(s);return t.setDate(1),t.setHours(0,0,0,0),t}const h=["Today","This Week","This Month","All Time"];function T(s="All Time"){const[t,a]=r.useState(s),i=r.useMemo(()=>{const o=new Date;let e=null;return t==="Today"?e=f(o):t==="This Week"?e=u(o,{weekStartsOn:1}):t==="This Month"&&(e=l(o)),e?e.toISOString():void 0},[t]);return{period:t,setPeriod:a,publishedAfter:i}}export{h as P,T as u}; diff --git a/assets/useQuery-BLoDQBYX.js b/assets/useQuery-CPia3mbp.js similarity index 98% rename from assets/useQuery-BLoDQBYX.js rename to assets/useQuery-CPia3mbp.js index a91ef62154cdbb223bac56c47b109ced796649f3..bcf90a1943e5a06356700bd9d11b82830b55be7b 100644 --- a/assets/useQuery-BLoDQBYX.js +++ b/assets/useQuery-CPia3mbp.js @@ -1 +1 @@ -var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{ap as Mt,aI as gt,aJ as S,ar as q,aK as j,at as tt,aL as et,aM as vt,aN as Qt,aO as J,aP as Tt,aQ as xt,aR as Rt,aq as Ct,r as O,aG as Ot,s as _t}from"./index-BHOUC_Zu.js";var v,a,H,g,x,U,C,w,W,D,L,_,F,M,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Mt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,W);p(this,D);p(this,L);p(this,_);p(this,F);p(this,M);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),mt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||j(this.options.staleTime,i(this,a))!==j(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,M))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,U),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},Q=!1,f;if(e._optimisticResults){const m=this.hasListeners(),k=!m&&mt(t,e),V=m&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:T,errorUpdatedAt:B,status:R}=d;f=d.data;let z=!1;if(e.placeholderData!==void 0&&f===void 0&&R==="pending"){let m;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(m=o.data,z=!0):m=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,m!==void 0&&(R="success",f=Rt(o==null?void 0:o.data,m,e),Q=!0)}if(e.select&&f!==void 0&&!z)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,W))f=i(this,D);else try{u(this,W,e.select),f=e.select(f),f=Rt(o==null?void 0:o.data,f,e),u(this,D,f),u(this,w,null)}catch(m){u(this,w,m)}i(this,w)&&(T=i(this,w),f=i(this,D),B=Date.now(),R="error");const X=d.fetchStatus==="fetching",Y=R==="pending",Z=R==="error",lt=Y&&X,dt=f!==void 0,I={status:R,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:R==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:T,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:Q,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const m=I.data!==void 0,k=I.status==="error"&&!m,V=G=>{k?G.reject(I.error):m&&G.resolve(I.data)},pt=()=>{const G=u(this,C,I.promise=gt());V(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,U,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const P=y;return i(this,g)[P]!==t[P]&&c.has(P)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,W=new WeakMap,D=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,M=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=j(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Qt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,M,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,M))||i(this,M)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Tt.isFocused())&&l(this,n,A).call(this)},i(this,M)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Pt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function mt(s,t){return Pt(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Dt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),Bt=()=>O.useContext(Nt),kt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},jt=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),Ht=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},Wt=(s,t)=>s.isLoading&&s.isFetching&&!t,zt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var Q,f,T,B;const r=Dt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_beforeQuery)==null||f.call(Q,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),kt(c,h,y),At(h);const P=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(R=>{const z=d?b.subscribe(Ct.batchCalls(R)):tt;return b.updateResult(),z},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),zt(c,E))throw yt(c,b,h);if(jt({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(T=o.getDefaultOptions().queries)==null?void 0:T._experimental_afterQuery)==null||B.call(T,c,E),c.experimental_prefetchInRender&&!et.isServer()&&Wt(E,r)){const R=P?yt(c,b,h):y==null?void 0:y.promise;R==null||R.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Dt as b,Bt as c,kt as d,Ht as e,At as f,yt as g,jt as h,zt as s,Xt as u}; +var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{aq as Mt,aI as gt,aJ as S,as as q,aK as j,au as tt,aL as et,aM as vt,aN as Qt,aO as J,aP as Tt,aQ as xt,aR as Rt,ar as Ct,r as O,aG as Ot,t as _t}from"./index-gsUrUwg6.js";var v,a,H,g,x,U,C,w,W,D,L,_,F,M,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Mt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,W);p(this,D);p(this,L);p(this,_);p(this,F);p(this,M);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),mt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||j(this.options.staleTime,i(this,a))!==j(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,M))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,U),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},Q=!1,f;if(e._optimisticResults){const m=this.hasListeners(),k=!m&&mt(t,e),V=m&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:T,errorUpdatedAt:B,status:R}=d;f=d.data;let z=!1;if(e.placeholderData!==void 0&&f===void 0&&R==="pending"){let m;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(m=o.data,z=!0):m=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,m!==void 0&&(R="success",f=Rt(o==null?void 0:o.data,m,e),Q=!0)}if(e.select&&f!==void 0&&!z)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,W))f=i(this,D);else try{u(this,W,e.select),f=e.select(f),f=Rt(o==null?void 0:o.data,f,e),u(this,D,f),u(this,w,null)}catch(m){u(this,w,m)}i(this,w)&&(T=i(this,w),f=i(this,D),B=Date.now(),R="error");const X=d.fetchStatus==="fetching",Y=R==="pending",Z=R==="error",lt=Y&&X,dt=f!==void 0,I={status:R,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:R==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:T,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:Q,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const m=I.data!==void 0,k=I.status==="error"&&!m,V=G=>{k?G.reject(I.error):m&&G.resolve(I.data)},pt=()=>{const G=u(this,C,I.promise=gt());V(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,U,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const P=y;return i(this,g)[P]!==t[P]&&c.has(P)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,H=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,W=new WeakMap,D=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,M=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=j(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Qt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,M,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,M))||i(this,M)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Tt.isFocused())&&l(this,n,A).call(this)},i(this,M)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,H,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Pt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function mt(s,t){return Pt(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&j(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(j(t.staleTime,s))}function Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Dt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),Bt=()=>O.useContext(Nt),kt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},jt=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),Ht=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},Wt=(s,t)=>s.isLoading&&s.isFetching&&!t,zt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var Q,f,T,B;const r=Dt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_beforeQuery)==null||f.call(Q,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),kt(c,h,y),At(h);const P=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(R=>{const z=d?b.subscribe(Ct.batchCalls(R)):tt;return b.updateResult(),z},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),zt(c,E))throw yt(c,b,h);if(jt({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(T=o.getDefaultOptions().queries)==null?void 0:T._experimental_afterQuery)==null||B.call(T,c,E),c.experimental_prefetchInRender&&!et.isServer()&&Wt(E,r)){const R=P?yt(c,b,h):y==null?void 0:y.promise;R==null||R.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Dt as b,Bt as c,kt as d,Ht as e,At as f,yt as g,jt as h,zt as s,Xt as u}; diff --git a/index.html b/index.html index 6fdee5c755aef0c594310112865a36d7a625a8c7..5fa04e35ee9000036d413570818e7ef8aeeb02c7 100644 --- a/index.html +++ b/index.html @@ -49,7 +49,7 @@ plausible.init(); })(); - +