diff --git a/assets/AiDeadlinesView-CRbaeNb8.js b/assets/AiDeadlinesView-D-zWicTZ.js similarity index 58% rename from assets/AiDeadlinesView-CRbaeNb8.js rename to assets/AiDeadlinesView-D-zWicTZ.js index 6efb532738e35f05d7b8795fbacc63f26a3ac604..e6e3b3843630bb2c45b2796172de3ba9063ea891 100644 --- a/assets/AiDeadlinesView-CRbaeNb8.js +++ b/assets/AiDeadlinesView-D-zWicTZ.js @@ -1,3 +1,3 @@ -import{r as x,j as t,c as A}from"./index-D9_nPZtO.js";import{u as B}from"./useQuery-cycUreG-.js";import{S as U}from"./switch-BM2BYYbv.js";import{S as W}from"./skeleton-CQ2CM4l9.js";import{A as O,a as V}from"./alert-B0bcMmNw.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-DnjY6ZOM.js";import"./index-BGBxtSYH.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"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(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}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(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`},X=(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)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(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}from"./index-Czt286FG.js";import{u as A}from"./useQuery-DLzEukS9.js";import{c as B}from"./catalog-BRyB71ZU.js";import{S as U}from"./switch-DfN0FiAU.js";import{S as W}from"./skeleton-B7eqTJnv.js";import{A as O,a as V}from"./alert-pIw6ZaYb.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,b as Y,c as H,d as K}from"./dialog-CJthLFv3.js";import"./index-DzH9562Y.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"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(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}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(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`},X=(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)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(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}/,""),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=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(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(` -`),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),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)},ne=({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?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{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:[m&&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:m})]}),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})]})]}),u!=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:_(u,r)},children:X(u,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,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=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:h&&!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:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),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:z(e.url)??void 0,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:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({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(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(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:p=>{(p.key==="Enter"||p.key===" ")&&(p.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:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.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:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},pe=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=B({queryKey:["conference-deadlines"],queryFn:()=>A.getConferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.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))),g=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[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{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(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"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:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):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(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{pe as default}; +`),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),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)},ne=({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?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{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:[m&&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:m})]}),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})]})]}),u!=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:_(u,r)},children:X(u,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,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=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:h&&!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:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),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:z(e.url)??void 0,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:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({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(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(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:p=>{(p.key==="Enter"||p.key===" ")&&(p.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:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.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:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.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))),g=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[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{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(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"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:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):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(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default}; diff --git a/assets/AuthorDetailView-DWrMqjuC.js b/assets/AuthorDetailView-DWrMqjuC.js deleted file mode 100644 index 305428255c8b417e5fbb943c333b1c1447bfeaf9..0000000000000000000000000000000000000000 --- a/assets/AuthorDetailView-DWrMqjuC.js +++ /dev/null @@ -1 +0,0 @@ -import{f as m,j as e,L as g,c as h}from"./index-D9_nPZtO.js";import{u as d}from"./useQuery-cycUreG-.js";import{S as c}from"./skeleton-CQ2CM4l9.js";import x from"./NotFound-DLV3c5vS.js";const N=()=>{var l,n,i,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.getAuthorPapers(a,{page:1,page_size:20}),enabled:!!a});return((l=r.error)==null?void 0:l.status)===404?e.jsx(x,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((n=r.data)==null?void 0:n.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((i=r.data)==null?void 0:i.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(g,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{N as default}; diff --git a/assets/AuthorDetailView-h0Ew8Kww.js b/assets/AuthorDetailView-h0Ew8Kww.js new file mode 100644 index 0000000000000000000000000000000000000000..ed89881934682a6581e522acf4ddd197a1936255 --- /dev/null +++ b/assets/AuthorDetailView-h0Ew8Kww.js @@ -0,0 +1 @@ +import{f as m,j as e,L as x,p as h}from"./index-Czt286FG.js";import{u as d}from"./useQuery-DLzEukS9.js";import{S as c}from"./skeleton-B7eqTJnv.js";import g from"./NotFound-5-TztvbD.js";const N=()=>{var l,n,i,o,u;const{authorId:a}=m(),r=d({queryKey:["author",a],queryFn:()=>h.getAuthor(a),enabled:!!a}),t=d({queryKey:["author-papers",a],queryFn:()=>h.authorPapers(a,{page:1,page_size:20}),enabled:!!a});return((l=r.error)==null?void 0:l.status)===404?e.jsx(g,{}):e.jsxs("div",{className:"page",children:[e.jsx("p",{className:"sidebar-label",children:"Author"}),e.jsx("h1",{className:"feed-title",children:((n=r.data)==null?void 0:n.full_name)??e.jsx(c,{className:"h-10 w-64 inline-block"})}),((i=r.data)==null?void 0:i.hf_username)&&e.jsxs("a",{href:`https://huggingface.co/${r.data.hf_username}`,target:"_blank",rel:"noopener noreferrer",children:["@",r.data.hf_username," on Hugging Face"]}),e.jsxs("section",{style:{marginTop:40},"aria-labelledby":"author-papers-heading",children:[e.jsx("h2",{id:"author-papers-heading",children:"Research papers"}),t.isLoading&&e.jsx(c,{className:"h-24 w-full mt-4"}),((o=t.data)==null?void 0:o.results.length)===0&&e.jsx("p",{children:"No public papers are available."}),e.jsx("ol",{className:"paper-list",children:(u=t.data)==null?void 0:u.results.map(s=>{const p=s.source==="external"?String(s.id):s.arxiv_id;return e.jsx("li",{children:e.jsx(x,{to:`/paper/${p}`,children:s.title})},s.id)})})]})]})};export{N as default}; diff --git a/assets/BenchmarkDetailView-BWArUzbc.js b/assets/BenchmarkDetailView-BWArUzbc.js deleted file mode 100644 index 3cc8a2869499f238fe86dbbe77adbfe0824589ee..0000000000000000000000000000000000000000 --- a/assets/BenchmarkDetailView-BWArUzbc.js +++ /dev/null @@ -1,2 +0,0 @@ -import{u as vt,r as w,j as n,a4 as ne,h as jt,f as _t,a as kt,_ as St,L as me,c as ee}from"./index-D9_nPZtO.js";import{u as te}from"./useQuery-cycUreG-.js";import{S as xe}from"./skeleton-CQ2CM4l9.js";import{S as Je}from"./switch-BM2BYYbv.js";import{A as Ct,a as Et}from"./alert-B0bcMmNw.js";import{L as ye}from"./LatexTitle-BtRWGRIx.js";import{C as Nt,E as Rt}from"./ExternalSourceEvalBadge-Cu4mN0M9.js";import{B as Tt}from"./BenchmarkTrendSparkline-CN-RBbNH.js";import{I as $t}from"./components-DrTew0nD.js";import{s as Mt}from"./safeExternalHref-CkBrsh84.js";import"./index-BGBxtSYH.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DVeX2fQl.js";import"./transform-BObV5jzB.js";function Ft(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}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Lt(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(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?`${Ce[x]} ${r.year}`:Ce[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 It=({points:e,metric:t})=>{const r=vt(),[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=>Ze(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(Ze(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=Lt(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 Pt(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 At=(()=>{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 Ot(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 Ut(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Wt(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),Ut(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 qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function zt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Gt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?qt(r):zt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=At();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Gt(c,r,a,s)),t.appendChild(l)}function Kt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Qt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Xt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function $e(e){const t=Xt(e).toLowerCase();return Qt[t]||""}function Yt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Jt(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 Ne={};function Zt(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=Zt(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[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")||""),Yt(l)));a=Jt(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 Ne[s]=a,a}async function er(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function tr(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 rr(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 sr(e,t){return P(e,HTMLCanvasElement)?er(e):P(e,HTMLVideoElement)?tr(e,t):P(e,HTMLIFrameElement)?rr(e,t):e.cloneNode(ht(e))}const nr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ar(e,t,r){var s,a;if(ht(t))return t;let i=[];return nr(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 ir(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 cr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function lr(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 or(e,t,r){return P(t,Element)&&(ir(e,t,r),Kt(e,t,r),cr(e,t),lr(e,t)),t}async function dr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;isr(s,t)).then(s=>ar(e,s,t)).then(s=>or(e,s,t)).then(s=>dr(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,ur=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,mr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function hr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function fr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function pr(e,t,r,s,a){try{const i=r?Pt(t,r):t,c=$e(t);let l;return a||(l=await Me(i,c,s)),e.replace(hr(t),`$1${l}$3`)}catch{}return e}function gr(e,{preferredFontFormat:t}){return t?e.replace(mr,r=>{for(;;){const[s,,a]=ur.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=gr(e,r);return fr(s).reduce((i,c)=>i.then(l=>pr(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 xr(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 br(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 yr(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 xr(e,t),await br(e,t),await yr(e,t))}function wr(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 st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(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 it(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 vr(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=nt(u).then(f=>at(f,t)).then(f=>it(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(nt(a.href).then(l=>at(l,t)).then(l=>it(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 jr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function _r(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await vr(r,t);return jr(s)}function bt(e){return e.trim().replace(/["']/g,"")}function kr(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 Sr(e,t){const r=await _r(e,t),s=kr(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 Cr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Sr(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 Er(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Cr(a,t),await xt(a,t),wr(a,t),await Wt(a,r,s)}async function Nr(e,t={}){const{width:r,height:s}=ut(e,t),a=await Er(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Ht(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Vt(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 Rr(e,t={}){const r=await Nr(e,t);return await Ot(r)}const Te="#ffffff";function Tr(){return typeof window>"u"?Te:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||Te}function $r(e){if(typeof window>"u")return Te;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Tr():t}async function Mr(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 Rr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:$r(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[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 Mr(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($t,{name:"copy",size:11}),l]})};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 Fr(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Lr(e){const t=new Map;for(const r of e){const s=Fr(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 lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Ir(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 Pr=5;function Ar(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||"—"}const Jr=()=>{var Le,Ie,Pe,Ae,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[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(()=>Ft(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(()=>Lr(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,Pr),[W,b]),{points:oe,sota:pe,sotaModel:o}=w.useMemo(()=>Ir(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:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,de=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Ar(_.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(Tt,{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:Mt(_.paper_url)??void 0,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(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(It,{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(ct,{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=lt(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(Nt,{}),(h.external??h.is_external)&&n.jsx(Rt,{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{Jr as default}; diff --git a/assets/BenchmarkDetailView-hM6r7YYu.js b/assets/BenchmarkDetailView-hM6r7YYu.js new file mode 100644 index 0000000000000000000000000000000000000000..ce28493c41194f508cf093c48d37a4820a9643ab --- /dev/null +++ b/assets/BenchmarkDetailView-hM6r7YYu.js @@ -0,0 +1,2 @@ +import{u as vt,r as w,j as n,N as se,h as jt,f as _t,a as kt,F as St,L as ue}from"./index-Czt286FG.js";import{u as ee}from"./useQuery-DLzEukS9.js";import{c as me}from"./catalog-BRyB71ZU.js";import{C as Ct,E as Et,e as Nt}from"./evaluations-DoOZeNPs.js";import{S as xe}from"./skeleton-B7eqTJnv.js";import{S as Je}from"./switch-DfN0FiAU.js";import{A as Rt,a as $t}from"./alert-pIw6ZaYb.js";import{L as ye}from"./LatexTitle-BMNMJu5R.js";import{B as Tt}from"./BenchmarkTrendSparkline-CrCjGcyr.js";import{I as Mt}from"./components-D0aZHC0e.js";import{s as Ft}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-g7QtmX4K.js";import"./index-DzH9562Y.js";import"./katex.min-BSBacQyE.js";import"./transform-IZH7YNlm.js";function Lt(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}}function Ze(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const Ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ee(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function It(e,t){if(e===t){const{year:u,month:p}=Ee(e);return[{timestamp:new Date(u,p,1).getTime(),key:`${u}-${p}`,label:`${Ce[p]} ${u}`}]}const r=Ee(e),s=Ee(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?`${Ce[x]} ${r.year}`:Ce[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 At=({points:e,metric:t})=>{const r=vt(),[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,ne=i-l-u,L=c-p-f,T=e.map(o=>Ze(o.date)),z=Math.min(...T),I=Math.max(...T),ae=I-z||1,Y=o=>z===I?l+ne/2:l+(o-z)/ae*ne,G=e.map((o,m)=>{const k=Y(Ze(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}},ie=[],b=N.length>0?P(N[N.length-1]):null;let _e=-1/0;for(let o=0;ob.left-fe||(_e=m.right,ie.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}b&&ie.push({x:b.x,y:b.y,text:b.text,anchor:b.anchor});const K=It(z,I),W=5,ce=o=>a(m=>m===o?null:m),le=o=>{o&&r(`/paper/${o}`)},pe=(o,m)=>{const v=`${o.data.modelName||o.data.paperTitle||"Unknown model"}: ${se(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:()=>ce(o.idx),onFocus:()=>a(o.idx),onBlur:()=>ce(o.idx),onClick:()=>le(o.data.paperRouteId),onKeyDown:C=>{M&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),le(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:se(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"}}))}),ie.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}: ${se(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 Pt(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 Dt=(()=>{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 Ut(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 Wt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function qt(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),Wt(a)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function zt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Gt(e,t){return dt(t).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function Kt(e,t,r,s){const a=`.${e}:${t}`,i=r.cssText?zt(r):Gt(r,s);return document.createTextNode(`${a}{${i}}`)}function et(e,t,r,s){const a=window.getComputedStyle(e,r),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=Dt();try{t.className=`${t.className} ${c}`}catch{return}const l=document.createElement("style");l.appendChild(Kt(c,r,a,s)),t.appendChild(l)}function Qt(e,t,r){et(e,t,":before",r),et(e,t,":after",r)}const tt="application/font-woff",rt="image/jpeg",Xt={woff:tt,woff2:tt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:rt,jpeg:rt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Yt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Te(e){const t=Yt(e).toLowerCase();return Xt[t]||""}function Jt(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Zt(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 Ne={};function er(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=er(e,t,r.includeQueryParams);if(Ne[s]!=null)return Ne[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")||""),Jt(l)));a=Zt(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 Ne[s]=a,a}async function tr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ve(t)}async function rr(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=Te(r),a=await Me(r,s,t);return ve(a)}async function sr(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 nr(e,t){return A(e,HTMLCanvasElement)?tr(e):A(e,HTMLVideoElement)?rr(e,t):A(e,HTMLIFrameElement)?sr(e,t):e.cloneNode(ht(e))}const ar=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",ht=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ir(e,t,r){var s,a;if(ht(t))return t;let i=[];return ar(e)&&e.assignedNodes?i=q(e.assignedNodes()):A(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||A(e,HTMLVideoElement)||await i.reduce((c,l)=>c.then(()=>je(l,r)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function cr(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`),A(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 lr(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function or(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function dr(e,t,r){return A(t,Element)&&(cr(e,t,r),Qt(e,t,r),lr(e,t),or(e,t)),t}async function ur(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;inr(s,t)).then(s=>ir(e,s,t)).then(s=>dr(e,s,t)).then(s=>ur(s,t))}const ft=/url\((['"]?)([^'"]+?)\1\)/g,mr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,hr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function pr(e){const t=[];return e.replace(ft,(r,s,a)=>(t.push(a),r)),t.filter(r=>!Re(r))}async function gr(e,t,r,s,a){try{const i=r?Pt(t,r):t,c=Te(t);let l;return a||(l=await Me(i,c,s)),e.replace(fr(t),`$1${l}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(hr,r=>{for(;;){const[s,,a]=mr.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=xr(e,r);return pr(s).reduce((i,c)=>i.then(l=>gr(l,c,t,r)),Promise.resolve(s))}async function re(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 br(e,t){await re("background",e,t)||await re("background-image",e,t),await re("mask",e,t)||await re("-webkit-mask",e,t)||await re("mask-image",e,t)||await re("-webkit-mask-image",e,t)}async function yr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!Re(e.src))&&!(A(e,SVGImageElement)&&!Re(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await Me(s,Te(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 wr(e,t){const s=q(e.childNodes).map(a=>xt(a,t));await Promise.all(s).then(()=>e)}async function xt(e,t){A(e,Element)&&(await br(e,t),await yr(e,t),await wr(e,t))}function vr(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 st={};async function nt(e){let t=st[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},st[e]=t,t}async function at(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 it(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 jr(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=nt(u).then(f=>at(f,t)).then(f=>it(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(nt(a.href).then(l=>at(l,t)).then(l=>it(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 _r(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>pt(t.style.getPropertyValue("src")))}async function kr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=q(e.ownerDocument.styleSheets),s=await jr(r,t);return _r(s)}function bt(e){return e.trim().replace(/["']/g,"")}function Sr(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 Cr(e,t){const r=await kr(e,t),s=Sr(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 Er(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Cr(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 Nr(e,t={}){const{width:r,height:s}=ut(e,t),a=await je(e,t,!0);return await Er(a,t),await xt(a,t),vr(a,t),await qt(a,r,s)}async function Rr(e,t={}){const{width:r,height:s}=ut(e,t),a=await Nr(e,t),i=await ve(a),c=document.createElement("canvas"),l=c.getContext("2d"),u=t.pixelRatio||Vt(),p=t.canvasWidth||r,f=t.canvasHeight||s;return c.width=p*u,c.height=f*u,t.skipAutoScale||Ot(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 $r(e,t={}){const r=await Rr(e,t);return await Ut(r)}const $e="#ffffff";function Tr(){return typeof window>"u"?$e:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||$e}function Mr(e){if(typeof window>"u")return $e;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Tr():t}async function Fr(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 $r(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Mr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const ct=({targetRef:e,label:t})=>{const{toast:r}=jt(),[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 Fr(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(Mt,{name:"copy",size:11}),l]})};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 lt(e,t){return t?e.id===t||e.sourceEvaluationIds.includes(t):!1}function ot(e,t){return e.ranksByMetric[t]??e.best_rank??9999}function Ar(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 Pr=5;function Dr(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||"—"}const es=()=>{var Le,Ie,Ae,Pe,De,Be,He,Ve,Oe,Ue,We,qe,ze;const{datasetSlug:e}=_t(),[t]=kt(),r=t.get("task")||void 0,s=t.get("eval")||void 0,{preferences:a,setHideClosedSourceEvals:i}=St(),[c,l]=w.useState(void 0),u=w.useRef(null),p=w.useRef(!1),f=w.useRef(null),y=w.useRef(null),x=ee({queryKey:["dataset",e,"with-paper",r,a.hide_closed_source_evals?"open":"all"],queryFn:()=>me.getDatasetBySlug(e,{include_paper:!0,task:r,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),E=ee({queryKey:["dataset-evals",(Le=x.data)==null?void 0:Le.id],queryFn:()=>Nt.byDataset(x.data.id),enabled:!!((Ie=x.data)!=null&&Ie.id),staleTime:5*60*1e3}),U=ee({queryKey:["dataset-tasks",(Ae=x.data)==null?void 0:Ae.id],queryFn:()=>me.datasetTasks(x.data.id),enabled:!!((Pe=x.data)!=null&&Pe.id),staleTime:10*60*1e3}),ne=ee({queryKey:["metric-directions"],queryFn:()=>me.metricDirections(),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]),T=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,$=-1;for(const j of d){const de=h.get(j.id)||0;de>$&&($=de,S=j.id)}if(S)return S}return d[0].id},[U.data,E.data,r,L]),z=ee({queryKey:["task-benchmark-trends",T,a.hide_closed_source_evals?!0:void 0],queryFn:()=>me.trendingBenchmarks(T,{limit:100,min_recent_papers:0,is_open:a.hide_closed_source_evals?!0:void 0}),enabled:!!T&&!!((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]),ae=ee({queryKey:["leaderboard-metrics",(He=x.data)==null?void 0:He.id,T],queryFn:()=>me.leaderboardMetrics(x.data.id,T),enabled:!!((Ve=x.data)!=null&&Ve.id)&&!!T,staleTime:10*60*1e3}),Y=w.useMemo(()=>Lt(E.data,T,a.hide_closed_source_evals),[E.data,T,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(()=>(ae.data||[]).map(d=>d.metric_name),[ae.data]),P=J.length?J:fe,ie=w.useMemo(()=>{var S;if(H.length===0)return P[0]||"";const d=new Map;for(const $ of H)for(const j of Object.keys($.metrics||{}))J.length&&!P.includes(j)||d.set(j,(d.get(j)||0)+1);let g=null,h=0;for(const[$,j]of d)j>h&&(h=j,g=$);return g||P[0]||((S=H[0])==null?void 0:S.best_metric)||""},[H,P,J]),b=c||(L==null?void 0:L.best_metric)||ie,K=(((Ue=(Oe=ne.data)==null?void 0:Oe.directions)==null?void 0:Ue[b])||"higher_is_better")==="lower_is_better"?"↓":"↑",W=w.useMemo(()=>!b||!P.includes(b)?P:[b,...P.filter(d=>d!==b)],[P,b]),ce=w.useMemo(()=>W.length===0?b?[b]:[]:W.slice(0,Pr),[W,b]),{points:le,sota:pe,sotaModel:o}=w.useMemo(()=>Ar(H,b,K),[H,b,K]),m=(We=x.data)==null?void 0:We.leaderboard_summary,k=E.isSuccess&&U.isSuccess&&ne.isSuccess&&(!T||ae.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 T?d.find(g=>g.id===T)||d[0]||null:d[0]||null},[U.data,T]);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(Rt,{variant:"destructive",children:n.jsx($t,{children:"Benchmark not found."})})});const _=x.data,Q=H.slice().sort((d,g)=>{var $,j;const h=he(($=d.metrics)==null?void 0:$[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:ot(d,b)-ot(g,b)}),Fe=!!_.supports_harness,R=s&&Q.find(d=>lt(d,s))||null,F=_.introducing_paper??void 0,oe=(F==null?void 0:F.arxiv_id)||(F==null?void 0:F.id)||Dr(_.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=!!oe||!!_.paper_url||!!X,wt=F!=null&&F.arxiv_id||(ze=_.paper_url)!=null&&ze.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${oe}`:`Paper ${oe}`;return n.jsx("div",{className:"page",children:n.jsxs("div",{className:"bm-page",children:[n.jsxs("div",{className:"breadcrumb",children:[n.jsx(ue,{to:"/tasks",children:"Tasks"}),B&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"sep",children:"/"}),n.jsx(ue,{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(Tt,{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:se(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"}),oe?n.jsxs(ue,{to:`/paper/${oe}`,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:Ft(_.paper_url)??void 0,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})]})]}),le.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:[P.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(ct,{targetRef:f,label:"SOTA chart"})]})]}),n.jsx("div",{className:"bm-chart-wrap",children:n.jsx(At,{points:le,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 $,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&&(($=R.metrics)==null?void 0:$[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,": ",se(S),g?" · ":""]}):null,d?n.jsx(ue,{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:[P.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(ct,{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"}),ce.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 $=he((Ke=h.metrics)==null?void 0:Ke[b]);let j=null;$!==null&&((d===null||$!==d)&&(g=S+1,d=$),j=g);const de=h.paper_arxiv_id||h.paper_id,Ge=h.paper_title||(h.paper_arxiv_id?`arXiv:${h.paper_arxiv_id}`:null),ke=lt(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(Ct,{}),(h.external??h.is_external)&&n.jsx(Et,{sourceUrl:h.source_url||h.external_source_url||h.result_url})]}),Fe&&n.jsx("td",{className:"col-harness",children:h.harness||"—"}),ce.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!==""?se(ge):"—"},Se)}),n.jsx("td",{className:"col-paper",children:de?n.jsx(ue,{to:`/paper/${de}`,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{es as default}; diff --git a/assets/BenchmarkTrendSparkline-CN-RBbNH.js b/assets/BenchmarkTrendSparkline-CrCjGcyr.js similarity index 97% rename from assets/BenchmarkTrendSparkline-CN-RBbNH.js rename to assets/BenchmarkTrendSparkline-CrCjGcyr.js index c55fb2c11362ba5125748117dffdf47824de6911..5a6a45a4d71b504dcf03c2f7eff51ff749e93b1a 100644 --- a/assets/BenchmarkTrendSparkline-CN-RBbNH.js +++ b/assets/BenchmarkTrendSparkline-CrCjGcyr.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-D9_nPZtO.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-Czt286FG.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/ChatMessage-CIUk_Zbp.js b/assets/ChatMessage-BctqyM5G.js similarity index 98% rename from assets/ChatMessage-CIUk_Zbp.js rename to assets/ChatMessage-BctqyM5G.js index 86fd2ee703acfdc7a8dfa809e340642f18e7b136..d6f522b406fcff1e252eb704b6aef409532d6dc2 100644 --- a/assets/ChatMessage-CIUk_Zbp.js +++ b/assets/ChatMessage-BctqyM5G.js @@ -1,4 +1,4 @@ -import{d as L,r as C,j as e,R as f,C as B}from"./index-D9_nPZtO.js";import{u as O,a as q,b as D,M as J,R as Q,W as Z,p as F,A as ee,F as te,G as A,H as se}from"./chatSessions-CQv5Fwer.js";import"./katex.min-BSBacQyE.js";import{H as R,a as M,b as H}from"./hover-card-DVeX2fQl.js";import{u as ae}from"./useQuery-cycUreG-.js";import{f as re,p as ne}from"./github-DYxu-4Fs.js";import{G as U}from"./github-DngRIean.js";import{r as ie,a as oe,P as G}from"./PaperPreviewLink-D3OkhqBL.js";import{M as ce,r as le,d as de}from"./index-XzA0bTLC.js";import{F as ue}from"./file-text-CM_ChV1A.js";/** +import{d as L,r as C,j as e,R as f,C as B}from"./index-Czt286FG.js";import{u as O,a as q,b as D,M as J,R as Q,W as Z,p as F,A as ee,F as te,G as A,H as se}from"./chatSessions-lE15HqmS.js";import"./katex.min-BSBacQyE.js";import{H as R,a as M,b as H}from"./hover-card-g7QtmX4K.js";import{u as ae}from"./useQuery-DLzEukS9.js";import{f as re,p as ne}from"./github-Cy0ZQSs0.js";import{G as U}from"./github-HgTw2jEK.js";import{r as ie,a as oe,P as G}from"./PaperPreviewLink-D8Gj_IIj.js";import{M as ce,r as le,d as de}from"./index-Bzn4VKTO.js";import{F as ue}from"./file-text-D3BfQF99.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-DscYSLiQ.js b/assets/ChatView-D9MyddkD.js similarity index 99% rename from assets/ChatView-DscYSLiQ.js rename to assets/ChatView-D9MyddkD.js index 8cba291995df7b5b9e050b6f0c1ae2d036be047e..73a72379ecc24b1e84b0b34a3de569cb03dc379c 100644 --- a/assets/ChatView-DscYSLiQ.js +++ b/assets/ChatView-D9MyddkD.js @@ -1,4 +1,4 @@ -import{d as qt,e as Ze,r as c,j as r,f as Bt,u as Ht,a as Wt,g as Gt,h as Kt,k as $t,l as Vt,b as zt,X as Qt,c as Jt}from"./index-D9_nPZtO.js";import{u as Xt}from"./useQuery-cycUreG-.js";import{C as St,U as Et,A as Zt}from"./ChatMessage-CIUk_Zbp.js";import{d as en,g as ct,t as Lt,r as tn,S as nn,P as rn,D as sn,l as an,C as Xe,e as ze,f as on,h as Qe,i as Je,j as cn,k as ln,m as un,n as Ct,o as dn,T as hn,p as kt,s as it,v as fn,w as pn,x as mn,y as gn}from"./chatSessions-CQv5Fwer.js";import{S as yn}from"./chatPrompts-CDY3UGU1.js";import{u as bn,r as vn,a as _n,O as wn,b as xn}from"./openrouter-D8ilQuCd.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DVeX2fQl.js";import"./github-DYxu-4Fs.js";import"./github-DngRIean.js";import"./PaperPreviewLink-D3OkhqBL.js";import"./index-XzA0bTLC.js";import"./file-text-CM_ChV1A.js";import"./chevron-down-D6vo9F6c.js";/** +import{d as qt,e as Ze,r as c,j as r,f as Bt,u as Ht,a as Wt,g as Gt,h as Kt,k as $t,l as Vt,b as zt,X as Qt,c as Jt}from"./index-Czt286FG.js";import{u as Xt}from"./useQuery-DLzEukS9.js";import{C as St,U as Et,A as Zt}from"./ChatMessage-BctqyM5G.js";import{d as en,g as ct,t as Lt,r as tn,S as nn,P as rn,D as sn,l as an,C as Xe,e as ze,f as on,h as Qe,i as Je,j as cn,k as ln,m as un,n as Ct,o as dn,T as hn,p as kt,s as it,v as fn,w as pn,x as mn,y as gn}from"./chatSessions-lE15HqmS.js";import{S as yn}from"./chatPrompts-CDY3UGU1.js";import{u as bn,r as vn,a as _n,O as wn,b as xn}from"./openrouter-D-TuExng.js";import"./katex.min-BSBacQyE.js";import"./hover-card-g7QtmX4K.js";import"./github-Cy0ZQSs0.js";import"./github-HgTw2jEK.js";import"./PaperPreviewLink-D8Gj_IIj.js";import"./index-Bzn4VKTO.js";import"./file-text-D3BfQF99.js";import"./chevron-down-D8AKxdK5.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ConferenceDetailView-B9R293-r.js b/assets/ConferenceDetailView-B9R293-r.js deleted file mode 100644 index 975673090833c53724ee34963f28998a03354254..0000000000000000000000000000000000000000 --- a/assets/ConferenceDetailView-B9R293-r.js +++ /dev/null @@ -1 +0,0 @@ -import{f as L,r as D,j as e,L as p,c as C}from"./index-D9_nPZtO.js";import{u as T}from"./useQuery-cycUreG-.js";import{M as F}from"./MarkdownText-skQuzg4e.js";import{c as B,h as A,d as E}from"./transform-BObV5jzB.js";import{S as f}from"./skeleton-CQ2CM4l9.js";import{A as P,a as z}from"./alert-B0bcMmNw.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-D3OkhqBL.js";import"./index-XzA0bTLC.js";import"./hover-card-DVeX2fQl.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(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}`},X=()=>{var k,S,b,_,$,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[R(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=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.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?O(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:M(s.url)??void 0,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{X as default}; diff --git a/assets/ConferenceDetailView-BdyVHxJR.js b/assets/ConferenceDetailView-BdyVHxJR.js new file mode 100644 index 0000000000000000000000000000000000000000..494849bbbdef42d436215624ba501dffecb11342 --- /dev/null +++ b/assets/ConferenceDetailView-BdyVHxJR.js @@ -0,0 +1 @@ +import{f as L,r as D,j as e,L as p}from"./index-Czt286FG.js";import{u as T}from"./useQuery-DLzEukS9.js";import{M as F}from"./MarkdownText-DfT-SORZ.js";import{c as A}from"./catalog-BRyB71ZU.js";import{c as B,h as C,d as E}from"./transform-IZH7YNlm.js";import{S as f}from"./skeleton-B7eqTJnv.js";import{A as P,a as z}from"./alert-pIw6ZaYb.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-D8Gj_IIj.js";import"./index-Bzn4VKTO.js";import"./hover-card-g7QtmX4K.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",O=(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}`},Z=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.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((n,r)=>n+r.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?O(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:M(s.url)??void 0,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:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.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((n,r)=>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))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.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:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.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(l=>{const d=l.slug||"",x=B(C(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)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{Z as default}; diff --git a/assets/ConferenceTaskView-DDnwDUzk.js b/assets/ConferenceTaskView-DDnwDUzk.js new file mode 100644 index 0000000000000000000000000000000000000000..cf5533aba646f6fa2bb5e087e9972308de6bf73c --- /dev/null +++ b/assets/ConferenceTaskView-DDnwDUzk.js @@ -0,0 +1 @@ +import{f as $,a as D,r as x,j as e,L as b,R as W}from"./index-Czt286FG.js";import{u as M}from"./useQuery-DLzEukS9.js";import{P as G}from"./components-D0aZHC0e.js";import{u as J,P as X}from"./useIntersectionObserver-DWuiXfmk.js";import{M as h}from"./MarkdownText-DfT-SORZ.js";import{c as z}from"./catalog-BRyB71ZU.js";import{t as Y,d as Z}from"./transform-IZH7YNlm.js";import{c as ee}from"./usePapers-BlskNTEC.js";import{S as se}from"./skeleton-B7eqTJnv.js";import{A as ae,a as te}from"./alert-pIw6ZaYb.js";import"./LatexTitle-BMNMJu5R.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-D8Gj_IIj.js";import"./index-Bzn4VKTO.js";import"./hover-card-g7QtmX4K.js";import"./useInfiniteQuery-Dk5Z9hLn.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",be=()=>{var A,F,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=M({queryKey:["conference",a],queryFn:()=>z.getConference(a),enabled:!!a,staleTime:10*60*1e3}),f=M({queryKey:["task",n],queryFn:()=>z.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:R}=J({rootMargin:"200px"});x.useEffect(()=>{R&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[R,i.hasNextPage,i.isFetchingNextPage]),x.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=x.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=x.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((A=f.data)==null?void 0:A.name)||n||"",((F=f.data)==null?void 0:F.slug)||n),C=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=f.data;return m.error||f.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{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(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.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:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{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/)."}),l&&a==="icml-2026"&&e.jsx(h,{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/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:C.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.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:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",C.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.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:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{be as default}; diff --git a/assets/ConferenceTaskView-tg9N-zJJ.js b/assets/ConferenceTaskView-tg9N-zJJ.js deleted file mode 100644 index 627ac3af814a0f9dced0b32285659b226248116e..0000000000000000000000000000000000000000 --- a/assets/ConferenceTaskView-tg9N-zJJ.js +++ /dev/null @@ -1 +0,0 @@ -import{f as $,a as D,r as f,j as e,L as b,R as W,c as M}from"./index-D9_nPZtO.js";import{u as z}from"./useQuery-cycUreG-.js";import{P as G}from"./components-DrTew0nD.js";import{u as J,P as X}from"./useIntersectionObserver-CZXk9yc2.js";import{M as h}from"./MarkdownText-skQuzg4e.js";import{t as Y,d as Z}from"./transform-BObV5jzB.js";import{c as ee}from"./usePapers-B3J6SKWU.js";import{S as se}from"./skeleton-CQ2CM4l9.js";import{A as ae,a as te}from"./alert-B0bcMmNw.js";import"./LatexTitle-BtRWGRIx.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-D3OkhqBL.js";import"./index-XzA0bTLC.js";import"./hover-card-DVeX2fQl.js";import"./useInfiniteQuery-CQNVzwuX.js";const re=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ne=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",ve=()=>{var F,A,L,O,T,B;const{confSlug:a,taskSlug:n}=$(),[c,j]=D(),y=ne(c.get("order_by")),S=c.get("has_code")==="true",w=c.get("has_hf_artifacts")==="true",I=t=>{const s=new URLSearchParams(c);s.set("order_by",t),j(s)},q=t=>{const s=new URLSearchParams(c);t?s.set("has_code","true"):s.delete("has_code"),j(s)},Q=t=>{const s=new URLSearchParams(c);t?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),j(s)},k=n==="all",P=n==="oral",N=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",u=l||d,p=k||P||N||l||d,K=p?void 0:n,U=P?"oral":N?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=z({queryKey:["conference",a],queryFn:()=>M.getConference(a),enabled:!!a,staleTime:10*60*1e3}),x=z({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),i=ee({conferenceSlug:a||"",taskSlug:K,presentation:U,page_size:12,order_by:y,order_dir:"desc",include_resources:!0,has_code:S,has_hf_artifacts:w,enabled:!!a}),{targetRef:V,isIntersecting:C}=J({rootMargin:"200px"});f.useEffect(()=>{C&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[C,i.hasNextPage,i.isFetchingNextPage]),f.useEffect(()=>{window.scrollTo(0,0)},[a,n]);const _=f.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[i.data]),v=f.useMemo(()=>_.map(Y),[_]),g=k?"All papers":P?"Oral papers":N?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":Z(((F=x.data)==null?void 0:F.name)||n||"",((A=x.data)==null?void 0:A.slug)||n),R=((O=(L=i.data)==null?void 0:L.pages[0])==null?void 0:O.count)??((T=m.data)==null?void 0:T.paper_count)??0,r=x.data;return m.error||x.error||i.error?e.jsx("div",{className:"page",children:e.jsx(ae,{variant:"destructive",children:e.jsx(te,{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(b,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(b,{to:`/conferences/${a}`,children:((B=m.data)==null?void 0:B.name)??a}),e.jsx("span",{children:" / "}),e.jsx("span",{children:g})]}),e.jsxs("div",{className:!p&&(r!=null&&r.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:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:g}),l&&a==="iclr-2026"&&e.jsx(h,{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/)."}),l&&a==="icml-2026"&&e.jsx(h,{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/)."}),d&&a==="cvpr-2026"&&e.jsx(h,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(h,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:R.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.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:r.image_url,alt:`${g} schematic`,onError:t=>{var s,o;(o=(s=t.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",g,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(h,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:u?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",R.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!u&&e.jsx("div",{className:"sort-options",children:re.map(([t,s])=>e.jsx("button",{className:`sort-btn ${y===t?"active":""}`,onClick:()=>I(t),children:s},t))}),e.jsx(X,{hasCode:S,hasHfArtifacts:w,onHasCodeChange:q,onHasHfArtifactsChange:Q,showDivider:!u})]}),!u&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:g})]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((t,s)=>e.jsx(se,{className:"h-40 w-full"},s))}):v.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:v.map((t,s)=>{var E;const o=(E=_[s])==null?void 0:E.conference_award,H=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[H&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:H}),e.jsx(G,{paper:t,rank:s+1})]},t.id)})}),e.jsx("div",{ref:V,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{ve as default}; diff --git a/assets/ConferencesIndexView-CqQhkVsQ.js b/assets/ConferencesIndexView-CqQhkVsQ.js new file mode 100644 index 0000000000000000000000000000000000000000..c6179943d8f7aeaa0c0b7122570ce73b5c7f1b6c --- /dev/null +++ b/assets/ConferencesIndexView-CqQhkVsQ.js @@ -0,0 +1 @@ +import{r as u,j as e,L as d}from"./index-Czt286FG.js";import{u as p}from"./useQuery-DLzEukS9.js";import{c as f}from"./catalog-BRyB71ZU.js";import{S as m}from"./skeleton-B7eqTJnv.js";import{A as h,a as g}from"./alert-pIw6ZaYb.js";import{T as x}from"./TaxonomySuggestionTile-lcZG5E-y.js";import"./SignInToEditDialog-Dgq0yOYP.js";import"./button-vhqVRnBn.js";import"./textarea-Ov25LunA.js";import"./dialog-CJthLFv3.js";import"./useMutation-DqQi_NTN.js";import"./submissions-BsEO_Bbg.js";import"./loader-circle-DyZRZBrM.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},M=()=>{const r=p({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{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."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.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:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{M as default}; diff --git a/assets/ConferencesIndexView-VmZKLP09.js b/assets/ConferencesIndexView-VmZKLP09.js deleted file mode 100644 index 4135784327ebf73304963b8facdf911f00892d66..0000000000000000000000000000000000000000 --- a/assets/ConferencesIndexView-VmZKLP09.js +++ /dev/null @@ -1 +0,0 @@ -import{r as u,j as e,L as d,c as p}from"./index-D9_nPZtO.js";import{u as h}from"./useQuery-cycUreG-.js";import{S as m}from"./skeleton-CQ2CM4l9.js";import{A as f,a as g}from"./alert-B0bcMmNw.js";import{T as x}from"./TaxonomySuggestionTile-BO-dHwso.js";import"./SignInToEditDialog-NNf7Zp6R.js";import"./button-B859643f.js";import"./textarea-BVF3ykiv.js";import"./dialog-DnjY6ZOM.js";import"./useMutation-CJCfaNMQ.js";import"./loader-circle-CrVj12oC.js";const j=(r,a)=>{if(!r)return null;const t=new Date(`${r}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=t.getFullYear();return s&&s.getTime()!==t.getTime()?t.getMonth()===s.getMonth()?`${n(t).replace(/\d+$/,"").trim()} ${t.getDate()}–${s.getDate()}, ${i}`:`${n(t)} – ${n(s)}, ${i}`:`${n(t)}, ${i}`},v=r=>{var t;if(r.year!=null)return r.year;if(r.start_date)return Number(r.start_date.slice(0,4));const a=(t=r.slug.match(/-(\d{4})$/))==null?void 0:t[1];return a?Number(a):0},y=(r,a)=>{if(r.start_date&&a.start_date){const t=r.start_date.localeCompare(a.start_date);if(t!==0)return t}else{if(r.start_date)return-1;if(a.start_date)return 1}return r.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},F=()=>{const r=h({queryKey:["conferences"],queryFn:()=>p.getConferences(),staleTime:6e5}),a=u.useMemo(()=>{var s;if(!((s=r.data)!=null&&s.results))return null;const t={};return r.data.results.forEach(n=>{const i=v(n);(t[i]||(t[i]=[])).push(n)}),Object.values(t).forEach(n=>n.sort(y)),Object.keys(t).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:t[n]}))},[r.data]);return r.error?e.jsx("div",{className:"page",children:e.jsx(f,{variant:"destructive",children:e.jsx(g,{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."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),r.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((t,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:t,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.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:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},t)})]})};export{F as default}; diff --git a/assets/CronDashboard-DFeDiILJ.js b/assets/CronDashboard-DFeDiILJ.js deleted file mode 100644 index 201bec96c4d247a3cfed19013b76a5650869f2ee..0000000000000000000000000000000000000000 --- a/assets/CronDashboard-DFeDiILJ.js +++ /dev/null @@ -1,56 +0,0 @@ -import{d as w,r as m,j as e,v as N,O as Ae,o as Ee,n as H,a6 as De,Q as Ie,S as Je,q as z,P as qe,t as Oe,T as ce,L as He,k as We,c as L,g as Be,b as Ue}from"./index-D9_nPZtO.js";import{u as E}from"./useQuery-cycUreG-.js";import{B as _,D as se,f as ze}from"./codexAddEvals-Xch_LMp1.js";import{B as A}from"./button-B859643f.js";import{C as Ke}from"./chevron-down-D6vo9F6c.js";import{F as ae}from"./file-text-CM_ChV1A.js";import{C as D,R as re,S as Qe}from"./shield-alert-CDv23c0X.js";import{L as C}from"./loader-circle-CrVj12oC.js";import{C as Q}from"./circle-check-I1TZu4fL.js";import{E as le}from"./external-link-DlvfPaEN.js";import{u as ne}from"./useMutation-CJCfaNMQ.js";import{u as Ge}from"./useInfiniteQuery-CQNVzwuX.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 O=w("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** - * @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 Ve=w("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** - * @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 Xe=w("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @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 Ye=w("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @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 Ze=w("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** - * @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 es=w("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 ss=w("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. - * See the LICENSE file in the root directory of this source tree. - */const oe=w("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @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 as=w("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/** - * @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 rs=w("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** - * @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=w("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"}]]),u=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:N("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));u.displayName="Card";const j=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:N("flex flex-col space-y-1.5 p-6",s),...a}));j.displayName="CardHeader";const f=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:N("text-2xl font-semibold leading-none tracking-tight",s),...a}));f.displayName="CardTitle";const k=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:N("text-sm text-muted-foreground",s),...a}));k.displayName="CardDescription";const p=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:N("p-6 pt-0",s),...a}));p.displayName="CardContent";const ts=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:N("flex items-center p-6 pt-0",s),...a}));ts.displayName="CardFooter";var W="Tabs",[is]=Oe(W,[ce]),de=ce(),[cs,G]=is(W),me=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:l,defaultValue:d,orientation:x="horizontal",dir:o,activationMode:i="automatic",...h}=s,b=Ae(o),[c,g]=Ee({prop:n,onChange:l,defaultProp:d??"",caller:W});return e.jsx(cs,{scope:r,baseId:De(),value:c,onValueChange:g,orientation:x,dir:b,activationMode:i,children:e.jsx(H.div,{dir:b,"data-orientation":x,...h,ref:a})})});me.displayName=W;var xe="TabsList",he=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...l}=s,d=G(xe,r),x=de(r);return e.jsx(Ie,{asChild:!0,...x,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(H.div,{role:"tablist","aria-orientation":d.orientation,...l,ref:a})})});he.displayName=xe;var ue="TabsTrigger",pe=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:l=!1,...d}=s,x=G(ue,r),o=de(r),i=fe(x.baseId,n),h=ve(x.baseId,n),b=n===x.value;return e.jsx(Je,{asChild:!0,...o,focusable:!l,active:b,children:e.jsx(H.button,{type:"button",role:"tab","aria-selected":b,"aria-controls":h,"data-state":b?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:i,...d,ref:a,onMouseDown:z(s.onMouseDown,c=>{!l&&c.button===0&&c.ctrlKey===!1?x.onValueChange(n):c.preventDefault()}),onKeyDown:z(s.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&x.onValueChange(n)}),onFocus:z(s.onFocus,()=>{const c=x.activationMode!=="manual";!b&&!l&&c&&x.onValueChange(n)})})})});pe.displayName=ue;var ge="TabsContent",je=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:l,children:d,...x}=s,o=G(ge,r),i=fe(o.baseId,n),h=ve(o.baseId,n),b=n===o.value,c=m.useRef(b);return m.useEffect(()=>{const g=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(g)},[]),e.jsx(qe,{present:l||b,children:({present:g})=>e.jsx(H.div,{"data-state":b?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":i,hidden:!g,id:h,tabIndex:0,...x,ref:a,style:{...s.style,animationDuration:c.current?"0s":void 0},children:g&&d})})});je.displayName=ge;function fe(s,a){return`${s}-trigger-${a}`}function ve(s,a){return`${s}-content-${a}`}var ls=me,Ne=he,be=pe,ye=je;const os=ls,_e=m.forwardRef(({className:s,...a},r)=>e.jsx(Ne,{ref:r,className:N("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));_e.displayName=Ne.displayName;const R=m.forwardRef(({className:s,...a},r)=>e.jsx(be,{ref:r,className:N("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}));R.displayName=be.displayName;const F=m.forwardRef(({className:s,...a},r)=>e.jsx(ye,{ref:r,className:N("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));F.displayName=ye.displayName;function v(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),l=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:l<24?`${l}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function we(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 ke(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function Ce(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const ds={healthy:Q,degraded:ns,broken:D,running:C,stuck:D,unknown:Ye};function ms({status:s,isRunning:a}){const r=a?"running":s,n=ds[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function te({icon:s,title:a,metrics:r}){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(r).map(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Ce(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof l=="number"?l.toLocaleString():l})]},n))})]})}function xs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(O,{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",ke(s)],...s.updated_at?[["Updated",v(s.updated_at)]]:[]].map(([a,r])=>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:r})]},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(_,{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,r])=>e.jsxs(_,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function hs(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function us({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",className:hs(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(le,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",v(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",v(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",we(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function ps({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(as,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(C,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Ce(n)}),e.jsx("div",{className:"text-lg font-semibold",children:l.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(us,{job:n},n.id))})]})]})}function gs({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:l=!1,paperMarkdownJobsError:d=null}){const x=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),i=s.job_name==="paper_markdown_backfill",h=x||o||!!s.workflow_status||i;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"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(ms,{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(_,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(_,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),h&&(a?e.jsx(Xe,{className:"h-4 w-4 cron-muted"}):e.jsx(Ke,{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(oe,{}),"Log: ",v(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(se,{}),"DB: ",v(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(rs,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(O,{}),"Duration: ",we(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(Ve,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ae,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(O,{}),"Actions: ",ke(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(_,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&h&&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&&x&&e.jsx(te,{icon:ae,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(te,{icon:se,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(xs,{workflow:s.workflow_status}),i&&e.jsx(ps,{monitor:n,loading:l,error:d})]})})]})}const Se=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:N("w-full caption-bottom text-sm",s),...a})}));Se.displayName="Table";const Te=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:N("[&_tr]:border-b",s),...a}));Te.displayName="TableHeader";const $e=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:N("[&_tr:last-child]:border-0",s),...a}));$e.displayName="TableBody";const js=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:N("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));js.displayName="TableFooter";const K=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:N("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));K.displayName="TableRow";const P=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:N("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));P.displayName="TableHead";const M=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:N("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));M.displayName="TableCell";const fs=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:N("mt-4 text-sm text-muted-foreground",s),...a}));fs.displayName="TableCaption";const vs={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},Ns={"add-evals":"Add evals","enrich-paper":"Enrich paper"},bs={queued:ss,dispatching:C,running:Ze,completed:Q,failed:D,canceled:es};function ys({status:s}){const a=bs[s];return e.jsxs(_,{variant:"outline",className:vs[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function _s(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 ws({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:l,error:d}=E({queryKey:["codexPaperJobs",a],queryFn:()=>ze(100),refetchInterval:s?1e4:!1,retry:!1}),x=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(u,{className:"mb-8",children:[e.jsx(j,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(f,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(k,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),l&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(p,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(C,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&x!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),x===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&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(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),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:r.summary.total})]})]}),r.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(Se,{children:[e.jsx(Te,{children:e.jsxs(K,{children:[e.jsx(P,{children:"Status"}),e.jsx(P,{children:"Paper"}),e.jsx(P,{children:"Action"}),e.jsx(P,{children:"Requested"}),e.jsx(P,{children:"Execution"})]})}),e.jsx($e,{children:r.jobs.map(o=>{const i=_s(o);return e.jsxs(K,{children:[e.jsx(M,{className:"align-top",children:e.jsx(ys,{status:o.status})}),e.jsxs(M,{className:"min-w-[260px] align-top",children:[e.jsx(He,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[Ns[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(Q,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(M,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:v(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(M,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(le,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),i&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:i,children:i})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",v(r.timestamp)]})]})]})]})}const ks=()=>{var d,x,o;const s=We(),a=Ge({queryKey:["catalog-audit"],queryFn:({pageParam:i})=>L.getCatalogAudit(i),initialPageParam:void 0,getNextPageParam:i=>i.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(i=>i.events))??[],n=ne({mutationFn:()=>L.acknowledgeCatalogAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),l=ne({mutationFn:i=>L.rollbackCatalogEvent(i),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(u,{children:[e.jsxs(j,{className:"flex-row items-center justify-between",children:[e.jsx(f,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(x=a.data)==null?void 0:x.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(A,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(p,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(i=>e.jsxs("article",{className:`rounded-md border p-3 ${i.operation==="delete"||i.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[i.operation," ",i.entity_type," ",i.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",i.actor_username??i.actor_role," ·"," ",new Date(i.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:i.before,after:i.after},null,2)})]}),!i.rollback_of_event_id&&e.jsx(A,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>l.mutate(i.id),disabled:l.isPending||i.rollback_eligible===!1,children:i.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},i.id)),a.hasNextPage&&e.jsx(A,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},ie={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},y=s=>`$${(s/1e6).toFixed(2)}`,Cs=({data:s,loading:a,error:r})=>{const[n,l]=m.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(C,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const x=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),o=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",i=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Circuit"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:o}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Month to date"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(x),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${x}%`}})})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Application headroom"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",y(s.application_cap_microusd)]})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Live compute"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(u,{children:[e.jsxs(j,{children:[e.jsx(f,{children:"Accounting and policy"}),e.jsxs(k,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(p,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:n,onChange:h=>l(h.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),y(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),y(s.provider_floor_microusd)," · ",e.jsx(_,{children:i})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${y(s.environment_cap_microusd)}`," · Workspace ",y(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",y(s.warning_microusd)," · trip ",y(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),v(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?v(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?v(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${v(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${v(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${y(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${v(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${y(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{children:"Live lifecycle"})}),e.jsx(p,{className:"text-sm",children:Object.entries(s.live_states).map(([h,b])=>e.jsxs("span",{className:"mr-4",children:[h,": ",b]},h))})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{children:"Daily spend"})}),e.jsx(p,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(h=>e.jsxs("li",{children:[h.date,": blank ",y(h.blank_pool_microusd)," · assigned ",y(h.assigned_microusd)]},h.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(u,{children:[e.jsxs(j,{children:[e.jsx(f,{children:"Recent circuit events"}),e.jsx(k,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(p,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(h=>e.jsxs("li",{children:[e.jsx(_,{children:h.severity})," ",h.type," · ",v(h.created_at)]},h.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Ss=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(C,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(j,{children:[e.jsx(f,{children:"Web search"}),e.jsxs(k,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",v(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${v(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(l=>e.jsxs("li",{children:[l.type," · ",v(l.created_at),l.error_class?` · ${l.error_class}`:""]},l.id))})]})]})},Hs=()=>{const s=Ue(),[a,r]=m.useState(!0),[n,l]=m.useState(0),[d,x]=m.useState(""),[o,i]=m.useState(""),[h,b]=m.useState(new Set),{user:c}=Be(),{data:g,isLoading:V,isFetching:X,error:S,refetch:Le}=E({queryKey:["cronStatus",c==null?void 0:c.username],queryFn:()=>L.getCronStatus(),enabled:!!(c!=null&&c.is_admin),refetchInterval:a?3e4:!1,retry:!1}),I=E({queryKey:["paperMarkdownJobs",c==null?void 0:c.username],queryFn:()=>L.getPaperMarkdownJobs(),enabled:!!(c!=null&&c.is_admin),refetchInterval:a?3e4:!1,retry:!1}),J=E({queryKey:["chatSandboxSpend",c==null?void 0:c.username,o],queryFn:()=>L.getChatSandboxSpend(o||void 0),enabled:!!(c!=null&&c.is_admin),refetchInterval:a?3e4:!1,retry:!1}),B=E({queryKey:["chatWebSearchBudget",c==null?void 0:c.username],queryFn:()=>L.getChatWebSearchBudget(),enabled:!!(c!=null&&c.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),Y=(S&&typeof S=="object"&&"status"in S?S.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":S instanceof Error?S.message:void 0,Re=t=>{b(T=>{const $=new Set(T);return $.has(t)?$.delete(t):$.add(t),$})},Z=(g==null?void 0:g.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],ee=(g==null?void 0:g.jobs.filter(t=>t.dashboard_group!=="leaderboard_sync"))??[],Fe=ee.filter(t=>t.critical),q=ee.filter(t=>!t.critical).reduce((t,T)=>(t[T.category]||(t[T.category]=[]),t[T.category].push(T),t),{}),Pe=Object.keys(q).sort((t,T)=>{const $=["hourly","daily","weekly"];return $.indexOf(t)-$.indexOf(T)}),U=t=>e.jsx(gs,{job:t,expanded:h.has(t.job_name),onToggle:()=>Re(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?I.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?I.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?I.error:null},t.job_name),Me=()=>{l(t=>t+1),Le(),I.refetch(),J.refetch()};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(O,{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(A,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(re,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(A,{variant:"outline",size:"sm",onClick:Me,disabled:X,children:[e.jsx(re,{className:`h-4 w-4 mr-2 ${X?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(u,{className:"mb-6",children:e.jsx(p,{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(os,{defaultValue:"critical-jobs",children:[e.jsxs(_e,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(R,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(R,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(R,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(R,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(R,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(F,{value:"critical-jobs",className:"mt-6",children:[V&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(D,{className:"h-5 w-5"}),e.jsx("p",{children:Y??"Failed to load CRON jobs status. Please try again."})]})})}),g&&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(t=>e.jsxs(u,{children:[e.jsx(j,{className:"pb-2",children:e.jsx(f,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(p,{children:e.jsx("div",{className:"text-2xl font-bold",children:g.summary[t]})})]},t))}),g.summary.critical_issues.length>0&&e.jsxs(u,{className:"mb-6 cron-status--broken",children:[e.jsx(j,{children:e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(Qe,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(p,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:g.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(u,{className:"mb-8",children:[e.jsx(j,{children:e.jsx(f,{className:"text-base",children:"What to check next"})}),e.jsxs(p,{children:[e.jsx("p",{className:"text-sm cron-muted",children:g.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(oe,{className:"h-4 w-4"}),"Last updated: ",v(g.timestamp)," · Health score:"," ",g.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(u,{className:"mb-8",children:[e.jsxs(j,{children:[e.jsx(f,{className:"text-xl",children:"Critical jobs"}),e.jsx(k,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(p,{className:"space-y-4",children:Fe.map(U)})]}),e.jsx("div",{className:"space-y-6",children:Pe.map(t=>e.jsxs(u,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(f,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(_,{className:ie[t]??ie.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(k,{children:[q[t].length," job",q[t].length!==1?"s":""]})]})}),e.jsx(p,{className:"space-y-4",children:q[t].map(U)})]},t))})]})]}),e.jsxs(F,{value:"leaderboard-syncs",className:"mt-6",children:[V&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(D,{className:"h-5 w-5"}),e.jsx("p",{children:Y??"Failed to load leaderboard sync status. Please try again."})]})})}),g&&e.jsxs(u,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(f,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(k,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(_,{children:[Z.length," jobs"]})]})}),e.jsx(p,{className:"space-y-4",children:Z.map(U)})]})]}),e.jsx(F,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(ws,{autoRefresh:a,refreshToken:n})}),e.jsx(F,{value:"catalog-audit",className:"mt-6",children:e.jsx(ks,{})}),e.jsxs(F,{value:"chat-compute",className:"mt-6",children:[e.jsxs(u,{className:"mb-6",children:[e.jsxs(j,{children:[e.jsx(f,{children:"Environment record"}),e.jsx(k,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(p,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:d,onChange:t=>x(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(A,{onClick:()=>i(d.trim()),children:"Load"})]})]}),e.jsx(Cs,{data:J.data,loading:J.isLoading,error:J.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Ss,{data:B.data,loading:B.isLoading,error:B.error})})]})]})]})})};export{Cs as ChatComputePanel,Ss as WebSearchBudgetPanel,Hs as default}; diff --git a/assets/CronDashboard-Re43pdV1.js b/assets/CronDashboard-Re43pdV1.js new file mode 100644 index 0000000000000000000000000000000000000000..bc669542a90a0e9b4f16cc21fc92dfb14c5bea8b --- /dev/null +++ b/assets/CronDashboard-Re43pdV1.js @@ -0,0 +1,56 @@ +import{d as w,r as m,j as e,v as N,x as Ee,n as De,m as H,O as Ie,y as Je,I as qe,q as z,P as Oe,t as He,z as le,L as We,k as Be,g as Ue,b as ze,c as q}from"./index-Czt286FG.js";import{u as A}from"./useQuery-DLzEukS9.js";import{B as _,D as ae,f as Ke}from"./codexAddEvals-CMSsCOlW.js";import{B as M}from"./button-vhqVRnBn.js";import{C as Qe}from"./chevron-down-D8AKxdK5.js";import{F as re}from"./file-text-D3BfQF99.js";import{C as E,R as ne,S as Ge}from"./shield-alert-CXix4gJs.js";import{L as C}from"./loader-circle-DyZRZBrM.js";import{C as G}from"./circle-check-51xwSfKm.js";import{E as oe}from"./external-link-D9s3iGdi.js";import{u as te}from"./useMutation-DqQi_NTN.js";import{u as Ve}from"./useInfiniteQuery-Dk5Z9hLn.js";import{c as K}from"./catalog-BRyB71ZU.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 O=w("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @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 Xe=w("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + * @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 Ye=w("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @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 Ze=w("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @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 es=w("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** + * @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 ss=w("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 as=w("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. + * See the LICENSE file in the root directory of this source tree. + */const de=w("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @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 rs=w("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/** + * @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=w("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + * @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 ts=w("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"}]]),u=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:N("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a}));u.displayName="Card";const j=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:N("flex flex-col space-y-1.5 p-6",s),...a}));j.displayName="CardHeader";const f=m.forwardRef(({className:s,...a},r)=>e.jsx("h3",{ref:r,className:N("text-2xl font-semibold leading-none tracking-tight",s),...a}));f.displayName="CardTitle";const k=m.forwardRef(({className:s,...a},r)=>e.jsx("p",{ref:r,className:N("text-sm text-muted-foreground",s),...a}));k.displayName="CardDescription";const p=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:N("p-6 pt-0",s),...a}));p.displayName="CardContent";const is=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{ref:r,className:N("flex items-center p-6 pt-0",s),...a}));is.displayName="CardFooter";var W="Tabs",[cs]=He(W,[le]),me=le(),[ls,V]=cs(W),xe=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,onValueChange:l,defaultValue:d,orientation:x="horizontal",dir:o,activationMode:i="automatic",...h}=s,b=Ee(o),[c,g]=De({prop:n,onChange:l,defaultProp:d??"",caller:W});return e.jsx(ls,{scope:r,baseId:Ie(),value:c,onValueChange:g,orientation:x,dir:b,activationMode:i,children:e.jsx(H.div,{dir:b,"data-orientation":x,...h,ref:a})})});xe.displayName=W;var he="TabsList",ue=m.forwardRef((s,a)=>{const{__scopeTabs:r,loop:n=!0,...l}=s,d=V(he,r),x=me(r);return e.jsx(Je,{asChild:!0,...x,orientation:d.orientation,dir:d.dir,loop:n,children:e.jsx(H.div,{role:"tablist","aria-orientation":d.orientation,...l,ref:a})})});ue.displayName=he;var pe="TabsTrigger",ge=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,disabled:l=!1,...d}=s,x=V(pe,r),o=me(r),i=ve(x.baseId,n),h=Ne(x.baseId,n),b=n===x.value;return e.jsx(qe,{asChild:!0,...o,focusable:!l,active:b,children:e.jsx(H.button,{type:"button",role:"tab","aria-selected":b,"aria-controls":h,"data-state":b?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:i,...d,ref:a,onMouseDown:z(s.onMouseDown,c=>{!l&&c.button===0&&c.ctrlKey===!1?x.onValueChange(n):c.preventDefault()}),onKeyDown:z(s.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&x.onValueChange(n)}),onFocus:z(s.onFocus,()=>{const c=x.activationMode!=="manual";!b&&!l&&c&&x.onValueChange(n)})})})});ge.displayName=pe;var je="TabsContent",fe=m.forwardRef((s,a)=>{const{__scopeTabs:r,value:n,forceMount:l,children:d,...x}=s,o=V(je,r),i=ve(o.baseId,n),h=Ne(o.baseId,n),b=n===o.value,c=m.useRef(b);return m.useEffect(()=>{const g=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(g)},[]),e.jsx(Oe,{present:l||b,children:({present:g})=>e.jsx(H.div,{"data-state":b?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":i,hidden:!g,id:h,tabIndex:0,...x,ref:a,style:{...s.style,animationDuration:c.current?"0s":void 0},children:g&&d})})});fe.displayName=je;function ve(s,a){return`${s}-trigger-${a}`}function Ne(s,a){return`${s}-content-${a}`}var os=xe,be=ue,ye=ge,_e=fe;const ds=os,we=m.forwardRef(({className:s,...a},r)=>e.jsx(be,{ref:r,className:N("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));we.displayName=be.displayName;const L=m.forwardRef(({className:s,...a},r)=>e.jsx(ye,{ref:r,className:N("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}));L.displayName=ye.displayName;const R=m.forwardRef(({className:s,...a},r)=>e.jsx(_e,{ref:r,className:N("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));R.displayName=_e.displayName;function v(s){if(!s)return"Never";const a=new Date(s);if(Number.isNaN(a.getTime()))return s;const r=Date.now()-a.getTime(),n=Math.floor(r/6e4),l=Math.floor(r/36e5),d=Math.floor(r/864e5);return n<1?"Just now":n<60?`${n}m ago`:l<24?`${l}h ago`:d<7?`${d}d ago`:a.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ke(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 Ce(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function Se(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const ms={healthy:G,degraded:ts,broken:E,running:C,stuck:E,unknown:Ze};function xs({status:s,isRunning:a}){const r=a?"running":s,n=ms[r];return e.jsx(n,{className:`cron-status-icon cron-status--${r}${r==="running"?" animate-spin":""}`})}function ie({icon:s,title:a,metrics:r}){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(r).map(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Se(n)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof l=="number"?l.toLocaleString():l})]},n))})]})}function hs({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(O,{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",Ce(s)],...s.updated_at?[["Updated",v(s.updated_at)]]:[]].map(([a,r])=>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:r})]},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(_,{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,r])=>e.jsxs(_,{variant:"outline",children:[a,": ",r??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function us(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function ps({job:s}){const a=s.progress,r=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.total_papers*100):0;return e.jsxs("div",{className:"cron-metric-card space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-semibold",children:[s.mode??"unknown"," · shard ",s.shard_id??"N/A"]}),e.jsx("div",{className:"font-mono text-xs cron-muted truncate",children:s.id})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",className:us(s.stage),children:s.stage.toLowerCase()}),s.url&&e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer","aria-label":`Open Hugging Face Job ${s.id}`,className:"cron-info-text",children:e.jsx(oe,{className:"h-4 w-4"})})]})]}),a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between gap-3 text-xs cron-muted mb-1",children:[e.jsxs("span",{children:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[r.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${r}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-sm",children:[e.jsxs("span",{children:[e.jsx("strong",{children:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",v(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.error_samples.map(n=>e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",children:n.arxiv_id}),": ",n.error]},`${n.arxiv_id}:${n.error}`))]})]}):e.jsx("div",{className:"text-sm cron-muted",children:"Waiting for the shard progress checkpoint."}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs cron-muted",children:[s.hardware&&e.jsx("span",{children:s.hardware}),s.created_at&&e.jsxs("span",{children:["Created ",v(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",ke(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function gs({monitor:s,loading:a,error:r}){return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(rs,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(C,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!r&&e.jsx("div",{className:"cron-message cron-message--error",children:"Could not load Hugging Face Jobs."}),s&&!s.available&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.error??"Hugging Face monitoring is unavailable."}),(s==null?void 0:s.available)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-3",children:Object.entries(s.summary).map(([n,l])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Se(n)}),e.jsx("div",{className:"text-lg font-semibold",children:l.toLocaleString()})]},n))}),s.jobs.length===0?e.jsx("div",{className:"cron-metric-card text-sm cron-muted",children:"No OCR shards have been launched yet."}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:s.jobs.map(n=>e.jsx(ps,{job:n},n.id))})]})]})}function js({job:s,expanded:a,onToggle:r,paperMarkdownJobs:n,paperMarkdownJobsLoading:l=!1,paperMarkdownJobsError:d=null}){const x=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),i=s.job_name==="paper_markdown_backfill",h=x||o||!!s.workflow_status||i;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:r,"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(xs,{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(_,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(_,{variant:"outline",className:"cron-status--broken",children:"Stale lock"}),h&&(a?e.jsx(Ye,{className:"h-4 w-4 cron-muted"}):e.jsx(Qe,{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(de,{}),"Log: ",v(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(ae,{}),"DB: ",v(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ns,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(O,{}),"Duration: ",ke(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(Xe,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(re,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(O,{}),"Actions: ",Ce(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(_,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&h&&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&&x&&e.jsx(ie,{icon:re,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(ie,{icon:ae,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(hs,{workflow:s.workflow_status}),i&&e.jsx(gs,{monitor:n,loading:l,error:d})]})})]})}const Te=m.forwardRef(({className:s,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:N("w-full caption-bottom text-sm",s),...a})}));Te.displayName="Table";const $e=m.forwardRef(({className:s,...a},r)=>e.jsx("thead",{ref:r,className:N("[&_tr]:border-b",s),...a}));$e.displayName="TableHeader";const Le=m.forwardRef(({className:s,...a},r)=>e.jsx("tbody",{ref:r,className:N("[&_tr:last-child]:border-0",s),...a}));Le.displayName="TableBody";const fs=m.forwardRef(({className:s,...a},r)=>e.jsx("tfoot",{ref:r,className:N("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));fs.displayName="TableFooter";const Q=m.forwardRef(({className:s,...a},r)=>e.jsx("tr",{ref:r,className:N("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));Q.displayName="TableRow";const F=m.forwardRef(({className:s,...a},r)=>e.jsx("th",{ref:r,className:N("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));F.displayName="TableHead";const P=m.forwardRef(({className:s,...a},r)=>e.jsx("td",{ref:r,className:N("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));P.displayName="TableCell";const vs=m.forwardRef(({className:s,...a},r)=>e.jsx("caption",{ref:r,className:N("mt-4 text-sm text-muted-foreground",s),...a}));vs.displayName="TableCaption";const Ns={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown"},bs={"add-evals":"Add evals","enrich-paper":"Enrich paper"},ys={queued:as,dispatching:C,running:es,completed:G,failed:E,canceled:ss};function _s({status:s}){const a=ys[s];return e.jsxs(_,{variant:"outline",className:Ns[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),s]})}function ws(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 ks({autoRefresh:s,refreshToken:a}){const{data:r,isLoading:n,isFetching:l,error:d}=A({queryKey:["codexPaperJobs",a],queryFn:()=>Ke(100),refetchInterval:s?1e4:!1,retry:!1}),x=d&&typeof d=="object"&&"status"in d?d.status:void 0;return e.jsxs(u,{className:"mb-8",children:[e.jsx(j,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(f,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(k,{children:"Durable queue and execution history for admin-triggered Hugging Face Jobs"})]}),l&&!n&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(C,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(p,{children:[n&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(C,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),d&&x!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:d instanceof Error?d.message:"Could not load Codex paper jobs."}),x===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),r&&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(o=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:o}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:r.summary[o]})]},o)),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:r.summary.total})]})]}),r.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(Te,{children:[e.jsx($e,{children:e.jsxs(Q,{children:[e.jsx(F,{children:"Status"}),e.jsx(F,{children:"Paper"}),e.jsx(F,{children:"Action"}),e.jsx(F,{children:"Requested"}),e.jsx(F,{children:"Execution"})]})}),e.jsx(Le,{children:r.jobs.map(o=>{const i=ws(o);return e.jsxs(Q,{children:[e.jsx(P,{className:"align-top",children:e.jsx(_s,{status:o.status})}),e.jsxs(P,{className:"min-w-[260px] align-top",children:[e.jsx(We,{to:`/paper/${encodeURIComponent(o.paper_route)}`,className:"font-medium hover:underline",children:o.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",o.paper_id]})]}),e.jsxs(P,{className:"whitespace-nowrap align-top",children:[bs[o.kind],o.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(G,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(P,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:v(o.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",o.requested_by]})]}),e.jsxs(P,{className:"max-w-[360px] align-top",children:[o.hf_job_url?e.jsxs("a",{href:o.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(oe,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),i&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${o.error?"text-red-700":"cron-muted"}`,title:i,children:i})]})]},o.id)})})]}),e.jsxs("p",{className:"mt-4 text-xs cron-muted",children:["Showing the 100 most recent jobs · Queue totals include full history · Updated ",v(r.timestamp)]})]})]})]})}const Cs=()=>{var d,x,o;const s=Be(),a=Ve({queryKey:["catalog-audit"],queryFn:({pageParam:i})=>K.audit(i),initialPageParam:void 0,getNextPageParam:i=>i.next_cursor??void 0}),r=((d=a.data)==null?void 0:d.pages.flatMap(i=>i.events))??[],n=te({mutationFn:()=>K.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),l=te({mutationFn:i=>K.rollbackEvent(i),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsx("div",{className:"space-y-4",children:e.jsxs(u,{children:[e.jsxs(j,{className:"flex-row items-center justify-between",children:[e.jsx(f,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((o=(x=a.data)==null?void 0:x.pages[0])==null?void 0:o.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(M,{variant:"outline",size:"sm",onClick:()=>n.mutate(),disabled:n.isPending,children:"Mark read"})]})]}),e.jsxs(p,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),r.map(i=>e.jsxs("article",{className:`rounded-md border p-3 ${i.operation==="delete"||i.rollback_eligible===!1?"border-red-500 bg-red-50/50":""}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("strong",{children:[i.operation," ",i.entity_type," ",i.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",i.actor_username??i.actor_role," ·"," ",new Date(i.created_at).toLocaleString()]})]}),e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Inspect snapshots"}),e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded bg-muted p-3",children:JSON.stringify({before:i.before,after:i.after},null,2)})]}),!i.rollback_of_event_id&&e.jsx(M,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>l.mutate(i.id),disabled:l.isPending||i.rollback_eligible===!1,children:i.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},i.id)),a.hasNextPage&&e.jsx(M,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})})},ce={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded"},y=s=>`$${(s/1e6).toFixed(2)}`,Ss=({data:s,loading:a,error:r})=>{const[n,l]=m.useState("staging-current"),d={"staging-current":"Starter staging · $75 warning / $100 trip / no Environment cap","staging-production-era":"Staging with production · $15 / $20 / $25",production:"Production · $175 / $200 / $225"};if(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(C,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const x=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),o=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",i=s.reconciliation_state==="fresh"?"Fresh":s.reconciliation_state==="stale"?"Stale":"Unavailable";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Circuit"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:o}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Month to date"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(x),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${x}%`}})})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Application headroom"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:y(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",y(s.application_cap_microusd)]})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{className:"text-sm",children:"Live compute"})}),e.jsxs(p,{children:[e.jsx("div",{className:"text-2xl font-bold",children:s.live_count}),e.jsxs("p",{className:"text-xs cron-muted",children:[s.termination_uncertain_count," termination uncertain"]})]})]})]}),e.jsxs(u,{children:[e.jsxs(j,{children:[e.jsx(f,{children:"Accounting and policy"}),e.jsxs(k,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(p,{className:"grid md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Environment record"}),e.jsx("br",{}),s.environment," · ",s.provider_mode==="starter_workspace"?"Starter Workspace":"Team isolated"]}),e.jsxs("label",{children:[e.jsx("strong",{children:"Policy profile"}),e.jsxs("select",{"aria-label":"Chat compute policy profile",value:n,onChange:h=>l(h.target.value),className:"block mt-1",children:[e.jsx("option",{value:"staging-current",children:"Staging now"}),e.jsx("option",{value:"staging-production-era",children:"Staging with production"}),e.jsx("option",{value:"production",children:"Production"})]}),e.jsxs("span",{className:"text-xs cron-muted",children:[d[n]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),y(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),y(s.provider_floor_microusd)," · ",e.jsx(_,{children:i})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${y(s.environment_cap_microusd)}`," · Workspace ",y(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",y(s.warning_microusd)," · trip ",y(s.application_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Policy allocation"}),e.jsx("br",{}),"Starter staging $75/$100 with no Environment cap · future Team staging $15/$20/$25 · production $175/$200/$225 · workspace $250"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Cycle end"}),e.jsx("br",{}),v(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?v(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?v(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${v(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${v(s.next_reconciliation_at)}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Burn projection"}),e.jsx("br",{}),s.burn_rate_microusd_per_hour===null?"Not enough data":`${y(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${v(s.projected_cap_hit_at)}`:""}`]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Prior cycle"}),e.jsx("br",{}),s.prior_cycle?`${s.prior_cycle.billing_cycle} · ${y(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{children:"Live lifecycle"})}),e.jsx(p,{className:"text-sm",children:Object.entries(s.live_states).map(([h,b])=>e.jsxs("span",{className:"mr-4",children:[h,": ",b]},h))})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(f,{children:"Daily spend"})}),e.jsx(p,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(h=>e.jsxs("li",{children:[h.date,": blank ",y(h.blank_pool_microusd)," · assigned ",y(h.assigned_microusd)]},h.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(u,{children:[e.jsxs(j,{children:[e.jsx(f,{children:"Recent circuit events"}),e.jsx(k,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(p,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(h=>e.jsxs("li",{children:[e.jsx(_,{children:h.severity})," ",h.type," · ",v(h.created_at)]},h.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Ts=({data:s,loading:a,error:r})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(C,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(r||!s)return e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const n=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(u,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(j,{children:[e.jsx(f,{children:"Web search"}),e.jsxs(k,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsxs("div",{className:"grid md:grid-cols-4 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Circuit"}),e.jsx("br",{}),s.circuit_state,s.trip_reason?` · ${s.trip_reason}`:""]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Calls"}),e.jsx("br",{}),s.call_count," / ",s.hard_limit_calls," · ",s.success_count," successful"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Remaining"}),e.jsx("br",{}),s.remaining_calls]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Warning"}),e.jsx("br",{}),s.warning_calls," calls"]})]}),e.jsx("div",{role:"progressbar","aria-label":"Web-search monthly budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${n}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",v(s.cycle_end_at)," · provider-reported cost $",(s.provider_cost_microusd/1e6).toFixed(4),s.last_latency_ms!==null?` · last ${s.last_latency_ms} ms / ${s.last_result_count??0} results`:"",s.cooldown_until?` · cooldown until ${v(s.cooldown_until)}`:"",s.last_provider_error_class?` · last provider error ${s.last_provider_error_class}`:""]}),s.events.length>0&&e.jsx("ul",{className:"space-y-1 text-sm",children:s.events.map(l=>e.jsxs("li",{children:[l.type," · ",v(l.created_at),l.error_class?` · ${l.error_class}`:""]},l.id))})]})]})},Bs=()=>{const s=ze(),[a,r]=m.useState(!0),[n,l]=m.useState(0),[d,x]=m.useState(""),[o,i]=m.useState(""),[h,b]=m.useState(new Set),{user:c}=Ue(),{data:g,isLoading:X,isFetching:Y,error:S,refetch:Re}=A({queryKey:["cronStatus",c==null?void 0:c.username],queryFn:()=>q.getCronStatus(),enabled:!!(c!=null&&c.is_admin),refetchInterval:a?3e4:!1,retry:!1}),D=A({queryKey:["paperMarkdownJobs",c==null?void 0:c.username],queryFn:()=>q.getPaperMarkdownJobs(),enabled:!!(c!=null&&c.is_admin),refetchInterval:a?3e4:!1,retry:!1}),I=A({queryKey:["chatSandboxSpend",c==null?void 0:c.username,o],queryFn:()=>q.getChatSandboxSpend(o||void 0),enabled:!!(c!=null&&c.is_admin),refetchInterval:a?3e4:!1,retry:!1}),B=A({queryKey:["chatWebSearchBudget",c==null?void 0:c.username],queryFn:()=>q.getChatWebSearchBudget(),enabled:!!(c!=null&&c.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),Z=(S&&typeof S=="object"&&"status"in S?S.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":S instanceof Error?S.message:void 0,Fe=t=>{b(T=>{const $=new Set(T);return $.has(t)?$.delete(t):$.add(t),$})},ee=(g==null?void 0:g.jobs.filter(t=>t.dashboard_group==="leaderboard_sync"))??[],se=(g==null?void 0:g.jobs.filter(t=>t.dashboard_group!=="leaderboard_sync"))??[],Pe=se.filter(t=>t.critical),J=se.filter(t=>!t.critical).reduce((t,T)=>(t[T.category]||(t[T.category]=[]),t[T.category].push(T),t),{}),Me=Object.keys(J).sort((t,T)=>{const $=["hourly","daily","weekly"];return $.indexOf(t)-$.indexOf(T)}),U=t=>e.jsx(js,{job:t,expanded:h.has(t.job_name),onToggle:()=>Fe(t.job_name),paperMarkdownJobs:t.job_name==="paper_markdown_backfill"?D.data:void 0,paperMarkdownJobsLoading:t.job_name==="paper_markdown_backfill"?D.isLoading:!1,paperMarkdownJobsError:t.job_name==="paper_markdown_backfill"?D.error:null},t.job_name),Ae=()=>{l(t=>t+1),Re(),D.refetch(),I.refetch()};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(O,{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(M,{variant:"outline",size:"sm",onClick:()=>r(!a),className:a?"cron-status--running":"",children:[e.jsx(ne,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(M,{variant:"outline",size:"sm",onClick:Ae,disabled:Y,children:[e.jsx(ne,{className:`h-4 w-4 mr-2 ${Y?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(u,{className:"mb-6",children:e.jsx(p,{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(ds,{defaultValue:"critical-jobs",children:[e.jsxs(we,{className:"grid h-auto w-full grid-cols-2 sm:w-auto sm:grid-cols-5",children:[e.jsx(L,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(L,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(L,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(L,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(L,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(R,{value:"critical-jobs",className:"mt-6",children:[X&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"h-5 w-5"}),e.jsx("p",{children:Z??"Failed to load CRON jobs status. Please try again."})]})})}),g&&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(t=>e.jsxs(u,{children:[e.jsx(j,{className:"pb-2",children:e.jsx(f,{className:"text-sm font-medium cron-muted capitalize",children:t})}),e.jsx(p,{children:e.jsx("div",{className:"text-2xl font-bold",children:g.summary[t]})})]},t))}),g.summary.critical_issues.length>0&&e.jsxs(u,{className:"mb-6 cron-status--broken",children:[e.jsx(j,{children:e.jsxs(f,{className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(p,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:g.summary.critical_issues.map(t=>e.jsx("li",{children:t},t))})})]}),e.jsxs(u,{className:"mb-8",children:[e.jsx(j,{children:e.jsx(f,{className:"text-base",children:"What to check next"})}),e.jsxs(p,{children:[e.jsx("p",{className:"text-sm cron-muted",children:g.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(de,{className:"h-4 w-4"}),"Last updated: ",v(g.timestamp)," · Health score:"," ",g.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(u,{className:"mb-8",children:[e.jsxs(j,{children:[e.jsx(f,{className:"text-xl",children:"Critical jobs"}),e.jsx(k,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(p,{className:"space-y-4",children:Pe.map(U)})]}),e.jsx("div",{className:"space-y-6",children:Me.map(t=>e.jsxs(u,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(f,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(_,{className:ce[t]??ce.hourly,children:t}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(k,{children:[J[t].length," job",J[t].length!==1?"s":""]})]})}),e.jsx(p,{className:"space-y-4",children:J[t].map(U)})]},t))})]})]}),e.jsxs(R,{value:"leaderboard-syncs",className:"mt-6",children:[X&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(C,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),S&&e.jsx(u,{className:"cron-status--broken",children:e.jsx(p,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(E,{className:"h-5 w-5"}),e.jsx("p",{children:Z??"Failed to load leaderboard sync status. Please try again."})]})})}),g&&e.jsxs(u,{children:[e.jsx(j,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(f,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(k,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(_,{children:[ee.length," jobs"]})]})}),e.jsx(p,{className:"space-y-4",children:ee.map(U)})]})]}),e.jsx(R,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(ks,{autoRefresh:a,refreshToken:n})}),e.jsx(R,{value:"catalog-audit",className:"mt-6",children:e.jsx(Cs,{})}),e.jsxs(R,{value:"chat-compute",className:"mt-6",children:[e.jsxs(u,{className:"mb-6",children:[e.jsxs(j,{children:[e.jsx(f,{children:"Environment record"}),e.jsx(k,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(p,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:d,onChange:t=>x(t.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(M,{onClick:()=>i(d.trim()),children:"Load"})]})]}),e.jsx(Ss,{data:I.data,loading:I.isLoading,error:I.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Ts,{data:B.data,loading:B.isLoading,error:B.error})})]})]})]})})};export{Ss as ChatComputePanel,Ts as WebSearchBudgetPanel,Bs as default}; diff --git a/assets/ExternalSourceEvalBadge-Cu4mN0M9.js b/assets/ExternalSourceEvalBadge-Cu4mN0M9.js deleted file mode 100644 index 02b34b91d8aa25cf0bf3f130cc363745565f4ede..0000000000000000000000000000000000000000 --- a/assets/ExternalSourceEvalBadge-Cu4mN0M9.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e,L as n}from"./index-D9_nPZtO.js";import{H as o,a as l,b as i}from"./hover-card-DVeX2fQl.js";import{s as c}from"./safeExternalHref-CkBrsh84.js";const h=()=>e.jsxs(o,{openDelay:120,closeDelay:120,children:[e.jsx(l,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),e.jsxs(i,{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(n,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function d(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 m=({sourceUrl:a})=>{const r=c(a),s=typeof a=="string"&&a.startsWith("/paper/")?a:null,t=d(a);return e.jsxs(o,{openDelay:120,closeDelay:120,children:[e.jsx(l,{asChild:!0,children:e.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${t}`,children:"External"})}),e.jsxs(i,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",s?e.jsxs(e.Fragment,{children:[" ",e.jsx(n,{to:s,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:t}),"."]}):r?e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:t}),"."]}):e.jsxs(e.Fragment,{children:[" ",t,"."]})]})]})};export{h as C,m as E}; diff --git a/assets/FeedView-CKJiV0Ra.js b/assets/FeedView-CKJiV0Ra.js new file mode 100644 index 0000000000000000000000000000000000000000..bfa3a91fca44b1fc4ca0f3d15c26ec611c610cc3 --- /dev/null +++ b/assets/FeedView-CKJiV0Ra.js @@ -0,0 +1 @@ +import{u as F,r as d,i as R,j as e,a as q,L as M,b as $,c as U}from"./index-Czt286FG.js";import{P as B}from"./components-D0aZHC0e.js";import{u as K,P as W}from"./useIntersectionObserver-DWuiXfmk.js";import{D as G,S as z,P as Q,u as V,a as X,M as Y,R as J,W as Z,A as ee,b as se,q as ae,c as te}from"./chatSessions-lE15HqmS.js";import{c as I}from"./catalog-BRyB71ZU.js";import{S}from"./chatPrompts-CDY3UGU1.js";import{t as re,d as O}from"./transform-IZH7YNlm.js";import{u as ie}from"./usePapers-BlskNTEC.js";import{P as ne}from"./usePeriodFilter-D6AJqB5b.js";import{S as v}from"./skeleton-B7eqTJnv.js";import{A as oe,a as le}from"./alert-pIw6ZaYb.js";import{u as D}from"./useQuery-DLzEukS9.js";import"./LatexTitle-BMNMJu5R.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-D8AKxdK5.js";import"./useInfiniteQuery-Dk5Z9hLn.js";const ce=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],de={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},me={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},H=45,he=1800,pe=25,ue=350,fe=i=>{const[h,o]=d.useState(S[0].slice(0,1));return d.useEffect(()=>{var j,_;if(!i)return;if((_=(j=window.matchMedia)==null?void 0:j.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){o(S[0]);return}let p=0,n=1,u=!1,m;o(S[0].slice(0,n));const l=()=>{const f=S[p];if(!u){if(n+=1,o(f.slice(0,n)),n===f.length){u=!0,m=window.setTimeout(l,he);return}m=window.setTimeout(l,H);return}if(n-=1,o(f.slice(0,n)),n===0){u=!1,p=(p+1)%S.length,m=window.setTimeout(l,ue);return}m=window.setTimeout(l,pe)};return m=window.setTimeout(l,H),()=>window.clearTimeout(m)},[i]),h},xe=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",ge=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",be=()=>{var w,s,a;const i=F(),h=$()?z:Q,[o,p]=d.useState({text:"",paperMentions:[]}),n=o.text,[u,m]=d.useState(0),[l,j]=d.useState(G),_=(w=h.find(r=>r.id===l))==null?void 0:w.provider,[f,k]=d.useState(!1),[x,c]=d.useState("low"),[g,L]=d.useState(!1),A=fe(!n),y=d.useRef(null),E=D({queryKey:["chatAvailability"],queryFn:()=>U.getChatAvailability(),retry:!1,enabled:R()}),N=!!((s=E.data)!=null&&s.web_search_available),b=R()&&((a=E.data)==null?void 0:a.paper_mentions_enabled)!==!1,t=V({draft:o,onChange:p,enabled:b,textareaRef:y});d.useEffect(()=>{const r=y.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[n]);const T=async(r=o)=>{if(!(!r.text.trim()||g)){L(!0),ae(r,l,{webSearchEnabled:N&&f,reasoningEffort:x});try{const C=await te(l,x);i(`/chat/${C.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(X,{text:o.text,mentions:o.paperMentions,scrollTop:u,variant:"home"}),e.jsx("textarea",{ref:y,rows:1,value:n,placeholder:A,"aria-label":"Ask the assistant",disabled:g,onChange:r=>t.updateText(r.target.value,r.target.selectionStart),onSelect:r=>t.refresh(r.currentTarget.selectionStart),onClick:r=>t.refresh(r.currentTarget.selectionStart),onScroll:r=>m(r.currentTarget.scrollTop),onBlur:r=>{var P,C;(C=(P=r.relatedTarget)==null?void 0:P.closest)!=null&&C.call(P,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:r=>{t.keyDown(r)||r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),T())},role:b?"combobox":void 0,"aria-expanded":b?t.open:void 0,"aria-controls":t.open?t.pickerId:void 0,"aria-activedescendant":t.open&&t.results.length?`${t.optionIdPrefix}-${t.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":t.message?"ask-home-paper-mention-message":void 0})]}),t.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:t.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(Y,{models:h,selectedModel:l,onModelChange:j}),e.jsx(J,{value:x,onChange:c,disabled:g}),N&&e.jsx(Z,{enabled:f,onChange:k,disabled:g}),_!=="openrouter"&&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:()=>void T(),disabled:!n.trim()||g,"aria-label":"Ask the assistant",children:e.jsx(ee,{})})]}),e.jsx(se,{open:t.open,query:t.query,results:t.results,activeIndex:t.activeIndex,loading:t.loading,error:t.error,onSelect:t.select,id:t.pickerId,optionIdPrefix:t.optionIdPrefix})]})]})},Ie=()=>{var N,b,t,T,w;const[i,h]=q(),o=xe(i.get("order_by")),p=ge(i.get("time")),n=i.get("has_code")==="true",u=i.get("has_hf_artifacts")==="true",m=me[p],l=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},j=s=>{const a=new URLSearchParams(i);a.set("time",de[s]),h(a)},_=s=>{const a=new URLSearchParams(i);s?a.set("has_code","true"):a.delete("has_code"),h(a)},f=s=>{const a=new URLSearchParams(i);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),h(a)},k=D({queryKey:["top-tasks-sidebar"],queryFn:()=>I.topTasks(8),staleTime:10*60*1e3}),x=D({queryKey:["trending-tasks-sidebar"],queryFn:()=>I.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=ie({page_size:30,order_by:o,order_dir:"desc",time:p,include_resources:!0,has_code:n,has_hf_artifacts:u}),g=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(r=>r.results))||[]).map(re)},[c.data]),{targetRef:L,isIntersecting:A}=K({rootMargin:"400px"});d.useEffect(()=>{A&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[A,c.hasNextPage,c.isFetchingNextPage]);const y=c.isLoading,E=c.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"}),k.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),(N=k.data)==null?void 0:N.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{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"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),((t=(b=x.data)==null?void 0:b.results)==null?void 0:t.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(w=(T=x.data)==null?void 0:T.results)==null?void 0:w.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[R()&&e.jsx(be,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:ce.map(([s,a])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:a},s))}),e.jsx(W,{hasCode:n,hasHfArtifacts:u,onHasCodeChange:_,onHasHfArtifactsChange:f})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ne.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>j(s),children:s},s))})]}),E&&e.jsx(oe,{variant:"destructive",className:"mb-4",children:e.jsx(le,{children:"Failed to load papers. Please try again."})}),y?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(v,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(v,{className:"h-6 w-3/4"}),e.jsx(v,{className:"h-4 w-1/2"}),e.jsx(v,{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(B,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{be as AskAssistant,Ie as default}; diff --git a/assets/FeedView-oz8sxM3L.js b/assets/FeedView-oz8sxM3L.js deleted file mode 100644 index 504f23c96661c12703295b60ff11e281933ca6e2..0000000000000000000000000000000000000000 --- a/assets/FeedView-oz8sxM3L.js +++ /dev/null @@ -1 +0,0 @@ -import{u as F,r as d,i as R,j as e,a as q,L as M,b as $,c as D}from"./index-D9_nPZtO.js";import{P as U}from"./components-DrTew0nD.js";import{u as B,P as K}from"./useIntersectionObserver-CZXk9yc2.js";import{D as W,S as G,P as z,u as Q,a as V,M as X,R as Y,W as J,A as Z,b as ee,q as se,c as ae}from"./chatSessions-CQv5Fwer.js";import{S}from"./chatPrompts-CDY3UGU1.js";import{t as te,d as O}from"./transform-BObV5jzB.js";import{u as re}from"./usePapers-B3J6SKWU.js";import{P as ie}from"./usePeriodFilter-BkksG2SW.js";import{S as v}from"./skeleton-CQ2CM4l9.js";import{A as ne,a as oe}from"./alert-B0bcMmNw.js";import{u as I}from"./useQuery-cycUreG-.js";import"./LatexTitle-BtRWGRIx.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./chevron-down-D6vo9F6c.js";import"./useInfiniteQuery-CQNVzwuX.js";const le=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce={Today:"today","This Week":"week","This Month":"month","All Time":"all_time"},de={today:"Today",week:"This Week",month:"This Month",all_time:"All Time"},H=45,me=1800,he=25,pe=350,ue=i=>{const[h,o]=d.useState(S[0].slice(0,1));return d.useEffect(()=>{var j,_;if(!i)return;if((_=(j=window.matchMedia)==null?void 0:j.call(window,"(prefers-reduced-motion: reduce)"))!=null&&_.matches){o(S[0]);return}let p=0,n=1,u=!1,m;o(S[0].slice(0,n));const l=()=>{const g=S[p];if(!u){if(n+=1,o(g.slice(0,n)),n===g.length){u=!0,m=window.setTimeout(l,me);return}m=window.setTimeout(l,H);return}if(n-=1,o(g.slice(0,n)),n===0){u=!1,p=(p+1)%S.length,m=window.setTimeout(l,pe);return}m=window.setTimeout(l,he)};return m=window.setTimeout(l,H),()=>window.clearTimeout(m)},[i]),h},ge=i=>i==="trending"||i==="date_published"||i==="citation_count"?i:"trending",xe=i=>i==="today"||i==="week"||i==="month"||i==="all_time"?i:"all_time",fe=()=>{var w,s,a;const i=F(),h=$()?G:z,[o,p]=d.useState({text:"",paperMentions:[]}),n=o.text,[u,m]=d.useState(0),[l,j]=d.useState(W),_=(w=h.find(r=>r.id===l))==null?void 0:w.provider,[g,k]=d.useState(!1),[x,c]=d.useState("low"),[f,L]=d.useState(!1),A=ue(!n),y=d.useRef(null),E=I({queryKey:["chatAvailability"],queryFn:()=>D.getChatAvailability(),retry:!1,enabled:R()}),N=!!((s=E.data)!=null&&s.web_search_available),b=R()&&((a=E.data)==null?void 0:a.paper_mentions_enabled)!==!1,t=Q({draft:o,onChange:p,enabled:b,textareaRef:y});d.useEffect(()=>{const r=y.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,160)}px`)},[n]);const T=async(r=o)=>{if(!(!r.text.trim()||f)){L(!0),se(r,l,{webSearchEnabled:N&&g,reasoningEffort:x});try{const C=await ae(l,x);i(`/chat/${C.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ask-home-new",children:"Hint: type @ to bring papers into context"}),e.jsxs("div",{className:"ask-home",children:[e.jsxs("div",{className:"ask-home-textarea-wrap",children:[e.jsx(V,{text:o.text,mentions:o.paperMentions,scrollTop:u,variant:"home"}),e.jsx("textarea",{ref:y,rows:1,value:n,placeholder:A,"aria-label":"Ask the assistant",disabled:f,onChange:r=>t.updateText(r.target.value,r.target.selectionStart),onSelect:r=>t.refresh(r.currentTarget.selectionStart),onClick:r=>t.refresh(r.currentTarget.selectionStart),onScroll:r=>m(r.currentTarget.scrollTop),onBlur:r=>{var P,C;(C=(P=r.relatedTarget)==null?void 0:P.closest)!=null&&C.call(P,".chat-paper-picker")||window.setTimeout(t.close,0)},onKeyDown:r=>{t.keyDown(r)||r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),T())},role:b?"combobox":void 0,"aria-expanded":b?t.open:void 0,"aria-controls":t.open?t.pickerId:void 0,"aria-activedescendant":t.open&&t.results.length?`${t.optionIdPrefix}-${t.activeIndex}`:void 0,"aria-autocomplete":b?"list":void 0,"aria-describedby":t.message?"ask-home-paper-mention-message":void 0})]}),t.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:t.message}),e.jsxs("div",{className:"ask-home-foot",children:[e.jsxs("div",{className:"ask-home-provider-tools",children:[e.jsx(X,{models:h,selectedModel:l,onModelChange:j}),e.jsx(Y,{value:x,onChange:c,disabled:f}),N&&e.jsx(J,{enabled:g,onChange:k,disabled:f}),_!=="openrouter"&&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:()=>void T(),disabled:!n.trim()||f,"aria-label":"Ask the assistant",children:e.jsx(Z,{})})]}),e.jsx(ee,{open:t.open,query:t.query,results:t.results,activeIndex:t.activeIndex,loading:t.loading,error:t.error,onSelect:t.select,id:t.pickerId,optionIdPrefix:t.optionIdPrefix})]})]})},Re=()=>{var N,b,t,T,w;const[i,h]=q(),o=ge(i.get("order_by")),p=xe(i.get("time")),n=i.get("has_code")==="true",u=i.get("has_hf_artifacts")==="true",m=de[p],l=s=>{const a=new URLSearchParams(i);a.set("order_by",s),h(a)},j=s=>{const a=new URLSearchParams(i);a.set("time",ce[s]),h(a)},_=s=>{const a=new URLSearchParams(i);s?a.set("has_code","true"):a.delete("has_code"),h(a)},g=s=>{const a=new URLSearchParams(i);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),h(a)},k=I({queryKey:["top-tasks-sidebar"],queryFn:()=>D.getTopTasks({limit:8}),staleTime:10*60*1e3}),x=I({queryKey:["trending-tasks-sidebar"],queryFn:()=>D.getTrendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),c=re({page_size:30,order_by:o,order_dir:"desc",time:p,include_resources:!0,has_code:n,has_hf_artifacts:u}),f=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.pages.flatMap(r=>r.results))||[]).map(te)},[c.data]),{targetRef:L,isIntersecting:A}=B({rootMargin:"400px"});d.useEffect(()=>{A&&c.hasNextPage&&!c.isFetchingNextPage&&c.fetchNextPage()},[A,c.hasNextPage,c.isFetchingNextPage]);const y=c.isLoading,E=c.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"}),k.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),(N=k.data)==null?void 0:N.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(M,{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"}),x.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,a)=>e.jsx(v,{className:"h-5 w-full"},a))}),((t=(b=x.data)==null?void 0:b.results)==null?void 0:t.length)===0&&!x.isLoading&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"No domains gaining momentum right now."}),(w=(T=x.data)==null?void 0:T.results)==null?void 0:w.map(s=>e.jsxs(M,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[O(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))]})]}),e.jsxs("div",{children:[R()&&e.jsx(fe,{}),e.jsxs("div",{className:"sort-bar home-feed-sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:le.map(([s,a])=>e.jsx("button",{className:`sort-btn ${o===s?"active":""}`,onClick:()=>l(s),children:a},s))}),e.jsx(K,{hasCode:n,hasHfArtifacts:u,onHasCodeChange:_,onHasHfArtifactsChange:g})]}),e.jsx("div",{className:"sort-options sort-options-time",children:ie.map(s=>e.jsx("button",{className:`sort-btn sort-btn-time ${m===s?"active":""}`,onClick:()=>j(s),children:s},s))})]}),E&&e.jsx(ne,{variant:"destructive",className:"mb-4",children:e.jsx(oe,{children:"Failed to load papers. Please try again."})}),y?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(v,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(v,{className:"h-6 w-3/4"}),e.jsx(v,{className:"h-4 w-1/2"}),e.jsx(v,{className:"h-12 w-full"})]})]},a))}):f.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:f.map((s,a)=>e.jsx(U,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:L,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})};export{fe as AskAssistant,Re as default}; diff --git a/assets/FrameworksIndexView-C476TwCA.js b/assets/FrameworksIndexView-C476TwCA.js deleted file mode 100644 index 5b0532919388d4a69ea7918e42022a791c1c50b3..0000000000000000000000000000000000000000 --- a/assets/FrameworksIndexView-C476TwCA.js +++ /dev/null @@ -1 +0,0 @@ -import{u as d,j as e,L as o,R as m,c as p}from"./index-D9_nPZtO.js";import{u as h}from"./useQuery-cycUreG-.js";import{I as u}from"./components-DrTew0nD.js";import{c as g,h as f}from"./transform-BObV5jzB.js";import"./LatexTitle-BtRWGRIx.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(u,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},B=()=>{var a;const r=h({queryKey:["framework-catalog"],queryFn:()=>p.getFrameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),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."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,B as default}; diff --git a/assets/FrameworksIndexView-Ci4wSude.js b/assets/FrameworksIndexView-Ci4wSude.js new file mode 100644 index 0000000000000000000000000000000000000000..8bf74d877f6690cffee36946b79988d782a9156a --- /dev/null +++ b/assets/FrameworksIndexView-Ci4wSude.js @@ -0,0 +1 @@ +import{u as d,j as e,L as o,R as m}from"./index-Czt286FG.js";import{u as p}from"./useQuery-DLzEukS9.js";import{I as h}from"./components-D0aZHC0e.js";import{c as u}from"./catalog-BRyB71ZU.js";import{c as g,h as f}from"./transform-IZH7YNlm.js";import"./LatexTitle-BMNMJu5R.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},b=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},w=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(b,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},L=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),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."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(w,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{w as FrameworkCard,L as default}; diff --git a/assets/LatexTitle-BtRWGRIx.js b/assets/LatexTitle-BMNMJu5R.js similarity index 98% rename from assets/LatexTitle-BtRWGRIx.js rename to assets/LatexTitle-BMNMJu5R.js index 97f554e04adac37fe1a2e534ebacb0406f8393b5..5edb5af550bc3819adb144e88e75e44ae29b557c 100644 --- a/assets/LatexTitle-BtRWGRIx.js +++ b/assets/LatexTitle-BMNMJu5R.js @@ -1 +1 @@ -import{j as o,r as g}from"./index-D9_nPZtO.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-Czt286FG.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-skQuzg4e.js b/assets/MarkdownText-DfT-SORZ.js similarity index 75% rename from assets/MarkdownText-skQuzg4e.js rename to assets/MarkdownText-DfT-SORZ.js index 8a312ab4912034b6ef7f6a5f177037887421efff..4a41516dd110313375c8b94d20901b741549ebcf 100644 --- a/assets/MarkdownText-skQuzg4e.js +++ b/assets/MarkdownText-DfT-SORZ.js @@ -1 +1 @@ -import{Z as l,j as s,L as u}from"./index-D9_nPZtO.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-D3OkhqBL.js";import{M as d,r as w}from"./index-XzA0bTLC.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const E=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{E as M,f as r}; +import{E as l,j as s,L as u}from"./index-Czt286FG.js";import"./katex.min-BSBacQyE.js";import{r as p,a as m,P as h}from"./PaperPreviewLink-D8Gj_IIj.js";import{M as d,r as w}from"./index-Bzn4VKTO.js";const x=new Set(["paperswithcode.co","www.paperswithcode.co","localhost","127.0.0.1","167.235.148.241"]),P=["/methods","/paper","/papers","/tasks","/benchmark","/conferences"];function f(n,o=window.location.origin){if(!n)return null;let t;if(n.startsWith("/"))t=n;else try{const r=new URL(n,o);if(!x.has(r.hostname))return null;t=`${r.pathname}${r.search}${r.hash}`}catch{return null}const e=t.split(/[?#]/,1)[0];return P.some(r=>e===r||e.startsWith(`${r}/`))?t:null}function k(n){const t=n.split(/[?#]/,1)[0].match(/^\/papers?\/([^/]+)$/);if(!t||t[1].includes("%"))return null;const e=t[1],r=/^\d{4}[.-]\d{4,5}(?:v\d+)?$/.test(e),a=/^[1-9]\d*$/.test(e);return!r&&!a?null:l(e)}const $=({text:n,className:o=""})=>s.jsx("div",{className:o,children:s.jsx(d,{remarkPlugins:[w,m],rehypePlugins:[p],components:{a:({href:t,children:e,node:r,...a})=>{const i=f(t);if(i){const c=k(i);return c?s.jsx(h,{routeId:c,to:i,...a,children:e}):s.jsx(u,{to:i,...a,children:e})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...a,children:e})}},children:n})});export{$ as M,f as r}; diff --git a/assets/MethodDetailView-D8nv95w4.js b/assets/MethodDetailView-D8nv95w4.js deleted file mode 100644 index 9d4669248b5fb1255d7f9d5b914477888fedf292..0000000000000000000000000000000000000000 --- a/assets/MethodDetailView-D8nv95w4.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e,r as P,f as W,a as Z,L as C,c as y,ap as V}from"./index-D9_nPZtO.js";import{u as M}from"./useQuery-cycUreG-.js";import{u as X}from"./useInfiniteQuery-CQNVzwuX.js";import{M as Y,P as J}from"./components-DrTew0nD.js";import{u as ee,P as te}from"./useIntersectionObserver-CZXk9yc2.js";import{r as se,M as O}from"./MarkdownText-skQuzg4e.js";import{s as ae}from"./slug-BpH-Nkvz.js";import{t as re}from"./transform-BObV5jzB.js";import{S as A}from"./skeleton-CQ2CM4l9.js";import{A as ne,a as ie}from"./alert-B0bcMmNw.js";import{s as le}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-BtRWGRIx.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-D3OkhqBL.js";import"./index-XzA0bTLC.js";import"./hover-card-DVeX2fQl.js";const s={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"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),oe=()=>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:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),ce=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],de=()=>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:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),ce.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),me={attention:oe,"agent-skills":de},he=({method:t})=>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:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),pe=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=me[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="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:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(he,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,ue=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),xe=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>ue.format(new Date(`${t}T00:00:00Z`)),ge=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},fe=({history:t,methodName:n})=>{const[o,l]=P.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=ge(t.length,c),L=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],v=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),L.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const N=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,N):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,S=o===p,k=p===t.length-1,b=Q(i);return e.jsxs("g",{className:`method-usage-bar${S?" is-active":""}${k?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${b?`. ${b}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?xe.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),v&&e.jsx("span",{children:v})]})]})},je=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Ee=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=P.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>y.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),L=M({queryKey:["areas-all"],queryFn:()=>y.getAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>y.getMethodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),v=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=X({queryKey:["method-papers-infinite",t,v,g,u],queryFn:({pageParam:r=1})=>y.getMethodPapers(t,{page:r,page_size:20,order_by:v,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>y.getMethod(G))):r.area_id?(await y.getMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),N=P.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(re)},[i.data]),{targetRef:w,isIntersecting:F}=ee({rootMargin:"200px"});if(P.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ne,{variant:"destructive",children:e.jsx(ie,{children:"Method not found."})})});const a=h.data,S=(H=L.data)==null?void 0:H.results.find(r=>r.id===a.area_id),k=se(a.source_url),b=k?null:le(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),S&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${ae(S.name)}`,children:S.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" 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:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),k?e.jsxs(C,{className:"method-source-link",to:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):b?e.jsxs("a",{className:"method-source-link",href:b,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(fe,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(pe,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(Y,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:je.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(te,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[N.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):N.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:N.map((r,d)=>e.jsx(J,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Ee as default}; diff --git a/assets/MethodDetailView-YYTWjJSv.js b/assets/MethodDetailView-YYTWjJSv.js new file mode 100644 index 0000000000000000000000000000000000000000..bc177b3546fa97d6ccd0d02af641ee73f036c9f9 --- /dev/null +++ b/assets/MethodDetailView-YYTWjJSv.js @@ -0,0 +1 @@ +import{j as e,r as L,f as W,a as Z,L as C,a9 as V,p as X}from"./index-Czt286FG.js";import{u as M}from"./useQuery-DLzEukS9.js";import{u as Y}from"./useInfiniteQuery-Dk5Z9hLn.js";import{M as J,P as ee}from"./components-D0aZHC0e.js";import{u as te,P as se}from"./useIntersectionObserver-DWuiXfmk.js";import{r as ae,M as O}from"./MarkdownText-DfT-SORZ.js";import{c as b}from"./catalog-BRyB71ZU.js";import{s as re}from"./slug-BpH-Nkvz.js";import{t as ne}from"./transform-IZH7YNlm.js";import{S as A}from"./skeleton-B7eqTJnv.js";import{A as ie,a as le}from"./alert-pIw6ZaYb.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./LatexTitle-BMNMJu5R.js";import"./katex.min-BSBacQyE.js";import"./PaperPreviewLink-D8Gj_IIj.js";import"./index-Bzn4VKTO.js";import"./hover-card-g7QtmX4K.js";const s={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"},j=({x:t,y:n,w:o,h:l,fill:f,stroke:g,label:u,fontSize:c=10,multiline:_})=>e.jsxs("g",{children:[e.jsx("rect",{x:t,y:n,width:o,height:l,rx:"3",ry:"3",fill:f,stroke:g,strokeWidth:"1"}),_?e.jsxs(e.Fragment,{children:[e.jsx("text",{x:t+o/2,y:n+l/2-2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[0]}),e.jsx("text",{x:t+o/2,y:n+l/2+c-1,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:_[1]})]}):e.jsx("text",{x:t+o/2,y:n+l/2,fontSize:c,fontFamily:"var(--sans)",fill:s.ink,textAnchor:"middle",dominantBaseline:"middle",children:u})]}),ce=()=>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:s.faint,textAnchor:"middle",children:"Scaled Dot-Product Attention"}),e.jsx(j,{x:140,y:40,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M180 66 L180 80",stroke:s.ink}),e.jsx(j,{x:140,y:80,w:80,h:26,fill:s.green,stroke:s.greenS,label:"SoftMax",fontSize:11}),e.jsx("path",{d:"M180 106 L180 120",stroke:s.ink}),e.jsx(j,{x:140,y:120,w:80,h:26,fill:s.purple,stroke:s.purpleS,label:"Mask (opt.)",fontSize:11}),e.jsx("path",{d:"M180 146 L180 160",stroke:s.ink}),e.jsx(j,{x:140,y:160,w:80,h:26,fill:s.blue,stroke:s.blueS,label:"Scale ÷√dₖ",fontSize:11}),e.jsx("path",{d:"M180 186 L180 200",stroke:s.ink}),e.jsx(j,{x:140,y:200,w:80,h:26,fill:s.yellow,stroke:s.yellowS,label:"MatMul",fontSize:11}),e.jsx("path",{d:"M156 226 L120 270",stroke:s.ink}),e.jsx("path",{d:"M180 226 L180 270",stroke:s.ink}),e.jsx("path",{d:"M204 226 L240 270",stroke:s.ink}),e.jsx(j,{x:100,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"Q",fontSize:13}),e.jsx(j,{x:160,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"K",fontSize:13}),e.jsx(j,{x:220,y:270,w:40,h:24,fill:s.pink,stroke:s.pinkS,label:"V",fontSize:13}),e.jsxs("text",{x:"180",y:"330",fontSize:"14",fontFamily:"var(--serif)",fontStyle:"italic",fill:s.ink,textAnchor:"middle",children:["softmax(QK",e.jsx("tspan",{fontSize:"9",baselineShift:"super",children:"⊤"})," / √d) V"]})]}),de=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],me=()=>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:s.faint,textAnchor:"middle",children:"Skill package layout"}),e.jsx("rect",{x:"28",y:"48",width:"304",height:"318",rx:"8",fill:"#FFFDF8",stroke:s.faint,strokeWidth:"1"}),de.map(([t,n],o)=>{const l=92+o*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:l,fontSize:"11",fontFamily:"var(--mono)",fill:s.ink,dominantBaseline:"middle",children:t}),n?e.jsx("text",{x:"138",y:l,fontSize:"8.5",fontFamily:"var(--mono)",fill:s.faint,dominantBaseline:"middle",children:n}):null]},t)})]}),he={attention:ce,"agent-skills":me},pe=({method:t})=>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:s.faint,textAnchor:"middle",children:t.name||"method"}),e.jsx(j,{x:80,y:70,w:200,h:50,fill:s.blue,stroke:s.blueS,label:"Input",fontSize:12}),e.jsx("path",{d:"M180 120 L180 150",stroke:s.ink}),e.jsx(j,{x:80,y:150,w:200,h:70,fill:s.orange,stroke:s.orangeS,label:t.name||"transform",fontSize:13}),e.jsx("path",{d:"M180 220 L180 250",stroke:s.ink}),e.jsx(j,{x:80,y:250,w:200,h:50,fill:s.purple,stroke:s.purpleS,label:"Output",fontSize:12})]}),ue=({method:t})=>{const n=(t.slug||"").toLowerCase(),o=he[n];if(o)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(o,{})});if(t.image_url){const l=n==="transformer"||n==="gpt-4"||n==="gpt-4o"||n==="multi-head-attention"?" method-figure-svg--compact":n==="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:t.image_url,alt:`${t.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:t})})},D=720,B=138,x={top:8,right:10,bottom:25,left:36},K=56,xe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),E=t=>xe.format(new Date(`${t}T00:00:00Z`)),fe=(t,n)=>{if(t===0)return new Set;const o=t>48?12:t>36?6:t>18?3:2,l=Math.max(1,Math.ceil(K/n)),f=Math.max(o,l),g=t-1,u=new Set([0,g]);for(let c=f;c=K&&u.add(c);return u},Q=t=>{if(t.coverage_status===void 0||["complete","not_applicable"].includes(t.coverage_status))return null;const n=t.processed_paper_count!==void 0&&t.eligible_paper_count!==void 0?`; ${t.processed_paper_count.toLocaleString()} of ${t.eligible_paper_count.toLocaleString()} eligible papers processed`:"";return`Historical tagging ${t.coverage_status==="failed"?"needs retry":"in progress"}${n}`},je=({history:t,methodName:n})=>{const[o,l]=L.useState(null),f=Math.max(1,...t.map(i=>i.paper_count)),g=D-x.left-x.right,u=B-x.top-x.bottom,c=t.length?g/t.length:g,_=Math.max(2,c*.68),h=fe(t.length,c),P=Array.from(new Set([0,Math.ceil(f/2),f])),m=o==null?null:t[o],y=m?Q(m):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${D} ${B}`,role:"group","aria-label":`${n}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[n,": papers mentioning this method by publication month"]}),P.map(i=>{const p=x.top+u-i/f*u;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:x.left,x2:D-x.right,y1:p,y2:p}),e.jsx("text",{className:"method-usage-y-label",x:x.left-8,y:p+3,textAnchor:"end",children:i})]},i)}),t.map((i,p)=>{const v=i.paper_count/f*u,w=i.paper_count>0?Math.max(1,v):0,F=x.left+c*p+(c-_)/2,a=x.top+u-w,N=o===p,S=p===t.length-1,k=Q(i);return e.jsxs("g",{className:`method-usage-bar${N?" is-active":""}${S?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${E(i.start_date)}: ${i.paper_count} ${i.paper_count===1?"paper":"papers"}${k?`. ${k}`:""}`,onMouseEnter:()=>l(p),onMouseLeave:()=>l(null),onFocus:()=>l(p),onBlur:()=>l(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:x.left+c*p,y:x.top,width:c,height:u}),e.jsx("rect",{className:"method-usage-bar-mark",x:F,y:a,width:_,height:w,rx:"1.5"})]},i.start_date)}),t.map((i,p)=>h.has(p)?e.jsx("text",{className:"method-usage-x-label",x:x.left+c*(p+.5),y:B-11,textAnchor:"middle",children:t.length>48?ge.format(new Date(`${i.start_date}T00:00:00Z`)):E(i.start_date)},i.start_date):null)]}),m&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:E(m.start_date)}),e.jsxs("span",{children:[m.paper_count," ",m.paper_count===1?"paper":"papers",o===t.length-1?" · month to date":""]}),e.jsxs("span",{children:[(m.catalog_share??0).toFixed(2),"% of"," ",(m.catalog_paper_count??0).toLocaleString()," catalog papers"]}),y&&e.jsx("span",{children:y})]})]})},_e=[["trending","trending"],["new","newest"],["cited","most cited"]],U={"on-policy-distillation":["fine-tuning","post-training","rlvr","rlhf","direct-preference-optimization-dpo"],mcp:["agent-skills"],"agent-skills":["mcp"]},Te=()=>{var I,T,z,$,H,R;const{methodSlug:t}=W(),[n,o]=Z(),[l,f]=L.useState("trending"),g=n.get("has_code")==="true",u=n.get("has_hf_artifacts")==="true",c=r=>{const d=new URLSearchParams(n);r?d.set("has_code","true"):d.delete("has_code"),o(d)},_=r=>{const d=new URLSearchParams(n);r?d.set("has_hf_artifacts","true"):d.delete("has_hf_artifacts"),o(d)},h=M({queryKey:["method",t],queryFn:()=>b.getMethod(t),enabled:!!t,staleTime:10*60*1e3}),P=M({queryKey:["areas-all"],queryFn:()=>b.listAreas({page_size:50,ordering:"name"}),enabled:!!((I=h.data)!=null&&I.area_id),staleTime:10*60*1e3}),m=M({queryKey:["method-trend",t],queryFn:()=>b.methodTrend(t),enabled:!!t&&!!h.data,staleTime:10*60*1e3}),y=l==="trending"?"trending":l==="cited"?"citation_count":"date_published",i=Y({queryKey:["method-papers-infinite",t,y,g,u],queryFn:({pageParam:r=1})=>X.forMethod(t,{page:r,page_size:20,order_by:y,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:u}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:!!t,staleTime:5*60*1e3,placeholderData:V}),p=M({queryKey:["related-methods",(T=h.data)==null?void 0:T.slug,(z=h.data)==null?void 0:z.area_id,($=h.data)==null?void 0:$.id],queryFn:async()=>{const r=h.data;if(!r)return[];const d=r.slug?U[r.slug]:void 0;return d?Promise.all(d.map(G=>b.getMethod(G))):r.area_id?(await b.listMethods({area_id:r.area_id,exclude_id:r.id,ordering:"-paper_count",page_size:8})).results:[]},enabled:!!(h.data&&(h.data.slug&&U[h.data.slug]||h.data.area_id)),staleTime:10*60*1e3}),v=L.useMemo(()=>{var d;return(((d=i.data)==null?void 0:d.pages.flatMap(q=>q.results))||[]).map(ne)},[i.data]),{targetRef:w,isIntersecting:F}=te({rootMargin:"200px"});if(L.useEffect(()=>{F&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[F,i.hasNextPage,i.isFetchingNextPage]),h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(A,{className:"h-12 w-1/2 mb-4"}),e.jsx(A,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(ie,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=h.data,N=(H=P.data)==null?void 0:H.results.find(r=>r.id===a.area_id),S=ae(a.source_url),k=S?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(C,{to:"/methods",children:"Methods"}),N&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(C,{to:`/methods#area-${re(N.name)}`,children:N.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" 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:a.name}),a.full_name&&a.full_name!==a.name&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontSize:16,fontStyle:"italic",color:"var(--ink-soft)",marginTop:8},children:a.full_name}),a.description&&e.jsx(O,{className:"method-description",text:a.description}),a.source_url&&a.source_title&&e.jsxs("div",{className:"method-source",children:[e.jsx("span",{className:"method-source-label",children:"Source"}),S?e.jsxs(C,{className:"method-source-link",to:S,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):k?e.jsxs("a",{className:"method-source-link",href:k,target:"_blank",rel:"noopener noreferrer",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]}):e.jsxs("div",{className:"method-source-link is-static",children:[e.jsx("span",{className:"method-source-title",children:a.source_title}),a.introduced_year&&e.jsx("span",{className:"method-source-meta",children:a.introduced_year})]})]}),e.jsxs("div",{className:"tag-hero-meta",children:[e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Papers mentioning"}),e.jsx("span",{className:"value",children:(a.paper_count??0).toLocaleString()})]}),m.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsx("span",{className:"value",children:m.data.comparison_complete?e.jsxs(e.Fragment,{children:[m.data.trend_score.toFixed(1),e.jsx("small",{children:"/mo"})]}):"Pending"})]}),a.introduced_year!=null&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Introduced"}),e.jsx("span",{className:"value",children:a.introduced_year})]})]}),m.isLoading?e.jsx(A,{className:"h-36 w-full method-trend-skeleton"}):m.data?e.jsxs("section",{className:"method-trend-panel method-trend-panel--compact",children:[e.jsxs("div",{className:"method-trend-header",children:[e.jsx("div",{children:e.jsx("div",{className:"method-trend-eyebrow",children:"Usage trend"})}),e.jsxs("div",{className:"method-trend-summary",children:[e.jsx("strong",{children:m.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",m.data.recent_days,"d"]})]})]}),e.jsx(je,{history:m.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx(O,{className:"method-image-credit",text:a.image_credit})})]})]}),(((R=p.data)==null?void 0:R.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),p.data.map(r=>e.jsx(J,{method:{slug:r.slug,name:r.name}},r.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:_e.map(([r,d])=>e.jsx("button",{className:`sort-btn ${l===r?"active":""}`,onClick:()=>f(r),children:d},r))}),e.jsx(se,{hasCode:g,hasHfArtifacts:u,onHasCodeChange:c,onHasHfArtifactsChange:_})]}),e.jsxs("div",{className:"results-count",children:[v.length," papers mentioning ",a.name]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,d)=>e.jsx(A,{className:"h-40 w-full"},d))}):v.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:v.map((r,d)=>e.jsx(ee,{paper:r,rank:d+1},r.id))}),e.jsx("div",{ref:w,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Te as default}; diff --git a/assets/MethodsIndexView-B4Zfj2D1.js b/assets/MethodsIndexView-B4Zfj2D1.js new file mode 100644 index 0000000000000000000000000000000000000000..4f6f89b7c9a478c5f4302da2df01f2df23b564b7 --- /dev/null +++ b/assets/MethodsIndexView-B4Zfj2D1.js @@ -0,0 +1,6 @@ +import{d as g,r as d,j as e,L as f}from"./index-Czt286FG.js";import{u as m}from"./useQuery-DLzEukS9.js";import{c as h}from"./catalog-BRyB71ZU.js";import{s as j}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-B7eqTJnv.js";import{A as y,a as v}from"./alert-pIw6ZaYb.js";import{T as _}from"./TaxonomySuggestionTile-lcZG5E-y.js";import"./SignInToEditDialog-Dgq0yOYP.js";import"./button-vhqVRnBn.js";import"./textarea-Ov25LunA.js";import"./dialog-CJthLFv3.js";import"./useMutation-DqQi_NTN.js";import"./submissions-BsEO_Bbg.js";import"./loader-circle-DyZRZBrM.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 N=g("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]),C=()=>{var l,c;const i=m({queryKey:["areas-all"],queryFn:()=>h.listAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=m({queryKey:["methods-all"],queryFn:async()=>(await h.listMethods({page:1,page_size:500,ordering:"-trend_score",include_trends:!0})).results,staleTime:10*60*1e3}),o=d.useMemo(()=>{if(!n.data||!i.data)return null;const t={};return n.data.forEach(a=>{const r=a.area_id??"_unassigned";(t[r]||(t[r]=[])).push(a)}),Object.values(t).forEach(a=>a.sort((r,s)=>(s.trend_score||0)-(r.trend_score||0)||(s.paper_count||0)-(r.paper_count||0)||r.name.localeCompare(s.name))),t},[n.data,i.data]),u=d.useMemo(()=>{const t=(n.data||[]).filter(r=>(r.trend_score||0)>0).sort((r,s)=>(s.trend_score||0)-(r.trend_score||0)),a=Math.ceil(t.length*.25);return new Set(t.slice(0,a).map(r=>r.id))},[n.data]);return d.useEffect(()=>{var t;!i.data||!n.data||!window.location.hash||(t=document.getElementById(window.location.hash.slice(1)))==null||t.scrollIntoView({block:"start"})},[i.data,n.data]),i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(y,{variant:"destructive",children:e.jsx(v,{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. Trend scores show papers using each method per 30 days, measured over the latest 90 days; the flame marks the top quartile."})]})}),i.isLoading||n.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((t,a)=>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:8}).map((r,s)=>e.jsx(p,{className:"h-20"},s))})]},a))}):(c=(l=i.data)==null?void 0:l.results)==null?void 0:c.map(t=>{const a=(o==null?void 0:o[t.id])||[];if(a.length===0)return null;const r=a.reduce((s,x)=>s+(x.paper_count||0),0);return e.jsxs("section",{id:`area-${j(t.name)}`,style:{marginBottom:48,scrollMarginTop:80},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:t.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[a.length," methods · ",r.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[a.map(s=>e.jsxs(f,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:[s.name,u.has(s.id)&&e.jsx(N,{className:"method-trending-icon",size:15,"aria-label":"Top quartile by recent method mentions"})]}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),(s.trend_score??0)>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"method-trend-score",children:[(s.trend_score??0).toFixed(1),"/mo"]})]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id)),e.jsx(_,{kind:"method"})]})]},t.id)})]})};export{C as default}; diff --git a/assets/MethodsIndexView-CMQ_zbFE.js b/assets/MethodsIndexView-CMQ_zbFE.js deleted file mode 100644 index c6d1969d33b51dd82dd9f9b7881092b50a7ff989..0000000000000000000000000000000000000000 --- a/assets/MethodsIndexView-CMQ_zbFE.js +++ /dev/null @@ -1,6 +0,0 @@ -import{d as g,r as d,j as e,L as j,c as m}from"./index-D9_nPZtO.js";import{u as h}from"./useQuery-cycUreG-.js";import{s as f}from"./slug-BpH-Nkvz.js";import{S as p}from"./skeleton-CQ2CM4l9.js";import{A as y,a as v}from"./alert-B0bcMmNw.js";import{T as _}from"./TaxonomySuggestionTile-BO-dHwso.js";import"./SignInToEditDialog-NNf7Zp6R.js";import"./button-B859643f.js";import"./textarea-BVF3ykiv.js";import"./dialog-DnjY6ZOM.js";import"./useMutation-CJCfaNMQ.js";import"./loader-circle-CrVj12oC.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 N=g("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]),E=()=>{var l,c;const i=h({queryKey:["areas-all"],queryFn:()=>m.getAreas({page_size:50,ordering:"name"}),staleTime:6e5}),n=h({queryKey:["methods-all"],queryFn:async()=>(await m.getMethods({page:1,page_size:500,ordering:"-trend_score",include_trends:!0})).results,staleTime:10*60*1e3}),o=d.useMemo(()=>{if(!n.data||!i.data)return null;const t={};return n.data.forEach(r=>{const a=r.area_id??"_unassigned";(t[a]||(t[a]=[])).push(r)}),Object.values(t).forEach(r=>r.sort((a,s)=>(s.trend_score||0)-(a.trend_score||0)||(s.paper_count||0)-(a.paper_count||0)||a.name.localeCompare(s.name))),t},[n.data,i.data]),u=d.useMemo(()=>{const t=(n.data||[]).filter(a=>(a.trend_score||0)>0).sort((a,s)=>(s.trend_score||0)-(a.trend_score||0)),r=Math.ceil(t.length*.25);return new Set(t.slice(0,r).map(a=>a.id))},[n.data]);return d.useEffect(()=>{var t;!i.data||!n.data||!window.location.hash||(t=document.getElementById(window.location.hash.slice(1)))==null||t.scrollIntoView({block:"start"})},[i.data,n.data]),i.error||n.error?e.jsx("div",{className:"page",children:e.jsx(y,{variant:"destructive",children:e.jsx(v,{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. Trend scores show papers using each method per 30 days, measured over the latest 90 days; the flame marks the top quartile."})]})}),i.isLoading||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:8}).map((a,s)=>e.jsx(p,{className:"h-20"},s))})]},r))}):(c=(l=i.data)==null?void 0:l.results)==null?void 0:c.map(t=>{const r=(o==null?void 0:o[t.id])||[];if(r.length===0)return null;const a=r.reduce((s,x)=>s+(x.paper_count||0),0);return e.jsxs("section",{id:`area-${f(t.name)}`,style:{marginBottom:48,scrollMarginTop:80},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:t.name})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," methods · ",a.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[r.map(s=>e.jsxs(j,{to:`/methods/${s.slug||s.id}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",style:{fontFamily:"var(--mono)",fontSize:15},children:[s.name,u.has(s.id)&&e.jsx(N,{className:"method-trending-icon",size:15,"aria-label":"Top quartile by recent method mentions"})]}),e.jsxs("div",{className:"meta",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),(s.trend_score??0)>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{className:"method-trend-score",children:[(s.trend_score??0).toFixed(1),"/mo"]})]}),s.introduced_year!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:s.introduced_year})]})]})]},s.id)),e.jsx(_,{kind:"method"})]})]},t.id)})]})};export{E as default}; diff --git a/assets/NotFound-DLV3c5vS.js b/assets/NotFound-5-TztvbD.js similarity index 89% rename from assets/NotFound-DLV3c5vS.js rename to assets/NotFound-5-TztvbD.js index 460090c5690903d15a022b8111daeed52a290670..cc00723d1c3fca0658e8f27fe3b387506502b4e3 100644 --- a/assets/NotFound-DLV3c5vS.js +++ b/assets/NotFound-5-TztvbD.js @@ -1 +1 @@ -import{aQ as o,r as a,j as t,L as s}from"./index-D9_nPZtO.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{au as o,r as a,j as t,L as s}from"./index-Czt286FG.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/OrganizationContributionGraph-BFVnJhUY.js b/assets/OrganizationContributionGraph-BFVnJhUY.js new file mode 100644 index 0000000000000000000000000000000000000000..270baa30cc053a958830b7e9a5c8fb884995bf81 --- /dev/null +++ b/assets/OrganizationContributionGraph-BFVnJhUY.js @@ -0,0 +1 @@ +import{r as b,j as o}from"./index-Czt286FG.js";import{u as z}from"./useQuery-DLzEukS9.js";import{S as T}from"./skeleton-B7eqTJnv.js";import{c as w}from"./catalog-BRyB71ZU.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;eg.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O}; diff --git a/assets/OrganizationContributionGraph-CjsAmlOx.js b/assets/OrganizationContributionGraph-CjsAmlOx.js deleted file mode 100644 index d25fa6ce0e831b107cb6ab8759bba8d1e792edc4..0000000000000000000000000000000000000000 --- a/assets/OrganizationContributionGraph-CjsAmlOx.js +++ /dev/null @@ -1 +0,0 @@ -import{r as b,j as o,c as z}from"./index-D9_nPZtO.js";import{u as T}from"./useQuery-cycUreG-.js";import{S as w}from"./skeleton-CQ2CM4l9.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,g)=>e-g),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const g=new Date(e),d=N(g),m=e>=r.getTime()&&e<=i.getTime(),C=m?p.get(d)??0:0;l.push({key:d,date:g,count:C,inRange:m,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;em.inRange&&(e===0||m.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},k=({organizationSlug:n,organizationName:r})=>{const i=T({queryKey:["organization-contributions",n],queryFn:()=>z.getOrganizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(w,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,k as O}; diff --git a/assets/OrganizationDetailView-COwL-Neo.js b/assets/OrganizationDetailView-COwL-Neo.js deleted file mode 100644 index 69a773d26988e23966763f258a50fa67689c972f..0000000000000000000000000000000000000000 --- a/assets/OrganizationDetailView-COwL-Neo.js +++ /dev/null @@ -1 +0,0 @@ -import{f as t,j as r}from"./index-D9_nPZtO.js";import{O as i}from"./OrganizationPaperFeed-B-ZiEuUF.js";import m from"./NotFound-DLV3c5vS.js";import"./useQuery-cycUreG-.js";import"./components-DrTew0nD.js";import"./LatexTitle-BtRWGRIx.js";import"./katex.min-BSBacQyE.js";import"./transform-BObV5jzB.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-skQuzg4e.js";import"./PaperPreviewLink-D3OkhqBL.js";import"./index-XzA0bTLC.js";import"./hover-card-DVeX2fQl.js";import"./OrganizationContributionGraph-CjsAmlOx.js";import"./skeleton-CQ2CM4l9.js";import"./useIntersectionObserver-CZXk9yc2.js";import"./alert-B0bcMmNw.js";import"./searchable-select-Css_GGu3.js";import"./button-B859643f.js";import"./dialog-DnjY6ZOM.js";import"./loader-circle-CrVj12oC.js";import"./usePapers-B3J6SKWU.js";import"./useInfiniteQuery-CQNVzwuX.js";const V=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{V as default}; diff --git a/assets/OrganizationDetailView-D2uv0yr-.js b/assets/OrganizationDetailView-D2uv0yr-.js new file mode 100644 index 0000000000000000000000000000000000000000..947775e9e95a977b5076b119ce4cd95c05278345 --- /dev/null +++ b/assets/OrganizationDetailView-D2uv0yr-.js @@ -0,0 +1 @@ +import{f as t,j as r}from"./index-Czt286FG.js";import{O as i}from"./OrganizationPaperFeed-CXi0Ug8S.js";import m from"./NotFound-5-TztvbD.js";import"./useQuery-DLzEukS9.js";import"./components-D0aZHC0e.js";import"./LatexTitle-BMNMJu5R.js";import"./katex.min-BSBacQyE.js";import"./transform-IZH7YNlm.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-DfT-SORZ.js";import"./PaperPreviewLink-D8Gj_IIj.js";import"./index-Bzn4VKTO.js";import"./hover-card-g7QtmX4K.js";import"./OrganizationContributionGraph-BFVnJhUY.js";import"./skeleton-B7eqTJnv.js";import"./catalog-BRyB71ZU.js";import"./useIntersectionObserver-DWuiXfmk.js";import"./alert-pIw6ZaYb.js";import"./searchable-select-D6ZufK5P.js";import"./button-vhqVRnBn.js";import"./dialog-CJthLFv3.js";import"./loader-circle-DyZRZBrM.js";import"./usePapers-BlskNTEC.js";import"./useInfiniteQuery-Dk5Z9hLn.js";const b=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{b as default}; diff --git a/assets/OrganizationPaperFeed-B-ZiEuUF.js b/assets/OrganizationPaperFeed-B-ZiEuUF.js deleted file mode 100644 index 2fed3f331e2271ebda4d0511cc9786804734ca83..0000000000000000000000000000000000000000 --- a/assets/OrganizationPaperFeed-B-ZiEuUF.js +++ /dev/null @@ -1 +0,0 @@ -import{u as E,a as Q,r as d,j as e,L as w,c as C}from"./index-D9_nPZtO.js";import{u as A}from"./useQuery-cycUreG-.js";import{P as U}from"./components-DrTew0nD.js";import{M as B}from"./MarkdownText-skQuzg4e.js";import{O as G}from"./OrganizationContributionGraph-CjsAmlOx.js";import{u as K,P as W}from"./useIntersectionObserver-CZXk9yc2.js";import{A as D,a as Z}from"./alert-B0bcMmNw.js";import{a as z}from"./searchable-select-Css_GGu3.js";import{S as $}from"./skeleton-CQ2CM4l9.js";import{d as J}from"./usePapers-B3J6SKWU.js";import{d as T,t as V}from"./transform-BObV5jzB.js";import X from"./NotFound-DLV3c5vS.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",me=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>C.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>C.getOrganizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},S=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx($,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:S,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...q(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx($,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{me as O}; diff --git a/assets/OrganizationPaperFeed-CXi0Ug8S.js b/assets/OrganizationPaperFeed-CXi0Ug8S.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ba44cc9a1acefe0f38fa7c2c41b71f1e8af01c --- /dev/null +++ b/assets/OrganizationPaperFeed-CXi0Ug8S.js @@ -0,0 +1 @@ +import{u as E,a as Q,r as d,j as e,L as w}from"./index-Czt286FG.js";import{u as A}from"./useQuery-DLzEukS9.js";import{P as U}from"./components-D0aZHC0e.js";import{M as B}from"./MarkdownText-DfT-SORZ.js";import{O as G}from"./OrganizationContributionGraph-BFVnJhUY.js";import{u as K,P as W}from"./useIntersectionObserver-DWuiXfmk.js";import{A as D,a as Z}from"./alert-pIw6ZaYb.js";import{a as z}from"./searchable-select-D6ZufK5P.js";import{S as C}from"./skeleton-B7eqTJnv.js";import{d as J}from"./usePapers-BlskNTEC.js";import{c as $}from"./catalog-BRyB71ZU.js";import{d as T,t as V}from"./transform-IZH7YNlm.js";import X from"./NotFound-5-TztvbD.js";const Y=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ee=n=>n==="date_published"||n==="citation_count"?n:"trending",ue=({organizationSlug:n,taskSlug:p})=>{var N,y,v,P,L,F,k,O;const I=E(),[l,h]=Q(),[M,m]=d.useState(!1),u=ee(l.get("order_by")),g=l.get("has_code")==="true",f=l.get("has_hf_artifacts")==="true",_=A({queryKey:["organization",n],queryFn:()=>$.getOrganization(n),staleTime:10*60*1e3}),c=A({queryKey:["organization-areas-with-tasks",n],queryFn:()=>$.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=J({organizationSlug:n,taskSlug:p,page_size:12,order_by:u,order_dir:"desc",include_resources:!0,has_code:g,has_hf_artifacts:f,enabled:!!n}),{targetRef:H,isIntersecting:x}=K({rootMargin:"200px"});d.useEffect(()=>{x&&i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},[x,i.hasNextPage,i.isFetchingNextPage]),d.useEffect(()=>{m(!1)},[n,p]);const j=d.useMemo(()=>{var a;return(((a=c.data)==null?void 0:a.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:T(t.name,t.slug)})))},[c.data]),o=j.find(a=>a.slug===p),b=d.useMemo(()=>{var a;return(((a=i.data)==null?void 0:a.pages)??[]).flatMap(r=>r.results.map(V))},[i.data]),s=_.data??((N=c.data)==null?void 0:N.organization),R=((v=(y=i.data)==null?void 0:y.pages[0])==null?void 0:v.count)??0;if(((P=_.error)==null?void 0:P.status)===404||((L=c.error)==null?void 0:L.status)===404||((F=i.error)==null?void 0:F.status)===404)return e.jsx(X,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(D,{variant:"destructive",children:e.jsx(Z,{children:"Failed to load organization papers. Please try again."})})});const q=a=>{const r=a.trim().toLocaleLowerCase();return j.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},S=a=>{const r=a==="__all__"?`/orgs/${n}`:`/orgs/${n}/${a}`,t=l.toString();I({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(w,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(w,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(s==null?void 0:s.name)??n}),o&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:T(o.name,o.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:"feed-title organization-hero-title",children:[s!=null&&s.logo_url&&!M?e.jsx("img",{src:s.logo_url,alt:"",width:58,height:58,onError:()=>m(!0)}):s?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:s.name.slice(0,1).toUpperCase()}):null,(s==null?void 0:s.name)??e.jsx(C,{className:"h-12 w-64"})]}),s&&e.jsxs("div",{className:"feed-subtitle",children:[((k=s.paper_count)==null?void 0:k.toLocaleString())??0," papers",(s.organization_trending_score??0)>0&&s.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",s.trending_rank," trending this month"]})]}),(s==null?void 0:s.description)&&e.jsx(B,{className:"method-description",text:s.description}),s&&e.jsxs("div",{className:"organization-hero-links",children:[s.website_url&&e.jsx("a",{href:s.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),s.hf_url&&e.jsx("a",{href:s.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),s.github_url&&e.jsx("a",{href:s.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),s&&e.jsx(G,{organizationSlug:n,organizationName:s.name})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(z,{value:p??"__all__",onChange:S,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:o?{value:o.slug,label:o.label,description:`${o.paper_count.toLocaleString()} ${o.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=s==null?void 0:s.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async a=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=s==null?void 0:s.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...q(a)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Y.map(([a,r])=>e.jsx("button",{type:"button",className:`sort-btn ${u===a?"active":""}`,onClick:()=>{const t=new URLSearchParams(l);a==="trending"?t.delete("order_by"):t.set("order_by",a),h(t)},children:r},a))}),e.jsx(W,{hasCode:g,hasHfArtifacts:f,onHasCodeChange:a=>{const r=new URLSearchParams(l);a?r.set("has_code","true"):r.delete("has_code"),h(r)},onHasHfArtifactsChange:a=>{const r=new URLSearchParams(l);a?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),h(r)}})]}),e.jsxs("div",{className:"results-count",children:[R.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,r)=>e.jsx(C,{className:"h-40 w-full"},r))}):b.length===0?e.jsx("div",{className:"no-results",children:(s==null?void 0:s.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:b.map((a,r)=>e.jsx(U,{paper:a,rank:r+1,showInstitution:!1},a.id))}),e.jsx("div",{ref:H,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{ue as O}; diff --git a/assets/OrganizationTaskView-BYJZ35ys.js b/assets/OrganizationTaskView-BYJZ35ys.js new file mode 100644 index 0000000000000000000000000000000000000000..0033b459cfaaf0fd0a1618aa2e5d7e9716b268af --- /dev/null +++ b/assets/OrganizationTaskView-BYJZ35ys.js @@ -0,0 +1 @@ +import{f as i,j as t}from"./index-Czt286FG.js";import{O as m}from"./OrganizationPaperFeed-CXi0Ug8S.js";import p from"./NotFound-5-TztvbD.js";import"./useQuery-DLzEukS9.js";import"./components-D0aZHC0e.js";import"./LatexTitle-BMNMJu5R.js";import"./katex.min-BSBacQyE.js";import"./transform-IZH7YNlm.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-DfT-SORZ.js";import"./PaperPreviewLink-D8Gj_IIj.js";import"./index-Bzn4VKTO.js";import"./hover-card-g7QtmX4K.js";import"./OrganizationContributionGraph-BFVnJhUY.js";import"./skeleton-B7eqTJnv.js";import"./catalog-BRyB71ZU.js";import"./useIntersectionObserver-DWuiXfmk.js";import"./alert-pIw6ZaYb.js";import"./searchable-select-D6ZufK5P.js";import"./button-vhqVRnBn.js";import"./dialog-CJthLFv3.js";import"./loader-circle-DyZRZBrM.js";import"./usePapers-BlskNTEC.js";import"./useInfiniteQuery-Dk5Z9hLn.js";const b=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{b as default}; diff --git a/assets/OrganizationTaskView-JO8z_y24.js b/assets/OrganizationTaskView-JO8z_y24.js deleted file mode 100644 index 4e5ec8551dd2191f4b4ce8f675d42d02ab7c069a..0000000000000000000000000000000000000000 --- a/assets/OrganizationTaskView-JO8z_y24.js +++ /dev/null @@ -1 +0,0 @@ -import{f as i,j as t}from"./index-D9_nPZtO.js";import{O as m}from"./OrganizationPaperFeed-B-ZiEuUF.js";import p from"./NotFound-DLV3c5vS.js";import"./useQuery-cycUreG-.js";import"./components-DrTew0nD.js";import"./LatexTitle-BtRWGRIx.js";import"./katex.min-BSBacQyE.js";import"./transform-BObV5jzB.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-skQuzg4e.js";import"./PaperPreviewLink-D3OkhqBL.js";import"./index-XzA0bTLC.js";import"./hover-card-DVeX2fQl.js";import"./OrganizationContributionGraph-CjsAmlOx.js";import"./skeleton-CQ2CM4l9.js";import"./useIntersectionObserver-CZXk9yc2.js";import"./alert-B0bcMmNw.js";import"./searchable-select-Css_GGu3.js";import"./button-B859643f.js";import"./dialog-DnjY6ZOM.js";import"./loader-circle-CrVj12oC.js";import"./usePapers-B3J6SKWU.js";import"./useInfiniteQuery-CQNVzwuX.js";const V=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{V as default}; diff --git a/assets/OrganizationsIndexView-DH89Eu3h.js b/assets/OrganizationsIndexView-DH89Eu3h.js deleted file mode 100644 index a7870acfd64270bb81284bf1ed3315f11a4213a8..0000000000000000000000000000000000000000 --- a/assets/OrganizationsIndexView-DH89Eu3h.js +++ /dev/null @@ -1 +0,0 @@ -import{a as u,r as g,j as e,L as x,c as j}from"./index-D9_nPZtO.js";import{u as y}from"./useQuery-cycUreG-.js";import{A as f,a as _}from"./alert-B0bcMmNw.js";import{S as N}from"./skeleton-CQ2CM4l9.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},z=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",l=y({queryKey:["organizations","featured"],queryFn:()=>j.getOrganizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=l.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,o)=>(o.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(o.name)||r.slug.localeCompare(o.slug)):t==="name"?[...a].sort((r,o)=>r.name.localeCompare(o.name)||r.slug.localeCompare(o.slug)):a},[l.data,c,t]);return e.jsxs("div",{className:"page organizations-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:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=l.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),l.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(N,{className:"organization-card-skeleton"},a))}):l.error?e.jsx(f,{variant:"destructive",children:e.jsxs(_,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>l.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{z as default}; diff --git a/assets/OrganizationsIndexView-DMKv-CHw.js b/assets/OrganizationsIndexView-DMKv-CHw.js new file mode 100644 index 0000000000000000000000000000000000000000..938b2e47bd7d0eb9cb90feca3fb9a0be31434631 --- /dev/null +++ b/assets/OrganizationsIndexView-DMKv-CHw.js @@ -0,0 +1 @@ +import{a as u,r as g,j as e,L as x}from"./index-Czt286FG.js";import{u as j}from"./useQuery-DLzEukS9.js";import{A as y,a as f}from"./alert-pIw6ZaYb.js";import{S as _}from"./skeleton-B7eqTJnv.js";import{c as N}from"./catalog-BRyB71ZU.js";const v=n=>n==="papers"||n==="name"?n:"trending",S=({organization:n})=>{const[d,t]=g.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>t(!0)})})},A=()=>{var h;const[n,d]=u(),t=v(n.get("sort")),c=n.get("q")??"",o=j({queryKey:["organizations","featured"],queryFn:()=>N.organizations(!0),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),i=s.sort??t,r=s.query??c;i==="trending"?a.delete("sort"):a.set("sort",i),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=g.useMemo(()=>{var i;const s=c.trim().toLocaleLowerCase(),a=(((i=o.data)==null?void 0:i.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return t==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):t==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,t]);return e.jsxs("div",{className:"page organizations-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:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from 21 leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsxs("h2",{id:"organizations-heading",children:[((h=o.data)==null?void 0:h.count)??21," organizations"]}),e.jsx("span",{children:t==="trending"?"Ranked by 30-day momentum":t==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:t===s?"active":"","aria-pressed":t===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true",children:Array.from({length:6}).map((s,a)=>e.jsx(_,{className:"organization-card-skeleton"},a))}):o.error?e.jsx(y,{variant:"destructive",children:e.jsxs(f,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,i=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(S,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),t==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[i?`Publishing ${i}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{A as default}; diff --git a/assets/PaperDetailView-CL5W15M-.js b/assets/PaperDetailView-CL5W15M-.js new file mode 100644 index 0000000000000000000000000000000000000000..11a92af7df1ecb9ba300c3c0a1f3f9c2e9709df7 --- /dev/null +++ b/assets/PaperDetailView-CL5W15M-.js @@ -0,0 +1,29 @@ +import{d as St,r as h,j as e,P as xs,m as ke,n as bs,o as De,q as Le,s as js,t as It,C as je,v as Xe,k as he,h as pe,X as At,p as W,g as Ze,R as We,A as yt,c as _t,w as vs,e as la,x as ca,y as da,I as ua,z as ys,B as ma,D as ha,T as pa,f as fa,E as ga,u as xa,F as ba,L as xe,G as ja,H as va,J as ya,K as _a,M as ka,N as wa}from"./index-Czt286FG.js";import{u as ne}from"./useQuery-DLzEukS9.js";import{I as J,S as Na,a as Ca,T as Ea,M as Sa}from"./components-D0aZHC0e.js";import{e as Ye,C as Ia,E as Aa}from"./evaluations-DoOZeNPs.js";import{L as Ke,a as $a}from"./LatexTitle-BMNMJu5R.js";import{s as Pa}from"./transform-IZH7YNlm.js";import{f as Ra,D as Fa}from"./latexPlainText-DI8YEXVe.js";import{a as Ta}from"./usePapers-BlskNTEC.js";import{S as Fe}from"./skeleton-B7eqTJnv.js";import{A as La,a as Ua}from"./alert-pIw6ZaYb.js";import{B as H}from"./button-vhqVRnBn.js";import{u as _s}from"./index-DzH9562Y.js";import{I as ee}from"./textarea-Ov25LunA.js";import{D as oe,a as le,b as ce,c as de,d as ue,e as me}from"./dialog-CJthLFv3.js";import{u as fe}from"./useMutation-DqQi_NTN.js";import{c as _e}from"./catalog-BRyB71ZU.js";import{s as ve}from"./submissions-BsEO_Bbg.js";import{S as $t,P as et,L as re,a as Da}from"./SignInToEditDialog-Dgq0yOYP.js";import{S as Ue,a as ns}from"./searchable-select-D6ZufK5P.js";import{L as ie}from"./loader-circle-DyZRZBrM.js";import{B as ks,D as Ba,c as Ha,g as Ma,s as za,a as qa,b as Ka,d as Oa,i as Ga,e as Qa}from"./codexAddEvals-CMSsCOlW.js";import{n as ct,g as is}from"./github-Cy0ZQSs0.js";import{G as os}from"./github-HgTw2jEK.js";import{S as ls,s as Va}from"./savedPapersAuth-CPfYg_9a.js";import{M as Ja,r as Xa}from"./index-Bzn4VKTO.js";import{s as Ce}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-g7QtmX4K.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-Dk5Z9hLn.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 cs=St("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + * @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 ws=St("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** + * @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 tt=St("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function Wa(t){return t!=null&&t.can_directly_edit_catalog?"direct":"pending"}function Ya(t){return(t??[]).filter(a=>!!(a.dataset_slug&&a.task_slug))}function Za(t,a,n="https://paperswithcode.co"){return a.map(l=>{const i=encodeURIComponent(l.evaluation_id),c=`${n}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge.svg?eval=${i}&live=1`,o=`${n}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge-link?eval=${i}`;return`[![${`Papers with Code: ${l.best_rank===1?"SOTA":`#${l.best_rank}`} on ${l.dataset_name}`}](${c})](${o})`}).join(` +`)}function er(t,a=!0){return ne({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return Ye.byPaper(t)},enabled:a&&!!t,staleTime:0,refetchOnMount:"always"})}const Ns=t=>t.replace(/v\d+$/,""),tr={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},dt=(t,a)=>{const n=(t[a]||[]).length;return n<100?{count:n,isLimited:!1}:{count:n,isLimited:!0}},ut=(t,a)=>{const n=t[a];return Array.isArray(n)?n.map(l=>{if(typeof l=="string")return l;if(l&&typeof l=="object"){const i=l;return i.id||i.repoId||null}return null}).filter(l=>!!l).map(l=>`${tr[a]}${l}`):[]},sr=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${Ns(t)}`)).ok}catch{return!1}},ar=async t=>{const a=Ns(t),[n,l]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${a}/repos`).then(async x=>x.ok?x.json():(console.warn(`Failed to fetch repos for arXiv:${a}, status: ${x.status}`),null)).catch(x=>(console.warn(`Failed to fetch repos for arXiv:${a}:`,x),null)),sr(a)]);if(!n)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:l};const i=dt(n,"models"),c=dt(n,"datasets"),o=dt(n,"spaces");return{models:i.count,datasets:c.count,spaces:o.count,modelUrls:ut(n,"models"),datasetUrls:ut(n,"datasets"),spaceUrls:ut(n,"spaces"),isLimited:i.isLimited||c.isLimited||o.isLimited,paperExists:l}},rr=t=>ne({queryKey:["huggingface-repos",t],queryFn:()=>ar(t),enabled:!!t,staleTime:10*60*1e3,retry:1}),nr={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url"};function ir(t){return nr[t]??null}function or(){const[t,a]=h.useState(null),n=h.useCallback(i=>{a(i)},[]),l=h.useCallback((i,c)=>{a(o=>c?i:o===i?null:o)},[]);return{activeEditor:t,openEditor:n,setEditorOpen:l}}var st="Checkbox",[lr]=It(st),[cr,Pt]=lr(st);function dr(t){const{__scopeCheckbox:a,checked:n,children:l,defaultChecked:i,disabled:c,form:o,name:x,onCheckedChange:u,required:s,value:w="on",internal_do_not_use_render:_}=t,[I,N]=bs({prop:n,defaultProp:i??!1,onChange:u,caller:st}),[$,p]=h.useState(null),[T,L]=h.useState(null),R=h.useRef(!1),B=$?!!o||!!$.closest("form"):!0,D={checked:I,disabled:c,setChecked:N,control:$,setControl:p,name:x,form:o,value:w,hasConsumerStoppedPropagationRef:R,required:s,defaultChecked:be(i)?!1:i,isFormControl:B,bubbleInput:T,setBubbleInput:L};return e.jsx(cr,{scope:a,...D,children:ur(_)?_(D):l})}var Cs="CheckboxTrigger",Es=h.forwardRef(({__scopeCheckbox:t,onKeyDown:a,onClick:n,...l},i)=>{const{control:c,value:o,disabled:x,checked:u,required:s,setControl:w,setChecked:_,hasConsumerStoppedPropagationRef:I,isFormControl:N,bubbleInput:$}=Pt(Cs,t),p=De(i,w),T=h.useRef(u);return h.useEffect(()=>{const L=c==null?void 0:c.form;if(L){const R=()=>_(T.current);return L.addEventListener("reset",R),()=>L.removeEventListener("reset",R)}},[c,_]),e.jsx(ke.button,{type:"button",role:"checkbox","aria-checked":be(u)?"mixed":u,"aria-required":s,"data-state":Ps(u),"data-disabled":x?"":void 0,disabled:x,value:o,...l,ref:p,onKeyDown:Le(a,L=>{L.key==="Enter"&&L.preventDefault()}),onClick:Le(n,L=>{_(R=>be(R)?!0:!R),$&&N&&(I.current=L.isPropagationStopped(),I.current||L.stopPropagation())})})});Es.displayName=Cs;var Rt=h.forwardRef((t,a)=>{const{__scopeCheckbox:n,name:l,checked:i,defaultChecked:c,required:o,disabled:x,value:u,onCheckedChange:s,form:w,..._}=t;return e.jsx(dr,{__scopeCheckbox:n,checked:i,defaultChecked:c,disabled:x,required:o,onCheckedChange:s,name:l,form:w,value:u,internal_do_not_use_render:({isFormControl:I})=>e.jsxs(e.Fragment,{children:[e.jsx(Es,{..._,ref:a,__scopeCheckbox:n}),I&&e.jsx($s,{__scopeCheckbox:n})]})})});Rt.displayName=st;var Ss="CheckboxIndicator",Is=h.forwardRef((t,a)=>{const{__scopeCheckbox:n,forceMount:l,...i}=t,c=Pt(Ss,n);return e.jsx(xs,{present:l||be(c.checked)||c.checked===!0,children:e.jsx(ke.span,{"data-state":Ps(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...t.style}})})});Is.displayName=Ss;var As="CheckboxBubbleInput",$s=h.forwardRef(({__scopeCheckbox:t,...a},n)=>{const{control:l,hasConsumerStoppedPropagationRef:i,checked:c,defaultChecked:o,required:x,disabled:u,name:s,value:w,form:_,bubbleInput:I,setBubbleInput:N}=Pt(As,t),$=De(n,N),p=_s(c),T=js(l);h.useEffect(()=>{const R=I;if(!R)return;const B=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(B,"checked").set,d=!i.current;if(p!==c&&y){const f=new Event("click",{bubbles:d});R.indeterminate=be(c),y.call(R,be(c)?!1:c),R.dispatchEvent(f)}},[I,p,c,i]);const L=h.useRef(be(c)?!1:c);return e.jsx(ke.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??L.current,required:x,disabled:u,name:s,value:w,form:_,...a,tabIndex:-1,ref:$,style:{...a.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});$s.displayName=As;function ur(t){return typeof t=="function"}function be(t){return t==="indeterminate"}function Ps(t){return be(t)?"indeterminate":t?"checked":"unchecked"}const at=h.forwardRef(({className:t,style:a,...n},l)=>e.jsx(Rt,{ref:l,className:Xe("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...a},...n,children:e.jsx(Is,{className:Xe("flex items-center justify-center text-current"),children:e.jsx(je,{className:"h-4 w-4"})})}));at.displayName=Rt.displayName;function mr(t,a,n){if(!t)return t;const l=i=>i.paper_id!==a||i.paper_title===n?i:{...i,paper_title:n};if(Array.isArray(t)){const i=t.map(l);return i.some((o,x)=>o!==t[x])?i:t}if(Array.isArray(t.results)){const i=t.results.map(l);return i.some((o,x)=>o!==t.results[x])?{...t,results:i}:t}return t}function Se(t,a,n){new Set([...n,a.id,a.arxiv_id].filter(o=>!!o)).forEach(o=>{t.setQueryData(["paper",o],a),t.setQueryData(["paper-arxiv",o],a)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const i=String(a.id),c=o=>mr(o,i,a.title);t.setQueriesData({queryKey:["evaluations"]},c),t.setQueriesData({queryKey:["dataset-evals"]},c),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function ye({isAuthor:t=!1}){const a=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:a?"Test-only: this change stays on staging.":"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:a?"This exercises staging-local pending behavior and is not queued for production review.":t?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const hr=250,pr=100;function fr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialTaskIds:i,initialTasks:c,onSuccess:o,submitMode:x="direct",isAuthor:u=!1}){const[s,w]=h.useState(i),[_,I]=h.useState(!1),[N,$]=h.useState(""),[p,T]=h.useState(""),[L,R]=h.useState(new Map),B=he(),{toast:D}=pe(),y=h.useRef(!1);h.useEffect(()=>{if(!t){y.current=!1;return}if(y.current)return;y.current=!0,w(i),$(""),T("");const m=new Map;(c||[]).forEach(C=>{const A=parseInt(C.id);Number.isNaN(A)||m.set(A,C)}),R(m)},[t,i,c]),h.useEffect(()=>{const m=window.setTimeout(()=>{T(N.trim())},hr);return()=>window.clearTimeout(m)},[N]);const{data:d,isFetching:f}=ne({queryKey:["tasks-search",p],queryFn:()=>_e.listTasks({page_size:pr,...p?{q:p}:{}}),enabled:t});h.useEffect(()=>{var m;(m=d==null?void 0:d.results)!=null&&m.length&&R(C=>{const A=new Map(C);return d.results.forEach(U=>{const E=parseInt(U.id);Number.isNaN(E)||A.set(E,U)}),A})},[d]);const v=h.useMemo(()=>{const m=(d==null?void 0:d.results)||[],C=new Set,A=[];return s.forEach(U=>{if(C.has(U))return;const E=L.get(U);E&&(A.push(E),C.add(U))}),m.forEach(U=>{const E=parseInt(U.id);Number.isNaN(E)||C.has(E)||(A.push(U),C.add(E))}),A},[d,s,L]),F=fe({mutationFn:async({paperId:m,taskIds:C})=>x==="pending"?(await ve.submit({paper_id:parseInt(m),edit_type:"tasks",proposed_payload:{task_ids:C}}),null):W.updateTasks(m,C),onMutate:async({taskIds:m})=>{if(x==="pending")return{snapshots:[]};const C=m.map(E=>L.get(E)).filter(E=>!!E).map(E=>({id:E.id,name:E.name,slug:E.slug})).sort((E,z)=>E.name.localeCompare(z.name)),A=Array.from(new Set([n,l].filter(E=>!!E)));await Promise.all(A.flatMap(E=>[B.cancelQueries({queryKey:["paper",E]}),B.cancelQueries({queryKey:["paper-arxiv",E]})]));const U=[];return A.forEach(E=>{["paper","paper-arxiv"].forEach(z=>{const Y=[z,E],g=B.getQueryData(Y);U.push({key:Y,data:g}),g&&B.setQueryData(Y,{...g,tasks:C})})}),D({title:"Tasks updated",description:`Saved ${m.length} task${m.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1),{snapshots:U}},onSuccess:m=>{if(x==="pending"){D({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),o==null||o(),a(!1);return}m&&Se(B,m,[n,l])},onError:(m,C,A)=>{var z,Y;(z=A==null?void 0:A.snapshots)==null||z.forEach(({key:g,data:S})=>{B.setQueryData(g,S)});const U=m;let E=U.message||(x==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(U.response)try{const g=JSON.parse(U.response);typeof(g==null?void 0:g.detail)=="string"?E=g.detail:Array.isArray(g==null?void 0:g.detail)&&((Y=g.detail[0])!=null&&Y.msg)&&(E=g.detail[0].msg)}catch{E=U.response}D({title:x==="pending"?"Could not submit edit":"Could not save tasks",description:E,variant:"destructive"})}}),K=()=>{x==="direct"&&i.some(m=>!s.includes(m))&&!window.confirm("Remove one or more task links from this paper?")||F.mutate({paperId:n,taskIds:s})},O=h.useMemo(()=>{if(s.length!==i.length)return!0;const m=new Set(i);return s.some(C=>!m.has(C))},[s,i]),Q=(m,C)=>{w(A=>C?A.includes(m)?A:[...A,m]:A.filter(U=>U!==m))},X=()=>$("");return e.jsxs(oe,{open:t,onOpenChange:a,children:[e.jsxs(le,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Paper Tasks"}),e.jsx(ue,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),x==="pending"&&e.jsx(ye,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ue,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ee,{type:"text",placeholder:"Search tasks...",value:N,onChange:m=>$(m.target.value),className:"pl-9 pr-9"}),N&&e.jsx("button",{type:"button",onClick:X,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(At,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:v.length>0?e.jsx("div",{className:"space-y-2",children:v.map(m=>{const C=parseInt(m.id),A=s.includes(C);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(at,{id:`task-${m.id}`,checked:A,onCheckedChange:U=>Q(C,U===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${m.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[m.name,m.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[m.description.substring(0,100),m.description.length>100?"...":""]})]})]},m.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ie,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ue,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:p?`No tasks found matching "${p}"`:"No tasks available"})]})}),e.jsxs(me,{children:[e.jsx(H,{variant:"ghost",className:"sm:mr-auto",onClick:()=>I(!0),children:"Suggest a new task"}),e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:K,disabled:F.isPending||!O,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),x==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),x==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx($t,{open:_,onOpenChange:I,paperId:n,kind:"task"})]})}const gr=250,xr=100;function br({open:t,onOpenChange:a,paperId:n,arxivId:l,initialMethodIds:i,initialMethods:c,onSuccess:o,submitMode:x="direct",isAuthor:u=!1}){const[s,w]=h.useState(i),[_,I]=h.useState(!1),[N,$]=h.useState(""),[p,T]=h.useState(""),[L,R]=h.useState(new Map),B=he(),{toast:D}=pe(),y=h.useRef(!1);h.useEffect(()=>{if(!t){y.current=!1;return}if(y.current)return;y.current=!0,w(i),$(""),T("");const m=new Map;(c||[]).forEach(C=>{const A=parseInt(C.id);Number.isNaN(A)||m.set(A,C)}),R(m)},[t,i,c]),h.useEffect(()=>{const m=window.setTimeout(()=>{T(N.trim())},gr);return()=>window.clearTimeout(m)},[N]);const{data:d,isFetching:f}=ne({queryKey:["methods-search",p],queryFn:()=>_e.listMethods({page_size:xr,...p?{q:p}:{}}),enabled:t});h.useEffect(()=>{var m;(m=d==null?void 0:d.results)!=null&&m.length&&R(C=>{const A=new Map(C);return d.results.forEach(U=>{const E=parseInt(U.id);Number.isNaN(E)||A.set(E,U)}),A})},[d]);const v=h.useMemo(()=>{const m=(d==null?void 0:d.results)||[],C=new Set,A=[];return s.forEach(U=>{if(C.has(U))return;const E=L.get(U);E&&(A.push(E),C.add(U))}),m.forEach(U=>{const E=parseInt(U.id);Number.isNaN(E)||C.has(E)||(A.push(U),C.add(E))}),A},[d,s,L]),F=fe({mutationFn:async({paperId:m,methodIds:C})=>x==="pending"?(await ve.submit({paper_id:parseInt(m),edit_type:"methods",proposed_payload:{method_ids:C}}),null):W.updateMethods(m,C),onSuccess:m=>{if(x==="pending"){D({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),o==null||o(),a(!1);return}m&&Se(B,m,[n,l]),D({title:"Methods updated",description:`Saved ${s.length} method${s.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1)},onError:m=>{var U;const C=m;let A=C.message||(x==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(C.response)try{const E=JSON.parse(C.response);typeof(E==null?void 0:E.detail)=="string"?A=E.detail:Array.isArray(E==null?void 0:E.detail)&&((U=E.detail[0])!=null&&U.msg)&&(A=E.detail[0].msg)}catch{A=C.response}D({title:x==="pending"?"Could not submit edit":"Could not save methods",description:A,variant:"destructive"})}}),K=()=>{x==="direct"&&i.some(m=>!s.includes(m))&&!window.confirm("Remove one or more method links from this paper?")||F.mutate({paperId:n,methodIds:s})},O=h.useMemo(()=>{if(s.length!==i.length)return!0;const m=new Set(i);return s.some(C=>!m.has(C))},[s,i]),Q=(m,C)=>{w(A=>C?A.includes(m)?A:[...A,m]:A.filter(U=>U!==m))},X=()=>$("");return e.jsxs(oe,{open:t,onOpenChange:a,children:[e.jsxs(le,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Paper Methods"}),e.jsx(ue,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),x==="pending"&&e.jsx(ye,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Ue,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(ee,{type:"text",placeholder:"Search methods...",value:N,onChange:m=>$(m.target.value),className:"pl-9 pr-9"}),N&&e.jsx("button",{type:"button",onClick:X,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(At,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:v.length>0?e.jsx("div",{className:"space-y-2",children:v.map(m=>{const C=parseInt(m.id),A=s.includes(C);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(at,{id:`method-${m.id}`,checked:A,onCheckedChange:U=>Q(C,U===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${m.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[m.name,m.full_name&&m.full_name!==m.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:m.full_name}),m.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[m.description.substring(0,100),m.description.length>100?"...":""]})]})]},m.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ie,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ue,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:p?`No methods found matching "${p}"`:"No methods available"})]})}),e.jsxs(me,{children:[e.jsx(H,{variant:"ghost",className:"sm:mr-auto",onClick:()=>I(!0),children:"Suggest a new method"}),e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:K,disabled:F.isPending||!O,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),x==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),x==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx($t,{open:_,onOpenChange:I,paperId:n,kind:"method"})]})}function jr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialRepositories:i,onSuccess:c,submitMode:o="direct",isAuthor:x=!1}){const[u,s]=h.useState(i),[w,_]=h.useState(""),I=he(),{toast:N}=pe(),$=h.useRef(!1);h.useEffect(()=>{if(!t){$.current=!1;return}$.current||($.current=!0,s(i),_(""))},[t,i]);const p=fe({mutationFn:async({paperId:f,repositories:v})=>o==="pending"?(await ve.submit({paper_id:parseInt(f),edit_type:"repositories",proposed_payload:{repositories:v}}),null):W.updateRepositories(f,v),onSuccess:f=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),c==null||c(),a(!1),_("");return}f&&Se(I,f,[n,l]),c==null||c(),a(!1),_("")},onError:f=>{var K;const v=f;let F=v.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(v.response)try{const O=JSON.parse(v.response);typeof(O==null?void 0:O.detail)=="string"?F=O.detail:Array.isArray(O==null?void 0:O.detail)&&((K=O.detail[0])!=null&&K.msg)&&(F=O.detail[0].msg)}catch{F=v.response}N({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:F,variant:"destructive"})}}),T=f=>{const v=[];for(const F of f){const K=v.find(O=>is(O.url,F.url));if(K)K.is_official=K.is_official||F.is_official;else{const O=ct(F.url);v.push({url:O??F.url.trim(),is_official:F.is_official})}}return v},L=()=>{const f=w.trim(),v=f?[...u,{url:f,is_official:!1}]:u;return f&&u.some(F=>is(F.url,f))?(alert("This repository URL is already added"),null):T(v)},R=()=>{const f=L();f!==null&&f.length!==u.length&&(s(f),_(""))},B=f=>{s(u.filter(v=>v.url!==f))},D=f=>{s(u.map(v=>v.url===f?{...v,is_official:!v.is_official}:v))},y=()=>{const f=L();f!==null&&(o==="direct"&&i.some(v=>!f.some(F=>F.url===v.url))&&!window.confirm("Remove one or more repositories from this paper?")||p.mutate({paperId:n,repositories:f}))},d=h.useMemo(()=>{const f=w.trim(),v=f?[...u,{url:f,is_official:!1}]:u;if(v.length!==i.length)return!0;const F=T(i),K=T(v);if(K.length!==F.length)return!0;const O=new Map(F.map(Q=>[ct(Q.url)??Q.url.trim(),!!Q.is_official]));return K.some(Q=>{const X=ct(Q.url)??Q.url.trim(),m=O.get(X);return m===void 0||m!==!!Q.is_official})},[u,w,i]);return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Paper Repositories"}),e.jsx(ue,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(ye,{isAuthor:x}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(ee,{type:"url",placeholder:"https://github.com/owner/repo",value:w,onChange:f=>_(f.target.value),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),R())},className:"flex-1"}),e.jsxs(H,{onClick:R,size:"sm",disabled:!w.trim(),children:[e.jsx(et,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((f,v)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(os,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:f.url}),f.is_official&&e.jsx(ks,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(H,{variant:f.is_official?"default":"outline",size:"sm",onClick:()=>D(f.url),className:"h-8 px-2 text-xs",title:f.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ws,{className:`w-3.5 h-3.5 mr-1 ${f.is_official?"fill-current":""}`}),f.is_official?"Official":"Mark official"]}),e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>B(f.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(tt,{className:"w-4 h-4"})})]})]},v))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(os,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:y,disabled:p.isPending||!d,children:p.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function vr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialProjectPages:i,onSuccess:c,submitMode:o="direct",isAuthor:x=!1}){const[u,s]=h.useState(i),[w,_]=h.useState(""),I=he(),{toast:N}=pe(),$=h.useRef(!1);h.useEffect(()=>{if(!t){$.current=!1;return}$.current||($.current=!0,s(i),_(""))},[t,i]);const p=fe({mutationFn:async({paperId:d,projectPages:f})=>o==="pending"?(await ve.submit({paper_id:parseInt(d),edit_type:"project_pages",proposed_payload:{project_pages:f}}),null):W.updateProjectPages(d,f),onSuccess:d=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),c==null||c(),a(!1),_("");return}d&&Se(I,d,[n,l]),c==null||c(),a(!1),_("")},onError:d=>{var F;const f=d;let v=f.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(f.response)try{const K=JSON.parse(f.response);typeof(K==null?void 0:K.detail)=="string"?v=K.detail:Array.isArray(K==null?void 0:K.detail)&&((F=K.detail[0])!=null&&F.msg)&&(v=K.detail[0].msg)}catch{v=f.response}N({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:v,variant:"destructive"})}}),T=()=>{const d=w.trim();return d?u.some(f=>f.url===d)?(alert("This project page URL is already added"),null):[...u,{url:d,is_official:!1}]:u},L=()=>{const d=T();d!==null&&d.length!==u.length&&(s(d),_(""))},R=d=>{s(u.filter(f=>f.url!==d))},B=d=>{s(u.map(f=>f.url===d?{...f,is_official:!f.is_official}:f))},D=()=>{const d=T();d!==null&&(o==="direct"&&i.some(f=>!d.some(v=>v.url===f.url))&&!window.confirm("Remove one or more project pages from this paper?")||p.mutate({paperId:n,projectPages:d}))},y=h.useMemo(()=>{const d=w.trim(),f=d?[...u,{url:d,is_official:!1}]:u;if(f.length!==i.length)return!0;const v=new Map(i.map(F=>[F.url.trim(),!!F.is_official]));return f.some(F=>{const K=v.get(F.url.trim());return K===void 0||K!==!!F.is_official})},[u,w,i]);return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Paper Project Pages"}),e.jsx(ue,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(ye,{isAuthor:x}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(ee,{type:"url",placeholder:"https://example.com/project",value:w,onChange:d=>_(d.target.value),onKeyPress:d=>{d.key==="Enter"&&(d.preventDefault(),L())},className:"flex-1"}),e.jsxs(H,{onClick:L,size:"sm",disabled:!w.trim(),children:[e.jsx(et,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((d,f)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(cs,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:d.url}),d.is_official&&e.jsx(ks,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(H,{variant:d.is_official?"default":"outline",size:"sm",onClick:()=>B(d.url),className:"h-8 px-2 text-xs",title:d.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ws,{className:`w-3.5 h-3.5 mr-1 ${d.is_official?"fill-current":""}`}),d.is_official?"Official":"Mark official"]}),e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>R(d.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(tt,{className:"w-4 h-4"})})]})]},f))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(cs,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:D,disabled:p.isPending||!y,children:p.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function yr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialUrl:i,onSuccess:c,submitMode:o="direct",isAuthor:x=!1}){const[u,s]=h.useState(i),w=he(),{toast:_}=pe(),I=h.useRef(!1);h.useEffect(()=>{if(!t){I.current=!1;return}I.current||(I.current=!0,s(i))},[t,i]);const N=fe({mutationFn:async({paperId:R,sourceUrl:B})=>o==="pending"?(await ve.submit({paper_id:parseInt(R),edit_type:"source_url",proposed_payload:{source_url:B}}),null):W.updateSourceUrl(R,B),onSuccess:R=>{if(o==="pending"){_({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),c==null||c(),a(!1);return}R&&Se(w,R,[n,l]),c==null||c(),a(!1)},onError:R=>{var y;const B=R;let D=B.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(B.response)try{const d=JSON.parse(B.response);typeof(d==null?void 0:d.detail)=="string"?D=d.detail:Array.isArray(d==null?void 0:d.detail)&&((y=d.detail[0])!=null&&y.msg)&&(D=d.detail[0].msg)}catch{D=B.response}_({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:D,variant:"destructive"})}}),$=u.trim(),p=/^https?:\/\//i.test($),T=$!==(i||"").trim(),L=()=>{p&&N.mutate({paperId:n,sourceUrl:$})};return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{className:"max-w-2xl",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Source URL"}),e.jsxs(ue,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(ye,{isAuthor:x}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(ee,{type:"url",placeholder:"https://example.com/paper",value:u,onChange:R=>s(R.target.value),onKeyPress:R=>{R.key==="Enter"&&p&&T&&(R.preventDefault(),L())}}),!p&&$.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:L,disabled:N.isPending||!p||!T,children:N.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const mt=100;function _r(t){return(t??[]).some(a=>a.slug==="coding-agents"||a.name.trim().toLowerCase()==="coding agents")}function ds(t){const a=parseInt(t.task_id,10),n=parseInt(t.dataset_id,10);return!(!Number.isFinite(a)||!Number.isFinite(n)||!t.metric_name.trim()||!t.metric_value.trim())}function kr(t){return t.map(a=>{const n=a.best_metric||Object.keys(a.metrics)[0],l=a.metrics[n];return{id:a.id,task_id:a.task_id,dataset_id:a.dataset_id,model_name:a.model_name||"",harness:a.harness||"",metric_name:n||"",metric_value:String(l||""),best_rank:a.best_rank?String(a.best_rank):"",num_parameters:a.num_parameters!=null?String(a.num_parameters):"",hf_model_url:a.hf_model_url||"",is_open:a.is_open!==!1,operation:"unchanged"}})}function wr(t){const a=new Map;return t.forEach(n=>{n.task_id&&n.task_name&&a.set(n.task_id,{id:n.task_id,name:n.task_name,slug:n.task_slug,level:0})}),a}function Nr(t){const a=new Map;return t.forEach(n=>{n.dataset_id&&n.dataset_name&&a.set(n.dataset_id,{id:n.dataset_id,name:n.dataset_name,slug:n.dataset_slug})}),a}function us(t,a){return`${t}:${a}`}function Oe(t){const a=t.trim();if(a==="")return null;const n=Number(a);return!Number.isFinite(n)||n<0?null:Math.trunc(n)}function Ge(t){const a=t.trim();return a===""?null:a}function Cr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialEvaluations:i,paperTasks:c,onSuccess:o,submitMode:x="direct",isAdmin:u=!1,isAuthor:s=!1}){const w=_r(c),[_,I]=h.useState([]),[N,$]=h.useState(null),[p,T]=h.useState(new Map),[L,R]=h.useState(new Map),B=he(),{toast:D}=pe(),y=h.useRef(!1),d=h.useRef(!1);h.useEffect(()=>{if(!t){y.current=!1,d.current=!1;return}y.current||d.current||i.length!==0&&(y.current=!0,I(kr(i)),T(wr(i)),R(Nr(i)))},[t,i]);const f=h.useMemo(()=>Array.from(new Set(_.map(g=>g.task_id).filter(g=>g&&g!==""))),[_]),v=h.useMemo(()=>{const g=new Set;return _.forEach(S=>{S.task_id&&S.dataset_id&&g.add(us(S.task_id,S.dataset_id))}),Array.from(g)},[_]),F=ne({queryKey:["datasets-by-tasks-for-eval-edit",f,t],queryFn:async()=>{const g={};return await Promise.all(f.map(async S=>{try{const P=await _e.listDatasets({task_id:parseInt(S),page_size:mt});g[S]=P.results}catch(P){console.error(`Error fetching datasets for task ${S}:`,P),g[S]=[]}})),g},enabled:t&&f.length>0});h.useEffect(()=>{F.data&&R(g=>{const S=new Map(g);return Object.values(F.data).forEach(P=>{P.forEach(b=>{S.set(b.id,b)})}),S})},[F.data]);const K=ne({queryKey:["leaderboard-metrics-for-eval-edit",v,t],queryFn:async()=>{const g={};return await Promise.all(v.map(async S=>{const[P,b]=S.split(":");try{g[S]=await _e.leaderboardMetrics(b,P)}catch(j){console.error(`Error fetching metrics for leaderboard ${S}:`,j),g[S]=[]}})),g},enabled:t&&v.length>0}),O=async g=>{const S=await _e.listTasks({page_size:mt,...g?{q:g}:{}});return T(P=>{const b=new Map(P);return S.results.forEach(j=>b.set(j.id,j)),b}),S.results.map(P=>{var b;return{value:P.id,label:P.name,description:(b=P.description)==null?void 0:b.slice(0,100)}})},Q=g=>async S=>{const P=await _e.listDatasets({task_id:parseInt(g),page_size:mt,...S?{q:S}:{}});return R(b=>{const j=new Map(b);return P.results.forEach(q=>j.set(q.id,q)),j}),P.results.map(b=>({value:b.id,label:b.name,description:b.full_name}))},X=(g,S)=>{if(!g||!S)return!1;const P=L.get(S);return!!(P!=null&&P.supports_harness)},m=(g,S,P)=>{var q;if(!g||!S)return[];const j=(((q=K.data)==null?void 0:q[us(g,S)])||[]).map(M=>({value:M.metric_name,label:M.metric_name,description:M.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return P&&!j.some(M=>M.value===P)&&j.unshift({value:P,label:`${P} (legacy)`}),j},C=fe({mutationFn:async({paperId:g,evaluations:S})=>{if(x==="pending"){const b=[];for(const j of S){if(j.operation==="delete"&&j.id){b.push({op:"delete",evaluation_id:parseInt(j.id)});continue}const q=X(j.task_id,j.dataset_id);if(j.operation==="create"){if(!ds(j))continue;const M=Oe(j.num_parameters),te={task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),metrics:{[j.metric_name]:j.metric_value},best_metric:j.metric_name},Ie=Ge(j.hf_model_url);j.model_name&&(te.model_name=j.model_name),q&&j.harness&&(te.harness=j.harness),j.best_rank&&(te.best_rank=parseInt(j.best_rank)),M!=null&&(te.num_parameters=M),Ie!=null&&(te.hf_model_url=Ie),te.is_open=j.is_open,b.push({op:"create",data:te})}else if(j.operation==="update"&&j.id){const M={task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),model_name:j.model_name||void 0,harness:q&&j.harness||null,metrics:{[j.metric_name]:j.metric_value},best_metric:j.metric_name,best_rank:j.best_rank?parseInt(j.best_rank):void 0,num_parameters:Oe(j.num_parameters),hf_model_url:Ge(j.hf_model_url),is_open:j.is_open};b.push({op:"update",evaluation_id:parseInt(j.id),data:M})}}return b.length===0?{submitted:!1}:(await ve.submit({paper_id:parseInt(g),edit_type:"evaluations",proposed_payload:{operations:b}}),{submitted:!0})}const P=[];for(const b of S)if(b.operation==="delete"&&b.id)P.push({operation:"delete",evaluation_id:parseInt(b.id)});else if(b.operation==="create"){if(!ds(b))continue;const j=X(b.task_id,b.dataset_id),q=Oe(b.num_parameters);P.push({operation:"create",payload:{paper_id:parseInt(g),task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:j&&b.harness||void 0,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:q??void 0,hf_model_url:Ge(b.hf_model_url)??void 0,is_open:b.is_open}})}else if(b.operation==="update"&&b.id){const j=X(b.task_id,b.dataset_id);P.push({operation:"update",evaluation_id:parseInt(b.id),payload:{task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:j&&b.harness||null,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:Oe(b.num_parameters),hf_model_url:Ge(b.hf_model_url),is_open:b.is_open,harness_set:!0,num_parameters_set:!0,hf_model_url_set:!0}})}if(!u&&P.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");return P.length>0&&await Ye.batch(parseInt(g),P),{submitted:P.length>0}},onSuccess:g=>{if(x==="pending"){g!=null&&g.submitted?D({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):D({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),o==null||o(),a(!1);return}B.invalidateQueries({queryKey:["paper-arxiv",l]}),B.invalidateQueries({queryKey:["evaluations","paper",n]}),o==null||o(),a(!1)},onError:g=>{var b;const S=g;let P=S.message||(x==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(S.response)try{const j=JSON.parse(S.response);typeof(j==null?void 0:j.detail)=="string"?P=j.detail:Array.isArray(j==null?void 0:j.detail)&&((b=j.detail[0])!=null&&b.msg)&&(P=j.detail[0].msg)}catch{P=S.response}D({title:x==="pending"?"Could not submit edit":"Could not save evaluations",description:P,variant:"destructive"})}}),A=()=>{d.current=!0,I([..._,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},U=g=>{if(d.current=!0,_[g].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;I(_.map((P,b)=>b===g?{...P,operation:"delete"}:P))}else I(_.filter((P,b)=>b!==g))},E=(g,S,P)=>{d.current=!0,I(_.map((b,j)=>{if(j!==g)return b;const q={...b,[S]:P};return S==="task_id"&&(q.dataset_id="",q.metric_name="",q.harness=""),S==="dataset_id"&&(q.metric_name="",P&&!X(q.task_id,P)&&(q.harness="")),b.operation==="unchanged"&&(q.operation="update"),q}))},z=(g,S)=>{d.current=!0,I(_.map((P,b)=>{if(b!==g)return P;const j={...P,is_open:S};return P.operation==="unchanged"&&(j.operation="update"),j}))},Y=()=>{const g=_.filter(S=>S.operation!=="delete"||S.id);C.mutate({paperId:n,evaluations:g})};return e.jsxs(oe,{open:t,onOpenChange:a,children:[e.jsxs(le,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Evaluation Results"}),e.jsx(ue,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),x==="pending"&&e.jsx(ye,{isAuthor:s}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[_.filter(g=>g.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${w?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),w&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:_.map((g,S)=>{if(g.operation==="delete")return null;const P=p.get(g.task_id),b=L.get(g.dataset_id),j=m(g.task_id,g.dataset_id,g.metric_name),q=!!(g.task_id&&g.dataset_id)&&K.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(ns,{value:g.task_id,onChange:M=>E(S,"task_id",M),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:P?{value:P.id,label:P.name}:null,queryKey:["eval-edit-task-search"],queryFn:O,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ns,{value:g.dataset_id,onChange:M=>E(S,"dataset_id",M),placeholder:g.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:g.task_id?"No datasets found for this task.":"Select a task first.",disabled:!g.task_id,selectedOption:b?{value:b.id,label:b.name}:null,queryKey:["eval-edit-dataset-search",g.task_id],queryFn:Q(g.task_id),enabled:t&&!!g.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ee,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:g.model_name,onChange:M=>E(S,"model_name",M.target.value)})}),w&&e.jsx("td",{className:"py-2 px-2",children:X(g.task_id,g.dataset_id)?e.jsx(ee,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:g.harness,onChange:M=>E(S,"harness",M.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!g.task_id||!g.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):q?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(ie,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):j.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:g.metric_name,onChange:M=>E(S,"metric_name",M.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),j.map(M=>e.jsx("option",{value:M.value,children:M.label},M.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ee,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:g.metric_value,onChange:M=>E(S,"metric_value",M.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ee,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:g.num_parameters,onChange:M=>E(S,"num_parameters",M.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(ee,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:g.hf_model_url,onChange:M=>E(S,"hf_model_url",M.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:g.is_open,onChange:M=>z(S,M.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>U(S),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(tt,{className:"w-4 h-4"})})})]},S)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ba,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(H,{variant:"outline",size:"sm",onClick:A,className:"flex items-center space-x-2",children:[e.jsx(et,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(me,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(H,{variant:"ghost",onClick:()=>$("benchmark"),children:"Suggest a new benchmark"}),e.jsx(H,{variant:"ghost",onClick:()=>$("metric"),children:"Suggest a new metric"})]}),e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:Y,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),x==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),x==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx($t,{open:N!==null,onOpenChange:g=>{g||$(null)},paperId:n,kind:N??"benchmark"})]})}const ht=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function ms(t){return t.map(a=>a.trim()).filter(Boolean)}function pt(t,a){const n=ms(t).sort(),l=ms(a).sort();return n.length!==l.length?!1:n.every((i,c)=>i===l[c])}function Er(t,a){return pt(t.hf_models,a.hf_models)&&pt(t.hf_datasets,a.hf_datasets)&&pt(t.hf_spaces,a.hf_spaces)}function Sr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialArtifacts:i,onSuccess:c,submitMode:o="direct",isAuthor:x=!1}){const[u,s]=h.useState(i),[w,_]=h.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),I=he(),{toast:N}=pe(),$=h.useRef(!1);h.useEffect(()=>{if(!t){$.current=!1;return}$.current||($.current=!0,s(i),_({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,i]);const p=fe({mutationFn:async({paperId:y,artifacts:d})=>o==="pending"?(await ve.submit({paper_id:parseInt(y),edit_type:"hf_artifacts",proposed_payload:d}),null):W.updateHfArtifacts(y,d),onSuccess:y=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),c==null||c(),a(!1),_({hf_models:"",hf_datasets:"",hf_spaces:""});return}y&&Se(I,y,[n,l]),c==null||c(),a(!1),_({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:y=>{var v;const d=y;let f=d.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(d.response)try{const F=JSON.parse(d.response);typeof(F==null?void 0:F.detail)=="string"?f=F.detail:Array.isArray(F==null?void 0:F.detail)&&((v=F.detail[0])!=null&&v.msg)&&(f=F.detail[0].msg)}catch{f=d.response}N({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:f,variant:"destructive"})}}),T=()=>{const y={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of ht){const f=w[d].trim();if(f){if(y[d].some(v=>v.trim()===f))return alert(`This ${d.replace("hf_","")} URL is already added`),null;y[d]=[...y[d],f]}}return y},L=y=>{const d=w[y].trim();if(d){if(u[y].some(f=>f.trim()===d)){alert(`This ${y.replace("hf_","")} URL is already added`);return}s(f=>({...f,[y]:[...f[y],d]})),_(f=>({...f,[y]:""}))}},R=(y,d)=>{s(f=>({...f,[y]:f[y].filter(v=>v!==d)}))},B=()=>{const y=T();if(y===null)return;const d=Object.keys(i).some(f=>i[f].some(v=>!y[f].includes(v)));o==="direct"&&d&&!window.confirm("Remove one or more Hugging Face artifact links?")||p.mutate({paperId:n,artifacts:y})},D=h.useMemo(()=>{const y={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of ht){const f=w[d].trim();if(f){if(y[d].some(v=>v.trim()===f))return!1;y[d]=[...y[d],f]}}return!Er(y,i)},[u,w,i]);return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Hugging Face Artifacts"}),e.jsx(ue,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(ye,{isAuthor:x}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:ht.map(({key:y,label:d,placeholder:f})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:d}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(ee,{type:"url",placeholder:f,value:w[y],onChange:v=>_(F=>({...F,[y]:v.target.value})),onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),L(y))},className:"flex-1"}),e.jsxs(H,{onClick:()=>L(y),size:"sm",disabled:!w[y].trim(),children:[e.jsx(et,{className:"w-4 h-4 mr-1"}),"Add"]})]}),u[y].length>0?e.jsx("div",{className:"space-y-2",children:u[y].map(v=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:v}),e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>R(y,v),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${d.toLowerCase()} URL`,children:e.jsx(tt,{className:"w-4 h-4"})})]},v))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",d.toLowerCase()," linked yet."]})]},y))}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:B,disabled:p.isPending||!D,children:p.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const Ir=({open:t,onOpenChange:a,paperId:n,initialOrganizationIds:l,submitMode:i,isAuthor:c})=>{var $;const[o,x]=h.useState(l),[u,s]=h.useState(""),w=he();h.useEffect(()=>{t&&(x(l),s(""))},[l,t]);const _=ne({queryKey:["organizations","curation"],queryFn:()=>_e.organizations(!1),enabled:t}),I=h.useMemo(()=>{var T,L;const p=u.trim().toLocaleLowerCase();return p?(((L=_.data)==null?void 0:L.results)??[]).filter(R=>R.name.toLocaleLowerCase().includes(p)):((T=_.data)==null?void 0:T.results)??[]},[($=_.data)==null?void 0:$.results,u]),N=fe({mutationFn:async()=>{l.some(T=>!o.includes(T))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")||(i==="pending"?await ve.submit({paper_id:Number(n),edit_type:"organizations",proposed_payload:{organization_ids:o}}):await W.updateOrganizations(n,o))},onSuccess:()=>{w.invalidateQueries({queryKey:["paper-arxiv"]}),a(!1)}});return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit organizations"}),e.jsx(ue,{children:"Associate existing organizations with this paper. Organization creation remains admin-only."})]}),i==="pending"&&e.jsx(ye,{isAuthor:c}),e.jsxs("div",{className:"relative",children:[e.jsx(Ue,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(ee,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:u,onChange:p=>s(p.target.value),className:"pl-9 pr-9"}),u&&e.jsx("button",{type:"button",onClick:()=>s(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(At,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[I.map(p=>{const T=Number(p.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(T),onChange:L=>x(R=>L.target.checked?[...R,T]:R.filter(B=>B!==T))}),p.name]},p.id)}),!_.isLoading&&I.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:u.trim()?`No organizations found matching "${u.trim()}"`:"No organizations available"})]}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:()=>N.mutate(),disabled:N.isPending,children:i==="pending"?"Submit test edit":"Save changes"})]})]})})},Ee=["my-bookmark-ids"],kt="pwc:pending-bookmark";function Ar(t){window.sessionStorage.setItem(kt,JSON.stringify(t)),window.location.assign(Va(!0))}function $r(){var l,i;const{user:t}=Ze(),a=ne({queryKey:Ee,queryFn:()=>_t.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),n=We.useMemo(()=>{var c;return new Set(((c=a.data)==null?void 0:c.paper_ids)??[])},[(l=a.data)==null?void 0:l.paper_ids]);return{ids:((i=a.data)==null?void 0:i.paper_ids)??[],idSet:n,isLoading:a.isLoading,isError:a.isError}}function Pr(){const{user:t}=Ze(),a=he(),n=fe({mutationFn:async({paperId:i,isBookmarked:c})=>{c?await _t.removeBookmark(i):await _t.addBookmark(i)},onMutate:async({paperId:i,isBookmarked:c})=>{await a.cancelQueries({queryKey:Ee});const o=a.getQueryData(Ee),x=typeof i=="string"?Number(i):i,u=(o==null?void 0:o.paper_ids)??[],s=c?u.filter(w=>w!==x):[x,...u.filter(w=>w!==x)];return a.setQueryData(Ee,{paper_ids:s}),{previous:o}},onError:(i,c,o)=>{o!=null&&o.previous&&a.setQueryData(Ee,o.previous),i instanceof yt&&i.code==="saved_papers_bucket_authorization_required"&&Ar(c)},onSettled:()=>{a.invalidateQueries({queryKey:Ee}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return We.useEffect(()=>{if(!t||n.isPending)return;const i=new URL(window.location.href);if(i.searchParams.get(ls)!=="1")return;i.searchParams.delete(ls),window.history.replaceState({},"",`${i.pathname}${i.search}${i.hash}`);const c=window.sessionStorage.getItem(kt);if(c){window.sessionStorage.removeItem(kt);try{const o=JSON.parse(c);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&n.mutate(o)}catch{}}},[n,t]),{toggle:We.useCallback((i,c)=>{if(!t){if(vs())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=la(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}n.mutate({paperId:i,isBookmarked:c})},[n,t]),isPending:n.isPending}}const Rr=({paperId:t})=>{const{user:a}=Ze(),{idSet:n}=$r(),{toggle:l,isPending:i}=Pr();if(vs())return null;const c=Number(t),o=!!a&&n.has(c),x=()=>{Number.isFinite(c)&&l(c,o)},u=a&&o?"Saved":"Save",s=a?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:x,disabled:i,"aria-pressed":o,"aria-label":s,title:s,children:[e.jsx(J,{name:"bookmark",size:12}),u]})};function Qe({children:t,showEdit:a=!1,onEdit:n,editAriaLabel:l}){return a?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:n,"aria-label":l,children:"edit"})]}):t}const Fr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:Oa,get:Ka,cancel:qa},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:za,get:Ma,cancel:Ha}};function Tr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Ja,{remarkPlugins:[Xa],components:{a:({children:a,...n})=>e.jsx("a",{...n,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:a}),p:({children:a})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:a}),ul:({children:a})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:a}),ol:({children:a})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:a}),h1:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h2:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h3:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),code:({children:a})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:a}),pre:({children:a})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:a})},children:t})})}function Rs({kind:t,paperId:a,paperTitle:n,triggerClassName:l,onComplete:i}){const c=Fr[t],[o,x]=h.useState(!1),[u,s]=h.useState(null),[w,_]=h.useState(!1),[I,N]=h.useState(null),$=h.useRef(null),p=(u==null?void 0:u.status)==="queued"||(u==null?void 0:u.status)==="dispatching"||(u==null?void 0:u.status)==="running",T=u==null?void 0:u.id;h.useEffect(()=>{if(!p||!T)return;let D=!1;const y=window.setInterval(async()=>{try{const d=await c.get(T);D||(s(d),N(null))}catch(d){D||N(d instanceof Error?d.message:"Could not check job status.")}},2e3);return()=>{D=!0,window.clearInterval(y)}},[p,c,T]),h.useEffect(()=>{(u==null?void 0:u.status)!=="completed"||$.current===u.id||($.current=u.id,i())},[u,i]);const L=async()=>{_(!0),N(null);try{s(await c.start(a))}catch(D){N(D instanceof Error?D.message:"Could not start Codex.")}finally{_(!1)}},R=()=>{s(null),N(null),$.current=null},B=async()=>{if(u){N(null);try{s(await c.cancel(u.id))}catch(D){N(D instanceof Error?D.message:"Could not cancel Codex.")}}};return e.jsxs(oe,{open:o,onOpenChange:x,children:[e.jsx("button",{type:"button",className:l,onClick:()=>x(!0),children:p?c.running:(u==null?void 0:u.status)==="completed"?c.complete:c.trigger}),e.jsxs(le,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(ce,{className:"min-w-0",children:[e.jsx(de,{children:c.title}),e.jsx(ue,{children:c.description(n)})]}),u?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",u.status]}),u.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:u.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),p&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[u.status==="queued"?"This job is queued and will start after the current Codex job finishes.":c.progress," ","This can take several minutes; you can close this window and return."]}),u.report&&e.jsx(Tr,{report:u.report}),u.error&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:u.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:c.notice}),I&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:I}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>x(!1),children:p?"Close":"Cancel"}),p&&e.jsx(H,{variant:"outline",onClick:()=>void B(),children:"Cancel job"}),!u&&e.jsx(H,{onClick:L,disabled:w,children:w?"Starting…":c.action}),u&&!p&&e.jsx(H,{variant:"outline",onClick:R,children:"Run again"})]})]})]})}function Lr(t){return e.jsx(Rs,{...t,kind:"add-evals",triggerClassName:"edit-link"})}function Ur(t){return e.jsx(Rs,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}var Ft="Radio",[Dr,Fs]=It(Ft),[Br,Hr]=Dr(Ft),Ts=h.forwardRef((t,a)=>{const{__scopeRadio:n,name:l,checked:i=!1,required:c,disabled:o,value:x="on",onCheck:u,form:s,...w}=t,[_,I]=h.useState(null),N=De(a,T=>I(T)),$=h.useRef(!1),p=_?s||!!_.closest("form"):!0;return e.jsxs(Br,{scope:n,checked:i,disabled:o,children:[e.jsx(ke.button,{type:"button",role:"radio","aria-checked":i,"data-state":Bs(i),"data-disabled":o?"":void 0,disabled:o,value:x,...w,ref:N,onClick:Le(t.onClick,T=>{i||u==null||u(),p&&($.current=T.isPropagationStopped(),$.current||T.stopPropagation())})}),p&&e.jsx(Ds,{control:_,bubbles:!$.current,name:l,value:x,checked:i,required:c,disabled:o,form:s,style:{transform:"translateX(-100%)"}})]})});Ts.displayName=Ft;var Ls="RadioIndicator",Us=h.forwardRef((t,a)=>{const{__scopeRadio:n,forceMount:l,...i}=t,c=Hr(Ls,n);return e.jsx(xs,{present:l||c.checked,children:e.jsx(ke.span,{"data-state":Bs(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})})});Us.displayName=Ls;var Mr="RadioBubbleInput",Ds=h.forwardRef(({__scopeRadio:t,control:a,checked:n,bubbles:l=!0,...i},c)=>{const o=h.useRef(null),x=De(o,c),u=_s(n),s=js(a);return h.useEffect(()=>{const w=o.current;if(!w)return;const _=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(_,"checked").set;if(u!==n&&N){const $=new Event("click",{bubbles:l});N.call(w,n),w.dispatchEvent($)}},[u,n,l]),e.jsx(ke.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:x,style:{...i.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ds.displayName=Mr;function Bs(t){return t?"checked":"unchecked"}var zr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],rt="RadioGroup",[qr]=It(rt,[ys,Fs]),Hs=ys(),Ms=Fs(),[Kr,Or]=qr(rt),zs=h.forwardRef((t,a)=>{const{__scopeRadioGroup:n,name:l,defaultValue:i,value:c,required:o=!1,disabled:x=!1,orientation:u,dir:s,loop:w=!0,onValueChange:_,...I}=t,N=Hs(n),$=ca(s),[p,T]=bs({prop:c,defaultProp:i??null,onChange:_,caller:rt});return e.jsx(Kr,{scope:n,name:l,required:o,disabled:x,value:p,onValueChange:T,children:e.jsx(da,{asChild:!0,...N,orientation:u,dir:$,loop:w,children:e.jsx(ke.div,{role:"radiogroup","aria-required":o,"aria-orientation":u,"data-disabled":x?"":void 0,dir:$,...I,ref:a})})})});zs.displayName=rt;var qs="RadioGroupItem",Ks=h.forwardRef((t,a)=>{const{__scopeRadioGroup:n,disabled:l,...i}=t,c=Or(qs,n),o=c.disabled||l,x=Hs(n),u=Ms(n),s=h.useRef(null),w=De(a,s),_=c.value===i.value,I=h.useRef(!1);return h.useEffect(()=>{const N=p=>{zr.includes(p.key)&&(I.current=!0)},$=()=>I.current=!1;return document.addEventListener("keydown",N),document.addEventListener("keyup",$),()=>{document.removeEventListener("keydown",N),document.removeEventListener("keyup",$)}},[]),e.jsx(ua,{asChild:!0,...x,focusable:!o,active:_,children:e.jsx(Ts,{disabled:o,required:c.required,checked:_,...u,...i,name:c.name,ref:w,onCheck:()=>c.onValueChange(i.value),onKeyDown:Le(N=>{N.key==="Enter"&&N.preventDefault()}),onFocus:Le(i.onFocus,()=>{var N;I.current&&((N=s.current)==null||N.click())})})})});Ks.displayName=qs;var Gr="RadioGroupIndicator",Os=h.forwardRef((t,a)=>{const{__scopeRadioGroup:n,...l}=t,i=Ms(n);return e.jsx(Us,{...i,...l,ref:a})});Os.displayName=Gr;var Gs=zs,Qs=Ks,Qr=Os;const wt=h.forwardRef(({className:t,...a},n)=>e.jsx(Gs,{className:Xe("grid gap-2",t),...a,ref:n}));wt.displayName=Gs.displayName;const Te=h.forwardRef(({className:t,...a},n)=>e.jsx(Qs,{ref:n,className:Xe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(Qr,{className:"flex items-center justify-center",children:e.jsx(ma,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Te.displayName=Qs.displayName;const Vr={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},Nt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,Jr=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,Xr=20,Ct="copy_to_bucket";function Wr(t){const a=t.trim();if(!Jr.test(a))return null;const[n,l]=a.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(n)}/${encodeURIComponent(l)}`}function Et(t){return`pwc:bucket-copy:${t}`}function Yr(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(Ct)!==t)return null;try{const n=window.sessionStorage.getItem(Et(t));if(!n)return null;const l=JSON.parse(n);return l.paperId!==t||typeof l.bucketId!="string"||!["new","existing"].includes(l.destinationMode)||!["public","private"].includes(l.visibility)||!Array.isArray(l.selectedIds)||l.selectedIds.some(i=>typeof i!="string")?null:l}catch{return null}}function Zr(t,a=Xr){if(a<1)throw new Error("Bucket copy batch size must be positive");const n=[];for(let l=0;l!Nt.test(u)))return null;const o=c.join("/"),x=a==="model"?"":`${a}s/`;return{id:`${a}:${o}`,kind:a,label:o,url:`https://huggingface.co/${x}${o}`,source:`hf://${x}${o}/`,destination:`${a}s/${o}/`,repoId:o}}catch{return null}}function en(t){try{const a=new URL(t);if(a.hostname!=="github.com"&&a.hostname!=="www.github.com")return null;const n=a.pathname.split("/").filter(Boolean);if(n.length<2)return null;const l=n[0],i=n[1].replace(/\.git$/,"");if(!Nt.test(l)||!Nt.test(i))return null;const c=`${l}/${i}`;return{id:`github:${c}`,kind:"github",label:c,url:`https://github.com/${c}`,source:`https://github.com/${c}.git`,destination:`github/${c}/`}}catch{return null}}function tn({githubUrls:t,hfModelUrls:a,hfDatasetUrls:n,hfSpaceUrls:l,paperId:i,pdfName:c,pdfUrl:o}){const x=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${c||i}.pdf`}:null,...a.map(s=>ft(s,"model")),...n.map(s=>ft(s,"dataset")),...l.map(s=>ft(s,"space")),...t.map(en)],u=new Set;return x.filter(s=>!s||u.has(s.id)?!1:(u.add(s.id),!0))}function sn(t,a,n){const l=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${Ve(t.trim())}`];n.create&&l.push(`hf buckets create "$HF_BUCKET" --exist-ok${n.isPrivate?" --private":""}`);for(const o of a.filter(x=>x.kind!=="github"&&x.kind!=="pdf"))l.push(`hf cp ${Ve(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const i=a.find(o=>o.kind==="pdf");i&&l.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${Ve(i.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${i.destination}"`);const c=a.filter(o=>o.kind==="github");if(c.length){l.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of c){const x=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;l.push(`git clone --depth 1 -- ${Ve(o.source)} "${x}"`,`hf sync "${x}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return l.join(` +`)}function an(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function rn(t){const{toast:a}=pe(),n=h.useMemo(()=>tn({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),l=h.useMemo(()=>Yr(t.paperId),[t.paperId]),[i,c]=h.useState(!!l),[o,x]=h.useState((l==null?void 0:l.destinationMode)??"new"),[u,s]=h.useState((l==null?void 0:l.bucketId)??""),[w,_]=h.useState((l==null?void 0:l.visibility)??"public"),[I,N]=h.useState(()=>new Set((l==null?void 0:l.selectedIds)??n.map(m=>m.id))),[$,p]=h.useState(!1),[T,L]=h.useState(null),[R,B]=h.useState(!!l),D=n.filter(m=>I.has(m.id)),y=D.length===n.length,d=Wr(u),f=d!==null,v=sn(u,D,{create:o==="new",isPrivate:w==="private"}),F=(m,C)=>{N(A=>{const U=new Set(A);return C?U.add(m):U.delete(m),U})},K=async()=>{try{await navigator.clipboard.writeText(v),a({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},O=h.useCallback(()=>{const m=ha("/api/v1/auth/hf/login"),C=new URL(window.location.href);C.searchParams.set(Ct,t.paperId),window.sessionStorage.setItem(Et(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:u.trim(),destinationMode:o,visibility:w,selectedIds:Array.from(I)}));const A=new URLSearchParams({return_to:C.toString(),authorize_bucket:"true"});o==="new"&&A.set("bucket_create","true"),window.location.assign(`${m}?${A.toString()}`)},[u,o,t.paperId,I,w]),Q=h.useCallback(async()=>{if(!t.isSignedIn){O();return}p(!0);let m=0,C=0;try{const A=D.filter(z=>z.kind!=="pdf"&&z.kind!=="github"&&!!z.repoId).map(z=>({kind:z.kind,repo_id:z.repoId})),U=Zr(A);U.length||U.push([]);for(const[z,Y]of U.entries()){L({current:z+1,total:U.length});const g=await W.copyToBucket(t.paperId,{bucket_id:u.trim(),create:z===0&&o==="new",private:w==="private",include_pdf:z===0&&D.some(S=>S.kind==="pdf"),artifacts:Y});m+=g.copied.length,C+=g.errors.length}const E=D.filter(z=>z.kind==="github").length;a({title:C?"Bucket copy partially completed":"Copied to bucket",description:[`${m} item${m===1?"":"s"} copied.`,C?`${C} item${C===1?"":"s"} failed.`:"",E?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:C?"destructive":void 0,action:d?e.jsx(pa,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!C&&!E&&c(!1)}catch(A){if(A instanceof yt&&A.code==="bucket_authorization_required"){O();return}a({title:m?"Bucket copy partially completed":"Bucket copy failed",description:m?`${m} item${m===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:A instanceof yt&&typeof A.detail=="string"?A.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{p(!1),L(null)}},[O,u,d,o,t.isSignedIn,t.paperId,D,a,w]);h.useEffect(()=>{if(!R||!t.isSignedIn)return;B(!1),window.sessionStorage.removeItem(Et(t.paperId));const m=new URL(window.location.href);m.searchParams.delete(Ct),window.history.replaceState({},"",`${m.pathname}${m.search}${m.hash}`),Q()},[Q,t.isSignedIn,t.paperId,R]);const X=()=>{N(new Set(n.map(m=>m.id))),!u&&t.suggestedBucketId&&s(t.suggestedBucketId),c(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:X,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:n.length?`${n.length} linked artifact${n.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(oe,{open:i,onOpenChange:c,children:e.jsxs(le,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(ce,{children:[e.jsxs(de,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(ue,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:n.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(re,{children:"Choose your destination"}),e.jsxs(wt,{value:o,onValueChange:m=>x(m),className:"grid grid-cols-2 gap-2",children:[e.jsxs(re,{className:"bucket-choice",children:[e.jsx(Te,{value:"new"}),"New bucket"]}),e.jsxs(re,{className:"bucket-choice",children:[e.jsx(Te,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(re,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(ee,{id:"bucket-id",value:u,onChange:m=>s(m.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":u.length>0&&!f}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),d&&e.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(J,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(re,{children:"Bucket visibility"}),e.jsxs(wt,{value:w,onValueChange:m=>_(m),className:"flex gap-5",children:[e.jsxs(re,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Te,{value:"public"}),"Public"]}),e.jsxs(re,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Te,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(re,{children:"Artifacts"}),e.jsx(H,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>N(y?new Set:new Set(n.map(m=>m.id))),children:y?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:n.map(m=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(at,{id:`bucket-artifact-${m.id}`,checked:I.has(m.id),onCheckedChange:C=>F(m.id,C===!0)}),e.jsxs(re,{htmlFor:`bucket-artifact-${m.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:Vr[m.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:m.label})]}),e.jsxs("a",{href:Ce(m.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(J,{name:"external",size:10})]})]},m.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(re,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:f?v:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(me,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(H,{type:"button",onClick:K,variant:"outline",disabled:!f||D.length===0,children:[e.jsx(J,{name:"copy",size:12}),"Copy commands"]}),e.jsx(H,{type:"button",onClick:Q,disabled:$||t.isSignedIn&&(!f||!D.some(m=>m.kind!=="github")),children:$?T&&T.total>1?`Copying ${T.current}/${T.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}const nn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL"},Je=360,gt=3,hs=3,on=["tldr","abstract","tasks","methods","results"];function ln(t){if(!t)return{section:null,resultsTaskSlug:null};const[a,n]=t.split("?",2);if(!on.includes(a))return{section:null,resultsTaskSlug:null};const l=a;return l!=="results"||!n?{section:l,resultsTaskSlug:null}:{section:l,resultsTaskSlug:new URLSearchParams(n).get("task")}}function ps(t){return`results-task-${t}`}function cn(t){return`#results?task=${encodeURIComponent(t)}`}function Re({id:t,label:a,accent:n}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:t,children:[e.jsx("span",{children:e.jsx("a",{href:`#${t}`,className:"section-anchor-link",children:a})}),n]})}function fs(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function gs(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function xt(t,a){try{const n=new URL(t),i=n.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return i?i.replace(/[-_]+/g," "):n.hostname.replace(/^www\./,"")}catch{return a}}const zn=()=>{var Jt,Xt,Wt,Yt,Zt,es,ts,ss,as,rs;const{arxivId:t}=fa(),a=t?ga(t):"",n=xa(),{toast:l}=pe(),{user:i}=Ze(),c=(i==null?void 0:i.is_admin)??!1,o=!!i,x=Wa(i),u=!0,{data:s,isLoading:w,error:_,refetch:I}=Ta(a||"",!!a),[N,$]=h.useState(!1);h.useEffect(()=>{if(!t||t===a)return;const r=window.location.search+window.location.hash;n(`/paper/${a}${r}`,{replace:!0})},[a,n,t]),h.useEffect(()=>{if(s!=null&&s.title)return document.title=Ra(s.title),()=>{document.title=Fa}},[s==null?void 0:s.title]),h.useEffect(()=>{if($(!1),!(s!=null&&s.id))return;const r=window.setTimeout(()=>$(!0),0);return()=>window.clearTimeout(r)},[s==null?void 0:s.id]);const{data:p,isLoading:T}=rr(N?s==null?void 0:s.arxiv_id:void 0),{data:L,isLoading:R,refetch:B}=er(s==null?void 0:s.id,N&&!!(s!=null&&s.id));h.useEffect(()=>{const r=()=>{I(),B(),x==="direct"&&(s!=null&&s.id)&&(W.primeCurationState(s.id,!0).catch(()=>{}),Ye.primeCurationState(s.id,!0).catch(()=>{})),l({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",r),()=>window.removeEventListener("pwc:catalog-conflict",r)},[x,s==null?void 0:s.id,I,B,l]);const{preferences:D}=ba(),y=h.useMemo(()=>!L||!D.hide_closed_source_evals?L:L.filter(r=>r.is_open!==!1),[L,D.hide_closed_source_evals]),d=h.useMemo(()=>({models:(s==null?void 0:s.hf_models)??[],datasets:(s==null?void 0:s.hf_datasets)??[],spaces:(s==null?void 0:s.hf_spaces)??[]}),[s==null?void 0:s.hf_models,s==null?void 0:s.hf_datasets,s==null?void 0:s.hf_spaces]),f=h.useMemo(()=>{const r=(k,G,V)=>{const ae=new Set,Z=[];for(const se of[...k,...G??[]])ae.has(se)||(ae.add(se),Z.push({href:se,label:xt(se,V)}));return Z};return{models:r(d.models,p==null?void 0:p.modelUrls,"Model"),datasets:r(d.datasets,p==null?void 0:p.datasetUrls,"Dataset"),spaces:r(d.spaces,p==null?void 0:p.spaceUrls,"Space")}},[d.models,d.datasets,d.spaces,p==null?void 0:p.modelUrls,p==null?void 0:p.datasetUrls,p==null?void 0:p.spaceUrls]),v=h.useMemo(()=>{if(!y)return[];const r=new Map;for(const k of y){const G=k.task_id,V=r.get(G);V?V.rows.push(k):r.set(G,{taskId:G,taskName:k.task_name||"—",taskSlug:k.task_slug,rows:[k]})}return Array.from(r.values())},[y]),F=h.useMemo(()=>v.map(r=>r.taskSlug??"").join("|"),[v]),K=ne({queryKey:["paper-versions",s==null?void 0:s.arxiv_id],queryFn:async()=>{const r=s.arxiv_id.replace(/v\d+$/,"");return W.versions(r)},enabled:N&&!!(s!=null&&s.arxiv_id),staleTime:10*60*1e3}),O=ne({queryKey:["related-papers",s==null?void 0:s.id],queryFn:()=>W.related(s.arxiv_id||s.id,4),enabled:N&&!!(s!=null&&s.id),staleTime:10*60*1e3}),[Q,X]=h.useState(!1),[m,C]=h.useState(!1),[A,U]=h.useState(!1),E=h.useRef(!1);h.useEffect(()=>{E.current=!1},[a]),h.useEffect(()=>{let r=0;const k=(V=!1,ae=!1)=>{const{section:Z,resultsTaskSlug:se}=ln(window.location.hash.slice(1));if(!Z||!s||Z==="tldr"&&!s.tldr||Z==="results"&&(!N||R)||!V&&E.current)return;let Ne=null;if(Z==="results"&&se){if(Ne=document.getElementById(ps(se)),!Ne){if(v.find(oa=>oa.taskSlug===se))return;Ne=document.getElementById("results")}}else Ne=document.getElementById(Z);if(!Ne)return;const ia=Ne;r=window.requestAnimationFrame(()=>{E.current=!0,ia.scrollIntoView({block:"start",behavior:ae?"smooth":"auto"})})};k();const G=()=>{E.current=!1,k(!0,!0)};return window.addEventListener("hashchange",G),()=>{window.removeEventListener("hashchange",G),r&&window.cancelAnimationFrame(r)}},[s,s==null?void 0:s.tldr,N,R,F,v]);const{activeEditor:z,openEditor:Y,setEditorOpen:g}=or();h.useEffect(()=>{x!=="direct"||!(s!=null&&s.id)||(z&&z!=="results"&&W.primeCurationState(s.id).catch(()=>{}),z==="results"&&Ye.primeCurationState(s.id).catch(()=>{}))},[z,x,s==null?void 0:s.id]);const[S,P]=h.useState(null),b=h.useRef(!1);h.useEffect(()=>{if(!i||!s||b.current)return;const r=sessionStorage.getItem("pwc:fresh-auth-edit");if(!r)return;b.current=!0;const k=ir(r);if(!W.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),k&&Y(k);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){l({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}W.resumeFreshAuthMutation().then(()=>{l({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch(V=>{l({variant:"destructive",title:"Could not apply the saved edit",description:V instanceof Error?V.message:"Please reload and review the edit again."})})},[Y,s,l,i]);const j=h.useMemo(()=>{if(!i||!(s!=null&&s.author_links))return!1;const r=i.username.toLowerCase();return s.author_links.some(k=>!!k.hf_username&&k.hf_username.toLowerCase()===r)},[i,s==null?void 0:s.author_links]),q=r=>{if(!o){P(r);return}Y(r)},[M,te]=h.useState("idle"),[Ie,Tt]=h.useState(null),[Lt,Ut]=h.useState(null),Vs=async()=>{if(a){te("indexing"),Tt(null),Ut(null);try{await W.indexFromArxiv(a),l({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>I(),1200),te("idle")}catch(r){const k=r;let G=k.message||"Failed to index paper";if(k.response)try{G=JSON.parse(k.response).detail||G}catch{G=k.response}Tt(G),(k.status===429||k.status===503)&&Ut("Try again later after arXiv has lifted the temporary limit."),te("idle")}}},{citationDisplay:Js,citationCopy:Dt}=h.useMemo(()=>{if(!s)return{citationDisplay:"",citationCopy:""};const r=`${s.title.slice(0,60)}${s.title.length>60?"…":""}`,k=`${s.authors[0]||""}${s.authors.length>1?" et al.":""}`,G=s.authors.join(" and "),V=(s.published||"").slice(0,4)||"—",ae=(Z,se)=>s.arxiv_id?`@article{${s.arxiv_id.replace(".","")}, + title={{${Z}}}, + author=${se}, + year={{${V}}}, + eprint={{${s.arxiv_id}}}, + archivePrefix={{arXiv}} +}`:`@misc{paper${s.id}, + title={{${Z}}}, + author=${se}, + year={{${V}}}, + url={{${s.source_url||s.url_abs||""}}} +}`;return{citationDisplay:ae(r,`{{${k}}}`),citationCopy:ae(s.title,`{${G}}`)}},[s]),Bt=h.useMemo(()=>Ya(s==null?void 0:s.leaderboard_ranks),[s==null?void 0:s.leaderboard_ranks]),[Xs,Ht]=h.useState(!1),Ws=async()=>{if(Dt)try{await navigator.clipboard.writeText(Dt),Ht(!0),l({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Ht(!1),1500)}catch{l({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},Ys=async()=>{if(!s)return;const r=s.arxiv_id||s.id,k=Za(r,Bt);if(k)try{await navigator.clipboard.writeText(k),l({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{l({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(w)return e.jsxs("div",{className:"page",children:[e.jsx(Fe,{className:"h-12 w-3/4 mb-4"}),e.jsx(Fe,{className:"h-6 w-1/3 mb-8"}),e.jsx(Fe,{className:"h-64 w-full"})]});if(_||!s)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(xe,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",a]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",a]})," in the database. You can index it from arXiv right now."]}),Ie&&e.jsx(La,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Ua,{children:[e.jsx("div",{children:Ie}),Lt&&e.jsx("div",{className:"mt-2",children:Lt})]})}),e.jsxs("div",{className:"action-row",children:[c&&e.jsxs("button",{className:"action-btn",onClick:Vs,disabled:M==="indexing",children:[e.jsx(J,{name:"sparkle",size:12}),M==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(H,{variant:"outline",onClick:()=>n("/papers"),children:"Browse Papers"})]})]});const Mt=K.data||[],Ae=Pa(s.repositories),ge=[...s.repositories??[]].sort((r,k)=>{const G=r.is_official?1:0,V=k.is_official?1:0;return G!==V?V-G:(k.num_stars||0)-(r.num_stars||0)}),Zs=(A?ge:ge.slice(0,gt)).map(r=>({...r,safeHref:Ce(r.url)})),nt={models:[...new Set([...d.models,...(p==null?void 0:p.modelUrls)??[]])],datasets:[...new Set([...d.datasets,...(p==null?void 0:p.datasetUrls)??[]])],spaces:[...new Set([...d.spaces,...(p==null?void 0:p.spaceUrls)??[]])]},it=((Jt=s.arxiv_id)==null?void 0:Jt.replace(/v\d+$/,""))??null,ot=s.arxiv_id?{isLoading:T,paperHref:`https://huggingface.co/papers/${it}`,rows:[{label:"Models",href:jt(`https://huggingface.co/models?other=arxiv:${s.arxiv_id}`,d.models),count:vt(d.models,p==null?void 0:p.modelUrls,p==null?void 0:p.models),isLimited:p==null?void 0:p.isLimited,links:f.models},{label:"Datasets",href:jt(`https://huggingface.co/datasets?other=arxiv:${s.arxiv_id}`,d.datasets),count:vt(d.datasets,p==null?void 0:p.datasetUrls,p==null?void 0:p.datasets),isLimited:p==null?void 0:p.isLimited,links:f.datasets},{label:"Spaces",href:jt(`https://huggingface.co/papers/${it}`,d.spaces),count:vt(d.spaces,p==null?void 0:p.spaceUrls,p==null?void 0:p.spaces),isLimited:p==null?void 0:p.isLimited,links:f.spaces}],footer:`Cite arxiv.org/abs/${it} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:bt(d.models),count:d.models.length,links:f.models},{label:"Datasets",href:bt(d.datasets),count:d.datasets.length,links:f.datasets},{label:"Spaces",href:bt(d.spaces),count:d.spaces.length,links:f.spaces}],footer:null},zt=s.tldr||null,qt=s.num_pages||null,we=s.abstract||"",ea=we.length>Je?we.slice(0,Je)+"…":we,ta=Q||we.length<=Je?we:ea,Be=(s.methods||[]).filter(r=>r.source_paper_id===s.id),He=s.introduced_benchmarks||[],$e=s.introduced_frameworks||[],sa=Be.length>0||He.length>0||$e.length>0,Kt=s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource",aa=s.source==="external"?"Source page":"arXiv page",Ot=Ce(s.url_pdf),Gt=Ce(s.url_abs),Qt=Ce(s.conference_url_abs),Pe=((Xt=s.project_pages)==null?void 0:Xt.filter(r=>r.url).map(r=>({...r,safeHref:Ce(r.url)})))??[],ra=(()=>{const r=[];return Be.length>0&&r.push(Be.length===1?"this method":"these methods"),He.length>0&&r.push(He.length===1?"this benchmark":"these benchmarks"),$e.length>0&&r.push($e.length===1?"this framework":"these frameworks"),r.length===0?"":r.length===1?r[0]:r.join(" and ")})(),Me=s.predecessor_papers||[],ze=s.successor_papers||[],na=Me.length>0||ze.length>0,qe=12,lt=s.authors.map((r,k)=>{var G,V,ae,Z;return{name:r,id:((V=(G=s.author_links)==null?void 0:G[k])==null?void 0:V.id)??null,hf_username:((Z=(ae=s.author_links)==null?void 0:ae[k])==null?void 0:Z.hf_username)??null}}),Vt=m||lt.length<=qe?lt:lt.slice(0,qe);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(xe,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:Kt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsx("h1",{className:"detail-title",children:e.jsx(Ke,{title:s.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Kt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",fs(s.published)]}),qt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[qt," pages"]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.citation_count.toLocaleString()," citations"]})]}),(s.proceeding||s.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),s.conference_slug?e.jsx("a",{href:`/conferences/${s.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(s.proceeding||s.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:s.proceeding.replace(/\s+\d{1,2}$/,"")})]}),Mt.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:s.version,onChange:r=>{const k=r.target.value;s.arxiv_id&&n(`/paper/${s.arxiv_id.replace(/v\d+$/,"")}${k?`?version=${k}`:""}`)},children:Mt.map(r=>e.jsxs("option",{value:r.version,children:[r.version," — ",fs(r.published)]},r.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Vt.map((r,k)=>e.jsxs(We.Fragment,{children:[r.id?e.jsx(xe,{to:`/authors/${r.id}`,children:r.name}):r.hf_username?e.jsx("a",{href:`https://huggingface.co/${r.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${r.hf_username} on Hugging Face`,children:r.name}):e.jsx("a",{children:r.name}),kqe&&e.jsx("button",{className:"show-more-authors",onClick:()=>C(r=>!r),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:m?"show fewer":`+${s.authors.length-qe} more`})]}),e.jsxs("div",{className:"action-row",children:[Ot&&e.jsxs("a",{className:"action-btn",href:Ot,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"pdf",size:12})," View PDF"]}),Gt&&e.jsx(Qe,{showEdit:s.source==="external"&&u,onEdit:()=>q("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:s.source==="external"&&u?"action-btn-segment action-btn-main":"action-btn",href:Gt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"external",size:12})," ",aa]})}),ot.paperHref&&(p==null?void 0:p.paperExists)&&e.jsxs("a",{className:"bm-action-btn",href:ot.paperHref,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Hugging Face",children:["View on ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})]}),Ae.githubUrl&&e.jsx(Qe,{showEdit:u,onEdit:()=>q("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Ae.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"github",size:12})," Code",Ae.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",gs(Ae.github)," ★"]})]})}),Ae.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>q("repositories"),title:"Add GitHub repository",children:[e.jsx(J,{name:"github",size:12})," Add code"]}),Pe.length===1?e.jsx(Qe,{showEdit:u,onEdit:()=>q("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Pe[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"globe",size:12})," Project page"]})}):null,Pe.length>1?e.jsx(Qe,{showEdit:u,onEdit:()=>q("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(ja,{children:[e.jsx(va,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(J,{name:"globe",size:12})," Project page"]})}),e.jsx(ya,{align:"start",className:"project-page-menu",children:Pe.map((r,k)=>e.jsx(_a,{asChild:!0,children:r.safeHref?e.jsx("a",{href:r.safeHref,target:"_blank",rel:"noopener noreferrer",children:xt(r.url,`Project page ${k+1}`)}):e.jsx("span",{children:xt(r.url,`Project page ${k+1}`)})},r.url))})]})}):null,Pe.length===0&&o?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>q("project-pages"),title:"Add project page",children:[e.jsx(J,{name:"globe",size:12})," Add project page"]}):null,Qt&&e.jsxs("a",{className:"action-btn",href:Qt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"external",size:12})," Conference"]}),(s.organizations||[]).map(r=>e.jsxs(xe,{to:`/orgs/${r.slug}`,className:"action-btn",title:r.name,"aria-label":r.name,children:[r.logo_url&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:16,width:16,borderRadius:3,overflow:"hidden"},children:e.jsx("img",{src:r.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:k=>{k.currentTarget.style.display="none"}})}),r.name]},r.id)),e.jsx("button",{type:"button",className:"action-btn",onClick:()=>q("organizations"),children:"Edit organizations"}),c&&Ga()&&e.jsx(Ur,{paperId:Number(s.id),paperTitle:s.title,onComplete:()=>void I()}),e.jsx(Rr,{paperId:s.id})]}),s.leaderboard_ranks&&s.leaderboard_ranks.length>0&&e.jsx(Na,{wrap:!0,paperHref:`/paper/${s.arxiv_id||s.id}`,ranks:s.leaderboard_ranks.filter(r=>r.best_rank>=1&&r.best_rank<=3).map(r=>({name:r.dataset_name,slug:r.dataset_slug||null,rank:r.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Ca,{paperId:s.arxiv_id||s.id,title:s.title,thumbnailUrl:ka(s.thumbnail_url),priority:!0})})]}),sa&&e.jsxs("div",{className:`introduced-banner${$e.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Be.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>n(`/methods/${r.slug||r.id}`),children:[r.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${r.id}`)),He.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>n(`/benchmark/${r.slug||r.id}`),children:[r.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${r.id}`)),$e.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>n(`/frameworks#framework-${r.slug}`),children:[r.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${r.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",ra,"."]})]}),na&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[ze.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:ze.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:ze.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>n(`/paper/${r.route_identifier}`),children:[e.jsx(Ke,{title:r.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${r.id}`))})]}),Me.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Me.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Me.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>n(`/paper/${r.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Ke,{title:r.title})]},`predecessor-${r.id}`))})]})]}),zt&&e.jsxs(e.Fragment,{children:[e.jsx(Re,{id:"tldr",label:"TL;DR · AI-generated"}),e.jsx("div",{className:"tldr-box",children:zt})]}),e.jsx(Re,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx($a,{text:ta})}),we.length>Je&&e.jsx("div",{className:"read-full",onClick:()=>X(r=>!r),children:Q?"− collapse abstract":"+ read full abstract"}),e.jsx(Re,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((Wt=s.tasks)==null?void 0:Wt.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>q("tasks"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(s.tasks||[]).map(r=>e.jsx(Ea,{slug:r.slug||"",label:r.name},r.id))}),e.jsx(Re,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((Yt=s.methods)==null?void 0:Yt.length)||0," used",e.jsx("button",{type:"button",onClick:()=>q("methods"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(s.methods||[]).map(r=>e.jsx(Sa,{method:r},r.id))}),e.jsx(Re,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[(y==null?void 0:y.length)||0," benchmarks",Bt.length>0&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:Ys,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(J,{name:"copy",size:10})," Copy PwC badge"]}),c&&Qa()&&e.jsx(Lr,{paperId:Number(s.id),paperTitle:s.title,onComplete:()=>void B()}),e.jsx("button",{type:"button",onClick:()=>q("results"),className:"edit-link",children:"edit"})]})}),R?e.jsx(Fe,{className:"h-32 w-full"}):v.length>0?v.map(r=>e.jsxs("div",{className:r.taskSlug?"paper-section-anchor":void 0,id:r.taskSlug?ps(r.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:r.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(xe,{to:`/tasks/${r.taskSlug}`,children:r.taskName}),e.jsx("a",{href:cn(r.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${r.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):r.taskName}),e.jsxs("span",{className:"accent",children:[r.rows.length," ",r.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:r.rows.map(k=>{var G;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:k.dataset_slug?e.jsx(xe,{to:`/benchmark/${k.dataset_slug}`,children:k.dataset_name||"—"}):k.dataset_name||"—"}),e.jsxs("td",{className:"model",title:k.model_name||void 0,children:[k.hf_model_url?e.jsx("a",{href:k.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${k.model_name||"model"} on Hugging Face`,children:k.model_name||"—"}):k.model_name||"—",k.is_open===!1&&e.jsx(Ia,{}),(k.external??k.is_external)&&e.jsx(Aa,{sourceUrl:k.source_url||k.external_source_url||k.result_url})]}),e.jsx("td",{className:"metric",children:k.best_metric}),e.jsx("td",{className:"value",children:wa((G=k.metrics)==null?void 0:G[k.best_metric||""])}),e.jsx("td",{className:"rank",children:k.best_rank!=null?`#${k.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:k.dataset_slug&&e.jsx(xe,{to:`/benchmark/${k.dataset_slug}?${[k.task_slug?`task=${encodeURIComponent(k.task_slug)}`:"",`eval=${encodeURIComponent(k.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},k.id)})})]})]},r.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[ge.length," repo",ge.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>q("repositories"),className:"edit-link",children:"edit"})]})]}),Zs.filter(r=>r.safeHref).map(r=>e.jsxs("a",{href:r.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(J,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[r.owner,"/",r.name]}),r.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",gs(r.num_stars)]})]},r.id)),ge.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),ge.length>gt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>U(r=>!r),children:A?"− show top 3":`+ show ${ge.length-gt} more repos`})]}),e.jsx(dn,{viewer:ot,onEdit:()=>q("hf-artifacts")}),e.jsx(rn,{githubUrls:ge.map(r=>r.url),hfModelUrls:nt.models,hfDatasetUrls:nt.datasets,hfSpaceUrls:nt.spaces,paperId:s.id,pdfName:((Zt=s.arxiv_id)==null?void 0:Zt.replace("/","-"))||s.id,pdfUrl:s.url_pdf,isSignedIn:!!i,suggestedBucketId:i?`${i.username}/${an(s.title)}`:void 0}),O.isLoading&&e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}),!O.isLoading&&(((es=O.data)==null?void 0:es.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),O.data.map(r=>e.jsxs(xe,{to:`/paper/${r.arxiv_id||r.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Ke,{title:r.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:r.arxiv_id?`arXiv:${r.arxiv_id}`:"External resource"}),r.citation_count!=null&&e.jsxs("span",{children:[r.citation_count.toLocaleString()," cites"]})]})]},r.id))]}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:Ws,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(J,{name:"copy",size:11}),Xs?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:Js})]})]})]}),e.jsx(fr,{open:z==="tasks",onOpenChange:r=>g("tasks",r),paperId:s.id,arxivId:a,initialTaskIds:((ts=s.tasks)==null?void 0:ts.map(r=>parseInt(r.id)))||[],initialTasks:s.tasks||[],submitMode:x,isAuthor:j}),e.jsx(br,{open:z==="methods",onOpenChange:r=>g("methods",r),paperId:s.id,arxivId:a,initialMethodIds:((ss=s.methods)==null?void 0:ss.map(r=>parseInt(r.id)))||[],initialMethods:s.methods||[],submitMode:x,isAuthor:j}),e.jsx(jr,{open:z==="repositories",onOpenChange:r=>g("repositories",r),paperId:s.id,arxivId:a,initialRepositories:((as=s.repositories)==null?void 0:as.map(r=>({url:r.url,is_official:r.is_official||!1})))||[],submitMode:x,isAuthor:j}),e.jsx(vr,{open:z==="project-pages",onOpenChange:r=>g("project-pages",r),paperId:s.id,arxivId:a,initialProjectPages:((rs=s.project_pages)==null?void 0:rs.map(r=>({url:r.url,is_official:r.is_official||!1})))||[],submitMode:x,isAuthor:j}),e.jsx(Cr,{open:z==="results",onOpenChange:r=>g("results",r),paperId:s.id,arxivId:a,initialEvaluations:L||[],paperTasks:s.tasks||[],submitMode:x,isAdmin:c,isAuthor:j}),e.jsx(yr,{open:z==="source-url",onOpenChange:r=>g("source-url",r),paperId:s.id,arxivId:a,initialUrl:s.source_url??s.url_abs??"",submitMode:x,isAuthor:j}),e.jsx(Sr,{open:z==="hf-artifacts",onOpenChange:r=>g("hf-artifacts",r),paperId:s.id,arxivId:a,initialArtifacts:{hf_models:d.models,hf_datasets:d.datasets,hf_spaces:d.spaces},submitMode:x,isAuthor:j}),e.jsx(Ir,{open:z==="organizations",onOpenChange:r=>g("organizations",r),paperId:s.id,initialOrganizationIds:(s.organizations||[]).map(r=>Number(r.id)),submitMode:x,isAuthor:j}),e.jsx(Da,{open:S!==null,onOpenChange:r=>{r||P(null)},sectionLabel:S?nn[S]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},dn=({viewer:t,onEdit:a})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[t.paperHref?e.jsx("a",{href:t.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]}),t.isLoading?e.jsx(Fe,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[t.rows.map(n=>e.jsx(un,{...n},n.label)),t.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:t.footer})]})]}),un=({label:t,href:a,count:n,isLimited:l,links:i})=>{const[c,o]=h.useState(!1),x=((i==null?void 0:i.length)??0)>0,u=((i==null?void 0:i.length)??0)>hs,s=c?i:i==null?void 0:i.slice(0,hs),w=n!=null?`${n}${l?"+":""}`:"—",_=n?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:w}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:w});return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:t}),_]}),x&&e.jsxs("div",{className:"hf-artifact-links",children:[s.map(I=>e.jsx("a",{href:I.href,target:"_blank",rel:"noopener noreferrer",children:I.label},I.href)),u&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":c,onClick:()=>o(I=>!I),children:c?"Show fewer":`View all ${i.length}`})]})]})};function bt(t){return t[0]??"https://huggingface.co"}function jt(t,a){return a[0]??t}function vt(t,a,n){if(n==null&&t.length===0&&!(a!=null&&a.length))return;const l=new Set([...t,...a??[]]);return Math.max(n??0,l.size)}export{zn as default}; diff --git a/assets/PaperDetailView-DEVQpo7C.js b/assets/PaperDetailView-DEVQpo7C.js deleted file mode 100644 index 1eb7fbce4cfbe664e133ce0b5bd08509d45793df..0000000000000000000000000000000000000000 --- a/assets/PaperDetailView-DEVQpo7C.js +++ /dev/null @@ -1,29 +0,0 @@ -import{d as Nt,m as la,r as h,j as e,P as fs,n as _e,o as gs,p as Ue,q as Te,s as xs,t as Ct,C as je,v as Je,k as he,h as pe,X as Et,w as ve,x as ca,y as bs,z as da,B as ua,D as ma,E as ha,F as pa,G as ss,H as fa,I as ga,J as xa,K as ba,M as ja,g as We,R as Xe,A as jt,c as re,N as js,e as vs,O as va,Q as ya,S as _a,T as ys,U as ka,V as wa,W as Na,Y as Ca,f as Ea,Z as Sa,u as Ia,_ as Pa,L as xe,$ as $a,a0 as Aa,a1 as Ra,a2 as Fa,a3 as Ta,a4 as La,a5 as Ua}from"./index-D9_nPZtO.js";import{u as ne}from"./useQuery-cycUreG-.js";import{I as J,S as Da,a as Ba,T as Ha,M as Ma}from"./components-DrTew0nD.js";import{C as za,E as qa}from"./ExternalSourceEvalBadge-Cu4mN0M9.js";import{L as qe,a as Oa}from"./LatexTitle-BtRWGRIx.js";import{s as Ka}from"./transform-BObV5jzB.js";import{f as Ga,D as Qa}from"./latexPlainText-DI8YEXVe.js";import{a as Va}from"./usePapers-B3J6SKWU.js";import{S as Re}from"./skeleton-CQ2CM4l9.js";import{A as Ja,a as Xa}from"./alert-B0bcMmNw.js";import{B as H}from"./button-B859643f.js";import{u as _s}from"./index-BGBxtSYH.js";import{I as Z}from"./textarea-BVF3ykiv.js";import{D as oe,a as le,b as ce,c as de,d as ue,e as me}from"./dialog-DnjY6ZOM.js";import{u as fe}from"./useMutation-CJCfaNMQ.js";import{S as St,P as Ye,L as ae,a as Wa}from"./SignInToEditDialog-NNf7Zp6R.js";import{S as Le,a as as}from"./searchable-select-Css_GGu3.js";import{L as ie}from"./loader-circle-CrVj12oC.js";import{B as ks,D as Ya,c as Za,g as er,s as tr,a as sr,b as ar,d as rr,i as nr,e as ir}from"./codexAddEvals-Xch_LMp1.js";import{n as ot,g as rs}from"./github-DYxu-4Fs.js";import{G as ns}from"./github-DngRIean.js";import{S as is,s as or}from"./savedPapersAuth-DSXf00GL.js";import{M as lr,r as cr}from"./index-XzA0bTLC.js";import{s as Ne}from"./safeExternalHref-CkBrsh84.js";import"./hover-card-DVeX2fQl.js";import"./katex.min-BSBacQyE.js";import"./useInfiniteQuery-CQNVzwuX.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 os=Nt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** - * @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 ws=Nt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** - * @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 Ze=Nt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function dr(t){return t!=null&&t.can_directly_edit_catalog?"direct":"pending"}function ur(t){return(t??[]).filter(a=>!!(a.dataset_slug&&a.task_slug))}function mr(t,a,n="https://paperswithcode.co"){return a.map(l=>{const i=encodeURIComponent(l.evaluation_id),c=`${n}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge.svg?eval=${i}&live=1`,o=`${n}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge-link?eval=${i}`;return`[![${`Papers with Code: ${l.best_rank===1?"SOTA":`#${l.best_rank}`} on ${l.dataset_name}`}](${c})](${o})`}).join(` -`)}function hr(t,a=!0){return ne({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return la(t)},enabled:a&&!!t,staleTime:0,refetchOnMount:"always"})}const Ns=t=>t.replace(/v\d+$/,""),pr={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},lt=(t,a)=>{const n=(t[a]||[]).length;return n<100?{count:n,isLimited:!1}:{count:n,isLimited:!0}},ct=(t,a)=>{const n=t[a];return Array.isArray(n)?n.map(l=>{if(typeof l=="string")return l;if(l&&typeof l=="object"){const i=l;return i.id||i.repoId||null}return null}).filter(l=>!!l).map(l=>`${pr[a]}${l}`):[]},fr=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${Ns(t)}`)).ok}catch{return!1}},gr=async t=>{const a=Ns(t),[n,l]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${a}/repos`).then(async x=>x.ok?x.json():(console.warn(`Failed to fetch repos for arXiv:${a}, status: ${x.status}`),null)).catch(x=>(console.warn(`Failed to fetch repos for arXiv:${a}:`,x),null)),fr(a)]);if(!n)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:l};const i=lt(n,"models"),c=lt(n,"datasets"),o=lt(n,"spaces");return{models:i.count,datasets:c.count,spaces:o.count,modelUrls:ct(n,"models"),datasetUrls:ct(n,"datasets"),spaceUrls:ct(n,"spaces"),isLimited:i.isLimited||c.isLimited||o.isLimited,paperExists:l}},xr=t=>ne({queryKey:["huggingface-repos",t],queryFn:()=>gr(t),enabled:!!t,staleTime:10*60*1e3,retry:1}),br={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url"};function jr(t){return br[t]??null}function vr(){const[t,a]=h.useState(null),n=h.useCallback(i=>{a(i)},[]),l=h.useCallback((i,c)=>{a(o=>c?i:o===i?null:o)},[]);return{activeEditor:t,openEditor:n,setEditorOpen:l}}var et="Checkbox",[yr]=Ct(et),[_r,It]=yr(et);function kr(t){const{__scopeCheckbox:a,checked:n,children:l,defaultChecked:i,disabled:c,form:o,name:x,onCheckedChange:u,required:s,value:w="on",internal_do_not_use_render:k}=t,[I,N]=gs({prop:n,defaultProp:i??!1,onChange:u,caller:et}),[$,p]=h.useState(null),[T,L]=h.useState(null),R=h.useRef(!1),B=$?!!o||!!$.closest("form"):!0,D={checked:I,disabled:c,setChecked:N,control:$,setControl:p,name:x,form:o,value:w,hasConsumerStoppedPropagationRef:R,required:s,defaultChecked:be(i)?!1:i,isFormControl:B,bubbleInput:T,setBubbleInput:L};return e.jsx(_r,{scope:a,...D,children:wr(k)?k(D):l})}var Cs="CheckboxTrigger",Es=h.forwardRef(({__scopeCheckbox:t,onKeyDown:a,onClick:n,...l},i)=>{const{control:c,value:o,disabled:x,checked:u,required:s,setControl:w,setChecked:k,hasConsumerStoppedPropagationRef:I,isFormControl:N,bubbleInput:$}=It(Cs,t),p=Ue(i,w),T=h.useRef(u);return h.useEffect(()=>{const L=c==null?void 0:c.form;if(L){const R=()=>k(T.current);return L.addEventListener("reset",R),()=>L.removeEventListener("reset",R)}},[c,k]),e.jsx(_e.button,{type:"button",role:"checkbox","aria-checked":be(u)?"mixed":u,"aria-required":s,"data-state":As(u),"data-disabled":x?"":void 0,disabled:x,value:o,...l,ref:p,onKeyDown:Te(a,L=>{L.key==="Enter"&&L.preventDefault()}),onClick:Te(n,L=>{k(R=>be(R)?!0:!R),$&&N&&(I.current=L.isPropagationStopped(),I.current||L.stopPropagation())})})});Es.displayName=Cs;var Pt=h.forwardRef((t,a)=>{const{__scopeCheckbox:n,name:l,checked:i,defaultChecked:c,required:o,disabled:x,value:u,onCheckedChange:s,form:w,...k}=t;return e.jsx(kr,{__scopeCheckbox:n,checked:i,defaultChecked:c,disabled:x,required:o,onCheckedChange:s,name:l,form:w,value:u,internal_do_not_use_render:({isFormControl:I})=>e.jsxs(e.Fragment,{children:[e.jsx(Es,{...k,ref:a,__scopeCheckbox:n}),I&&e.jsx($s,{__scopeCheckbox:n})]})})});Pt.displayName=et;var Ss="CheckboxIndicator",Is=h.forwardRef((t,a)=>{const{__scopeCheckbox:n,forceMount:l,...i}=t,c=It(Ss,n);return e.jsx(fs,{present:l||be(c.checked)||c.checked===!0,children:e.jsx(_e.span,{"data-state":As(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...t.style}})})});Is.displayName=Ss;var Ps="CheckboxBubbleInput",$s=h.forwardRef(({__scopeCheckbox:t,...a},n)=>{const{control:l,hasConsumerStoppedPropagationRef:i,checked:c,defaultChecked:o,required:x,disabled:u,name:s,value:w,form:k,bubbleInput:I,setBubbleInput:N}=It(Ps,t),$=Ue(n,N),p=_s(c),T=xs(l);h.useEffect(()=>{const R=I;if(!R)return;const B=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(B,"checked").set,d=!i.current;if(p!==c&&_){const f=new Event("click",{bubbles:d});R.indeterminate=be(c),_.call(R,be(c)?!1:c),R.dispatchEvent(f)}},[I,p,c,i]);const L=h.useRef(be(c)?!1:c);return e.jsx(_e.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??L.current,required:x,disabled:u,name:s,value:w,form:k,...a,tabIndex:-1,ref:$,style:{...a.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});$s.displayName=Ps;function wr(t){return typeof t=="function"}function be(t){return t==="indeterminate"}function As(t){return be(t)?"indeterminate":t?"checked":"unchecked"}const tt=h.forwardRef(({className:t,style:a,...n},l)=>e.jsx(Pt,{ref:l,className:Je("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...a},...n,children:e.jsx(Is,{className:Je("flex items-center justify-center text-current"),children:e.jsx(je,{className:"h-4 w-4"})})}));tt.displayName=Pt.displayName;function Nr(t,a,n){if(!t)return t;const l=i=>i.paper_id!==a||i.paper_title===n?i:{...i,paper_title:n};if(Array.isArray(t)){const i=t.map(l);return i.some((o,x)=>o!==t[x])?i:t}if(Array.isArray(t.results)){const i=t.results.map(l);return i.some((o,x)=>o!==t.results[x])?{...t,results:i}:t}return t}function Ee(t,a,n){new Set([...n,a.id,a.arxiv_id].filter(o=>!!o)).forEach(o=>{t.setQueryData(["paper",o],a),t.setQueryData(["paper-arxiv",o],a)}),t.invalidateQueries({queryKey:["papers"],refetchType:"none"}),t.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),t.invalidateQueries({queryKey:["task-papers-infinite"],refetchType:"none"});const i=String(a.id),c=o=>Nr(o,i,a.title);t.setQueriesData({queryKey:["evaluations"]},c),t.setQueriesData({queryKey:["dataset-evals"]},c),t.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),t.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}function ye({isAuthor:t=!1}){const a=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:a?"Test-only: this change stays on staging.":"Your changes will be reviewed by an admin."}),e.jsx("p",{className:"mt-1 leading-snug",children:a?"This exercises staging-local pending behavior and is not queued for production review.":t?"We can see this paper is yours. While we're in early access an admin still reviews each edit; this will become automatic for authors soon.":"Submissions are queued for review and don't change the paper page until an admin approves them."})]})}const Cr=250,Er=100;function Sr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialTaskIds:i,initialTasks:c,onSuccess:o,submitMode:x="direct",isAuthor:u=!1}){const[s,w]=h.useState(i),[k,I]=h.useState(!1),[N,$]=h.useState(""),[p,T]=h.useState(""),[L,R]=h.useState(new Map),B=he(),{toast:D}=pe(),_=h.useRef(!1);h.useEffect(()=>{if(!t){_.current=!1;return}if(_.current)return;_.current=!0,w(i),$(""),T("");const m=new Map;(c||[]).forEach(C=>{const P=parseInt(C.id);Number.isNaN(P)||m.set(P,C)}),R(m)},[t,i,c]),h.useEffect(()=>{const m=window.setTimeout(()=>{T(N.trim())},Cr);return()=>window.clearTimeout(m)},[N]);const{data:d,isFetching:f}=ne({queryKey:["tasks-search",p],queryFn:()=>bs({page_size:Er,...p?{q:p}:{}}),enabled:t});h.useEffect(()=>{var m;(m=d==null?void 0:d.results)!=null&&m.length&&R(C=>{const P=new Map(C);return d.results.forEach(U=>{const E=parseInt(U.id);Number.isNaN(E)||P.set(E,U)}),P})},[d]);const v=h.useMemo(()=>{const m=(d==null?void 0:d.results)||[],C=new Set,P=[];return s.forEach(U=>{if(C.has(U))return;const E=L.get(U);E&&(P.push(E),C.add(U))}),m.forEach(U=>{const E=parseInt(U.id);Number.isNaN(E)||C.has(E)||(P.push(U),C.add(E))}),P},[d,s,L]),F=fe({mutationFn:async({paperId:m,taskIds:C})=>x==="pending"?(await ve({paper_id:parseInt(m),edit_type:"tasks",proposed_payload:{task_ids:C}}),null):ca(m,C),onMutate:async({taskIds:m})=>{if(x==="pending")return{snapshots:[]};const C=m.map(E=>L.get(E)).filter(E=>!!E).map(E=>({id:E.id,name:E.name,slug:E.slug})).sort((E,z)=>E.name.localeCompare(z.name)),P=Array.from(new Set([n,l].filter(E=>!!E)));await Promise.all(P.flatMap(E=>[B.cancelQueries({queryKey:["paper",E]}),B.cancelQueries({queryKey:["paper-arxiv",E]})]));const U=[];return P.forEach(E=>{["paper","paper-arxiv"].forEach(z=>{const W=[z,E],g=B.getQueryData(W);U.push({key:W,data:g}),g&&B.setQueryData(W,{...g,tasks:C})})}),D({title:"Tasks updated",description:`Saved ${m.length} task${m.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1),{snapshots:U}},onSuccess:m=>{if(x==="pending"){D({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed task changes shortly."}),o==null||o(),a(!1);return}m&&Ee(B,m,[n,l])},onError:(m,C,P)=>{var z,W;(z=P==null?void 0:P.snapshots)==null||z.forEach(({key:g,data:S})=>{B.setQueryData(g,S)});const U=m;let E=U.message||(x==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");if(U.response)try{const g=JSON.parse(U.response);typeof(g==null?void 0:g.detail)=="string"?E=g.detail:Array.isArray(g==null?void 0:g.detail)&&((W=g.detail[0])!=null&&W.msg)&&(E=g.detail[0].msg)}catch{E=U.response}D({title:x==="pending"?"Could not submit edit":"Could not save tasks",description:E,variant:"destructive"})}}),O=()=>{x==="direct"&&i.some(m=>!s.includes(m))&&!window.confirm("Remove one or more task links from this paper?")||F.mutate({paperId:n,taskIds:s})},K=h.useMemo(()=>{if(s.length!==i.length)return!0;const m=new Set(i);return s.some(C=>!m.has(C))},[s,i]),Q=(m,C)=>{w(P=>C?P.includes(m)?P:[...P,m]:P.filter(U=>U!==m))},X=()=>$("");return e.jsxs(oe,{open:t,onOpenChange:a,children:[e.jsxs(le,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Paper Tasks"}),e.jsx(ue,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),x==="pending"&&e.jsx(ye,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Le,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Z,{type:"text",placeholder:"Search tasks...",value:N,onChange:m=>$(m.target.value),className:"pl-9 pr-9"}),N&&e.jsx("button",{type:"button",onClick:X,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Et,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:v.length>0?e.jsx("div",{className:"space-y-2",children:v.map(m=>{const C=parseInt(m.id),P=s.includes(C);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(tt,{id:`task-${m.id}`,checked:P,onCheckedChange:U=>Q(C,U===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${m.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[m.name,m.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[m.description.substring(0,100),m.description.length>100?"...":""]})]})]},m.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ie,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Le,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:p?`No tasks found matching "${p}"`:"No tasks available"})]})}),e.jsxs(me,{children:[e.jsx(H,{variant:"ghost",className:"sm:mr-auto",onClick:()=>I(!0),children:"Suggest a new task"}),e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:O,disabled:F.isPending||!K,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),x==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),x==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(St,{open:k,onOpenChange:I,paperId:n,kind:"task"})]})}const Ir=250,Pr=100;function $r({open:t,onOpenChange:a,paperId:n,arxivId:l,initialMethodIds:i,initialMethods:c,onSuccess:o,submitMode:x="direct",isAuthor:u=!1}){const[s,w]=h.useState(i),[k,I]=h.useState(!1),[N,$]=h.useState(""),[p,T]=h.useState(""),[L,R]=h.useState(new Map),B=he(),{toast:D}=pe(),_=h.useRef(!1);h.useEffect(()=>{if(!t){_.current=!1;return}if(_.current)return;_.current=!0,w(i),$(""),T("");const m=new Map;(c||[]).forEach(C=>{const P=parseInt(C.id);Number.isNaN(P)||m.set(P,C)}),R(m)},[t,i,c]),h.useEffect(()=>{const m=window.setTimeout(()=>{T(N.trim())},Ir);return()=>window.clearTimeout(m)},[N]);const{data:d,isFetching:f}=ne({queryKey:["methods-search",p],queryFn:()=>ua({page_size:Pr,...p?{q:p}:{}}),enabled:t});h.useEffect(()=>{var m;(m=d==null?void 0:d.results)!=null&&m.length&&R(C=>{const P=new Map(C);return d.results.forEach(U=>{const E=parseInt(U.id);Number.isNaN(E)||P.set(E,U)}),P})},[d]);const v=h.useMemo(()=>{const m=(d==null?void 0:d.results)||[],C=new Set,P=[];return s.forEach(U=>{if(C.has(U))return;const E=L.get(U);E&&(P.push(E),C.add(U))}),m.forEach(U=>{const E=parseInt(U.id);Number.isNaN(E)||C.has(E)||(P.push(U),C.add(E))}),P},[d,s,L]),F=fe({mutationFn:async({paperId:m,methodIds:C})=>x==="pending"?(await ve({paper_id:parseInt(m),edit_type:"methods",proposed_payload:{method_ids:C}}),null):da(m,C),onSuccess:m=>{if(x==="pending"){D({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed method changes shortly."}),o==null||o(),a(!1);return}m&&Ee(B,m,[n,l]),D({title:"Methods updated",description:`Saved ${s.length} method${s.length===1?"":"s"} for this paper.`}),o==null||o(),a(!1)},onError:m=>{var U;const C=m;let P=C.message||(x==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");if(C.response)try{const E=JSON.parse(C.response);typeof(E==null?void 0:E.detail)=="string"?P=E.detail:Array.isArray(E==null?void 0:E.detail)&&((U=E.detail[0])!=null&&U.msg)&&(P=E.detail[0].msg)}catch{P=C.response}D({title:x==="pending"?"Could not submit edit":"Could not save methods",description:P,variant:"destructive"})}}),O=()=>{x==="direct"&&i.some(m=>!s.includes(m))&&!window.confirm("Remove one or more method links from this paper?")||F.mutate({paperId:n,methodIds:s})},K=h.useMemo(()=>{if(s.length!==i.length)return!0;const m=new Set(i);return s.some(C=>!m.has(C))},[s,i]),Q=(m,C)=>{w(P=>C?P.includes(m)?P:[...P,m]:P.filter(U=>U!==m))},X=()=>$("");return e.jsxs(oe,{open:t,onOpenChange:a,children:[e.jsxs(le,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Paper Methods"}),e.jsx(ue,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),x==="pending"&&e.jsx(ye,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Le,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(Z,{type:"text",placeholder:"Search methods...",value:N,onChange:m=>$(m.target.value),className:"pl-9 pr-9"}),N&&e.jsx("button",{type:"button",onClick:X,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Et,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:v.length>0?e.jsx("div",{className:"space-y-2",children:v.map(m=>{const C=parseInt(m.id),P=s.includes(C);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(tt,{id:`method-${m.id}`,checked:P,onCheckedChange:U=>Q(C,U===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${m.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[m.name,m.full_name&&m.full_name!==m.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:m.full_name}),m.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[m.description.substring(0,100),m.description.length>100?"...":""]})]})]},m.id)})}):f?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ie,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Le,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:p?`No methods found matching "${p}"`:"No methods available"})]})}),e.jsxs(me,{children:[e.jsx(H,{variant:"ghost",className:"sm:mr-auto",onClick:()=>I(!0),children:"Suggest a new method"}),e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:O,disabled:F.isPending||!K,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),x==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),x==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(St,{open:k,onOpenChange:I,paperId:n,kind:"method"})]})}function Ar({open:t,onOpenChange:a,paperId:n,arxivId:l,initialRepositories:i,onSuccess:c,submitMode:o="direct",isAuthor:x=!1}){const[u,s]=h.useState(i),[w,k]=h.useState(""),I=he(),{toast:N}=pe(),$=h.useRef(!1);h.useEffect(()=>{if(!t){$.current=!1;return}$.current||($.current=!0,s(i),k(""))},[t,i]);const p=fe({mutationFn:async({paperId:f,repositories:v})=>o==="pending"?(await ve({paper_id:parseInt(f),edit_type:"repositories",proposed_payload:{repositories:v}}),null):ma(f,v),onSuccess:f=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed repository changes shortly."}),c==null||c(),a(!1),k("");return}f&&Ee(I,f,[n,l]),c==null||c(),a(!1),k("")},onError:f=>{var O;const v=f;let F=v.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");if(v.response)try{const K=JSON.parse(v.response);typeof(K==null?void 0:K.detail)=="string"?F=K.detail:Array.isArray(K==null?void 0:K.detail)&&((O=K.detail[0])!=null&&O.msg)&&(F=K.detail[0].msg)}catch{F=v.response}N({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:F,variant:"destructive"})}}),T=f=>{const v=[];for(const F of f){const O=v.find(K=>rs(K.url,F.url));if(O)O.is_official=O.is_official||F.is_official;else{const K=ot(F.url);v.push({url:K??F.url.trim(),is_official:F.is_official})}}return v},L=()=>{const f=w.trim(),v=f?[...u,{url:f,is_official:!1}]:u;return f&&u.some(F=>rs(F.url,f))?(alert("This repository URL is already added"),null):T(v)},R=()=>{const f=L();f!==null&&f.length!==u.length&&(s(f),k(""))},B=f=>{s(u.filter(v=>v.url!==f))},D=f=>{s(u.map(v=>v.url===f?{...v,is_official:!v.is_official}:v))},_=()=>{const f=L();f!==null&&(o==="direct"&&i.some(v=>!f.some(F=>F.url===v.url))&&!window.confirm("Remove one or more repositories from this paper?")||p.mutate({paperId:n,repositories:f}))},d=h.useMemo(()=>{const f=w.trim(),v=f?[...u,{url:f,is_official:!1}]:u;if(v.length!==i.length)return!0;const F=T(i),O=T(v);if(O.length!==F.length)return!0;const K=new Map(F.map(Q=>[ot(Q.url)??Q.url.trim(),!!Q.is_official]));return O.some(Q=>{const X=ot(Q.url)??Q.url.trim(),m=K.get(X);return m===void 0||m!==!!Q.is_official})},[u,w,i]);return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Paper Repositories"}),e.jsx(ue,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(ye,{isAuthor:x}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(Z,{type:"url",placeholder:"https://github.com/owner/repo",value:w,onChange:f=>k(f.target.value),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),R())},className:"flex-1"}),e.jsxs(H,{onClick:R,size:"sm",disabled:!w.trim(),children:[e.jsx(Ye,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((f,v)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(ns,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:f.url}),f.is_official&&e.jsx(ks,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(H,{variant:f.is_official?"default":"outline",size:"sm",onClick:()=>D(f.url),className:"h-8 px-2 text-xs",title:f.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ws,{className:`w-3.5 h-3.5 mr-1 ${f.is_official?"fill-current":""}`}),f.is_official?"Official":"Mark official"]}),e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>B(f.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Ze,{className:"w-4 h-4"})})]})]},v))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(ns,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:_,disabled:p.isPending||!d,children:p.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Rr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialProjectPages:i,onSuccess:c,submitMode:o="direct",isAuthor:x=!1}){const[u,s]=h.useState(i),[w,k]=h.useState(""),I=he(),{toast:N}=pe(),$=h.useRef(!1);h.useEffect(()=>{if(!t){$.current=!1;return}$.current||($.current=!0,s(i),k(""))},[t,i]);const p=fe({mutationFn:async({paperId:d,projectPages:f})=>o==="pending"?(await ve({paper_id:parseInt(d),edit_type:"project_pages",proposed_payload:{project_pages:f}}),null):ha(d,f),onSuccess:d=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed project page changes shortly."}),c==null||c(),a(!1),k("");return}d&&Ee(I,d,[n,l]),c==null||c(),a(!1),k("")},onError:d=>{var F;const f=d;let v=f.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");if(f.response)try{const O=JSON.parse(f.response);typeof(O==null?void 0:O.detail)=="string"?v=O.detail:Array.isArray(O==null?void 0:O.detail)&&((F=O.detail[0])!=null&&F.msg)&&(v=O.detail[0].msg)}catch{v=f.response}N({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:v,variant:"destructive"})}}),T=()=>{const d=w.trim();return d?u.some(f=>f.url===d)?(alert("This project page URL is already added"),null):[...u,{url:d,is_official:!1}]:u},L=()=>{const d=T();d!==null&&d.length!==u.length&&(s(d),k(""))},R=d=>{s(u.filter(f=>f.url!==d))},B=d=>{s(u.map(f=>f.url===d?{...f,is_official:!f.is_official}:f))},D=()=>{const d=T();d!==null&&(o==="direct"&&i.some(f=>!d.some(v=>v.url===f.url))&&!window.confirm("Remove one or more project pages from this paper?")||p.mutate({paperId:n,projectPages:d}))},_=h.useMemo(()=>{const d=w.trim(),f=d?[...u,{url:d,is_official:!1}]:u;if(f.length!==i.length)return!0;const v=new Map(i.map(F=>[F.url.trim(),!!F.is_official]));return f.some(F=>{const O=v.get(F.url.trim());return O===void 0||O!==!!F.is_official})},[u,w,i]);return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Paper Project Pages"}),e.jsx(ue,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(ye,{isAuthor:x}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(Z,{type:"url",placeholder:"https://example.com/project",value:w,onChange:d=>k(d.target.value),onKeyPress:d=>{d.key==="Enter"&&(d.preventDefault(),L())},className:"flex-1"}),e.jsxs(H,{onClick:L,size:"sm",disabled:!w.trim(),children:[e.jsx(Ye,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((d,f)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(os,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:d.url}),d.is_official&&e.jsx(ks,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(H,{variant:d.is_official?"default":"outline",size:"sm",onClick:()=>B(d.url),className:"h-8 px-2 text-xs",title:d.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ws,{className:`w-3.5 h-3.5 mr-1 ${d.is_official?"fill-current":""}`}),d.is_official?"Official":"Mark official"]}),e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>R(d.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Ze,{className:"w-4 h-4"})})]})]},f))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(os,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:D,disabled:p.isPending||!_,children:p.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Fr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialUrl:i,onSuccess:c,submitMode:o="direct",isAuthor:x=!1}){const[u,s]=h.useState(i),w=he(),{toast:k}=pe(),I=h.useRef(!1);h.useEffect(()=>{if(!t){I.current=!1;return}I.current||(I.current=!0,s(i))},[t,i]);const N=fe({mutationFn:async({paperId:R,sourceUrl:B})=>o==="pending"?(await ve({paper_id:parseInt(R),edit_type:"source_url",proposed_payload:{source_url:B}}),null):pa(R,B),onSuccess:R=>{if(o==="pending"){k({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed source URL change shortly."}),c==null||c(),a(!1);return}R&&Ee(w,R,[n,l]),c==null||c(),a(!1)},onError:R=>{var _;const B=R;let D=B.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");if(B.response)try{const d=JSON.parse(B.response);typeof(d==null?void 0:d.detail)=="string"?D=d.detail:Array.isArray(d==null?void 0:d.detail)&&((_=d.detail[0])!=null&&_.msg)&&(D=d.detail[0].msg)}catch{D=B.response}k({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:D,variant:"destructive"})}}),$=u.trim(),p=/^https?:\/\//i.test($),T=$!==(i||"").trim(),L=()=>{p&&N.mutate({paperId:n,sourceUrl:$})};return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{className:"max-w-2xl",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Source URL"}),e.jsxs(ue,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(ye,{isAuthor:x}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(Z,{type:"url",placeholder:"https://example.com/paper",value:u,onChange:R=>s(R.target.value),onKeyPress:R=>{R.key==="Enter"&&p&&T&&(R.preventDefault(),L())}}),!p&&$.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:L,disabled:N.isPending||!p||!T,children:N.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const dt=100;function Tr(t){return(t??[]).some(a=>a.slug==="coding-agents"||a.name.trim().toLowerCase()==="coding agents")}function ls(t){const a=parseInt(t.task_id,10),n=parseInt(t.dataset_id,10);return!(!Number.isFinite(a)||!Number.isFinite(n)||!t.metric_name.trim()||!t.metric_value.trim())}function Lr(t){return t.map(a=>{const n=a.best_metric||Object.keys(a.metrics)[0],l=a.metrics[n];return{id:a.id,task_id:a.task_id,dataset_id:a.dataset_id,model_name:a.model_name||"",harness:a.harness||"",metric_name:n||"",metric_value:String(l||""),best_rank:a.best_rank?String(a.best_rank):"",num_parameters:a.num_parameters!=null?String(a.num_parameters):"",hf_model_url:a.hf_model_url||"",is_open:a.is_open!==!1,operation:"unchanged"}})}function Ur(t){const a=new Map;return t.forEach(n=>{n.task_id&&n.task_name&&a.set(n.task_id,{id:n.task_id,name:n.task_name,slug:n.task_slug,level:0})}),a}function Dr(t){const a=new Map;return t.forEach(n=>{n.dataset_id&&n.dataset_name&&a.set(n.dataset_id,{id:n.dataset_id,name:n.dataset_name,slug:n.dataset_slug})}),a}function cs(t,a){return`${t}:${a}`}function Oe(t){const a=t.trim();if(a==="")return null;const n=Number(a);return!Number.isFinite(n)||n<0?null:Math.trunc(n)}function Ke(t){const a=t.trim();return a===""?null:a}function Br({open:t,onOpenChange:a,paperId:n,arxivId:l,initialEvaluations:i,paperTasks:c,onSuccess:o,submitMode:x="direct",isAdmin:u=!1,isAuthor:s=!1}){const w=Tr(c),[k,I]=h.useState([]),[N,$]=h.useState(null),[p,T]=h.useState(new Map),[L,R]=h.useState(new Map),B=he(),{toast:D}=pe(),_=h.useRef(!1),d=h.useRef(!1);h.useEffect(()=>{if(!t){_.current=!1,d.current=!1;return}_.current||d.current||i.length!==0&&(_.current=!0,I(Lr(i)),T(Ur(i)),R(Dr(i)))},[t,i]);const f=h.useMemo(()=>Array.from(new Set(k.map(g=>g.task_id).filter(g=>g&&g!==""))),[k]),v=h.useMemo(()=>{const g=new Set;return k.forEach(S=>{S.task_id&&S.dataset_id&&g.add(cs(S.task_id,S.dataset_id))}),Array.from(g)},[k]),F=ne({queryKey:["datasets-by-tasks-for-eval-edit",f,t],queryFn:async()=>{const g={};return await Promise.all(f.map(async S=>{try{const A=await ss({task_id:parseInt(S),page_size:dt});g[S]=A.results}catch(A){console.error(`Error fetching datasets for task ${S}:`,A),g[S]=[]}})),g},enabled:t&&f.length>0});h.useEffect(()=>{F.data&&R(g=>{const S=new Map(g);return Object.values(F.data).forEach(A=>{A.forEach(b=>{S.set(b.id,b)})}),S})},[F.data]);const O=ne({queryKey:["leaderboard-metrics-for-eval-edit",v,t],queryFn:async()=>{const g={};return await Promise.all(v.map(async S=>{const[A,b]=S.split(":");try{g[S]=await ga(b,A)}catch(j){console.error(`Error fetching metrics for leaderboard ${S}:`,j),g[S]=[]}})),g},enabled:t&&v.length>0}),K=async g=>{const S=await bs({page_size:dt,...g?{q:g}:{}});return T(A=>{const b=new Map(A);return S.results.forEach(j=>b.set(j.id,j)),b}),S.results.map(A=>{var b;return{value:A.id,label:A.name,description:(b=A.description)==null?void 0:b.slice(0,100)}})},Q=g=>async S=>{const A=await ss({task_id:parseInt(g),page_size:dt,...S?{q:S}:{}});return R(b=>{const j=new Map(b);return A.results.forEach(q=>j.set(q.id,q)),j}),A.results.map(b=>({value:b.id,label:b.name,description:b.full_name}))},X=(g,S)=>{if(!g||!S)return!1;const A=L.get(S);return!!(A!=null&&A.supports_harness)},m=(g,S,A)=>{var q;if(!g||!S)return[];const j=(((q=O.data)==null?void 0:q[cs(g,S)])||[]).map(M=>({value:M.metric_name,label:M.metric_name,description:M.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return A&&!j.some(M=>M.value===A)&&j.unshift({value:A,label:`${A} (legacy)`}),j},C=fe({mutationFn:async({paperId:g,evaluations:S})=>{if(x==="pending"){const b=[];for(const j of S){if(j.operation==="delete"&&j.id){b.push({op:"delete",evaluation_id:parseInt(j.id)});continue}const q=X(j.task_id,j.dataset_id);if(j.operation==="create"){if(!ls(j))continue;const M=Oe(j.num_parameters),ee={task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),metrics:{[j.metric_name]:j.metric_value},best_metric:j.metric_name},Se=Ke(j.hf_model_url);j.model_name&&(ee.model_name=j.model_name),q&&j.harness&&(ee.harness=j.harness),j.best_rank&&(ee.best_rank=parseInt(j.best_rank)),M!=null&&(ee.num_parameters=M),Se!=null&&(ee.hf_model_url=Se),ee.is_open=j.is_open,b.push({op:"create",data:ee})}else if(j.operation==="update"&&j.id){const M={task_id:parseInt(j.task_id),dataset_id:parseInt(j.dataset_id),model_name:j.model_name||void 0,harness:q&&j.harness||null,metrics:{[j.metric_name]:j.metric_value},best_metric:j.metric_name,best_rank:j.best_rank?parseInt(j.best_rank):void 0,num_parameters:Oe(j.num_parameters),hf_model_url:Ke(j.hf_model_url),is_open:j.is_open};b.push({op:"update",evaluation_id:parseInt(j.id),data:M})}}return b.length===0?{submitted:!1}:(await ve({paper_id:parseInt(g),edit_type:"evaluations",proposed_payload:{operations:b}}),{submitted:!0})}const A=[];for(const b of S)if(b.operation==="delete"&&b.id)A.push({operation:"delete",evaluation_id:parseInt(b.id)});else if(b.operation==="create"){if(!ls(b))continue;const j=X(b.task_id,b.dataset_id),q=Oe(b.num_parameters);A.push({operation:"create",payload:{paper_id:parseInt(g),task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:j&&b.harness||void 0,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:q??void 0,hf_model_url:Ke(b.hf_model_url)??void 0,is_open:b.is_open}})}else if(b.operation==="update"&&b.id){const j=X(b.task_id,b.dataset_id);A.push({operation:"update",evaluation_id:parseInt(b.id),payload:{task_id:parseInt(b.task_id),dataset_id:parseInt(b.dataset_id),model_name:b.model_name||void 0,harness:j&&b.harness||null,metrics:{[b.metric_name]:b.metric_value},best_metric:b.metric_name,best_rank:b.best_rank?parseInt(b.best_rank):void 0,num_parameters:Oe(b.num_parameters),hf_model_url:Ke(b.hf_model_url),is_open:b.is_open,harness_set:!0,num_parameters_set:!0,hf_model_url_set:!0}})}if(!u&&A.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");return A.length>0&&await fa(parseInt(g),A),{submitted:A.length>0}},onSuccess:g=>{if(x==="pending"){g!=null&&g.submitted?D({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed evaluation changes shortly."}):D({title:"No changes to submit",description:"Your evaluation list matches the existing data."}),o==null||o(),a(!1);return}B.invalidateQueries({queryKey:["paper-arxiv",l]}),B.invalidateQueries({queryKey:["evaluations","paper",n]}),o==null||o(),a(!1)},onError:g=>{var b;const S=g;let A=S.message||(x==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");if(S.response)try{const j=JSON.parse(S.response);typeof(j==null?void 0:j.detail)=="string"?A=j.detail:Array.isArray(j==null?void 0:j.detail)&&((b=j.detail[0])!=null&&b.msg)&&(A=j.detail[0].msg)}catch{A=S.response}D({title:x==="pending"?"Could not submit edit":"Could not save evaluations",description:A,variant:"destructive"})}}),P=()=>{d.current=!0,I([...k,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},U=g=>{if(d.current=!0,k[g].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;I(k.map((A,b)=>b===g?{...A,operation:"delete"}:A))}else I(k.filter((A,b)=>b!==g))},E=(g,S,A)=>{d.current=!0,I(k.map((b,j)=>{if(j!==g)return b;const q={...b,[S]:A};return S==="task_id"&&(q.dataset_id="",q.metric_name="",q.harness=""),S==="dataset_id"&&(q.metric_name="",A&&!X(q.task_id,A)&&(q.harness="")),b.operation==="unchanged"&&(q.operation="update"),q}))},z=(g,S)=>{d.current=!0,I(k.map((A,b)=>{if(b!==g)return A;const j={...A,is_open:S};return A.operation==="unchanged"&&(j.operation="update"),j}))},W=()=>{const g=k.filter(S=>S.operation!=="delete"||S.id);C.mutate({paperId:n,evaluations:g})};return e.jsxs(oe,{open:t,onOpenChange:a,children:[e.jsxs(le,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Evaluation Results"}),e.jsx(ue,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),x==="pending"&&e.jsx(ye,{isAuthor:s}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[k.filter(g=>g.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${w?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),w&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:k.map((g,S)=>{if(g.operation==="delete")return null;const A=p.get(g.task_id),b=L.get(g.dataset_id),j=m(g.task_id,g.dataset_id,g.metric_name),q=!!(g.task_id&&g.dataset_id)&&O.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsx(as,{value:g.task_id,onChange:M=>E(S,"task_id",M),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:A?{value:A.id,label:A.name}:null,queryKey:["eval-edit-task-search"],queryFn:K,enabled:t})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(as,{value:g.dataset_id,onChange:M=>E(S,"dataset_id",M),placeholder:g.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:g.task_id?"No datasets found for this task.":"Select a task first.",disabled:!g.task_id,selectedOption:b?{value:b.id,label:b.name}:null,queryKey:["eval-edit-dataset-search",g.task_id],queryFn:Q(g.task_id),enabled:t&&!!g.task_id})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:g.model_name,onChange:M=>E(S,"model_name",M.target.value)})}),w&&e.jsx("td",{className:"py-2 px-2",children:X(g.task_id,g.dataset_id)?e.jsx(Z,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:g.harness,onChange:M=>E(S,"harness",M.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsx("td",{className:"py-2 px-2",children:!g.task_id||!g.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):q?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(ie,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):j.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",value:g.metric_name,onChange:M=>E(S,"metric_name",M.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),j.map(M=>e.jsx("option",{value:M.value,children:M.label},M.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"text",className:"w-full text-sm",placeholder:"44.9",value:g.metric_value,onChange:M=>E(S,"metric_value",M.target.value)})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",value:g.num_parameters,onChange:M=>E(S,"num_parameters",M.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(Z,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:g.hf_model_url,onChange:M=>E(S,"hf_model_url",M.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:g.is_open,onChange:M=>z(S,M.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>U(S),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete row",children:e.jsx(Ze,{className:"w-4 h-4"})})})]},S)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ya,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(H,{variant:"outline",size:"sm",onClick:P,className:"flex items-center space-x-2",children:[e.jsx(Ye,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(me,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(H,{variant:"ghost",onClick:()=>$("benchmark"),children:"Suggest a new benchmark"}),e.jsx(H,{variant:"ghost",onClick:()=>$("metric"),children:"Suggest a new metric"})]}),e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:W,disabled:C.isPending,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),x==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),x==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(St,{open:N!==null,onOpenChange:g=>{g||$(null)},paperId:n,kind:N??"benchmark"})]})}const ut=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function ds(t){return t.map(a=>a.trim()).filter(Boolean)}function mt(t,a){const n=ds(t).sort(),l=ds(a).sort();return n.length!==l.length?!1:n.every((i,c)=>i===l[c])}function Hr(t,a){return mt(t.hf_models,a.hf_models)&&mt(t.hf_datasets,a.hf_datasets)&&mt(t.hf_spaces,a.hf_spaces)}function Mr({open:t,onOpenChange:a,paperId:n,arxivId:l,initialArtifacts:i,onSuccess:c,submitMode:o="direct",isAuthor:x=!1}){const[u,s]=h.useState(i),[w,k]=h.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),I=he(),{toast:N}=pe(),$=h.useRef(!1);h.useEffect(()=>{if(!t){$.current=!1;return}$.current||($.current=!0,s(i),k({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,i]);const p=fe({mutationFn:async({paperId:_,artifacts:d})=>o==="pending"?(await ve({paper_id:parseInt(_),edit_type:"hf_artifacts",proposed_payload:d}),null):xa(_,d),onSuccess:_=>{if(o==="pending"){N({title:"Edit submitted for review",description:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),c==null||c(),a(!1),k({hf_models:"",hf_datasets:"",hf_spaces:""});return}_&&Ee(I,_,[n,l]),c==null||c(),a(!1),k({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:_=>{var v;const d=_;let f=d.message||(o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");if(d.response)try{const F=JSON.parse(d.response);typeof(F==null?void 0:F.detail)=="string"?f=F.detail:Array.isArray(F==null?void 0:F.detail)&&((v=F.detail[0])!=null&&v.msg)&&(f=F.detail[0].msg)}catch{f=d.response}N({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:f,variant:"destructive"})}}),T=()=>{const _={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of ut){const f=w[d].trim();if(f){if(_[d].some(v=>v.trim()===f))return alert(`This ${d.replace("hf_","")} URL is already added`),null;_[d]=[..._[d],f]}}return _},L=_=>{const d=w[_].trim();if(d){if(u[_].some(f=>f.trim()===d)){alert(`This ${_.replace("hf_","")} URL is already added`);return}s(f=>({...f,[_]:[...f[_],d]})),k(f=>({...f,[_]:""}))}},R=(_,d)=>{s(f=>({...f,[_]:f[_].filter(v=>v!==d)}))},B=()=>{const _=T();if(_===null)return;const d=Object.keys(i).some(f=>i[f].some(v=>!_[f].includes(v)));o==="direct"&&d&&!window.confirm("Remove one or more Hugging Face artifact links?")||p.mutate({paperId:n,artifacts:_})},D=h.useMemo(()=>{const _={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of ut){const f=w[d].trim();if(f){if(_[d].some(v=>v.trim()===f))return!1;_[d]=[..._[d],f]}}return!Hr(_,i)},[u,w,i]);return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit Hugging Face Artifacts"}),e.jsx(ue,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(ye,{isAuthor:x}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:ut.map(({key:_,label:d,placeholder:f})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:d}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(Z,{type:"url",placeholder:f,value:w[_],onChange:v=>k(F=>({...F,[_]:v.target.value})),onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),L(_))},className:"flex-1"}),e.jsxs(H,{onClick:()=>L(_),size:"sm",disabled:!w[_].trim(),children:[e.jsx(Ye,{className:"w-4 h-4 mr-1"}),"Add"]})]}),u[_].length>0?e.jsx("div",{className:"space-y-2",children:u[_].map(v=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:v}),e.jsx(H,{variant:"ghost",size:"sm",onClick:()=>R(_,v),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${d.toLowerCase()} URL`,children:e.jsx(Ze,{className:"w-4 h-4"})})]},v))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",d.toLowerCase()," linked yet."]})]},_))}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:B,disabled:p.isPending||!D,children:p.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const zr=({open:t,onOpenChange:a,paperId:n,initialOrganizationIds:l,submitMode:i,isAuthor:c})=>{var $;const[o,x]=h.useState(l),[u,s]=h.useState(""),w=he();h.useEffect(()=>{t&&(x(l),s(""))},[l,t]);const k=ne({queryKey:["organizations","curation"],queryFn:()=>ja(!1),enabled:t}),I=h.useMemo(()=>{var T,L;const p=u.trim().toLocaleLowerCase();return p?(((L=k.data)==null?void 0:L.results)??[]).filter(R=>R.name.toLocaleLowerCase().includes(p)):((T=k.data)==null?void 0:T.results)??[]},[($=k.data)==null?void 0:$.results,u]),N=fe({mutationFn:async()=>{l.some(T=>!o.includes(T))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")||(i==="pending"?await ve({paper_id:Number(n),edit_type:"organizations",proposed_payload:{organization_ids:o}}):await ba(n,o))},onSuccess:()=>{w.invalidateQueries({queryKey:["paper-arxiv"]}),a(!1)}});return e.jsx(oe,{open:t,onOpenChange:a,children:e.jsxs(le,{children:[e.jsxs(ce,{children:[e.jsx(de,{children:"Edit organizations"}),e.jsx(ue,{children:"Associate existing organizations with this paper. Organization creation remains admin-only."})]}),i==="pending"&&e.jsx(ye,{isAuthor:c}),e.jsxs("div",{className:"relative",children:[e.jsx(Le,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(Z,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:u,onChange:p=>s(p.target.value),className:"pl-9 pr-9"}),u&&e.jsx("button",{type:"button",onClick:()=>s(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(Et,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[I.map(p=>{const T=Number(p.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(T),onChange:L=>x(R=>L.target.checked?[...R,T]:R.filter(B=>B!==T))}),p.name]},p.id)}),!k.isLoading&&I.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:u.trim()?`No organizations found matching "${u.trim()}"`:"No organizations available"})]}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(H,{onClick:()=>N.mutate(),disabled:N.isPending,children:i==="pending"?"Submit test edit":"Save changes"})]})]})})},Ce=["my-bookmark-ids"],vt="pwc:pending-bookmark";function qr(t){window.sessionStorage.setItem(vt,JSON.stringify(t)),window.location.assign(or(!0))}function Or(){var l,i;const{user:t}=We(),a=ne({queryKey:Ce,queryFn:()=>re.getMyBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),n=Xe.useMemo(()=>{var c;return new Set(((c=a.data)==null?void 0:c.paper_ids)??[])},[(l=a.data)==null?void 0:l.paper_ids]);return{ids:((i=a.data)==null?void 0:i.paper_ids)??[],idSet:n,isLoading:a.isLoading,isError:a.isError}}function Kr(){const{user:t}=We(),a=he(),n=fe({mutationFn:async({paperId:i,isBookmarked:c})=>{c?await re.removeBookmark(i):await re.addBookmark(i)},onMutate:async({paperId:i,isBookmarked:c})=>{await a.cancelQueries({queryKey:Ce});const o=a.getQueryData(Ce),x=typeof i=="string"?Number(i):i,u=(o==null?void 0:o.paper_ids)??[],s=c?u.filter(w=>w!==x):[x,...u.filter(w=>w!==x)];return a.setQueryData(Ce,{paper_ids:s}),{previous:o}},onError:(i,c,o)=>{o!=null&&o.previous&&a.setQueryData(Ce,o.previous),i instanceof jt&&i.code==="saved_papers_bucket_authorization_required"&&qr(c)},onSettled:()=>{a.invalidateQueries({queryKey:Ce}),a.invalidateQueries({queryKey:["my-bookmarks"]})}});return Xe.useEffect(()=>{if(!t||n.isPending)return;const i=new URL(window.location.href);if(i.searchParams.get(is)!=="1")return;i.searchParams.delete(is),window.history.replaceState({},"",`${i.pathname}${i.search}${i.hash}`);const c=window.sessionStorage.getItem(vt);if(c){window.sessionStorage.removeItem(vt);try{const o=JSON.parse(c);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&n.mutate(o)}catch{}}},[n,t]),{toggle:Xe.useCallback((i,c)=>{if(!t){if(js())return;const o=typeof window<"u"?window.location.pathname+window.location.search:"/";window.location.href=vs(`/api/v1/auth/hf/login?return_to=${encodeURIComponent(o)}`);return}n.mutate({paperId:i,isBookmarked:c})},[n,t]),isPending:n.isPending}}const Gr=({paperId:t})=>{const{user:a}=We(),{idSet:n}=Or(),{toggle:l,isPending:i}=Kr();if(js())return null;const c=Number(t),o=!!a&&n.has(c),x=()=>{Number.isFinite(c)&&l(c,o)},u=a&&o?"Saved":"Save",s=a?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:x,disabled:i,"aria-pressed":o,"aria-label":s,title:s,children:[e.jsx(J,{name:"bookmark",size:12}),u]})};function Ge({children:t,showEdit:a=!1,onEdit:n,editAriaLabel:l}){return a?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:n,"aria-label":l,children:"edit"})]}):t}const Qr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:rr,get:ar,cancel:sr},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:tr,get:er,cancel:Za}};function Vr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(lr,{remarkPlugins:[cr],components:{a:({children:a,...n})=>e.jsx("a",{...n,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:a}),p:({children:a})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:a}),ul:({children:a})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:a}),ol:({children:a})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:a}),h1:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h2:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),h3:({children:a})=>e.jsx("h3",{className:"mb-2 font-semibold",children:a}),code:({children:a})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:a}),pre:({children:a})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:a})},children:t})})}function Rs({kind:t,paperId:a,paperTitle:n,triggerClassName:l,onComplete:i}){const c=Qr[t],[o,x]=h.useState(!1),[u,s]=h.useState(null),[w,k]=h.useState(!1),[I,N]=h.useState(null),$=h.useRef(null),p=(u==null?void 0:u.status)==="queued"||(u==null?void 0:u.status)==="dispatching"||(u==null?void 0:u.status)==="running",T=u==null?void 0:u.id;h.useEffect(()=>{if(!p||!T)return;let D=!1;const _=window.setInterval(async()=>{try{const d=await c.get(T);D||(s(d),N(null))}catch(d){D||N(d instanceof Error?d.message:"Could not check job status.")}},2e3);return()=>{D=!0,window.clearInterval(_)}},[p,c,T]),h.useEffect(()=>{(u==null?void 0:u.status)!=="completed"||$.current===u.id||($.current=u.id,i())},[u,i]);const L=async()=>{k(!0),N(null);try{s(await c.start(a))}catch(D){N(D instanceof Error?D.message:"Could not start Codex.")}finally{k(!1)}},R=()=>{s(null),N(null),$.current=null},B=async()=>{if(u){N(null);try{s(await c.cancel(u.id))}catch(D){N(D instanceof Error?D.message:"Could not cancel Codex.")}}};return e.jsxs(oe,{open:o,onOpenChange:x,children:[e.jsx("button",{type:"button",className:l,onClick:()=>x(!0),children:p?c.running:(u==null?void 0:u.status)==="completed"?c.complete:c.trigger}),e.jsxs(le,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(ce,{className:"min-w-0",children:[e.jsx(de,{children:c.title}),e.jsx(ue,{children:c.description(n)})]}),u?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",u.status]}),u.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:u.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),p&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[u.status==="queued"?"This job is queued and will start after the current Codex job finishes.":c.progress," ","This can take several minutes; you can close this window and return."]}),u.report&&e.jsx(Vr,{report:u.report}),u.error&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:u.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:c.notice}),I&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:I}),e.jsxs(me,{children:[e.jsx(H,{variant:"outline",onClick:()=>x(!1),children:p?"Close":"Cancel"}),p&&e.jsx(H,{variant:"outline",onClick:()=>void B(),children:"Cancel job"}),!u&&e.jsx(H,{onClick:L,disabled:w,children:w?"Starting…":c.action}),u&&!p&&e.jsx(H,{variant:"outline",onClick:R,children:"Run again"})]})]})]})}function Jr(t){return e.jsx(Rs,{...t,kind:"add-evals",triggerClassName:"edit-link"})}function Xr(t){return e.jsx(Rs,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}var $t="Radio",[Wr,Fs]=Ct($t),[Yr,Zr]=Wr($t),Ts=h.forwardRef((t,a)=>{const{__scopeRadio:n,name:l,checked:i=!1,required:c,disabled:o,value:x="on",onCheck:u,form:s,...w}=t,[k,I]=h.useState(null),N=Ue(a,T=>I(T)),$=h.useRef(!1),p=k?s||!!k.closest("form"):!0;return e.jsxs(Yr,{scope:n,checked:i,disabled:o,children:[e.jsx(_e.button,{type:"button",role:"radio","aria-checked":i,"data-state":Bs(i),"data-disabled":o?"":void 0,disabled:o,value:x,...w,ref:N,onClick:Te(t.onClick,T=>{i||u==null||u(),p&&($.current=T.isPropagationStopped(),$.current||T.stopPropagation())})}),p&&e.jsx(Ds,{control:k,bubbles:!$.current,name:l,value:x,checked:i,required:c,disabled:o,form:s,style:{transform:"translateX(-100%)"}})]})});Ts.displayName=$t;var Ls="RadioIndicator",Us=h.forwardRef((t,a)=>{const{__scopeRadio:n,forceMount:l,...i}=t,c=Zr(Ls,n);return e.jsx(fs,{present:l||c.checked,children:e.jsx(_e.span,{"data-state":Bs(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})})});Us.displayName=Ls;var en="RadioBubbleInput",Ds=h.forwardRef(({__scopeRadio:t,control:a,checked:n,bubbles:l=!0,...i},c)=>{const o=h.useRef(null),x=Ue(o,c),u=_s(n),s=xs(a);return h.useEffect(()=>{const w=o.current;if(!w)return;const k=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(k,"checked").set;if(u!==n&&N){const $=new Event("click",{bubbles:l});N.call(w,n),w.dispatchEvent($)}},[u,n,l]),e.jsx(_e.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:x,style:{...i.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ds.displayName=en;function Bs(t){return t?"checked":"unchecked"}var tn=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],st="RadioGroup",[sn]=Ct(st,[ys,Fs]),Hs=ys(),Ms=Fs(),[an,rn]=sn(st),zs=h.forwardRef((t,a)=>{const{__scopeRadioGroup:n,name:l,defaultValue:i,value:c,required:o=!1,disabled:x=!1,orientation:u,dir:s,loop:w=!0,onValueChange:k,...I}=t,N=Hs(n),$=va(s),[p,T]=gs({prop:c,defaultProp:i??null,onChange:k,caller:st});return e.jsx(an,{scope:n,name:l,required:o,disabled:x,value:p,onValueChange:T,children:e.jsx(ya,{asChild:!0,...N,orientation:u,dir:$,loop:w,children:e.jsx(_e.div,{role:"radiogroup","aria-required":o,"aria-orientation":u,"data-disabled":x?"":void 0,dir:$,...I,ref:a})})})});zs.displayName=st;var qs="RadioGroupItem",Os=h.forwardRef((t,a)=>{const{__scopeRadioGroup:n,disabled:l,...i}=t,c=rn(qs,n),o=c.disabled||l,x=Hs(n),u=Ms(n),s=h.useRef(null),w=Ue(a,s),k=c.value===i.value,I=h.useRef(!1);return h.useEffect(()=>{const N=p=>{tn.includes(p.key)&&(I.current=!0)},$=()=>I.current=!1;return document.addEventListener("keydown",N),document.addEventListener("keyup",$),()=>{document.removeEventListener("keydown",N),document.removeEventListener("keyup",$)}},[]),e.jsx(_a,{asChild:!0,...x,focusable:!o,active:k,children:e.jsx(Ts,{disabled:o,required:c.required,checked:k,...u,...i,name:c.name,ref:w,onCheck:()=>c.onValueChange(i.value),onKeyDown:Te(N=>{N.key==="Enter"&&N.preventDefault()}),onFocus:Te(i.onFocus,()=>{var N;I.current&&((N=s.current)==null||N.click())})})})});Os.displayName=qs;var nn="RadioGroupIndicator",Ks=h.forwardRef((t,a)=>{const{__scopeRadioGroup:n,...l}=t,i=Ms(n);return e.jsx(Us,{...i,...l,ref:a})});Ks.displayName=nn;var Gs=zs,Qs=Os,on=Ks;const yt=h.forwardRef(({className:t,...a},n)=>e.jsx(Gs,{className:Je("grid gap-2",t),...a,ref:n}));yt.displayName=Gs.displayName;const Fe=h.forwardRef(({className:t,...a},n)=>e.jsx(Qs,{ref:n,className:Je("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(on,{className:"flex items-center justify-center",children:e.jsx(ka,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Fe.displayName=Qs.displayName;const ln={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},_t=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,cn=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,dn=20,kt="copy_to_bucket";function un(t){const a=t.trim();if(!cn.test(a))return null;const[n,l]=a.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(n)}/${encodeURIComponent(l)}`}function wt(t){return`pwc:bucket-copy:${t}`}function mn(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(kt)!==t)return null;try{const n=window.sessionStorage.getItem(wt(t));if(!n)return null;const l=JSON.parse(n);return l.paperId!==t||typeof l.bucketId!="string"||!["new","existing"].includes(l.destinationMode)||!["public","private"].includes(l.visibility)||!Array.isArray(l.selectedIds)||l.selectedIds.some(i=>typeof i!="string")?null:l}catch{return null}}function hn(t,a=dn){if(a<1)throw new Error("Bucket copy batch size must be positive");const n=[];for(let l=0;l!_t.test(u)))return null;const o=c.join("/"),x=a==="model"?"":`${a}s/`;return{id:`${a}:${o}`,kind:a,label:o,url:`https://huggingface.co/${x}${o}`,source:`hf://${x}${o}/`,destination:`${a}s/${o}/`,repoId:o}}catch{return null}}function pn(t){try{const a=new URL(t);if(a.hostname!=="github.com"&&a.hostname!=="www.github.com")return null;const n=a.pathname.split("/").filter(Boolean);if(n.length<2)return null;const l=n[0],i=n[1].replace(/\.git$/,"");if(!_t.test(l)||!_t.test(i))return null;const c=`${l}/${i}`;return{id:`github:${c}`,kind:"github",label:c,url:`https://github.com/${c}`,source:`https://github.com/${c}.git`,destination:`github/${c}/`}}catch{return null}}function fn({githubUrls:t,hfModelUrls:a,hfDatasetUrls:n,hfSpaceUrls:l,paperId:i,pdfName:c,pdfUrl:o}){const x=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${c||i}.pdf`}:null,...a.map(s=>ht(s,"model")),...n.map(s=>ht(s,"dataset")),...l.map(s=>ht(s,"space")),...t.map(pn)],u=new Set;return x.filter(s=>!s||u.has(s.id)?!1:(u.add(s.id),!0))}function gn(t,a,n){const l=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${Qe(t.trim())}`];n.create&&l.push(`hf buckets create "$HF_BUCKET" --exist-ok${n.isPrivate?" --private":""}`);for(const o of a.filter(x=>x.kind!=="github"&&x.kind!=="pdf"))l.push(`hf cp ${Qe(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const i=a.find(o=>o.kind==="pdf");i&&l.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${Qe(i.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${i.destination}"`);const c=a.filter(o=>o.kind==="github");if(c.length){l.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of c){const x=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;l.push(`git clone --depth 1 -- ${Qe(o.source)} "${x}"`,`hf sync "${x}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return l.join(` -`)}function xn(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function bn(t){const{toast:a}=pe(),n=h.useMemo(()=>fn({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),l=h.useMemo(()=>mn(t.paperId),[t.paperId]),[i,c]=h.useState(!!l),[o,x]=h.useState((l==null?void 0:l.destinationMode)??"new"),[u,s]=h.useState((l==null?void 0:l.bucketId)??""),[w,k]=h.useState((l==null?void 0:l.visibility)??"public"),[I,N]=h.useState(()=>new Set((l==null?void 0:l.selectedIds)??n.map(m=>m.id))),[$,p]=h.useState(!1),[T,L]=h.useState(null),[R,B]=h.useState(!!l),D=n.filter(m=>I.has(m.id)),_=D.length===n.length,d=un(u),f=d!==null,v=gn(u,D,{create:o==="new",isPrivate:w==="private"}),F=(m,C)=>{N(P=>{const U=new Set(P);return C?U.add(m):U.delete(m),U})},O=async()=>{try{await navigator.clipboard.writeText(v),a({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},K=h.useCallback(()=>{const m=wa("/api/v1/auth/hf/login"),C=new URL(window.location.href);C.searchParams.set(kt,t.paperId),window.sessionStorage.setItem(wt(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:u.trim(),destinationMode:o,visibility:w,selectedIds:Array.from(I)}));const P=new URLSearchParams({return_to:C.toString(),authorize_bucket:"true"});o==="new"&&P.set("bucket_create","true"),window.location.assign(`${m}?${P.toString()}`)},[u,o,t.paperId,I,w]),Q=h.useCallback(async()=>{if(!t.isSignedIn){K();return}p(!0);let m=0,C=0;try{const P=D.filter(z=>z.kind!=="pdf"&&z.kind!=="github"&&!!z.repoId).map(z=>({kind:z.kind,repo_id:z.repoId})),U=hn(P);U.length||U.push([]);for(const[z,W]of U.entries()){L({current:z+1,total:U.length});const g=await Na(t.paperId,{bucket_id:u.trim(),create:z===0&&o==="new",private:w==="private",include_pdf:z===0&&D.some(S=>S.kind==="pdf"),artifacts:W});m+=g.copied.length,C+=g.errors.length}const E=D.filter(z=>z.kind==="github").length;a({title:C?"Bucket copy partially completed":"Copied to bucket",description:[`${m} item${m===1?"":"s"} copied.`,C?`${C} item${C===1?"":"s"} failed.`:"",E?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:C?"destructive":void 0,action:d?e.jsx(Ca,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!C&&!E&&c(!1)}catch(P){if(P instanceof jt&&P.code==="bucket_authorization_required"){K();return}a({title:m?"Bucket copy partially completed":"Bucket copy failed",description:m?`${m} item${m===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:P instanceof jt&&typeof P.detail=="string"?P.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{p(!1),L(null)}},[K,u,d,o,t.isSignedIn,t.paperId,D,a,w]);h.useEffect(()=>{if(!R||!t.isSignedIn)return;B(!1),window.sessionStorage.removeItem(wt(t.paperId));const m=new URL(window.location.href);m.searchParams.delete(kt),window.history.replaceState({},"",`${m.pathname}${m.search}${m.hash}`),Q()},[Q,t.isSignedIn,t.paperId,R]);const X=()=>{N(new Set(n.map(m=>m.id))),!u&&t.suggestedBucketId&&s(t.suggestedBucketId),c(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:X,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:n.length?`${n.length} linked artifact${n.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(oe,{open:i,onOpenChange:c,children:e.jsxs(le,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(ce,{children:[e.jsxs(de,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(ue,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:n.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Choose your destination"}),e.jsxs(yt,{value:o,onValueChange:m=>x(m),className:"grid grid-cols-2 gap-2",children:[e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(Fe,{value:"new"}),"New bucket"]}),e.jsxs(ae,{className:"bucket-choice",children:[e.jsx(Fe,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(Z,{id:"bucket-id",value:u,onChange:m=>s(m.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":u.length>0&&!f}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),d&&e.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(J,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{children:"Bucket visibility"}),e.jsxs(yt,{value:w,onValueChange:m=>k(m),className:"flex gap-5",children:[e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Fe,{value:"public"}),"Public"]}),e.jsxs(ae,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Fe,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(ae,{children:"Artifacts"}),e.jsx(H,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>N(_?new Set:new Set(n.map(m=>m.id))),children:_?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:n.map(m=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(tt,{id:`bucket-artifact-${m.id}`,checked:I.has(m.id),onCheckedChange:C=>F(m.id,C===!0)}),e.jsxs(ae,{htmlFor:`bucket-artifact-${m.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:ln[m.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:m.label})]}),e.jsxs("a",{href:Ne(m.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(J,{name:"external",size:10})]})]},m.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:f?v:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(me,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(H,{type:"button",onClick:O,variant:"outline",disabled:!f||D.length===0,children:[e.jsx(J,{name:"copy",size:12}),"Copy commands"]}),e.jsx(H,{type:"button",onClick:Q,disabled:$||t.isSignedIn&&(!f||!D.some(m=>m.kind!=="github")),children:$?T&&T.total>1?`Copying ${T.current}/${T.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}const jn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL"},Ve=360,pt=3,us=3,vn=["tldr","abstract","tasks","methods","results"];function yn(t){if(!t)return{section:null,resultsTaskSlug:null};const[a,n]=t.split("?",2);if(!vn.includes(a))return{section:null,resultsTaskSlug:null};const l=a;return l!=="results"||!n?{section:l,resultsTaskSlug:null}:{section:l,resultsTaskSlug:new URLSearchParams(n).get("task")}}function ms(t){return`results-task-${t}`}function _n(t){return`#results?task=${encodeURIComponent(t)}`}function Ae({id:t,label:a,accent:n}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:t,children:[e.jsx("span",{children:e.jsx("a",{href:`#${t}`,className:"section-anchor-link",children:a})}),n]})}function hs(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ps(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function ft(t,a){try{const n=new URL(t),i=n.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return i?i.replace(/[-_]+/g," "):n.hostname.replace(/^www\./,"")}catch{return a}}const Zn=()=>{var Gt,Qt,Vt,Jt,Xt,Wt,Yt,Zt,es,ts;const{arxivId:t}=Ea(),a=t?Sa(t):"",n=Ia(),{toast:l}=pe(),{user:i}=We(),c=(i==null?void 0:i.is_admin)??!1,o=!!i,x=dr(i),u=!0,{data:s,isLoading:w,error:k,refetch:I}=Va(a||"",!!a),[N,$]=h.useState(!1);h.useEffect(()=>{if(!t||t===a)return;const r=window.location.search+window.location.hash;n(`/paper/${a}${r}`,{replace:!0})},[a,n,t]),h.useEffect(()=>{if(s!=null&&s.title)return document.title=Ga(s.title),()=>{document.title=Qa}},[s==null?void 0:s.title]),h.useEffect(()=>{if($(!1),!(s!=null&&s.id))return;const r=window.setTimeout(()=>$(!0),0);return()=>window.clearTimeout(r)},[s==null?void 0:s.id]);const{data:p,isLoading:T}=xr(N?s==null?void 0:s.arxiv_id:void 0),{data:L,isLoading:R,refetch:B}=hr(s==null?void 0:s.id,N&&!!(s!=null&&s.id));h.useEffect(()=>{const r=()=>{I(),B(),x==="direct"&&(s!=null&&s.id)&&(re.primePaperCurationState(s.id,!0).catch(()=>{}),re.primeEvaluationCurationState(s.id,!0).catch(()=>{})),l({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",r),()=>window.removeEventListener("pwc:catalog-conflict",r)},[x,s==null?void 0:s.id,I,B,l]);const{preferences:D}=Pa(),_=h.useMemo(()=>!L||!D.hide_closed_source_evals?L:L.filter(r=>r.is_open!==!1),[L,D.hide_closed_source_evals]),d=h.useMemo(()=>({models:(s==null?void 0:s.hf_models)??[],datasets:(s==null?void 0:s.hf_datasets)??[],spaces:(s==null?void 0:s.hf_spaces)??[]}),[s==null?void 0:s.hf_models,s==null?void 0:s.hf_datasets,s==null?void 0:s.hf_spaces]),f=h.useMemo(()=>{const r=(y,G,V)=>{const se=new Set,Y=[];for(const te of[...y,...G??[]])se.has(te)||(se.add(te),Y.push({href:te,label:ft(te,V)}));return Y};return{models:r(d.models,p==null?void 0:p.modelUrls,"Model"),datasets:r(d.datasets,p==null?void 0:p.datasetUrls,"Dataset"),spaces:r(d.spaces,p==null?void 0:p.spaceUrls,"Space")}},[d.models,d.datasets,d.spaces,p==null?void 0:p.modelUrls,p==null?void 0:p.datasetUrls,p==null?void 0:p.spaceUrls]),v=h.useMemo(()=>{if(!_)return[];const r=new Map;for(const y of _){const G=y.task_id,V=r.get(G);V?V.rows.push(y):r.set(G,{taskId:G,taskName:y.task_name||"—",taskSlug:y.task_slug,rows:[y]})}return Array.from(r.values())},[_]),F=h.useMemo(()=>v.map(r=>r.taskSlug??"").join("|"),[v]),O=ne({queryKey:["paper-versions",s==null?void 0:s.arxiv_id],queryFn:async()=>{const r=s.arxiv_id.replace(/v\d+$/,""),y=await fetch(vs(`/api/v1/papers/arxiv/${r}/versions`));return y.ok?await y.json():[]},enabled:N&&!!(s!=null&&s.arxiv_id),staleTime:10*60*1e3}),K=ne({queryKey:["related-papers",s==null?void 0:s.id],queryFn:()=>re.getRelatedPapers(s.arxiv_id||s.id,4),enabled:N&&!!(s!=null&&s.id),staleTime:10*60*1e3}),[Q,X]=h.useState(!1),[m,C]=h.useState(!1),[P,U]=h.useState(!1),E=h.useRef(!1);h.useEffect(()=>{E.current=!1},[a]),h.useEffect(()=>{let r=0;const y=(V=!1,se=!1)=>{const{section:Y,resultsTaskSlug:te}=yn(window.location.hash.slice(1));if(!Y||!s||Y==="tldr"&&!s.tldr||Y==="results"&&(!N||R)||!V&&E.current)return;let we=null;if(Y==="results"&&te){if(we=document.getElementById(ms(te)),!we){if(v.find(oa=>oa.taskSlug===te))return;we=document.getElementById("results")}}else we=document.getElementById(Y);if(!we)return;const ia=we;r=window.requestAnimationFrame(()=>{E.current=!0,ia.scrollIntoView({block:"start",behavior:se?"smooth":"auto"})})};y();const G=()=>{E.current=!1,y(!0,!0)};return window.addEventListener("hashchange",G),()=>{window.removeEventListener("hashchange",G),r&&window.cancelAnimationFrame(r)}},[s,s==null?void 0:s.tldr,N,R,F,v]);const{activeEditor:z,openEditor:W,setEditorOpen:g}=vr();h.useEffect(()=>{x!=="direct"||!(s!=null&&s.id)||(z&&z!=="results"&&re.primePaperCurationState(s.id).catch(()=>{}),z==="results"&&re.primeEvaluationCurationState(s.id).catch(()=>{}))},[z,x,s==null?void 0:s.id]);const[S,A]=h.useState(null),b=h.useRef(!1);h.useEffect(()=>{if(!i||!s||b.current)return;const r=sessionStorage.getItem("pwc:fresh-auth-edit");if(!r)return;b.current=!0;const y=jr(r);if(!re.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),y&&W(y);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){l({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}re.resumeFreshAuthMutation().then(()=>{l({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch(V=>{l({variant:"destructive",title:"Could not apply the saved edit",description:V instanceof Error?V.message:"Please reload and review the edit again."})})},[W,s,l,i]);const j=h.useMemo(()=>{if(!i||!(s!=null&&s.author_links))return!1;const r=i.username.toLowerCase();return s.author_links.some(y=>!!y.hf_username&&y.hf_username.toLowerCase()===r)},[i,s==null?void 0:s.author_links]),q=r=>{if(!o){A(r);return}W(r)},[M,ee]=h.useState("idle"),[Se,At]=h.useState(null),[Rt,Ft]=h.useState(null),Vs=async()=>{if(a){ee("indexing"),At(null),Ft(null);try{await Ua(a),l({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>I(),1200),ee("idle")}catch(r){const y=r;let G=y.message||"Failed to index paper";if(y.response)try{G=JSON.parse(y.response).detail||G}catch{G=y.response}At(G),(y.status===429||y.status===503)&&Ft("Try again later after arXiv has lifted the temporary limit."),ee("idle")}}},{citationDisplay:Js,citationCopy:Tt}=h.useMemo(()=>{if(!s)return{citationDisplay:"",citationCopy:""};const r=`${s.title.slice(0,60)}${s.title.length>60?"…":""}`,y=`${s.authors[0]||""}${s.authors.length>1?" et al.":""}`,G=s.authors.join(" and "),V=(s.published||"").slice(0,4)||"—",se=(Y,te)=>s.arxiv_id?`@article{${s.arxiv_id.replace(".","")}, - title={{${Y}}}, - author=${te}, - year={{${V}}}, - eprint={{${s.arxiv_id}}}, - archivePrefix={{arXiv}} -}`:`@misc{paper${s.id}, - title={{${Y}}}, - author=${te}, - year={{${V}}}, - url={{${s.source_url||s.url_abs||""}}} -}`;return{citationDisplay:se(r,`{{${y}}}`),citationCopy:se(s.title,`{${G}}`)}},[s]),Lt=h.useMemo(()=>ur(s==null?void 0:s.leaderboard_ranks),[s==null?void 0:s.leaderboard_ranks]),[Xs,Ut]=h.useState(!1),Ws=async()=>{if(Tt)try{await navigator.clipboard.writeText(Tt),Ut(!0),l({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Ut(!1),1500)}catch{l({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},Ys=async()=>{if(!s)return;const r=s.arxiv_id||s.id,y=mr(r,Lt);if(y)try{await navigator.clipboard.writeText(y),l({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{l({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(w)return e.jsxs("div",{className:"page",children:[e.jsx(Re,{className:"h-12 w-3/4 mb-4"}),e.jsx(Re,{className:"h-6 w-1/3 mb-8"}),e.jsx(Re,{className:"h-64 w-full"})]});if(k||!s)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(xe,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",a]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",a]})," in the database. You can index it from arXiv right now."]}),Se&&e.jsx(Ja,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Xa,{children:[e.jsx("div",{children:Se}),Rt&&e.jsx("div",{className:"mt-2",children:Rt})]})}),e.jsxs("div",{className:"action-row",children:[c&&e.jsxs("button",{className:"action-btn",onClick:Vs,disabled:M==="indexing",children:[e.jsx(J,{name:"sparkle",size:12}),M==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(H,{variant:"outline",onClick:()=>n("/papers"),children:"Browse Papers"})]})]});const Dt=O.data||[],Ie=Ka(s.repositories),ge=[...s.repositories??[]].sort((r,y)=>{const G=r.is_official?1:0,V=y.is_official?1:0;return G!==V?V-G:(y.num_stars||0)-(r.num_stars||0)}),Zs=(P?ge:ge.slice(0,pt)).map(r=>({...r,safeHref:Ne(r.url)})),at={models:[...new Set([...d.models,...(p==null?void 0:p.modelUrls)??[]])],datasets:[...new Set([...d.datasets,...(p==null?void 0:p.datasetUrls)??[]])],spaces:[...new Set([...d.spaces,...(p==null?void 0:p.spaceUrls)??[]])]},rt=((Gt=s.arxiv_id)==null?void 0:Gt.replace(/v\d+$/,""))??null,nt=s.arxiv_id?{isLoading:T,paperHref:`https://huggingface.co/papers/${rt}`,rows:[{label:"Models",href:xt(`https://huggingface.co/models?other=arxiv:${s.arxiv_id}`,d.models),count:bt(d.models,p==null?void 0:p.modelUrls,p==null?void 0:p.models),isLimited:p==null?void 0:p.isLimited,links:f.models},{label:"Datasets",href:xt(`https://huggingface.co/datasets?other=arxiv:${s.arxiv_id}`,d.datasets),count:bt(d.datasets,p==null?void 0:p.datasetUrls,p==null?void 0:p.datasets),isLimited:p==null?void 0:p.isLimited,links:f.datasets},{label:"Spaces",href:xt(`https://huggingface.co/papers/${rt}`,d.spaces),count:bt(d.spaces,p==null?void 0:p.spaceUrls,p==null?void 0:p.spaces),isLimited:p==null?void 0:p.isLimited,links:f.spaces}],footer:`Cite arxiv.org/abs/${rt} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:gt(d.models),count:d.models.length,links:f.models},{label:"Datasets",href:gt(d.datasets),count:d.datasets.length,links:f.datasets},{label:"Spaces",href:gt(d.spaces),count:d.spaces.length,links:f.spaces}],footer:null},Bt=s.tldr||null,Ht=s.num_pages||null,ke=s.abstract||"",ea=ke.length>Ve?ke.slice(0,Ve)+"…":ke,ta=Q||ke.length<=Ve?ke:ea,De=(s.methods||[]).filter(r=>r.source_paper_id===s.id),Be=s.introduced_benchmarks||[],Pe=s.introduced_frameworks||[],sa=De.length>0||Be.length>0||Pe.length>0,Mt=s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource",aa=s.source==="external"?"Source page":"arXiv page",zt=Ne(s.url_pdf),qt=Ne(s.url_abs),Ot=Ne(s.conference_url_abs),$e=((Qt=s.project_pages)==null?void 0:Qt.filter(r=>r.url).map(r=>({...r,safeHref:Ne(r.url)})))??[],ra=(()=>{const r=[];return De.length>0&&r.push(De.length===1?"this method":"these methods"),Be.length>0&&r.push(Be.length===1?"this benchmark":"these benchmarks"),Pe.length>0&&r.push(Pe.length===1?"this framework":"these frameworks"),r.length===0?"":r.length===1?r[0]:r.join(" and ")})(),He=s.predecessor_papers||[],Me=s.successor_papers||[],na=He.length>0||Me.length>0,ze=12,it=s.authors.map((r,y)=>{var G,V,se,Y;return{name:r,id:((V=(G=s.author_links)==null?void 0:G[y])==null?void 0:V.id)??null,hf_username:((Y=(se=s.author_links)==null?void 0:se[y])==null?void 0:Y.hf_username)??null}}),Kt=m||it.length<=ze?it:it.slice(0,ze);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(xe,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{children:Mt})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsx("h1",{className:"detail-title",children:e.jsx(qe,{title:s.title})}),e.jsxs("div",{className:"detail-meta",children:[e.jsx("span",{children:Mt}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:["Submitted ",hs(s.published)]}),Ht&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[Ht," pages"]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.citation_count.toLocaleString()," citations"]})]}),(s.proceeding||s.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),s.conference_slug?e.jsx("a",{href:`/conferences/${s.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(s.proceeding||s.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:s.proceeding.replace(/\s+\d{1,2}$/,"")})]}),Dt.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:s.version,onChange:r=>{const y=r.target.value;s.arxiv_id&&n(`/paper/${s.arxiv_id.replace(/v\d+$/,"")}${y?`?version=${y}`:""}`)},children:Dt.map(r=>e.jsxs("option",{value:r.version,children:[r.version," — ",hs(r.published)]},r.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Kt.map((r,y)=>e.jsxs(Xe.Fragment,{children:[r.id?e.jsx(xe,{to:`/authors/${r.id}`,children:r.name}):r.hf_username?e.jsx("a",{href:`https://huggingface.co/${r.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${r.hf_username} on Hugging Face`,children:r.name}):e.jsx("a",{children:r.name}),yze&&e.jsx("button",{className:"show-more-authors",onClick:()=>C(r=>!r),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:m?"show fewer":`+${s.authors.length-ze} more`})]}),e.jsxs("div",{className:"action-row",children:[zt&&e.jsxs("a",{className:"action-btn",href:zt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"pdf",size:12})," View PDF"]}),qt&&e.jsx(Ge,{showEdit:s.source==="external"&&u,onEdit:()=>q("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:s.source==="external"&&u?"action-btn-segment action-btn-main":"action-btn",href:qt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"external",size:12})," ",aa]})}),nt.paperHref&&(p==null?void 0:p.paperExists)&&e.jsxs("a",{className:"bm-action-btn",href:nt.paperHref,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Hugging Face",children:["View on ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})]}),Ie.githubUrl&&e.jsx(Ge,{showEdit:u,onEdit:()=>q("repositories"),editAriaLabel:"Edit code repositories",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Ie.githubUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"github",size:12})," Code",Ie.github!=null&&e.jsxs("span",{style:{opacity:.7,marginLeft:4},children:["· ",ps(Ie.github)," ★"]})]})}),Ie.githubUrl?null:e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>q("repositories"),title:"Add GitHub repository",children:[e.jsx(J,{name:"github",size:12})," Add code"]}),$e.length===1?e.jsx(Ge,{showEdit:u,onEdit:()=>q("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:$e[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"globe",size:12})," Project page"]})}):null,$e.length>1?e.jsx(Ge,{showEdit:u,onEdit:()=>q("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs($a,{children:[e.jsx(Aa,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(J,{name:"globe",size:12})," Project page"]})}),e.jsx(Ra,{align:"start",className:"project-page-menu",children:$e.map((r,y)=>e.jsx(Fa,{asChild:!0,children:r.safeHref?e.jsx("a",{href:r.safeHref,target:"_blank",rel:"noopener noreferrer",children:ft(r.url,`Project page ${y+1}`)}):e.jsx("span",{children:ft(r.url,`Project page ${y+1}`)})},r.url))})]})}):null,$e.length===0&&o?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>q("project-pages"),title:"Add project page",children:[e.jsx(J,{name:"globe",size:12})," Add project page"]}):null,Ot&&e.jsxs("a",{className:"action-btn",href:Ot,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(J,{name:"external",size:12})," Conference"]}),(s.organizations||[]).map(r=>e.jsxs(xe,{to:`/orgs/${r.slug}`,className:"action-btn",title:r.name,"aria-label":r.name,children:[r.logo_url&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:16,width:16,borderRadius:3,overflow:"hidden"},children:e.jsx("img",{src:r.logo_url,alt:"",style:{height:"150%",width:"150%",objectFit:"contain"},onError:y=>{y.currentTarget.style.display="none"}})}),r.name]},r.id)),e.jsx("button",{type:"button",className:"action-btn",onClick:()=>q("organizations"),children:"Edit organizations"}),c&&nr()&&e.jsx(Xr,{paperId:Number(s.id),paperTitle:s.title,onComplete:()=>void I()}),e.jsx(Gr,{paperId:s.id})]}),s.leaderboard_ranks&&s.leaderboard_ranks.length>0&&e.jsx(Da,{wrap:!0,paperHref:`/paper/${s.arxiv_id||s.id}`,ranks:s.leaderboard_ranks.filter(r=>r.best_rank>=1&&r.best_rank<=3).map(r=>({name:r.dataset_name,slug:r.dataset_slug||null,rank:r.best_rank}))})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(Ba,{paperId:s.arxiv_id||s.id,title:s.title,thumbnailUrl:Ta(s.thumbnail_url),priority:!0})})]}),sa&&e.jsxs("div",{className:`introduced-banner${Pe.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[De.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>n(`/methods/${r.slug||r.id}`),children:[r.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${r.id}`)),Be.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>n(`/benchmark/${r.slug||r.id}`),children:[r.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${r.id}`)),Pe.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>n(`/frameworks#framework-${r.slug}`),children:[r.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${r.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",ra,"."]})]}),na&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Me.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Me.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Me.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>n(`/paper/${r.route_identifier}`),children:[e.jsx(qe,{title:r.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${r.id}`))})]}),He.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:He.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:He.map(r=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>n(`/paper/${r.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(qe,{title:r.title})]},`predecessor-${r.id}`))})]})]}),Bt&&e.jsxs(e.Fragment,{children:[e.jsx(Ae,{id:"tldr",label:"TL;DR · AI-generated"}),e.jsx("div",{className:"tldr-box",children:Bt})]}),e.jsx(Ae,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",style:{marginBottom:8},children:e.jsx(Oa,{text:ta})}),ke.length>Ve&&e.jsx("div",{className:"read-full",onClick:()=>X(r=>!r),children:Q?"− collapse abstract":"+ read full abstract"}),e.jsx(Ae,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((Vt=s.tasks)==null?void 0:Vt.length)||0," tagged",e.jsx("button",{type:"button",onClick:()=>q("tasks"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(s.tasks||[]).map(r=>e.jsx(Ha,{slug:r.slug||"",label:r.name},r.id))}),e.jsx(Ae,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((Jt=s.methods)==null?void 0:Jt.length)||0," used",e.jsx("button",{type:"button",onClick:()=>q("methods"),className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(s.methods||[]).map(r=>e.jsx(Ma,{method:r},r.id))}),e.jsx(Ae,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[(_==null?void 0:_.length)||0," benchmarks",Lt.length>0&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:Ys,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(J,{name:"copy",size:10})," Copy PwC badge"]}),c&&ir()&&e.jsx(Jr,{paperId:Number(s.id),paperTitle:s.title,onComplete:()=>void B()}),e.jsx("button",{type:"button",onClick:()=>q("results"),className:"edit-link",children:"edit"})]})}),R?e.jsx(Re,{className:"h-32 w-full"}):v.length>0?v.map(r=>e.jsxs("div",{className:r.taskSlug?"paper-section-anchor":void 0,id:r.taskSlug?ms(r.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:r.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(xe,{to:`/tasks/${r.taskSlug}`,children:r.taskName}),e.jsx("a",{href:_n(r.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${r.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):r.taskName}),e.jsxs("span",{className:"accent",children:[r.rows.length," ",r.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:r.rows.map(y=>{var G;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:y.dataset_slug?e.jsx(xe,{to:`/benchmark/${y.dataset_slug}`,children:y.dataset_name||"—"}):y.dataset_name||"—"}),e.jsxs("td",{className:"model",title:y.model_name||void 0,children:[y.hf_model_url?e.jsx("a",{href:y.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${y.model_name||"model"} on Hugging Face`,children:y.model_name||"—"}):y.model_name||"—",y.is_open===!1&&e.jsx(za,{}),(y.external??y.is_external)&&e.jsx(qa,{sourceUrl:y.source_url||y.external_source_url||y.result_url})]}),e.jsx("td",{className:"metric",children:y.best_metric}),e.jsx("td",{className:"value",children:La((G=y.metrics)==null?void 0:G[y.best_metric||""])}),e.jsx("td",{className:"rank",children:y.best_rank!=null?`#${y.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:y.dataset_slug&&e.jsx(xe,{to:`/benchmark/${y.dataset_slug}?${[y.task_slug?`task=${encodeURIComponent(y.task_slug)}`:"",`eval=${encodeURIComponent(y.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},y.id)})})]})]},r.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]}),e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[ge.length," repo",ge.length===1?"":"s",e.jsx("button",{type:"button",onClick:()=>q("repositories"),className:"edit-link",children:"edit"})]})]}),Zs.filter(r=>r.safeHref).map(r=>e.jsxs("a",{href:r.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(J,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[r.owner,"/",r.name]}),r.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",ps(r.num_stars)]})]},r.id)),ge.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),ge.length>pt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>U(r=>!r),children:P?"− show top 3":`+ show ${ge.length-pt} more repos`})]}),e.jsx(kn,{viewer:nt,onEdit:()=>q("hf-artifacts")}),e.jsx(bn,{githubUrls:ge.map(r=>r.url),hfModelUrls:at.models,hfDatasetUrls:at.datasets,hfSpaceUrls:at.spaces,paperId:s.id,pdfName:((Xt=s.arxiv_id)==null?void 0:Xt.replace("/","-"))||s.id,pdfUrl:s.url_pdf,isSignedIn:!!i,suggestedBucketId:i?`${i.username}/${xn(s.title)}`:void 0}),K.isLoading&&e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}),!K.isLoading&&(((Wt=K.data)==null?void 0:Wt.length)??0)>0&&e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),K.data.map(r=>e.jsxs(xe,{to:`/paper/${r.arxiv_id||r.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(qe,{title:r.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:r.arxiv_id?`arXiv:${r.arxiv_id}`:"External resource"}),r.citation_count!=null&&e.jsxs("span",{children:[r.citation_count.toLocaleString()," cites"]})]})]},r.id))]}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:Ws,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(J,{name:"copy",size:11}),Xs?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:Js})]})]})]}),e.jsx(Sr,{open:z==="tasks",onOpenChange:r=>g("tasks",r),paperId:s.id,arxivId:a,initialTaskIds:((Yt=s.tasks)==null?void 0:Yt.map(r=>parseInt(r.id)))||[],initialTasks:s.tasks||[],submitMode:x,isAuthor:j}),e.jsx($r,{open:z==="methods",onOpenChange:r=>g("methods",r),paperId:s.id,arxivId:a,initialMethodIds:((Zt=s.methods)==null?void 0:Zt.map(r=>parseInt(r.id)))||[],initialMethods:s.methods||[],submitMode:x,isAuthor:j}),e.jsx(Ar,{open:z==="repositories",onOpenChange:r=>g("repositories",r),paperId:s.id,arxivId:a,initialRepositories:((es=s.repositories)==null?void 0:es.map(r=>({url:r.url,is_official:r.is_official||!1})))||[],submitMode:x,isAuthor:j}),e.jsx(Rr,{open:z==="project-pages",onOpenChange:r=>g("project-pages",r),paperId:s.id,arxivId:a,initialProjectPages:((ts=s.project_pages)==null?void 0:ts.map(r=>({url:r.url,is_official:r.is_official||!1})))||[],submitMode:x,isAuthor:j}),e.jsx(Br,{open:z==="results",onOpenChange:r=>g("results",r),paperId:s.id,arxivId:a,initialEvaluations:L||[],paperTasks:s.tasks||[],submitMode:x,isAdmin:c,isAuthor:j}),e.jsx(Fr,{open:z==="source-url",onOpenChange:r=>g("source-url",r),paperId:s.id,arxivId:a,initialUrl:s.source_url??s.url_abs??"",submitMode:x,isAuthor:j}),e.jsx(Mr,{open:z==="hf-artifacts",onOpenChange:r=>g("hf-artifacts",r),paperId:s.id,arxivId:a,initialArtifacts:{hf_models:d.models,hf_datasets:d.datasets,hf_spaces:d.spaces},submitMode:x,isAuthor:j}),e.jsx(zr,{open:z==="organizations",onOpenChange:r=>g("organizations",r),paperId:s.id,initialOrganizationIds:(s.organizations||[]).map(r=>Number(r.id)),submitMode:x,isAuthor:j}),e.jsx(Wa,{open:S!==null,onOpenChange:r=>{r||A(null)},sectionLabel:S?jn[S]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})},kn=({viewer:t,onEdit:a})=>e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[t.paperHref?e.jsx("a",{href:t.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]}),t.isLoading?e.jsx(Re,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[t.rows.map(n=>e.jsx(wn,{...n},n.label)),t.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:t.footer})]})]}),wn=({label:t,href:a,count:n,isLimited:l,links:i})=>{const[c,o]=h.useState(!1),x=((i==null?void 0:i.length)??0)>0,u=((i==null?void 0:i.length)??0)>us,s=c?i:i==null?void 0:i.slice(0,us),w=n!=null?`${n}${l?"+":""}`:"—",k=n?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:w}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:w});return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:t}),k]}),x&&e.jsxs("div",{className:"hf-artifact-links",children:[s.map(I=>e.jsx("a",{href:I.href,target:"_blank",rel:"noopener noreferrer",children:I.label},I.href)),u&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":c,onClick:()=>o(I=>!I),children:c?"Show fewer":`View all ${i.length}`})]})]})};function gt(t){return t[0]??"https://huggingface.co"}function xt(t,a){return a[0]??t}function bt(t,a,n){if(n==null&&t.length===0&&!(a!=null&&a.length))return;const l=new Set([...t,...a??[]]);return Math.max(n??0,l.size)}export{Zn as default}; diff --git a/assets/PaperPreviewLink-D3OkhqBL.js b/assets/PaperPreviewLink-D8Gj_IIj.js similarity index 80% rename from assets/PaperPreviewLink-D3OkhqBL.js rename to assets/PaperPreviewLink-D8Gj_IIj.js index 9ce2f588753d837f079263ef6d64dc7208b77e6c..50bc14b8c22a8fa086d3cb80cc655f3074ca8457 100644 --- a/assets/PaperPreviewLink-D3OkhqBL.js +++ b/assets/PaperPreviewLink-D8Gj_IIj.js @@ -1,7 +1,7 @@ -import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-XzA0bTLC.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,a3 as ce,Z as ue,L as he,aq as pe}from"./index-D9_nPZtO.js";import{u as me}from"./useQuery-cycUreG-.js";import{H as fe,a as de,b as ge}from"./hover-card-DVeX2fQl.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +import{o as F,l as ne,f as v,m as b,a as re,p as I,b as $,n as L,h as ie,s as ae,c as oe,v as se,S as le}from"./index-Bzn4VKTO.js";import{k as z}from"./katex.min-BSBacQyE.js";import{j as f,R as T,M as ce,E as ue,L as he,p as pe}from"./index-Czt286FG.js";import{u as me}from"./useQuery-DLzEukS9.js";import{H as fe,a as de,b as ge}from"./hover-card-g7QtmX4K.js";function xe(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:l,mathText:s,mathTextData:l}};function e(a){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},a)}function t(){this.buffer()}function n(){const a=this.resume(),u=this.stack[this.stack.length-1];F(u.type==="math"),u.meta=a}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];F(p.type==="math"),this.exit(a),p.value=u;const m=p.data.hChildren[0];F(m.type==="element"),F(m.tagName==="code"),m.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function o(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function s(a){const u=this.resume(),p=this.stack[this.stack.length-1];F(p.type==="inlineMath"),this.exit(a),p.value=u,p.data.hChildren.push({type:"text",value:u})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function ye(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,l,a){const u=o.value||"",p=l.createTracker(a),m="$".repeat(Math.max(ne(u,"$")+1,2)),g=l.enter("mathFlow");let x=p.move(m);if(o.meta){const d=l.enter("mathFlowMeta");x+=p.move(l.safe(o.meta,{after:` `,before:x,encode:["$"],...p.current()})),d()}return x+=p.move(` `),u&&(x+=p.move(u+` -`)),x+=p.move(m),g(),x}function r(o,s,l){let a=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(a);)u++;const p="$".repeat(u);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let m=-1;for(;++mu&&(u=p):p&&(u!==void 0&&u>-1&&a.push(` -`.repeat(u)||" "),u=-1,a.push(p))}return a.join("")}function Q(e,t,n){return e.type==="element"?Qe(e,t,n):e.type==="text"?n.whitespace==="normal"?Y(e,n):Ye(e):[]}function Qe(e,t,n){const r=Z(e,n),i=e.children||[];let o=-1,s=[];if(Xe(e))return s;let l,a;for(j(e)||H(e)&&B(t,e,H)?a=` -`:Ke(e)?(l=2,a=2):W(e)&&(l=1,a=1);++o({name:n.name,slug:n.slug??""}))}}function at(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ot(e){var n;if(e.conference)return e.conference;const t=(n=e.published)==null?void 0:n.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const st=({seed:e=0})=>f.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[f.jsxs("div",{className:"paper-preview-thumb-title",children:[f.jsx("span",{}),f.jsx("span",{})]}),f.jsx("div",{className:"paper-preview-thumb-auth"}),f.jsxs("div",{className:"paper-preview-thumb-cols",children:[f.jsx("div",{className:"paper-preview-thumb-col"}),f.jsx("div",{className:"paper-preview-thumb-col"})]}),f.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),lt=({thumbnailUrl:e,seed:t})=>{const[n,r]=T.useState(!1),i=ce(e);return T.useEffect(()=>r(!1),[i]),!i||n?f.jsx(st,{seed:t}):f.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:f.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>r(!0)})})},ct=({data:e})=>{const t=e.routeId.split("").reduce((r,i)=>r+i.charCodeAt(0),0),n=at(e);return f.jsxs("div",{className:"paper-preview-inner",children:[f.jsx(lt,{thumbnailUrl:e.thumbnailUrl,seed:t}),f.jsxs("div",{className:"paper-preview-meta",children:[f.jsx("div",{className:"paper-preview-title",children:e.title}),n&&f.jsx("div",{className:"paper-preview-auth",children:n}),f.jsxs("div",{className:"paper-preview-venue",children:[ot(e),e.arxivId&&f.jsxs(f.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&f.jsxs(f.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&f.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(r=>f.jsx("span",{className:"paper-preview-tag",children:r.name},r.slug||r.name))})]})]})},ut=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,yt=({routeId:e,to:t,initialData:n,className:r,children:i,target:o,title:s})=>{const l=ue(e),[a,u]=T.useState(!1),p=!!(n!=null&&n.title.trim()),m=me({queryKey:["paper-preview",l],queryFn:()=>pe(l,!1),enabled:a&&!p,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),g=n??(m.data?it(m.data,l):void 0),x=f.jsx(he,{className:r,to:t??`/paper/${l}`,target:o,title:s,rel:o==="_blank"?"noopener noreferrer":void 0,children:i});return f.jsxs(fe,{open:a,onOpenChange:d=>{(!d||!ut())&&u(d)},openDelay:150,closeDelay:100,children:[f.jsx(de,{asChild:!0,children:x}),f.jsx(ge,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:g?f.jsx(ct,{data:g}):m.isError?f.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):f.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{yt as P,gt as a,xt as r}; +`)),x+=p.move(m),g(),x}function r(o,s,l){let a=o.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(a);)u++;const p="$".repeat(u);/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^\$|\$$/.test(a))&&(a=" "+a+" ");let m=-1;for(;++mu&&(u=p):p&&(u!==void 0&&u>-1&&a.push(` +`.repeat(u)||" "),u=-1,a.push(p))}return a.join("")}function Q(e,t,n){return e.type==="element"?Qe(e,t,n):e.type==="text"?n.whitespace==="normal"?Y(e,n):Ye(e):[]}function Qe(e,t,n){const r=J(e,n),i=e.children||[];let o=-1,s=[];if(Xe(e))return s;let l,a;for(j(e)||H(e)&&B(t,e,H)?a=` +`:Ke(e)?(l=2,a=2):W(e)&&(l=1,a=1);++o({name:n.name,slug:n.slug??""}))}}function at(e){if(!e.authors.length)return"";const t=e.authors.slice(0,3).join(", ");return e.authors.length>3?`${t}, et al.`:t}function ot(e){var n;if(e.conference)return e.conference;const t=(n=e.published)==null?void 0:n.slice(0,4);if(e.arxivId)return t?`arXiv ${t}`:"arXiv";if(e.sourceUrl)try{return new URL(e.sourceUrl).hostname.replace(/^www\./,"")}catch{}return t??"external"}const st=({seed:e=0})=>f.jsxs("div",{className:"paper-preview-thumb","aria-hidden":"true","data-testid":"faux-paper-thumb",children:[f.jsxs("div",{className:"paper-preview-thumb-title",children:[f.jsx("span",{}),f.jsx("span",{})]}),f.jsx("div",{className:"paper-preview-thumb-auth"}),f.jsxs("div",{className:"paper-preview-thumb-cols",children:[f.jsx("div",{className:"paper-preview-thumb-col"}),f.jsx("div",{className:"paper-preview-thumb-col"})]}),f.jsx("div",{className:"paper-preview-thumb-fig",style:{top:62+e%3*8}})]}),lt=({thumbnailUrl:e,seed:t})=>{const[n,r]=T.useState(!1),i=ce(e);return T.useEffect(()=>r(!1),[i]),!i||n?f.jsx(st,{seed:t}):f.jsx("div",{className:"paper-preview-thumb paper-preview-thumb-real",children:f.jsx("img",{"data-testid":"paper-preview-image",src:i,alt:"",loading:"lazy",decoding:"async",onError:()=>r(!0)})})},ct=({data:e})=>{const t=e.routeId.split("").reduce((r,i)=>r+i.charCodeAt(0),0),n=at(e);return f.jsxs("div",{className:"paper-preview-inner",children:[f.jsx(lt,{thumbnailUrl:e.thumbnailUrl,seed:t}),f.jsxs("div",{className:"paper-preview-meta",children:[f.jsx("div",{className:"paper-preview-title",children:e.title}),n&&f.jsx("div",{className:"paper-preview-auth",children:n}),f.jsxs("div",{className:"paper-preview-venue",children:[ot(e),e.arxivId&&f.jsxs(f.Fragment,{children:[" · arXiv:",e.arxivId]}),e.citationCount!=null&&f.jsxs(f.Fragment,{children:[" · ↑ ",e.citationCount.toLocaleString()]})]}),e.tasks.length>0&&f.jsx("div",{className:"paper-preview-tags",children:e.tasks.map(r=>f.jsx("span",{className:"paper-preview-tag",children:r.name},r.slug||r.name))})]})]})},ut=()=>typeof window.matchMedia=="function"&&window.matchMedia("(hover: none), (pointer: coarse)").matches,yt=({routeId:e,to:t,initialData:n,className:r,children:i,target:o,title:s})=>{const l=ue(e),[a,u]=T.useState(!1),p=!!(n!=null&&n.title.trim()),m=me({queryKey:["paper-preview",l],queryFn:()=>pe.get(l,!1),enabled:a&&!p,staleTime:5*60*1e3,gcTime:30*60*1e3,retry:!1}),g=n??(m.data?it(m.data,l):void 0),x=f.jsx(he,{className:r,to:t??`/paper/${l}`,target:o,title:s,rel:o==="_blank"?"noopener noreferrer":void 0,children:i});return f.jsxs(fe,{open:a,onOpenChange:d=>{(!d||!ut())&&u(d)},openDelay:150,closeDelay:100,children:[f.jsx(de,{asChild:!0,children:x}),f.jsx(ge,{className:"paper-preview-pop",side:"bottom",align:"start",collisionPadding:12,children:g?f.jsx(ct,{data:g}):m.isError?f.jsx("div",{className:"paper-preview-status",children:"Preview unavailable"}):f.jsx("div",{className:"paper-preview-status","aria-live":"polite",children:"Loading preview…"})})]})};export{yt as P,gt as a,xt as r}; diff --git a/assets/PapersListView-CW9s6NIq.js b/assets/PapersListView-CW9s6NIq.js new file mode 100644 index 0000000000000000000000000000000000000000..a884c3448c93e7efb9058b909365c55ec3ab05df --- /dev/null +++ b/assets/PapersListView-CW9s6NIq.js @@ -0,0 +1 @@ +import{a as q,r as m,A as z,j as e,L as x}from"./index-Czt286FG.js";import{I as E,T as G,P as Q}from"./components-D0aZHC0e.js";import{c as U}from"./catalog-BRyB71ZU.js";import{t as W,d as K}from"./transform-IZH7YNlm.js";import{u as V}from"./usePapers-BlskNTEC.js";import{u as J}from"./useDebounce-DAhMNkJl.js";import{P as X}from"./usePeriodFilter-D6AJqB5b.js";import{u as Y,P as Z}from"./useIntersectionObserver-DWuiXfmk.js";import{S as p}from"./skeleton-B7eqTJnv.js";import{A as ee,a as se}from"./alert-pIw6ZaYb.js";import{u as ae}from"./useQuery-DLzEukS9.js";import"./LatexTitle-BMNMJu5R.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-Dk5Z9hLn.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),_e=()=>{var T,A,C,I,L,R,H;const[r,_]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[b,k]=m.useState(u),d=J(b,300);m.useEffect(()=>k(u),[u]),m.useEffect(()=>{if(d===u)return;const s=new URLSearchParams(r);d?s.set("search",d):s.delete("search"),_(s,{replace:!0})},[d]);const j=r.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const l=new URLSearchParams(r);i?l.set(s,i):l.delete(s),_(l)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:d||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>U.topTasks(8),enabled:!n,staleTime:10*60*1e3}),v=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(l=>l.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((C=(A=(T=t.data)==null?void 0:T.pages)==null?void 0:A[0])==null?void 0:C.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(G,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:s=>k(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[K(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.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(Q,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{_e as default}; diff --git a/assets/PapersListView-DOq44gD8.js b/assets/PapersListView-DOq44gD8.js deleted file mode 100644 index bcd58674d2cd02002582092f71106fcfcabe0199..0000000000000000000000000000000000000000 --- a/assets/PapersListView-DOq44gD8.js +++ /dev/null @@ -1 +0,0 @@ -import{a as q,r as m,A as z,j as e,L as x,c as G}from"./index-D9_nPZtO.js";import{I as E,T as Q,P as U}from"./components-DrTew0nD.js";import{t as W,d as K}from"./transform-BObV5jzB.js";import{u as V}from"./usePapers-B3J6SKWU.js";import{u as J}from"./useDebounce-BidSk3ad.js";import{P as X}from"./usePeriodFilter-BkksG2SW.js";import{u as Y,P as Z}from"./useIntersectionObserver-CZXk9yc2.js";import{S as p}from"./skeleton-CQ2CM4l9.js";import{A as ee,a as se}from"./alert-B0bcMmNw.js";import{u as ae}from"./useQuery-cycUreG-.js";import"./LatexTitle-BtRWGRIx.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-CQNVzwuX.js";const re=[["trending","trending"],["new","newest"],["cited","most cited"]],te=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),ve=()=>{var T,C,A,I,L,R,H;const[r,_]=q(),h=r.get("framework")||void 0,g=r.get("repository")||void 0,n=!!(h||g),u=r.get("search")||"",[b,k]=m.useState(u),l=J(b,300);m.useEffect(()=>k(u),[u]),m.useEffect(()=>{if(l===u)return;const s=new URLSearchParams(r);l?s.set("search",l):s.delete("search"),_(s,{replace:!0})},[l]);const j=r.get("order_by"),N=j==="citation_count"?"cited":j==="trending"||!j&&n?"trending":"new",o=r.get("time"),$=o==="today"?"Today":o==="week"?"This Week":o==="month"?"This Month":"All Time",y=r.get("has_hf_artifacts")==="true",w=!n&&r.get("has_code")==="true",f=(s,i)=>{const d=new URLSearchParams(r);i?d.set(s,i):d.delete(s),_(d)},B=s=>{f("time",s==="Today"?"today":s==="This Week"?"week":s==="This Month"?"month":void 0)},D=s=>{f("order_by",s==="cited"?"citation_count":s==="new"?"date_published":"trending")},t=V({page_size:20,order_by:N==="trending"?"trending":N==="cited"?"citation_count":"date_published",order_dir:"desc",search:l||void 0,time:o==="today"||o==="week"||o==="month"?o:"all_time",include_resources:!0,published_after:r.get("published_after")||void 0,published_before:r.get("published_before")||void 0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:w,has_hf_artifacts:y,framework:h,repository:g}),P=ae({queryKey:["top-tasks-sidebar"],queryFn:()=>G.getTopTasks({limit:8}),enabled:!n,staleTime:10*60*1e3}),v=m.useMemo(()=>{var i;return(((i=t.data)==null?void 0:i.pages.flatMap(d=>d.results))||[]).map(W)},[t.data]),{targetRef:O,isIntersecting:F}=Y({rootMargin:"200px"});m.useEffect(()=>{F&&t.hasNextPage&&!t.isFetchingNextPage&&t.fetchNextPage()},[F,t.hasNextPage,t.isFetchingNextPage]);const c=((A=(C=(T=t.data)==null?void 0:T.pages)==null?void 0:C[0])==null?void 0:A.count)??0,a=(R=(L=(I=t.data)==null?void 0:I.pages)==null?void 0:L[0])==null?void 0:R.scope,S=h&&t.error instanceof z&&t.error.status===404,M=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(x,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(x,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:n?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:M||h||g})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:n?(a==null?void 0:a.kind)==="framework"?c>0&&`${c.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",c>0&&`${c.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":e.jsxs(e.Fragment,{children:["Search the full corpus. ",c>0&&`${c.toLocaleString()} papers indexed.`]})}),n&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(E,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",te(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(x,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(Q,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx("div",{className:"period-switch",children:X.map(s=>e.jsx("button",{className:`period-btn ${$===s?"active":""}`,onClick:()=>B(s),children:s},s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(E,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:b,onChange:s=>k(s.target.value)})]})}),e.jsxs("div",{className:n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),P.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(p,{className:"h-5 w-full"},i))}),(H=P.data)==null?void 0:H.map(s=>e.jsxs(x,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[K(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.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:re.map(([s,i])=>e.jsx("button",{className:`sort-btn ${N===s?"active":""}`,onClick:()=>D(s),children:i},s))}),e.jsx(Z,{hasCode:w,hasHfArtifacts:y,onHasCodeChange:s=>f("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>f("has_hf_artifacts",s?"true":void 0),showHasCode:!n})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),S?e.jsx("div",{className:"no-results",children:"Framework not found."}):t.error&&e.jsx(ee,{variant:"destructive",className:"mb-4",children:e.jsx(se,{children:"Failed to load papers. Please try again."})}),!S&&(t.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(p,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(p,{className:"h-6 w-3/4"}),e.jsx(p,{className:"h-4 w-1/2"}),e.jsx(p,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsx("div",{className:"no-results",children:"No matching papers."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(U,{paper:s,rank:i+1},s.id))}),e.jsx("div",{ref:O,style:{height:1}}),t.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]}))]})]})]})};export{ve as default}; diff --git a/assets/PrivacyView-DAhZCWuE.js b/assets/PrivacyView-C5xTTwU4.js similarity index 99% rename from assets/PrivacyView-DAhZCWuE.js rename to assets/PrivacyView-C5xTTwU4.js index a926488b276d2f04eb29d8e69ce96e9b232f62c4..1a592d462e35223f8ca7d9367ba24de0929e6744 100644 --- a/assets/PrivacyView-DAhZCWuE.js +++ b/assets/PrivacyView-C5xTTwU4.js @@ -1 +1 @@ -import{R as s,j as e}from"./index-D9_nPZtO.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default}; +import{R as s,j as e}from"./index-Czt286FG.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 100 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default}; diff --git a/assets/RateLimitsView-BLLHWPbs.js b/assets/RateLimitsView-2DL6Cls3.js similarity index 88% rename from assets/RateLimitsView-BLLHWPbs.js rename to assets/RateLimitsView-2DL6Cls3.js index b07c53cf94e16f36f084b10e2b2df52cf9b79ce5..0dd646b2550b28a47c67329ad55d98e6762188aa 100644 --- a/assets/RateLimitsView-BLLHWPbs.js +++ b/assets/RateLimitsView-2DL6Cls3.js @@ -1 +1 @@ -import{j as e,e as s}from"./index-D9_nPZtO.js";import{u as r}from"./useQuery-cycUreG-.js";const c=()=>{const i=r({queryKey:["submission-rate-limit-policy"],queryFn:async()=>{const t=await fetch(s("/api/v1/rate-limits"));if(!t.ok)throw new Error("Policy unavailable");return t.json()}}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{c as default}; +import{j as e,e as s}from"./index-Czt286FG.js";import{u as r}from"./useQuery-DLzEukS9.js";const c=()=>{const i=r({queryKey:["submission-rate-limit-policy"],queryFn:async()=>{const t=await fetch(s("/api/v1/rate-limits"));if(!t.ok)throw new Error("Policy unavailable");return t.json()}}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{c as default}; diff --git a/assets/SavedPapersView-CPEK6--m.js b/assets/SavedPapersView-CPEK6--m.js new file mode 100644 index 0000000000000000000000000000000000000000..5898a70abd9b8ba6ed6ea024101e05b48a57fe35 --- /dev/null +++ b/assets/SavedPapersView-CPEK6--m.js @@ -0,0 +1 @@ +import{g as h,A as g,j as e,W as v,L as x,c as j}from"./index-Czt286FG.js";import{u as N}from"./useQuery-DLzEukS9.js";import{T as b,P as f}from"./components-D0aZHC0e.js";import{S as r}from"./skeleton-B7eqTJnv.js";import{A as k,a as y}from"./alert-pIw6ZaYb.js";import{t as w}from"./transform-IZH7YNlm.js";import{s as A}from"./savedPapersAuth-CPfYg_9a.js";import"./LatexTitle-BMNMJu5R.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const T=()=>{var d,o;const{user:t,isLoading:u}=h(),a=N({queryKey:["my-bookmarks"],queryFn:()=>j.getMyBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(b,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{T as default}; diff --git a/assets/SavedPapersView-t8CX70vO.js b/assets/SavedPapersView-t8CX70vO.js deleted file mode 100644 index 409bddf910a95535bbee003e3c3314c808cb1df7..0000000000000000000000000000000000000000 --- a/assets/SavedPapersView-t8CX70vO.js +++ /dev/null @@ -1 +0,0 @@ -import{g as h,A as g,j as e,ab as v,L as x,c as j}from"./index-D9_nPZtO.js";import{u as b}from"./useQuery-cycUreG-.js";import{T as N,P as f}from"./components-DrTew0nD.js";import{S as r}from"./skeleton-CQ2CM4l9.js";import{A as k,a as y}from"./alert-B0bcMmNw.js";import{t as w}from"./transform-BObV5jzB.js";import{s as A}from"./savedPapersAuth-DSXf00GL.js";import"./LatexTitle-BtRWGRIx.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";const T=()=>{var d,o;const{user:t,isLoading:u}=h(),a=b({queryKey:["my-bookmarks"],queryFn:()=>j.getMyBookmarks(),enabled:!!t,staleTime:30*1e3,refetchOnWindowFocus:!1}),n=a.error instanceof g&&a.error.code==="saved_papers_bucket_authorization_required",m=!!a.data&&!a.data.bucket_connected,c=()=>{window.location.assign(A())};return u?e.jsxs("div",{className:"page",children:[e.jsx(r,{className:"h-10 w-1/3 mb-4"}),e.jsx(r,{className:"h-6 w-1/2 mb-8"})]}):t?e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsxs("div",{className:"feed-subtitle",children:[(d=a.data)!=null&&d.count?`${a.data.count.toLocaleString()} saved · grouped by domain`:"Your bookmarked papers, grouped by domain.",(o=a.data)!=null&&o.bucket_connected?e.jsxs(e.Fragment,{children:[" · ",e.jsx("a",{href:`https://huggingface.co/buckets/${t.username}/pwc-saved-papers`,target:"_blank",rel:"noopener noreferrer",children:"Open your Hugging Face Bucket"})]}):null]})]})}),n?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsx("p",{children:"Your saved papers are still safe in Papers With Code. Approve Bucket access to copy them into a private Hugging Face Bucket that belongs to you."}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:"Approve and migrate saved papers"})]}):a.error?e.jsx(k,{variant:"destructive",className:"mb-4",children:e.jsx(y,{children:"Failed to load your saved papers. Please try again."})}):null,m?e.jsxs("div",{className:"saved-bucket-migration",children:[e.jsxs("p",{children:[a.data.count?`Your ${a.data.count.toLocaleString()} saved ${a.data.count===1?"paper is":"papers are"} still available below. `:"When you save your first paper, ","Approve Bucket access to copy saved papers into a private Hugging Face Bucket that belongs to you. The existing data is kept until the copy is verified."]}),e.jsx("button",{type:"button",className:"hf-signin-btn",onClick:c,children:a.data.count?"Approve and migrate saved papers":"Use a Hugging Face Bucket"})]}):null,n||a.error?null:a.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,s)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(r,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(r,{className:"h-6 w-3/4"}),e.jsx(r,{className:"h-4 w-1/2"}),e.jsx(r,{className:"h-12 w-full"})]})]},s))}):!a.data||a.data.count===0?e.jsxs("div",{className:"no-results",children:["No saved papers yet."," ",e.jsx(x,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(i=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:i.name}),i.tasks.map(s=>{const l=s.papers.length;return e.jsxs("div",{className:"saved-task-block",children:[e.jsxs("div",{className:"saved-task-row",children:[s.slug?e.jsx(N,{slug:s.slug,label:s.name}):e.jsx("span",{className:"tag-chip",style:{background:"var(--surface)"},children:s.name}),e.jsxs("span",{className:"saved-task-count",children:[l," ",l===1?"paper":"papers"]})]}),e.jsx("div",{className:"paper-list",children:s.papers.map(p=>e.jsx(f,{paper:w(p),rank:1},p.id))})]},`task-${i.id??"other"}-${s.id??"untagged"}`)})]},`area-${i.id??"other"}`))]}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Saved ",e.jsx("em",{children:"Papers"})]}),e.jsx("div",{className:"feed-subtitle",children:"Sign in with Hugging Face to save papers and revisit them later."})]})}),e.jsx("div",{className:"saved-signin-panel",children:e.jsx(v,{returnTo:"/saved"})})]})};export{T as default}; diff --git a/assets/SearchOverlay-C-KnmybT.js b/assets/SearchOverlay-C-KnmybT.js new file mode 100644 index 0000000000000000000000000000000000000000..6641de38035a2c591607b6092e2b773208d24579 --- /dev/null +++ b/assets/SearchOverlay-C-KnmybT.js @@ -0,0 +1 @@ +import{r as C,u as K,R as T,i as L,j as s,p as $}from"./index-Czt286FG.js";import{u as m}from"./useQuery-DLzEukS9.js";import{L as D}from"./LatexTitle-BMNMJu5R.js";import{c as j}from"./catalog-BRyB71ZU.js";import{u as z}from"./useDebounce-DAhMNkJl.js";import{c as M,h as B,d as I}from"./transform-IZH7YNlm.js";import"./katex.min-BSBacQyE.js";const X=10,V=({open:n,onClose:l})=>{var f,_,F,q,E,P;const v=C.useRef(null),w=K(),[c,R]=T.useState(""),[h,p]=T.useState(1),a=z(c,200),g=L();C.useEffect(()=>{var r;if(!n)return;(r=v.current)==null||r.focus();const e=A=>{A.key==="Escape"&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,l]);const t=m({queryKey:["search-papers",a,h],queryFn:()=>$.search(a,h,X),enabled:n&&a.length>=2,staleTime:6e4}),k=m({queryKey:["search-tasks",a],queryFn:()=>j.listTasks({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),y=m({queryKey:["search-methods",a],queryFn:()=>j.listMethods({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4}),N=m({queryKey:["search-benchmarks",a],queryFn:()=>j.listDatasets({q:a,page_size:6}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.results)||[],u=((F=N.data)==null?void 0:F.results)||[],x=((q=t.data)==null?void 0:q.results)||[],Q=t.isFetching||k.isFetching||y.isFetching||N.isFetching,S=o.length||x.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),p(1)},onKeyDown:e=>{g&&e.key==="Enter"&&(e.preventDefault(),b())}}),s.jsxs("div",{className:"search-results",children:[g&&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.",g&&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=M(B(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:I(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))]}),x.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"search-section-label",children:["Papers · page ",h]}),x.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(D,{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 p(((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&&p(t.data.next_page)},children:"Next"})]})]})]})]})})};export{V as default}; diff --git a/assets/SearchOverlay-DEmyxI4z.js b/assets/SearchOverlay-DEmyxI4z.js deleted file mode 100644 index 9f11dce54d836976b56f508c1072126f9e1b8d1a..0000000000000000000000000000000000000000 --- a/assets/SearchOverlay-DEmyxI4z.js +++ /dev/null @@ -1 +0,0 @@ -import{r as C,u as L,R as T,i as $,j as s,c as m}from"./index-D9_nPZtO.js";import{u as p}from"./useQuery-cycUreG-.js";import{L as A}from"./LatexTitle-BtRWGRIx.js";import{u as D}from"./useDebounce-BidSk3ad.js";import{c as z,h as M,d as B}from"./transform-BObV5jzB.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}),enabled:n&&a.length>=2,staleTime:6e4});if(!n)return null;const o=((f=k.data)==null?void 0:f.results)||[],d=((_=y.data)==null?void 0:_.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-BDObDhiz.js b/assets/SettingsView-BL0kpAqP.js similarity index 90% rename from assets/SettingsView-BDObDhiz.js rename to assets/SettingsView-BL0kpAqP.js index b48a2887120a41a5467f48952abf810b554d19cf..ceeee26b9f9cdb014f384dfaa40f85416f87c77f 100644 --- a/assets/SettingsView-BDObDhiz.js +++ b/assets/SettingsView-BL0kpAqP.js @@ -1,4 +1,4 @@ -import{d as j,g as q,_ as F,at as Y,i as U,R as u,k as $,j as e,ab as x,c as y,A as O}from"./index-D9_nPZtO.js";import{u as v}from"./useMutation-CJCfaNMQ.js";import{S as E}from"./switch-BM2BYYbv.js";import{f as Q,D as W}from"./latexPlainText-DI8YEXVe.js";import{u as B,a as H,r as K,b}from"./openrouter-D8ilQuCd.js";import{E as L}from"./external-link-DlvfPaEN.js";import"./index-BGBxtSYH.js";import"./useQuery-cycUreG-.js";/** +import{d as j,g as F,F as q,ae as Y,i as U,R as u,k as W,j as e,W as x,c as y,A as O}from"./index-Czt286FG.js";import{u as v}from"./useMutation-DqQi_NTN.js";import{S as _}from"./switch-DfN0FiAU.js";import{f as $,D as Q}from"./latexPlainText-DI8YEXVe.js";import{u as B,a as H,r as K,b}from"./openrouter-D-TuExng.js";import{E as L}from"./external-link-D9s3iGdi.js";import"./index-DzH9562Y.js";import"./useQuery-DLzEukS9.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -13,4 +13,4 @@ import{d as j,g as q,_ as F,at as Y,i as U,R as u,k as $,j as e,ab as x,c as y,A * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const G=j("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"}]]),X="https://openrouter.ai/settings/keys";function Z(t,o){if(t instanceof O){if(typeof t.detail=="string")return t.detail;if(typeof t.detail=="object"&&t.detail!==null&&"message"in t.detail&&typeof t.detail.message=="string")return t.detail.message}return t instanceof Error&&!t.message.startsWith("API request failed:")?t.message:o}const re=()=>{const{user:t,isLoading:o}=q(),{preferences:S,setHideClosedSourceEvals:P,canPersist:M}=F(),{theme:A,setTheme:T}=Y(),I=A??"system",r=U(),[f,l]=u.useState(""),[k,c]=u.useState(""),[d,N]=u.useState(""),h=$(),R=B(r&&!!t),D=H(r&&!!t),n=R.data,i=D.data,a=n?K(n.resets_at):null,m=(s,g)=>{l(Z(s,g)),c(s instanceof O?s.code??"":"")},p=v({mutationFn:s=>y.connectOpenRouterCredential(s),onSuccess:s=>{h.setQueryData(b,s),N(""),l(""),c("")},onError:s=>m(s,"Could not connect the OpenRouter key.")}),w=v({mutationFn:s=>y.setOpenRouterFallback(s),onSuccess:s=>{h.setQueryData(b,s),l(""),c("")},onError:s=>m(s,"Could not change paid fallback.")}),C=v({mutationFn:()=>y.disconnectOpenRouterCredential(),onSuccess:()=>{h.setQueryData(b,{connected:!1,verified_at:null,fallback_enabled:!1}),l(""),c("")},onError:s=>m(s,"Could not disconnect the OpenRouter key.")});return u.useEffect(()=>(document.title=Q("Settings"),()=>{document.title=W}),[]),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."})]})}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:t.role??"community member"}),"."," ",t.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",t.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),o&&!t?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):t?e.jsx("div",{className:"settings-provider-grid",children:e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(i==null?void 0:i.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),n?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:n.available?`${n.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${n.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.remaining_percent,children:e.jsx("span",{style:{width:`${n.remaining_percent}%`}})}),!n.available&&e.jsxs("p",{className:"settings-limit-note",children:[n.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${n.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:R.isError||n?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),i!=null&&i.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",i.verified_at?` · Last verified ${new Date(i.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(E,{checked:i.fallback_enabled,disabled:w.isPending,onCheckedChange:s=>w.mutate(!!s)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:C.isPending,onClick:()=>C.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:X,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(L,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),d.trim()&&p.mutate(d.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:d,onChange:s=>N(s.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!d.trim()||p.isPending,children:p.isPending?"Verifying…":"Connect key"})})]}),f&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:k==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":f}),k==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(x,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]})}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to use the Papers With Code-funded OpenRouter allowance for research chat."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),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:z},{value:"light",label:"Light",description:"Always use light mode",icon:G},{value:"dark",label:"Dark",description:"Always use dark mode",icon:V}].map(s=>{const g=s.icon,_=I===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${_?"is-selected":""}`,"aria-pressed":_,onClick:()=>T(s.value),children:[e.jsx(g,{"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(E,{id:"hide-closed-source-evals",checked:S.hide_closed_source_evals,onCheckedChange:s=>{P(!!s)}})]}),!o&&!M&&!t&&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(x,{returnTo:"/settings"})})]})]})]})};export{re as default}; + */const G=j("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"}]]),X="https://openrouter.ai/settings/keys";function Z(t,o){if(t instanceof O){if(typeof t.detail=="string")return t.detail;if(typeof t.detail=="object"&&t.detail!==null&&"message"in t.detail&&typeof t.detail.message=="string")return t.detail.message}return t instanceof Error&&!t.message.startsWith("API request failed:")?t.message:o}const re=()=>{const{user:t,isLoading:o}=F(),{preferences:S,setHideClosedSourceEvals:P,canPersist:M}=q(),{theme:A,setTheme:T}=Y(),I=A??"system",r=U(),[f,l]=u.useState(""),[k,c]=u.useState(""),[d,N]=u.useState(""),h=W(),R=B(r&&!!t),D=H(r&&!!t),n=R.data,i=D.data,a=n?K(n.resets_at):null,m=(s,g)=>{l(Z(s,g)),c(s instanceof O?s.code??"":"")},p=v({mutationFn:s=>y.connectOpenRouterCredential(s),onSuccess:s=>{h.setQueryData(b,s),N(""),l(""),c("")},onError:s=>m(s,"Could not connect the OpenRouter key.")}),w=v({mutationFn:s=>y.setOpenRouterFallback(s),onSuccess:s=>{h.setQueryData(b,s),l(""),c("")},onError:s=>m(s,"Could not change paid fallback.")}),C=v({mutationFn:()=>y.disconnectOpenRouterCredential(),onSuccess:()=>{h.setQueryData(b,{connected:!1,verified_at:null,fallback_enabled:!1}),l(""),c("")},onError:s=>m(s,"Could not disconnect the OpenRouter key.")});return u.useEffect(()=>(document.title=$("Settings"),()=>{document.title=Q}),[]),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."})]})}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:t.role??"community member"}),"."," ",t.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",t.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),o&&!t?e.jsx("div",{className:"settings-billing-loading",role:"status","aria-live":"polite",children:"Checking account…"}):t?e.jsx("div",{className:"settings-provider-grid",children:e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(i==null?void 0:i.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),n?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",a==null?void 0:a.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",a==null?void 0:a.utc,")"]})]})]}),e.jsx("strong",{children:n.available?`${n.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${n.remaining_percent}% remaining; resets ${a==null?void 0:a.local}; ${a==null?void 0:a.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n.remaining_percent,children:e.jsx("span",{style:{width:`${n.remaining_percent}%`}})}),!n.available&&e.jsxs("p",{className:"settings-limit-note",children:[n.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${n.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:R.isError||n?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),i!=null&&i.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",i.verified_at?` · Last verified ${new Date(i.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(_,{checked:i.fallback_enabled,disabled:w.isPending,onCheckedChange:s=>w.mutate(!!s)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:C.isPending,onClick:()=>C.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:X,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(L,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),d.trim()&&p.mutate(d.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:d,onChange:s=>N(s.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!d.trim()||p.isPending,children:p.isPending?"Verifying…":"Connect key"})})]}),f&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:k==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":f}),k==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(x,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]})}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to use the Papers With Code-funded OpenRouter allowance for research chat."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(x,{returnTo:"/settings"})})]})]}),r&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 100 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),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:z},{value:"light",label:"Light",description:"Always use light mode",icon:G},{value:"dark",label:"Dark",description:"Always use dark mode",icon:V}].map(s=>{const g=s.icon,E=I===s.value;return e.jsxs("button",{type:"button",className:`theme-option ${E?"is-selected":""}`,"aria-pressed":E,onClick:()=>T(s.value),children:[e.jsx(g,{"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(_,{id:"hide-closed-source-evals",checked:S.hide_closed_source_evals,onCheckedChange:s=>{P(!!s)}})]}),!o&&!M&&!t&&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(x,{returnTo:"/settings"})})]})]})]})};export{re as default}; diff --git a/assets/SharedChatView-DKbKiY7e.js b/assets/SharedChatView-DQ4fp3ZH.js similarity index 86% rename from assets/SharedChatView-DKbKiY7e.js rename to assets/SharedChatView-DQ4fp3ZH.js index aaed0c36a201e71fac703a79b378bb2addf5ba2c..dfaddb7e0b6397623ea2fca7dd917952bd1659e1 100644 --- a/assets/SharedChatView-DKbKiY7e.js +++ b/assets/SharedChatView-DQ4fp3ZH.js @@ -1 +1 @@ -import{f as x,u as f,r as u,j as e,b as g}from"./index-D9_nPZtO.js";import{u as j}from"./useQuery-cycUreG-.js";import{C as v,U as b,A as y}from"./ChatMessage-CIUk_Zbp.js";import{z as p,p as S,B as N,q as k,E as w}from"./chatSessions-CQv5Fwer.js";import"./katex.min-BSBacQyE.js";import"./hover-card-DVeX2fQl.js";import"./github-DYxu-4Fs.js";import"./github-DngRIean.js";import"./PaperPreviewLink-D3OkhqBL.js";import"./index-XzA0bTLC.js";import"./file-text-CM_ChV1A.js";import"./chevron-down-D6vo9F6c.js";const C=({detail:c})=>{const[i,h]=u.useState(()=>N(c)),s=u.useMemo(()=>{const a={};for(const r of i)for(const t of r.blocks??[])if(t.kind==="tool")for(const n of t.results??[])a[n.route_id]=n;return a},[i]),l=(a,r)=>{h(t=>t.map(n=>{var o;return n.id!==a?n:{...n,blocks:(o=n.blocks)==null?void 0:o.map((d,m)=>m===r&&(d.kind==="reasoning"||d.kind==="tool")?{...d,open:!d.open}:d)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(a=>a.role==="user"?e.jsx(b,{id:a.id,text:a.text??"",paperMentions:a.paperMentions??[]},a.id):e.jsx(y,{msg:a,papers:s,onToggleBlock:l},a.id))})},I=()=>{const{shareId:c=""}=x(),i=f(),h=g(),s=j({queryKey:["shared-chat",c],queryFn:()=>w(c),retry:(r,t)=>!(t instanceof p&&t.status===404)&&r<1});u.useEffect(()=>{const r=document.title,t=document.head.querySelector('meta[name="robots"]'),n=t==null?void 0:t.content,o=t??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",t||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,t?t.content=n??"":o.remove()}},[]);const l=r=>{k(r,void 0,{autoSend:!1}),i("/chat")},a=s.error instanceof p&&s.error.status===404;return s.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):a?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):s.isError||!s.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(C,{detail:s.data},s.data.updated_at),s.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",s.data.model_label]}),s.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),s.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai/",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(v,{onSend:r=>l(r.text),placeholder:"Ask a new research question…"})]})]})]})};export{I as default}; +import{f as x,u as f,r as u,j as e,b as g}from"./index-Czt286FG.js";import{u as j}from"./useQuery-DLzEukS9.js";import{C as v,U as b,A as y}from"./ChatMessage-BctqyM5G.js";import{z as p,p as S,B as N,q as k,E as w}from"./chatSessions-lE15HqmS.js";import"./katex.min-BSBacQyE.js";import"./hover-card-g7QtmX4K.js";import"./github-Cy0ZQSs0.js";import"./github-HgTw2jEK.js";import"./PaperPreviewLink-D8Gj_IIj.js";import"./index-Bzn4VKTO.js";import"./file-text-D3BfQF99.js";import"./chevron-down-D8AKxdK5.js";const C=({detail:c})=>{const[i,h]=u.useState(()=>N(c)),s=u.useMemo(()=>{const a={};for(const r of i)for(const t of r.blocks??[])if(t.kind==="tool")for(const n of t.results??[])a[n.route_id]=n;return a},[i]),l=(a,r)=>{h(t=>t.map(n=>{var o;return n.id!==a?n:{...n,blocks:(o=n.blocks)==null?void 0:o.map((d,m)=>m===r&&(d.kind==="reasoning"||d.kind==="tool")?{...d,open:!d.open}:d)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:i.map(a=>a.role==="user"?e.jsx(b,{id:a.id,text:a.text??"",paperMentions:a.paperMentions??[]},a.id):e.jsx(y,{msg:a,papers:s,onToggleBlock:l},a.id))})},I=()=>{const{shareId:c=""}=x(),i=f(),h=g(),s=j({queryKey:["shared-chat",c],queryFn:()=>w(c),retry:(r,t)=>!(t instanceof p&&t.status===404)&&r<1});u.useEffect(()=>{const r=document.title,t=document.head.querySelector('meta[name="robots"]'),n=t==null?void 0:t.content,o=t??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",t||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,t?t.content=n??"":o.remove()}},[]);const l=r=>{k(r,void 0,{autoSend:!1}),i("/chat")},a=s.error instanceof p&&s.error.status===404;return s.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(S,{})," Loading shared conversation…"]}):a?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):s.isError||!s.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void s.refetch(),children:"Try again"})]}):e.jsxs("div",{className:"shared-chat-page",children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),h&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsxs("div",{className:"shared-chat-content",children:[e.jsx(C,{detail:s.data},s.data.updated_at),s.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",s.data.model_label]}),s.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),s.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai/",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),h&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(v,{onSend:r=>l(r.text),placeholder:"Ask a new research question…"})]})]})]})};export{I as default}; diff --git a/assets/SignInToEditDialog-Dgq0yOYP.js b/assets/SignInToEditDialog-Dgq0yOYP.js new file mode 100644 index 0000000000000000000000000000000000000000..b34599c4d5fbbcb3b2e54d711d62b469b626238d --- /dev/null +++ b/assets/SignInToEditDialog-Dgq0yOYP.js @@ -0,0 +1,11 @@ +import{d as ie,r as a,j as e,U as pe,v as xe,V as fe,h as ve,X as je,C as be,W as ye}from"./index-Czt286FG.js";import{B as M}from"./button-vhqVRnBn.js";import{I as c,T as Ne}from"./textarea-Ov25LunA.js";import{D as ne,a as oe,b as le,c as ce,d as de,e as we}from"./dialog-CJthLFv3.js";import{u as Ie}from"./useMutation-DqQi_NTN.js";import{s as Se}from"./submissions-BsEO_Bbg.js";import{L as De}from"./loader-circle-DyZRZBrM.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 _e=ie("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/** + * @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 Ye=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Ce=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=Ce.reduce((i,n)=>{const o=pe(`Primitive.${n}`),s=a.forwardRef((u,f)=>{const{asChild:g,...v}=u,h=g?o:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(h,{...v,ref:f})});return s.displayName=`Primitive.${n}`,{...i,[n]:s}},{}),Pe="Label",me=a.forwardRef((i,n)=>e.jsx(Ee.label,{...i,ref:n,onMouseDown:o=>{var u;o.target.closest("button, input, select, textarea")||((u=i.onMouseDown)==null||u.call(i,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}}));me.displayName=Pe;var ue=me;const ke=fe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=a.forwardRef(({className:i,...n},o)=>e.jsx(ue,{ref:o,className:xe(ke(),i),...n}));d.displayName=ue.displayName;const Me=200,Le=2e3,Ae=300,Fe=500,ae=1e3,Re=2*1024*1024,re=["image/jpeg","image/png","image/webp","image/gif"],Be={task:"new_task",method:"new_method",benchmark:"new_benchmark",metric:"new_metric",conference:"new_conference"},Te={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ge={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function ze({open:i,onOpenChange:n,paperId:o,kind:s}){const[u,f]=a.useState(""),[g,v]=a.useState(""),[h,L]=a.useState(""),[A,F]=a.useState(""),[R,B]=a.useState(""),[T,G]=a.useState(""),[N,U]=a.useState(""),[x,w]=a.useState(null),[I,H]=a.useState(""),[j,V]=a.useState(""),[S,O]=a.useState(""),[D,X]=a.useState(""),[_,$]=a.useState(""),[C,K]=a.useState(""),[E,Y]=a.useState(""),[P,z]=a.useState(""),[J,W]=a.useState("higher_is_better"),[q,p]=a.useState(""),b=a.useRef(null),{toast:Q}=ve(),y=s,Z=s==="task"||s==="method";a.useEffect(()=>{i||(f(""),v(""),L(""),F(""),B(""),G(""),U(""),w(null),H(""),V(""),O(""),X(""),$(""),K(""),Y(""),z(""),W("higher_is_better"),p(""))},[i]);const ee=t=>{if(!t)return;if(p(""),!re.includes(t.type)){p("Choose a JPEG, PNG, WebP, or GIF image.");return}if(t.size>Re){p("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){p("Could not read that image.");return}w({file_name:t.name,mime_type:t.type,data_url:r.result})},r.onerror=()=>p("Could not read that image."),r.readAsDataURL(t)},ge=t=>{t.preventDefault(),ee(t.dataTransfer.files[0])},k=Ie({mutationFn:async()=>{const t={name:u.trim()};if(s==="conference")Object.entries({description:g.trim(),year:h?Number(h):void 0,start_date:A,end_date:R,venue:T.trim(),url:N.trim()}).forEach(([r,m])=>{m&&(t[r]=m)});else{const r=g.trim();r&&(t.description=r),Z&&(x&&(t.image=x),I.trim()&&(t.image_credit=I.trim())),s==="method"&&j.trim()&&(t.source_url=j.trim()),s==="task"&&(S.trim()&&(t.keywords=S.trim()),D&&(t.parent_id=Number(D)),_&&(t.area_id=Number(_))),s==="benchmark"&&(t.task_ids=C.split(",").map(m=>Number(m.trim())).filter(m=>Number.isInteger(m)&&m>0)),s==="metric"&&(t.direction=J,t.task_id=Number(E),t.dataset_id=Number(P))}return Se.submit({paper_id:o?parseInt(o):null,edit_type:Be[s],proposed_payload:t})},onSuccess:()=>{Q({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${y} shortly.`}),n(!1)},onError:t=>{var te,se;const r=t;let m=r.message||`Failed to submit your ${y} suggestion.`;if(r.response)try{const l=JSON.parse(r.response);typeof(l==null?void 0:l.detail)=="string"?m=l.detail:(te=l==null?void 0:l.detail)!=null&&te.message?m=`${l.detail.message} See ${l.detail.help||"/rate-limits"} for help.`:Array.isArray(l==null?void 0:l.detail)&&((se=l.detail[0])!=null&&se.msg)&&(m=l.detail[0].msg)}catch{m=r.response}Q({title:"Could not submit suggestion",description:m,variant:"destructive"})}}),he=u.trim().length>0&&(s==="task"||s==="method"&&!!j.trim()||s==="conference"&&!!h&&!!N.trim()||s==="benchmark"&&!!C.trim()&&!!g.trim()||s==="metric"&&!!E&&!!P&&!!g.trim());return e.jsx(ne,{open:i,onOpenChange:n,children:e.jsxs(oe,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Suggest a new ",y]}),e.jsxs(de,{children:["Propose a ",y," that isn't in the list yet. An admin will review your suggestion before it's added."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-name",children:"Name"}),e.jsx(c,{id:"suggest-name",value:u,maxLength:Me,placeholder:Te[s],onChange:t=>f(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"suggest-description",children:["Description",s==="task"||s==="method"||s==="conference"?" (optional)":""]}),e.jsx(Ne,{id:"suggest-description",value:g,maxLength:Le,placeholder:Ge[s],onChange:t=>v(t.target.value)})]}),s==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(c,{id:"suggest-keywords",value:S,onChange:t=>O(t.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(c,{type:"number",min:"1",value:D,onChange:t=>X(t.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(c,{type:"number",min:"1",value:_,onChange:t=>$(t.target.value),placeholder:"Area ID (optional)"})]})]}),s==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-task-ids",children:"Intended task IDs"}),e.jsx(c,{id:"suggest-task-ids",value:C,onChange:t=>K(t.target.value),placeholder:"e.g. 9, 14"})]}),s==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(d,{children:"Intended leaderboard"}),e.jsxs("select",{className:"w-full rounded-md border bg-background p-2",value:J,onChange:t=>W(t.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(c,{type:"number",min:"1",value:E,onChange:t=>Y(t.target.value),placeholder:"Task ID"}),e.jsx(c,{type:"number",min:"1",value:P,onChange:t=>z(t.target.value),placeholder:"Benchmark ID"})]})]}),Z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{children:"Image (optional)"}),e.jsx("input",{ref:b,className:"sr-only",type:"file",accept:re.join(","),onChange:t=>{var r;return ee((r=t.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(M,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{w(null),b.current&&(b.current.value="")},children:[e.jsx(je,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var t;return(t=b.current)==null?void 0:t.click()},onDragOver:t=>t.preventDefault(),onDrop:ge,children:[e.jsx(_e,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),q&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(c,{id:"suggest-image-source",value:I,maxLength:ae,placeholder:"Creator, publication, or source URL",onChange:t=>H(t.target.value)})]}),s==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(c,{id:"suggest-method-source",value:j,maxLength:ae,placeholder:"https://arxiv.org/abs/...",onChange:t=>V(t.target.value)})]})]}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(c,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:h,placeholder:"2026",onChange:t=>L(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(d,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(c,{id:"suggest-start-date",type:"date",value:A,onChange:t=>F(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(d,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(c,{id:"suggest-end-date",type:"date",value:R,onChange:t=>B(t.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(c,{id:"suggest-venue",value:T,maxLength:Ae,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:t=>G(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(c,{id:"suggest-url",type:"url",inputMode:"url",value:N,maxLength:Fe,placeholder:"https://example.org/conference",onChange:t=>U(t.target.value)})]})]})]}),e.jsxs(we,{children:[e.jsx(M,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),e.jsx(M,{onClick:()=>k.mutate(),disabled:k.isPending||!he,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function Je({open:i,onOpenChange:n,sectionLabel:o,returnTo:s,taxonomySuggestion:u=!1}){return e.jsx(ne,{open:i,onOpenChange:n,children:e.jsxs(oe,{className:"max-w-md",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Sign in to ",u?"suggest":"edit"," ",o]}),e.jsx(de,{children:u?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(ye,{returnTo:s})})]})})}export{d as L,Ye as P,ze as S,Je as a}; diff --git a/assets/SignInToEditDialog-NNf7Zp6R.js b/assets/SignInToEditDialog-NNf7Zp6R.js deleted file mode 100644 index e725ff0a682187ec392f4f33e56c2141e385b170..0000000000000000000000000000000000000000 --- a/assets/SignInToEditDialog-NNf7Zp6R.js +++ /dev/null @@ -1,11 +0,0 @@ -import{d as ne,r as a,j as e,a9 as pe,v as xe,aa as fe,h as ve,w as je,X as be,C as ye,ab as Ne}from"./index-D9_nPZtO.js";import{B as M}from"./button-B859643f.js";import{I as c,T as we}from"./textarea-BVF3ykiv.js";import{D as ie,a as oe,b as le,c as ce,d as de,e as Ie}from"./dialog-DnjY6ZOM.js";import{u as Se}from"./useMutation-CJCfaNMQ.js";import{L as De}from"./loader-circle-CrVj12oC.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 _e=ne("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/** - * @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 Ke=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Ce=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=Ce.reduce((n,i)=>{const o=pe(`Primitive.${i}`),s=a.forwardRef((u,f)=>{const{asChild:g,...v}=u,h=g?o:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(h,{...v,ref:f})});return s.displayName=`Primitive.${i}`,{...n,[i]:s}},{}),Pe="Label",me=a.forwardRef((n,i)=>e.jsx(Ee.label,{...n,ref:i,onMouseDown:o=>{var u;o.target.closest("button, input, select, textarea")||((u=n.onMouseDown)==null||u.call(n,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}}));me.displayName=Pe;var ue=me;const ke=fe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=a.forwardRef(({className:n,...i},o)=>e.jsx(ue,{ref:o,className:xe(ke(),n),...i}));d.displayName=ue.displayName;const Me=200,Le=2e3,Ae=300,Fe=500,ae=1e3,Re=2*1024*1024,re=["image/jpeg","image/png","image/webp","image/gif"],Be={task:"new_task",method:"new_method",benchmark:"new_benchmark",metric:"new_metric",conference:"new_conference"},Te={task:"e.g. Long-context Retrieval",method:"e.g. Rotary Position Embedding",benchmark:"e.g. ImageNet (ReaL)",metric:"e.g. Top-5 Accuracy",conference:"e.g. International Conference on Machine Learning 2026"},Ge={task:"Briefly describe this task and what it covers.",method:"Briefly describe this method and what it covers.",benchmark:"Briefly describe this benchmark, the task it belongs to, and where it comes from.",metric:"Briefly describe this metric and whether higher or lower is better.",conference:"Briefly describe this conference, including its research focus and edition."};function Ye({open:n,onOpenChange:i,paperId:o,kind:s}){const[u,f]=a.useState(""),[g,v]=a.useState(""),[h,L]=a.useState(""),[A,F]=a.useState(""),[R,B]=a.useState(""),[T,G]=a.useState(""),[N,H]=a.useState(""),[x,w]=a.useState(null),[I,U]=a.useState(""),[j,O]=a.useState(""),[S,V]=a.useState(""),[D,X]=a.useState(""),[_,$]=a.useState(""),[C,K]=a.useState(""),[E,Y]=a.useState(""),[P,z]=a.useState(""),[J,W]=a.useState("higher_is_better"),[q,p]=a.useState(""),b=a.useRef(null),{toast:Q}=ve(),y=s,Z=s==="task"||s==="method";a.useEffect(()=>{n||(f(""),v(""),L(""),F(""),B(""),G(""),H(""),w(null),U(""),O(""),V(""),X(""),$(""),K(""),Y(""),z(""),W("higher_is_better"),p(""))},[n]);const ee=t=>{if(!t)return;if(p(""),!re.includes(t.type)){p("Choose a JPEG, PNG, WebP, or GIF image.");return}if(t.size>Re){p("Image must be 2 MB or smaller.");return}const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){p("Could not read that image.");return}w({file_name:t.name,mime_type:t.type,data_url:r.result})},r.onerror=()=>p("Could not read that image."),r.readAsDataURL(t)},ge=t=>{t.preventDefault(),ee(t.dataTransfer.files[0])},k=Se({mutationFn:async()=>{const t={name:u.trim()};if(s==="conference")Object.entries({description:g.trim(),year:h?Number(h):void 0,start_date:A,end_date:R,venue:T.trim(),url:N.trim()}).forEach(([r,m])=>{m&&(t[r]=m)});else{const r=g.trim();r&&(t.description=r),Z&&(x&&(t.image=x),I.trim()&&(t.image_credit=I.trim())),s==="method"&&j.trim()&&(t.source_url=j.trim()),s==="task"&&(S.trim()&&(t.keywords=S.trim()),D&&(t.parent_id=Number(D)),_&&(t.area_id=Number(_))),s==="benchmark"&&(t.task_ids=C.split(",").map(m=>Number(m.trim())).filter(m=>Number.isInteger(m)&&m>0)),s==="metric"&&(t.direction=J,t.task_id=Number(E),t.dataset_id=Number(P))}return je({paper_id:o?parseInt(o):null,edit_type:Be[s],proposed_payload:t})},onSuccess:()=>{Q({title:"Suggestion submitted for review",description:`Thanks! An admin will review your suggested ${y} shortly.`}),i(!1)},onError:t=>{var te,se;const r=t;let m=r.message||`Failed to submit your ${y} suggestion.`;if(r.response)try{const l=JSON.parse(r.response);typeof(l==null?void 0:l.detail)=="string"?m=l.detail:(te=l==null?void 0:l.detail)!=null&&te.message?m=`${l.detail.message} See ${l.detail.help||"/rate-limits"} for help.`:Array.isArray(l==null?void 0:l.detail)&&((se=l.detail[0])!=null&&se.msg)&&(m=l.detail[0].msg)}catch{m=r.response}Q({title:"Could not submit suggestion",description:m,variant:"destructive"})}}),he=u.trim().length>0&&(s==="task"||s==="method"&&!!j.trim()||s==="conference"&&!!h&&!!N.trim()||s==="benchmark"&&!!C.trim()&&!!g.trim()||s==="metric"&&!!E&&!!P&&!!g.trim());return e.jsx(ie,{open:n,onOpenChange:i,children:e.jsxs(oe,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Suggest a new ",y]}),e.jsxs(de,{children:["Propose a ",y," that isn't in the list yet. An admin will review your suggestion before it's added."]})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-name",children:"Name"}),e.jsx(c,{id:"suggest-name",value:u,maxLength:Me,placeholder:Te[s],onChange:t=>f(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(d,{htmlFor:"suggest-description",children:["Description",s==="task"||s==="method"||s==="conference"?" (optional)":""]}),e.jsx(we,{id:"suggest-description",value:g,maxLength:Le,placeholder:Ge[s],onChange:t=>v(t.target.value)})]}),s==="task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-keywords",children:"Keywords (optional)"}),e.jsx(c,{id:"suggest-keywords",value:S,onChange:t=>V(t.target.value),placeholder:"comma-separated matching terms"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(c,{type:"number",min:"1",value:D,onChange:t=>X(t.target.value),placeholder:"Parent task ID (optional)"}),e.jsx(c,{type:"number",min:"1",value:_,onChange:t=>$(t.target.value),placeholder:"Area ID (optional)"})]})]}),s==="benchmark"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-task-ids",children:"Intended task IDs"}),e.jsx(c,{id:"suggest-task-ids",value:C,onChange:t=>K(t.target.value),placeholder:"e.g. 9, 14"})]}),s==="metric"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(d,{children:"Intended leaderboard"}),e.jsxs("select",{className:"w-full rounded-md border bg-background p-2",value:J,onChange:t=>W(t.target.value),children:[e.jsx("option",{value:"higher_is_better",children:"Higher is better"}),e.jsx("option",{value:"lower_is_better",children:"Lower is better"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(c,{type:"number",min:"1",value:E,onChange:t=>Y(t.target.value),placeholder:"Task ID"}),e.jsx(c,{type:"number",min:"1",value:P,onChange:t=>z(t.target.value),placeholder:"Benchmark ID"})]})]}),Z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{children:"Image (optional)"}),e.jsx("input",{ref:b,className:"sr-only",type:"file",accept:re.join(","),onChange:t=>{var r;return ee((r=t.target.files)==null?void 0:r[0])}}),x?e.jsxs("div",{className:"relative overflow-hidden rounded-md border border-border bg-muted/30",children:[e.jsx("img",{src:x.data_url,alt:"Selected suggestion",className:"max-h-48 w-full object-contain"}),e.jsxs(M,{type:"button",variant:"secondary",size:"sm",className:"absolute right-2 top-2 h-8 px-2",onClick:()=>{w(null),b.current&&(b.current.value="")},children:[e.jsx(be,{className:"mr-1 h-4 w-4"}),"Remove"]}),e.jsx("div",{className:"truncate border-t border-border px-3 py-2 text-xs text-muted-foreground",children:x.file_name})]}):e.jsxs("button",{type:"button",className:"flex w-full flex-col items-center justify-center rounded-md border border-dashed border-border px-4 py-6 text-center text-sm text-muted-foreground transition-colors hover:border-foreground/50 hover:text-foreground",onClick:()=>{var t;return(t=b.current)==null?void 0:t.click()},onDragOver:t=>t.preventDefault(),onDrop:ge,children:[e.jsx(_e,{className:"mb-2 h-6 w-6"}),e.jsx("span",{children:"Drop an image here, or click to choose one"}),e.jsx("span",{className:"mt-1 text-xs",children:"JPEG, PNG, WebP, or GIF · max 2 MB"})]}),q&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:q})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-image-source",children:"Image source (optional)"}),e.jsx(c,{id:"suggest-image-source",value:I,maxLength:ae,placeholder:"Creator, publication, or source URL",onChange:t=>U(t.target.value)})]}),s==="method"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-method-source",children:"Source URL (optional)"}),e.jsx(c,{id:"suggest-method-source",value:j,maxLength:ae,placeholder:"https://arxiv.org/abs/...",onChange:t=>O(t.target.value)})]})]}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-year",children:"Edition year"}),e.jsx(c,{id:"suggest-year",type:"number",min:"1900",max:"2200",value:h,placeholder:"2026",onChange:t=>L(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(d,{htmlFor:"suggest-start-date",children:"Start date (optional)"}),e.jsx(c,{id:"suggest-start-date",type:"date",value:A,onChange:t=>F(t.target.value)})]}),e.jsxs("div",{children:[e.jsx(d,{htmlFor:"suggest-end-date",children:"End date (optional)"}),e.jsx(c,{id:"suggest-end-date",type:"date",value:R,onChange:t=>B(t.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-venue",children:"Venue (optional)"}),e.jsx(c,{id:"suggest-venue",value:T,maxLength:Ae,placeholder:"e.g. Vancouver Convention Centre, Canada",onChange:t=>G(t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"suggest-url",children:"URL (optional)"}),e.jsx(c,{id:"suggest-url",type:"url",inputMode:"url",value:N,maxLength:Fe,placeholder:"https://example.org/conference",onChange:t=>H(t.target.value)})]})]})]}),e.jsxs(Ie,{children:[e.jsx(M,{variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(M,{onClick:()=>k.mutate(),disabled:k.isPending||!he,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-4 h-4 mr-2 animate-spin"}),"Submitting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ye,{className:"w-4 h-4 mr-2"}),"Submit suggestion"]})})]})]})})}function ze({open:n,onOpenChange:i,sectionLabel:o,returnTo:s,taxonomySuggestion:u=!1}){return e.jsx(ie,{open:n,onOpenChange:i,children:e.jsxs(oe,{className:"max-w-md",children:[e.jsxs(le,{children:[e.jsxs(ce,{children:["Sign in to ",u?"suggest":"edit"," ",o]}),e.jsx(de,{children:u?"Sign in with your Hugging Face account so an admin can review your suggestion.":"Anyone can suggest edits to a paper page. Sign in with your Hugging Face account first so an admin can review your submission."})]}),e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx(Ne,{returnTo:s})})]})})}export{d as L,Ke as P,Ye as S,ze as a}; diff --git a/assets/StagingAccessRequestView-DQ08h6Ei.js b/assets/StagingAccessRequestView-DQ08h6Ei.js deleted file mode 100644 index d3f5ae888f8c290792ae32cd63805607c3a15ed9..0000000000000000000000000000000000000000 --- a/assets/StagingAccessRequestView-DQ08h6Ei.js +++ /dev/null @@ -1 +0,0 @@ -import{g,R as t,j as e,ab as p,e as j}from"./index-D9_nPZtO.js";import{C as x}from"./circle-check-I1TZu4fL.js";const b=()=>{const{user:s,isLoading:l}=g(),[o,d]=t.useState(!1),[c,i]=t.useState(!1),[n,u]=t.useState(null),h=async m=>{m.preventDefault(),i(!0),u(null);try{const a=await fetch(j("/api/v1/staging-access-request"),{method:"POST",credentials:"include"});if(!a.ok){const r=await a.json().catch(()=>null);throw new Error((r==null?void 0:r.detail)||"Could not submit your request. Please try again.")}d(!0)}catch(a){u(a instanceof Error?a.message:"Could not submit your request.")}finally{i(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),o?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(x,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),l?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:h,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),n&&e.jsx("p",{className:"access-request-error",role:"alert",children:n}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:c,children:c?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(p,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{b as default}; diff --git a/assets/StagingAccessRequestView-L0hui4Bi.js b/assets/StagingAccessRequestView-L0hui4Bi.js new file mode 100644 index 0000000000000000000000000000000000000000..9f51bd07b41c66c79d6978fb0c5c1044438aea7e --- /dev/null +++ b/assets/StagingAccessRequestView-L0hui4Bi.js @@ -0,0 +1 @@ +import{g,R as t,j as e,W as p,e as j}from"./index-Czt286FG.js";import{C as x}from"./circle-check-51xwSfKm.js";const b=()=>{const{user:s,isLoading:l}=g(),[o,d]=t.useState(!1),[c,i]=t.useState(!1),[n,u]=t.useState(null),h=async m=>{m.preventDefault(),i(!0),u(null);try{const a=await fetch(j("/api/v1/staging-access-request"),{method:"POST",credentials:"include"});if(!a.ok){const r=await a.json().catch(()=>null);throw new Error((r==null?void 0:r.detail)||"Could not submit your request. Please try again.")}d(!0)}catch(a){u(a instanceof Error?a.message:"Could not submit your request.")}finally{i(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),o?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(x,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),l?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:h,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),n&&e.jsx("p",{className:"access-request-error",role:"alert",children:n}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:c,children:c?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(p,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{b as default}; diff --git a/assets/SubmissionsDashboard-CnW0soci.js b/assets/SubmissionsDashboard-CnW0soci.js deleted file mode 100644 index b1d533beb82a4db95d580980f5ebe2eaddc6903c..0000000000000000000000000000000000000000 --- a/assets/SubmissionsDashboard-CnW0soci.js +++ /dev/null @@ -1,6 +0,0 @@ -var pe=s=>{throw TypeError(s)};var P=(s,t,i)=>t.has(s)||pe("Cannot "+i);var f=(s,t,i)=>(P(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?pe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),y=(s,t,i,n)=>(P(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),R=(s,t,i)=>(P(s,t,"access private method"),i);import{ay as Oe,az as se,aA as Me,aB as Fe,k as ke,r as T,aC as Ie,d as Qe,j as e,aD as Se,aE as qe,R as k,v as Q,aF as Le,a3 as Ue,g as De,h as Ee,aq as $e,aG as Te,aH as Be,aI as He,aJ as ze,aK as Je,aL as te}from"./index-D9_nPZtO.js";import{Q as Ce,b as Ke,c as Ge,e as We,d as Ye,f as Ve,s as ge,g as Xe,h as Ze,u as be}from"./useQuery-cycUreG-.js";import{u as xe}from"./useMutation-CJCfaNMQ.js";import{s as $}from"./safeExternalHref-CkBrsh84.js";import{R as Pe,S as es,C as ss}from"./shield-alert-CDv23c0X.js";import{L as H}from"./loader-circle-CrVj12oC.js";import{C as ts}from"./circle-check-I1TZu4fL.js";function je(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function is(s,t,i){const n=s.slice(0);return n[t]=i,n}var U,S,D,L,E,I,z,J,K,G,_,ie,ne,Re,re,ae,le,we,ns=(we=class extends Oe{constructor(t,i,n){super();C(this,_);C(this,U);C(this,S);C(this,D);C(this,L);C(this,E);C(this,I);C(this,z);C(this,J);C(this,K);C(this,G,[]);y(this,U,t),y(this,L,n),y(this,D,[]),y(this,E,[]),y(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{R(this,_,ae).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){y(this,D,t),y(this,L,i),se.batch(()=>{const n=f(this,E),r=R(this,_,re).call(this,f(this,D));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const l=r.map(a=>a.observer),c=l.map(a=>a.getCurrentResult()),u=n.length!==l.length,m=l.some((a,o)=>a!==n[o]),b=u||m,j=b?!0:c.some((a,o)=>{const d=f(this,S)[o];return!d||!Me(a,d)});!b&&!j||(b&&(y(this,G,r),y(this,E,l)),y(this,S,c),this.hasListeners()&&(b&&(je(n,l).forEach(a=>{a.destroy()}),je(l,n).forEach(a=>{a.subscribe(o=>{R(this,_,ae).call(this,a,o)})})),R(this,_,le).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const n=R(this,_,re).call(this,t),r=n.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),l=n.map(c=>c.defaultedQueryOptions.queryHash);return[r,c=>R(this,_,ne).call(this,c??r,i,l),()=>R(this,_,ie).call(this,r,n)]}},U=new WeakMap,S=new WeakMap,D=new WeakMap,L=new WeakMap,E=new WeakMap,I=new WeakMap,z=new WeakMap,J=new WeakMap,K=new WeakMap,G=new WeakMap,_=new WeakSet,ie=function(t,i){return i.map((n,r)=>{const l=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,c=>{i.forEach(u=>{u.observer.trackProp(c)})})})},ne=function(t,i,n){if(i){const r=f(this,K),l=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((c,u)=>c!==r[u]));return(!f(this,I)||f(this,S)!==f(this,J)||l||i!==f(this,z))&&(y(this,z,i),y(this,J,f(this,S)),n!==void 0&&y(this,K,n),y(this,I,Fe(f(this,I),i(t)))),f(this,I)}return t},Re=function(){var t;return((t=f(this,L))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,n)=>{var r;return i.options.suspense&&((r=f(this,S)[n])==null?void 0:r.data)===void 0})},re=function(t){const i=new Map;f(this,E).forEach(r=>{const l=r.options.queryHash;if(!l)return;const c=i.get(l);c?c.push(r):i.set(l,[r])});const n=[];return t.forEach(r=>{var m;const l=f(this,U).defaultQueryOptions(r),u=((m=i.get(l.queryHash))==null?void 0:m.shift())??new Ce(f(this,U),l);n.push({defaultedQueryOptions:l,observer:u})}),n},ae=function(t,i){const n=f(this,E).indexOf(t);n!==-1&&(y(this,S,is(f(this,S),n,i)),R(this,_,le).call(this))},le=function(){var t;if(this.hasListeners()){const i=R(this,_,ie).call(this,f(this,S),f(this,G)),n=R(this,_,Re).call(this),r=f(this,I),l=n?r:R(this,_,ne).call(this,i,(t=f(this,L))==null?void 0:t.combine);(n||r!==l)&&se.batch(()=>{this.listeners.forEach(c=>{c(f(this,S))})})}},we);function X({queries:s,...t},i){const n=ke(),r=Ke(),l=Ge(),c=T.useMemo(()=>s.map(h=>{const w=n.defaultQueryOptions(h);return w._optimisticResults=r?"isRestoring":"optimistic",w}),[s,n,r]);c.forEach(h=>{We(h);const w=n.getQueryCache().get(h.queryHash);Ye(h,l,w)}),Ve(l);const[u]=T.useState(()=>new ns(n,c,t)),[m,b,j]=u.getOptimisticResult(c,t.combine),a=!r&&t.subscribed!==!1;T.useSyncExternalStore(T.useCallback(h=>a?u.subscribe(se.batchCalls(h)):Ie,[u,a]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),T.useEffect(()=>{u.setQueries(c,t)},[c,t,u]);const d=m.some((h,w)=>ge(c[w],h))?m.flatMap((h,w)=>{const x=c[w];if(x&&ge(x,h)){const q=new Ce(n,x);return Xe(x,q,l)}return[]}):[];if(d.length>0)throw Promise.all(d);const p=m.find((h,w)=>{const x=c[w];return x&&Ze({result:h,errorResetBoundary:l,throwOnError:x.throwOnError,query:n.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(p!=null&&p.error)throw p.error;return b(j())}/** - * @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 rs=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:{},ve=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!==null):[],Ne=s=>Array.isArray(s)?s.map(Number).filter(t=>Number.isFinite(t)):[],Y=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):[],as=s=>Array.isArray(s)?s.map(t=>M(t)):[],ls=s=>Array.isArray(s)?s.map(t=>M(t)):[],cs=s=>s.replace(/_/g," ");function os({currentPayload:s,proposedPayload:t}){const[i,n]=k.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(ce,{title:"Current payload",value:s??{}}),e.jsx(ce,{title:"Proposed payload",value:t})]})]})}function ce({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 _e({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n}){const r=k.useMemo(()=>Array.from(new Set([...s.map(o=>o.id),...t])).sort((o,d)=>o-d),[s,t]),l=X({queries:r.map(o=>({queryKey:[i,String(o)],queryFn:()=>n(String(o)),staleTime:5*60*1e3}))}),c=k.useMemo(()=>{const o=new Map;return s.forEach(d=>o.set(d.id,d.name)),l.forEach(d=>{const p=d.data;if(!p)return;const h=Number(p.id);Number.isFinite(h)&&o.set(h,p.name)}),o},[s,l]),u=new Set(s.map(o=>o.id)),m=new Set(t),b=r.filter(o=>u.has(o)&&!m.has(o)),j=r.filter(o=>!u.has(o)&&m.has(o)),a=(o,d)=>{const p=d==="current"&&b.includes(o),h=d==="proposed"&&j.includes(o);return e.jsx("span",{className:Q("submission-diff-pill",p&&"removed",h&&"added"),children:c.get(o)??`#${o}`},o)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:"Currently tagged",children:s.length>0?s.map(o=>a(o.id,"current")):e.jsx(N,{children:"No current tags"})}),e.jsx(v,{title:"Will be tagged",children:t.length>0?t.map(o=>a(o,"proposed")):e.jsx(N,{children:"No proposed tags"})})]})}function oe({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(c=>[c.url,c])),r=new Map(i.map(c=>[c.url,c])),l=Array.from(new Set([...n.keys(),...r.keys()])).sort();return l.length===0?e.jsxs(N,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:l.map(c=>{var o;const u=n.get(c),m=r.get(c),b=!u&&m,j=u&&!m,a=u&&m&&u.is_official!==m.is_official;return e.jsx("div",{className:Q("submission-url-row",b&&"added",j&&"removed",a&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:$(c)??void 0,target:"_blank",rel:"noopener noreferrer",className:Q("submission-url-link",j&&"removed"),children:c}),b&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),j&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),a&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(u.is_official)," ","->"," ",String(m.is_official)]}),((o=m??u)==null?void 0:o.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},c)})})}function ds({currentPayload:s,proposedPayload:t}){const i=as(M(s).evaluations),n=ls(t.operations),r=k.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.task_id&&a.add(Number(o.task_id))}),n.forEach(o=>{const d=o.data;d!=null&&d.task_id&&a.add(Number(d.task_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),l=k.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.dataset_id&&a.add(Number(o.dataset_id))}),n.forEach(o=>{const d=o.data;d!=null&&d.dataset_id&&a.add(Number(d.dataset_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),c=X({queries:r.map(a=>({queryKey:["task",String(a)],queryFn:()=>Se(String(a)),staleTime:5*60*1e3}))}),u=X({queries:l.map(a=>({queryKey:["dataset",String(a)],queryFn:()=>Le(String(a)),staleTime:5*60*1e3}))}),m=k.useMemo(()=>{const a=new Map;return c.forEach(o=>{const d=o.data;if(!d)return;const p=Number(d.id);Number.isFinite(p)&&a.set(p,d.name)}),a},[c]),b=k.useMemo(()=>{const a=new Map;return u.forEach(o=>{const d=o.data;if(!d)return;const p=Number(d.id);Number.isFinite(p)&&a.set(p,d.name)}),a},[u]),j=new Map(i.filter(a=>a.id!=null).map(a=>[Number(a.id),a]));return n.length===0?e.jsx(N,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((a,o)=>{const d=a.evaluation_id?j.get(a.evaluation_id):void 0,h=(a.op==="update"?{...d,...a.data}:a.data??d)??{};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(us,{evaluation:h,taskNames:m,datasetNames:b}):e.jsx(ce,{title:"Unsupported operation",value:a})]},`${a.op}-${a.evaluation_id??o}`)})})}function us({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,l=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(l).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(l).map(([c,u])=>e.jsxs("span",{className:"submission-metric-pill",children:[c,": ",String(u)]},c))}):e.jsx(N,{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 ms({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(v,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:$(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(N,{children:"No current URL"})}),e.jsx(v,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:$(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(N,{children:"No proposed URL"})})]})}function hs({proposedPayload:s}){const t=typeof s.title=="string"?s.title:"",i=typeof s.source_url=="string"?s.source_url:"",n=typeof s.abstract=="string"?s.abstract:"",r=typeof s.date_published=="string"?s.date_published:"",l=Array.isArray(s.authors)?s.authors.filter(c=>typeof c=="string"):[];return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(N,{children:"No title provided"})}),e.jsx(v,{title:"Publication date",children:r||e.jsx(N,{children:"No publication date provided"})}),e.jsx(v,{title:"Authors",children:l.length>0?l.map((c,u)=>e.jsx("span",{className:"submission-diff-pill added",children:c},`${c}-${u}`)):e.jsx(N,{children:"No authors provided"})}),e.jsx(v,{title:"Source URL",children:i?e.jsx("a",{className:"submission-url-link",href:$(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(N,{children:"No source URL provided"})}),e.jsx(v,{title:"Abstract",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(N,{children:"No abstract provided"})})]})}function B({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",r=typeof t.year=="number"?t.year:null,l=typeof t.start_date=="string"?t.start_date:"",c=typeof t.end_date=="string"?t.end_date:"",u=typeof t.venue=="string"?t.venue:"",m=typeof t.url=="string"?t.url:"",b=M(t.image),j=typeof b.data_url=="string"&&b.data_url.startsWith("data:image/")?b.data_url:"",a=typeof b.url=="string"?Ue(b.url)??"":j,o=typeof b.file_name=="string"?b.file_name:"Suggested image",d=typeof t.image_credit=="string"?t.image_credit:"",p=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(N,{children:"No name provided"})}),e.jsx(v,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(N,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{title:"Image",children:a?e.jsx("img",{src:a,alt:o,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(N,{children:"No image provided"})}),e.jsx(v,{title:"Image source",children:d||e.jsx(N,{children:"No image source provided"})})]}),s==="task"&&e.jsx(v,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(v,{title:"Intended task IDs",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(v,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(v,{title:"Source",children:p?p.startsWith("http://")||p.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:$(p)??void 0,target:"_blank",rel:"noopener noreferrer",children:p}):e.jsx("span",{className:"submission-field-value",children:p}):e.jsx(N,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(v,{title:"Edition and dates",children:r?`${r}${l?` · ${l}${c?` – ${c}`:""}`:""}`:e.jsx(N,{children:"No edition provided"})}),e.jsx(v,{title:"Venue",children:u||e.jsx(N,{children:"No venue provided"})}),e.jsx(v,{title:"URL",children:m?e.jsx("a",{className:"submission-url-link",href:$(m)??void 0,target:"_blank",rel:"noopener noreferrer",children:m}):e.jsx(N,{children:"No URL provided"})})]})]})}function v({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 N({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function fs({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:l})=>{const c=Array.isArray(i[r])?i[r].filter(m=>typeof m=="string"):[],u=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:l}),e.jsx(oe,{label:l.toLowerCase(),currentItems:c.map(m=>({url:m,is_official:!1})),proposedItems:u.map(m=>({url:m,is_official:!1}))})]},r)})})}function ps({editType:s,currentPayload:t,proposedPayload:i}){const n=M(t);let r;return s==="tasks"?r=e.jsx(_e,{currentItems:ve(n.tasks),proposedIds:Ne(i.task_ids),queryPrefix:"task",fetchEntity:Se}):s==="methods"?r=e.jsx(_e,{currentItems:ve(n.methods),proposedIds:Ne(i.method_ids),queryPrefix:"method",fetchEntity:qe}):s==="repositories"?r=e.jsx(oe,{label:"repositories",currentItems:Y(n.repositories),proposedItems:Y(i.repositories)}):s==="project_pages"?r=e.jsx(oe,{label:"project pages",currentItems:Y(n.project_pages),proposedItems:Y(i.project_pages)}):s==="evaluations"?r=e.jsx(ds,{currentPayload:t,proposedPayload:i}):s==="source_url"?r=e.jsx(ms,{currentPayload:t,proposedPayload:i}):s==="hf_artifacts"?r=e.jsx(fs,{currentPayload:t,proposedPayload:i}):s==="new_task"?r=e.jsx(B,{kind:"task",proposedPayload:i}):s==="new_method"?r=e.jsx(B,{kind:"method",proposedPayload:i}):s==="new_benchmark"?r=e.jsx(B,{kind:"benchmark",proposedPayload:i}):s==="new_metric"?r=e.jsx(B,{kind:"metric",proposedPayload:i}):s==="new_conference"?r=e.jsx(B,{kind:"conference",proposedPayload:i}):s==="new_external_paper"?r=e.jsx(hs,{proposedPayload:i}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",cs(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(os,{currentPayload:t,proposedPayload:i})]})}const ee=25,gs=["pending","approved","rejected","all"],bs=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference","new_external_paper"],de=["pending","approved","rejected"];function xs(s){return s.slice(0,2).toUpperCase()}function V(s){return s.replace(/_/g," ")}function js(s){return s==="new_external_paper"?"external paper":V(s)}const vs={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};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),l=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:r<24?`${r}h ago`:l<14?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function ue(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 Ns(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function _s(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function ys(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function ws(s,t,i){const n=t==="all"?void 0:t;if(s!=="all")return te({status:s,edit_type:n,limit:i,offset:0});const r=await Promise.all(de.map(l=>te({status:l,edit_type:n,limit:i,offset:0})));return{count:r.reduce((l,c)=>l+c.count,0),results:ys(r.flatMap(l=>l.results)).slice(0,i)}}function ks(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-empty submission-empty-warn",children:[e.jsx(es,{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 Ss(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function Es({submission:s,paper:t}){const i=ke(),{toast:n}=Ee(),r=s.paper_id,l=r===null,c=vs[s.edit_type]??{title:"Taxonomy directory",subtitle:"Directory suggestion"},u=l?null:_s(t,r),m=l?c.title:(t==null?void 0:t.title)||`Paper #${r}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,j=s.status==="pending",a=k.useCallback(x=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",x.id]}),x.paper_id!=null&&(i.invalidateQueries({queryKey:["paper",String(x.paper_id)]}),i.invalidateQueries({queryKey:["paper-summary",String(x.paper_id)]})),t!=null&&t.arxiv_id&&i.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),x.edit_type==="evaluations"&&x.paper_id!=null&&i.invalidateQueries({queryKey:["evaluations","paper",String(x.paper_id)]})},[t==null?void 0:t.arxiv_id,i]),o=xe({mutationFn:()=>ze(s.id),onSuccess:x=>{a(x),n({title:"Submission approved",description:`Applied ${V(s.edit_type)} changes for ${m}.`})},onError:x=>{n({title:"Could not approve submission",description:ue(x,"Approval failed. Please try again."),variant:"destructive"})}}),d=xe({mutationFn:()=>Je(s.id),onSuccess:x=>{a(x),n({title:"Submission rejected",description:`Rejected ${V(s.edit_type)} changes for ${m}.`})},onError:x=>{n({title:"Could not reject submission",description:ue(x,"Rejection failed. Please try again."),variant:"destructive"})}}),p=o.isPending,h=d.isPending,w=p||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:[u?e.jsx("a",{href:`/paper/${encodeURIComponent(u)}`,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?c.subtitle:`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",Ns(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(Te,{className:"h-6 w-6",children:[e.jsx(Be,{src:b,alt:s.hf_username}),e.jsx(He,{className:"text-[10px]",children:xs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(ps,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),s.review_evidence&&e.jsxs("details",{className:"submission-diff",open:!0,children:[e.jsx("summary",{children:"Codex review artifact"}),e.jsx("pre",{children:JSON.stringify(s.review_evidence,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:j?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>d.mutate(),disabled:w,className:"submission-action-btn reject",children:[h?e.jsx(H,{className:"spin",size:14}):e.jsx(ss,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>o.mutate(),disabled:w,className:"submission-action-btn approve",children:[p?e.jsx(H,{className:"spin",size:14}):e.jsx(ts,{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})]}),s.user_review_reason&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function qs(){var me,he,fe;const{user:s,isLoading:t}=De(),{toast:i}=Ee(),[n,r]=k.useState("pending"),[l,c]=k.useState("all"),[u,m]=k.useState(ee),b=!!(s!=null&&s.is_admin);k.useEffect(()=>{m(ee)},[n,l]);const j=be({queryKey:["pendingPaperEdits","counts",l],queryFn:async()=>{const g=l==="all"?void 0:l,A=await Promise.all(de.map(O=>te({status:O,edit_type:g,limit:1,offset:0})));return Object.fromEntries(A.map((O,W)=>[de[W],O.count]))},enabled:b,staleTime:30*1e3}),a=be({queryKey:["pendingPaperEdits",{status:n,editType:l,visibleLimit:u}],queryFn:()=>ws(n,l,u),enabled:b,retry:!1}),o=k.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)},[(me=a.data)==null?void 0:me.results]),d=X({queries:o.map(g=>({queryKey:["paper-summary",String(g)],queryFn:()=>$e(String(g),!1),enabled:b,staleTime:5*60*1e3}))}),p=k.useMemo(()=>{const g=new Map;return d.forEach(A=>{const O=A.data;if(!O)return;const W=Number(O.id);Number.isFinite(W)&&g.set(W,O)}),g},[d]);if(k.useEffect(()=>{a.error&&i({title:"Could not load submissions",description:ue(a.error,"Failed to load pending paper edits."),variant:"destructive"})},[a.error,i]),t)return e.jsx(Ss,{});if(!b)return e.jsx(ks,{});const h=j.data,w=h?h.pending+h.approved+h.rejected:void 0,x={pending:h==null?void 0:h.pending,approved:h==null?void 0:h.approved,rejected:h==null?void 0:h.rejected,all:w},q=((he=a.data)==null?void 0:he.results)??[],Z=((fe=a.data)==null?void 0:fe.count)??0,Ae=q.length{j.refetch(),a.refetch()},disabled:a.isFetching||j.isFetching,children:[e.jsx(Pe,{className:Q((a.isFetching||j.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:gs.map(g=>e.jsxs("button",{type:"button",className:Q("period-btn",n===g&&"active"),onClick:()=>r(g),children:[g,x[g]!=null&&e.jsx("span",{className:"submission-count",children:x[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:bs.map(g=>e.jsx("button",{type:"button",className:Q("sort-btn",l===g&&"active"),onClick:()=>c(g),children:js(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":`${Z} submissions`})})})}),a.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(H,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):q.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(rs,{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:q.map(g=>e.jsx(Es,{submission:g,paper:g.paper_id==null?void 0:p.get(g.paper_id)},g.id))}),q.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",q.length," of ",Z," submissions"]}),Ae&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(g=>g+ee),disabled:a.isFetching,children:[a.isFetching&&e.jsx(H,{className:"spin",size:14}),"Load more"]})]})]})]})}export{qs as default}; diff --git a/assets/SubmissionsDashboard-DSsa3EV4.js b/assets/SubmissionsDashboard-DSsa3EV4.js new file mode 100644 index 0000000000000000000000000000000000000000..979a6788f68e211ace8b8142b76592f952dbbe92 --- /dev/null +++ b/assets/SubmissionsDashboard-DSsa3EV4.js @@ -0,0 +1,6 @@ +var ge=s=>{throw TypeError(s)};var se=(s,t,i)=>t.has(s)||ge("Cannot "+i);var f=(s,t,i)=>(se(s,t,"read from private field"),i?i.call(s):t.get(s)),R=(s,t,i)=>t.has(s)?ge("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),y=(s,t,i,n)=>(se(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),C=(s,t,i)=>(se(s,t,"access private method"),i);import{ai as Oe,aj as ie,ak as Me,al as Fe,k as Se,r as B,am as Ie,d as Qe,j as e,R as w,v as Q,M as qe,g as Le,h as Ee,p as Ue,an as De,ao as $e,ap as Te}from"./index-Czt286FG.js";import{Q as Re,b as Be,c as He,e as ze,d as Je,f as Ke,s as be,g as Ge,h as We,u as je}from"./useQuery-DLzEukS9.js";import{u as xe}from"./useMutation-DqQi_NTN.js";import{c as U}from"./catalog-BRyB71ZU.js";import{s as T}from"./safeExternalHref-CkBrsh84.js";import{s as z}from"./submissions-BsEO_Bbg.js";import{R as Ye,S as Ve,C as Xe}from"./shield-alert-CXix4gJs.js";import{L as J}from"./loader-circle-DyZRZBrM.js";import{C as Ze}from"./circle-check-51xwSfKm.js";function ve(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function Pe(s,t,i){const n=s.slice(0);return n[t]=i,n}var D,S,$,L,E,I,K,G,W,Y,_,ne,re,Ce,ae,le,ce,we,es=(we=class extends Oe{constructor(t,i,n){super();R(this,_);R(this,D);R(this,S);R(this,$);R(this,L);R(this,E);R(this,I);R(this,K);R(this,G);R(this,W);R(this,Y,[]);y(this,D,t),y(this,L,n),y(this,$,[]),y(this,E,[]),y(this,S,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&f(this,E).forEach(t=>{t.subscribe(i=>{C(this,_,le).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,f(this,E).forEach(t=>{t.destroy()})}setQueries(t,i){y(this,$,t),y(this,L,i),ie.batch(()=>{const n=f(this,E),r=C(this,_,ae).call(this,f(this,$));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const l=r.map(a=>a.observer),c=l.map(a=>a.getCurrentResult()),u=n.length!==l.length,m=l.some((a,o)=>a!==n[o]),b=u||m,x=b?!0:c.some((a,o)=>{const d=f(this,S)[o];return!d||!Me(a,d)});!b&&!x||(b&&(y(this,Y,r),y(this,E,l)),y(this,S,c),this.hasListeners()&&(b&&(ve(n,l).forEach(a=>{a.destroy()}),ve(l,n).forEach(a=>{a.subscribe(o=>{C(this,_,le).call(this,a,o)})})),C(this,_,ce).call(this)))})}getCurrentResult(){return f(this,S)}getQueries(){return f(this,E).map(t=>t.getCurrentQuery())}getObservers(){return f(this,E)}getOptimisticResult(t,i){const n=C(this,_,ae).call(this,t),r=n.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),l=n.map(c=>c.defaultedQueryOptions.queryHash);return[r,c=>C(this,_,re).call(this,c??r,i,l),()=>C(this,_,ne).call(this,r,n)]}},D=new WeakMap,S=new WeakMap,$=new WeakMap,L=new WeakMap,E=new WeakMap,I=new WeakMap,K=new WeakMap,G=new WeakMap,W=new WeakMap,Y=new WeakMap,_=new WeakSet,ne=function(t,i){return i.map((n,r)=>{const l=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,c=>{i.forEach(u=>{u.observer.trackProp(c)})})})},re=function(t,i,n){if(i){const r=f(this,W),l=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((c,u)=>c!==r[u]));return(!f(this,I)||f(this,S)!==f(this,G)||l||i!==f(this,K))&&(y(this,K,i),y(this,G,f(this,S)),n!==void 0&&y(this,W,n),y(this,I,Fe(f(this,I),i(t)))),f(this,I)}return t},Ce=function(){var t;return((t=f(this,L))==null?void 0:t.combine)!==void 0&&f(this,E).some((i,n)=>{var r;return i.options.suspense&&((r=f(this,S)[n])==null?void 0:r.data)===void 0})},ae=function(t){const i=new Map;f(this,E).forEach(r=>{const l=r.options.queryHash;if(!l)return;const c=i.get(l);c?c.push(r):i.set(l,[r])});const n=[];return t.forEach(r=>{var m;const l=f(this,D).defaultQueryOptions(r),u=((m=i.get(l.queryHash))==null?void 0:m.shift())??new Re(f(this,D),l);n.push({defaultedQueryOptions:l,observer:u})}),n},le=function(t,i){const n=f(this,E).indexOf(t);n!==-1&&(y(this,S,Pe(f(this,S),n,i)),C(this,_,ce).call(this))},ce=function(){var t;if(this.hasListeners()){const i=C(this,_,ne).call(this,f(this,S),f(this,Y)),n=C(this,_,Ce).call(this),r=f(this,I),l=n?r:C(this,_,re).call(this,i,(t=f(this,L))==null?void 0:t.combine);(n||r!==l)&&ie.batch(()=>{this.listeners.forEach(c=>{c(f(this,S))})})}},we);function P({queries:s,...t},i){const n=Se(),r=Be(),l=He(),c=B.useMemo(()=>s.map(h=>{const k=n.defaultQueryOptions(h);return k._optimisticResults=r?"isRestoring":"optimistic",k}),[s,n,r]);c.forEach(h=>{ze(h);const k=n.getQueryCache().get(h.queryHash);Je(h,l,k)}),Ke(l);const[u]=B.useState(()=>new es(n,c,t)),[m,b,x]=u.getOptimisticResult(c,t.combine),a=!r&&t.subscribed!==!1;B.useSyncExternalStore(B.useCallback(h=>a?u.subscribe(ie.batchCalls(h)):Ie,[u,a]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),B.useEffect(()=>{u.setQueries(c,t)},[c,t,u]);const d=m.some((h,k)=>be(c[k],h))?m.flatMap((h,k)=>{const j=c[k];if(j&&be(j,h)){const q=new Re(n,j);return Ge(j,q,l)}return[]}):[];if(d.length>0)throw Promise.all(d);const p=m.find((h,k)=>{const j=c[k];return j&&We({result:h,errorResetBoundary:l,throwOnError:j.throwOnError,query:n.getQueryCache().get(j.queryHash),suspense:j.suspense})});if(p!=null&&p.error)throw p.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 ss=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:{},Ne=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!==null):[],_e=s=>Array.isArray(s)?s.map(Number).filter(t=>Number.isFinite(t)):[],X=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):[],ts=s=>Array.isArray(s)?s.map(t=>M(t)):[],is=s=>Array.isArray(s)?s.map(t=>M(t)):[],ns=s=>s.replace(/_/g," ");function rs({currentPayload:s,proposedPayload:t}){const[i,n]=w.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 ye({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n}){const r=w.useMemo(()=>Array.from(new Set([...s.map(o=>o.id),...t])).sort((o,d)=>o-d),[s,t]),l=P({queries:r.map(o=>({queryKey:[i,String(o)],queryFn:()=>n(String(o)),staleTime:5*60*1e3}))}),c=w.useMemo(()=>{const o=new Map;return s.forEach(d=>o.set(d.id,d.name)),l.forEach(d=>{const p=d.data;if(!p)return;const h=Number(p.id);Number.isFinite(h)&&o.set(h,p.name)}),o},[s,l]),u=new Set(s.map(o=>o.id)),m=new Set(t),b=r.filter(o=>u.has(o)&&!m.has(o)),x=r.filter(o=>!u.has(o)&&m.has(o)),a=(o,d)=>{const p=d==="current"&&b.includes(o),h=d==="proposed"&&x.includes(o);return e.jsx("span",{className:Q("submission-diff-pill",p&&"removed",h&&"added"),children:c.get(o)??`#${o}`},o)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:"Currently tagged",children:s.length>0?s.map(o=>a(o.id,"current")):e.jsx(N,{children:"No current tags"})}),e.jsx(v,{title:"Will be tagged",children:t.length>0?t.map(o=>a(o,"proposed")):e.jsx(N,{children:"No proposed tags"})})]})}function de({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(c=>[c.url,c])),r=new Map(i.map(c=>[c.url,c])),l=Array.from(new Set([...n.keys(),...r.keys()])).sort();return l.length===0?e.jsxs(N,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:l.map(c=>{var o;const u=n.get(c),m=r.get(c),b=!u&&m,x=u&&!m,a=u&&m&&u.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:T(c)??void 0,target:"_blank",rel:"noopener noreferrer",className:Q("submission-url-link",x&&"removed"),children:c}),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(u.is_official)," ","->"," ",String(m.is_official)]}),((o=m??u)==null?void 0:o.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},c)})})}function as({currentPayload:s,proposedPayload:t}){const i=ts(M(s).evaluations),n=is(t.operations),r=w.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.task_id&&a.add(Number(o.task_id))}),n.forEach(o=>{const d=o.data;d!=null&&d.task_id&&a.add(Number(d.task_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),l=w.useMemo(()=>{const a=new Set;return i.forEach(o=>{o.dataset_id&&a.add(Number(o.dataset_id))}),n.forEach(o=>{const d=o.data;d!=null&&d.dataset_id&&a.add(Number(d.dataset_id))}),Array.from(a).filter(o=>Number.isFinite(o))},[i,n]),c=P({queries:r.map(a=>({queryKey:["task",String(a)],queryFn:()=>U.getTask(String(a)),staleTime:5*60*1e3}))}),u=P({queries:l.map(a=>({queryKey:["dataset",String(a)],queryFn:()=>U.getDataset(String(a)),staleTime:5*60*1e3}))}),m=w.useMemo(()=>{const a=new Map;return c.forEach(o=>{const d=o.data;if(!d)return;const p=Number(d.id);Number.isFinite(p)&&a.set(p,d.name)}),a},[c]),b=w.useMemo(()=>{const a=new Map;return u.forEach(o=>{const d=o.data;if(!d)return;const p=Number(d.id);Number.isFinite(p)&&a.set(p,d.name)}),a},[u]),x=new Map(i.filter(a=>a.id!=null).map(a=>[Number(a.id),a]));return n.length===0?e.jsx(N,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((a,o)=>{const d=a.evaluation_id?x.get(a.evaluation_id):void 0,h=(a.op==="update"?{...d,...a.data}:a.data??d)??{};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(ls,{evaluation:h,taskNames:m,datasetNames:b}):e.jsx(oe,{title:"Unsupported operation",value:a})]},`${a.op}-${a.evaluation_id??o}`)})})}function ls({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,l=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(l).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(l).map(([c,u])=>e.jsxs("span",{className:"submission-metric-pill",children:[c,": ",String(u)]},c))}):e.jsx(N,{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 cs({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(v,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:T(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(N,{children:"No current URL"})}),e.jsx(v,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:T(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(N,{children:"No proposed URL"})})]})}function os({proposedPayload:s}){const t=typeof s.title=="string"?s.title:"",i=typeof s.source_url=="string"?s.source_url:"",n=typeof s.abstract=="string"?s.abstract:"",r=typeof s.date_published=="string"?s.date_published:"",l=Array.isArray(s.authors)?s.authors.filter(c=>typeof c=="string"):[];return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(N,{children:"No title provided"})}),e.jsx(v,{title:"Publication date",children:r||e.jsx(N,{children:"No publication date provided"})}),e.jsx(v,{title:"Authors",children:l.length>0?l.map((c,u)=>e.jsx("span",{className:"submission-diff-pill added",children:c},`${c}-${u}`)):e.jsx(N,{children:"No authors provided"})}),e.jsx(v,{title:"Source URL",children:i?e.jsx("a",{className:"submission-url-link",href:T(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(N,{children:"No source URL provided"})}),e.jsx(v,{title:"Abstract",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(N,{children:"No abstract provided"})})]})}function H({kind:s,proposedPayload:t}){const i=typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",r=typeof t.year=="number"?t.year:null,l=typeof t.start_date=="string"?t.start_date:"",c=typeof t.end_date=="string"?t.end_date:"",u=typeof t.venue=="string"?t.venue:"",m=typeof t.url=="string"?t.url:"",b=M(t.image),x=typeof b.data_url=="string"&&b.data_url.startsWith("data:image/")?b.data_url:"",a=typeof b.url=="string"?qe(b.url)??"":x,o=typeof b.file_name=="string"?b.file_name:"Suggested image",d=typeof t.image_credit=="string"?t.image_credit:"",p=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(v,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(N,{children:"No name provided"})}),e.jsx(v,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(N,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{title:"Image",children:a?e.jsx("img",{src:a,alt:o,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(N,{children:"No image provided"})}),e.jsx(v,{title:"Image source",children:d||e.jsx(N,{children:"No image source provided"})})]}),s==="task"&&e.jsx(v,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(v,{title:"Intended task IDs",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(v,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(v,{title:"Source",children:p?p.startsWith("http://")||p.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:T(p)??void 0,target:"_blank",rel:"noopener noreferrer",children:p}):e.jsx("span",{className:"submission-field-value",children:p}):e.jsx(N,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(v,{title:"Edition and dates",children:r?`${r}${l?` · ${l}${c?` – ${c}`:""}`:""}`:e.jsx(N,{children:"No edition provided"})}),e.jsx(v,{title:"Venue",children:u||e.jsx(N,{children:"No venue provided"})}),e.jsx(v,{title:"URL",children:m?e.jsx("a",{className:"submission-url-link",href:T(m)??void 0,target:"_blank",rel:"noopener noreferrer",children:m}):e.jsx(N,{children:"No URL provided"})})]})]})}function v({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 N({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ds({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:l})=>{const c=Array.isArray(i[r])?i[r].filter(m=>typeof m=="string"):[],u=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:l}),e.jsx(de,{label:l.toLowerCase(),currentItems:c.map(m=>({url:m,is_official:!1})),proposedItems:u.map(m=>({url:m,is_official:!1}))})]},r)})})}function us({editType:s,currentPayload:t,proposedPayload:i}){const n=M(t);let r;return s==="tasks"?r=e.jsx(ye,{currentItems:Ne(n.tasks),proposedIds:_e(i.task_ids),queryPrefix:"task",fetchEntity:U.getTask.bind(U)}):s==="methods"?r=e.jsx(ye,{currentItems:Ne(n.methods),proposedIds:_e(i.method_ids),queryPrefix:"method",fetchEntity:U.getMethod.bind(U)}):s==="repositories"?r=e.jsx(de,{label:"repositories",currentItems:X(n.repositories),proposedItems:X(i.repositories)}):s==="project_pages"?r=e.jsx(de,{label:"project pages",currentItems:X(n.project_pages),proposedItems:X(i.project_pages)}):s==="evaluations"?r=e.jsx(as,{currentPayload:t,proposedPayload:i}):s==="source_url"?r=e.jsx(cs,{currentPayload:t,proposedPayload:i}):s==="hf_artifacts"?r=e.jsx(ds,{currentPayload:t,proposedPayload:i}):s==="new_task"?r=e.jsx(H,{kind:"task",proposedPayload:i}):s==="new_method"?r=e.jsx(H,{kind:"method",proposedPayload:i}):s==="new_benchmark"?r=e.jsx(H,{kind:"benchmark",proposedPayload:i}):s==="new_metric"?r=e.jsx(H,{kind:"metric",proposedPayload:i}):s==="new_conference"?r=e.jsx(H,{kind:"conference",proposedPayload:i}):s==="new_external_paper"?r=e.jsx(os,{proposedPayload:i}):r=e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["No custom renderer exists yet for ",ns(s),"."]}),e.jsxs("div",{className:"submission-diff-body",children:[r,e.jsx(rs,{currentPayload:t,proposedPayload:i})]})}const te=25,ms=["pending","approved","rejected","all"],hs=["all","tasks","methods","evaluations","repositories","project_pages","source_url","new_task","new_method","new_benchmark","new_metric","new_conference","new_external_paper"],ue=["pending","approved","rejected"];function fs(s){return s.slice(0,2).toUpperCase()}function Z(s){return s.replace(/_/g," ")}function ps(s){return s==="new_external_paper"?"external paper":Z(s)}const gs={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function ke(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),l=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:r<24?`${r}h ago`:l<14?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function me(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 z.list({status:s,edit_type:n,limit:i,offset:0});const r=await Promise.all(ue.map(l=>z.list({status:l,edit_type:n,limit:i,offset:0})));return{count:r.reduce((l,c)=>l+c.count,0),results:xs(r.flatMap(l=>l.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(Ve,{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 _s(){return e.jsx("div",{className:"page",children:e.jsxs("div",{className:"submission-loading",children:[e.jsx(J,{className:"spin",size:18}),e.jsx("span",{children:"Checking admin session..."})]})})}function ys({submission:s,paper:t}){const i=Se(),{toast:n}=Ee(),r=s.paper_id,l=r===null,c=gs[s.edit_type]??{title:"Taxonomy directory",subtitle:"Directory suggestion"},u=l?null:js(t,r),m=l?c.title:(t==null?void 0:t.title)||`Paper #${r}`,b=`https://huggingface.co/${encodeURIComponent(s.hf_username)}/avatar`,x=s.status==="pending",a=w.useCallback(j=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",j.id]}),j.paper_id!=null&&(i.invalidateQueries({queryKey:["paper",String(j.paper_id)]}),i.invalidateQueries({queryKey:["paper-summary",String(j.paper_id)]})),t!=null&&t.arxiv_id&&i.invalidateQueries({queryKey:["paper-arxiv",t.arxiv_id]}),j.edit_type==="evaluations"&&j.paper_id!=null&&i.invalidateQueries({queryKey:["evaluations","paper",String(j.paper_id)]})},[t==null?void 0:t.arxiv_id,i]),o=xe({mutationFn:()=>z.approve(s.id),onSuccess:j=>{a(j),n({title:"Submission approved",description:`Applied ${Z(s.edit_type)} changes for ${m}.`})},onError:j=>{n({title:"Could not approve submission",description:me(j,"Approval failed. Please try again."),variant:"destructive"})}}),d=xe({mutationFn:()=>z.reject(s.id),onSuccess:j=>{a(j),n({title:"Submission rejected",description:`Rejected ${Z(s.edit_type)} changes for ${m}.`})},onError:j=>{n({title:"Could not reject submission",description:me(j,"Rejection failed. Please try again."),variant:"destructive"})}}),p=o.isPending,h=d.isPending,k=p||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:[u?e.jsx("a",{href:`/paper/${encodeURIComponent(u)}`,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?c.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:ke(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:Z(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(De,{className:"h-6 w-6",children:[e.jsx($e,{src:b,alt:s.hf_username}),e.jsx(Te,{className:"text-[10px]",children:fs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(us,{editType:s.edit_type,currentPayload:s.current_payload,proposedPayload:s.proposed_payload})}),s.conflict_payload&&e.jsxs("div",{className:"submission-empty submission-empty-warn",children:["Canonical state changed after this submission. Review the conflict before deciding.",e.jsx("pre",{children:JSON.stringify(s.conflict_payload,null,2)})]}),s.review_evidence&&e.jsxs("details",{className:"submission-diff",open:!0,children:[e.jsx("summary",{children:"Codex review artifact"}),e.jsx("pre",{children:JSON.stringify(s.review_evidence,null,2)})]}),e.jsx("footer",{className:"submission-actions",children:x?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>d.mutate(),disabled:k,className:"submission-action-btn reject",children:[h?e.jsx(J,{className:"spin",size:14}):e.jsx(Xe,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>o.mutate(),disabled:k,className:"submission-action-btn approve",children:[p?e.jsx(J,{className:"spin",size:14}):e.jsx(Ze,{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?` ${ke(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),s.user_review_reason&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:"Applied payload"}),e.jsx("pre",{children:JSON.stringify(s.applied_payload,null,2)})]}),s.result_entity_type&&e.jsxs("span",{children:["Created/applied: ",e.jsxs("strong",{children:[s.result_entity_type," #",s.result_entity_id]})]})]})})]})}function Is(){var he,fe,pe;const{user:s,isLoading:t}=Le(),{toast:i}=Ee(),[n,r]=w.useState("pending"),[l,c]=w.useState("all"),[u,m]=w.useState(te),b=!!(s!=null&&s.is_admin);w.useEffect(()=>{m(te)},[n,l]);const x=je({queryKey:["pendingPaperEdits","counts",l],queryFn:async()=>{const g=l==="all"?void 0:l,A=await Promise.all(ue.map(O=>z.list({status:O,edit_type:g,limit:1,offset:0})));return Object.fromEntries(A.map((O,V)=>[ue[V],O.count]))},enabled:b,staleTime:30*1e3}),a=je({queryKey:["pendingPaperEdits",{status:n,editType:l,visibleLimit:u}],queryFn:()=>vs(n,l,u),enabled:b,retry:!1}),o=w.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)},[(he=a.data)==null?void 0:he.results]),d=P({queries:o.map(g=>({queryKey:["paper-summary",String(g)],queryFn:()=>Ue.get(String(g),!1),enabled:b,staleTime:5*60*1e3}))}),p=w.useMemo(()=>{const g=new Map;return d.forEach(A=>{const O=A.data;if(!O)return;const V=Number(O.id);Number.isFinite(V)&&g.set(V,O)}),g},[d]);if(w.useEffect(()=>{a.error&&i({title:"Could not load submissions",description:me(a.error,"Failed to load pending paper edits."),variant:"destructive"})},[a.error,i]),t)return e.jsx(_s,{});if(!b)return e.jsx(Ns,{});const h=x.data,k=h?h.pending+h.approved+h.rejected:void 0,j={pending:h==null?void 0:h.pending,approved:h==null?void 0:h.approved,rejected:h==null?void 0:h.rejected,all:k},q=((fe=a.data)==null?void 0:fe.results)??[],ee=((pe=a.data)==null?void 0:pe.count)??0,Ae=q.length{x.refetch(),a.refetch()},disabled:a.isFetching||x.isFetching,children:[e.jsx(Ye,{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:ms.map(g=>e.jsxs("button",{type:"button",className:Q("period-btn",n===g&&"active"),onClick:()=>r(g),children:[g,j[g]!=null&&e.jsx("span",{className:"submission-count",children:j[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:hs.map(g=>e.jsx("button",{type:"button",className:Q("sort-btn",l===g&&"active"),onClick:()=>c(g),children:ps(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":`${ee} submissions`})})})}),a.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(J,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):q.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ss,{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:q.map(g=>e.jsx(ys,{submission:g,paper:g.paper_id==null?void 0:p.get(g.paper_id)},g.id))}),q.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",q.length," of ",ee," submissions"]}),Ae&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>m(g=>g+te),disabled:a.isFetching,children:[a.isFetching&&e.jsx(J,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Is as default}; diff --git a/assets/SubmitView-Dmd8F124.js b/assets/SubmitView-Dmd8F124.js deleted file mode 100644 index 6121c253fd15574f5509cbebe3151358fdd7f8a7..0000000000000000000000000000000000000000 --- a/assets/SubmitView-Dmd8F124.js +++ /dev/null @@ -1 +0,0 @@ -import{u as k,k as D,h as C,g as E,R as d,j as e,V as L,au as z}from"./index-D9_nPZtO.js";import{u as F}from"./useMutation-CJCfaNMQ.js";import{A as X,a as q}from"./alert-B0bcMmNw.js";import{B as _}from"./button-B859643f.js";import{I as g,T as N}from"./textarea-BVF3ykiv.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function R(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function V(n,i){const a=n.trim();if(R(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function B(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const W=()=>{const n=k(),i=D(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,h]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),h(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const m=R(l),A=m==="external",c=F({mutationFn:t=>z(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(B(t))}}),P=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const T=L("/api/v1/auth/hf/login");window.location.assign(`${T}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=V(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),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(g,{id:"submit-input",value:l,onChange:t=>p(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:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="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."})]}),A&&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(g,{id:"submit-title",value:u,onChange:t=>h(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(N,{id:"submit-abstract",value:f,onChange:t=>S(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(g,{id:"submit-authors",value:x,onChange:t=>j(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(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(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."})]})]}),I&&e.jsx(X,{variant:"destructive",children:e.jsx(q,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{W as default}; diff --git a/assets/SubmitView-Q9xo_vl0.js b/assets/SubmitView-Q9xo_vl0.js new file mode 100644 index 0000000000000000000000000000000000000000..f2cd343fa44c47e86d0851515082e393b33242d2 --- /dev/null +++ b/assets/SubmitView-Q9xo_vl0.js @@ -0,0 +1 @@ +import{u as P,k,h as C,g as E,R as d,j as e,D as L,p as z}from"./index-Czt286FG.js";import{u as F}from"./useMutation-DqQi_NTN.js";import{A as X,a as q}from"./alert-pIw6ZaYb.js";import{B as _}from"./button-vhqVRnBn.js";import{I as g,T as N}from"./textarea-Ov25LunA.js";const v="pwc:paper-submit-draft",U=/^\d{4}\.\d{4,5}(v\d+)?$/i,$=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,O=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function A(n){const i=n.trim();return i?U.test(i)||$.test(i)||O.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function B(n,i){const a=n.trim();if(A(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},l=i.title.trim();l&&(o.title=l);const p=i.abstract.trim();p&&(o.abstract=p);const u=i.authors.split(/[,\n]/).map(h=>h.trim()).filter(Boolean);return u.length>0&&(o.authors=u),i.datePublished&&(o.date_published=i.datePublished),o}function J(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const W=()=>{const n=P(),i=k(),{toast:a}=C(),{user:s,isLoading:o}=E(),[l,p]=d.useState(""),[u,h]=d.useState(""),[f,S]=d.useState(""),[x,j]=d.useState(""),[b,w]=d.useState(""),[I,y]=d.useState(null);d.useEffect(()=>{const t=sessionStorage.getItem(v);if(t){sessionStorage.removeItem(v);try{const r=JSON.parse(t);p(r.input??""),h(r.title??""),S(r.abstract??""),j(r.authors??""),w(r.datePublished??"")}catch{}}},[]);const m=A(l),R=m==="external",c=F({mutationFn:t=>z.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),c.reset();return}i.invalidateQueries({queryKey:["papers"],refetchType:"none"}),i.invalidateQueries({queryKey:["papers-infinite"],refetchType:"none"}),i.invalidateQueries({queryKey:["trending-papers"],refetchType:"none"});const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(J(t))}}),T=t=>{if(t.preventDefault(),y(null),m==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(v,JSON.stringify({input:l,title:u,abstract:f,authors:x,datePublished:b}));const D=L("/api/v1/auth/hf/login");window.location.assign(`${D}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=B(l,{title:u,abstract:f,authors:x,datePublished:b});c.mutate(r)};return e.jsxs("div",{className:"page",style:{maxWidth:720},children:[e.jsx("h1",{className:"detail-title",children:"Submit a paper"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:12,lineHeight:1.55},children:["Index an arXiv paper or propose a non-arXiv paper (blog post, technical report, model release page). External papers enter the submission queue and appear only after review."," ",e.jsx("a",{href:"/rate-limits",children:"Read the submission and rate-limit policy."})]}),e.jsxs("form",{onSubmit:T,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(g,{id:"submit-input",value:l,onChange:t=>p(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:m==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":m==="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."})]}),R&&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(g,{id:"submit-title",value:u,onChange:t=>h(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(N,{id:"submit-abstract",value:f,onChange:t=>S(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(g,{id:"submit-authors",value:x,onChange:t=>j(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(g,{id:"submit-date",type:"date",value:b,onChange:t=>w(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."})]})]}),I&&e.jsx(X,{variant:"destructive",children:e.jsx(q,{children:I})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(_,{type:"submit",disabled:c.isPending||o,children:o?"Checking sign-in…":c.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(_,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:c.isPending,children:"Cancel"})]})]})]})};export{W as default}; diff --git a/assets/TagBrowseView-M8ve0LOV.js b/assets/TagBrowseView-M8ve0LOV.js deleted file mode 100644 index 31c40d861d0dd633b7ed9dfaad443050ba9e16d3..0000000000000000000000000000000000000000 --- a/assets/TagBrowseView-M8ve0LOV.js +++ /dev/null @@ -1,11 +0,0 @@ -import{d as fe,r as h,o as Z,j as e,n as F,a6 as be,q as je,P as Je,t as _e,p as ve,a7 as Xe,R as _,a8 as es,O as ss,v as J,L as A,f as as,u as ts,a as ns,_ as rs,a3 as os,c as xe}from"./index-D9_nPZtO.js";import{u as ge}from"./useQuery-cycUreG-.js";import{P as cs,M as is}from"./components-DrTew0nD.js";import{B as ls}from"./BenchmarkTrendSparkline-CN-RBbNH.js";import{u as ds,P as ms}from"./useIntersectionObserver-CZXk9yc2.js";import{M as Q}from"./MarkdownText-skQuzg4e.js";import{t as ps,d as V}from"./transform-BObV5jzB.js";import{b as hs}from"./usePapers-B3J6SKWU.js";import{S as U}from"./skeleton-CQ2CM4l9.js";import{A as us,a as xs}from"./alert-B0bcMmNw.js";import{C as gs}from"./chevron-down-D6vo9F6c.js";import{G as fs}from"./github-DngRIean.js";import"./LatexTitle-BtRWGRIx.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-D3OkhqBL.js";import"./index-XzA0bTLC.js";import"./hover-card-DVeX2fQl.js";import"./useInfiniteQuery-CQNVzwuX.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 bs=fe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** - * @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 js=fe("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var K="Collapsible",[_s,Ne]=_e(K),[vs,X]=_s(K),ke=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:c,onOpenChange:l,...u}=a,[g,f]=Z({prop:r,defaultProp:i??!1,onChange:l,caller:K});return e.jsx(vs,{scope:n,disabled:c,contentId:be(),open:g,onOpenToggle:h.useCallback(()=>f(j=>!j),[f]),children:e.jsx(F.div,{"data-state":se(g),"data-disabled":c?"":void 0,...u,ref:o})})});ke.displayName=K;var we="CollapsibleTrigger",Ce=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,...r}=a,i=X(we,n);return e.jsx(F.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:o,onClick:je(a.onClick,i.onOpenToggle)})});Ce.displayName=we;var ee="CollapsibleContent",ye=h.forwardRef((a,o)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Je,{present:n||i.open,children:({present:c})=>e.jsx(Ns,{...r,ref:o,present:c})})});ye.displayName=ee;var Ns=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,present:r,children:i,...c}=a,l=X(ee,n),[u,g]=h.useState(r),f=h.useRef(null),j=ve(o,f),v=h.useRef(0),R=v.current,S=h.useRef(0),T=S.current,k=l.open||u,N=h.useRef(k),p=h.useRef(void 0);return h.useEffect(()=>{const m=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(m)},[]),Xe(()=>{const m=f.current;if(m){p.current=p.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";const w=m.getBoundingClientRect();v.current=w.height,S.current=w.width,N.current||(m.style.transitionDuration=p.current.transitionDuration,m.style.animationName=p.current.animationName),g(r)}},[l.open,r]),e.jsx(F.div,{"data-state":se(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!k,...c,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var ks=ke,ws=Ce,Cs=ye,C="Accordion",ys=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,As,Ss]=es(C),[z]=_e(C,[Ss,Ne]),te=Ne(),Ae=_.forwardRef((a,o)=>{const{type:n,...r}=a,i=r,c=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Es,{...c,ref:o}):e.jsx(Is,{...i,ref:o})})});Ae.displayName=C;var[Se,Ps]=z(C),[Pe,Rs]=z(C,{collapsible:!1}),Is=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:c=!1,...l}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:C});return e.jsx(Se,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>c&&g(""),[c,g]),children:e.jsx(Pe,{scope:a.__scopeAccordion,collapsible:c,children:e.jsx(Re,{...l,ref:o})})})}),Es=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...c}=a,[l,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:C}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),f=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Se,{scope:a.__scopeAccordion,value:l,onItemOpen:g,onItemClose:f,children:e.jsx(Pe,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Re,{...c,ref:o})})})}),[Ts,G]=z(C),Re=_.forwardRef((a,o)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:c="vertical",...l}=a,u=_.useRef(null),g=ve(u,o),f=As(n),v=ss(i)==="ltr",R=je(a.onKeyDown,S=>{var B;if(!ys.includes(S.key))return;const T=S.target,k=f().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),p=k.length;if(N===-1)return;S.preventDefault();let m=N;const w=0,I=p-1,b=()=>{m=N+1,m>I&&(m=w)},E=()=>{m=N-1,m{const{__scopeAccordion:n,value:r,...i}=a,c=G(q,n),l=Ps(q,n),u=te(n),g=be(),f=r&&l.value.includes(r)||!1,j=c.disabled||a.disabled;return e.jsx(Ms,{scope:n,open:f,disabled:j,triggerId:g,children:e.jsx(ks,{"data-orientation":c.orientation,"data-state":De(f),...u,...i,ref:o,disabled:j,open:f,onOpenChange:v=>{v?l.onItemOpen(r):l.onItemClose(r)}})})});Ie.displayName=q;var Ee="AccordionHeader",Te=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Ee,n);return e.jsx(F.h3,{"data-orientation":i.orientation,"data-state":De(c.open),"data-disabled":c.disabled?"":void 0,...r,ref:o})});Te.displayName=Ee;var Y="AccordionTrigger",Me=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Y,n),l=Rs(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(ws,{"aria-disabled":c.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:c.triggerId,...u,...r,ref:o})})});Me.displayName=Y;var $e="AccordionContent",Oe=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne($e,n),l=te(n);return e.jsx(Cs,{role:"region","aria-labelledby":c.triggerId,"data-orientation":i.orientation,...l,...r,ref:o,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Oe.displayName=$e;function De(a){return a?"open":"closed"}var $s=Ae,Os=Ie,Ds=Te,Fe=Me,Be=Oe;const Fs=$s,Le=h.forwardRef(({className:a,...o},n)=>e.jsx(Os,{ref:n,className:J("border-b",a),...o}));Le.displayName="AccordionItem";const He=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Ds,{className:"flex",children:e.jsxs(Fe,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[o,e.jsx(gs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));He.displayName=Fe.displayName;const Ve=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Be,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:o})}));Ve.displayName=Be.displayName;const Bs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Ls=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",W=3,Hs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Vs=({frameworks:a})=>a.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),a.map(o=>e.jsxs(A,{to:`/papers?framework=${encodeURIComponent(o.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:o.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Hs(o.num_stars)]})]},o.framework_id))]}),Us=a=>[...a].sort((o,n)=>{const r=o.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),la=()=>{var le,de,me,pe,he,ue;const{taskSlug:a}=as(),o=ts(),[n,r]=ns(),i=Ls(n.get("order_by")),c=n.get("has_code")==="true",l=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},f=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,S]=h.useState(()=>new Set),{preferences:T}=rs(),k=(s,t)=>{const d=s||"";return t?`/benchmark/${d}?task=${encodeURIComponent(t)}`:`/benchmark/${d}`},N=T.hide_closed_source_evals?!0:void 0,p=ge({queryKey:["task-page",a,N],queryFn:()=>xe.getTaskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3}),m=ge({queryKey:["task-benchmark-trends",a,N],queryFn:()=>xe.getTrendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),w=h.useMemo(()=>{var s;return Us(((s=p.data)==null?void 0:s.children)||[])},[p.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=p.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(d=>{s.set(d.subtask_id,d.benchmarks||[])}),s},[p.data]),b=hs({taskId:((de=(le=p.data)==null?void 0:le.task)==null?void 0:de.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:c,has_hf_artifacts:l,enabled:!!((pe=(me=p.data)==null?void 0:me.task)!=null&&pe.id)}),E=h.useMemo(()=>{var t;return(((t=b.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(ps)},[b.data]),D=h.useMemo(()=>{var t;const s={};return(t=b.data)==null||t.pages.forEach(d=>d.results.forEach(O=>(O.methods||[]).forEach(P=>{const y=P.slug||P.id;s[y]||(s[y]={id:P.id,name:P.name,slug:P.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((d,O)=>O.count-d.count).slice(0,8)},[b.data]),{targetRef:B,isIntersecting:M}=ds({rootMargin:"200px"});if(h.useEffect(()=>{M&&b.hasNextPage&&!b.isFetchingNextPage&&b.fetchNextPage()},[M,b.hasNextPage,b.isFetchingNextPage]),p.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-4"}),e.jsx(U,{className:"h-6 w-1/3 mb-8"}),e.jsx(U,{className:"h-64 w-full"})]});if(p.error||!p.data)return e.jsx("div",{className:"page",children:e.jsx(us,{variant:"destructive",children:e.jsx(xs,{children:"Task not found."})})});const x=p.data.task,Ue=p.data.parents||[],L=V(x.name,x.slug),re=(p.data.sisters||[]).filter(s=>s.id!==x.id),qe=p.data.recommended_frameworks||[],H=p.data.benchmarks||[],Ke=new Map(H.map(s=>[s.id,s])),ze=new Set(H.map(s=>s.id)),oe=(((he=m.data)==null?void 0:he.results)||[]).filter(s=>ze.has(s.id)).map(s=>{const t=Ke.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=oe.length?oe:H.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),ce=((ue=m.data)==null?void 0:ue.recent_days)||90,Ge=w.some(s=>(I.get(s.id)||[]).length>0),Qe=w.length>0,ie=$.length>0,We=(()=>{const s=new Set;return H.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(d=>s.add(d.id))),s.size})(),Ye=s=>{S(t=>{const d=new Set(t);return d.has(s)?d.delete(s):d.add(s),d})};return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(A,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:"/tasks",children:"Tasks"}),[...Ue].reverse().map(s=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:`/tasks/${s.slug||s.id}`,children:V(s.name,s.slug)})]},s.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:x.name.toUpperCase()})]}),e.jsxs("div",{className:x.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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:L}),x.description&&e.jsx(Q,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Fs,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(Le,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(He,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(Ve,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(Q,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:We}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[D.length,"+"]}),"METHODS USED"]})]}),e.jsx(Vs,{frameworks:qe})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:os(x.image_url)??void 0,alt:`${L} schematic`,onError:s=>{var t,d;(d=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",L,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Q,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[ie&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ce,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ls,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ce,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(A,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(js,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(A,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(fs,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(A,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(bs,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),Qe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:ie?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:Ge?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",w.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:w.map(s=>{const t=I.get(s.id)||[],d=R.has(s.id),O=d?t:t.slice(0,W),P=t.length-W;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:V(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Ze)=>e.jsxs("div",{className:"bench-row",onClick:()=>o(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Ze+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),P>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ye(s.id),children:d?`− show top ${W}`:`+ show ${P} more benchmark${P===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(x.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Bs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ms,{hasCode:c,hasHfArtifacts:l,onHasCodeChange:g,onHasHfArtifactsChange:f})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:L})]})]}),b.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(U,{className:"h-40 w-full"},t))}):E.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(cs,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:B,style:{height:1}}),b.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),re.slice(0,8).map(s=>e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:V(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),D.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),D.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(is,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Vs as RecommendedFrameworkLinks,la as default}; diff --git a/assets/TagBrowseView-mW7aLEG6.js b/assets/TagBrowseView-mW7aLEG6.js new file mode 100644 index 0000000000000000000000000000000000000000..83132466dec01e4e1714525b9ced83e9176f5e61 --- /dev/null +++ b/assets/TagBrowseView-mW7aLEG6.js @@ -0,0 +1,11 @@ +import{d as fe,r as h,n as Z,j as e,m as F,O as be,q as je,P as Je,t as _e,o as ve,Q as Xe,R as _,S as es,x as ss,v as J,L as A,f as as,u as ts,a as ns,F as rs,M as os}from"./index-Czt286FG.js";import{u as xe}from"./useQuery-DLzEukS9.js";import{P as cs,M as is}from"./components-D0aZHC0e.js";import{B as ls}from"./BenchmarkTrendSparkline-CrCjGcyr.js";import{u as ds,P as ms}from"./useIntersectionObserver-DWuiXfmk.js";import{M as Q}from"./MarkdownText-DfT-SORZ.js";import{c as ge}from"./catalog-BRyB71ZU.js";import{t as ps,d as V}from"./transform-IZH7YNlm.js";import{b as hs}from"./usePapers-BlskNTEC.js";import{S as U}from"./skeleton-B7eqTJnv.js";import{A as us,a as xs}from"./alert-pIw6ZaYb.js";import{C as gs}from"./chevron-down-D8AKxdK5.js";import{G as fs}from"./github-HgTw2jEK.js";import"./LatexTitle-BMNMJu5R.js";import"./katex.min-BSBacQyE.js";import"./safeExternalHref-CkBrsh84.js";import"./PaperPreviewLink-D8Gj_IIj.js";import"./index-Bzn4VKTO.js";import"./hover-card-g7QtmX4K.js";import"./useInfiniteQuery-Dk5Z9hLn.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 bs=fe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @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 js=fe("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);var K="Collapsible",[_s,Ne]=_e(K),[vs,X]=_s(K),ke=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:c,onOpenChange:l,...u}=a,[g,f]=Z({prop:r,defaultProp:i??!1,onChange:l,caller:K});return e.jsx(vs,{scope:n,disabled:c,contentId:be(),open:g,onOpenToggle:h.useCallback(()=>f(j=>!j),[f]),children:e.jsx(F.div,{"data-state":se(g),"data-disabled":c?"":void 0,...u,ref:o})})});ke.displayName=K;var we="CollapsibleTrigger",Ce=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,...r}=a,i=X(we,n);return e.jsx(F.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":se(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:o,onClick:je(a.onClick,i.onOpenToggle)})});Ce.displayName=we;var ee="CollapsibleContent",ye=h.forwardRef((a,o)=>{const{forceMount:n,...r}=a,i=X(ee,a.__scopeCollapsible);return e.jsx(Je,{present:n||i.open,children:({present:c})=>e.jsx(Ns,{...r,ref:o,present:c})})});ye.displayName=ee;var Ns=h.forwardRef((a,o)=>{const{__scopeCollapsible:n,present:r,children:i,...c}=a,l=X(ee,n),[u,g]=h.useState(r),f=h.useRef(null),j=ve(o,f),v=h.useRef(0),R=v.current,S=h.useRef(0),T=S.current,k=l.open||u,N=h.useRef(k),p=h.useRef(void 0);return h.useEffect(()=>{const m=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(m)},[]),Xe(()=>{const m=f.current;if(m){p.current=p.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";const w=m.getBoundingClientRect();v.current=w.height,S.current=w.width,N.current||(m.style.transitionDuration=p.current.transitionDuration,m.style.animationName=p.current.animationName),g(r)}},[l.open,r]),e.jsx(F.div,{"data-state":se(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!k,...c,ref:j,style:{"--radix-collapsible-content-height":R?`${R}px`:void 0,"--radix-collapsible-content-width":T?`${T}px`:void 0,...a.style},children:k&&i})});function se(a){return a?"open":"closed"}var ks=ke,ws=Ce,Cs=ye,C="Accordion",ys=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ae,As,Ss]=es(C),[z]=_e(C,[Ss,Ne]),te=Ne(),Ae=_.forwardRef((a,o)=>{const{type:n,...r}=a,i=r,c=r;return e.jsx(ae.Provider,{scope:a.__scopeAccordion,children:n==="multiple"?e.jsx(Es,{...c,ref:o}):e.jsx(Is,{...i,ref:o})})});Ae.displayName=C;var[Se,Ps]=z(C),[Pe,Rs]=z(C,{collapsible:!1}),Is=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:c=!1,...l}=a,[u,g]=Z({prop:n,defaultProp:r??"",onChange:i,caller:C});return e.jsx(Se,{scope:a.__scopeAccordion,value:_.useMemo(()=>u?[u]:[],[u]),onItemOpen:g,onItemClose:_.useCallback(()=>c&&g(""),[c,g]),children:e.jsx(Pe,{scope:a.__scopeAccordion,collapsible:c,children:e.jsx(Re,{...l,ref:o})})})}),Es=_.forwardRef((a,o)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...c}=a,[l,u]=Z({prop:n,defaultProp:r??[],onChange:i,caller:C}),g=_.useCallback(j=>u((v=[])=>[...v,j]),[u]),f=_.useCallback(j=>u((v=[])=>v.filter(R=>R!==j)),[u]);return e.jsx(Se,{scope:a.__scopeAccordion,value:l,onItemOpen:g,onItemClose:f,children:e.jsx(Pe,{scope:a.__scopeAccordion,collapsible:!0,children:e.jsx(Re,{...c,ref:o})})})}),[Ts,G]=z(C),Re=_.forwardRef((a,o)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:c="vertical",...l}=a,u=_.useRef(null),g=ve(u,o),f=As(n),v=ss(i)==="ltr",R=je(a.onKeyDown,S=>{var B;if(!ys.includes(S.key))return;const T=S.target,k=f().filter(M=>{var x;return!((x=M.ref.current)!=null&&x.disabled)}),N=k.findIndex(M=>M.ref.current===T),p=k.length;if(N===-1)return;S.preventDefault();let m=N;const w=0,I=p-1,b=()=>{m=N+1,m>I&&(m=w)},E=()=>{m=N-1,m{const{__scopeAccordion:n,value:r,...i}=a,c=G(q,n),l=Ps(q,n),u=te(n),g=be(),f=r&&l.value.includes(r)||!1,j=c.disabled||a.disabled;return e.jsx(Ms,{scope:n,open:f,disabled:j,triggerId:g,children:e.jsx(ks,{"data-orientation":c.orientation,"data-state":De(f),...u,...i,ref:o,disabled:j,open:f,onOpenChange:v=>{v?l.onItemOpen(r):l.onItemClose(r)}})})});Ie.displayName=q;var Ee="AccordionHeader",Te=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Ee,n);return e.jsx(F.h3,{"data-orientation":i.orientation,"data-state":De(c.open),"data-disabled":c.disabled?"":void 0,...r,ref:o})});Te.displayName=Ee;var Y="AccordionTrigger",Me=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne(Y,n),l=Rs(Y,n),u=te(n);return e.jsx(ae.ItemSlot,{scope:n,children:e.jsx(ws,{"aria-disabled":c.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:c.triggerId,...u,...r,ref:o})})});Me.displayName=Y;var $e="AccordionContent",Oe=_.forwardRef((a,o)=>{const{__scopeAccordion:n,...r}=a,i=G(C,n),c=ne($e,n),l=te(n);return e.jsx(Cs,{role:"region","aria-labelledby":c.triggerId,"data-orientation":i.orientation,...l,...r,ref:o,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...a.style}})});Oe.displayName=$e;function De(a){return a?"open":"closed"}var $s=Ae,Os=Ie,Ds=Te,Fe=Me,Be=Oe;const Fs=$s,Le=h.forwardRef(({className:a,...o},n)=>e.jsx(Os,{ref:n,className:J("border-b",a),...o}));Le.displayName="AccordionItem";const He=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Ds,{className:"flex",children:e.jsxs(Fe,{ref:r,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",a),...n,children:[o,e.jsx(gs,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));He.displayName=Fe.displayName;const Ve=h.forwardRef(({className:a,children:o,...n},r)=>e.jsx(Be,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:J("pb-4 pt-0",a),children:o})}));Ve.displayName=Be.displayName;const Bs=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],Ls=a=>a==="trending"||a==="date_published"||a==="citation_count"?a:"trending",W=3,Hs=a=>new Intl.NumberFormat("en",{notation:a>=1e3?"compact":"standard",maximumFractionDigits:1}).format(a),Vs=({frameworks:a})=>a.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),a.map(o=>e.jsxs(A,{to:`/papers?framework=${encodeURIComponent(o.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:o.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Hs(o.num_stars)]})]},o.framework_id))]}),Us=a=>[...a].sort((o,n)=>{const r=o.slug==="classic-language-modeling",i=n.slug==="classic-language-modeling";return r!==i?r?1:-1:0}),da=()=>{var le,de,me,pe,he,ue;const{taskSlug:a}=as(),o=ts(),[n,r]=ns(),i=Ls(n.get("order_by")),c=n.get("has_code")==="true",l=n.get("has_hf_artifacts")==="true",u=s=>{const t=new URLSearchParams(n);t.set("order_by",s),r(t)},g=s=>{const t=new URLSearchParams(n);s?t.set("has_code","true"):t.delete("has_code"),r(t)},f=s=>{const t=new URLSearchParams(n);s?t.set("has_hf_artifacts","true"):t.delete("has_hf_artifacts"),r(t)},[j,v]=h.useState(!1),[R,S]=h.useState(()=>new Set),{preferences:T}=rs(),k=(s,t)=>{const d=s||"";return t?`/benchmark/${d}?task=${encodeURIComponent(t)}`:`/benchmark/${d}`},N=T.hide_closed_source_evals?!0:void 0,p=xe({queryKey:["task-page",a,N],queryFn:()=>ge.taskPage(a,{is_open:N}),enabled:!!a,staleTime:10*60*1e3}),m=xe({queryKey:["task-benchmark-trends",a,N],queryFn:()=>ge.trendingBenchmarks(a,{limit:100,min_recent_papers:0,is_open:N}),enabled:!!a,staleTime:10*60*1e3}),w=h.useMemo(()=>{var s;return Us(((s=p.data)==null?void 0:s.children)||[])},[p.data]),I=h.useMemo(()=>{var t;const s=new Map;return(((t=p.data)==null?void 0:t.subtask_benchmarks)||[]).forEach(d=>{s.set(d.subtask_id,d.benchmarks||[])}),s},[p.data]),b=hs({taskId:((de=(le=p.data)==null?void 0:le.task)==null?void 0:de.id)||"",page_size:20,order_by:i,order_dir:"desc",include_resources:!0,has_code:c,has_hf_artifacts:l,enabled:!!((pe=(me=p.data)==null?void 0:me.task)!=null&&pe.id)}),E=h.useMemo(()=>{var t;return(((t=b.data)==null?void 0:t.pages.flatMap(d=>d.results))||[]).map(ps)},[b.data]),D=h.useMemo(()=>{var t;const s={};return(t=b.data)==null||t.pages.forEach(d=>d.results.forEach(O=>(O.methods||[]).forEach(P=>{const y=P.slug||P.id;s[y]||(s[y]={id:P.id,name:P.name,slug:P.slug||"",count:0}),s[y].count++}))),Object.values(s).sort((d,O)=>O.count-d.count).slice(0,8)},[b.data]),{targetRef:B,isIntersecting:M}=ds({rootMargin:"200px"});if(h.useEffect(()=>{M&&b.hasNextPage&&!b.isFetchingNextPage&&b.fetchNextPage()},[M,b.hasNextPage,b.isFetchingNextPage]),p.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(U,{className:"h-12 w-1/2 mb-4"}),e.jsx(U,{className:"h-6 w-1/3 mb-8"}),e.jsx(U,{className:"h-64 w-full"})]});if(p.error||!p.data)return e.jsx("div",{className:"page",children:e.jsx(us,{variant:"destructive",children:e.jsx(xs,{children:"Task not found."})})});const x=p.data.task,Ue=p.data.parents||[],L=V(x.name,x.slug),re=(p.data.sisters||[]).filter(s=>s.id!==x.id),qe=p.data.recommended_frameworks||[],H=p.data.benchmarks||[],Ke=new Map(H.map(s=>[s.id,s])),ze=new Set(H.map(s=>s.id)),oe=(((he=m.data)==null?void 0:he.results)||[]).filter(s=>ze.has(s.id)).map(s=>{const t=Ke.get(s.id);return{...s,best_model_name:(t==null?void 0:t.best_model_name)??s.best_model_name,best_paper_route:t==null?void 0:t.best_paper_route,best_paper_title:t==null?void 0:t.best_paper_title,best_code_url:t==null?void 0:t.best_code_url}}),$=oe.length?oe:H.map(s=>({id:s.id,name:s.name,slug:s.slug,full_name:s.full_name,recent_paper_count:0,baseline_paper_count:0,all_time_paper_count:s.paper_count||0,trend_score:0,support_weighted_score:0,rate_change:null,latest_reported_on:null,best_model_name:s.best_model_name,best_paper_route:s.best_paper_route,best_paper_title:s.best_paper_title,best_code_url:s.best_code_url,history:[]})),ce=((ue=m.data)==null?void 0:ue.recent_days)||90,Ge=w.some(s=>(I.get(s.id)||[]).length>0),Qe=w.length>0,ie=$.length>0,We=(()=>{const s=new Set;return H.forEach(t=>s.add(t.id)),I.forEach(t=>t.forEach(d=>s.add(d.id))),s.size})(),Ye=s=>{S(t=>{const d=new Set(t);return d.has(s)?d.delete(s):d.add(s),d})};return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(A,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:"/tasks",children:"Tasks"}),[...Ue].reverse().map(s=>e.jsxs(_.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(A,{to:`/tasks/${s.slug||s.id}`,children:V(s.name,s.slug)})]},s.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:x.name.toUpperCase()})]}),e.jsxs("div",{className:x.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:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:L}),x.description&&e.jsx(Q,{className:"task-explainer",text:x.description}),x.research_trends&&x.research_trends.length>0&&e.jsx(Fs,{className:"task-research-trends",type:"single",collapsible:!0,children:e.jsxs(Le,{className:"task-research-trends-item",value:"key-trends",children:[e.jsx(He,{className:"task-research-trends-trigger",children:e.jsx("span",{className:"task-research-trends-title",children:"Key trends"})}),e.jsx(Ve,{className:"task-research-trends-content",children:e.jsx("ul",{children:x.research_trends.map((s,t)=>e.jsx("li",{children:e.jsx(Q,{text:s})},t))})})]})}),e.jsxs("div",{className:"task-quickstats",children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:(x.paper_count??0).toLocaleString()}),"PAPERS"]}),e.jsxs("span",{children:[e.jsx("span",{className:"num",children:We}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[D.length,"+"]}),"METHODS USED"]})]}),e.jsx(Vs,{frameworks:qe})]}),x.image_url&&e.jsxs("figure",{className:`task-figure-card${x.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:os(x.image_url)??void 0,alt:`${L} schematic`,onError:s=>{var t,d;(d=(t=s.currentTarget.parentElement)==null?void 0:t.parentElement)==null||d.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",L,x.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(Q,{className:"task-image-credit",text:x.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[ie&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[ce,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",$.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),(j?$:$.slice(0,5)).map(s=>e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ls,{history:s.history,benchmarkName:s.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:s.recent_paper_count})," ",s.recent_paper_count===1?"paper":"papers"," /"," ",ce,"d"]}),s.rate_change==null?s.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${s.rate_change>=1?"is-up":"is-down"}`,children:[s.rate_change>=1?"↑":"↓"," ",s.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(A,{className:"bench-row-name",to:k(s.slug||s.id,a),children:s.name}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:s.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:s.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(js,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:s.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:s.best_paper_route&&s.best_paper_title?e.jsx(A,{to:`/paper/${encodeURIComponent(s.best_paper_route)}`,children:s.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:s.best_code_url?e.jsx("a",{href:s.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${s.best_paper_title||s.best_model_name}`,children:e.jsx(fs,{size:18,strokeWidth:1.8,"aria-hidden":"true"})}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-compare",role:"cell",children:e.jsxs(A,{to:k(s.slug||s.id,a),"aria-label":`Compare ${s.best_model_name||"the best model"} with all results on ${s.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(bs,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s.id))]}),$.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(s=>!s),children:j?"− show top 5":`+ show ${$.length-5} more benchmarks`})]}),Qe&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:ie?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:Ge?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",w.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:w.map(s=>{const t=I.get(s.id)||[],d=R.has(s.id),O=d?t:t.slice(0,W),P=t.length-W;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:V(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:t.length>0?`[${t.length} benchmark${t.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),O.length>0?O.map((y,Ze)=>e.jsxs("div",{className:"bench-row",onClick:()=>o(k(y.slug||y.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(Ze+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:y.name}),e.jsx("div",{className:"bench-row-sub",children:y.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:y.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},y.id)):e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),P>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Ye(s.id),children:d?`− show top ${W}`:`+ show ${P} more benchmark${P===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(x.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Bs.map(([s,t])=>e.jsx("button",{className:`sort-btn ${i===s?"active":""}`,onClick:()=>u(s),children:t},s))}),e.jsx(ms,{hasCode:c,hasHfArtifacts:l,onHasCodeChange:g,onHasHfArtifactsChange:f})]}),e.jsxs("div",{className:"results-count",children:[E.length," loaded in ",e.jsx("span",{children:L})]})]}),b.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,t)=>e.jsx(U,{className:"h-40 w-full"},t))}):E.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:E.map((s,t)=>e.jsx(cs,{paper:s,rank:t+1},s.id))}),e.jsx("div",{ref:B,style:{height:1}}),b.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[re.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),re.slice(0,8).map(s=>e.jsxs(A,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:V(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),D.length>0&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"02/"}),e.jsx("div",{className:"side-block-label",children:"Common Methods"}),D.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(is,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Vs as RecommendedFrameworkLinks,da as default}; diff --git a/assets/TagsIndexView-BwiGVYXT.js b/assets/TagsIndexView-BwiGVYXT.js new file mode 100644 index 0000000000000000000000000000000000000000..40d09ec44085c5044cf171b12dd74cc4b83706ae --- /dev/null +++ b/assets/TagsIndexView-BwiGVYXT.js @@ -0,0 +1 @@ +import{r as m,j as s,L as p}from"./index-Czt286FG.js";import{u as h}from"./useQuery-DLzEukS9.js";import{c as g}from"./catalog-BRyB71ZU.js";import{c as x,h as f,d as u}from"./transform-IZH7YNlm.js";import{S as d}from"./skeleton-B7eqTJnv.js";import{A as j,a as y}from"./alert-pIw6ZaYb.js";import{T as k}from"./TaxonomySuggestionTile-lcZG5E-y.js";import"./SignInToEditDialog-Dgq0yOYP.js";import"./button-vhqVRnBn.js";import"./textarea-Ov25LunA.js";import"./dialog-CJthLFv3.js";import"./useMutation-DqQi_NTN.js";import"./submissions-BsEO_Bbg.js";import"./loader-circle-DyZRZBrM.js";const v=r=>(r==null?void 0:r.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",R=()=>{const r=h({queryKey:["areas-with-tasks"],queryFn:()=>g.areasWithTasks(),staleTime:6e5}),o=m.useMemo(()=>{if(!r.data)return[];const e={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>e[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=m.useMemo(()=>o.reduce((e,t)=>e+t.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(j,{variant:"destructive",children:s.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,t)=>s.jsxs("div",{children:[s.jsx(d,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>s.jsx(d,{className:"h-24"},a))})]},t))}):o.map(e=>{const t=e.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.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"]})]}),s.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),s.jsx(k,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{R as default}; diff --git a/assets/TagsIndexView-CiMTi7r2.js b/assets/TagsIndexView-CiMTi7r2.js deleted file mode 100644 index 69be28382079c2b2ba1087133053c8caf04a34f3..0000000000000000000000000000000000000000 --- a/assets/TagsIndexView-CiMTi7r2.js +++ /dev/null @@ -1 +0,0 @@ -import{r as d,j as s,L as p,c as h}from"./index-D9_nPZtO.js";import{u as g}from"./useQuery-cycUreG-.js";import{c as x,h as f,d as u}from"./transform-BObV5jzB.js";import{S as m}from"./skeleton-CQ2CM4l9.js";import{A as j,a as y}from"./alert-B0bcMmNw.js";import{T as k}from"./TaxonomySuggestionTile-BO-dHwso.js";import"./SignInToEditDialog-NNf7Zp6R.js";import"./button-B859643f.js";import"./textarea-BVF3ykiv.js";import"./dialog-DnjY6ZOM.js";import"./useMutation-CJCfaNMQ.js";import"./loader-circle-CrVj12oC.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 e={general:0,vision:1,video:2,language:3,audio:4,other:5},t=n=>e[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((e,t)=>e+t.tasks.length,0),[o]);return r.error?s.jsx("div",{className:"page",children:s.jsx(j,{variant:"destructive",children:s.jsx(y,{children:"Failed to load taxonomy. Please try again."})})}):s.jsxs("div",{className:"page",children:[s.jsx("div",{className:"feed-header",children:s.jsxs("div",{children:[s.jsxs("h1",{className:"feed-title",children:["All ",s.jsx("em",{children:"Domains"})]}),s.jsx("div",{className:"feed-subtitle",children:"Browse research by area. Click any task to see trending work."})]})}),r.isLoading?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((e,t)=>s.jsxs("div",{children:[s.jsx(m,{className:"h-8 w-1/3 mb-4"}),s.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((n,a)=>s.jsx(m,{className:"h-24"},a))})]},t))}):o.map(e=>{const t=e.tasks;if(t.length===0)return null;const n=t.reduce((a,i)=>a+(i.paper_count||0),0);return s.jsxs("section",{style:{marginBottom:48},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:24,paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[s.jsxs("div",{children:[s.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:e.name}),e.description&&s.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:e.description})]}),s.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"]})]}),s.jsxs("div",{className:"tag-grid",children:[t.map(a=>{const i=a.slug||"",l=x(f(i));return s.jsxs(p,{to:`/tasks/${i}`,className:"tag-cell",children:[s.jsxs("div",{className:"name",children:[s.jsx("span",{className:"dot",style:{background:l.dot}}),u(a.name,i)]}),s.jsx("div",{className:"meta",children:s.jsxs("span",{children:[(a.paper_count??0).toLocaleString()," papers"]})})]},a.id)}),s.jsx(k,{kind:"task"})]})]},e.id)}),c>0&&s.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[c," tasks across ",o.filter(e=>e.tasks.length>0).length," areas."]})]})};export{D as default}; diff --git a/assets/TaxonomySuggestionTile-BO-dHwso.js b/assets/TaxonomySuggestionTile-lcZG5E-y.js similarity index 83% rename from assets/TaxonomySuggestionTile-BO-dHwso.js rename to assets/TaxonomySuggestionTile-lcZG5E-y.js index ff5d0b55562450f0d0ff4560511d4d6438f99b68..48eaed98ecca157a42424ed1ee276dccf9d590f7 100644 --- a/assets/TaxonomySuggestionTile-BO-dHwso.js +++ b/assets/TaxonomySuggestionTile-lcZG5E-y.js @@ -1 +1 @@ -import{g as u,r as o,j as e}from"./index-D9_nPZtO.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-NNf7Zp6R.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),g=`Suggest a new ${s}...`,r=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:r,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),g]}),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{g as u,r as o,j as e}from"./index-Czt286FG.js";import{P as c,S as m,a as p}from"./SignInToEditDialog-Dgq0yOYP.js";function h({kind:s}){const{user:a}=u(),[i,n]=o.useState(!1),[l,t]=o.useState(!1),g=`Suggest a new ${s}...`,r=()=>{a?n(!0):t(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:r,children:[e.jsxs("div",{className:"name",children:[e.jsx(c,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),g]}),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-BlGLrFvK.js b/assets/TrendsView-Cn5lx78X.js similarity index 97% rename from assets/TrendsView-BlGLrFvK.js rename to assets/TrendsView-Cn5lx78X.js index 23f44155d915fed302bf56773a446b0b9f0e89f0..a2104d3101c37a604cc36b2735a16078efebf9a6 100644 --- a/assets/TrendsView-BlGLrFvK.js +++ b/assets/TrendsView-Cn5lx78X.js @@ -1 +1 @@ -import{c as X,R as G,j as e}from"./index-D9_nPZtO.js";import{u as J}from"./useQuery-cycUreG-.js";import{A as q,a as E}from"./alert-B0bcMmNw.js";import{S as P}from"./skeleton-CQ2CM4l9.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{c as X,R as G,j as e}from"./index-Czt286FG.js";import{u as J}from"./useQuery-DLzEukS9.js";import{A as q,a as E}from"./alert-pIw6ZaYb.js";import{S as P}from"./skeleton-B7eqTJnv.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/UserProfileView-Bq_ZES4n.js b/assets/UserProfileView-Bq_ZES4n.js new file mode 100644 index 0000000000000000000000000000000000000000..bf959bbd226638cbd9fbcaeaea2f75a02cd647a4 --- /dev/null +++ b/assets/UserProfileView-Bq_ZES4n.js @@ -0,0 +1 @@ +import{f as s,j as e,at as i,e as o}from"./index-Czt286FG.js";import{u as d}from"./useQuery-DLzEukS9.js";import{C as l}from"./OrganizationContributionGraph-BFVnJhUY.js";import"./skeleton-B7eqTJnv.js";import"./catalog-BRyB71ZU.js";async function c(t){const a=await fetch(o(`/api/v1/profiles/${encodeURIComponent(t)}`),{credentials:"include"});if(!a.ok)throw new Error("Profile not found");const r=await a.json();if(a.redirected){const n=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:n,redirected_from_alias:!0}}return r}const f=()=>{const{username:t=""}=s(),a=d({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>c(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(i,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{f as default}; diff --git a/assets/UserProfileView-CR04MORR.js b/assets/UserProfileView-CR04MORR.js deleted file mode 100644 index 0da430e906828a6e43bf897bf3faae14b02da2ac..0000000000000000000000000000000000000000 --- a/assets/UserProfileView-CR04MORR.js +++ /dev/null @@ -1 +0,0 @@ -import{f as s,j as e,aP as i,e as o}from"./index-D9_nPZtO.js";import{u as d}from"./useQuery-cycUreG-.js";import{C as l}from"./OrganizationContributionGraph-CjsAmlOx.js";import"./skeleton-CQ2CM4l9.js";async function c(t){const a=await fetch(o(`/api/v1/profiles/${encodeURIComponent(t)}`),{credentials:"include"});if(!a.ok)throw new Error("Profile not found");const r=await a.json();if(a.redirected){const n=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:n,redirected_from_alias:!0}}return r}const x=()=>{const{username:t=""}=s(),a=d({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>c(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(i,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(l,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{x as default}; diff --git a/assets/alert-B0bcMmNw.js b/assets/alert-B0bcMmNw.js deleted file mode 100644 index f63951641cb469bc37b7cf8901948846be85c45a..0000000000000000000000000000000000000000 --- a/assets/alert-B0bcMmNw.js +++ /dev/null @@ -1 +0,0 @@ -import{r,j as s,v as l,aa as i}from"./index-D9_nPZtO.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=r.forwardRef(({className:e,variant:t,...a},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...a}));n.displayName="Alert";const v=r.forwardRef(({className:e,...t},a)=>s.jsx("h5",{ref:a,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=r.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; diff --git a/assets/alert-pIw6ZaYb.js b/assets/alert-pIw6ZaYb.js new file mode 100644 index 0000000000000000000000000000000000000000..2c08f8d6cf733a34ed0194938fc2339d6b83514f --- /dev/null +++ b/assets/alert-pIw6ZaYb.js @@ -0,0 +1 @@ +import{r as a,j as s,v as l,V as i}from"./index-Czt286FG.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}; diff --git a/assets/button-B859643f.js b/assets/button-B859643f.js deleted file mode 100644 index fc0808829c8867918108ba7eefae6cf405639f16..0000000000000000000000000000000000000000 --- a/assets/button-B859643f.js +++ /dev/null @@ -1 +0,0 @@ -import{r as i,j as d,ax as u,v as c,aa as f}from"./index-D9_nPZtO.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=i.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const a=n?u:"button";return d.jsx(a,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; diff --git a/assets/button-vhqVRnBn.js b/assets/button-vhqVRnBn.js new file mode 100644 index 0000000000000000000000000000000000000000..82df8a2e56f784e1b9e7af52ddb5042b6b5ee50a --- /dev/null +++ b/assets/button-vhqVRnBn.js @@ -0,0 +1 @@ +import{r as a,j as d,ah as u,v as c,V as f}from"./index-Czt286FG.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?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; diff --git a/assets/catalog-BRyB71ZU.js b/assets/catalog-BRyB71ZU.js new file mode 100644 index 0000000000000000000000000000000000000000..5453b54de6eea0fc94361212d7b6c916e0596ac8 --- /dev/null +++ b/assets/catalog-BRyB71ZU.js @@ -0,0 +1 @@ +import{ac as o}from"./index-Czt286FG.js";function s(n,t){const e=new URLSearchParams;for(const[i,a]of Object.entries(t??{}))a!==void 0&&a!==""&&e.set(i,String(a));const r=e.toString();return`${n}${r?`?${r}`:""}`}class u{constructor(t){this.request=t}listAreas(t){return this.request(s("/areas/",t))}getArea(t){return this.request(`/areas/${t}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(t){return this.request(s("/tasks/",t))}getTask(t){return this.request(`/tasks/${t}`)}topTasks(t){return this.request(s("/tasks/top",{limit:t}))}trendingTasks(t){return this.request(s("/tasks/trending",t))}taskChildren(t,e){return this.request(s(`/tasks/${t}/children`,e))}taskParents(t){return this.request(`/tasks/${t}/parents`)}taskPage(t,e){return this.request(s(`/tasks/${t}/page`,e))}trendingBenchmarks(t,e){return this.request(s(`/tasks/${encodeURIComponent(t)}/trending-benchmarks`,e))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(t){return this.request(s("/methods/",t))}getMethod(t){return this.request(`/methods/${encodeURIComponent(t)}`)}methodTrend(t,e){return this.request(s(`/methods/${encodeURIComponent(t)}/trend`,e))}listDatasets(t){const{task_id:e,...r}=t??{};return this.request(s("/datasets/",{...r,task:r.task??e}))}getDataset(t){return this.request(`/datasets/${t}`)}getDatasetBySlug(t,e){return this.request(s(`/datasets/${t}`,e))}async datasetTasks(t){return(await this.request(`/datasets/${t}/tasks/`)).results}async leaderboardMetrics(t,e){return(await this.request(`/datasets/${t}/tasks/${e}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(t){return this.request(`/conferences/${t}`)}conferenceAreasWithTasks(t){return this.request(`/conferences/${t}/areas-with-tasks`)}organizations(t=!1){return this.request(`/organizations/${t?"?featured_only=true":""}`)}getOrganization(t){return this.request(`/organizations/${t}`)}organizationContributions(t){return this.request(`/organizations/${t}/contributions`)}organizationAreasWithTasks(t){return this.request(`/organizations/${t}/areas-with-tasks`)}audit(t){return this.request(s("/admin/catalog-audit",{cursor:t}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(t){return this.request(`/admin/catalog-audit/${t}/rollback`,{method:"POST"})}}const h=new u(o);export{h as c}; diff --git a/assets/chatSessions-CQv5Fwer.js b/assets/chatSessions-CQv5Fwer.js deleted file mode 100644 index 5f35f8e40aba1a506b5c97070fc1381fade26d77..0000000000000000000000000000000000000000 --- a/assets/chatSessions-CQv5Fwer.js +++ /dev/null @@ -1,7 +0,0 @@ -import{d as Q,j as a,r as C,C as J,R as d,c as F,e as U}from"./index-D9_nPZtO.js";import{C as X}from"./chevron-down-D6vo9F6c.js";import{u as Z}from"./useQuery-cycUreG-.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 ee=Q("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),ue=({light:e})=>a.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),he=({open:e})=>a.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),de=()=>a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]}),pe=({size:e=14})=>a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7"}),a.jsx("path",{d:"m21 21-4.3-4.3"})]}),fe=()=>a.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:a.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),ge=()=>a.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M12 5v14M5 12h14"})}),me=()=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),a.jsx("path",{d:"M9 4v16"})]}),ve=()=>a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.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"})}),te=[{provider:"huggingface",label:"Inference Providers"},{provider:"openrouter",label:"OpenRouter"}],ye=({models:e,selectedModel:r,onModelChange:t,disabled:s})=>{var o,i;const n=((o=e.find(u=>u.id===r))==null?void 0:o.label)??`${r} (unavailable)`,c=e.filter(u=>!u.provider);return e.length===1&&((i=e[0])==null?void 0:i.id)===r?a.jsx("span",{className:"chat-model-label","aria-label":"Research model",children:n}):a.jsxs("span",{className:`chat-model-picker${s?" is-disabled":""}`,children:[a.jsx("span",{className:"chat-model-picker-sizer","aria-hidden":"true",children:n}),a.jsxs("select",{className:"chat-model-select",value:r,disabled:s,onChange:u=>t(u.target.value),"aria-label":"Research model",children:[!e.some(u=>u.id===r)&&a.jsx("option",{value:r,disabled:!0,children:n}),c.map(u=>a.jsx("option",{value:u.id,children:u.label},u.id)),te.map(({provider:u,label:v})=>{const h=e.filter(p=>p.provider===u);return h.length===0?null:a.jsx("optgroup",{label:v,children:h.map(p=>a.jsx("option",{value:p.id,children:p.label},p.id))},u)})]}),a.jsx("svg",{className:"chat-model-picker-chevron",viewBox:"0 0 12 8","aria-hidden":"true",children:a.jsx("path",{d:"m1 1 5 5 5-5"})})]})},R=[{value:"low",label:"Low",description:"Faster and more concise"},{value:"high",label:"High",description:"More thorough"},{value:"max",label:"Max",description:"Deepest and slowest"}],xe=({value:e,onChange:r,disabled:t=!1})=>{const[s,n]=C.useState(!1),c=C.useRef(null),o=R.find(i=>i.value===e)??R[0];return C.useEffect(()=>{if(!s)return;const i=v=>{var h;(h=c.current)!=null&&h.contains(v.target)||n(!1)},u=v=>{v.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",i),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",u)}},[s]),C.useEffect(()=>{t&&n(!1)},[t]),a.jsxs("div",{className:"chat-effort-picker",ref:c,children:[a.jsxs("button",{type:"button",className:"chat-effort-trigger","aria-label":`Reasoning effort: ${o.label}`,"aria-haspopup":"listbox","aria-expanded":s,disabled:t,onClick:()=>n(i=>!i),children:[a.jsx("span",{children:o.label}),a.jsx(X,{size:13,"aria-hidden":"true"})]}),s&&a.jsxs("div",{className:"chat-effort-menu",role:"listbox","aria-label":"Reasoning effort",children:[a.jsx("div",{className:"chat-effort-menu-label","aria-hidden":"true",children:"Reasoning effort"}),R.map(i=>a.jsxs("button",{type:"button",className:`chat-effort-option${i.value===e?" is-selected":""}`,role:"option","aria-selected":i.value===e,onClick:()=>{r(i.value),n(!1)},children:[a.jsxs("span",{className:"chat-effort-option-copy",children:[a.jsx("strong",{children:i.label}),a.jsx("small",{children:i.description})]}),i.value===e&&a.jsx(J,{size:15,"aria-hidden":"true"})]},i.value))]})]})},we=({text:e,mentions:r,scrollTop:t=0,variant:s="composer"})=>{const n=[];let c=0;for(const o of[...r].sort((i,u)=>i.start-u.start)){const i=e.slice(o.start,o.end),u=i===o.title||i===`@${o.title}`;o.starte.length||!u||(n.push(e.slice(c,o.start)),n.push(a.jsx("span",{className:`chat-paper-inline-highlight${o.unavailable?" is-unavailable":""}`,"data-paper-route-id":o.route_id,children:i},o.key)),c=o.end)}return n.push(e.slice(c)),e.endsWith(` -`)&&n.push("​"),a.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${s}`,children:a.jsx("div",{style:{transform:`translateY(-${t}px)`},children:n})})},_e=({open:e,query:r,results:t,activeIndex:s,loading:n,error:c,onSelect:o,id:i="chat-paper-picker",optionIdPrefix:u="chat-paper-option"})=>{if(!e)return null;const v=r.trim()?n?"Searching papers…":c?"Paper search is unavailable":t.length?`${t.length} paper${t.length===1?"":"s"} found`:"No papers found":"Type to search papers";return a.jsxs("div",{className:"chat-paper-picker",id:i,role:"listbox","aria-label":"Paper results",children:[a.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:v}),t.map((h,p)=>{const P=h.arxiv_id||h.id,S=h.arxiv_id||(()=>{try{return h.source_url?new URL(h.source_url).hostname:"External resource"}catch{return"External resource"}})();return a.jsxs("button",{type:"button",id:`${u}-${p}`,role:"option","aria-selected":p===s,className:`chat-paper-option${p===s?" is-active":""}`,onMouseDown:E=>{E.preventDefault(),o(h)},children:[a.jsx("span",{className:"chat-paper-option-title",children:h.title}),a.jsx("span",{className:"chat-paper-option-meta",children:S})]},P)})]})},se=10,re=3;function B(e,r){const s=e.slice(0,r).lastIndexOf("@");if(s<0)return null;const n=s>0?e[s-1]:"";if(n&&/[\p{L}\p{M}\p{N}_@]/u.test(n))return null;const c=e.slice(s+1,r);return/[\n\r@]/.test(c)?null:{start:s,end:r,query:c}}function W(e,r,t){let s=0;for(;si.end<=s?[i]:i.start>=c?[{...i,start:i.start+o,end:i.end+o}]:[])}function be({draft:e,onChange:r,enabled:t,textareaRef:s}){var L;const n=`chat-paper-picker-${d.useId().replace(/:/g,"")}`,c=`${n}-option`,[o,i]=d.useState(null),[u,v]=d.useState(""),[h,p]=d.useState(0),[P,S]=d.useState(""),E=d.useRef(new Set);d.useEffect(()=>{t||i(null)},[t]),d.useEffect(()=>{const l=window.setTimeout(()=>v((o==null?void 0:o.query.trim())??""),150);return()=>window.clearTimeout(l)},[o==null?void 0:o.query]);const w=Z({queryKey:["chat-paper-mention-search",u.toLowerCase()],queryFn:({signal:l})=>F.searchPapers(u,1,10,"hybrid",l),enabled:t&&!!o&&u.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),g=d.useMemo(()=>{var l;return((l=w.data)==null?void 0:l.results)??[]},[(L=w.data)==null?void 0:L.results]);d.useEffect(()=>p(0),[u]),d.useEffect(()=>{var l;(l=document.getElementById(`${c}-${h}`))==null||l.scrollIntoView({block:"nearest"})},[h,c]);const K=d.useCallback(l=>{var y;if(!t){i(null);return}const f=l??((y=s.current)==null?void 0:y.selectionStart)??e.text.length;if(e.paperMentions.some(_=>f>_.start&&f<=_.end)){i(null);return}i(B(e.text,f))},[e.paperMentions,e.text,t,s]),V=d.useCallback((l,f)=>{var k;const y=W(e.text,l,e.paperMentions);r({text:l,paperMentions:y});const x=f??((k=s.current)==null?void 0:k.selectionStart)??l.length;t&&!y.some(j=>x>j.start&&x<=j.end)?i(B(l,x)):i(null)},[e,t,r,s]),D=d.useCallback(l=>{if(!o)return!1;const f=l.arxiv_id||l.id,y=new Set(e.paperMentions.map(b=>b.route_id));if(e.paperMentions.length>=se)return S("A message can contain at most 10 paper mentions."),!1;if(!y.has(f)&&y.size>=re)return S("A message can attach at most 3 distinct papers."),!1;const _=l.title,x=e.text.slice(o.end),k=x.length===0,j=e.text.slice(0,o.start)+_+(k?" ":"")+x,G=W(e.text,j,e.paperMentions),H={key:crypto.randomUUID(),route_id:f,title:l.title,source:l.source==="external"?"external":"arxiv",start:o.start,end:o.start+_.length};return r({text:j,paperMentions:[...G,H].sort((b,T)=>b.start-T.start)}),i(null),S(""),window.requestAnimationFrame(()=>{var T,q;const b=H.end+(k||x.startsWith(" ")?1:0);(T=s.current)==null||T.focus(),(q=s.current)==null||q.setSelectionRange(b,b)}),E.current.has(f)||(E.current.add(f),F.prewarmChatPaperContext(f).catch(()=>{})),!0},[o,e,r,s]),z=d.useCallback(l=>!o||l.nativeEvent.isComposing?!1:l.key==="Tab"?(i(null),!1):l.key==="Escape"?(l.preventDefault(),i(null),!0):l.key==="ArrowDown"||l.key==="ArrowUp"?(l.preventDefault(),g.length&&p(f=>l.key==="ArrowDown"?(f+1)%g.length:(f-1+g.length)%g.length),!0):l.key==="Home"&&g.length?(l.preventDefault(),p(0),!0):l.key==="End"&&g.length?(l.preventDefault(),p(g.length-1),!0):l.key==="Enter"&&!l.shiftKey?(l.preventDefault(),g[h]?D(g[h]):w.isFetching||i(null),!0):!1,[o,h,g,w.isFetching,D]);return{open:!!o,query:(o==null?void 0:o.query)??"",results:g,activeIndex:h,loading:w.isFetching,error:w.isError,message:P,pickerId:n,optionIdPrefix:c,updateText:V,refresh:K,select:D,keyDown:z,close:()=>i(null)}}const Se=({enabled:e,onChange:r,disabled:t=!1})=>a.jsxs("button",{type:"button",className:`chat-web-search-toggle${e?" is-enabled":""}`,role:"switch","aria-checked":e,"aria-label":"Web search",title:"Allow public-web search when useful; enabled search queries are processed by Exa",disabled:t,onClick:()=>r(!e),children:[a.jsx(ee,{size:15,"aria-hidden":"true"}),a.jsx("span",{children:"Web"})]}),$="pwc:chat-oauth-draft",M="pwc:chat-oauth-model",I="pwc:chat-oauth-auto-send",ne="pwc:chat-oauth-attempted",A="pwc:chat-web-search-enabled",O="pwc:chat-reasoning-effort";function ke(e,r,t={}){const s=typeof e=="string"?e:e.text,n=s.length-s.trimStart().length,c=s.trim();if(!c)return;const o=n+c.length,i={text:c,paperMentions:typeof e=="string"?[]:e.paperMentions.filter(u=>u.start>=n&&u.end<=o).map(u=>({...u,start:u.start-n,end:u.end-n}))};sessionStorage.setItem($,i.paperMentions.length?JSON.stringify(i):c),t.autoSend===!1?sessionStorage.removeItem(I):sessionStorage.setItem(I,"1"),r?sessionStorage.setItem(M,r):sessionStorage.removeItem(M),t.webSearchEnabled?sessionStorage.setItem(A,"1"):sessionStorage.removeItem(A),sessionStorage.setItem(O,t.reasoningEffort??"low")}function je(){var s;if(typeof window>"u"||sessionStorage.getItem(I)!=="1")return null;const e=(s=sessionStorage.getItem($))==null?void 0:s.trim();if(!e)return null;let r={text:e,paperMentions:[]};try{const n=JSON.parse(e);typeof n.text=="string"&&Array.isArray(n.paperMentions)&&(r=n)}catch{}const t=r.text.trim();return t?{prompt:t,draft:{...r,text:t},model:sessionStorage.getItem(M),webSearchEnabled:sessionStorage.getItem(A)==="1",reasoningEffort:["low","high","max"].includes(sessionStorage.getItem(O)??"")?sessionStorage.getItem(O):"low"}:null}function Ee(){sessionStorage.removeItem($),sessionStorage.removeItem(M),sessionStorage.removeItem(I),sessionStorage.removeItem(ne),sessionStorage.removeItem(A),sessionStorage.removeItem(O)}const Y="deepseek-ai/DeepSeek-V4-Flash-0731",Te=[{id:Y,label:"DeepSeek V4 Flash",provider:"openrouter"}],Ce=[{id:Y,label:"DeepSeek V4 Flash",provider:"openrouter"}];async function m(e,r){const t=await fetch(U(e),{credentials:"include",headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(!t.ok){const s=await t.json().catch(()=>null),n=s==null?void 0:s.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${t.status})`)}return t.status===204?void 0:t.json()}class ae extends Error{constructor(r,t){super(r),this.status=t}}async function oe(e){const r=await fetch(U(e),{headers:{Accept:"application/json"}});if(!r.ok){const t=await r.json().catch(()=>null),s=t==null?void 0:t.detail;throw new ae((s==null?void 0:s.message)||s||`Shared conversation request failed (${r.status})`,r.status)}return r.json()}async function Me(){const e=[];let r=null;do{const t=new URLSearchParams({limit:"50"});r&&t.set("cursor",r);const s=await m(`/api/v1/chat/sessions?${t.toString()}`);e.push(...s.items),r=s.next_cursor}while(r&&e.length<100);return e}function Ie(e,r="low"){return m("/api/v1/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:r})})}function Ae(e){return m(`/api/v1/chat/sessions/${e}`)}function Oe(e,r){return m(`/api/v1/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(r)})}function Pe(e){return m(`/api/v1/chat/sessions/${e}`,{method:"DELETE"})}function De(){return m("/api/v1/chat/sessions/archive-old",{method:"POST"})}function Re(){return m("/api/v1/chat/sessions/archive-oldest",{method:"POST"})}function Ne(e){return m(`/api/v1/chat/sessions/${e}/cancel`,{method:"POST"})}function $e(e){return m(`/api/v1/chat/sessions/${e}/share`,{method:"POST"})}function Le(e){return oe(`/api/v1/chat/shares/${encodeURIComponent(e)}`)}async function He(){return m("/api/v1/chat/models")}function N(e,r){const t=e.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:r&&(s.status==="error"||s.status==="denied"||s.status==="running")}:{...s,done:!0});return t.filter((s,n)=>{const c=t[n-1];return!(s.kind==="reasoning"&&(c==null?void 0:c.kind)==="reasoning"&&s.text===c.text)})}function qe(e){const r=t=>t==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":t==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":t==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":t==="provider_timeout"?"The model provider timed out. Try again shortly.":t==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":t==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":t==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":t==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":t==="openrouter_byok_billing_error"?"Your OpenRouter key is connected, but OpenRouter rejected billing for the account behind it. A key spending limit is not an account credit balance. Add credits or enable pay-as-you-go in OpenRouter, then try again.":t==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":["provider_error","provider_unavailable"].includes(t??"")?"The model provider failed before completing the response. You can edit and retry your question.":t==="persistence_error"?"The response could not be saved. You can edit and retry your question.":t==="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 e.messages.flatMap(t=>{if(t.role==="assistant")return[{id:t.id,role:"assistant",blocks:N(t.display_blocks,!0),followups:t.followups,citations:t.citations,finishReason:t.finish_reason??void 0,streaming:!1}];const s={id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(c=>({...c,key:c.occurrence_id})),revision:t.revision,status:t.status,error:t.status==="complete"?void 0:t.error_code||t.status};if(!["error","interrupted"].includes(t.status))return[s];const n=t.status==="interrupted";return[s,{id:`${t.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:N(t.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:r(t.error_code),errorCode:n?void 0:t.error_code??void 0}]})}function Fe(e){return e.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(t=>({...t,key:t.occurrence_id}))}:{id:r.id,role:"assistant",blocks:N(r.display_blocks,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function Be(e){const r=Date.now(),t=new Date().setHours(0,0,0,0),s=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...e].sort((c,o)=>Date.parse(o.updated_at)-Date.parse(c.updated_at))){const c=Date.parse(n.updated_at),o=r-c;c>=t?s[0].items.push(n):o<7*864e5?s[1].items.push(n):o<30*864e5?s[2].items.push(n):s[3].items.push(n)}return s.filter(n=>n.items.length>0)}export{fe as A,Fe as B,$ as C,Y as D,Le as E,de as F,he as G,pe as H,ye as M,Te as P,xe as R,Ce as S,ve as T,Se as W,we as a,_e as b,Ie as c,Ne as d,M as e,O as f,Ae as g,I as h,ne as i,Ee as j,He as k,Me as l,ge as m,me as n,Be as o,ue as p,ke as q,je as r,Oe as s,qe as t,be as u,Pe as v,$e as w,Re as x,De as y,ae as z}; diff --git a/assets/chatSessions-lE15HqmS.js b/assets/chatSessions-lE15HqmS.js new file mode 100644 index 0000000000000000000000000000000000000000..a3cbcfda85d8b580b17706e463a48672b38d32be --- /dev/null +++ b/assets/chatSessions-lE15HqmS.js @@ -0,0 +1,7 @@ +import{d as G,j as a,r as C,C as Q,R as d,c as J,p as X,e as W}from"./index-Czt286FG.js";import{C as Z}from"./chevron-down-D8AKxdK5.js";import{u as ee}from"./useQuery-DLzEukS9.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 te=G("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),he=({light:e})=>a.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),de=({open:e})=>a.jsx("svg",{className:`chat-chev${e?" chat-chev-open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),pe=()=>a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"m9 12 2 2 4-4"})]}),fe=({size:e=14})=>a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7"}),a.jsx("path",{d:"m21 21-4.3-4.3"})]}),ge=()=>a.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:a.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),me=()=>a.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M12 5v14M5 12h14"})}),ve=()=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),a.jsx("path",{d:"M9 4v16"})]}),ye=()=>a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.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"})}),se=[{provider:"huggingface",label:"Inference Providers"},{provider:"openrouter",label:"OpenRouter"}],xe=({models:e,selectedModel:r,onModelChange:t,disabled:s})=>{var o,i;const n=((o=e.find(u=>u.id===r))==null?void 0:o.label)??`${r} (unavailable)`,c=e.filter(u=>!u.provider);return e.length===1&&((i=e[0])==null?void 0:i.id)===r?a.jsx("span",{className:"chat-model-label","aria-label":"Research model",children:n}):a.jsxs("span",{className:`chat-model-picker${s?" is-disabled":""}`,children:[a.jsx("span",{className:"chat-model-picker-sizer","aria-hidden":"true",children:n}),a.jsxs("select",{className:"chat-model-select",value:r,disabled:s,onChange:u=>t(u.target.value),"aria-label":"Research model",children:[!e.some(u=>u.id===r)&&a.jsx("option",{value:r,disabled:!0,children:n}),c.map(u=>a.jsx("option",{value:u.id,children:u.label},u.id)),se.map(({provider:u,label:v})=>{const h=e.filter(p=>p.provider===u);return h.length===0?null:a.jsx("optgroup",{label:v,children:h.map(p=>a.jsx("option",{value:p.id,children:p.label},p.id))},u)})]}),a.jsx("svg",{className:"chat-model-picker-chevron",viewBox:"0 0 12 8","aria-hidden":"true",children:a.jsx("path",{d:"m1 1 5 5 5-5"})})]})},R=[{value:"low",label:"Low",description:"Faster and more concise"},{value:"high",label:"High",description:"More thorough"},{value:"max",label:"Max",description:"Deepest and slowest"}],we=({value:e,onChange:r,disabled:t=!1})=>{const[s,n]=C.useState(!1),c=C.useRef(null),o=R.find(i=>i.value===e)??R[0];return C.useEffect(()=>{if(!s)return;const i=v=>{var h;(h=c.current)!=null&&h.contains(v.target)||n(!1)},u=v=>{v.key==="Escape"&&n(!1)};return document.addEventListener("mousedown",i),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",u)}},[s]),C.useEffect(()=>{t&&n(!1)},[t]),a.jsxs("div",{className:"chat-effort-picker",ref:c,children:[a.jsxs("button",{type:"button",className:"chat-effort-trigger","aria-label":`Reasoning effort: ${o.label}`,"aria-haspopup":"listbox","aria-expanded":s,disabled:t,onClick:()=>n(i=>!i),children:[a.jsx("span",{children:o.label}),a.jsx(Z,{size:13,"aria-hidden":"true"})]}),s&&a.jsxs("div",{className:"chat-effort-menu",role:"listbox","aria-label":"Reasoning effort",children:[a.jsx("div",{className:"chat-effort-menu-label","aria-hidden":"true",children:"Reasoning effort"}),R.map(i=>a.jsxs("button",{type:"button",className:`chat-effort-option${i.value===e?" is-selected":""}`,role:"option","aria-selected":i.value===e,onClick:()=>{r(i.value),n(!1)},children:[a.jsxs("span",{className:"chat-effort-option-copy",children:[a.jsx("strong",{children:i.label}),a.jsx("small",{children:i.description})]}),i.value===e&&a.jsx(Q,{size:15,"aria-hidden":"true"})]},i.value))]})]})},_e=({text:e,mentions:r,scrollTop:t=0,variant:s="composer"})=>{const n=[];let c=0;for(const o of[...r].sort((i,u)=>i.start-u.start)){const i=e.slice(o.start,o.end),u=i===o.title||i===`@${o.title}`;o.starte.length||!u||(n.push(e.slice(c,o.start)),n.push(a.jsx("span",{className:`chat-paper-inline-highlight${o.unavailable?" is-unavailable":""}`,"data-paper-route-id":o.route_id,children:i},o.key)),c=o.end)}return n.push(e.slice(c)),e.endsWith(` +`)&&n.push("​"),a.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${s}`,children:a.jsx("div",{style:{transform:`translateY(-${t}px)`},children:n})})},be=({open:e,query:r,results:t,activeIndex:s,loading:n,error:c,onSelect:o,id:i="chat-paper-picker",optionIdPrefix:u="chat-paper-option"})=>{if(!e)return null;const v=r.trim()?n?"Searching papers…":c?"Paper search is unavailable":t.length?`${t.length} paper${t.length===1?"":"s"} found`:"No papers found":"Type to search papers";return a.jsxs("div",{className:"chat-paper-picker",id:i,role:"listbox","aria-label":"Paper results",children:[a.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:v}),t.map((h,p)=>{const D=h.arxiv_id||h.id,S=h.arxiv_id||(()=>{try{return h.source_url?new URL(h.source_url).hostname:"External resource"}catch{return"External resource"}})();return a.jsxs("button",{type:"button",id:`${u}-${p}`,role:"option","aria-selected":p===s,className:`chat-paper-option${p===s?" is-active":""}`,onMouseDown:E=>{E.preventDefault(),o(h)},children:[a.jsx("span",{className:"chat-paper-option-title",children:h.title}),a.jsx("span",{className:"chat-paper-option-meta",children:S})]},D)})]})},re=10,ne=3;function F(e,r){const s=e.slice(0,r).lastIndexOf("@");if(s<0)return null;const n=s>0?e[s-1]:"";if(n&&/[\p{L}\p{M}\p{N}_@]/u.test(n))return null;const c=e.slice(s+1,r);return/[\n\r@]/.test(c)?null:{start:s,end:r,query:c}}function B(e,r,t){let s=0;for(;si.end<=s?[i]:i.start>=c?[{...i,start:i.start+o,end:i.end+o}]:[])}function Se({draft:e,onChange:r,enabled:t,textareaRef:s}){var L;const n=`chat-paper-picker-${d.useId().replace(/:/g,"")}`,c=`${n}-option`,[o,i]=d.useState(null),[u,v]=d.useState(""),[h,p]=d.useState(0),[D,S]=d.useState(""),E=d.useRef(new Set);d.useEffect(()=>{t||i(null)},[t]),d.useEffect(()=>{const l=window.setTimeout(()=>v((o==null?void 0:o.query.trim())??""),150);return()=>window.clearTimeout(l)},[o==null?void 0:o.query]);const w=ee({queryKey:["chat-paper-mention-search",u.toLowerCase()],queryFn:({signal:l})=>X.search(u,1,10,"hybrid",l),enabled:t&&!!o&&u.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),g=d.useMemo(()=>{var l;return((l=w.data)==null?void 0:l.results)??[]},[(L=w.data)==null?void 0:L.results]);d.useEffect(()=>p(0),[u]),d.useEffect(()=>{var l;(l=document.getElementById(`${c}-${h}`))==null||l.scrollIntoView({block:"nearest"})},[h,c]);const Y=d.useCallback(l=>{var y;if(!t){i(null);return}const f=l??((y=s.current)==null?void 0:y.selectionStart)??e.text.length;if(e.paperMentions.some(_=>f>_.start&&f<=_.end)){i(null);return}i(F(e.text,f))},[e.paperMentions,e.text,t,s]),K=d.useCallback((l,f)=>{var k;const y=B(e.text,l,e.paperMentions);r({text:l,paperMentions:y});const x=f??((k=s.current)==null?void 0:k.selectionStart)??l.length;t&&!y.some(j=>x>j.start&&x<=j.end)?i(F(l,x)):i(null)},[e,t,r,s]),P=d.useCallback(l=>{if(!o)return!1;const f=l.arxiv_id||l.id,y=new Set(e.paperMentions.map(b=>b.route_id));if(e.paperMentions.length>=re)return S("A message can contain at most 10 paper mentions."),!1;if(!y.has(f)&&y.size>=ne)return S("A message can attach at most 3 distinct papers."),!1;const _=l.title,x=e.text.slice(o.end),k=x.length===0,j=e.text.slice(0,o.start)+_+(k?" ":"")+x,z=B(e.text,j,e.paperMentions),H={key:crypto.randomUUID(),route_id:f,title:l.title,source:l.source==="external"?"external":"arxiv",start:o.start,end:o.start+_.length};return r({text:j,paperMentions:[...z,H].sort((b,T)=>b.start-T.start)}),i(null),S(""),window.requestAnimationFrame(()=>{var T,q;const b=H.end+(k||x.startsWith(" ")?1:0);(T=s.current)==null||T.focus(),(q=s.current)==null||q.setSelectionRange(b,b)}),E.current.has(f)||(E.current.add(f),J.prewarmChatPaperContext(f).catch(()=>{})),!0},[o,e,r,s]),V=d.useCallback(l=>!o||l.nativeEvent.isComposing?!1:l.key==="Tab"?(i(null),!1):l.key==="Escape"?(l.preventDefault(),i(null),!0):l.key==="ArrowDown"||l.key==="ArrowUp"?(l.preventDefault(),g.length&&p(f=>l.key==="ArrowDown"?(f+1)%g.length:(f-1+g.length)%g.length),!0):l.key==="Home"&&g.length?(l.preventDefault(),p(0),!0):l.key==="End"&&g.length?(l.preventDefault(),p(g.length-1),!0):l.key==="Enter"&&!l.shiftKey?(l.preventDefault(),g[h]?P(g[h]):w.isFetching||i(null),!0):!1,[o,h,g,w.isFetching,P]);return{open:!!o,query:(o==null?void 0:o.query)??"",results:g,activeIndex:h,loading:w.isFetching,error:w.isError,message:D,pickerId:n,optionIdPrefix:c,updateText:K,refresh:Y,select:P,keyDown:V,close:()=>i(null)}}const ke=({enabled:e,onChange:r,disabled:t=!1})=>a.jsxs("button",{type:"button",className:`chat-web-search-toggle${e?" is-enabled":""}`,role:"switch","aria-checked":e,"aria-label":"Web search",title:"Allow public-web search when useful; enabled search queries are processed by Exa",disabled:t,onClick:()=>r(!e),children:[a.jsx(te,{size:15,"aria-hidden":"true"}),a.jsx("span",{children:"Web"})]}),$="pwc:chat-oauth-draft",M="pwc:chat-oauth-model",I="pwc:chat-oauth-auto-send",ae="pwc:chat-oauth-attempted",A="pwc:chat-web-search-enabled",O="pwc:chat-reasoning-effort";function je(e,r,t={}){const s=typeof e=="string"?e:e.text,n=s.length-s.trimStart().length,c=s.trim();if(!c)return;const o=n+c.length,i={text:c,paperMentions:typeof e=="string"?[]:e.paperMentions.filter(u=>u.start>=n&&u.end<=o).map(u=>({...u,start:u.start-n,end:u.end-n}))};sessionStorage.setItem($,i.paperMentions.length?JSON.stringify(i):c),t.autoSend===!1?sessionStorage.removeItem(I):sessionStorage.setItem(I,"1"),r?sessionStorage.setItem(M,r):sessionStorage.removeItem(M),t.webSearchEnabled?sessionStorage.setItem(A,"1"):sessionStorage.removeItem(A),sessionStorage.setItem(O,t.reasoningEffort??"low")}function Ee(){var s;if(typeof window>"u"||sessionStorage.getItem(I)!=="1")return null;const e=(s=sessionStorage.getItem($))==null?void 0:s.trim();if(!e)return null;let r={text:e,paperMentions:[]};try{const n=JSON.parse(e);typeof n.text=="string"&&Array.isArray(n.paperMentions)&&(r=n)}catch{}const t=r.text.trim();return t?{prompt:t,draft:{...r,text:t},model:sessionStorage.getItem(M),webSearchEnabled:sessionStorage.getItem(A)==="1",reasoningEffort:["low","high","max"].includes(sessionStorage.getItem(O)??"")?sessionStorage.getItem(O):"low"}:null}function Te(){sessionStorage.removeItem($),sessionStorage.removeItem(M),sessionStorage.removeItem(I),sessionStorage.removeItem(ae),sessionStorage.removeItem(A),sessionStorage.removeItem(O)}const U="deepseek-ai/DeepSeek-V4-Flash-0731",Ce=[{id:U,label:"DeepSeek V4 Flash",provider:"openrouter"}],Me=[{id:U,label:"DeepSeek V4 Flash",provider:"openrouter"}];async function m(e,r){const t=await fetch(W(e),{credentials:"include",headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(!t.ok){const s=await t.json().catch(()=>null),n=s==null?void 0:s.detail;throw new Error((n==null?void 0:n.message)||n||`Chat request failed (${t.status})`)}return t.status===204?void 0:t.json()}class oe extends Error{constructor(r,t){super(r),this.status=t}}async function ie(e){const r=await fetch(W(e),{headers:{Accept:"application/json"}});if(!r.ok){const t=await r.json().catch(()=>null),s=t==null?void 0:t.detail;throw new oe((s==null?void 0:s.message)||s||`Shared conversation request failed (${r.status})`,r.status)}return r.json()}async function Ie(){const e=[];let r=null;do{const t=new URLSearchParams({limit:"50"});r&&t.set("cursor",r);const s=await m(`/api/v1/chat/sessions?${t.toString()}`);e.push(...s.items),r=s.next_cursor}while(r&&e.length<100);return e}function Ae(e,r="low"){return m("/api/v1/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:r})})}function Oe(e){return m(`/api/v1/chat/sessions/${e}`)}function De(e,r){return m(`/api/v1/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(r)})}function Pe(e){return m(`/api/v1/chat/sessions/${e}`,{method:"DELETE"})}function Re(){return m("/api/v1/chat/sessions/archive-old",{method:"POST"})}function Ne(){return m("/api/v1/chat/sessions/archive-oldest",{method:"POST"})}function $e(e){return m(`/api/v1/chat/sessions/${e}/cancel`,{method:"POST"})}function Le(e){return m(`/api/v1/chat/sessions/${e}/share`,{method:"POST"})}function He(e){return ie(`/api/v1/chat/shares/${encodeURIComponent(e)}`)}async function qe(){return m("/api/v1/chat/models")}function N(e,r){const t=e.map(s=>s.kind==="reasoning"?{...s,active:!1,open:!1}:s.kind==="tool"?{...s,status:s.status==="running"?"error":s.status,open:r&&(s.status==="error"||s.status==="denied"||s.status==="running")}:{...s,done:!0});return t.filter((s,n)=>{const c=t[n-1];return!(s.kind==="reasoning"&&(c==null?void 0:c.kind)==="reasoning"&&s.text===c.text)})}function Fe(e){const r=t=>t==="hf_inference_billing_exhausted"?"Hugging Face could not bill this request. Your included credits may be exhausted; enable or review pay-as-you-go billing in Settings.":t==="hf_inference_credential_expired"?"Your Hugging Face Inference Providers authorization is missing or expired. Re-sign in with Hugging Face to continue.":t==="provider_rate_limit"?"The selected model is temporarily rate-limited. Try again shortly.":t==="provider_timeout"?"The model provider timed out. Try again shortly.":t==="openrouter_monthly_budget_exhausted"?"The remaining shared Papers With Code OpenRouter allowance was not enough to continue this response.":t==="openrouter_staging_funding_disabled"?"Shared staging credits have ended because chat is now live on paperswithcode.co. Continue there with your included monthly allowance.":t==="openrouter_unavailable"?"OpenRouter is currently unavailable. However, you can still bring your own key in Settings.":t==="openrouter_byok_credential_invalid"?"Your OpenRouter API key is no longer valid. Reconnect it in Settings, then try again.":t==="openrouter_byok_billing_error"?"Your OpenRouter key is connected, but OpenRouter rejected billing for the account behind it. A key spending limit is not an account credit balance. Add credits or enable pay-as-you-go in OpenRouter, then try again.":t==="openrouter_byok_rate_limit"?"Your OpenRouter API key is temporarily rate-limited.":["provider_error","provider_unavailable"].includes(t??"")?"The model provider failed before completing the response. You can edit and retry your question.":t==="persistence_error"?"The response could not be saved. You can edit and retry your question.":t==="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 e.messages.flatMap(t=>{if(t.role==="assistant")return[{id:t.id,role:"assistant",blocks:N(t.display_blocks,!0),followups:t.followups,citations:t.citations,finishReason:t.finish_reason??void 0,streaming:!1}];const s={id:t.id,role:"user",text:t.content,paperMentions:(t.paper_mentions??[]).map(c=>({...c,key:c.occurrence_id})),revision:t.revision,status:t.status,error:t.status==="complete"?void 0:t.error_code||t.status};if(!["error","interrupted"].includes(t.status))return[s];const n=t.status==="interrupted";return[s,{id:`${t.id}-${n?"interrupted":"error"}`,role:"assistant",blocks:N(t.display_blocks,!0),streaming:!1,finishReason:n?"stopped":void 0,error:n?void 0:r(t.error_code),errorCode:n?void 0:t.error_code??void 0}]})}function Be(e){return e.messages.map(r=>r.role==="user"?{id:r.id,role:"user",text:r.content,paperMentions:(r.paper_mentions??[]).map(t=>({...t,key:t.occurrence_id}))}:{id:r.id,role:"assistant",blocks:N(r.display_blocks,!1),citations:r.citations,finishReason:r.finish_reason??void 0,error:r.error??void 0,streaming:!1})}function We(e){const r=Date.now(),t=new Date().setHours(0,0,0,0),s=[{label:"Today",items:[]},{label:"Previous 7 Days",items:[]},{label:"Previous 30 Days",items:[]},{label:"Older",items:[]}];for(const n of[...e].sort((c,o)=>Date.parse(o.updated_at)-Date.parse(c.updated_at))){const c=Date.parse(n.updated_at),o=r-c;c>=t?s[0].items.push(n):o<7*864e5?s[1].items.push(n):o<30*864e5?s[2].items.push(n):s[3].items.push(n)}return s.filter(n=>n.items.length>0)}export{ge as A,Be as B,$ as C,U as D,He as E,pe as F,de as G,fe as H,xe as M,Ce as P,we as R,Me as S,ye as T,ke as W,_e as a,be as b,Ae as c,$e as d,M as e,O as f,Oe as g,I as h,ae as i,Te as j,qe as k,Ie as l,me as m,ve as n,We as o,he as p,je as q,Ee as r,De as s,Fe as t,Se as u,Pe as v,Le as w,Ne as x,Re as y,oe as z}; diff --git a/assets/chevron-down-D6vo9F6c.js b/assets/chevron-down-D8AKxdK5.js similarity index 85% rename from assets/chevron-down-D6vo9F6c.js rename to assets/chevron-down-D8AKxdK5.js index 28adb73287c6eaabaf5234d13a2a369ab9043c94..58ddd6fe9f6a9b704817519cef425004da977476 100644 --- a/assets/chevron-down-D6vo9F6c.js +++ b/assets/chevron-down-D8AKxdK5.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-D9_nPZtO.js";/** +import{d as o}from"./index-Czt286FG.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-I1TZu4fL.js b/assets/circle-check-51xwSfKm.js similarity index 87% rename from assets/circle-check-I1TZu4fL.js rename to assets/circle-check-51xwSfKm.js index d1d048e95e6df74982f5eeaabafe24f56809d27f..79adb974d69bea051efd003673bc7bebb8b67592 100644 --- a/assets/circle-check-I1TZu4fL.js +++ b/assets/circle-check-51xwSfKm.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-D9_nPZtO.js";/** +import{d as c}from"./index-Czt286FG.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codexAddEvals-Xch_LMp1.js b/assets/codexAddEvals-CMSsCOlW.js similarity index 97% rename from assets/codexAddEvals-Xch_LMp1.js rename to assets/codexAddEvals-CMSsCOlW.js index 5b64b99d5a9a832f1335f24462a0f2f917e8309c..395efe08b1e314c5a75695019c3b1d9856499080 100644 --- a/assets/codexAddEvals-Xch_LMp1.js +++ b/assets/codexAddEvals-CMSsCOlW.js @@ -1,4 +1,4 @@ -import{d as o,j as i,v as c,aa as d,e as n}from"./index-D9_nPZtO.js";/** +import{d as o,j as i,v as c,V as d,e as n}from"./index-Czt286FG.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/components-DrTew0nD.js b/assets/components-D0aZHC0e.js similarity index 82% rename from assets/components-DrTew0nD.js rename to assets/components-D0aZHC0e.js index 491b1b16b2fdac07d685ce65e72e389536fd6c8c..18dbd7f5e3cbed9fa9e497fd1c52f7c520f4f5e0 100644 --- a/assets/components-DrTew0nD.js +++ b/assets/components-D0aZHC0e.js @@ -1 +1 @@ -import{k as R,R as p,c as E,j as e,L,u as S}from"./index-D9_nPZtO.js";import{L as T,a as P}from"./LatexTitle-BtRWGRIx.js";import{h as Z,d as H,a as B,c as D}from"./transform-BObV5jzB.js";import{s as C}from"./safeExternalHref-CkBrsh84.js";const G=({slug:t,label:s,onClick:r})=>{const a=S(),x=Z(t),o=D(x),i=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:i,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),H(s||B(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const x=o=>{if(o.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=p.useRef(null),a=p.useRef(null),[x,o]=p.useState(t.length);if(p.useLayoutEffect(()=>{const n=r.current,h=a.current;if(!n||!h||t.length===0)return;const l=f=>(h.textContent=f,h.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let d=0,u=0;for(const N of t){const m=l(N.measureText);if(d+m<=f)d+=m,u+=1;else break}if(u0&&d+l(` · +${t.length-u} more`)>f;)u-=1,d-=l(t[u].measureText);u===0&&(u=1)}o(u)};M();const g=new ResizeObserver(M);return g.observe(n),()=>g.disconnect()},[t]),t.length===0)return null;const i=t.slice(0,Math.max(1,Math.min(x,t.length))),c=t.length-i.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),i.map((n,h)=>e.jsxs(p.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[h>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.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:l=>l.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${h}`)),c>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",c," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=p.useMemo(()=>{const o=[];let i=!0;for(const c of[1,2,3]){const n=t.filter(h=>h.rank===c);n.forEach((h,l)=>{const M=l===0,g=M?`${i?"":" · "}${$[c]} on `:", ";o.push({name:h.name,slug:h.slug,rank:c,isGroupStart:M,measureText:g+h.name})}),n.length>0&&(i=!1)}return o},[t]),x=p.useMemo(()=>[1,2,3].map(o=>t.filter(c=>c.rank===o).map((c,n)=>({name:c.name,slug:c.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${$[o]} on `:", ")+c.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))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},K=({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"})]}),_=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)},V=({paperId:t})=>{const s=_(t),r=160,a=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,i=[],c=9+Math.floor(s()*3);for(let k=0;k.3,h=Math.floor(s()*3),l=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:d+(r-d*2)*(1-k)/2,y:z+v*2.4,width:(r-d*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:d+(r-d*2)*(1-o)/2,y:W,width:(r-d*2)*o,height:.9,fill:g,opacity:.7,rx:.2}),e.jsx("rect",{x:d,y:A,width:6,height:1,fill:f,opacity:.6}),i.map((k,v)=>{const y=j+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:N,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:m,y:j,width:u,height:14,fill:"#F0EBE0",stroke:g,strokeWidth:.3,opacity:.9}),h===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${m+2},${j+11} ${m+6},${j+8} ${m+10},${j+9} ${m+14},${j+5} ${m+18},${j+6} ${m+22},${j+3}`})}),h===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:m+u/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:m+2,y:j+11,width:u-4,height:1.5,fill:g})]}),h===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:m+3,y:j+5,width:u-6,height:1,fill:f}),e.jsx("rect",{x:m+6,y:j+8,width:u-12,height:.8,fill:f})]})]}),l.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:m,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`r${v}`)})]})})},q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[x,o]=p.useState(!1),[i,c]=p.useState(0),[n,h]=p.useState(a),l=p.useRef(null);p.useEffect(()=>{o(!1),c(0)},[r]);const M=p.useMemo(()=>{if(!r)return null;if(i===0)return r;const g=r.includes("?")?"&":"?";return`${r}${g}retry=${i}`},[r,i]);return p.useEffect(()=>{if(a||n)return;const g=l.current;if(!g)return;const f=new IntersectionObserver(([d])=>{d.isIntersecting&&(h(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(g),()=>f.disconnect()},[a,n]),r&&!x?e.jsx("div",{ref:l,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:(a||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(i<1){c(g=>g+1);return}o(!0)}},M)}):e.jsx(V,{paperId:t})},Y="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Q(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function J(t){return t.tags.includes(Y)?t.methods.filter(s=>!Q(s)):t.methods}const X=({name:t,slug:s,logoUrl:r})=>{const[a,x]=p.useState(!1);return!r||a?null:e.jsx(L,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},oe=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a})=>{const x=R(),o=`/paper/${t.id}`,i=p.useCallback(()=>{x.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>E.getPaperByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,x]),c=t.authors.slice(0,3).join(", "),n=t.authors.length,h=J(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:o,className:"paper-thumb-wrap",onFocus:i,onMouseEnter:i,children:e.jsx(q,{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.jsxs("h3",{className:"paper-title",children:[e.jsx(L,{to:o,onFocus:i,onMouseEnter:i,children:e.jsx(T,{title:t.title})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(l=>e.jsx(X,{...l},l.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[c,n>3&&e.jsxs("span",{children:[", ","+",n-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[n>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[n>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(P,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:o}),(t.tags.length>0||h.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(l=>e.jsx(G,{slug:l,onClick:a},l)),h.map(l=>e.jsx(O,{method:l},l.id||l.slug||l.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[C(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:l=>l.stopPropagation(),children:[e.jsx(K,{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:"↑"}),ee(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),C(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:l=>l.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 ee(t){return t.toFixed(1)}export{K as I,O as M,oe as P,I as S,G as T,q as a}; +import{k as R,R as p,p as E,j as e,L,u as S}from"./index-Czt286FG.js";import{L as T,a as P}from"./LatexTitle-BMNMJu5R.js";import{h as Z,d as H,a as B,c as D}from"./transform-IZH7YNlm.js";import{s as C}from"./safeExternalHref-CkBrsh84.js";const G=({slug:t,label:s,onClick:r})=>{const a=S(),x=Z(t),o=D(x),i=c=>{if(c.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:o.bg,color:o.text},onClick:i,children:[e.jsx("span",{className:"dot",style:{background:o.dot}}),H(s||B(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const x=o=>{if(o.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:x,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},F=({units:t,paperHref:s})=>{const r=p.useRef(null),a=p.useRef(null),[x,o]=p.useState(t.length);if(p.useLayoutEffect(()=>{const n=r.current,h=a.current;if(!n||!h||t.length===0)return;const l=f=>(h.textContent=f,h.scrollWidth),M=()=>{const f=n.clientWidth;if(f<=0)return;let d=0,u=0;for(const N of t){const m=l(N.measureText);if(d+m<=f)d+=m,u+=1;else break}if(u0&&d+l(` · +${t.length-u} more`)>f;)u-=1,d-=l(t[u].measureText);u===0&&(u=1)}o(u)};M();const g=new ResizeObserver(M);return g.observe(n),()=>g.disconnect()},[t]),t.length===0)return null;const i=t.slice(0,Math.max(1,Math.min(x,t.length))),c=t.length-i.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),i.map((n,h)=>e.jsxs(p.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[h>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.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:l=>l.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.slug||n.name}-${h}`)),c>0&&e.jsxs(L,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",c," more"]})]})},I=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=p.useMemo(()=>{const o=[];let i=!0;for(const c of[1,2,3]){const n=t.filter(h=>h.rank===c);n.forEach((h,l)=>{const M=l===0,g=M?`${i?"":" · "}${$[c]} on `:", ";o.push({name:h.name,slug:h.slug,rank:c,isGroupStart:M,measureText:g+h.name})}),n.length>0&&(i=!1)}return o},[t]),x=p.useMemo(()=>[1,2,3].map(o=>t.filter(c=>c.rank===o).map((c,n)=>({name:c.name,slug:c.slug,rank:o,isGroupStart:n===0,measureText:(n===0?`${$[o]} on `:", ")+c.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))}):a.length===0?null:e.jsx(F,{units:a,paperHref:s})},K=({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"})]}),_=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)},V=({paperId:t})=>{const s=_(t),r=160,a=220,x=[.85+s()*.1,.55+s()*.25],o=.45+s()*.3,i=[],c=9+Math.floor(s()*3);for(let k=0;k.3,h=Math.floor(s()*3),l=[],M=6+Math.floor(s()*3);for(let k=0;ke.jsx("rect",{x:d+(r-d*2)*(1-k)/2,y:z+v*2.4,width:(r-d*2)*k,height:1.4,fill:f,rx:.3},`t${v}`)),e.jsx("rect",{x:d+(r-d*2)*(1-o)/2,y:A,width:(r-d*2)*o,height:.9,fill:g,opacity:.7,rx:.2}),e.jsx("rect",{x:d,y:W,width:6,height:1,fill:f,opacity:.6}),i.map((k,v)=>{const y=j+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:N,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:m,y:j,width:u,height:14,fill:"#F0EBE0",stroke:g,strokeWidth:.3,opacity:.9}),h===0&&e.jsx("g",{stroke:f,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${m+2},${j+11} ${m+6},${j+8} ${m+10},${j+9} ${m+14},${j+5} ${m+18},${j+6} ${m+22},${j+3}`})}),h===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:m+u/2,cy:j+7,r:3.5,fill:f}),e.jsx("rect",{x:m+2,y:j+11,width:u-4,height:1.5,fill:g})]}),h===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:m+3,y:j+5,width:u-6,height:1,fill:f}),e.jsx("rect",{x:m+6,y:j+8,width:u-12,height:.8,fill:f})]})]}),l.map((k,v)=>{const y=j+(n?16:0)+v*2.1;return y>a-d-1?null:e.jsx("rect",{x:m,y,width:u*k,height:.8,fill:g,opacity:.55,rx:.2},`r${v}`)})]})})},q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[x,o]=p.useState(!1),[i,c]=p.useState(0),[n,h]=p.useState(a),l=p.useRef(null);p.useEffect(()=>{o(!1),c(0)},[r]);const M=p.useMemo(()=>{if(!r)return null;if(i===0)return r;const g=r.includes("?")?"&":"?";return`${r}${g}retry=${i}`},[r,i]);return p.useEffect(()=>{if(a||n)return;const g=l.current;if(!g)return;const f=new IntersectionObserver(([d])=>{d.isIntersecting&&(h(!0),f.disconnect())},{rootMargin:"250px"});return f.observe(g),()=>f.disconnect()},[a,n]),r&&!x?e.jsx("div",{ref:l,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:(a||n)&&M&&e.jsx("img",{src:M,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(i<1){c(g=>g+1);return}o(!0)}},M)}):e.jsx(V,{paperId:t})},Y="language-modeling";function w(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function Q(t){return w(t.slug)==="large language model"||w(t.name)==="large language model"}function J(t){return t.tags.includes(Y)?t.methods.filter(s=>!Q(s)):t.methods}const X=({name:t,slug:s,logoUrl:r})=>{const[a,x]=p.useState(!1);return!r||a?null:e.jsx(L,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>x(!0)})})},oe=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a})=>{const x=R(),o=`/paper/${t.id}`,i=p.useCallback(()=>{x.prefetchQuery({queryKey:["paper-arxiv",t.id],queryFn:()=>E.getByArxivId(t.id,!0),staleTime:10*60*1e3})},[t.id,x]),c=t.authors.slice(0,3).join(", "),n=t.authors.length,h=J(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(L,{to:o,className:"paper-thumb-wrap",onFocus:i,onMouseEnter:i,children:e.jsx(q,{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.jsxs("h3",{className:"paper-title",children:[e.jsx(L,{to:o,onFocus:i,onMouseEnter:i,children:e.jsx(T,{title:t.title})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(l=>e.jsx(X,{...l},l.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[c,n>3&&e.jsxs("span",{children:[", ","+",n-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[n>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[n>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(P,{text:t.abstract})}),t.sotaRanks.length>0&&e.jsx(I,{ranks:t.sotaRanks,paperHref:o}),(t.tags.length>0||h.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(l=>e.jsx(G,{slug:l,onClick:a},l)),h.map(l=>e.jsx(O,{method:l},l.id||l.slug||l.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[C(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:l=>l.stopPropagation(),children:[e.jsx(K,{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:"↑"}),ee(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),C(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:C(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:l=>l.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 ee(t){return t.toFixed(1)}export{K as I,O as M,oe as P,I as S,G as T,q as a}; diff --git a/assets/dialog-CJthLFv3.js b/assets/dialog-CJthLFv3.js new file mode 100644 index 0000000000000000000000000000000000000000..53bca500de122f89e691e0c0213be63071805cb1 --- /dev/null +++ b/assets/dialog-CJthLFv3.js @@ -0,0 +1,5 @@ +import{r as s,j as i,Y,n as Z,O as R,P as N,a0 as K,m as D,q as x,t as U,o as h,a1 as X,a2 as J,a3 as Q,a4 as ee,a5 as te,a8 as oe,X as ne,v as p}from"./index-Czt286FG.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?Y(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(K,{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(J,{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 Q(),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-DnjY6ZOM.js b/assets/dialog-DnjY6ZOM.js deleted file mode 100644 index f744f1ff8a209f7f4c4efad149c7297e530406ef..0000000000000000000000000000000000000000 --- a/assets/dialog-DnjY6ZOM.js +++ /dev/null @@ -1,5 +0,0 @@ -import{r as s,j as i,ac as Z,o as K,a6 as R,P as h,ag as U,n as D,q as x,t as X,p as N,ah as Y,ai as J,aj as Q,ak as ee,al as te,ao as oe,X as ne,v as p}from"./index-D9_nPZtO.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?Z(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]=X(C),[de,f]=b(C),P=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]=K({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})};P.displayName=C;var O="DialogTrigger",ue=s.forwardRef((e,t)=>{const{__scopeDialog:o,...a}=e,n=f(O,o),r=N(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=O;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(h,{present:o||r.open,children:i.jsx(U,{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(h,{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(J,{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(h,{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=N(t,o.contentRef,a);return s.useEffect(()=>{const r=a.current;if(r)return Y(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=N(t,d);return Q(),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=P,Re=w,V=A,H=T,B=F,z=W,he=k;const we=Ce,Ne=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(Ne,{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(he,{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 Pe=s.forwardRef(({className:e,...t},o)=>i.jsx(z,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));Pe.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,Pe as d,je as e}; diff --git a/assets/ExternalSourceEvalBadge-DXfuqNnO.css b/assets/evaluations-DXfuqNnO.css similarity index 100% rename from assets/ExternalSourceEvalBadge-DXfuqNnO.css rename to assets/evaluations-DXfuqNnO.css diff --git a/assets/evaluations-DoOZeNPs.js b/assets/evaluations-DoOZeNPs.js new file mode 100644 index 0000000000000000000000000000000000000000..50be25457034d263c992dea7d03bc3bf5d104a41 --- /dev/null +++ b/assets/evaluations-DoOZeNPs.js @@ -0,0 +1 @@ +import{j as a,L as u,ac as h,ad as l}from"./index-Czt286FG.js";import{H as c,a as d,b as p}from"./hover-card-g7QtmX4K.js";import{s as g}from"./safeExternalHref-CkBrsh84.js";const y=()=>a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(p,{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"," ",a.jsx(u,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function m(r){if(!r)return"Evaluation sourced outside this paper";const e=r.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(r,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return r}}const w=({sourceUrl:r})=>{const e=g(r),t=typeof r=="string"&&r.startsWith("/paper/")?r:null,s=m(r);return a.jsxs(c,{openDelay:120,closeDelay:120,children:[a.jsx(d,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${s}`,children:"External"})}),a.jsxs(p,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(u,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:s}),"."]}):a.jsxs(a.Fragment,{children:[" ",s,"."]})]})]})};class x{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(s=>s[1]!==void 0).map(([s,n])=>[s,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return l.primeEvaluations(e,t)}batch(e,t){return l.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const s=await this.list({...e,page_size:100}),n=[...s.results];let i=s.next_page;for(;i;){const o=await this.list({...e,page:i,page_size:100});n.push(...o.results),i=o.next_page}return n}}const S=new x(h);export{y as C,w as E,S as e}; diff --git a/assets/external-link-DlvfPaEN.js b/assets/external-link-D9s3iGdi.js similarity index 89% rename from assets/external-link-DlvfPaEN.js rename to assets/external-link-D9s3iGdi.js index 866c76535469fc0c4cf347f58d063693c5ea85e5..34777db76cba10b02338d8cfc2c5541e7204f393 100644 --- a/assets/external-link-DlvfPaEN.js +++ b/assets/external-link-D9s3iGdi.js @@ -1,4 +1,4 @@ -import{d as a}from"./index-D9_nPZtO.js";/** +import{d as a}from"./index-Czt286FG.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-CM_ChV1A.js b/assets/file-text-D3BfQF99.js similarity index 91% rename from assets/file-text-CM_ChV1A.js rename to assets/file-text-D3BfQF99.js index 7c82dec6374660b139e3b41fbf4adea6e71e96d9..0d297a4309c5608694c7d907b32febf5121ffbcd 100644 --- a/assets/file-text-CM_ChV1A.js +++ b/assets/file-text-D3BfQF99.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-D9_nPZtO.js";/** +import{d as e}from"./index-Czt286FG.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-DYxu-4Fs.js b/assets/github-Cy0ZQSs0.js similarity index 96% rename from assets/github-DYxu-4Fs.js rename to assets/github-Cy0ZQSs0.js index 0ee5e576dfc36560c5bac0cf1d7dc14c2d5ee703..d88ae06c47145a18478797550527cfbd88b34285 100644 --- a/assets/github-DYxu-4Fs.js +++ b/assets/github-Cy0ZQSs0.js @@ -1 +1 @@ -import{e as l}from"./index-D9_nPZtO.js";const u=new Set(["github.com","www.github.com"]);function c(o){let n;try{n=new URL(o)}catch{return null}if(n.protocol!=="https:"||!u.has(n.hostname))return null;const r=n.pathname.split("/").filter(Boolean);if(r.length!==2)return null;let e,t;try{e=decodeURIComponent(r[0]),t=decodeURIComponent(r[1]).replace(/\.git$/,"")}catch{return null}if(!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$/.test(e)||!/^[a-zA-Z0-9._-]{1,100}$/.test(t))return null;const i=`${e}/${t}`,s=[e,t].map(encodeURIComponent).join("/");return{owner:e,repository:t,repoId:i,url:`https://github.com/${s}`}}async function h(o,n){const r=[o.owner,o.repository].map(encodeURIComponent).join("/"),e=await fetch(l(`/api/v1/github/repositories/${r}/preview`),{signal:n});if(!e.ok)throw new Error(`GitHub repository lookup failed: ${e.status}`);const t=await e.json();return{description:typeof t.description=="string"?t.description:null,stars:typeof t.stars=="number"?t.stars:0,forks:typeof t.forks=="number"?t.forks:0,language:typeof t.language=="string"?t.language:null,archived:t.archived===!0,avatarUrl:typeof t.avatar_url=="string"?t.avatar_url:""}}function a(o){const n=o.trim();if(!n)return null;let r=n;!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`https://${r}`);try{const e=new URL(r);if(e.hostname.toLowerCase()!=="github.com")return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<2)return null;const i=t[0].toLowerCase();let s=t[1].toLowerCase();return s.endsWith(".git")&&(s=s.slice(0,-4)),`https://github.com/${i}/${s}`}catch{return null}}function f(o,n){const r=a(o),e=a(n);return r&&e?r===e:o.trim()===n.trim()}export{h as f,f as g,a as n,c as p}; +import{e as l}from"./index-Czt286FG.js";const u=new Set(["github.com","www.github.com"]);function c(o){let n;try{n=new URL(o)}catch{return null}if(n.protocol!=="https:"||!u.has(n.hostname))return null;const r=n.pathname.split("/").filter(Boolean);if(r.length!==2)return null;let e,t;try{e=decodeURIComponent(r[0]),t=decodeURIComponent(r[1]).replace(/\.git$/,"")}catch{return null}if(!/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$/.test(e)||!/^[a-zA-Z0-9._-]{1,100}$/.test(t))return null;const i=`${e}/${t}`,s=[e,t].map(encodeURIComponent).join("/");return{owner:e,repository:t,repoId:i,url:`https://github.com/${s}`}}async function h(o,n){const r=[o.owner,o.repository].map(encodeURIComponent).join("/"),e=await fetch(l(`/api/v1/github/repositories/${r}/preview`),{signal:n});if(!e.ok)throw new Error(`GitHub repository lookup failed: ${e.status}`);const t=await e.json();return{description:typeof t.description=="string"?t.description:null,stars:typeof t.stars=="number"?t.stars:0,forks:typeof t.forks=="number"?t.forks:0,language:typeof t.language=="string"?t.language:null,archived:t.archived===!0,avatarUrl:typeof t.avatar_url=="string"?t.avatar_url:""}}function a(o){const n=o.trim();if(!n)return null;let r=n;!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`https://${r}`);try{const e=new URL(r);if(e.hostname.toLowerCase()!=="github.com")return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<2)return null;const i=t[0].toLowerCase();let s=t[1].toLowerCase();return s.endsWith(".git")&&(s=s.slice(0,-4)),`https://github.com/${i}/${s}`}catch{return null}}function f(o,n){const r=a(o),e=a(n);return r&&e?r===e:o.trim()===n.trim()}export{h as f,f as g,a as n,c as p}; diff --git a/assets/github-DngRIean.js b/assets/github-HgTw2jEK.js similarity index 92% rename from assets/github-DngRIean.js rename to assets/github-HgTw2jEK.js index af57741b434ea7c4c0b056d9371a1c52e118a571..744762ce8cde2616adab66ed1292d780d0786ea0 100644 --- a/assets/github-DngRIean.js +++ b/assets/github-HgTw2jEK.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-D9_nPZtO.js";/** +import{d as c}from"./index-Czt286FG.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-DVeX2fQl.js b/assets/hover-card-DVeX2fQl.js deleted file mode 100644 index faabc7fe188d53db27afc4e58f6a0e0bceead934..0000000000000000000000000000000000000000 --- a/assets/hover-card-DVeX2fQl.js +++ /dev/null @@ -1 +0,0 @@ -import{r as n,o as k,j as c,ad as F,ae as I,n as U,q as l,af as T,P as O,ag as $,t as W,p as z,al as B,am as G,an as K,v as q}from"./index-D9_nPZtO.js";var E,b="HoverCard",[y]=W(b,[T]),w=T(),[V,S]=y(b),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(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(V,{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=S(_,r),i=w(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,g(a.onOpen)),onPointerLeave:l(e.onPointerLeave,g(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",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(J,{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=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(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,g(i.onOpen)),onPointerLeave:l(e.onPointerLeave,g(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=S(R,r),C=w(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=w(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function g(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/hover-card-g7QtmX4K.js b/assets/hover-card-g7QtmX4K.js new file mode 100644 index 0000000000000000000000000000000000000000..22a21e575674f080e35687fb939b88e31069c0c9 --- /dev/null +++ b/assets/hover-card-g7QtmX4K.js @@ -0,0 +1 @@ +import{r as n,n as k,j as c,Z as F,_ as I,m as U,q as l,$ as T,P as O,a0 as $,t as W,o as z,a5 as B,a6 as G,a7 as K,v as q}from"./index-Czt286FG.js";var E,g="HoverCard",[y]=W(g,[T]),w=T(),[V,S]=y(g),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:f=700,closeDelay:v=300}=e,d=w(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:g}),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(V,{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=g;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=w(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,b(a.onOpen)),onPointerLeave:l(e.onPointerLeave,b(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",[Z,J]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(Z,{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=J(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(Q,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,b(i.onOpen)),onPointerLeave:l(e.onPointerLeave,b(i.onClose)),ref:o})})});A.displayName=R;var Q=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=S(R,r),C=w(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)"}})})}),X="HoverCardArrow",Y=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=w(r);return c.jsx(K,{...a,...s,ref:o})});Y.displayName=X;function b(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-XzA0bTLC.js b/assets/index-Bzn4VKTO.js similarity index 99% rename from assets/index-XzA0bTLC.js rename to assets/index-Bzn4VKTO.js index 8b07baedeb7747a896a39b1ba023b53e10e5959a..dbf5119e5db522ba9a70275a9a30f10d57d23050 100644 --- a/assets/index-XzA0bTLC.js +++ b/assets/index-Bzn4VKTO.js @@ -1,4 +1,4 @@ -import{ar as nn,as as or,j as pn}from"./index-D9_nPZtO.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{aa as nn,ab as or,j as pn}from"./index-Czt286FG.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;++Hi.map(i=>d[i]); +var T0=Object.defineProperty;var hf=e=>{throw TypeError(e)};var R0=(e,t,n)=>t in e?T0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Lt=(e,t,n)=>R0(e,typeof t!="symbol"?t+"":t,n),Sl=(e,t,n)=>t.has(e)||hf("Cannot "+n);var N=(e,t,n)=>(Sl(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>t.has(e)?hf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(Sl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Oe=(e,t,n)=>(Sl(e,t,"access private method"),n);var rs=(e,t,n,r)=>({set _(o){W(e,t,o,n)},get _(){return N(e,t,r)}});function N0(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 iO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Up={exports:{}},Aa={},Bp={exports:{}},Z={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Bi=Symbol.for("react.element"),O0=Symbol.for("react.portal"),A0=Symbol.for("react.fragment"),M0=Symbol.for("react.strict_mode"),j0=Symbol.for("react.profiler"),L0=Symbol.for("react.provider"),I0=Symbol.for("react.context"),D0=Symbol.for("react.forward_ref"),$0=Symbol.for("react.suspense"),F0=Symbol.for("react.memo"),z0=Symbol.for("react.lazy"),pf=Symbol.iterator;function U0(e){return e===null||typeof e!="object"?null:(e=pf&&e[pf]||e["@@iterator"],typeof e=="function"?e:null)}var Vp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wp=Object.assign,Hp={};function Ao(e,t,n){this.props=e,this.context=t,this.refs=Hp,this.updater=n||Vp}Ao.prototype.isReactComponent={};Ao.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ao.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function qp(){}qp.prototype=Ao.prototype;function Oc(e,t,n){this.props=e,this.context=t,this.refs=Hp,this.updater=n||Vp}var Ac=Oc.prototype=new qp;Ac.constructor=Oc;Wp(Ac,Ao.prototype);Ac.isPureReactComponent=!0;var gf=Array.isArray,Kp=Object.prototype.hasOwnProperty,Mc={current:null},Gp={key:!0,ref:!0,__self:!0,__source:!0};function Qp(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Kp.call(t,r)&&!Gp.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,F=O[B];if(0>>1;Bo(fe,L))yeo(J,fe)?(O[B]=J,O[ye]=L,B=ye):(O[B]=fe,O[X]=L,B=X);else if(yeo(J,L))O[B]=J,O[ye]=L,B=ye;else break e}}return k}function o(O,k){var L=O.sortIndex-k.sortIndex;return L!==0?L:O.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,p=3,h=!1,E=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(O){for(var k=n(u);k!==null;){if(k.callback===null)r(u);else if(k.startTime<=O)r(u),k.sortIndex=k.expirationTime,t(l,k);else break;k=n(u)}}function S(O){if(y=!1,w(O),!E)if(n(l)!==null)E=!0,U(C);else{var k=n(u);k!==null&&H(S,k.startTime-O)}}function C(O,k){E=!1,y&&(y=!1,v(R),R=-1),h=!0;var L=p;try{for(w(k),d=n(l);d!==null&&(!(d.expirationTime>k)||O&&!z());){var B=d.callback;if(typeof B=="function"){d.callback=null,p=d.priorityLevel;var F=B(d.expirationTime<=k);k=e.unstable_now(),typeof F=="function"?d.callback=F:d===n(l)&&r(l),w(k)}else r(l);d=n(l)}if(d!==null)var G=!0;else{var X=n(u);X!==null&&H(S,X.startTime-k),G=!1}return G}finally{d=null,p=L,h=!1}}var _=!1,P=null,R=-1,j=5,M=-1;function z(){return!(e.unstable_now()-MO||125B?(O.sortIndex=L,t(u,O),n(l)===null&&O===n(u)&&(y?(v(R),R=-1):y=!0,H(S,L-B))):(O.sortIndex=F,t(l,O),E||h||(E=!0,U(C))),O},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(O){var k=p;return function(){var L=p;p=k;try{return O.apply(this,arguments)}finally{p=L}}}})(eg);Zp.exports=eg;var J0=Zp.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Z0=f,it=J0;function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pu=Object.prototype.hasOwnProperty,ex=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,vf={},yf={};function tx(e){return pu.call(yf,e)?!0:pu.call(vf,e)?!1:ex.test(e)?yf[e]=!0:(vf[e]=!0,!1)}function nx(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function rx(e,t,n,r){if(t===null||typeof t>"u"||nx(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function We(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new We(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new We(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new We(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new We(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){je[e]=new We(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new We(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new We(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new We(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new We(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lc=/[\-:]([a-z])/g;function Ic(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Lc,Ic);je[t]=new We(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Lc,Ic);je[t]=new We(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Lc,Ic);je[t]=new We(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new We(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new We("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new We(e,1,!1,e.toLowerCase(),null,!0,!0)});function Dc(e,t,n,r){var o=je.hasOwnProperty(t)?je[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` +`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{_l=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Zo(e):""}function ox(e){switch(e.tag){case 5:return Zo(e.type);case 16:return Zo("Lazy");case 13:return Zo("Suspense");case 19:return Zo("SuspenseList");case 0:case 2:case 15:return e=bl(e.type,!1),e;case 11:return e=bl(e.type.render,!1),e;case 1:return e=bl(e.type,!0),e;default:return""}}function yu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Wr:return"Fragment";case Vr:return"Portal";case gu:return"Profiler";case $c:return"StrictMode";case mu:return"Suspense";case vu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case rg:return(e.displayName||"Context")+".Consumer";case ng:return(e._context.displayName||"Context")+".Provider";case Fc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case zc:return t=e.displayName||null,t!==null?t:yu(e.type)||"Memo";case kn:t=e._payload,e=e._init;try{return yu(e(t))}catch{}}return null}function ix(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return yu(t);case 8:return t===$c?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Qn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ig(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sx(e){var t=ig(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ss(e){e._valueTracker||(e._valueTracker=sx(e))}function sg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ig(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Gs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function wu(e,t){var n=t.checked;return me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Qn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ag(e,t){t=t.checked,t!=null&&Dc(e,"checked",t,!1)}function xu(e,t){ag(e,t);var n=Qn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Su(e,t.type,n):t.hasOwnProperty("defaultValue")&&Su(e,t.type,Qn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Su(e,t,n){(t!=="number"||Gs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ei=Array.isArray;function to(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=as.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var oi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ax=["Webkit","ms","Moz","O"];Object.keys(oi).forEach(function(e){ax.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),oi[t]=oi[e]})});function dg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||oi.hasOwnProperty(e)&&oi[e]?(""+t).trim():t+"px"}function fg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=dg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var lx=me({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _u(e,t){if(t){if(lx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(A(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(A(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(A(61))}if(t.style!=null&&typeof t.style!="object")throw Error(A(62))}}function bu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pu=null;function Uc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ku=null,no=null,ro=null;function _f(e){if(e=Hi(e)){if(typeof ku!="function")throw Error(A(280));var t=e.stateNode;t&&(t=$a(t),ku(e.stateNode,e.type,t))}}function hg(e){no?ro?ro.push(e):ro=[e]:no=e}function pg(){if(no){var e=no,t=ro;if(ro=no=null,_f(e),t)for(e=0;e>>=0,e===0?32:31-(wx(e)/xx|0)|0}var ls=64,us=4194304;function ti(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Js(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=ti(a):(i&=s,i!==0&&(r=ti(i)))}else s=n&~o,s!==0?r=ti(s):i!==0&&(r=ti(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Vi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=n}function _x(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=si),Mf=" ",jf=!1;function jg(e,t){switch(e){case"keyup":return Jx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hr=!1;function eS(e,t){switch(e){case"compositionend":return Lg(t);case"keypress":return t.which!==32?null:(jf=!0,Mf);case"textInput":return e=t.data,e===Mf&&jf?null:e;default:return null}}function tS(e,t){if(Hr)return e==="compositionend"||!Qc&&jg(e,t)?(e=Ag(),js=qc=Dn=null,Hr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$f(n)}}function Fg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zg(){for(var e=window,t=Gs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gs(e.document)}return t}function Yc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function cS(e){var t=zg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Fg(n.ownerDocument.documentElement,n)){if(r!==null&&Yc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Ff(n,i);var s=Ff(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,qr=null,Mu=null,li=null,ju=!1;function zf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ju||qr==null||qr!==Gs(r)||(r=qr,"selectionStart"in r&&Yc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),li&&Si(li,r)||(li=r,r=ta(Mu,"onSelect"),0Qr||(e.current=zu[Qr],zu[Qr]=null,Qr--)}function se(e,t){Qr++,zu[Qr]=e.current,e.current=t}var Yn={},Fe=er(Yn),Qe=er(!1),xr=Yn;function So(e,t){var n=e.type.contextTypes;if(!n)return Yn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ye(e){return e=e.childContextTypes,e!=null}function ra(){ue(Qe),ue(Fe)}function Kf(e,t,n){if(Fe.current!==Yn)throw Error(A(168));se(Fe,t),se(Qe,n)}function Qg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(A(108,ix(e)||"Unknown",o));return me({},n,r)}function oa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yn,xr=Fe.current,se(Fe,e),se(Qe,Qe.current),!0}function Gf(e,t,n){var r=e.stateNode;if(!r)throw Error(A(169));n?(e=Qg(e,t,xr),r.__reactInternalMemoizedMergedChildContext=e,ue(Qe),ue(Fe),se(Fe,e)):ue(Qe),se(Qe,n)}var tn=null,Fa=!1,Fl=!1;function Yg(e){tn===null?tn=[e]:tn.push(e)}function ES(e){Fa=!0,Yg(e)}function tr(){if(!Fl&&tn!==null){Fl=!0;var e=0,t=oe;try{var n=tn;for(oe=1;e>=s,o-=s,rn=1<<32-Tt(t)+o|n<R?(j=P,P=null):j=P.sibling;var M=p(v,P,w[R],S);if(M===null){P===null&&(P=j);break}e&&P&&M.alternate===null&&t(v,P),m=i(M,m,R),_===null?C=M:_.sibling=M,_=M,P=j}if(R===w.length)return n(v,P),de&&sr(v,R),C;if(P===null){for(;RR?(j=P,P=null):j=P.sibling;var z=p(v,P,M.value,S);if(z===null){P===null&&(P=j);break}e&&P&&z.alternate===null&&t(v,P),m=i(z,m,R),_===null?C=z:_.sibling=z,_=z,P=j}if(M.done)return n(v,P),de&&sr(v,R),C;if(P===null){for(;!M.done;R++,M=w.next())M=d(v,M.value,S),M!==null&&(m=i(M,m,R),_===null?C=M:_.sibling=M,_=M);return de&&sr(v,R),C}for(P=r(v,P);!M.done;R++,M=w.next())M=h(P,v,R,M.value,S),M!==null&&(e&&M.alternate!==null&&P.delete(M.key===null?R:M.key),m=i(M,m,R),_===null?C=M:_.sibling=M,_=M);return e&&P.forEach(function(D){return t(v,D)}),de&&sr(v,R),C}function x(v,m,w,S){if(typeof w=="object"&&w!==null&&w.type===Wr&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case is:e:{for(var C=w.key,_=m;_!==null;){if(_.key===C){if(C=w.type,C===Wr){if(_.tag===7){n(v,_.sibling),m=o(_,w.props.children),m.return=v,v=m;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===kn&&Xf(C)===_.type){n(v,_.sibling),m=o(_,w.props),m.ref=qo(v,_,w),m.return=v,v=m;break e}n(v,_);break}else t(v,_);_=_.sibling}w.type===Wr?(m=wr(w.props.children,v.mode,S,w.key),m.return=v,v=m):(S=Bs(w.type,w.key,w.props,null,v.mode,S),S.ref=qo(v,m,w),S.return=v,v=S)}return s(v);case Vr:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){n(v,m.sibling),m=o(m,w.children||[]),m.return=v,v=m;break e}else{n(v,m);break}else t(v,m);m=m.sibling}m=Kl(w,v.mode,S),m.return=v,v=m}return s(v);case kn:return _=w._init,x(v,m,_(w._payload),S)}if(ei(w))return E(v,m,w,S);if(Uo(w))return y(v,m,w,S);ms(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(n(v,m.sibling),m=o(m,w),m.return=v,v=m):(n(v,m),m=ql(w,v.mode,S),m.return=v,v=m),s(v)):n(v,m)}return x}var Co=em(!0),tm=em(!1),aa=er(null),la=null,Jr=null,ed=null;function td(){ed=Jr=la=null}function nd(e){var t=aa.current;ue(aa),e._currentValue=t}function Vu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function io(e,t){la=e,ed=Jr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(ed!==e)if(e={context:e,memoizedValue:t,next:null},Jr===null){if(la===null)throw Error(A(308));Jr=e,la.dependencies={lanes:0,firstContext:e}}else Jr=Jr.next=e;return t}var ur=null;function rd(e){ur===null?ur=[e]:ur.push(e)}function nm(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,rd(t)):(n.next=o.next,o.next=n),t.interleaved=n,un(e,r)}function un(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Tn=!1;function od(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function sn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,un(e,n)}return o=r.interleaved,o===null?(t.next=t,rd(r)):(t.next=o.next,o.next=t),r.interleaved=t,un(e,n)}function Is(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vc(e,n)}}function Jf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ua(e,t,n,r){var o=e.updateQueue;Tn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,c=u=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var E=e,y=a;switch(p=t,h=n,y.tag){case 1:if(E=y.payload,typeof E=="function"){d=E.call(h,d,p);break e}d=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=y.payload,p=typeof E=="function"?E.call(h,d,p):E,p==null)break e;d=me({},d,p);break e;case 2:Tn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,s|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Cr|=s,e.lanes=s,e.memoizedState=d}}function Zf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ul.transition;Ul.transition={};try{e(!1),t()}finally{oe=n,Ul.transition=r}}function xm(){return mt().memoizedState}function PS(e,t,n){var r=qn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Sm(e))Em(t,n);else if(n=nm(e,t,n,r),n!==null){var o=Be();Rt(n,e,r,o),Cm(n,t,r)}}function kS(e,t,n){var r=qn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sm(e))Em(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Nt(a,s)){var l=t.interleaved;l===null?(o.next=o,rd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=nm(e,t,o,r),n!==null&&(o=Be(),Rt(n,e,r,o),Cm(n,t,r))}}function Sm(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function Em(e,t){ui=da=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Cm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vc(e,n)}}var fa={readContext:gt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},TS={readContext:gt,useCallback:function(e,t){return Ft().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:th,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$s(4194308,4,gm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $s(4194308,4,e,t)},useInsertionEffect:function(e,t){return $s(4,2,e,t)},useMemo:function(e,t){var n=Ft();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ft();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=PS.bind(null,pe,e),[r.memoizedState,e]},useRef:function(e){var t=Ft();return e={current:e},t.memoizedState=e},useState:eh,useDebugValue:fd,useDeferredValue:function(e){return Ft().memoizedState=e},useTransition:function(){var e=eh(!1),t=e[0];return e=bS.bind(null,e[1]),Ft().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pe,o=Ft();if(de){if(n===void 0)throw Error(A(407));n=n()}else{if(n=t(),Te===null)throw Error(A(349));Er&30||am(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,th(um.bind(null,r,i,e),[e]),r.flags|=2048,Ri(9,lm.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ft(),t=Te.identifierPrefix;if(de){var n=on,r=rn;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ki++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Vt]=t,e[_i]=r,Mm(e,t,!1,!1),t.stateNode=e;e:{switch(s=bu(n,r),n){case"dialog":le("cancel",e),le("close",e),o=r;break;case"iframe":case"object":case"embed":le("load",e),o=r;break;case"video":case"audio":for(o=0;oPo&&(t.flags|=128,r=!0,Ko(i,!1),t.lanes=4194304)}else{if(!r)if(e=ca(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ko(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!de)return Ie(t),null}else 2*Se()-i.renderingStartTime>Po&&n!==1073741824&&(t.flags|=128,r=!0,Ko(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Se(),t.sibling=null,n=he.current,se(he,r?n&1|2:n&1),t):(Ie(t),null);case 22:case 23:return yd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ze&1073741824&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),null;case 24:return null;case 25:return null}throw Error(A(156,t.tag))}function IS(e,t){switch(Jc(t),t.tag){case 1:return Ye(t.type)&&ra(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _o(),ue(Qe),ue(Fe),ad(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return sd(t),null;case 13:if(ue(he),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));Eo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(he),null;case 4:return _o(),null;case 10:return nd(t.type._context),null;case 22:case 23:return yd(),null;case 24:return null;default:return null}}var ys=!1,$e=!1,DS=typeof WeakSet=="function"?WeakSet:Set,$=null;function Zr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function Ju(e,t,n){try{n()}catch(r){xe(e,t,r)}}var fh=!1;function $S(e,t){if(Lu=Zs,e=zg(),Yc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=e,p=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++u===o&&(a=s),p===i&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Iu={focusedElem:e,selectionRange:n},Zs=!1,$=t;$!==null;)if(t=$,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$=e;else for(;$!==null;){t=$;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var y=E.memoizedProps,x=E.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ct(t.type,y),x);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(A(163))}}catch(S){xe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,$=e;break}$=t.return}return E=fh,fh=!1,E}function ci(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Ju(t,n,i)}o=o.next}while(o!==r)}}function Ba(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Zu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Im(e){var t=e.alternate;t!==null&&(e.alternate=null,Im(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vt],delete t[_i],delete t[Fu],delete t[xS],delete t[SS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Dm(e){return e.tag===5||e.tag===3||e.tag===4}function hh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=na));else if(r!==4&&(e=e.child,e!==null))for(ec(e,t,n),e=e.sibling;e!==null;)ec(e,t,n),e=e.sibling}function tc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(tc(e,t,n),e=e.sibling;e!==null;)tc(e,t,n),e=e.sibling}var Ae=null,Pt=!1;function En(e,t,n){for(n=n.child;n!==null;)$m(e,t,n),n=n.sibling}function $m(e,t,n){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(ja,n)}catch{}switch(n.tag){case 5:$e||Zr(n,t);case 6:var r=Ae,o=Pt;Ae=null,En(e,t,n),Ae=r,Pt=o,Ae!==null&&(Pt?(e=Ae,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ae.removeChild(n.stateNode));break;case 18:Ae!==null&&(Pt?(e=Ae,n=n.stateNode,e.nodeType===8?$l(e.parentNode,n):e.nodeType===1&&$l(e,n),wi(e)):$l(Ae,n.stateNode));break;case 4:r=Ae,o=Pt,Ae=n.stateNode.containerInfo,Pt=!0,En(e,t,n),Ae=r,Pt=o;break;case 0:case 11:case 14:case 15:if(!$e&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Ju(n,t,s),o=o.next}while(o!==r)}En(e,t,n);break;case 1:if(!$e&&(Zr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){xe(n,t,a)}En(e,t,n);break;case 21:En(e,t,n);break;case 22:n.mode&1?($e=(r=$e)||n.memoizedState!==null,En(e,t,n),$e=r):En(e,t,n);break;default:En(e,t,n)}}function ph(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new DS),t.forEach(function(r){var o=KS.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function St(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Se()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zS(r/1960))-r,10e?16:e,$n===null)var r=!1;else{if(e=$n,$n=null,ga=0,ne&6)throw Error(A(331));var o=ne;for(ne|=4,$=e.current;$!==null;){var i=$,s=i.child;if($.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lSe()-md?yr(e,0):gd|=n),Xe(e,t)}function qm(e,t){t===0&&(e.mode&1?(t=us,us<<=1,!(us&130023424)&&(us=4194304)):t=1);var n=Be();e=un(e,t),e!==null&&(Vi(e,t,n),Xe(e,n))}function qS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qm(e,n)}function KS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(A(314))}r!==null&&r.delete(t),qm(e,n)}var Km;Km=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qe.current)Ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ge=!1,jS(e,t,n);Ge=!!(e.flags&131072)}else Ge=!1,de&&t.flags&1048576&&Xg(t,sa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fs(e,t),e=t.pendingProps;var o=So(t,Fe.current);io(t,n),o=ud(null,t,r,e,o,n);var i=cd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ye(r)?(i=!0,oa(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,od(t),o.updater=Ua,t.stateNode=o,o._reactInternals=t,Hu(t,r,e,n),t=Gu(null,t,r,!0,i,n)):(t.tag=0,de&&i&&Xc(t),ze(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fs(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=QS(r),e=Ct(r,e),o){case 0:t=Ku(null,t,r,e,n);break e;case 1:t=uh(null,t,r,e,n);break e;case 11:t=ah(null,t,r,e,n);break e;case 14:t=lh(null,t,r,Ct(r.type,e),n);break e}throw Error(A(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ct(r,o),Ku(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ct(r,o),uh(e,t,r,o,n);case 3:e:{if(Nm(t),e===null)throw Error(A(387));r=t.pendingProps,i=t.memoizedState,o=i.element,rm(e,t),ua(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=bo(Error(A(423)),t),t=ch(e,t,r,n,o);break e}else if(r!==o){o=bo(Error(A(424)),t),t=ch(e,t,r,n,o);break e}else for(nt=Vn(t.stateNode.containerInfo.firstChild),rt=t,de=!0,kt=null,n=tm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Eo(),r===o){t=cn(e,t,n);break e}ze(e,t,r,n)}t=t.child}return t;case 5:return om(t),e===null&&Bu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Du(r,o)?s=null:i!==null&&Du(r,i)&&(t.flags|=32),Rm(e,t),ze(e,t,s,n),t.child;case 6:return e===null&&Bu(t),null;case 13:return Om(e,t,n);case 4:return id(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Co(t,null,r,n):ze(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ct(r,o),ah(e,t,r,o,n);case 7:return ze(e,t,t.pendingProps,n),t.child;case 8:return ze(e,t,t.pendingProps.children,n),t.child;case 12:return ze(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,se(aa,r._currentValue),r._currentValue=s,i!==null)if(Nt(i.value,s)){if(i.children===o.children&&!Qe.current){t=cn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=sn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Vu(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(A(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Vu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}ze(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,io(t,n),o=gt(o),r=r(o),t.flags|=1,ze(e,t,r,n),t.child;case 14:return r=t.type,o=Ct(r,t.pendingProps),o=Ct(r.type,o),lh(e,t,r,o,n);case 15:return km(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ct(r,o),Fs(e,t),t.tag=1,Ye(r)?(e=!0,oa(t)):e=!1,io(t,n),_m(t,r,o),Hu(t,r,o,n),Gu(null,t,r,!0,e,n);case 19:return Am(e,t,n);case 22:return Tm(e,t,n)}throw Error(A(156,t.tag))};function Gm(e,t){return Sg(e,t)}function GS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ft(e,t,n,r){return new GS(e,t,n,r)}function xd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function QS(e){if(typeof e=="function")return xd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Fc)return 11;if(e===zc)return 14}return 2}function Kn(e,t){var n=e.alternate;return n===null?(n=ft(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Bs(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")xd(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Wr:return wr(n.children,o,i,t);case $c:s=8,o|=8;break;case gu:return e=ft(12,n,t,o|2),e.elementType=gu,e.lanes=i,e;case mu:return e=ft(13,n,t,o),e.elementType=mu,e.lanes=i,e;case vu:return e=ft(19,n,t,o),e.elementType=vu,e.lanes=i,e;case og:return Wa(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ng:s=10;break e;case rg:s=9;break e;case Fc:s=11;break e;case zc:s=14;break e;case kn:s=16,r=null;break e}throw Error(A(130,e==null?e:typeof e,""))}return t=ft(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function wr(e,t,n,r){return e=ft(7,e,r,t),e.lanes=n,e}function Wa(e,t,n,r){return e=ft(22,e,r,t),e.elementType=og,e.lanes=n,e.stateNode={isHidden:!1},e}function ql(e,t,n){return e=ft(6,e,null,t),e.lanes=n,e}function Kl(e,t,n){return t=ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function YS(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kl(0),this.expirationTimes=kl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Sd(e,t,n,r,o,i,s,a,l){return e=new YS(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ft(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},od(i),e}function XS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jm)}catch(e){console.error(e)}}Jm(),Jp.exports=st;var Ki=Jp.exports;const Zm=zp(Ki);var ev,Eh=Ki;ev=Eh.createRoot,Eh.hydrateRoot;var ya=["light","dark"],bd="(prefers-color-scheme: dark)",nE=typeof window>"u",Pd=f.createContext(void 0),rE={setTheme:e=>{},themes:[]},oE=()=>{var e;return(e=f.useContext(Pd))!=null?e:rE},iE=e=>f.useContext(Pd)?e.children:f.createElement(aE,{...e}),sE=["light","dark"],aE=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:i=sE,defaultTheme:s=n?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:c})=>{let[d,p]=f.useState(()=>Ch(o,s)),[h,E]=f.useState(()=>Ch(o)),y=l?Object.values(l):i,x=f.useCallback(S=>{let C=S;if(!C)return;S==="system"&&n&&(C=_h());let _=l?l[C]:C,P=t?uE():null,R=document.documentElement;if(a==="class"?(R.classList.remove(...y),_&&R.classList.add(_)):_?R.setAttribute(a,_):R.removeAttribute(a),r){let j=ya.includes(s)?s:null,M=ya.includes(C)?C:j;R.style.colorScheme=M}P==null||P()},[]),v=f.useCallback(S=>{let C=typeof S=="function"?S(S):S;p(C);try{localStorage.setItem(o,C)}catch{}},[e]),m=f.useCallback(S=>{let C=_h(S);E(C),d==="system"&&n&&!e&&x("system")},[d,e]);f.useEffect(()=>{let S=window.matchMedia(bd);return S.addListener(m),m(S),()=>S.removeListener(m)},[m]),f.useEffect(()=>{let S=C=>{if(C.key!==o)return;let _=C.newValue||s;v(_)};return window.addEventListener("storage",S),()=>window.removeEventListener("storage",S)},[v]),f.useEffect(()=>{x(e??d)},[e,d]);let w=f.useMemo(()=>({theme:d,setTheme:v,forcedTheme:e,resolvedTheme:d==="system"?h:d,themes:n?[...i,"system"]:i,systemTheme:n?h:void 0}),[d,v,e,h,n,i]);return f.createElement(Pd.Provider,{value:w},f.createElement(lE,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:o,themes:i,defaultTheme:s,attribute:a,value:l,children:u,attrs:y,nonce:c}),u)},lE=f.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:s,attrs:a,nonce:l})=>{let u=i==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(E=>`'${E}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=o?ya.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(E,y=!1,x=!0)=>{let v=s?s[E]:E,m=y?E+"|| ''":`'${v}'`,w="";return o&&x&&!y&&ya.includes(E)&&(w+=`d.style.colorScheme = '${E}';`),n==="class"?y||v?w+=`c.add(${m})`:w+="null":v&&(w+=`d[s](n,${m})`),w},h=e?`!function(){${c}${p(e)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${bd}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${p(s?"x[e]":"e",!0)}}${u?"":"else{"+p(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${p(s?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${d}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})}),Ch=(e,t)=>{if(nE)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},uE=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},_h=e=>(e||(e=window.matchMedia(bd)),e.matches?"dark":"light");class cE extends T.Component{constructor(){super(...arguments);Lt(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n){console.error("The application could not render",n)}render(){return this.state.failed?g.jsx("main",{children:g.jsxs("div",{className:"page",role:"alert",children:[g.jsx("h1",{children:"This page could not load"}),g.jsx("p",{children:"The site may have been updated while this tab was open."}),g.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>window.location.reload(),children:"Reload page"})]})}):this.props.children}}const Gl="pwc:chunk-reload-at",tv=6e4;function dE(e,t){if(!e)return!0;const n=Number(e);return!Number.isFinite(n)||t-n>=tv}function fE(){if(typeof window>"u")return()=>{};const e=n=>{const r=Date.now();dE(sessionStorage.getItem(Gl),r)&&(n.preventDefault(),sessionStorage.setItem(Gl,String(r)),window.location.reload())};window.addEventListener("vite:preloadError",e);const t=window.setTimeout(()=>sessionStorage.removeItem(Gl),tv);return()=>{window.removeEventListener("vite:preloadError",e),window.clearTimeout(t)}}const hE="modulepreload",pE=function(e){return"/"+e},bh={},re=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=pE(l),l in bh)return;bh[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":hE,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((p,h)=>{d.addEventListener("load",p),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};/** + * @remix-run/router v1.23.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Oi(){return Oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Qa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vE(){return Math.random().toString(36).substr(2,8)}function kh(e,t){return{usr:e.state,key:e.key,idx:t}}function wa(e,t,n,r){return n===void 0&&(n=null),Oi({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Tr(t):t,{state:n,key:t&&t.key||r||vE()})}function Ai(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Tr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function nv(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=Fn.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(Oi({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){a=Fn.Pop;let x=c(),v=x==null?null:x-u;u=x,l&&l({action:a,location:y.location,delta:v})}function p(x,v){a=Fn.Push;let m=wa(y.location,x,v);n&&n(m,x),u=c()+1;let w=kh(m,u),S=y.createHref(m);try{s.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(S)}i&&l&&l({action:a,location:y.location,delta:1})}function h(x,v){a=Fn.Replace;let m=wa(y.location,x,v);n&&n(m,x),u=c();let w=kh(m,u),S=y.createHref(m);s.replaceState(w,"",S),i&&l&&l({action:a,location:y.location,delta:0})}function E(x){let v=o.location.origin!=="null"?o.location.origin:o.location.href,m=typeof x=="string"?x:Ai(x);return m=m.replace(/ $/,"%20"),ge(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let y={get action(){return a},get location(){return e(o,s)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Ph,d),l=x,()=>{o.removeEventListener(Ph,d),l=null}},createHref(x){return t(o,x)},createURL:E,encodeLocation(x){let v=E(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(x){return s.go(x)}};return y}var Th;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Th||(Th={}));function yE(e,t,n){return n===void 0&&(n="/"),wE(e,t,n)}function wE(e,t,n,r){let o=typeof t=="string"?Tr(t):t,i=ko(o.pathname||"/",n);if(i==null)return null;let s=rv(e);xE(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(ge(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Gn([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(ge(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),rv(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:kE(u,i.index),routesMeta:c})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of ov(i.path))o(i,s,l)}),t}function ov(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=ov(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function xE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:TE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const SE=/^:[\w-]+$/,EE=3,CE=2,_E=1,bE=10,PE=-2,Rh=e=>e==="*";function kE(e,t){let n=e.split("/"),r=n.length;return n.some(Rh)&&(r+=PE),t&&(r+=CE),n.filter(o=>!Rh(o)).reduce((o,i)=>o+(SE.test(i)?EE:i===""?_E:bE),r)}function TE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function RE(e,t,n){let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a{let{paramName:p,isOptional:h}=c;if(p==="*"){let y=a[d]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const E=a[d];return h&&!E?u[p]=void 0:u[p]=(E||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function NE(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Qa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function OE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qa(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ko(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const AE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ME=e=>AE.test(e);function jE(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Tr(e):e,i;if(n)if(ME(n))i=n;else{if(n.includes("//")){let s=n;n=n.replace(/\/\/+/g,"/"),Qa(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?i=Nh(n.substring(1),"/"):i=Nh(n,t)}else i=t;return{pathname:i,search:DE(r),hash:$E(o)}}function Nh(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Ql(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function LE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kd(e,t){let n=LE(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Td(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Tr(e):(o=Oi({},e),ge(!o.pathname||!o.pathname.includes("?"),Ql("?","pathname","search",o)),ge(!o.pathname||!o.pathname.includes("#"),Ql("#","pathname","hash",o)),ge(!o.search||!o.search.includes("#"),Ql("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),d-=1;o.pathname=p.join("/")}a=d>=0?t[d]:"/"}let l=jE(o,a),u=s&&s!=="/"&&s.endsWith("/"),c=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Gn=e=>e.join("/").replace(/\/\/+/g,"/"),IE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$E=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function FE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const iv=["post","put","patch","delete"];new Set(iv);const zE=["get",...iv];new Set(zE);/** + * React Router v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Mi(){return Mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),f.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=Td(u,JSON.parse(s),i,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Gn([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,s,i,e])}function uv(){let{matches:e}=f.useContext(gn),t=e[e.length-1];return t?t.params:{}}function Ja(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=f.useContext(pn),{matches:o}=f.useContext(gn),{pathname:i}=Mt(),s=JSON.stringify(kd(o,r.v7_relativeSplatPath));return f.useMemo(()=>Td(e,JSON.parse(s),i,n==="path"),[e,s,i,n])}function VE(e,t){return WE(e,t)}function WE(e,t,n,r){Lo()||ge(!1);let{navigator:o}=f.useContext(pn),{matches:i}=f.useContext(gn),s=i[i.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=Mt(),c;if(t){var d;let x=typeof t=="string"?Tr(t):t;l==="/"||(d=x.pathname)!=null&&d.startsWith(l)||ge(!1),c=x}else c=u;let p=c.pathname||"/",h=p;if(l!=="/"){let x=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let E=yE(e,{pathname:h}),y=QE(E&&E.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:Gn([l,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:Gn([l,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&y?f.createElement(Xa.Provider,{value:{location:Mi({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Fn.Pop}},y):y}function HE(){let e=ZE(),t=FE(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:o},n):null,null)}const qE=f.createElement(HE,null);class KE extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(gn.Provider,{value:this.props.routeContext},f.createElement(av.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function GE(e){let{routeContext:t,match:n,children:r}=e,o=f.useContext(Ya);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(gn.Provider,{value:t},r)}function QE(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let c=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||ge(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,p)=>{let h,E=!1,y=null,x=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||qE,l&&(u<0&&p===0?(t1("route-fallback"),E=!0,x=null):u===p&&(E=!0,x=d.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,p+1)),m=()=>{let w;return h?w=y:E?w=x:d.route.Component?w=f.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,f.createElement(GE,{match:d,routeContext:{outlet:c,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?f.createElement(KE,{location:n.location,revalidation:n.revalidation,component:y,error:h,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()},null)}var cv=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(cv||{}),dv=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(dv||{});function YE(e){let t=f.useContext(Ya);return t||ge(!1),t}function XE(e){let t=f.useContext(sv);return t||ge(!1),t}function JE(e){let t=f.useContext(gn);return t||ge(!1),t}function fv(e){let t=JE(),n=t.matches[t.matches.length-1];return n.route.id||ge(!1),n.route.id}function ZE(){var e;let t=f.useContext(av),n=XE(),r=fv();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function e1(){let{router:e}=YE(cv.UseNavigateStable),t=fv(dv.UseNavigateStable),n=f.useRef(!1);return lv(()=>{n.current=!0}),f.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Mi({fromRouteId:t},i)))},[e,t])}const Oh={};function t1(e,t,n){Oh[e]||(Oh[e]=!0)}function hv(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function To(e){let{to:t,replace:n,state:r,relative:o}=e;Lo()||ge(!1);let{future:i,static:s}=f.useContext(pn),{matches:a}=f.useContext(gn),{pathname:l}=Mt(),u=Rd(),c=Td(t,kd(a,i.v7_relativeSplatPath),l,o==="path"),d=JSON.stringify(c);return f.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:o}),[u,d,o,n,r]),null}function te(e){ge(!1)}function pv(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Fn.Pop,navigator:i,static:s=!1,future:a}=e;Lo()&&ge(!1);let l=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:l,navigator:i,static:s,future:Mi({v7_relativeSplatPath:!1},a)}),[l,a,i,s]);typeof r=="string"&&(r=Tr(r));let{pathname:c="/",search:d="",hash:p="",state:h=null,key:E="default"}=r,y=f.useMemo(()=>{let x=ko(c,l);return x==null?null:{location:{pathname:x,search:d,hash:p,state:h,key:E},navigationType:o}},[l,c,d,p,h,E,o]);return y==null?null:f.createElement(pn.Provider,{value:u},f.createElement(Xa.Provider,{children:n,value:y}))}function n1(e){let{children:t,location:n}=e;return VE(ac(t),n)}new Promise(()=>{});function ac(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,o)=>{if(!f.isValidElement(r))return;let i=[...t,o];if(r.type===f.Fragment){n.push.apply(n,ac(r.props.children,i));return}r.type!==te&&ge(!1),!r.props.index||!r.props.children||ge(!1);let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=ac(r.props.children,i)),n.push(s)}),n}/** + * React Router DOM v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function r1(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function o1(e,t){return e.button===0&&(!t||t==="_self")&&!r1(e)}function lc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function i1(e,t){let n=lc(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const s1=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],a1=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],l1="6";try{window.__reactRouterVersion=l1}catch{}const u1=f.createContext({isTransitioning:!1}),c1="startTransition",Sa=Ma[c1];function d1(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=gE({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&Sa?Sa(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>hv(r),[r]),f.createElement(pv,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}function f1(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=mE({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&Sa?Sa(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>hv(r),[r]),f.createElement(pv,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const h1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",p1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,en=f.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,p=gv(t,s1),{basename:h}=f.useContext(pn),E,y=!1;if(typeof u=="string"&&p1.test(u)&&(E=u,h1))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=ko(S.pathname,h);S.origin===w.origin&&C!=null?u=C+S.search+S.hash:y=!0}catch{}let x=UE(u,{relative:o}),v=m1(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:o,viewTransition:d});function m(w){r&&r(w),w.defaultPrevented||v(w)}return f.createElement("a",xa({},p,{href:E||x,onClick:y||i?r:m,ref:n,target:l}))}),or=f.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:l,viewTransition:u,children:c}=t,d=gv(t,a1),p=Ja(l,{relative:d.relative}),h=Mt(),E=f.useContext(sv),{navigator:y,basename:x}=f.useContext(pn),v=E!=null&&v1(p)&&u===!0,m=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;o||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&x&&(S=ko(S,x)||S);const C=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!s&&w.startsWith(m)&&w.charAt(C)==="/",P=S!=null&&(S===m||!s&&S.startsWith(m)&&S.charAt(m.length)==="/"),R={isActive:_,isPending:P,isTransitioning:v},j=_?r:void 0,M;typeof i=="function"?M=i(R):M=[i,_?"active":null,P?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let z=typeof a=="function"?a(R):a;return f.createElement(en,xa({},d,{"aria-current":j,className:M,ref:n,style:z,to:l,viewTransition:u}),typeof c=="function"?c(R):c)});var uc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(uc||(uc={}));var Ah;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ah||(Ah={}));function g1(e){let t=f.useContext(Ya);return t||ge(!1),t}function m1(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:a}=t===void 0?{}:t,l=Rd(),u=Mt(),c=Ja(e,{relative:s});return f.useCallback(d=>{if(o1(d,n)){d.preventDefault();let p=r!==void 0?r:Ai(u)===Ai(c);l(e,{replace:p,state:o,preventScrollReset:i,relative:s,viewTransition:a})}},[u,l,c,r,o,n,e,i,s,a])}function sO(e){let t=f.useRef(lc(e)),n=f.useRef(!1),r=Mt(),o=f.useMemo(()=>i1(r.search,n.current?null:t.current),[r.search]),i=Rd(),s=f.useCallback((a,l)=>{const u=lc(typeof a=="function"?a(o):a);n.current=!0,i("?"+u,l)},[i,o]);return[o,s]}function v1(e,t){t===void 0&&(t={});let n=f.useContext(u1);n==null&&ge(!1);let{basename:r}=g1(uc.useViewTransitionState),o=Ja(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=ko(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=ko(n.nextLocation.pathname,r)||n.nextLocation.pathname;return sc(o.pathname,s)!=null||sc(o.pathname,i)!=null}var Za=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fr,On,co,Op,y1=(Op=class extends Za{constructor(){super();ee(this,fr);ee(this,On);ee(this,co);W(this,co,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,On)||this.setEventListener(N(this,co))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,On))==null||t.call(this),W(this,On,void 0))}setEventListener(t){var n;W(this,co,t),(n=N(this,On))==null||n.call(this),W(this,On,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,fr)!==t&&(W(this,fr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,fr)=="boolean"?N(this,fr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fr=new WeakMap,On=new WeakMap,co=new WeakMap,Op),mv=new y1,w1={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},An,Nc,Ap,x1=(Ap=class{constructor(){ee(this,An,w1);ee(this,Nc,!1)}setTimeoutProvider(e){W(this,An,e)}setTimeout(e,t){return N(this,An).setTimeout(e,t)}clearTimeout(e){N(this,An).clearTimeout(e)}setInterval(e,t){return N(this,An).setInterval(e,t)}clearInterval(e){N(this,An).clearInterval(e)}},An=new WeakMap,Nc=new WeakMap,Ap),cc=new x1;function S1(e){setTimeout(e,0)}var E1=typeof window>"u"||"Deno"in globalThis;function _t(){}function C1(e,t){return typeof e=="function"?e(t):e}function _1(e){return typeof e=="number"&&e>=0&&e!==1/0}function b1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dc(e,t){return typeof e=="function"?e(t):e}function P1(e,t){return typeof e=="function"?e(t):e}function Mh(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Nd(s,t.options))return!1}else if(!Li(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function jh(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ji(t.options.mutationKey)!==ji(i))return!1}else if(!Li(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Nd(e,t){return((t==null?void 0:t.queryKeyHashFn)||ji)(e)}function ji(e){return JSON.stringify(e,(t,n)=>fc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Li(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Li(e[n],t[n])):!1}var k1=Object.prototype.hasOwnProperty;function vv(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Lh(e)&&Lh(t);if(!r&&!(fc(e)&&fc(t)))return t;const i=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),a=s.length,l=r?new Array(a):{};let u=0;for(let c=0;c{cc.setTimeout(t,e)})}function R1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?vv(e,t):t}function lO(e){return e}function N1(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function O1(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Od=Symbol();function yv(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Od?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function uO(e,t){return typeof e=="function"?e(...t):!!e}function A1(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var wv=(()=>{let e=()=>E1;return{isServer(){return e()},setIsServer(t){e=t}}})();function M1(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var j1=S1;function L1(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=j1;const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ue=L1(),fo,Mn,ho,Mp,I1=(Mp=class extends Za{constructor(){super();ee(this,fo,!0);ee(this,Mn);ee(this,ho);W(this,ho,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){N(this,Mn)||this.setEventListener(N(this,ho))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Mn))==null||t.call(this),W(this,Mn,void 0))}setEventListener(t){var n;W(this,ho,t),(n=N(this,Mn))==null||n.call(this),W(this,Mn,t(this.setOnline.bind(this)))}setOnline(t){N(this,fo)!==t&&(W(this,fo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,fo)}},fo=new WeakMap,Mn=new WeakMap,ho=new WeakMap,Mp),Ea=new I1;function D1(e){return Math.min(1e3*2**e,3e4)}function xv(e){return(e??"online")==="online"?Ea.isOnline():!0}var hc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Sv(e){let t=!1,n=0,r;const o=M1(),i=()=>o.status!=="pending",s=y=>{var x;if(!i()){const v=new hc(y);p(v),(x=e.onCancel)==null||x.call(e,v)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>mv.isFocused()&&(e.networkMode==="always"||Ea.isOnline())&&e.canRun(),c=()=>xv(e.networkMode)&&e.canRun(),d=y=>{i()||(r==null||r(),o.resolve(y))},p=y=>{i()||(r==null||r(),o.reject(y))},h=()=>new Promise(y=>{var x;r=v=>{(i()||u())&&y(v)},(x=e.onPause)==null||x.call(e)}).then(()=>{var y;r=void 0,i()||(y=e.onContinue)==null||y.call(e)}),E=()=>{if(i())return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(d).catch(v=>{var _;if(i())return;const m=e.retry??(wv.isServer()?0:3),w=e.retryDelay??D1,S=typeof w=="function"?w(n,v):w,C=m===!0||typeof m=="number"&&nu()?void 0:h()).then(()=>{t?p(v):E()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?E():h().then(E),o)}}var hr,jp,Ev=(jp=class{constructor(){ee(this,hr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_1(this.gcTime)&&W(this,hr,cc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wv.isServer()?1/0:5*60*1e3))}clearGcTimeout(){N(this,hr)!==void 0&&(cc.clearTimeout(N(this,hr)),W(this,hr,void 0))}},hr=new WeakMap,jp);function $1(e){return{onFetch:(t,n)=>{var c,d,p,h,E;const r=t.options,o=(p=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((E=t.state.data)==null?void 0:E.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const x=w=>{A1(w,()=>t.signal,()=>y=!0)},v=yv(t.options,t.fetchOptions),m=async(w,S,C)=>{if(y)return Promise.reject(t.signal.reason);if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return x(z),z})(),R=await v(P),{maxPages:j}=t.options,M=C?O1:N1;return{pages:M(w.pages,R,j),pageParams:M(w.pageParams,S,j)}};if(o&&i.length){const w=o==="backward",S=w?Cv:pc,C={pages:i,pageParams:s},_=S(r,C);a=await m(C,_,w)}else{const w=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:pc(r,a);if(l>0&&S==null)break;a=await m(a,S),l++}while(l{var y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function pc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Cv(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function cO(e,t){return t?pc(e,t)!=null:!1}function dO(e,t){return!t||!e.getPreviousPageParam?!1:Cv(e,t)!=null}var po,pr,go,ut,gr,Pe,Fi,mr,et,_v,Jt,Lp,F1=(Lp=class extends Ev{constructor(t){super();ee(this,et);ee(this,po);ee(this,pr);ee(this,go);ee(this,ut);ee(this,gr);ee(this,Pe);ee(this,Fi);ee(this,mr);W(this,mr,!1),W(this,Fi,t.defaultOptions),this.setOptions(t.options),this.observers=[],W(this,gr,t.client),W(this,ut,N(this,gr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,W(this,pr,$h(this.options)),this.state=t.state??N(this,pr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return N(this,po)}get promise(){var t;return(t=N(this,Pe))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,Fi),...t},t!=null&&t._type&&W(this,po,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=$h(this.options);n.data!==void 0&&(this.setState(Dh(n.data,n.dataUpdatedAt)),W(this,pr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,ut).remove(this)}setData(t,n){const r=R1(this.state.data,t,this.options);return Oe(this,et,Jt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Oe(this,et,Jt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=N(this,Pe))==null?void 0:r.promise;return(o=N(this,Pe))==null||o.cancel(t),n?n.then(_t).catch(_t):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return N(this,pr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>P1(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Od||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>dc(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!b1(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Pe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Pe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Pe)&&(N(this,mr)||Oe(this,et,_v).call(this)?N(this,Pe).cancel({revert:!0}):N(this,Pe).cancelRetry()),this.scheduleGc()),N(this,ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,et,Jt).call(this,{type:"invalidate"})}async fetch(t,n){var u,c,d,p,h,E,y,x,v,m,w;if(this.state.fetchStatus!=="idle"&&((u=N(this,Pe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,Pe))return N(this,Pe).continueRetry(),N(this,Pe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(C=>C.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(W(this,mr,!0),r.signal)})},i=()=>{const S=yv(this.options,n),_=(()=>{const P={client:N(this,gr),queryKey:this.queryKey,meta:this.meta};return o(P),P})();return W(this,mr,!1),this.options.persister?this.options.persister(S,_,this):S(_)},a=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:N(this,gr),state:this.state,fetchFn:i};return o(S),S})(),l=N(this,po)==="infinite"?$1(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),W(this,go,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Oe(this,et,Jt).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),W(this,Pe,Sv({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof hc&&S.revert&&this.setState({...N(this,go),fetchStatus:"idle"}),r.abort()},onFail:(S,C)=>{Oe(this,et,Jt).call(this,{type:"failed",failureCount:S,error:C})},onPause:()=>{Oe(this,et,Jt).call(this,{type:"pause"})},onContinue:()=>{Oe(this,et,Jt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await N(this,Pe).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(h=(p=N(this,ut).config).onSuccess)==null||h.call(p,S,this),(y=(E=N(this,ut).config).onSettled)==null||y.call(E,S,this.state.error,this),S}catch(S){if(S instanceof hc){if(S.silent)return N(this,Pe).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Oe(this,et,Jt).call(this,{type:"error",error:S}),(v=(x=N(this,ut).config).onError)==null||v.call(x,S,this),(w=(m=N(this,ut).config).onSettled)==null||w.call(m,this.state.data,S,this),S}finally{this.scheduleGc()}}},po=new WeakMap,pr=new WeakMap,go=new WeakMap,ut=new WeakMap,gr=new WeakMap,Pe=new WeakMap,Fi=new WeakMap,mr=new WeakMap,et=new WeakSet,_v=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Jt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...z1(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...Dh(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return W(this,go,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,ut).notify({query:this,type:"updated",action:t})})},Lp);function z1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xv(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Dh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function $h(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var zi,zt,De,vr,Ut,bn,Ip,U1=(Ip=class extends Ev{constructor(t){super();ee(this,Ut);ee(this,zi);ee(this,zt);ee(this,De);ee(this,vr);W(this,zi,t.client),this.mutationId=t.mutationId,W(this,De,t.mutationCache),W(this,zt,[]),this.state=t.state||B1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,zt).includes(t)||(N(this,zt).push(t),this.clearGcTimeout(),N(this,De).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){W(this,zt,N(this,zt).filter(n=>n!==t)),this.scheduleGc(),N(this,De).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,zt).length||(this.state.status==="pending"?this.scheduleGc():N(this,De).remove(this))}continue(){var t;return((t=N(this,vr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,l,u,c,d,p,h,E,y,x,v,m,w,S,C,_,P;const n=()=>{Oe(this,Ut,bn).call(this,{type:"continue"})},r={client:N(this,zi),meta:this.options.meta,mutationKey:this.options.mutationKey};W(this,vr,Sv({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,j)=>{Oe(this,Ut,bn).call(this,{type:"failed",failureCount:R,error:j})},onPause:()=>{Oe(this,Ut,bn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,De).canRun(this)}));const o=this.state.status==="pending",i=!N(this,vr).canStart();try{if(o)n();else{Oe(this,Ut,bn).call(this,{type:"pending",variables:t,isPaused:i}),N(this,De).config.onMutate&&await N(this,De).config.onMutate(t,this,r);const j=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t,r));j!==this.state.context&&Oe(this,Ut,bn).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const R=await N(this,vr).start();return await((u=(l=N(this,De).config).onSuccess)==null?void 0:u.call(l,R,t,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,R,t,this.state.context,r)),await((h=(p=N(this,De).config).onSettled)==null?void 0:h.call(p,R,null,this.state.variables,this.state.context,this,r)),await((y=(E=this.options).onSettled)==null?void 0:y.call(E,R,null,t,this.state.context,r)),Oe(this,Ut,bn).call(this,{type:"success",data:R}),R}catch(R){try{await((v=(x=N(this,De).config).onError)==null?void 0:v.call(x,R,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((w=(m=this.options).onError)==null?void 0:w.call(m,R,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((C=(S=N(this,De).config).onSettled)==null?void 0:C.call(S,void 0,R,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((P=(_=this.options).onSettled)==null?void 0:P.call(_,void 0,R,t,this.state.context,r))}catch(j){Promise.reject(j)}throw Oe(this,Ut,bn).call(this,{type:"error",error:R}),R}finally{N(this,De).runNext(this)}}},zi=new WeakMap,zt=new WeakMap,De=new WeakMap,vr=new WeakMap,Ut=new WeakSet,bn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ue.batch(()=>{N(this,zt).forEach(r=>{r.onMutationUpdate(t)}),N(this,De).notify({mutation:this,type:"updated",action:t})})},Ip);function B1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nn,bt,Ui,Dp,V1=(Dp=class extends Za{constructor(t={}){super();ee(this,nn);ee(this,bt);ee(this,Ui);this.config=t,W(this,nn,new Set),W(this,bt,new Map),W(this,Ui,0)}build(t,n,r){const o=new U1({client:t,mutationCache:this,mutationId:++rs(this,Ui)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){N(this,nn).add(t);const n=Ss(t);if(typeof n=="string"){const r=N(this,bt).get(n);r?r.push(t):N(this,bt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,nn).delete(t)){const n=Ss(t);if(typeof n=="string"){const r=N(this,bt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&N(this,bt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ss(t);if(typeof n=="string"){const r=N(this,bt).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Ss(t);if(typeof n=="string"){const o=(r=N(this,bt).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ue.batch(()=>{N(this,nn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,nn).clear(),N(this,bt).clear()})}getAll(){return Array.from(N(this,nn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>jh(n,r))}findAll(t={}){return this.getAll().filter(n=>jh(t,n))}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ue.batch(()=>Promise.all(t.map(n=>n.continue().catch(_t))))}},nn=new WeakMap,bt=new WeakMap,Ui=new WeakMap,Dp);function Ss(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Bt,$p,W1=($p=class extends Za{constructor(t={}){super();ee(this,Bt);this.config=t,W(this,Bt,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Nd(o,n);let s=this.get(i);return s||(s=new F1({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){N(this,Bt).has(t.queryHash)||(N(this,Bt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,Bt).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,Bt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ue.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,Bt).get(t)}getAll(){return[...N(this,Bt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Mh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Mh(t,r)):n}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Bt=new WeakMap,$p),we,jn,Ln,mo,vo,In,yo,wo,Fp,H1=(Fp=class{constructor(e={}){ee(this,we);ee(this,jn);ee(this,Ln);ee(this,mo);ee(this,vo);ee(this,In);ee(this,yo);ee(this,wo);W(this,we,e.queryCache||new W1),W(this,jn,e.mutationCache||new V1),W(this,Ln,e.defaultOptions||{}),W(this,mo,new Map),W(this,vo,new Map),W(this,In,0)}mount(){rs(this,In)._++,N(this,In)===1&&(W(this,yo,mv.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onFocus())})),W(this,wo,Ea.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onOnline())})))}unmount(){var e,t;rs(this,In)._--,N(this,In)===0&&((e=N(this,yo))==null||e.call(this),W(this,yo,void 0),(t=N(this,wo))==null||t.call(this),W(this,wo,void 0))}isFetching(e){return N(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,jn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,we).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(dc(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(this,we).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=N(this,we).get(r.queryHash),i=o==null?void 0:o.state.data,s=C1(t,i);if(s!==void 0)return N(this,we).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Ue.batch(()=>N(this,we).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,we);Ue.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,we);return Ue.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ue.batch(()=>N(this,we).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(_t).catch(_t)}invalidateQueries(e,t={}){return Ue.batch(()=>(N(this,we).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ue.batch(()=>N(this,we).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(_t)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(_t)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,we).build(this,t);return n.isStaleByTime(dc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_t).catch(_t)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_t).catch(_t)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ea.isOnline()?N(this,jn).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,we)}getMutationCache(){return N(this,jn)}getDefaultOptions(){return N(this,Ln)}setDefaultOptions(e){W(this,Ln,e)}setQueryDefaults(e,t){N(this,mo).set(ji(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,mo).values()],n={};return t.forEach(r=>{Li(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,vo).set(ji(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,vo).values()],n={};return t.forEach(r=>{Li(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Ln).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nd(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Od&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Ln).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,we).clear(),N(this,jn).clear()}},we=new WeakMap,jn=new WeakMap,Ln=new WeakMap,mo=new WeakMap,vo=new WeakMap,In=new WeakMap,yo=new WeakMap,wo=new WeakMap,Fp),bv=f.createContext(void 0),fO=e=>{const t=f.useContext(bv);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},q1=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(bv.Provider,{value:e,children:t}));const Fh=e=>e.endsWith("/")?e.slice(0,-1):e;function Ad(){const e="https://paperswithcode.co".trim();if(!e)return"";try{const t=e.startsWith("http")?new URL(e):new URL(e,typeof window<"u"?window.location.origin:"http://localhost");return Fh(t.origin)}catch{return Fh(e)}}function dr(e){const t=e.startsWith("/")?e:`/${e}`,n=Ad();return n?`${n}${t}`:t}function el(e){const t=e.startsWith("/")?e:`/${e}`;return dr(t)}function K1(){return el("/admin-dashboard")}function hO(e){if(!e)return null;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("//"))return e;if(e.startsWith("/")){const t=Ad();return t?`${t}${e}`:e}return e}function Gi(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function Ca(){const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function pO(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function G1(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}const Q1="/hf-logo.svg?v=20260513b",zh=({size:e=14})=>g.jsx("img",{src:Q1,alt:"",width:Math.round(e*95/88),height:e,"aria-hidden":"true",draggable:!1,style:{display:"block"}});function Y1(e,t=!1,n=!1){const r=el("/api/v1/auth/hf/login"),i=new URL(r,window.location.origin).origin===window.location.origin?e:new URL(e,window.location.origin).toString(),s=new URLSearchParams({return_to:i});return t&&s.set("authorize_inference","true"),n&&s.set("collect_email","true"),`${r}?${s.toString()}`}const Pv=({returnTo:e,compact:t=!1,label:n="Sign in",authorizeInference:r=!1,collectEmail:o=!1})=>{if(Gi())return null;const i=()=>{window.location.href=Y1(e,r,o)};return t?g.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:i,children:g.jsx(zh,{size:16})}):g.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:i,"aria-label":"Sign in with Hugging Face",children:[g.jsx(zh,{size:18}),g.jsx("span",{children:n})]})};function X1(e,t=[]){let n=[];function r(i,s){const a=f.createContext(s);a.displayName=i+"Context";const l=n.length;n=[...n,s];const u=d=>{var v;const{scope:p,children:h,...E}=d,y=((v=p==null?void 0:p[e])==null?void 0:v[l])||a,x=f.useMemo(()=>E,Object.values(E));return g.jsx(y.Provider,{value:x,children:h})};u.displayName=i+"Provider";function c(d,p){var y;const h=((y=p==null?void 0:p[e])==null?void 0:y[l])||a,E=f.useContext(h);if(E)return E;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,J1(o,...t)]}function J1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Je(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var vt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function Uh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Rr(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Uh(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{let{children:i,...s}=r;kv(i)&&typeof _a=="function"&&(i=_a(i._payload));const a=f.Children.toArray(i),l=a.find(rC);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var gO=Tv("Slot");function tC(e){const t=f.forwardRef((n,r)=>{let{children:o,...i}=n;if(kv(o)&&typeof _a=="function"&&(o=_a(o._payload)),f.isValidElement(o)){const s=iC(o),a=oC(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Rr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nC=Symbol("radix.slottable");function rC(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nC}function oC(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function iC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Md=sC.reduce((e,t)=>{const n=Tv(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Rv={exports:{}},Nv={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ro=f;function aC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lC=typeof Object.is=="function"?Object.is:aC,uC=Ro.useState,cC=Ro.useEffect,dC=Ro.useLayoutEffect,fC=Ro.useDebugValue;function hC(e,t){var n=t(),r=uC({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return dC(function(){o.value=n,o.getSnapshot=t,Yl(o)&&i({inst:o})},[e,n,t]),cC(function(){return Yl(o)&&i({inst:o}),e(function(){Yl(o)&&i({inst:o})})},[e]),fC(n),n}function Yl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lC(e,n)}catch{return!0}}function pC(e,t){return t()}var gC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?pC:hC;Nv.useSyncExternalStore=Ro.useSyncExternalStore!==void 0?Ro.useSyncExternalStore:gC;Rv.exports=Nv;var mC=Rv.exports;function vC(){return mC.useSyncExternalStore(yC,()=>!0,()=>!1)}function yC(){return()=>{}}var jd="Avatar",[wC]=X1(jd),[xC,Ov]=wC(jd),Av=f.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=f.useState("idle");return g.jsx(xC,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:g.jsx(Md.span,{...r,ref:t})})});Av.displayName=jd;var Mv="AvatarImage",jv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=Ov(Mv,n),a=SC(r,i),l=Je(u=>{o(u),s.onImageLoadingStatusChange(u)});return vt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?g.jsx(Md.img,{...i,ref:t,src:r}):null});jv.displayName=Mv;var Lv="AvatarFallback",Iv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=Ov(Lv,n),[s,a]=f.useState(r===void 0);return f.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?g.jsx(Md.span,{...o,ref:t}):null});Iv.displayName=Lv;function Bh(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function SC(e,{referrerPolicy:t,crossOrigin:n}){const r=vC(),o=f.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[s,a]=f.useState(()=>Bh(i,e));return vt(()=>{a(Bh(i,e))},[i,e]),vt(()=>{const l=d=>()=>{a(d)};if(!i)return;const u=l("loaded"),c=l("error");return i.addEventListener("load",u),i.addEventListener("error",c),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",c)}},[i,n,t]),s}var Dv=Av,$v=jv,Fv=Iv;function zv(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const t=_C(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Ld);return a[0]===""&&a.length!==1&&a.shift(),Bv(a,t)||CC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Bv=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Bv(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Ld);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},Vh=/^\[(.+)\]$/,CC=e=>{if(Vh.test(e)){const t=Vh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},_C=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return PC(Object.entries(e.classGroups),n).forEach(([i,s])=>{gc(s,r,i,t)}),r},gc=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Wh(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(bC(o)){gc(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{gc(s,Wh(t,i),n,r)})})},Wh=(e,t)=>{let n=e;return t.split(Ld).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},bC=e=>e.isThemeGetter,PC=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,kC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Vv="!",TC=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let u=0,c=0,d;for(let x=0;xc?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:E,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:s}):s},RC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},NC=e=>({cache:kC(e.cacheSize),parseClassName:TC(e),...EC(e)}),OC=/\s+/,AC=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(OC);let a="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let E=!!h,y=r(E?p.substring(0,h):p);if(!y){if(!E){a=u+(a.length>0?" "+a:a);continue}if(y=r(p),!y){a=u+(a.length>0?" "+a:a);continue}E=!1}const x=RC(c).join(":"),v=d?x+Vv:x,m=v+y;if(i.includes(m))continue;i.push(m);const w=o(y,E);for(let S=0;S0?" "+a:a)}return a};function MC(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(c),e());return n=NC(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=AC(l,n);return o(l,c),c}return function(){return i(MC.apply(null,arguments))}}const ae=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Hv=/^\[(?:([a-z-]+):)?(.+)\]$/i,LC=/^\d+\/\d+$/,IC=new Set(["px","full","screen"]),DC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$C=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,FC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,UC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xt=e=>ao(e)||IC.has(e)||LC.test(e),Cn=e=>Io(e,"length",QC),ao=e=>!!e&&!Number.isNaN(Number(e)),Xl=e=>Io(e,"number",ao),Qo=e=>!!e&&Number.isInteger(Number(e)),BC=e=>e.endsWith("%")&&ao(e.slice(0,-1)),Q=e=>Hv.test(e),_n=e=>DC.test(e),VC=new Set(["length","size","percentage"]),WC=e=>Io(e,VC,qv),HC=e=>Io(e,"position",qv),qC=new Set(["image","url"]),KC=e=>Io(e,qC,XC),GC=e=>Io(e,"",YC),Yo=()=>!0,Io=(e,t,n)=>{const r=Hv.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},QC=e=>$C.test(e)&&!FC.test(e),qv=()=>!1,YC=e=>zC.test(e),XC=e=>UC.test(e),JC=()=>{const e=ae("colors"),t=ae("spacing"),n=ae("blur"),r=ae("brightness"),o=ae("borderColor"),i=ae("borderRadius"),s=ae("borderSpacing"),a=ae("borderWidth"),l=ae("contrast"),u=ae("grayscale"),c=ae("hueRotate"),d=ae("invert"),p=ae("gap"),h=ae("gradientColorStops"),E=ae("gradientColorStopPositions"),y=ae("inset"),x=ae("margin"),v=ae("opacity"),m=ae("padding"),w=ae("saturate"),S=ae("scale"),C=ae("sepia"),_=ae("skew"),P=ae("space"),R=ae("translate"),j=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",Q,t],D=()=>[Q,t],q=()=>["",Xt,Cn],I=()=>["auto",ao,Q],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",Q],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[ao,Q];return{cacheSize:500,separator:":",theme:{colors:[Yo],spacing:[Xt,Cn],blur:["none","",_n,Q],brightness:B(),borderColor:[e],borderRadius:["none","","full",_n,Q],borderSpacing:D(),borderWidth:q(),contrast:B(),grayscale:k(),hueRotate:B(),invert:k(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[BC,Cn],inset:z(),margin:z(),opacity:B(),padding:D(),saturate:B(),scale:B(),sepia:k(),skew:B(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",Q]}],container:["container"],columns:[{columns:[_n]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),Q]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qo,Q]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Q]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",Qo,Q]}],"grid-cols":[{"grid-cols":[Yo]}],"col-start-end":[{col:["auto",{span:["full",Qo,Q]},Q]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Yo]}],"row-start-end":[{row:["auto",{span:[Qo,Q]},Q]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Q]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Q,t]}],"min-w":[{"min-w":[Q,t,"min","max","fit"]}],"max-w":[{"max-w":[Q,t,"none","full","min","max","fit","prose",{screen:[_n]},_n]}],h:[{h:[Q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_n,Cn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xl]}],"font-family":[{font:[Yo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Q]}],"line-clamp":[{"line-clamp":["none",ao,Xl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xt,Q]}],"list-image":[{"list-image":["none",Q]}],"list-style-type":[{list:["none","disc","decimal",Q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xt,Cn]}],"underline-offset":[{"underline-offset":["auto",Xt,Q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),HC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",WC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},KC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:U()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Xt,Q]}],"outline-w":[{outline:[Xt,Cn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Xt,Cn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_n,GC]}],"shadow-color":[{shadow:[Yo]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",_n,Q]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Q]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Q]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Qo,Q]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Xt,Cn,Xl]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ZC=jC(JC);function Ne(...e){return ZC(Uv(e))}function mO(e){const t=e.trim(),n=t.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=t.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:t}function vO(e){if(e==null||e==="")return"—";const t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.abs(t)>=100?t.toFixed(0):Math.abs(t)>=10?t.toFixed(1):t.toFixed(2):String(e)}const Kv=f.forwardRef(({className:e,...t},n)=>g.jsx(Dv,{ref:n,className:Ne("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Kv.displayName=Dv.displayName;const Gv=f.forwardRef(({className:e,...t},n)=>g.jsx($v,{ref:n,className:Ne("aspect-square h-full w-full",e),...t}));Gv.displayName=$v.displayName;const Qv=f.forwardRef(({className:e,...t},n)=>g.jsx(Fv,{ref:n,className:Ne("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Qv.displayName=Fv.displayName;function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function yO(e,t){const n=f.createContext(t),r=i=>{const{children:s,...a}=i,l=f.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=f.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Nr(e,t=[]){let n=[];function r(i,s){const a=f.createContext(s),l=n.length;n=[...n,s];const u=d=>{var v;const{scope:p,children:h,...E}=d,y=((v=p==null?void 0:p[e])==null?void 0:v[l])||a,x=f.useMemo(()=>E,Object.values(E));return g.jsx(y.Provider,{value:x,children:h})};u.displayName=i+"Provider";function c(d,p){var y;const h=((y=p==null?void 0:p[e])==null?void 0:y[l])||a,E=f.useContext(h);if(E)return E;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,e_(o,...t)]}function e_(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var t_=Ma[" useInsertionEffect ".trim().toString()]||vt;function Id({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=n_({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const c=f.useRef(e!==void 0);f.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=f.useCallback(c=>{var d;if(a){const p=r_(c)?c(e):c;p!==e&&((d=s.current)==null||d.call(s,p))}else i(c)},[a,e,i,s]);return[l,u]}function n_({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),i=f.useRef(t);return t_(()=>{i.current=t},[t]),f.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function r_(e){return typeof e=="function"}function o_(e){const t=i_(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(a_);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function i_(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=u_(o),a=l_(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Rr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var s_=Symbol("radix.slottable");function a_(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===s_}function l_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function u_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var c_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=c_.reduce((e,t)=>{const n=o_(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Dd(e,t){e&&Ki.flushSync(()=>e.dispatchEvent(t))}function Hh(e){const t=d_(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(h_);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function d_(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=g_(o),a=p_(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Rr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var f_=Symbol("radix.slottable");function h_(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===f_}function p_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function g_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $d(e){const t=e+"CollectionProvider",[n,r]=Nr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:v}=y,m=T.useRef(null),w=T.useRef(new Map).current;return g.jsx(o,{scope:x,itemMap:w,collectionRef:m,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=Hh(a),u=T.forwardRef((y,x)=>{const{scope:v,children:m}=y,w=i(a,v),S=Re(x,w.collectionRef);return g.jsx(l,{ref:S,children:m})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",p=Hh(c),h=T.forwardRef((y,x)=>{const{scope:v,children:m,...w}=y,S=T.useRef(null),C=Re(x,S),_=i(c,v);return T.useEffect(()=>(_.itemMap.set(S,{ref:S,...w}),()=>void _.itemMap.delete(S))),g.jsx(p,{[d]:"",ref:C,children:m})});h.displayName=c;function E(y){const x=i(e+"CollectionConsumer",y);return T.useCallback(()=>{const m=x.collectionRef.current;if(!m)return[];const w=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((_,P)=>w.indexOf(_.ref.current)-w.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},E,r]}var m_=f.createContext(void 0);function Yv(e){const t=f.useContext(m_);return e||t||"ltr"}function v_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var y_="DismissableLayer",mc="dismissableLayer.update",w_="dismissableLayer.pointerDownOutside",x_="dismissableLayer.focusOutside",qh,Xv=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tl=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=f.useContext(Xv),[c,d]=f.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=f.useState({}),E=Re(t,P=>d(P)),y=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(x),m=c?y.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=m>=v,C=E_(P=>{const R=P.target,j=[...u.branches].some(M=>M.contains(R));!S||j||(o==null||o(P),s==null||s(P),P.defaultPrevented||a==null||a())},p),_=C_(P=>{const R=P.target;[...u.branches].some(M=>M.contains(R))||(i==null||i(P),s==null||s(P),P.defaultPrevented||a==null||a())},p);return v_(P=>{m===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},p),f.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(qh=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Kh(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=qh)}},[c,p,n,u]),f.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Kh())},[c,u]),f.useEffect(()=>{const P=()=>h({});return document.addEventListener(mc,P),()=>document.removeEventListener(mc,P)},[]),g.jsx(ve.div,{...l,ref:E,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,_.onFocusCapture),onBlurCapture:V(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});tl.displayName=y_;var S_="DismissableLayerBranch",Jv=f.forwardRef((e,t)=>{const n=f.useContext(Xv),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(ve.div,{...e,ref:o})});Jv.displayName=S_;function E_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Zv(w_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function C_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e),r=f.useRef(!1);return f.useEffect(()=>{const o=i=>{i.target&&!r.current&&Zv(x_,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kh(){const e=new CustomEvent(mc);document.dispatchEvent(e)}function Zv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Dd(o,i):o.dispatchEvent(i)}var __=tl,b_=Jv,Jl=0;function P_(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gh()),document.body.insertAdjacentElement("beforeend",e[1]??Gh()),Jl++,()=>{Jl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Jl--}},[])}function Gh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Zl="focusScope.autoFocusOnMount",eu="focusScope.autoFocusOnUnmount",Qh={bubbles:!1,cancelable:!0},k_="FocusScope",ey=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=f.useState(null),u=Je(o),c=Je(i),d=f.useRef(null),p=Re(t,y=>l(y)),h=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let y=function(w){if(h.paused||!a)return;const S=w.target;a.contains(S)?d.current=S:Pn(d.current,{select:!0})},x=function(w){if(h.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||Pn(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&Pn(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const m=new MutationObserver(v);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),m.disconnect()}}},[r,a,h.paused]),f.useEffect(()=>{if(a){Xh.add(h);const y=document.activeElement;if(!a.contains(y)){const v=new CustomEvent(Zl,Qh);a.addEventListener(Zl,u),a.dispatchEvent(v),v.defaultPrevented||(T_(M_(ty(a)),{select:!0}),document.activeElement===y&&Pn(a))}return()=>{a.removeEventListener(Zl,u),setTimeout(()=>{const v=new CustomEvent(eu,Qh);a.addEventListener(eu,c),a.dispatchEvent(v),v.defaultPrevented||Pn(y??document.body,{select:!0}),a.removeEventListener(eu,c),Xh.remove(h)},0)}}},[a,u,c,h]);const E=f.useCallback(y=>{if(!n&&!r||h.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const m=y.currentTarget,[w,S]=R_(m);w&&S?!y.shiftKey&&v===S?(y.preventDefault(),n&&Pn(w,{select:!0})):y.shiftKey&&v===w&&(y.preventDefault(),n&&Pn(S,{select:!0})):v===m&&y.preventDefault()}},[n,r,h.paused]);return g.jsx(ve.div,{tabIndex:-1,...s,ref:p,onKeyDown:E})});ey.displayName=k_;function T_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pn(r,{select:t}),document.activeElement!==n)return}function R_(e){const t=ty(e),n=Yh(t,e),r=Yh(t.reverse(),e);return[n,r]}function ty(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 Yh(e,t){for(const n of e)if(!N_(n,{upTo:t}))return n}function N_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function O_(e){return e instanceof HTMLInputElement&&"select"in e}function Pn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&O_(e)&&t&&e.select()}}var Xh=A_();function A_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Jh(e,t),e.unshift(t)},remove(t){var n;e=Jh(e,t),(n=e[0])==null||n.resume()}}}function Jh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function M_(e){return e.filter(t=>t.tagName!=="A")}var j_=Ma[" useId ".trim().toString()]||(()=>{}),L_=0;function vc(e){const[t,n]=f.useState(j_());return vt(()=>{n(r=>r??String(L_++))},[e]),t?`radix-${t}`:""}const I_=["top","right","bottom","left"],Xn=Math.min,tt=Math.max,ba=Math.round,Es=Math.floor,Gt=e=>({x:e,y:e}),D_={left:"right",right:"left",bottom:"top",top:"bottom"};function yc(e,t,n){return tt(e,Xn(t,n))}function dn(e,t){return typeof e=="function"?e(t):e}function fn(e){return e.split("-")[0]}function Do(e){return e.split("-")[1]}function Fd(e){return e==="x"?"y":"x"}function zd(e){return e==="y"?"height":"width"}function Ht(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ud(e){return Fd(Ht(e))}function $_(e,t,n){n===void 0&&(n=!1);const r=Do(e),o=Ud(e),i=zd(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Pa(s)),[s,Pa(s)]}function F_(e){const t=Pa(e);return[wc(e),t,wc(t)]}function wc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Zh=["left","right"],ep=["right","left"],z_=["top","bottom"],U_=["bottom","top"];function B_(e,t,n){switch(e){case"top":case"bottom":return n?t?ep:Zh:t?Zh:ep;case"left":case"right":return t?z_:U_;default:return[]}}function V_(e,t,n,r){const o=Do(e);let i=B_(fn(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(wc)))),i}function Pa(e){const t=fn(e);return D_[t]+e.slice(t.length)}function W_(e){return{top:0,right:0,bottom:0,left:0,...e}}function ny(e){return typeof e!="number"?W_(e):{top:e,right:e,bottom:e,left:e}}function ka(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function tp(e,t,n){let{reference:r,floating:o}=e;const i=Ht(t),s=Ud(t),a=zd(s),l=fn(t),u=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Do(t)){case"start":h[s]-=p*(n&&u?-1:1);break;case"end":h[s]+=p*(n&&u?-1:1);break}return h}async function H_(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=dn(t,e),E=ny(h),x=a[p?d==="floating"?"reference":"floating":d],v=ka(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),m=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=ka(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:l}):m);return{top:(v.top-C.top+E.top)/S.y,bottom:(C.bottom-v.bottom+E.bottom)/S.y,left:(v.left-C.left+E.left)/S.x,right:(C.right-v.right+E.right)/S.x}}const q_=50,K_=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:H_},l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=tp(u,r,l),p=r,h=0;const E={};for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=dn(e,t)||{};if(u==null)return{};const d=ny(c),p={x:n,y:r},h=Ud(o),E=zd(h),y=await s.getDimensions(u),x=h==="y",v=x?"top":"left",m=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[E]+i.reference[h]-p[h]-i.floating[E],C=p[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=_?_[w]:0;(!P||!await(s.isElement==null?void 0:s.isElement(_)))&&(P=a.floating[w]||i.floating[E]);const R=S/2-C/2,j=P/2-y[E]/2-1,M=Xn(d[v],j),z=Xn(d[m],j),D=M,q=P-y[E]-z,I=P/2-y[E]/2+R,Y=yc(D,I,q),U=!l.arrow&&Do(o)!=null&&I!==Y&&i.reference[E]/2-(II<=0)){var z,D;const I=(((z=i.flip)==null?void 0:z.index)||0)+1,Y=P[I];if(Y&&(!(d==="alignment"?m!==Ht(Y):!1)||M.every(O=>Ht(O.placement)===m?O.overflows[0]>0:!0)))return{data:{index:I,overflows:M},reset:{placement:Y}};let U=(D=M.filter(H=>H.overflows[0]<=0).sort((H,O)=>H.overflows[1]-O.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(h){case"bestFit":{var q;const H=(q=M.filter(O=>{if(_){const k=Ht(O.placement);return k===m||k==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(k=>k>0).reduce((k,L)=>k+L,0)]).sort((O,k)=>O[1]-k[1])[0])==null?void 0:q[0];H&&(U=H);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function np(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rp(e){return I_.some(t=>e[t]>=0)}const Y_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=dn(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=np(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:rp(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=np(s,n.floating);return{data:{escapedOffsets:a,escaped:rp(a)}}}default:return{}}}}},ry=new Set(["left","top"]);async function X_(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=fn(n),a=Do(n),l=Ht(n)==="y",u=ry.has(s)?-1:1,c=i&&l?-1:1,d=dn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:E}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof E=="number"&&(h=a==="end"?E*-1:E),l?{x:h*c,y:p*u}:{x:p*u,y:h*c}}const J_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await X_(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Z_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:m,y:w}=v;return{x:m,y:w}}},...u}=dn(e,t),c={x:n,y:r},d=await i.detectOverflow(t,u),p=Ht(fn(o)),h=Fd(p);let E=c[h],y=c[p];if(s){const v=h==="y"?"top":"left",m=h==="y"?"bottom":"right",w=E+d[v],S=E-d[m];E=yc(w,E,S)}if(a){const v=p==="y"?"top":"left",m=p==="y"?"bottom":"right",w=y+d[v],S=y-d[m];y=yc(w,y,S)}const x=l.fn({...t,[h]:E,[p]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[h]:s,[p]:a}}}}}},eb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=dn(e,t),c={x:n,y:r},d=Ht(o),p=Fd(d);let h=c[p],E=c[d];const y=dn(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const w=p==="y"?"height":"width",S=i.reference[p]-i.floating[w]+x.mainAxis,C=i.reference[p]+i.reference[w]-x.mainAxis;hC&&(h=C)}if(u){var v,m;const w=p==="y"?"width":"height",S=ry.has(fn(o)),C=i.reference[d]-i.floating[w]+(S&&((v=s.offset)==null?void 0:v[d])||0)+(S?0:x.crossAxis),_=i.reference[d]+i.reference[w]+(S?0:((m=s.offset)==null?void 0:m[d])||0)-(S?x.crossAxis:0);E_&&(E=_)}return{[p]:h,[d]:E}}}},tb=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=dn(e,t),c=await s.detectOverflow(t,u),d=fn(o),p=Do(o),h=Ht(o)==="y",{width:E,height:y}=i.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,x=p==="end"?"top":"bottom");const m=y-c.top-c.bottom,w=E-c.left-c.right,S=Xn(y-c[x],m),C=Xn(E-c[v],w),_=!t.middlewareData.shift;let P=S,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=m),_&&!p){const M=tt(c.left,0),z=tt(c.right,0),D=tt(c.top,0),q=tt(c.bottom,0);h?R=E-2*(M!==0||z!==0?M+z:tt(c.left,c.right)):P=y-2*(D!==0||q!==0?D+q:tt(c.top,c.bottom))}await l({...t,availableWidth:R,availableHeight:P});const j=await s.getDimensions(a.floating);return E!==j.width||y!==j.height?{reset:{rects:!0}}:{}}}};function nl(){return typeof window<"u"}function $o(e){return oy(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qt(e){var t;return(t=(oy(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oy(e){return nl()?e instanceof Node||e instanceof ot(e).Node:!1}function Ot(e){return nl()?e instanceof Element||e instanceof ot(e).Element:!1}function mn(e){return nl()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function op(e){return!nl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}function Qi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function nb(e){return/^(table|td|th)$/.test($o(e))}function rl(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const rb=/transform|translate|scale|rotate|perspective|filter/,ob=/paint|layout|strict|content/,ir=e=>!!e&&e!=="none";let tu;function Bd(e){const t=Ot(e)?At(e):e;return ir(t.transform)||ir(t.translate)||ir(t.scale)||ir(t.rotate)||ir(t.perspective)||!Vd()&&(ir(t.backdropFilter)||ir(t.filter))||rb.test(t.willChange||"")||ob.test(t.contain||"")}function ib(e){let t=Jn(e);for(;mn(t)&&!No(t);){if(Bd(t))return t;if(rl(t))return null;t=Jn(t)}return null}function Vd(){return tu==null&&(tu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tu}function No(e){return/^(html|body|#document)$/.test($o(e))}function At(e){return ot(e).getComputedStyle(e)}function ol(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jn(e){if($o(e)==="html")return e;const t=e.assignedSlot||e.parentNode||op(e)&&e.host||Qt(e);return op(t)?t.host:t}function iy(e){const t=Jn(e);return No(t)?e.ownerDocument?e.ownerDocument.body:e.body:mn(t)&&Qi(t)?t:iy(t)}function Ii(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=iy(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ot(o);if(i){const a=xc(s);return t.concat(s,s.visualViewport||[],Qi(o)?o:[],a&&n?Ii(a):[])}else return t.concat(o,Ii(o,[],n))}function xc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sy(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=mn(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ba(n)!==i||ba(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Wd(e){return Ot(e)?e:e.contextElement}function lo(e){const t=Wd(e);if(!mn(t))return Gt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=sy(t);let s=(i?ba(n.width):n.width)/r,a=(i?ba(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const sb=Gt(0);function ay(e){const t=ot(e);return!Vd()||!t.visualViewport?sb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ab(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function br(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Wd(e);let s=Gt(1);t&&(r?Ot(r)&&(s=lo(r)):s=lo(e));const a=ab(i,n,r)?ay(i):Gt(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,c=o.width/s.x,d=o.height/s.y;if(i){const p=ot(i),h=r&&Ot(r)?ot(r):r;let E=p,y=xc(E);for(;y&&r&&h!==E;){const x=lo(y),v=y.getBoundingClientRect(),m=At(y),w=v.left+(y.clientLeft+parseFloat(m.paddingLeft))*x.x,S=v.top+(y.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=w,u+=S,E=ot(y),y=xc(E)}}return ka({width:c,height:d,x:l,y:u})}function il(e,t){const n=ol(e).scrollLeft;return t?t.left+n:br(Qt(e)).left+n}function ly(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-il(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function lb(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Qt(r),a=t?rl(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Gt(1);const c=Gt(0),d=mn(r);if((d||!d&&!i)&&(($o(r)!=="body"||Qi(s))&&(l=ol(r)),d)){const h=br(r);u=lo(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=s&&!d&&!i?ly(s,l):Gt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}}function ub(e){return Array.from(e.getClientRects())}function cb(e){const t=Qt(e),n=ol(e),r=e.ownerDocument.body,o=tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+il(e);const a=-n.scrollTop;return At(r).direction==="rtl"&&(s+=tt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const ip=25;function db(e,t){const n=ot(e),r=Qt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Vd();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=il(r);if(u<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,E=Math.abs(r.clientWidth-d.clientWidth-h);E<=ip&&(i-=E)}else u<=ip&&(i+=u);return{width:i,height:s,x:a,y:l}}function fb(e,t){const n=br(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=mn(e)?lo(e):Gt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function sp(e,t,n){let r;if(t==="viewport")r=db(e,n);else if(t==="document")r=cb(Qt(e));else if(Ot(t))r=fb(t,n);else{const o=ay(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ka(r)}function uy(e,t){const n=Jn(e);return n===t||!Ot(n)||No(n)?!1:At(n).position==="fixed"||uy(n,t)}function hb(e,t){const n=t.get(e);if(n)return n;let r=Ii(e,[],!1).filter(a=>Ot(a)&&$o(a)!=="body"),o=null;const i=At(e).position==="fixed";let s=i?Jn(e):e;for(;Ot(s)&&!No(s);){const a=At(s),l=Bd(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Qi(s)&&!l&&uy(e,s))?r=r.filter(c=>c!==s):o=a,s=Jn(s)}return t.set(e,r),r}function pb(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?rl(t)?[]:hb(t,this._c):[].concat(n),r],a=sp(t,s[0],o);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let p=1;p{s(!1,1e-7)},1e3)}P===1&&!dy(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return s(!0),i}function Sb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Wd(e),c=o||i?[...u?Ii(u):[],...t?Ii(t):[]]:[];c.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=u&&a?xb(u,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(v=>{let[m]=v;m&&m.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),u&&!l&&h.observe(u),t&&h.observe(t));let E,y=l?br(e):null;l&&x();function x(){const v=br(e);y&&!dy(y,v)&&n(),y=v,E=requestAnimationFrame(x)}return n(),()=>{var v;c.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(E)}}const Eb=J_,Cb=Z_,_b=Q_,bb=tb,Pb=Y_,lp=G_,kb=eb,Tb=(e,t,n)=>{const r=new Map,o={platform:wb,...n},i={...o.platform,_c:r};return K_(e,t,{...o,platform:i})};var Rb=typeof document<"u",Nb=function(){},Vs=Rb?f.useLayoutEffect:Nb;function Ta(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ta(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ta(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function fy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function up(e,t){const n=fy(e);return Math.round(t*n)/n}function ru(e){const t=f.useRef(e);return Vs(()=>{t.current=e}),t}function Ob(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=f.useState(r);Ta(p,r)||h(r);const[E,y]=f.useState(null),[x,v]=f.useState(null),m=f.useCallback(O=>{O!==_.current&&(_.current=O,y(O))},[]),w=f.useCallback(O=>{O!==P.current&&(P.current=O,v(O))},[]),S=i||E,C=s||x,_=f.useRef(null),P=f.useRef(null),R=f.useRef(c),j=l!=null,M=ru(l),z=ru(o),D=ru(u),q=f.useCallback(()=>{if(!_.current||!P.current)return;const O={placement:t,strategy:n,middleware:p};z.current&&(O.platform=z.current),Tb(_.current,P.current,O).then(k=>{const L={...k,isPositioned:D.current!==!1};I.current&&!Ta(R.current,L)&&(R.current=L,Ki.flushSync(()=>{d(L)}))})},[p,t,n,z,D]);Vs(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[u]);const I=f.useRef(!1);Vs(()=>(I.current=!0,()=>{I.current=!1}),[]),Vs(()=>{if(S&&(_.current=S),C&&(P.current=C),S&&C){if(M.current)return M.current(S,C,q);q()}},[S,C,q,M,j]);const Y=f.useMemo(()=>({reference:_,floating:P,setReference:m,setFloating:w}),[m,w]),U=f.useMemo(()=>({reference:S,floating:C}),[S,C]),H=f.useMemo(()=>{const O={position:n,left:0,top:0};if(!U.floating)return O;const k=up(U.floating,c.x),L=up(U.floating,c.y);return a?{...O,transform:"translate("+k+"px, "+L+"px)",...fy(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:L}},[n,a,U.floating,c.x,c.y]);return f.useMemo(()=>({...c,update:q,refs:Y,elements:U,floatingStyles:H}),[c,q,Y,U,H])}const Ab=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?lp({element:r.current,padding:o}).fn(n):{}:r?lp({element:r,padding:o}).fn(n):{}}}},Mb=(e,t)=>{const n=Eb(e);return{name:n.name,fn:n.fn,options:[e,t]}},jb=(e,t)=>{const n=Cb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lb=(e,t)=>({fn:kb(e).fn,options:[e,t]}),Ib=(e,t)=>{const n=_b(e);return{name:n.name,fn:n.fn,options:[e,t]}},Db=(e,t)=>{const n=bb(e);return{name:n.name,fn:n.fn,options:[e,t]}},$b=(e,t)=>{const n=Pb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fb=(e,t)=>{const n=Ab(e);return{name:n.name,fn:n.fn,options:[e,t]}};var zb="Arrow",hy=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(ve.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});hy.displayName=zb;var Ub=hy;function Bb(e){const[t,n]=f.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Hd="Popper",[py,sl]=Nr(Hd),[Vb,gy]=py(Hd),my=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return g.jsx(Vb,{scope:t,anchor:r,onAnchorChange:o,children:n})};my.displayName=Hd;var vy="PopperAnchor",yy=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=gy(vy,n),s=f.useRef(null),a=Re(t,s),l=f.useRef(null);return f.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:g.jsx(ve.div,{...o,ref:a})});yy.displayName=vy;var qd="PopperContent",[Wb,Hb]=py(qd),wy=f.forwardRef((e,t)=>{var J,Yt,be,jt,vn,jr;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:E,...y}=e,x=gy(qd,n),[v,m]=f.useState(null),w=Re(t,yn=>m(yn)),[S,C]=f.useState(null),_=Bb(S),P=(_==null?void 0:_.width)??0,R=(_==null?void 0:_.height)??0,j=r+(i!=="center"?"-"+i:""),M=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},z=Array.isArray(u)?u:[u],D=z.length>0,q={padding:M,boundary:z.filter(Kb),altBoundary:D},{refs:I,floatingStyles:Y,placement:U,isPositioned:H,middlewareData:O}=Ob({strategy:"fixed",placement:j,whileElementsMounted:(...yn)=>Sb(...yn,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[Mb({mainAxis:o+R,alignmentAxis:s}),l&&jb({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Lb():void 0,...q}),l&&Ib({...q}),Db({...q,apply:({elements:yn,rects:es,availableWidth:vl,availableHeight:ts})=>{const{width:yl,height:Fo}=es.reference,Lr=yn.floating.style;Lr.setProperty("--radix-popper-available-width",`${vl}px`),Lr.setProperty("--radix-popper-available-height",`${ts}px`),Lr.setProperty("--radix-popper-anchor-width",`${yl}px`),Lr.setProperty("--radix-popper-anchor-height",`${Fo}px`)}}),S&&Fb({element:S,padding:a}),Gb({arrowWidth:P,arrowHeight:R}),p&&$b({strategy:"referenceHidden",...q})]}),[k,L]=Ey(U),B=Je(E);vt(()=>{H&&(B==null||B())},[H,B]);const F=(J=O.arrow)==null?void 0:J.x,G=(Yt=O.arrow)==null?void 0:Yt.y,X=((be=O.arrow)==null?void 0:be.centerOffset)!==0,[fe,ye]=f.useState();return vt(()=>{v&&ye(window.getComputedStyle(v).zIndex)},[v]),g.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:H?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(jt=O.transformOrigin)==null?void 0:jt.x,(vn=O.transformOrigin)==null?void 0:vn.y].join(" "),...((jr=O.hide)==null?void 0:jr.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Wb,{scope:n,placedSide:k,onArrowChange:C,arrowX:F,arrowY:G,shouldHideArrow:X,children:g.jsx(ve.div,{"data-side":k,"data-align":L,...y,ref:w,style:{...y.style,animation:H?void 0:"none"}})})})});wy.displayName=qd;var xy="PopperArrow",qb={top:"bottom",right:"left",bottom:"top",left:"right"},Sy=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Hb(xy,r),s=qb[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx(Ub,{...o,ref:n,style:{...o.style,display:"block"}})})});Sy.displayName=xy;function Kb(e){return e!==null}var Gb=e=>({name:"transformOrigin",options:e,fn(t){var x,v,m;const{placement:n,rects:r,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,c]=Ey(n),d={start:"0%",center:"50%",end:"100%"}[c],p=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,h=(((m=o.arrow)==null?void 0:m.y)??0)+l/2;let E="",y="";return u==="bottom"?(E=s?d:`${p}px`,y=`${-l}px`):u==="top"?(E=s?d:`${p}px`,y=`${r.floating.height+l}px`):u==="right"?(E=`${-l}px`,y=s?d:`${h}px`):u==="left"&&(E=`${r.floating.width+l}px`,y=s?d:`${h}px`),{data:{x:E,y}}}});function Ey(e){const[t,n="center"]=e.split("-");return[t,n]}var Qb=my,Cy=yy,_y=wy,by=Sy,Yb="Portal",Kd=f.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=f.useState(!1);vt(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Zm.createPortal(g.jsx(ve.div,{...r,ref:t}),s):null});Kd.displayName=Yb;function Xb(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Or=e=>{const{present:t,children:n}=e,r=Jb(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=Re(r.ref,Zb(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};Or.displayName="Presence";function Jb(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Xb(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=Cs(r.current);i.current=a==="mounted"?u:"none"},[a]),vt(()=>{const u=r.current,c=o.current;if(c!==e){const p=i.current,h=Cs(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),vt(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=h=>{const y=Cs(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&y&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},p=h=>{h.target===t&&(i.current=Cs(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Cs(e){return(e==null?void 0:e.animationName)||"none"}function Zb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ou="rovingFocusGroup.onEntryFocus",eP={bubbles:!1,cancelable:!0},Yi="RovingFocusGroup",[Sc,Py,tP]=$d(Yi),[nP,ky]=Nr(Yi,[tP]),[rP,oP]=nP(Yi),Ty=f.forwardRef((e,t)=>g.jsx(Sc.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Sc.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(iP,{...e,ref:t})})}));Ty.displayName=Yi;var iP=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,p=f.useRef(null),h=Re(t,p),E=Yv(i),[y,x]=Id({prop:s,defaultProp:a??null,onChange:l,caller:Yi}),[v,m]=f.useState(!1),w=Je(u),S=Py(n),C=f.useRef(!1),[_,P]=f.useState(0);return f.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(ou,w),()=>R.removeEventListener(ou,w)},[w]),g.jsx(rP,{scope:n,orientation:r,dir:E,loop:o,currentTabStopId:y,onItemFocus:f.useCallback(R=>x(R),[x]),onItemShiftTab:f.useCallback(()=>m(!0),[]),onFocusableItemAdd:f.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:f.useCallback(()=>P(R=>R-1),[]),children:g.jsx(ve.div,{tabIndex:v||_===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,R=>{const j=!C.current;if(R.target===R.currentTarget&&j&&!v){const M=new CustomEvent(ou,eP);if(R.currentTarget.dispatchEvent(M),!M.defaultPrevented){const z=S().filter(U=>U.focusable),D=z.find(U=>U.active),q=z.find(U=>U.id===y),Y=[D,q,...z].filter(Boolean).map(U=>U.ref.current);Oy(Y,c)}}C.current=!1}),onBlur:V(e.onBlur,()=>m(!1))})})}),Ry="RovingFocusGroupItem",Ny=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=vc(),u=i||l,c=oP(Ry,n),d=c.currentTabStopId===u,p=Py(n),{onFocusableItemAdd:h,onFocusableItemRemove:E,currentTabStopId:y}=c;return f.useEffect(()=>{if(r)return h(),()=>E()},[r,h,E]),g.jsx(Sc.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:g.jsx(ve.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:V(e.onMouseDown,x=>{r?c.onItemFocus(u):x.preventDefault()}),onFocus:V(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:V(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=lP(x,c.orientation,c.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=p().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const S=w.indexOf(x.currentTarget);w=c.loop?uP(w,S+1):w.slice(S+1)}setTimeout(()=>Oy(w))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:y!=null}):s})})});Ny.displayName=Ry;var sP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aP(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function lP(e,t,n){const r=aP(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sP[r]}function Oy(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function uP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cP=Ty,dP=Ny;function fP(e){const t=hP(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(gP);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function hP(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=vP(o),a=mP(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Rr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pP=Symbol("radix.slottable");function gP(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pP}function mP(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function vP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},zr=new WeakMap,_s=new WeakMap,bs={},iu=0,Ay=function(e){return e&&(e.host||Ay(e.parentNode))},wP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ay(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},xP=function(e,t,n,r){var o=wP(t,Array.isArray(e)?e:[e]);bs[n]||(bs[n]=new WeakMap);var i=bs[n],s=[],a=new Set,l=new Set(o),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};o.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))c(p);else try{var h=p.getAttribute(r),E=h!==null&&h!=="false",y=(zr.get(p)||0)+1,x=(i.get(p)||0)+1;zr.set(p,y),i.set(p,x),s.push(p),y===1&&E&&_s.set(p,!0),x===1&&p.setAttribute(n,"true"),E||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return c(t),a.clear(),iu++,function(){s.forEach(function(d){var p=zr.get(d)-1,h=i.get(d)-1;zr.set(d,p),i.set(d,h),p||(_s.has(d)||d.removeAttribute(r),_s.delete(d)),h||d.removeAttribute(n)}),iu--,iu||(zr=new WeakMap,zr=new WeakMap,_s=new WeakMap,bs={})}},SP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=yP(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),xP(r,o,n,"aria-hidden")):function(){return null}},Wt=function(){return Wt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return $P;var t=FP(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},UP=Iy(),uo="data-scroll-locked",BP=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(CP,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(a,"px ").concat(r,`; + } + body[`).concat(uo,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Ws,` { + right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Hs,` { + margin-right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Ws," .").concat(Ws,` { + right: 0 `).concat(r,`; + } + + .`).concat(Hs," .").concat(Hs,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(uo,`] { + `).concat(_P,": ").concat(a,`px; + } +`)},dp=function(){var e=parseInt(document.body.getAttribute(uo)||"0",10);return isFinite(e)?e:0},VP=function(){f.useEffect(function(){return document.body.setAttribute(uo,(dp()+1).toString()),function(){var e=dp()-1;e<=0?document.body.removeAttribute(uo):document.body.setAttribute(uo,e.toString())}},[])},WP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;VP();var i=f.useMemo(function(){return zP(o)},[o]);return f.createElement(UP,{styles:BP(i,!t,o,n?"":"!important")})},Ec=!1;if(typeof window<"u")try{var Ps=Object.defineProperty({},"passive",{get:function(){return Ec=!0,!0}});window.addEventListener("test",Ps,Ps),window.removeEventListener("test",Ps,Ps)}catch{Ec=!1}var Ur=Ec?{passive:!1}:!1,HP=function(e){return e.tagName==="TEXTAREA"},Dy=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!HP(e)&&n[t]==="visible")},qP=function(e){return Dy(e,"overflowY")},KP=function(e){return Dy(e,"overflowX")},fp=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=$y(e,r);if(o){var i=Fy(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},GP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},QP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},$y=function(e,t){return e==="v"?qP(t):KP(t)},Fy=function(e,t){return e==="v"?GP(t):QP(t)},YP=function(e,t){return e==="h"&&t==="rtl"?-1:1},XP=function(e,t,n,r,o){var i=YP(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,c=s>0,d=0,p=0;do{if(!a)break;var h=Fy(e,a),E=h[0],y=h[1],x=h[2],v=y-x-i*E;(E||v)&&$y(e,a)&&(d+=v,p+=E);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(d)<1||!c&&Math.abs(p)<1)&&(u=!0),u},ks=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hp=function(e){return[e.deltaX,e.deltaY]},pp=function(e){return e&&"current"in e?e.current:e},JP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZP=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},ek=0,Br=[];function tk(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(ek++)[0],i=f.useState(Iy)[0],s=f.useRef(e);f.useEffect(function(){s.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=EP([e.lockRef.current],(e.shards||[]).map(pp),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=f.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var v=ks(y),m=n.current,w="deltaX"in y?y.deltaX:m[0]-v[0],S="deltaY"in y?y.deltaY:m[1]-v[1],C,_=y.target,P=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in y&&P==="h"&&_.type==="range")return!1;var R=window.getSelection(),j=R&&R.anchorNode,M=j?j===_||j.contains(_):!1;if(M)return!1;var z=fp(P,_);if(!z)return!0;if(z?C=P:(C=P==="v"?"h":"v",z=fp(P,_)),!z)return!1;if(!r.current&&"changedTouches"in y&&(w||S)&&(r.current=C),!C)return!0;var D=r.current||C;return XP(D,x,y,D==="h"?w:S)},[]),l=f.useCallback(function(y){var x=y;if(!(!Br.length||Br[Br.length-1]!==i)){var v="deltaY"in x?hp(x):ks(x),m=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&JP(C.delta,v)})[0];if(m&&m.should){x.cancelable&&x.preventDefault();return}if(!m){var w=(s.current.shards||[]).map(pp).filter(Boolean).filter(function(C){return C.contains(x.target)}),S=w.length>0?a(x,w[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=f.useCallback(function(y,x,v,m){var w={name:y,delta:x,target:v,should:m,shadowParent:nk(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),c=f.useCallback(function(y){n.current=ks(y),r.current=void 0},[]),d=f.useCallback(function(y){u(y.type,hp(y),y.target,a(y,e.lockRef.current))},[]),p=f.useCallback(function(y){u(y.type,ks(y),y.target,a(y,e.lockRef.current))},[]);f.useEffect(function(){return Br.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Ur),document.addEventListener("touchmove",l,Ur),document.addEventListener("touchstart",c,Ur),function(){Br=Br.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,Ur),document.removeEventListener("touchmove",l,Ur),document.removeEventListener("touchstart",c,Ur)}},[]);var h=e.removeScrollBar,E=e.inert;return f.createElement(f.Fragment,null,E?f.createElement(i,{styles:ZP(o)}):null,h?f.createElement(WP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function nk(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rk=OP(Ly,tk);var zy=f.forwardRef(function(e,t){return f.createElement(al,Wt({},e,{ref:t,sideCar:rk}))});zy.classNames=al.classNames;var Cc=["Enter"," "],ok=["ArrowDown","PageUp","Home"],Uy=["ArrowUp","PageDown","End"],ik=[...ok,...Uy],sk={ltr:[...Cc,"ArrowRight"],rtl:[...Cc,"ArrowLeft"]},ak={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Xi="Menu",[Di,lk,uk]=$d(Xi),[Ar,By]=Nr(Xi,[uk,sl,ky]),ll=sl(),Vy=ky(),[ck,Mr]=Ar(Xi),[dk,Ji]=Ar(Xi),Wy=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=ll(t),[l,u]=f.useState(null),c=f.useRef(!1),d=Je(i),p=Yv(o);return f.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),g.jsx(Qb,{...a,children:g.jsx(ck,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:g.jsx(dk,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:p,modal:s,children:r})})})};Wy.displayName=Xi;var fk="MenuAnchor",Gd=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ll(n);return g.jsx(Cy,{...o,...r,ref:t})});Gd.displayName=fk;var Qd="MenuPortal",[hk,Hy]=Ar(Qd,{forceMount:void 0}),qy=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Mr(Qd,t);return g.jsx(hk,{scope:t,forceMount:n,children:g.jsx(Or,{present:n||i.open,children:g.jsx(Kd,{asChild:!0,container:o,children:r})})})};qy.displayName=Qd;var pt="MenuContent",[pk,Yd]=Ar(pt),Ky=f.forwardRef((e,t)=>{const n=Hy(pt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Mr(pt,e.__scopeMenu),s=Ji(pt,e.__scopeMenu);return g.jsx(Di.Provider,{scope:e.__scopeMenu,children:g.jsx(Or,{present:r||i.open,children:g.jsx(Di.Slot,{scope:e.__scopeMenu,children:s.modal?g.jsx(gk,{...o,ref:t}):g.jsx(mk,{...o,ref:t})})})})}),gk=f.forwardRef((e,t)=>{const n=Mr(pt,e.__scopeMenu),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const i=r.current;if(i)return SP(i)},[]),g.jsx(Xd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mk=f.forwardRef((e,t)=>{const n=Mr(pt,e.__scopeMenu);return g.jsx(Xd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),vk=fP("MenuContent.ScrollLock"),Xd=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:E,...y}=e,x=Mr(pt,n),v=Ji(pt,n),m=ll(n),w=Vy(n),S=lk(n),[C,_]=f.useState(null),P=f.useRef(null),R=Re(t,P,x.onContentChange),j=f.useRef(0),M=f.useRef(""),z=f.useRef(0),D=f.useRef(null),q=f.useRef("right"),I=f.useRef(0),Y=E?zy:f.Fragment,U=E?{as:vk,allowPinchZoom:!0}:void 0,H=k=>{var J,Yt;const L=M.current+k,B=S().filter(be=>!be.disabled),F=document.activeElement,G=(J=B.find(be=>be.ref.current===F))==null?void 0:J.textValue,X=B.map(be=>be.textValue),fe=Rk(X,L,G),ye=(Yt=B.find(be=>be.textValue===fe))==null?void 0:Yt.ref.current;(function be(jt){M.current=jt,window.clearTimeout(j.current),jt!==""&&(j.current=window.setTimeout(()=>be(""),1e3))})(L),ye&&setTimeout(()=>ye.focus())};f.useEffect(()=>()=>window.clearTimeout(j.current),[]),P_();const O=f.useCallback(k=>{var B,F;return q.current===((B=D.current)==null?void 0:B.side)&&Ok(k,(F=D.current)==null?void 0:F.area)},[]);return g.jsx(pk,{scope:n,searchRef:M,onItemEnter:f.useCallback(k=>{O(k)&&k.preventDefault()},[O]),onItemLeave:f.useCallback(k=>{var L;O(k)||((L=P.current)==null||L.focus(),_(null))},[O]),onTriggerLeave:f.useCallback(k=>{O(k)&&k.preventDefault()},[O]),pointerGraceTimerRef:z,onPointerGraceIntentChange:f.useCallback(k=>{D.current=k},[]),children:g.jsx(Y,{...U,children:g.jsx(ey,{asChild:!0,trapped:o,onMountAutoFocus:V(i,k=>{var L;k.preventDefault(),(L=P.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g.jsx(tl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:g.jsx(cP,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:_,onEntryFocus:V(l,k=>{v.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(_y,{role:"menu","aria-orientation":"vertical","data-state":uw(x.open),"data-radix-menu-content":"",dir:v.dir,...m,...y,ref:R,style:{outline:"none",...y.style},onKeyDown:V(y.onKeyDown,k=>{const B=k.target.closest("[data-radix-menu-content]")===k.currentTarget,F=k.ctrlKey||k.altKey||k.metaKey,G=k.key.length===1;B&&(k.key==="Tab"&&k.preventDefault(),!F&&G&&H(k.key));const X=P.current;if(k.target!==X||!ik.includes(k.key))return;k.preventDefault();const ye=S().filter(J=>!J.disabled).map(J=>J.ref.current);Uy.includes(k.key)&&ye.reverse(),kk(ye)}),onBlur:V(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(j.current),M.current="")}),onPointerMove:V(e.onPointerMove,$i(k=>{const L=k.target,B=I.current!==k.clientX;if(k.currentTarget.contains(L)&&B){const F=k.clientX>I.current?"right":"left";q.current=F,I.current=k.clientX}}))})})})})})})});Ky.displayName=pt;var yk="MenuGroup",Jd=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{role:"group",...r,ref:t})});Jd.displayName=yk;var wk="MenuLabel",Gy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Gy.displayName=wk;var Ra="MenuItem",gp="menu.itemSelect",ul=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=f.useRef(null),s=Ji(Ra,e.__scopeMenu),a=Yd(Ra,e.__scopeMenu),l=Re(t,i),u=f.useRef(!1),c=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(gp,{bubbles:!0,cancelable:!0});d.addEventListener(gp,h=>r==null?void 0:r(h),{once:!0}),Dd(d,p),p.defaultPrevented?u.current=!1:s.onClose()}};return g.jsx(Qy,{...o,ref:l,disabled:n,onClick:V(e.onClick,c),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),u.current=!0},onPointerUp:V(e.onPointerUp,d=>{var p;u.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:V(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||Cc.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ul.displayName=Ra;var Qy=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Yd(Ra,n),a=Vy(n),l=f.useRef(null),u=Re(t,l),[c,d]=f.useState(!1),[p,h]=f.useState("");return f.useEffect(()=>{const E=l.current;E&&h((E.textContent??"").trim())},[i.children]),g.jsx(Di.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:g.jsx(dP,{asChild:!0,...a,focusable:!r,children:g.jsx(ve.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:V(e.onPointerMove,$i(E=>{r?s.onItemLeave(E):(s.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,$i(E=>s.onItemLeave(E))),onFocus:V(e.onFocus,()=>d(!0)),onBlur:V(e.onBlur,()=>d(!1))})})})}),xk="MenuCheckboxItem",Yy=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(tw,{scope:e.__scopeMenu,checked:n,children:g.jsx(ul,{role:"menuitemcheckbox","aria-checked":Na(n)?"mixed":n,...o,ref:t,"data-state":ef(n),onSelect:V(o.onSelect,()=>r==null?void 0:r(Na(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Yy.displayName=xk;var Xy="MenuRadioGroup",[Sk,Ek]=Ar(Xy,{value:void 0,onValueChange:()=>{}}),Jy=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Je(r);return g.jsx(Sk,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(Jd,{...o,ref:t})})});Jy.displayName=Xy;var Zy="MenuRadioItem",ew=f.forwardRef((e,t)=>{const{value:n,...r}=e,o=Ek(Zy,e.__scopeMenu),i=n===o.value;return g.jsx(tw,{scope:e.__scopeMenu,checked:i,children:g.jsx(ul,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":ef(i),onSelect:V(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});ew.displayName=Zy;var Zd="MenuItemIndicator",[tw,Ck]=Ar(Zd,{checked:!1}),nw=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Ck(Zd,n);return g.jsx(Or,{present:r||Na(i.checked)||i.checked===!0,children:g.jsx(ve.span,{...o,ref:t,"data-state":ef(i.checked)})})});nw.displayName=Zd;var _k="MenuSeparator",rw=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});rw.displayName=_k;var bk="MenuArrow",ow=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ll(n);return g.jsx(by,{...o,...r,ref:t})});ow.displayName=bk;var Pk="MenuSub",[wO,iw]=Ar(Pk),ri="MenuSubTrigger",sw=f.forwardRef((e,t)=>{const n=Mr(ri,e.__scopeMenu),r=Ji(ri,e.__scopeMenu),o=iw(ri,e.__scopeMenu),i=Yd(ri,e.__scopeMenu),s=f.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},c=f.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return f.useEffect(()=>c,[c]),f.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),g.jsx(Gd,{asChild:!0,...u,children:g.jsx(Qy,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":uw(n.open),...e,ref:Rr(t,o.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:V(e.onPointerMove,$i(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:V(e.onPointerLeave,$i(d=>{var h,E;c();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const y=(E=n.content)==null?void 0:E.dataset.side,x=y==="right",v=x?-5:5,m=p[x?"left":"right"],w=p[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:m,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:m,y:p.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:V(e.onKeyDown,d=>{var h;const p=i.searchRef.current!=="";e.disabled||p&&d.key===" "||sk[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});sw.displayName=ri;var aw="MenuSubContent",lw=f.forwardRef((e,t)=>{const n=Hy(pt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Mr(pt,e.__scopeMenu),s=Ji(pt,e.__scopeMenu),a=iw(aw,e.__scopeMenu),l=f.useRef(null),u=Re(t,l);return g.jsx(Di.Provider,{scope:e.__scopeMenu,children:g.jsx(Or,{present:r||i.open,children:g.jsx(Di.Slot,{scope:e.__scopeMenu,children:g.jsx(Xd,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:V(e.onFocusOutside,c=>{c.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:V(e.onEscapeKeyDown,c=>{s.onClose(),c.preventDefault()}),onKeyDown:V(e.onKeyDown,c=>{var h;const d=c.currentTarget.contains(c.target),p=ak[s.dir].includes(c.key);d&&p&&(i.onOpenChange(!1),(h=a.trigger)==null||h.focus(),c.preventDefault())})})})})})});lw.displayName=aw;function uw(e){return e?"open":"closed"}function Na(e){return e==="indeterminate"}function ef(e){return Na(e)?"indeterminate":e?"checked":"unchecked"}function kk(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Tk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Rk(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Tk(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Nk(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function Ok(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Nk(n,t)}function $i(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ak=Wy,Mk=Gd,jk=qy,Lk=Ky,Ik=Jd,Dk=Gy,$k=ul,Fk=Yy,zk=Jy,Uk=ew,Bk=nw,Vk=rw,Wk=ow,Hk=sw,qk=lw,cl="DropdownMenu",[Kk]=Nr(cl,[By]),He=By(),[Gk,cw]=Kk(cl),dw=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=He(t),u=f.useRef(null),[c,d]=Id({prop:o,defaultProp:i??!1,onChange:s,caller:cl});return g.jsx(Gk,{scope:t,triggerId:vc(),triggerRef:u,contentId:vc(),open:c,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(p=>!p),[d]),modal:a,children:g.jsx(Ak,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};dw.displayName=cl;var fw="DropdownMenuTrigger",hw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=cw(fw,n),s=He(n);return g.jsx(Mk,{asChild:!0,...s,children:g.jsx(ve.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Rr(t,i.triggerRef),onPointerDown:V(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:V(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});hw.displayName=fw;var Qk="DropdownMenuPortal",pw=e=>{const{__scopeDropdownMenu:t,...n}=e,r=He(t);return g.jsx(jk,{...r,...n})};pw.displayName=Qk;var gw="DropdownMenuContent",mw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=cw(gw,n),i=He(n),s=f.useRef(!1);return g.jsx(Lk,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:V(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:V(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!o.modal||c)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});mw.displayName=gw;var Yk="DropdownMenuGroup",Xk=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Ik,{...o,...r,ref:t})});Xk.displayName=Yk;var Jk="DropdownMenuLabel",vw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Dk,{...o,...r,ref:t})});vw.displayName=Jk;var Zk="DropdownMenuItem",yw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx($k,{...o,...r,ref:t})});yw.displayName=Zk;var eT="DropdownMenuCheckboxItem",ww=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Fk,{...o,...r,ref:t})});ww.displayName=eT;var tT="DropdownMenuRadioGroup",nT=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(zk,{...o,...r,ref:t})});nT.displayName=tT;var rT="DropdownMenuRadioItem",xw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Uk,{...o,...r,ref:t})});xw.displayName=rT;var oT="DropdownMenuItemIndicator",Sw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Bk,{...o,...r,ref:t})});Sw.displayName=oT;var iT="DropdownMenuSeparator",Ew=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Vk,{...o,...r,ref:t})});Ew.displayName=iT;var sT="DropdownMenuArrow",aT=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Wk,{...o,...r,ref:t})});aT.displayName=sT;var lT="DropdownMenuSubTrigger",Cw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Hk,{...o,...r,ref:t})});Cw.displayName=lT;var uT="DropdownMenuSubContent",_w=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(qk,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_w.displayName=uT;var cT=dw,dT=hw,fT=pw,bw=mw,Pw=vw,kw=yw,Tw=ww,Rw=xw,Nw=Sw,Ow=Ew,Aw=Cw,Mw=_w;/** + * @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 hT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jw=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @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. + */var pT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @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 gT=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>f.createElement("svg",{ref:l,...pT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:jw("lucide",o),...a},[...s.map(([u,c])=>f.createElement(u,c)),...Array.isArray(i)?i:[i]]));/** + * @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 dl=(e,t)=>{const n=f.forwardRef(({className:r,...o},i)=>f.createElement(gT,{ref:i,iconNode:t,className:jw(`lucide-${hT(e)}`,r),...o}));return n.displayName=`${e}`,n};/** + * @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 mT=dl("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @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 vT=dl("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @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 yT=dl("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @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 wT=dl("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),xT=cT,ST=dT,ET=f.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(Aw,{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,g.jsx(vT,{className:"ml-auto h-4 w-4"})]}));ET.displayName=Aw.displayName;const CT=f.forwardRef(({className:e,...t},n)=>g.jsx(Mw,{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}));CT.displayName=Mw.displayName;const Lw=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(fT,{children:g.jsx(bw,{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})}));Lw.displayName=bw.displayName;const $t=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(kw,{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}));$t.displayName=kw.displayName;const _T=f.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(Tw,{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:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Nw,{children:g.jsx(mT,{className:"h-4 w-4"})})}),t]}));_T.displayName=Tw.displayName;const bT=f.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(Rw,{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:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Nw,{children:g.jsx(yT,{className:"h-2 w-2 fill-current"})})}),t]}));bT.displayName=Rw.displayName;const Iw=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(Pw,{ref:r,className:Ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Iw.displayName=Pw.displayName;const _c=f.forwardRef(({className:e,...t},n)=>g.jsx(Ow,{ref:n,className:Ne("-mx-1 my-1 h-px bg-muted",e),...t}));_c.displayName=Ow.displayName;function PT(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 kT=({user:e,onLogout:t})=>g.jsxs(xT,{children:[g.jsx(ST,{asChild:!0,children:g.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:g.jsxs(Kv,{className:"h-8 w-8",children:[e.avatar_url&&g.jsx(Gv,{src:e.avatar_url,alt:e.username}),g.jsx(Qv,{className:"text-xs",children:PT(e)})]})})}),g.jsxs(Lw,{align:"end",className:"w-56",children:[g.jsxs(Iw,{className:"flex flex-col gap-0.5 py-2",children:[g.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),g.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&g.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"}),e.role==="contributor"&&g.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),g.jsx(_c,{}),g.jsx($t,{asChild:!0,children:g.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),Ca()&&g.jsx($t,{asChild:!0,children:g.jsx(en,{to:"/chat",children:"Chat"})}),g.jsx($t,{asChild:!0,children:g.jsx(en,{to:"/frameworks",children:"Frameworks"})}),g.jsx($t,{asChild:!0,children:g.jsx(en,{to:"/trends",children:"Trends"})}),e.is_admin&&g.jsxs(g.Fragment,{children:[g.jsx($t,{asChild:!0,children:g.jsx(en,{to:"/admin-dashboard",children:"Admin dashboard"})}),g.jsx($t,{asChild:!0,children:g.jsx(en,{to:"/submissions",children:"Review submissions"})})]}),g.jsx($t,{asChild:!0,children:g.jsx(en,{to:`/${encodeURIComponent(e.username)}`,children:"My contributions"})}),g.jsx($t,{asChild:!0,children:g.jsx(en,{to:"/settings",children:"Settings"})}),g.jsx(_c,{}),g.jsx($t,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),Dw=T.createContext(null),mp="pwc:auth-stale";async function TT(){if(Gi())return null;const e=await fetch(dr("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return e.status===401||!e.ok?null:await e.json()}const RT=({children:e})=>{const[t,n]=T.useState(null),[r,o]=T.useState(!0),i=T.useCallback(async()=>{o(!0);const l=await TT();n(l),o(!1)},[]),s=T.useCallback(async()=>{const l=el("/api/v1/auth/logout");if(new URL(l,window.location.origin).origin!==window.location.origin){const u=document.createElement("form");u.method="POST",u.action=`${l}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(u),u.submit();return}await fetch(dr("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);T.useEffect(()=>{i()},[i]),T.useEffect(()=>{const l=()=>n(null);return window.addEventListener(mp,l),()=>window.removeEventListener(mp,l)},[]);const a=T.useMemo(()=>({user:t,isLoading:r,refresh:i,logout:s}),[t,r,i,s]);return g.jsx(Dw.Provider,{value:a,children:e})};function tf(){const e=T.useContext(Dw);if(!e)throw new Error("useAuth must be used inside an ");return e}const Xo=({name:e,size:t=14})=>{const n={search:g.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:g.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:g.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:g.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return g.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},vp="https://github.com/huggingface/paperswithcode-feedback/issues",NT="https://github.com/huggingface/pwc-cli",yp=[{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:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],OT=()=>{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)},AT=()=>{const[e,t]=T.useState(!1);return T.useEffect(()=>{t(OT())},[]),g.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},MT=({onOpenSearch:e})=>{const[t,n]=T.useState(!1),r=()=>n(!1),{user:o,logout:i}=tf(),s=Mt(),a=Ca()&&(s.pathname==="/chat"||s.pathname.startsWith("/chat/")),l=`${s.pathname}${s.search}`||"/",u=Gi();return g.jsxs(g.Fragment,{children:[g.jsxs("header",{className:`app-header${a?" app-header-chat":""}`,children:[g.jsxs("div",{className:"app-header-inner",children:[g.jsxs(or,{to:"/",className:"brand",onClick:r,children:[g.jsx("span",{className:"brand-mark"}),g.jsxs("span",{className:"brand-name",children:["Papers ",g.jsx("em",{children:"With Code"})]})]}),g.jsx("nav",{className:"nav",children:yp.map(({to:c,label:d,end:p})=>g.jsx(or,{to:c,end:p,className:({isActive:h})=>`nav-item ${h?"active":""}`,children:d},c))}),g.jsx("div",{className:"header-spacer"}),g.jsx("a",{className:"feedback-link header-feedback-link",href:vp,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),g.jsxs("button",{className:"search-trigger",onClick:e,children:[g.jsx(Xo,{name:"search",size:13}),g.jsx("span",{children:"Search papers, authors, domains…"}),g.jsx(AT,{})]}),g.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:g.jsx(Xo,{name:"search",size:14})}),!u&&g.jsx(or,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:g.jsx(Xo,{name:"bookmark",size:13})}),u?null:o?g.jsx(kT,{user:o,onLogout:i}):g.jsx(Pv,{returnTo:l}),g.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(c=>!c),children:g.jsx(Xo,{name:t?"close":"menu",size:14})})]}),g.jsxs("div",{className:"site-announcement",role:"status",children:[g.jsx("span",{children:"New: Papers with Code CLI and Skill now "}),g.jsx("a",{href:NT,target:"_blank",rel:"noreferrer",children:"available"}),g.jsx("span",{children:" as well as "}),g.jsx(or,{to:"/chat",children:"chat"})]})]}),t&&g.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:g.jsxs("div",{className:"mobile-nav-panel",onClick:c=>c.stopPropagation(),children:[g.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),e()},children:[g.jsx(Xo,{name:"search",size:14}),g.jsx("span",{children:"Search papers, authors, domains…"})]}),yp.map(({to:c,label:d,end:p})=>g.jsx(or,{to:c,end:p,className:"mobile-nav-link",onClick:r,children:d},c)),g.jsx("a",{className:"mobile-nav-link",href:vp,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!u&&g.jsx(or,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),!u&&(o==null?void 0:o.is_admin)&&g.jsx(or,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:r,children:"Admin dashboard"})]})})]})},jT=()=>{const{pathname:e}=Mt();return e==="/chat"||e.startsWith("/chat/")?null:g.jsx("footer",{className:"site-footer",children:g.jsxs("div",{className:"site-footer-inner",children:[g.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),g.jsx(en,{to:"/privacy",children:"Privacy"}),g.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},LT=1,IT=1e6;let uu=0;function DT(){return uu=(uu+1)%Number.MAX_SAFE_INTEGER,uu.toString()}const cu=new Map,wp=e=>{if(cu.has(e))return;const t=setTimeout(()=>{cu.delete(e),hi({type:"REMOVE_TOAST",toastId:e})},IT);cu.set(e,t)},$T=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,LT)};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?wp(n):e.toasts.forEach(r=>{wp(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)}}},qs=[];let Ks={toasts:[]};function hi(e){Ks=$T(Ks,e),qs.forEach(t=>{t(Ks)})}function FT({...e}){const t=DT(),n=o=>hi({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>hi({type:"DISMISS_TOAST",toastId:t});return hi({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function zT(){const[e,t]=f.useState(Ks);return f.useEffect(()=>(qs.push(t),()=>{const n=qs.indexOf(t);n>-1&&qs.splice(n,1)}),[e]),{...e,toast:FT,dismiss:n=>hi({type:"DISMISS_TOAST",toastId:n})}}var UT=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"}),BT="VisuallyHidden",fl=f.forwardRef((e,t)=>g.jsx(ve.span,{...e,ref:t,style:{...UT,...e.style}}));fl.displayName=BT;var VT=fl,nf="ToastProvider",[rf,WT,HT]=$d("Toast"),[$w]=Nr("Toast",[HT]),[qT,hl]=$w(nf),Fw=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=f.useState(null),[u,c]=f.useState(0),d=f.useRef(!1),p=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${nf}\`. Expected non-empty \`string\`.`),g.jsx(rf.Provider,{scope:t,children:g.jsx(qT,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>c(h=>h+1),[]),onToastRemove:f.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:p,children:s})})};Fw.displayName=nf;var zw="ToastViewport",KT=["F8"],bc="toast.viewportPause",Pc="toast.viewportResume",Uw=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=KT,label:o="Notifications ({hotkey})",...i}=e,s=hl(zw,n),a=WT(n),l=f.useRef(null),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),p=Re(t,d,s.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=s.toastCount>0;f.useEffect(()=>{const x=v=>{var w;r.length!==0&&r.every(S=>v[S]||v.code===S)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,v=d.current;if(E&&x&&v){const m=()=>{if(!s.isClosePausedRef.current){const _=new CustomEvent(bc);v.dispatchEvent(_),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const _=new CustomEvent(Pc);v.dispatchEvent(_),s.isClosePausedRef.current=!1}},S=_=>{!x.contains(_.relatedTarget)&&w()},C=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",m),x.addEventListener("focusout",S),x.addEventListener("pointermove",m),x.addEventListener("pointerleave",C),window.addEventListener("blur",m),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",m),x.removeEventListener("focusout",S),x.removeEventListener("pointermove",m),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",m),window.removeEventListener("focus",w)}}},[E,s.isClosePausedRef]);const y=f.useCallback(({tabbingDirection:x})=>{const m=a().map(w=>{const S=w.ref.current,C=[S,...sR(S)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?m.reverse():m).flat()},[a]);return f.useEffect(()=>{const x=d.current;if(x){const v=m=>{var C,_,P;const w=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!w){const R=document.activeElement,j=m.shiftKey;if(m.target===x&&j){(C=u.current)==null||C.focus();return}const D=y({tabbingDirection:j?"backwards":"forwards"}),q=D.findIndex(I=>I===R);du(D.slice(q+1))?m.preventDefault():j?(_=u.current)==null||_.focus():(P=c.current)==null||P.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,y]),g.jsxs(b_,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&g.jsx(kc,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});du(x)}}),g.jsx(rf.Slot,{scope:n,children:g.jsx(ve.ol,{tabIndex:-1,...i,ref:p})}),E&&g.jsx(kc,{ref:c,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});du(x)}})]})});Uw.displayName=zw;var Bw="ToastFocusProxy",kc=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=hl(Bw,n);return g.jsx(fl,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});kc.displayName=Bw;var Zi="Toast",GT="toast.swipeStart",QT="toast.swipeMove",YT="toast.swipeCancel",XT="toast.swipeEnd",Vw=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a,l]=Id({prop:r,defaultProp:o??!0,onChange:i,caller:Zi});return g.jsx(Or,{present:n||a,children:g.jsx(eR,{open:a,...s,ref:t,onClose:()=>l(!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:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}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:c,y:d}=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",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Vw.displayName=Zi;var[JT,ZT]=$w(Zi,{onClose(){}}),eR=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:p,onSwipeEnd:h,...E}=e,y=hl(Zi,n),[x,v]=f.useState(null),m=Re(t,I=>v(I)),w=f.useRef(null),S=f.useRef(null),C=o||y.duration,_=f.useRef(0),P=f.useRef(C),R=f.useRef(0),{onToastAdd:j,onToastRemove:M}=y,z=Je(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=y.viewport)==null||Y.focus()),s()}),D=f.useCallback(I=>{!I||I===1/0||(window.clearTimeout(R.current),_.current=new Date().getTime(),R.current=window.setTimeout(z,I))},[z]);f.useEffect(()=>{const I=y.viewport;if(I){const Y=()=>{D(P.current),u==null||u()},U=()=>{const H=new Date().getTime()-_.current;P.current=P.current-H,window.clearTimeout(R.current),l==null||l()};return I.addEventListener(bc,U),I.addEventListener(Pc,Y),()=>{I.removeEventListener(bc,U),I.removeEventListener(Pc,Y)}}},[y.viewport,C,l,u,D]),f.useEffect(()=>{i&&!y.isClosePausedRef.current&&D(C)},[i,C,y.isClosePausedRef,D]),f.useEffect(()=>(j(),()=>M()),[j,M]);const q=f.useMemo(()=>x?Yw(x):null,[x]);return y.viewport?g.jsxs(g.Fragment,{children:[q&&g.jsx(tR,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:q}),g.jsx(JT,{scope:n,onClose:z,children:Ki.createPortal(g.jsx(rf.ItemSlot,{scope:n,children:g.jsx(__,{asChild:!0,onEscapeKeyDown:V(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||z(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:g.jsx(ve.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...E,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:V(e.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:V(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:V(e.onPointerMove,I=>{if(!w.current)return;const Y=I.clientX-w.current.x,U=I.clientY-w.current.y,H=!!S.current,O=["left","right"].includes(y.swipeDirection),k=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,L=O?k(0,Y):0,B=O?0:k(0,U),F=I.pointerType==="touch"?10:2,G={x:L,y:B},X={originalEvent:I,delta:G};H?(S.current=G,Ts(QT,d,X,{discrete:!1})):xp(G,y.swipeDirection,F)?(S.current=G,Ts(GT,c,X,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(Y)>F||Math.abs(U)>F)&&(w.current=null)}),onPointerUp:V(e.onPointerUp,I=>{const Y=S.current,U=I.target;if(U.hasPointerCapture(I.pointerId)&&U.releasePointerCapture(I.pointerId),S.current=null,w.current=null,Y){const H=I.currentTarget,O={originalEvent:I,delta:Y};xp(Y,y.swipeDirection,y.swipeThreshold)?Ts(XT,h,O,{discrete:!0}):Ts(YT,p,O,{discrete:!0}),H.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),tR=e=>{const{__scopeToast:t,children:n,...r}=e,o=hl(Zi,t),[i,s]=f.useState(!1),[a,l]=f.useState(!1);return oR(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:g.jsx(Kd,{asChild:!0,children:g.jsx(fl,{...r,children:i&&g.jsxs(g.Fragment,{children:[o.label," ",n]})})})},nR="ToastTitle",Ww=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Ww.displayName=nR;var rR="ToastDescription",Hw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Hw.displayName=rR;var qw="ToastAction",Kw=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?g.jsx(Qw,{altText:n,asChild:!0,children:g.jsx(of,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${qw}\`. Expected non-empty \`string\`.`),null)});Kw.displayName=qw;var Gw="ToastClose",of=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=ZT(Gw,n);return g.jsx(Qw,{asChild:!0,children:g.jsx(ve.button,{type:"button",...r,ref:t,onClick:V(e.onClick,o.onClose)})})});of.displayName=Gw;var Qw=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return g.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Yw(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),iR(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(...Yw(r))}}),t}function Ts(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?Dd(o,i):o.dispatchEvent(i)}var xp=(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 oR(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 iR(e){return e.nodeType===e.ELEMENT_NODE}function sR(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 du(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var aR=Fw,Xw=Uw,Jw=Vw,Zw=Ww,e0=Hw,t0=Kw,n0=of;const Sp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ep=Uv,lR=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ep(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 c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const p=Sp(c)||Sp(d);return o[u][p]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,p]=c;return p===void 0||(u[d]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...h}=c;return Object.entries(h).every(E=>{let[y,x]=E;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,d,p]:u},[]);return Ep(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},uR=aR,r0=f.forwardRef(({className:e,...t},n)=>g.jsx(Xw,{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}));r0.displayName=Xw.displayName;const cR=lR("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"}}),o0=f.forwardRef(({className:e,variant:t,...n},r)=>g.jsx(Jw,{ref:r,className:Ne(cR({variant:t}),e),...n}));o0.displayName=Jw.displayName;const dR=f.forwardRef(({className:e,...t},n)=>g.jsx(t0,{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}));dR.displayName=t0.displayName;const i0=f.forwardRef(({className:e,...t},n)=>g.jsx(n0,{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:g.jsx(wT,{className:"h-4 w-4"})}));i0.displayName=n0.displayName;const s0=f.forwardRef(({className:e,...t},n)=>g.jsx(Zw,{ref:n,className:Ne("text-sm font-semibold",e),...t}));s0.displayName=Zw.displayName;const a0=f.forwardRef(({className:e,...t},n)=>g.jsx(e0,{ref:n,className:Ne("text-sm opacity-90",e),...t}));a0.displayName=e0.displayName;function fR(){const{toasts:e}=zT();return g.jsxs(uR,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return g.jsxs(o0,{...i,children:[g.jsxs("div",{className:"grid gap-1",children:[n&&g.jsx(s0,{children:n}),r&&g.jsx(a0,{children:r})]}),o,g.jsx(i0,{})]},t)}),g.jsx(r0,{})]})}var hR=e=>{switch(e){case"success":return mR;case"info":return yR;case"warning":return vR;case"error":return wR;default:return null}},pR=Array(12).fill(0),gR=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},pR.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),mR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),vR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),yR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),wR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),xR=T.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"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),SR=()=>{let[e,t]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Tc=1,ER=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:Tc++,i=this.toasts.find(a=>a.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(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):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 l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(_R(l)&&!l.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:u,description:c})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(l):t.success,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(l):t.error,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,u)=>s.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Tc++;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}},qe=new ER,CR=(e,t)=>{let n=(t==null?void 0:t.id)||Tc++;return qe.addToast({title:e,...t,id:n}),n},_R=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",bR=CR,PR=()=>qe.toasts,kR=()=>qe.getActiveToasts();Object.assign(bR,{success:qe.success,info:qe.info,warning:qe.warning,error:qe.error,custom:qe.custom,message:qe.message,promise:qe.promise,dismiss:qe.dismiss,loading:qe.loading},{getHistory:PR,getToasts:kR});function TR(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))}TR(`: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 Rs(e){return e.label!==void 0}var RR=3,NR="32px",OR="16px",Cp=4e3,AR=356,MR=14,jR=20,LR=200;function Et(...e){return e.filter(Boolean).join(" ")}function IR(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var DR=e=>{var t,n,r,o,i,s,a,l,u,c,d;let{invert:p,toast:h,unstyled:E,interacting:y,setHeights:x,visibleToasts:v,heights:m,index:w,toasts:S,expanded:C,removeToast:_,defaultRichColors:P,closeButton:R,style:j,cancelButtonStyle:M,actionButtonStyle:z,className:D="",descriptionClassName:q="",duration:I,position:Y,gap:U,loadingIcon:H,expandByDefault:O,classNames:k,icons:L,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:F}=e,[G,X]=T.useState(null),[fe,ye]=T.useState(null),[J,Yt]=T.useState(!1),[be,jt]=T.useState(!1),[vn,jr]=T.useState(!1),[yn,es]=T.useState(!1),[vl,ts]=T.useState(!1),[yl,Fo]=T.useState(0),[Lr,af]=T.useState(0),zo=T.useRef(h.duration||I||Cp),lf=T.useRef(null),nr=T.useRef(null),w0=w===0,x0=w+1<=v,lt=h.type,Ir=h.dismissible!==!1,S0=h.className||"",E0=h.descriptionClassName||"",ns=T.useMemo(()=>m.findIndex(K=>K.toastId===h.id)||0,[m,h.id]),C0=T.useMemo(()=>{var K;return(K=h.closeButton)!=null?K:R},[h.closeButton,R]),uf=T.useMemo(()=>h.duration||I||Cp,[h.duration,I]),wl=T.useRef(0),Dr=T.useRef(0),cf=T.useRef(0),$r=T.useRef(null),[_0,b0]=Y.split("-"),df=T.useMemo(()=>m.reduce((K,ie,ce)=>ce>=ns?K:K+ie.height,0),[m,ns]),ff=SR(),P0=h.invert||p,xl=lt==="loading";Dr.current=T.useMemo(()=>ns*U+df,[ns,df]),T.useEffect(()=>{zo.current=uf},[uf]),T.useEffect(()=>{Yt(!0)},[]),T.useEffect(()=>{let K=nr.current;if(K){let ie=K.getBoundingClientRect().height;return af(ie),x(ce=>[{toastId:h.id,height:ie,position:h.position},...ce]),()=>x(ce=>ce.filter(yt=>yt.toastId!==h.id))}},[x,h.id]),T.useLayoutEffect(()=>{if(!J)return;let K=nr.current,ie=K.style.height;K.style.height="auto";let ce=K.getBoundingClientRect().height;K.style.height=ie,af(ce),x(yt=>yt.find(wt=>wt.toastId===h.id)?yt.map(wt=>wt.toastId===h.id?{...wt,height:ce}:wt):[{toastId:h.id,height:ce,position:h.position},...yt])},[J,h.title,h.description,x,h.id]);let wn=T.useCallback(()=>{jt(!0),Fo(Dr.current),x(K=>K.filter(ie=>ie.toastId!==h.id)),setTimeout(()=>{_(h)},LR)},[h,_,x,Dr]);T.useEffect(()=>{if(h.promise&<==="loading"||h.duration===1/0||h.type==="loading")return;let K;return C||y||F&&ff?(()=>{if(cf.current{var ie;(ie=h.onAutoClose)==null||ie.call(h,h),wn()},zo.current)),()=>clearTimeout(K)},[C,y,h,lt,F,ff,wn]),T.useEffect(()=>{h.delete&&wn()},[wn,h.delete]);function k0(){var K,ie,ce;return L!=null&&L.loading?T.createElement("div",{className:Et(k==null?void 0:k.loader,(K=h==null?void 0:h.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":lt==="loading"},L.loading):H?T.createElement("div",{className:Et(k==null?void 0:k.loader,(ie=h==null?void 0:h.classNames)==null?void 0:ie.loader,"sonner-loader"),"data-visible":lt==="loading"},H):T.createElement(gR,{className:Et(k==null?void 0:k.loader,(ce=h==null?void 0:h.classNames)==null?void 0:ce.loader),visible:lt==="loading"})}return T.createElement("li",{tabIndex:0,ref:nr,className:Et(D,S0,k==null?void 0:k.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[lt],(n=h==null?void 0:h.classNames)==null?void 0:n[lt]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:P,"data-styled":!(h.jsx||h.unstyled||E),"data-mounted":J,"data-promise":!!h.promise,"data-swiped":vl,"data-removed":be,"data-visible":x0,"data-y-position":_0,"data-x-position":b0,"data-index":w,"data-front":w0,"data-swiping":vn,"data-dismissible":Ir,"data-type":lt,"data-invert":P0,"data-swipe-out":yn,"data-swipe-direction":fe,"data-expanded":!!(C||O&&J),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${be?yl:Dr.current}px`,"--initial-height":O?"auto":`${Lr}px`,...j,...h.style},onDragEnd:()=>{jr(!1),X(null),$r.current=null},onPointerDown:K=>{xl||!Ir||(lf.current=new Date,Fo(Dr.current),K.target.setPointerCapture(K.pointerId),K.target.tagName!=="BUTTON"&&(jr(!0),$r.current={x:K.clientX,y:K.clientY}))},onPointerUp:()=>{var K,ie,ce,yt;if(yn||!Ir)return;$r.current=null;let wt=Number(((K=nr.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),xn=Number(((ie=nr.current)==null?void 0:ie.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),rr=new Date().getTime()-((ce=lf.current)==null?void 0:ce.getTime()),xt=G==="x"?wt:xn,Sn=Math.abs(xt)/rr;if(Math.abs(xt)>=jR||Sn>.11){Fo(Dr.current),(yt=h.onDismiss)==null||yt.call(h,h),ye(G==="x"?wt>0?"right":"left":xn>0?"down":"up"),wn(),es(!0),ts(!1);return}jr(!1),X(null)},onPointerMove:K=>{var ie,ce,yt,wt;if(!$r.current||!Ir||((ie=window.getSelection())==null?void 0:ie.toString().length)>0)return;let xn=K.clientY-$r.current.y,rr=K.clientX-$r.current.x,xt=(ce=e.swipeDirections)!=null?ce:IR(Y);!G&&(Math.abs(rr)>1||Math.abs(xn)>1)&&X(Math.abs(rr)>Math.abs(xn)?"x":"y");let Sn={x:0,y:0};G==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&xn<0||xt.includes("bottom")&&xn>0)&&(Sn.y=xn):G==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&rr<0||xt.includes("right")&&rr>0)&&(Sn.x=rr),(Math.abs(Sn.x)>0||Math.abs(Sn.y)>0)&&ts(!0),(yt=nr.current)==null||yt.style.setProperty("--swipe-amount-x",`${Sn.x}px`),(wt=nr.current)==null||wt.style.setProperty("--swipe-amount-y",`${Sn.y}px`)}},C0&&!h.jsx?T.createElement("button",{"aria-label":B,"data-disabled":xl,"data-close-button":!0,onClick:xl||!Ir?()=>{}:()=>{var K;wn(),(K=h.onDismiss)==null||K.call(h,h)},className:Et(k==null?void 0:k.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=L==null?void 0:L.close)!=null?i:xR):null,h.jsx||f.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,lt||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:Et(k==null?void 0:k.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||k0():null,h.type!=="loading"?h.icon||(L==null?void 0:L[lt])||hR(lt):null):null,T.createElement("div",{"data-content":"",className:Et(k==null?void 0:k.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:Et(k==null?void 0:k.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?T.createElement("div",{"data-description":"",className:Et(q,E0,k==null?void 0:k.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),f.isValidElement(h.cancel)?h.cancel:h.cancel&&Rs(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:K=>{var ie,ce;Rs(h.cancel)&&Ir&&((ce=(ie=h.cancel).onClick)==null||ce.call(ie,K),wn())},className:Et(k==null?void 0:k.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,f.isValidElement(h.action)?h.action:h.action&&Rs(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||z,onClick:K=>{var ie,ce;Rs(h.action)&&((ce=(ie=h.action).onClick)==null||ce.call(ie,K),!K.defaultPrevented&&wn())},className:Et(k==null?void 0:k.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function _p(){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 $R(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?OR:NR;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${s}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=a:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var FR=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:p,style:h,visibleToasts:E=RR,toastOptions:y,dir:x=_p(),gap:v=MR,loadingIcon:m,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[_,P]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(_.filter(F=>F.position).map(F=>F.position)))),[_,r]),[j,M]=T.useState([]),[z,D]=T.useState(!1),[q,I]=T.useState(!1),[Y,U]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=T.useRef(null),O=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=T.useRef(null),L=T.useRef(!1),B=T.useCallback(F=>{P(G=>{var X;return(X=G.find(fe=>fe.id===F.id))!=null&&X.delete||qe.dismiss(F.id),G.filter(({id:fe})=>fe!==F.id)})},[]);return T.useEffect(()=>qe.subscribe(F=>{if(F.dismiss){P(G=>G.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{Zm.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]})})})}),[]),T.useEffect(()=>{if(c!=="system"){U(c);return}if(c==="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)}})}},[c]),T.useEffect(()=>{_.length<=1&&D(!1)},[_]),T.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]),T.useEffect(()=>{if(H.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,L.current=!1)}},[H.current]),T.createElement("section",{ref:t,"aria-label":`${S} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,G)=>{var X;let[fe,ye]=F.split("-");return _.length?T.createElement("ol",{key:F,dir:x==="auto"?_p():x,tabIndex:-1,ref:H,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":fe,"data-lifted":z&&_.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((X=j[0])==null?void 0:X.height)||0}px`,"--width":`${AR}px`,"--gap":`${v}px`,...h,...$R(l,u)},onBlur:J=>{L.current&&!J.currentTarget.contains(J.relatedTarget)&&(L.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||L.current||(L.current=!0,k.current=J.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{q||D(!1)},onDragEnd:()=>D(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},_.filter(J=>!J.position&&G===0||J.position===F).map((J,Yt)=>{var be,jt;return T.createElement(DR,{key:J.id,icons:w,index:Yt,toast:J,defaultRichColors:d,duration:(be=y==null?void 0:y.duration)!=null?be:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:E,closeButton:(jt=y==null?void 0:y.closeButton)!=null?jt:s,interacting:q,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:_.filter(vn=>vn.position==J.position),heights:j.filter(vn=>vn.position==J.position),setHeights:M,expandByDefault:i,gap:v,loadingIcon:m,expanded:z,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const zR=({...e})=>{const{theme:t="system"}=oE();return g.jsx(FR,{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 UR=Symbol("radix.slottable");function BR(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=UR,t}var[pl]=Nr("Tooltip",[sl]),sf=sl(),l0="TooltipProvider",VR=700,bp="tooltip.open",[WR,u0]=pl(l0),c0=e=>{const{__scopeTooltip:t,delayDuration:n=VR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(WR,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};c0.displayName=l0;var d0="Tooltip",[xO,gl]=pl(d0),Rc="TooltipTrigger",HR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gl(Rc,n),i=u0(Rc,n),s=sf(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),u=f.useRef(!1),c=f.useRef(!1),d=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(Cy,{asChild:!0,...s,children:g.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:V(e.onPointerMove,p=>{p.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});HR.displayName=Rc;var qR="TooltipPortal",[SO,KR]=pl(qR,{forceMount:void 0}),Oo="TooltipContent",f0=f.forwardRef((e,t)=>{const n=KR(Oo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=gl(Oo,e.__scopeTooltip);return g.jsx(Or,{present:r||s.open,children:s.disableHoverableContent?g.jsx(h0,{side:o,...i,ref:t}):g.jsx(GR,{side:o,...i,ref:t})})}),GR=f.forwardRef((e,t)=>{const n=gl(Oo,e.__scopeTooltip),r=u0(Oo,e.__scopeTooltip),o=f.useRef(null),i=Re(t,o),[s,a]=f.useState(null),{trigger:l,onClose:u}=n,c=o.current,{onPointerInTransitChange:d}=r,p=f.useCallback(()=>{a(null),d(!1)},[d]),h=f.useCallback((E,y)=>{const x=E.currentTarget,v={x:E.clientX,y:E.clientY},m=ZR(v,x.getBoundingClientRect()),w=eN(v,m),S=tN(y.getBoundingClientRect()),C=rN([...w,...S]);a(C),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(l&&c){const E=x=>h(x,c),y=x=>h(x,l);return l.addEventListener("pointerleave",E),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",E),c.removeEventListener("pointerleave",y)}}},[l,c,h,p]),f.useEffect(()=>{if(s){const E=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},m=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!nN(v,s);m?p():w&&(p(),u())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[l,c,s,u,p]),g.jsx(h0,{...e,ref:i})}),[QR,YR]=pl(d0,{isInside:!1}),XR=BR("TooltipContent"),h0=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=gl(Oo,n),u=sf(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener(bp,c),()=>document.removeEventListener(bp,c)),[c]),f.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),g.jsx(tl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:g.jsxs(_y,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.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:[g.jsx(XR,{children:r}),g.jsx(QR,{scope:n,isInside:!0,children:g.jsx(VT,{id:l.contentId,role:"tooltip",children:o||r})})]})})});f0.displayName=Oo;var p0="TooltipArrow",JR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=sf(n);return YR(p0,n).isInside?null:g.jsx(by,{...o,...r,ref:t})});JR.displayName=p0;function ZR(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 eN(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 tN(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 nN(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function rN(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),oN(t)}function oN(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 iN=c0,g0=f0;const sN=iN,aN=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(g0,{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}));aN.displayName=g0.displayName;function lN(){const{pathname:e,hash:t}=Mt();f.useEffect(()=>{t||window.scrollTo(0,0)},[e,t])}const uN="cronAdminToken";function cN(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(uN))==null?void 0:e.trim())??""}const Pp=!1;class Oa extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);Lt(this,"status");Lt(this,"statusText");Lt(this,"response");Lt(this,"detail");Lt(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="string"&&(this.message=this.detail),typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const i="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${i}`}}catch{this.detail=void 0}}}class dN{constructor(t){this.baseUrl=t}async request(t,n){const r=`${this.baseUrl}${t}`;try{const{headers:o,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=cN(),u=new Headers(o);u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l);const c=await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u});if(!c.ok){const p=new Oa(c,await c.text());throw console.error("[API] Error response:",p.response),p}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}}async function fN(e){try{return await e()}catch(t){throw t instanceof Oa&&t.status===401&&t.code!=="fresh_auth_required"&&t.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale")),t}}const hN=new dN(`${Ad()}/api/v1`),ml=(e,t)=>fN(()=>hN.request(e,t));class pN{constructor(t){this.request=t}getPreferences(){return this.request("/me/preferences")}updatePreferences(t){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(t)})}}const kp=new pN(ml),Ns="pwc:fresh-auth-mutation";function gN(e){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",e);const t=el("/api/v1/auth/hf/login");window.location.assign(`${t}?return_to=${encodeURIComponent(window.location.href)}`)}class m0{constructor(t,n=gN){Lt(this,"paperLoads",new Map);Lt(this,"evaluationLoads",new Map);this.request=t,this.recoverFreshAuth=n}primePaper(t,n=!1){n&&this.paperLoads.delete(t);let r=this.paperLoads.get(t);return r||(r=this.request(`/papers/${t}/curation-state`).catch(o=>{throw this.paperLoads.delete(t),o}),this.paperLoads.set(t,r)),r}primeEvaluations(t,n=!1){n&&this.evaluationLoads.delete(t);let r=this.evaluationLoads.get(t);return r||(r=this.request(`/evaluations/curation-state?paper_id=${t}`).catch(o=>{throw this.evaluationLoads.delete(t),o}),this.evaluationLoads.set(t,r)),r}async mutatePaper(t,n,r,o,i){const s=this.paperLoads.get(t);if(!s)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const a=(await s).sections[n];if(!a)throw new Error(`Missing curation version for ${n}`);return this.mutate(n,o,r,a,i,`paper:${t}:${n}`)}async mutateEvaluations(t,n,r,o){const i=this.evaluationLoads.get(String(t));if(!i)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const s=(await i).version;return this.mutate("evaluations",r,n,s,o,`paper:${t}:evaluations`)}async mutate(t,n,r,o,i,s){const a=new Headers(i.headers);Object.entries(this.idempotencyHeaders(s,r,o)).forEach(([u,c])=>a.set(u,c));const l={...i,headers:a};try{const u=await this.request(n,l);return this.clearAttempt(l),u}catch(u){throw u instanceof Oa&&u.status===401&&u.code==="fresh_auth_required"?(this.saveFreshAuthMutation(t,n,r,l),this.recoverFreshAuth(t)):u instanceof Oa&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:n}}))),u}}freshAuthMutationDraft(){const t=sessionStorage.getItem(Ns);if(!t)return null;try{const n=JSON.parse(t);if(!n.endpoint.startsWith("/")||n.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(n.options.method))throw new Error("Invalid saved mutation draft");return n}catch{return sessionStorage.removeItem(Ns),null}}async resumeFreshAuthMutation(){const t=this.freshAuthMutationDraft();if(!t)throw new Error("No saved catalog edit is available.");const n=await this.request(t.endpoint,{method:t.options.method,body:t.options.body,headers:t.options.headers});return this.clearAttempt({headers:t.options.headers}),sessionStorage.removeItem(Ns),sessionStorage.removeItem("pwc:fresh-auth-edit"),n}saveFreshAuthMutation(t,n,r,o){const i=Object.fromEntries(new Headers(o.headers).entries()),s=typeof o.body=="string"?o.body:void 0;sessionStorage.setItem(Ns,JSON.stringify({section:t,endpoint:n,payload:r,options:{method:(o.method??"POST").toUpperCase(),body:s,headers:i}}))}idempotencyHeaders(t,n,r){const o=`pwc:mutation:${t}:${JSON.stringify(n)}`,i=sessionStorage.getItem(o);if(i){const a=JSON.parse(i);return{"Idempotency-Key":a.key,"If-Match":a.version}}const s=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:s,version:r})),sessionStorage.setItem(`pwc:mutation-key:${s}`,o),{"Idempotency-Key":s,"If-Match":r}}clearAttempt(t){const n=new Headers(t.headers).get("Idempotency-Key");if(!n)return;const r=sessionStorage.getItem(`pwc:mutation-key:${n}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${n}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const Dt=new m0(ml);function Jo(e){const t=new URLSearchParams;for(const[r,o]of Object.entries(e??{}))o!==void 0&&o!==""&&t.set(r,String(o));const n=t.toString();return n?`?${n}`:""}class mN{constructor(t){this.request=t}list(t){const n=new URLSearchParams;for(const[o,i]of Object.entries(t??{}))i!==void 0&&i!==""&&n.set(o,String(i));const r=n.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(t,n=1,r=10,o,i){const s=new URLSearchParams({q:t,page:n.toString(),page_size:r.toString()});return o&&s.set("mode",o),this.request(`/papers/search?${s.toString()}`,{signal:i})}get(t,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/${t}${r}`)}getByArxivId(t,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/arxiv/${t}${r}`)}related(t,n=4){return this.request(`/papers/${encodeURIComponent(t)}/related?limit=${n}`)}versions(t){return this.request(`/papers/arxiv/${t}/versions`)}indexFromArxiv(t){return this.request(`/papers/index/${t}`,{method:"POST"})}submit(t){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(t)})}copyToBucket(t,n){return this.request(`/papers/${encodeURIComponent(t)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(n)})}trending(t){const n=new URLSearchParams;for(const[o,i]of Object.entries(t??{}))i!==void 0&&n.set(o,String(i));const r=n.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}forTask(t,n){return this.request(`/tasks/${t}/papers${Jo(n)}`)}forMethod(t,n){return this.request(`/methods/${encodeURIComponent(t)}/papers${Jo(n)}`)}forConference(t,n){return this.request(`/conferences/${t}/papers${Jo(n)}`)}forOrganization(t,n){return this.request(`/organizations/${t}/papers${Jo(n)}`)}getAuthor(t){return this.request(`/authors/${t}`)}authorPapers(t,n){return this.request(`/authors/${t}/papers${Jo(n)}`)}primeCurationState(t,n=!1){return Dt.primePaper(t,n)}freshAuthMutationDraft(){return Dt.freshAuthMutationDraft()}resumeFreshAuthMutation(){return Dt.resumeFreshAuthMutation()}updateTasks(t,n){const r=new URLSearchParams(n.map(o=>["task_ids",String(o)])).toString();return Dt.mutatePaper(t,"tasks",n,`/papers/${t}/tasks?${r}`,{method:"PUT"})}updateMethods(t,n){const r=new URLSearchParams(n.map(o=>["method_ids",String(o)])).toString();return Dt.mutatePaper(t,"methods",n,`/papers/${t}/methods?${r}`,{method:"PUT"})}updateOrganizations(t,n){const r=new URLSearchParams(n.map(o=>["organization_ids",String(o)])).toString();return Dt.mutatePaper(t,"organizations",n,`/papers/${t}/organizations?${r}`,{method:"PUT"})}updateRepositories(t,n){return Dt.mutatePaper(t,"repositories",n,`/papers/${t}/repositories`,{method:"PUT",body:JSON.stringify({repositories:n})})}updateProjectPages(t,n){return Dt.mutatePaper(t,"project_pages",n,`/papers/${t}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:n})})}updateSourceUrl(t,n){return Dt.mutatePaper(t,"source_url",n,`/papers/${t}/source-url`,{method:"PUT",body:JSON.stringify({source_url:n})})}updateHfArtifacts(t,n){return Dt.mutatePaper(t,"hf_artifacts",n,`/papers/${t}/hf-artifacts`,{method:"PUT",body:JSON.stringify(n)})}}const fu=new mN(ml);class vN{constructor(){Lt(this,"curation");this.curation=new m0((t,n)=>this.request(t,n))}async request(t,n){return ml(t,n)}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()),(t==null?void 0:t.has_code)!==void 0&&n.append("has_code",t.has_code.toString()),(t==null?void 0:t.has_hf_artifacts)!==void 0&&n.append("has_hf_artifacts",t.has_hf_artifacts.toString()),t!=null&&t.framework&&n.append("framework",t.framework),t!=null&&t.repository&&n.append("repository",t.repository);const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(t,n=1,r=10,o,i){return fu.search(t,n,r,o,i)}async getPaper(t,n=!0){return fu.get(t,n)}async getPaperByArxivId(t,n=!0){return fu.getByArxivId(t,n)}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)})}primePaperCurationState(t,n=!1){return this.curation.primePaper(t,n)}primeEvaluationCurationState(t,n=!1){return this.curation.primeEvaluations(t,n)}freshAuthMutationDraft(){return this.curation.freshAuthMutationDraft()}resumeFreshAuthMutation(){return this.curation.resumeFreshAuthMutation()}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.curation.mutatePaper(t,"tasks",n,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.curation.mutatePaper(t,"methods",n,o,{method:"PUT"})}async updatePaperOrganizations(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("organization_ids",i.toString()));const o=`/papers/${t}/organizations?${r.toString()}`;return this.curation.mutatePaper(t,"organizations",n,o,{method:"PUT"})}async updatePaperRepositories(t,n){const r=`/papers/${t}/repositories`;return this.curation.mutatePaper(t,"repositories",n,r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(t,n){const r=`/papers/${t}/project-pages`;return this.curation.mutatePaper(t,"project_pages",n,r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(t,n){const r=`/papers/${t}/source-url`;return this.curation.mutatePaper(t,"source_url",n,r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(t,n){const r=`/papers/${t}/hf-artifacts`;return this.curation.mutatePaper(t,"hf_artifacts",n,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 getAuthorPapers(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=r.toString();return this.request(`/authors/${t}/papers${o?`?${o}`:""}`)}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"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/conferences/${t}/papers?${o}`:`/conferences/${t}/papers`;return this.request(i)}async getOrganizations(t=!1){return this.request(`/organizations/${t?"?featured_only=true":""}`)}async getOrganization(t){return this.request(`/organizations/${t}`)}async getOrganizationContributions(t){return this.request(`/organizations/${t}/contributions`)}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"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","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.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 getFrameworkCatalog(){return this.request("/frameworks/")}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());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()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.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?void 0:t.include_trends)!==void 0&&n.append("include_trends",t.include_trends.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 getMethodTrend(t,n){const r=new URLSearchParams;(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.history_months)!==void 0&&r.append("history_months",n.history_months.toString());const o=r.toString();return this.request(`/methods/${encodeURIComponent(t)}/trend${o?`?${o}`:""}`)}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()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.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 a=await this.getEvaluations({paper_id:r,page:s,page_size:100,ordering:"-benchmark_popularity"});i.push(...a.results),s=a.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 a=i.next_page;for(;a;){const l=await this.getEvaluations({dataset_id:o,best_metric:n,page:a,page_size:100,ordering:"best_rank"});s.push(...l.results),a=l.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 batchEvaluations(t,n){return this.curation.mutateEvaluations(t,n,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:t,operations:n})})}async generateThumbnail(t){const n=dr(`/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=dr(`/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=dr("/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 kp.getPreferences()}async updateMyPreferences(t){return kp.updatePreferences(t)}async getOpenRouterUsage(){return this.request("/chat/usage",{cache:"no-store"})}async getChatAvailability(){return this.request("/chat/availability",{cache:"no-store"})}async prewarmChatPaperContext(t){const n=await fetch(dr("/api/v1/chat/paper-context/prewarm"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({route_id:t}),credentials:"omit",cache:"no-store"});if(!n.ok)throw new Error(`Paper context prewarm failed (${n.status})`)}async getChatSandboxSpend(t){const n=t?`?environment=${encodeURIComponent(t)}`:"";return this.request(`/chat/admin/sandbox-spend${n}`,{cache:"no-store"})}async getChatWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}async getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}async connectOpenRouterCredential(t){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:t})})}async setOpenRouterFallback(t){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:t})})}async disconnectOpenRouterCredential(){await this.request("/chat/openrouter-key",{method:"DELETE"})}async getCronStatus(){return this.request("/cron/status",{cache:"no-store"})}async getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}async getMyContributions(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/contributions${n}`)}async getCatalogAudit(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/admin/catalog-audit${n}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(t){return this.request(`/admin/catalog-audit/${t}/rollback`,{method:"POST"})}}const b=new vN;b.getPapers.bind(b);b.getPaper.bind(b);b.getPaperByArxivId.bind(b);b.indexPaperFromArxiv.bind(b);b.submitPaper.bind(b);b.updatePaperTasks.bind(b);b.updatePaperMethods.bind(b);b.updatePaperOrganizations.bind(b);b.updatePaperRepositories.bind(b);b.updatePaperProjectPages.bind(b);b.updatePaperSourceUrl.bind(b);b.updatePaperHfArtifacts.bind(b);b.primePaperCurationState.bind(b);b.primeEvaluationCurationState.bind(b);b.getTrendingPapers.bind(b);b.getRepositoriesForPaper.bind(b);b.getRepositories.bind(b);b.getProjectPagesForPaper.bind(b);b.getProjectPages.bind(b);b.getAuthors.bind(b);b.getAuthor.bind(b);b.getAreas.bind(b);b.getArea.bind(b);b.getAreasWithTasks.bind(b);b.getConferences.bind(b);b.getConferenceDeadlines.bind(b);b.getConference.bind(b);b.getConferenceAreasWithTasks.bind(b);b.getConferencePapers.bind(b);b.getOrganizations.bind(b);b.getOrganization.bind(b);b.getOrganizationContributions.bind(b);b.getOrganizationAreasWithTasks.bind(b);b.getOrganizationPapers.bind(b);b.getAreaTasks.bind(b);b.getTasks.bind(b);b.getTask.bind(b);b.getTopTasks.bind(b);b.getTrendingTasks.bind(b);b.getTaskChildren.bind(b);b.getTaskParents.bind(b);b.getTaskPage.bind(b);b.getTaskPapers.bind(b);b.getMethods.bind(b);b.getMethod.bind(b);b.getMethodPapers.bind(b);b.getDatasets.bind(b);b.getDataset.bind(b);b.getDatasetBySlug.bind(b);b.getDatasetTasks.bind(b);b.getLeaderboardMetrics.bind(b);b.getEvaluations.bind(b);b.getEvaluation.bind(b);b.getEvaluationsByPaper.bind(b);b.getEvaluationsByDataset.bind(b);b.createEvaluation.bind(b);b.updateEvaluation.bind(b);b.deleteEvaluation.bind(b);b.batchEvaluations.bind(b);b.generateThumbnail.bind(b);b.getThumbnailStatus.bind(b);b.getMetrics.bind(b);b.getMetric.bind(b);b.getMetricDirections.bind(b);b.getResearchTrends.bind(b);b.healthCheck.bind(b);b.getMyBookmarkIds.bind(b);b.getMyBookmarks.bind(b);b.addBookmark.bind(b);b.getMyPreferences.bind(b);b.updateMyPreferences.bind(b);b.submitPendingPaperEdit.bind(b);b.listPendingPaperEdits.bind(b);b.getPendingPaperEdit.bind(b);b.approvePendingPaperEdit.bind(b);b.rejectPendingPaperEdit.bind(b);b.removeBookmark.bind(b);const hu={hide_closed_source_evals:!1},v0=T.createContext(null),yN=({children:e})=>{const{user:t}=tf(),[n,r]=T.useState(hu),[o,i]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!t){r(hu);return}return i(!0),b.getMyPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(hu)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[t]);const s=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!t)try{const c=await b.updateMyPreferences(u);r(c)}catch{r(n)}},[n,t]),a=T.useMemo(()=>({preferences:n,canPersist:!!t,isLoading:o,setHideClosedSourceEvals:s}),[n,t,o,s]);return g.jsx(v0.Provider,{value:a,children:e})};function EO(){const e=T.useContext(v0);if(!e)throw new Error("usePreferences must be used inside a ");return e}const y0=G1(),wN=y0?f1:d1;if(!y0&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const xN=T.lazy(()=>re(()=>import("./FeedView-CKJiV0Ra.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]))),SN=T.lazy(()=>re(()=>import("./ChatView-D9MyddkD.js"),__vite__mapDeps([18,10,19,8,9,3,4,20,21,22,23,24,25,12,26]))),EN=T.lazy(()=>re(()=>import("./SharedChatView-DQ4fp3ZH.js"),__vite__mapDeps([27,10,19,8,9,3,4,20,21,22,23,24,25]))),CN=T.lazy(()=>re(()=>import("./PapersListView-CW9s6NIq.js"),__vite__mapDeps([28,1,2,3,4,5,6,11,13,10,14,29,15,7,16,17]))),_N=T.lazy(()=>re(()=>import("./PaperDetailView-CL5W15M-.js"),__vite__mapDeps([30,10,1,2,3,4,5,6,31,20,32,33,13,14,16,17,34,35,36,37,38,11,39,40,41,42,43,21,22,44,24]))),bN=T.lazy(()=>re(()=>import("./TagsIndexView-BwiGVYXT.js"),__vite__mapDeps([45,10,11,5,16,17,46,40,34,36,37,38,39,41]))),PN=T.lazy(()=>re(()=>import("./TagBrowseView-mW7aLEG6.js"),__vite__mapDeps([47,10,1,2,3,4,5,6,48,7,49,23,24,20,11,13,14,16,17,9,22]))),kN=T.lazy(()=>re(()=>import("./MethodsIndexView-B4Zfj2D1.js"),__vite__mapDeps([50,10,11,51,16,17,46,40,34,36,37,38,39,41]))),TN=T.lazy(()=>re(()=>import("./FrameworksIndexView-Ci4wSude.js"),__vite__mapDeps([52,10,1,2,3,4,5,6,11]))),RN=T.lazy(()=>re(()=>import("./TrendsView-Cn5lx78X.js"),__vite__mapDeps([53,10,17,16]))),NN=T.lazy(()=>re(()=>import("./ConferencesIndexView-CqQhkVsQ.js"),__vite__mapDeps([54,10,11,16,17,46,40,34,36,37,38,39,41]))),ON=T.lazy(()=>re(()=>import("./AiDeadlinesView-D-zWicTZ.js"),__vite__mapDeps([55,10,11,56,35,16,17,6,37]))),AN=T.lazy(()=>re(()=>import("./ConferenceDetailView-BdyVHxJR.js"),__vite__mapDeps([57,10,49,3,4,23,24,20,11,5,16,17,6]))),MN=T.lazy(()=>re(()=>import("./ConferenceTaskView-DDnwDUzk.js"),__vite__mapDeps([58,10,1,2,3,4,5,6,7,49,23,24,20,11,13,14,16,17]))),jN=T.lazy(()=>re(()=>import("./OrganizationsIndexView-DMKv-CHw.js"),__vite__mapDeps([59,10,17,16,11,60]))),LN=T.lazy(()=>re(()=>import("./OrganizationDetailView-D2uv0yr-.js"),__vite__mapDeps([61,62,10,1,2,3,4,5,6,49,23,24,20,63,16,11,7,17,42,34,37,41,13,14,64]))),IN=T.lazy(()=>re(()=>import("./OrganizationTaskView-BYJZ35ys.js"),__vite__mapDeps([65,62,10,1,2,3,4,5,6,49,23,24,20,63,16,11,7,17,42,34,37,41,13,14,64]))),DN=T.lazy(()=>re(()=>import("./AuthorDetailView-h0Ew8Kww.js"),__vite__mapDeps([66,10,16,64]))),$N=T.lazy(()=>re(()=>import("./MethodDetailView-YYTWjJSv.js"),__vite__mapDeps([67,10,14,1,2,3,4,5,6,7,49,23,24,20,11,51,16,17]))),FN=T.lazy(()=>re(()=>import("./BenchmarkDetailView-hM6r7YYu.js"),__vite__mapDeps([68,10,11,31,20,6,32,16,56,35,17,2,3,4,48,1,5,69]))),zN=T.lazy(()=>re(()=>import("./SavedPapersView-CPEK6--m.js"),__vite__mapDeps([70,10,1,2,3,4,5,6,16,17,44]))),UN=T.lazy(()=>re(()=>import("./SettingsView-BL0kpAqP.js"),__vite__mapDeps([71,38,56,35,33,26,10,72]))),BN=T.lazy(()=>re(()=>import("./PrivacyView-C5xTTwU4.js"),__vite__mapDeps([73,33]))),VN=T.lazy(()=>re(()=>import("./SubmitView-Q9xo_vl0.js"),__vite__mapDeps([74,38,17,34,36]))),WN=T.lazy(()=>re(()=>import("./CronDashboard-Re43pdV1.js"),__vite__mapDeps([75,10,43,34,9,25,76,41,77,72,38,14,11,78]))),HN=T.lazy(()=>re(()=>import("./SubmissionsDashboard-DSsa3EV4.js"),__vite__mapDeps([79,10,38,11,6,39,76,41,77]))),qN=T.lazy(()=>re(()=>import("./UserProfileView-Bq_ZES4n.js"),__vite__mapDeps([80,10,63,16,11]))),KN=T.lazy(()=>re(()=>import("./RateLimitsView-2DL6Cls3.js"),__vite__mapDeps([81,10]))),Tp=T.lazy(()=>re(()=>import("./NotFound-5-TztvbD.js"),[])),GN=T.lazy(()=>re(()=>import("./SearchOverlay-C-KnmybT.js"),__vite__mapDeps([82,10,2,3,4,11,29,5]))),QN=T.lazy(()=>re(()=>import("./StagingAccessRequestView-L0hui4Bi.js"),__vite__mapDeps([83,77]))),Rp=()=>g.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),g.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),YN=new H1({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),XN=()=>{const{arxivId:e}=uv();return g.jsx(To,{to:e?`/paper/${e}`:"/papers",replace:!0})},JN=()=>{const{taskSlug:e}=uv();return g.jsx(To,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},Np=({element:e})=>Gi()?g.jsx(To,{to:"/",replace:!0}):g.jsx(g.Fragment,{children:e}),ZN=({element:e})=>{const{user:t,isLoading:n}=tf();return Gi()?g.jsx(To,{to:"/",replace:!0}):n?g.jsx("div",{className:"page",children:g.jsx("div",{className:"submission-loading",children:g.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?g.jsx(g.Fragment,{children:e}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Admin access required"}),g.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Sign in required"}),g.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),g.jsx(Pv,{returnTo:"/admin-dashboard"})]})})},eO=()=>{const e=K1(),t=typeof window<"u"&&new URL(e,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{t&&window.location.replace(e)},[e,t]),t?g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-loading",children:[g.jsx("span",{children:"Opening the production admin dashboard..."}),g.jsx("a",{href:e,children:"Continue"})]})}):g.jsx(ZN,{element:g.jsx(WN,{})})},tO=()=>{const[e,t]=T.useState(!1),n=Mt();return lN(),T.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),T.useEffect(()=>{const r=o=>{(o.metaKey||o.ctrlKey)&&o.key==="k"&&(o.preventDefault(),t(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?g.jsx(T.Suspense,{fallback:g.jsx(Rp,{}),children:g.jsx(QN,{})}):g.jsxs(g.Fragment,{children:[g.jsx(MT,{onOpenSearch:()=>t(!0)}),g.jsx("main",{children:g.jsx(T.Suspense,{fallback:g.jsx(Rp,{}),children:g.jsxs(n1,{children:[g.jsx(te,{path:"/",element:g.jsx(xN,{})}),g.jsx(te,{path:"/chat/:sessionId?",element:Ca()?g.jsx(SN,{}):g.jsx(To,{to:"/",replace:!0})}),g.jsx(te,{path:"/share/:shareId",element:Ca()?g.jsx(EN,{}):g.jsx(Tp,{})}),g.jsx(te,{path:"/papers",element:g.jsx(CN,{})}),g.jsx(te,{path:"/papers/:arxivId",element:g.jsx(XN,{})}),g.jsx(te,{path:"/paper/:arxivId",element:g.jsx(_N,{})}),g.jsx(te,{path:"/tasks",element:g.jsx(bN,{})}),g.jsx(te,{path:"/tasks/:taskSlug",element:g.jsx(PN,{})}),g.jsx(te,{path:"/task/:taskSlug",element:g.jsx(JN,{})}),g.jsx(te,{path:"/methods",element:g.jsx(kN,{})}),g.jsx(te,{path:"/methods/:methodSlug",element:g.jsx($N,{})}),g.jsx(te,{path:"/frameworks",element:g.jsx(TN,{})}),g.jsx(te,{path:"/trends",element:g.jsx(RN,{})}),g.jsx(te,{path:"/conferences",element:g.jsx(NN,{})}),g.jsx(te,{path:"/ai-deadlines",element:g.jsx(ON,{})}),g.jsx(te,{path:"/conferences/:confSlug",element:g.jsx(AN,{})}),g.jsx(te,{path:"/conferences/:confSlug/:taskSlug",element:g.jsx(MN,{})}),g.jsx(te,{path:"/organizations",element:g.jsx(jN,{})}),g.jsx(te,{path:"/orgs/:orgSlug",element:g.jsx(LN,{})}),g.jsx(te,{path:"/orgs/:orgSlug/:taskSlug",element:g.jsx(IN,{})}),g.jsx(te,{path:"/authors/:authorId",element:g.jsx(DN,{})}),g.jsx(te,{path:"/benchmark/:datasetSlug",element:g.jsx(FN,{})}),g.jsx(te,{path:"/submit",element:g.jsx(VN,{})}),g.jsx(te,{path:"/saved",element:g.jsx(Np,{element:g.jsx(zN,{})})}),g.jsx(te,{path:"/settings",element:g.jsx(UN,{})}),g.jsx(te,{path:"/privacy",element:g.jsx(BN,{})}),g.jsx(te,{path:"/admin-dashboard",element:g.jsx(eO,{})}),g.jsx(te,{path:"/cron-dashboard",element:g.jsx(To,{to:"/admin-dashboard",replace:!0})}),g.jsx(te,{path:"/submissions",element:g.jsx(Np,{element:g.jsx(HN,{})})}),g.jsx(te,{path:"/rate-limits",element:g.jsx(KN,{})}),g.jsx(te,{path:"/:username",element:g.jsx(qN,{})}),g.jsx(te,{path:"*",element:g.jsx(Tp,{})})]})})}),g.jsx(jT,{}),e&&g.jsx(T.Suspense,{fallback:null,children:g.jsx(GN,{open:e,onClose:()=>t(!1)})})]})},nO=()=>g.jsx(q1,{client:YN,children:g.jsx(RT,{children:g.jsx(yN,{children:g.jsxs(sN,{children:[g.jsx(wN,{children:g.jsx(tO,{})}),g.jsx(fR,{}),g.jsx(zR,{}),!1]})})})});fE();const rO=ev(document.getElementById("root"));rO.render(g.jsx(T.StrictMode,{children:g.jsx(iE,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:g.jsx(cE,{children:g.jsx(nO,{})})})}));export{sl as $,Oa as A,yT as B,mT as C,el as D,mO as E,EO as F,xT as G,ST as H,dP as I,Lw as J,$t as K,en as L,hO as M,vO as N,vc as O,Or as P,vt as Q,T as R,$d as S,dR as T,Tv as U,lR as V,Pv as W,wT as X,Rr as Y,Qb as Z,Cy as _,sO as a,Kd as a0,SP as a1,zy as a2,P_ as a3,ey as a4,tl as a5,_y as a6,by as a7,yO as a8,lO as a9,b1 as aA,cc as aB,mv as aC,z1 as aD,R1 as aE,iO as aa,zp as ab,ml as ac,Dt as ad,oE as ae,dO as af,cO as ag,gO as ah,Za as ai,Ue as aj,aO as ak,vv as al,_t as am,Kv as an,Gv as ao,Qv as ap,ji as aq,B1 as ar,uO as as,To as at,Mt as au,M1 as av,P1 as aw,dc as ax,wv as ay,_1 as az,pO as b,b as c,dl as d,dr as e,uv as f,tf as g,zT as h,Ca as i,g as j,fO as k,Y1 as l,ve as m,Id as n,Re as o,fu as p,V as q,f as r,Bb as s,Nr as t,Rd as u,Ne as v,Gi as w,Yv as x,cP as y,ky as z}; diff --git a/assets/index-D9_nPZtO.js b/assets/index-D9_nPZtO.js deleted file mode 100644 index 58f8e1448e7ebf2b3fb4a93aeb311626b957a237..0000000000000000000000000000000000000000 --- a/assets/index-D9_nPZtO.js +++ /dev/null @@ -1,157 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedView-oz8sxM3L.js","assets/components-DrTew0nD.js","assets/LatexTitle-BtRWGRIx.js","assets/katex.min-BSBacQyE.js","assets/katex-wklAmtGL.css","assets/transform-BObV5jzB.js","assets/safeExternalHref-CkBrsh84.js","assets/useIntersectionObserver-CZXk9yc2.js","assets/chatSessions-CQv5Fwer.js","assets/chevron-down-D6vo9F6c.js","assets/useQuery-cycUreG-.js","assets/chatPrompts-CDY3UGU1.js","assets/usePapers-B3J6SKWU.js","assets/useInfiniteQuery-CQNVzwuX.js","assets/usePeriodFilter-BkksG2SW.js","assets/skeleton-CQ2CM4l9.js","assets/alert-B0bcMmNw.js","assets/ChatView-DscYSLiQ.js","assets/ChatMessage-CIUk_Zbp.js","assets/hover-card-DVeX2fQl.js","assets/github-DYxu-4Fs.js","assets/github-DngRIean.js","assets/PaperPreviewLink-D3OkhqBL.js","assets/index-XzA0bTLC.js","assets/file-text-CM_ChV1A.js","assets/openrouter-D8ilQuCd.js","assets/SharedChatView-DKbKiY7e.js","assets/PapersListView-DOq44gD8.js","assets/useDebounce-BidSk3ad.js","assets/PaperDetailView-DEVQpo7C.js","assets/ExternalSourceEvalBadge-Cu4mN0M9.js","assets/ExternalSourceEvalBadge-DXfuqNnO.css","assets/latexPlainText-DI8YEXVe.js","assets/button-B859643f.js","assets/index-BGBxtSYH.js","assets/textarea-BVF3ykiv.js","assets/dialog-DnjY6ZOM.js","assets/useMutation-CJCfaNMQ.js","assets/SignInToEditDialog-NNf7Zp6R.js","assets/loader-circle-CrVj12oC.js","assets/searchable-select-Css_GGu3.js","assets/codexAddEvals-Xch_LMp1.js","assets/savedPapersAuth-DSXf00GL.js","assets/TagsIndexView-CiMTi7r2.js","assets/TaxonomySuggestionTile-BO-dHwso.js","assets/TagBrowseView-M8ve0LOV.js","assets/BenchmarkTrendSparkline-CN-RBbNH.js","assets/MarkdownText-skQuzg4e.js","assets/MethodsIndexView-CMQ_zbFE.js","assets/slug-BpH-Nkvz.js","assets/FrameworksIndexView-C476TwCA.js","assets/TrendsView-BlGLrFvK.js","assets/ConferencesIndexView-VmZKLP09.js","assets/AiDeadlinesView-CRbaeNb8.js","assets/switch-BM2BYYbv.js","assets/ConferenceDetailView-B9R293-r.js","assets/ConferenceTaskView-tg9N-zJJ.js","assets/OrganizationsIndexView-DH89Eu3h.js","assets/OrganizationsIndexView-dniuSNch.css","assets/OrganizationDetailView-COwL-Neo.js","assets/OrganizationPaperFeed-B-ZiEuUF.js","assets/OrganizationContributionGraph-CjsAmlOx.js","assets/NotFound-DLV3c5vS.js","assets/OrganizationTaskView-JO8z_y24.js","assets/AuthorDetailView-DWrMqjuC.js","assets/MethodDetailView-D8nv95w4.js","assets/BenchmarkDetailView-BWArUzbc.js","assets/BenchmarkDetailView-DS2Mrskn.css","assets/SavedPapersView-t8CX70vO.js","assets/SettingsView-BDObDhiz.js","assets/external-link-DlvfPaEN.js","assets/PrivacyView-DAhZCWuE.js","assets/SubmitView-Dmd8F124.js","assets/CronDashboard-DFeDiILJ.js","assets/shield-alert-CDv23c0X.js","assets/circle-check-I1TZu4fL.js","assets/CronDashboard-DwChfW9h.css","assets/SubmissionsDashboard-CnW0soci.js","assets/UserProfileView-CR04MORR.js","assets/RateLimitsView-BLLHWPbs.js","assets/SearchOverlay-DEmyxI4z.js","assets/StagingAccessRequestView-DQ08h6Ei.js"])))=>i.map(i=>d[i]); -var b0=Object.defineProperty;var df=e=>{throw TypeError(e)};var P0=(e,t,n)=>t in e?b0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Lt=(e,t,n)=>P0(e,typeof t!="symbol"?t+"":t,n),wl=(e,t,n)=>t.has(e)||df("Cannot "+n);var N=(e,t,n)=>(wl(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>t.has(e)?df("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(wl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Oe=(e,t,n)=>(wl(e,t,"access private method"),n);var ts=(e,t,n,r)=>({set _(o){W(e,t,o,n)},get _(){return N(e,t,r)}});function k0(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 rO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fp={exports:{}},Na={},zp={exports:{}},Z={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var zi=Symbol.for("react.element"),T0=Symbol.for("react.portal"),R0=Symbol.for("react.fragment"),N0=Symbol.for("react.strict_mode"),O0=Symbol.for("react.profiler"),A0=Symbol.for("react.provider"),M0=Symbol.for("react.context"),j0=Symbol.for("react.forward_ref"),L0=Symbol.for("react.suspense"),I0=Symbol.for("react.memo"),D0=Symbol.for("react.lazy"),ff=Symbol.iterator;function $0(e){return e===null||typeof e!="object"?null:(e=ff&&e[ff]||e["@@iterator"],typeof e=="function"?e:null)}var Up={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Bp=Object.assign,Vp={};function Oo(e,t,n){this.props=e,this.context=t,this.refs=Vp,this.updater=n||Up}Oo.prototype.isReactComponent={};Oo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Oo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Wp(){}Wp.prototype=Oo.prototype;function Rc(e,t,n){this.props=e,this.context=t,this.refs=Vp,this.updater=n||Up}var Nc=Rc.prototype=new Wp;Nc.constructor=Rc;Bp(Nc,Oo.prototype);Nc.isPureReactComponent=!0;var hf=Array.isArray,Hp=Object.prototype.hasOwnProperty,Oc={current:null},qp={key:!0,ref:!0,__self:!0,__source:!0};function Kp(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Hp.call(t,r)&&!qp.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,F=O[B];if(0>>1;Bo(fe,L))yeo(J,fe)?(O[B]=J,O[ye]=L,B=ye):(O[B]=fe,O[X]=L,B=X);else if(yeo(J,L))O[B]=J,O[ye]=L,B=ye;else break e}}return k}function o(O,k){var L=O.sortIndex-k.sortIndex;return L!==0?L:O.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,p=3,h=!1,E=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(O){for(var k=n(u);k!==null;){if(k.callback===null)r(u);else if(k.startTime<=O)r(u),k.sortIndex=k.expirationTime,t(l,k);else break;k=n(u)}}function S(O){if(y=!1,w(O),!E)if(n(l)!==null)E=!0,U(C);else{var k=n(u);k!==null&&H(S,k.startTime-O)}}function C(O,k){E=!1,y&&(y=!1,v(R),R=-1),h=!0;var L=p;try{for(w(k),d=n(l);d!==null&&(!(d.expirationTime>k)||O&&!z());){var B=d.callback;if(typeof B=="function"){d.callback=null,p=d.priorityLevel;var F=B(d.expirationTime<=k);k=e.unstable_now(),typeof F=="function"?d.callback=F:d===n(l)&&r(l),w(k)}else r(l);d=n(l)}if(d!==null)var G=!0;else{var X=n(u);X!==null&&H(S,X.startTime-k),G=!1}return G}finally{d=null,p=L,h=!1}}var _=!1,P=null,R=-1,j=5,M=-1;function z(){return!(e.unstable_now()-MO||125B?(O.sortIndex=L,t(u,O),n(l)===null&&O===n(u)&&(y?(v(R),R=-1):y=!0,H(S,L-B))):(O.sortIndex=F,t(l,O),E||h||(E=!0,U(C))),O},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(O){var k=p;return function(){var L=p;p=k;try{return O.apply(this,arguments)}finally{p=L}}}})(Jp);Xp.exports=Jp;var Q0=Xp.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Y0=f,it=Q0;function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fu=Object.prototype.hasOwnProperty,X0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,gf={},mf={};function J0(e){return fu.call(mf,e)?!0:fu.call(gf,e)?!1:X0.test(e)?mf[e]=!0:(gf[e]=!0,!1)}function Z0(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ex(e,t,n,r){if(t===null||typeof t>"u"||Z0(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function We(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new We(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new We(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new We(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new We(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){je[e]=new We(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new We(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new We(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new We(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new We(e,5,!1,e.toLowerCase(),null,!1,!1)});var Mc=/[\-:]([a-z])/g;function jc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Mc,jc);je[t]=new We(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Mc,jc);je[t]=new We(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Mc,jc);je[t]=new We(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new We(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new We("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new We(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lc(e,t,n,r){var o=je.hasOwnProperty(t)?je[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` -`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{El=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xo(e):""}function tx(e){switch(e.tag){case 5:return Xo(e.type);case 16:return Xo("Lazy");case 13:return Xo("Suspense");case 19:return Xo("SuspenseList");case 0:case 2:case 15:return e=Cl(e.type,!1),e;case 11:return e=Cl(e.type.render,!1),e;case 1:return e=Cl(e.type,!0),e;default:return""}}function mu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Vr:return"Fragment";case Br:return"Portal";case hu:return"Profiler";case Ic:return"StrictMode";case pu:return"Suspense";case gu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case tg:return(e.displayName||"Context")+".Consumer";case eg:return(e._context.displayName||"Context")+".Provider";case Dc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $c:return t=e.displayName||null,t!==null?t:mu(e.type)||"Memo";case Pn:t=e._payload,e=e._init;try{return mu(e(t))}catch{}}return null}function nx(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mu(t);case 8:return t===Ic?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Gn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rx(e){var t=rg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function os(e){e._valueTracker||(e._valueTracker=rx(e))}function og(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=rg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function qs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function vu(e,t){var n=t.checked;return me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function yf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Gn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ig(e,t){t=t.checked,t!=null&&Lc(e,"checked",t,!1)}function yu(e,t){ig(e,t);var n=Gn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?wu(e,t.type,n):t.hasOwnProperty("defaultValue")&&wu(e,t.type,Gn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function wf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function wu(e,t,n){(t!=="number"||qs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Jo=Array.isArray;function eo(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=is.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function hi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ni={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ox=["Webkit","ms","Moz","O"];Object.keys(ni).forEach(function(e){ox.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ni[t]=ni[e]})});function ug(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ni.hasOwnProperty(e)&&ni[e]?(""+t).trim():t+"px"}function cg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=ug(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var ix=me({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Eu(e,t){if(t){if(ix[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(A(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(A(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(A(61))}if(t.style!=null&&typeof t.style!="object")throw Error(A(62))}}function Cu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _u=null;function Fc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bu=null,to=null,no=null;function Ef(e){if(e=Vi(e)){if(typeof bu!="function")throw Error(A(280));var t=e.stateNode;t&&(t=Ia(t),bu(e.stateNode,e.type,t))}}function dg(e){to?no?no.push(e):no=[e]:to=e}function fg(){if(to){var e=to,t=no;if(no=to=null,Ef(e),t)for(e=0;e>>=0,e===0?32:31-(mx(e)/vx|0)|0}var ss=64,as=4194304;function Zo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ys(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Zo(a):(i&=s,i!==0&&(r=Zo(i)))}else s=n&~o,s!==0?r=Zo(s):i!==0&&(r=Zo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ui(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=n}function Sx(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=oi),Of=" ",Af=!1;function Ag(e,t){switch(e){case"keyup":return Qx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function Xx(e,t){switch(e){case"compositionend":return Mg(t);case"keypress":return t.which!==32?null:(Af=!0,Of);case"textInput":return e=t.data,e===Of&&Af?null:e;default:return null}}function Jx(e,t){if(Wr)return e==="compositionend"||!Kc&&Ag(e,t)?(e=Ng(),As=Wc=In=null,Wr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=If(n)}}function Dg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $g(){for(var e=window,t=qs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=qs(e.document)}return t}function Gc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function aS(e){var t=$g(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Dg(n.ownerDocument.documentElement,n)){if(r!==null&&Gc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Df(n,i);var s=Df(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Hr=null,Ou=null,si=null,Au=!1;function $f(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Au||Hr==null||Hr!==qs(r)||(r=Hr,"selectionStart"in r&&Gc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),si&&wi(si,r)||(si=r,r=Zs(Ou,"onSelect"),0Gr||(e.current=$u[Gr],$u[Gr]=null,Gr--)}function se(e,t){Gr++,$u[Gr]=e.current,e.current=t}var Qn={},Fe=Zn(Qn),Qe=Zn(!1),wr=Qn;function xo(e,t){var n=e.type.contextTypes;if(!n)return Qn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ye(e){return e=e.childContextTypes,e!=null}function ta(){ue(Qe),ue(Fe)}function Hf(e,t,n){if(Fe.current!==Qn)throw Error(A(168));se(Fe,t),se(Qe,n)}function Kg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(A(108,nx(e)||"Unknown",o));return me({},n,r)}function na(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qn,wr=Fe.current,se(Fe,e),se(Qe,Qe.current),!0}function qf(e,t,n){var r=e.stateNode;if(!r)throw Error(A(169));n?(e=Kg(e,t,wr),r.__reactInternalMemoizedMergedChildContext=e,ue(Qe),ue(Fe),se(Fe,e)):ue(Qe),se(Qe,n)}var en=null,Da=!1,Dl=!1;function Gg(e){en===null?en=[e]:en.push(e)}function wS(e){Da=!0,Gg(e)}function er(){if(!Dl&&en!==null){Dl=!0;var e=0,t=oe;try{var n=en;for(oe=1;e>=s,o-=s,nn=1<<32-Tt(t)+o|n<R?(j=P,P=null):j=P.sibling;var M=p(v,P,w[R],S);if(M===null){P===null&&(P=j);break}e&&P&&M.alternate===null&&t(v,P),m=i(M,m,R),_===null?C=M:_.sibling=M,_=M,P=j}if(R===w.length)return n(v,P),de&&ir(v,R),C;if(P===null){for(;RR?(j=P,P=null):j=P.sibling;var z=p(v,P,M.value,S);if(z===null){P===null&&(P=j);break}e&&P&&z.alternate===null&&t(v,P),m=i(z,m,R),_===null?C=z:_.sibling=z,_=z,P=j}if(M.done)return n(v,P),de&&ir(v,R),C;if(P===null){for(;!M.done;R++,M=w.next())M=d(v,M.value,S),M!==null&&(m=i(M,m,R),_===null?C=M:_.sibling=M,_=M);return de&&ir(v,R),C}for(P=r(v,P);!M.done;R++,M=w.next())M=h(P,v,R,M.value,S),M!==null&&(e&&M.alternate!==null&&P.delete(M.key===null?R:M.key),m=i(M,m,R),_===null?C=M:_.sibling=M,_=M);return e&&P.forEach(function(D){return t(v,D)}),de&&ir(v,R),C}function x(v,m,w,S){if(typeof w=="object"&&w!==null&&w.type===Vr&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case rs:e:{for(var C=w.key,_=m;_!==null;){if(_.key===C){if(C=w.type,C===Vr){if(_.tag===7){n(v,_.sibling),m=o(_,w.props.children),m.return=v,v=m;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Pn&&Qf(C)===_.type){n(v,_.sibling),m=o(_,w.props),m.ref=Ho(v,_,w),m.return=v,v=m;break e}n(v,_);break}else t(v,_);_=_.sibling}w.type===Vr?(m=yr(w.props.children,v.mode,S,w.key),m.return=v,v=m):(S=zs(w.type,w.key,w.props,null,v.mode,S),S.ref=Ho(v,m,w),S.return=v,v=S)}return s(v);case Br:e:{for(_=w.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===w.containerInfo&&m.stateNode.implementation===w.implementation){n(v,m.sibling),m=o(m,w.children||[]),m.return=v,v=m;break e}else{n(v,m);break}else t(v,m);m=m.sibling}m=Hl(w,v.mode,S),m.return=v,v=m}return s(v);case Pn:return _=w._init,x(v,m,_(w._payload),S)}if(Jo(w))return E(v,m,w,S);if(zo(w))return y(v,m,w,S);ps(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,m!==null&&m.tag===6?(n(v,m.sibling),m=o(m,w),m.return=v,v=m):(n(v,m),m=Wl(w,v.mode,S),m.return=v,v=m),s(v)):n(v,m)}return x}var Eo=Jg(!0),Zg=Jg(!1),ia=Zn(null),sa=null,Xr=null,Jc=null;function Zc(){Jc=Xr=sa=null}function ed(e){var t=ia.current;ue(ia),e._currentValue=t}function Uu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function oo(e,t){sa=e,Jc=Xr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(Jc!==e)if(e={context:e,memoizedValue:t,next:null},Xr===null){if(sa===null)throw Error(A(308));Xr=e,sa.dependencies={lanes:0,firstContext:e}}else Xr=Xr.next=e;return t}var lr=null;function td(e){lr===null?lr=[e]:lr.push(e)}function em(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,td(t)):(n.next=o.next,o.next=n),t.interleaved=n,ln(e,r)}function ln(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var kn=!1;function nd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function on(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ln(e,n)}return o=r.interleaved,o===null?(t.next=t,td(r)):(t.next=o.next,o.next=t),r.interleaved=t,ln(e,n)}function js(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uc(e,n)}}function Yf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function aa(e,t,n,r){var o=e.updateQueue;kn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,c=u=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var E=e,y=a;switch(p=t,h=n,y.tag){case 1:if(E=y.payload,typeof E=="function"){d=E.call(h,d,p);break e}d=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=y.payload,p=typeof E=="function"?E.call(h,d,p):E,p==null)break e;d=me({},d,p);break e;case 2:kn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,s|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Er|=s,e.lanes=s,e.memoizedState=d}}function Xf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Fl.transition;Fl.transition={};try{e(!1),t()}finally{oe=n,Fl.transition=r}}function ym(){return mt().memoizedState}function CS(e,t,n){var r=Hn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wm(e))xm(t,n);else if(n=em(e,t,n,r),n!==null){var o=Be();Rt(n,e,r,o),Sm(n,t,r)}}function _S(e,t,n){var r=Hn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wm(e))xm(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Nt(a,s)){var l=t.interleaved;l===null?(o.next=o,td(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=em(e,t,o,r),n!==null&&(o=Be(),Rt(n,e,r,o),Sm(n,t,r))}}function wm(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function xm(e,t){ai=ua=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uc(e,n)}}var ca={readContext:gt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},bS={readContext:gt,useCallback:function(e,t){return $t().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Zf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Is(4194308,4,hm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Is(4194308,4,e,t)},useInsertionEffect:function(e,t){return Is(4,2,e,t)},useMemo:function(e,t){var n=$t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$t();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=CS.bind(null,pe,e),[r.memoizedState,e]},useRef:function(e){var t=$t();return e={current:e},t.memoizedState=e},useState:Jf,useDebugValue:cd,useDeferredValue:function(e){return $t().memoizedState=e},useTransition:function(){var e=Jf(!1),t=e[0];return e=ES.bind(null,e[1]),$t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pe,o=$t();if(de){if(n===void 0)throw Error(A(407));n=n()}else{if(n=t(),Te===null)throw Error(A(349));Sr&30||im(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Zf(am.bind(null,r,i,e),[e]),r.flags|=2048,ki(9,sm.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=$t(),t=Te.identifierPrefix;if(de){var n=rn,r=nn;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=bi++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Bt]=t,e[Ei]=r,Om(e,t,!1,!1),t.stateNode=e;e:{switch(s=Cu(n,r),n){case"dialog":le("cancel",e),le("close",e),o=r;break;case"iframe":case"object":case"embed":le("load",e),o=r;break;case"video":case"audio":for(o=0;obo&&(t.flags|=128,r=!0,qo(i,!1),t.lanes=4194304)}else{if(!r)if(e=la(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),qo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!de)return Ie(t),null}else 2*Se()-i.renderingStartTime>bo&&n!==1073741824&&(t.flags|=128,r=!0,qo(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Se(),t.sibling=null,n=he.current,se(he,r?n&1|2:n&1),t):(Ie(t),null);case 22:case 23:return md(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ze&1073741824&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),null;case 24:return null;case 25:return null}throw Error(A(156,t.tag))}function MS(e,t){switch(Yc(t),t.tag){case 1:return Ye(t.type)&&ta(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Co(),ue(Qe),ue(Fe),id(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return od(t),null;case 13:if(ue(he),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));So()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(he),null;case 4:return Co(),null;case 10:return ed(t.type._context),null;case 22:case 23:return md(),null;case 24:return null;default:return null}}var ms=!1,$e=!1,jS=typeof WeakSet=="function"?WeakSet:Set,$=null;function Jr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function Yu(e,t,n){try{n()}catch(r){xe(e,t,r)}}var ch=!1;function LS(e,t){if(Mu=Xs,e=$g(),Gc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=e,p=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++u===o&&(a=s),p===i&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(ju={focusedElem:e,selectionRange:n},Xs=!1,$=t;$!==null;)if(t=$,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$=e;else for(;$!==null;){t=$;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var y=E.memoizedProps,x=E.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ct(t.type,y),x);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(A(163))}}catch(S){xe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,$=e;break}$=t.return}return E=ch,ch=!1,E}function li(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Yu(t,n,i)}o=o.next}while(o!==r)}}function za(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Xu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function jm(e){var t=e.alternate;t!==null&&(e.alternate=null,jm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Bt],delete t[Ei],delete t[Du],delete t[vS],delete t[yS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Lm(e){return e.tag===5||e.tag===3||e.tag===4}function dh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ju(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ea));else if(r!==4&&(e=e.child,e!==null))for(Ju(e,t,n),e=e.sibling;e!==null;)Ju(e,t,n),e=e.sibling}function Zu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Zu(e,t,n),e=e.sibling;e!==null;)Zu(e,t,n),e=e.sibling}var Ae=null,Pt=!1;function Sn(e,t,n){for(n=n.child;n!==null;)Im(e,t,n),n=n.sibling}function Im(e,t,n){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(Aa,n)}catch{}switch(n.tag){case 5:$e||Jr(n,t);case 6:var r=Ae,o=Pt;Ae=null,Sn(e,t,n),Ae=r,Pt=o,Ae!==null&&(Pt?(e=Ae,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ae.removeChild(n.stateNode));break;case 18:Ae!==null&&(Pt?(e=Ae,n=n.stateNode,e.nodeType===8?Il(e.parentNode,n):e.nodeType===1&&Il(e,n),vi(e)):Il(Ae,n.stateNode));break;case 4:r=Ae,o=Pt,Ae=n.stateNode.containerInfo,Pt=!0,Sn(e,t,n),Ae=r,Pt=o;break;case 0:case 11:case 14:case 15:if(!$e&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Yu(n,t,s),o=o.next}while(o!==r)}Sn(e,t,n);break;case 1:if(!$e&&(Jr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){xe(n,t,a)}Sn(e,t,n);break;case 21:Sn(e,t,n);break;case 22:n.mode&1?($e=(r=$e)||n.memoizedState!==null,Sn(e,t,n),$e=r):Sn(e,t,n);break;default:Sn(e,t,n)}}function fh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new jS),t.forEach(function(r){var o=WS.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function St(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Se()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*DS(r/1960))-r,10e?16:e,Dn===null)var r=!1;else{if(e=Dn,Dn=null,ha=0,ne&6)throw Error(A(331));var o=ne;for(ne|=4,$=e.current;$!==null;){var i=$,s=i.child;if($.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lSe()-pd?vr(e,0):hd|=n),Xe(e,t)}function Wm(e,t){t===0&&(e.mode&1?(t=as,as<<=1,!(as&130023424)&&(as=4194304)):t=1);var n=Be();e=ln(e,t),e!==null&&(Ui(e,t,n),Xe(e,n))}function VS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wm(e,n)}function WS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(A(314))}r!==null&&r.delete(t),Wm(e,n)}var Hm;Hm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qe.current)Ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ge=!1,OS(e,t,n);Ge=!!(e.flags&131072)}else Ge=!1,de&&t.flags&1048576&&Qg(t,oa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ds(e,t),e=t.pendingProps;var o=xo(t,Fe.current);oo(t,n),o=ad(null,t,r,e,o,n);var i=ld();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ye(r)?(i=!0,na(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,nd(t),o.updater=Fa,t.stateNode=o,o._reactInternals=t,Vu(t,r,e,n),t=qu(null,t,r,!0,i,n)):(t.tag=0,de&&i&&Qc(t),ze(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ds(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=qS(r),e=Ct(r,e),o){case 0:t=Hu(null,t,r,e,n);break e;case 1:t=ah(null,t,r,e,n);break e;case 11:t=ih(null,t,r,e,n);break e;case 14:t=sh(null,t,r,Ct(r.type,e),n);break e}throw Error(A(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ct(r,o),Hu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ct(r,o),ah(e,t,r,o,n);case 3:e:{if(Tm(t),e===null)throw Error(A(387));r=t.pendingProps,i=t.memoizedState,o=i.element,tm(e,t),aa(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=_o(Error(A(423)),t),t=lh(e,t,r,n,o);break e}else if(r!==o){o=_o(Error(A(424)),t),t=lh(e,t,r,n,o);break e}else for(nt=Bn(t.stateNode.containerInfo.firstChild),rt=t,de=!0,kt=null,n=Zg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(So(),r===o){t=un(e,t,n);break e}ze(e,t,r,n)}t=t.child}return t;case 5:return nm(t),e===null&&zu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Lu(r,o)?s=null:i!==null&&Lu(r,i)&&(t.flags|=32),km(e,t),ze(e,t,s,n),t.child;case 6:return e===null&&zu(t),null;case 13:return Rm(e,t,n);case 4:return rd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Eo(t,null,r,n):ze(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ct(r,o),ih(e,t,r,o,n);case 7:return ze(e,t,t.pendingProps,n),t.child;case 8:return ze(e,t,t.pendingProps.children,n),t.child;case 12:return ze(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,se(ia,r._currentValue),r._currentValue=s,i!==null)if(Nt(i.value,s)){if(i.children===o.children&&!Qe.current){t=un(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=on(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Uu(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(A(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Uu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}ze(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,oo(t,n),o=gt(o),r=r(o),t.flags|=1,ze(e,t,r,n),t.child;case 14:return r=t.type,o=Ct(r,t.pendingProps),o=Ct(r.type,o),sh(e,t,r,o,n);case 15:return bm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ct(r,o),Ds(e,t),t.tag=1,Ye(r)?(e=!0,na(t)):e=!1,oo(t,n),Em(t,r,o),Vu(t,r,o,n),qu(null,t,r,!0,e,n);case 19:return Nm(e,t,n);case 22:return Pm(e,t,n)}throw Error(A(156,t.tag))};function qm(e,t){return wg(e,t)}function HS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ft(e,t,n,r){return new HS(e,t,n,r)}function yd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qS(e){if(typeof e=="function")return yd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Dc)return 11;if(e===$c)return 14}return 2}function qn(e,t){var n=e.alternate;return n===null?(n=ft(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function zs(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")yd(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Vr:return yr(n.children,o,i,t);case Ic:s=8,o|=8;break;case hu:return e=ft(12,n,t,o|2),e.elementType=hu,e.lanes=i,e;case pu:return e=ft(13,n,t,o),e.elementType=pu,e.lanes=i,e;case gu:return e=ft(19,n,t,o),e.elementType=gu,e.lanes=i,e;case ng:return Ba(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case eg:s=10;break e;case tg:s=9;break e;case Dc:s=11;break e;case $c:s=14;break e;case Pn:s=16,r=null;break e}throw Error(A(130,e==null?e:typeof e,""))}return t=ft(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function yr(e,t,n,r){return e=ft(7,e,r,t),e.lanes=n,e}function Ba(e,t,n,r){return e=ft(22,e,r,t),e.elementType=ng,e.lanes=n,e.stateNode={isHidden:!1},e}function Wl(e,t,n){return e=ft(6,e,null,t),e.lanes=n,e}function Hl(e,t,n){return t=ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function KS(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bl(0),this.expirationTimes=bl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function wd(e,t,n,r,o,i,s,a,l){return e=new KS(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ft(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},nd(i),e}function GS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ym)}catch(e){console.error(e)}}Ym(),Yp.exports=st;var Hi=Yp.exports;const Xm=$p(Hi);var Jm,xh=Hi;Jm=xh.createRoot,xh.hydrateRoot;var ma=["light","dark"],Cd="(prefers-color-scheme: dark)",ZS=typeof window>"u",_d=f.createContext(void 0),eE={setTheme:e=>{},themes:[]},tE=()=>{var e;return(e=f.useContext(_d))!=null?e:eE},nE=e=>f.useContext(_d)?e.children:f.createElement(oE,{...e}),rE=["light","dark"],oE=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:i=rE,defaultTheme:s=n?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:c})=>{let[d,p]=f.useState(()=>Sh(o,s)),[h,E]=f.useState(()=>Sh(o)),y=l?Object.values(l):i,x=f.useCallback(S=>{let C=S;if(!C)return;S==="system"&&n&&(C=Eh());let _=l?l[C]:C,P=t?sE():null,R=document.documentElement;if(a==="class"?(R.classList.remove(...y),_&&R.classList.add(_)):_?R.setAttribute(a,_):R.removeAttribute(a),r){let j=ma.includes(s)?s:null,M=ma.includes(C)?C:j;R.style.colorScheme=M}P==null||P()},[]),v=f.useCallback(S=>{let C=typeof S=="function"?S(S):S;p(C);try{localStorage.setItem(o,C)}catch{}},[e]),m=f.useCallback(S=>{let C=Eh(S);E(C),d==="system"&&n&&!e&&x("system")},[d,e]);f.useEffect(()=>{let S=window.matchMedia(Cd);return S.addListener(m),m(S),()=>S.removeListener(m)},[m]),f.useEffect(()=>{let S=C=>{if(C.key!==o)return;let _=C.newValue||s;v(_)};return window.addEventListener("storage",S),()=>window.removeEventListener("storage",S)},[v]),f.useEffect(()=>{x(e??d)},[e,d]);let w=f.useMemo(()=>({theme:d,setTheme:v,forcedTheme:e,resolvedTheme:d==="system"?h:d,themes:n?[...i,"system"]:i,systemTheme:n?h:void 0}),[d,v,e,h,n,i]);return f.createElement(_d.Provider,{value:w},f.createElement(iE,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:o,themes:i,defaultTheme:s,attribute:a,value:l,children:u,attrs:y,nonce:c}),u)},iE=f.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:s,attrs:a,nonce:l})=>{let u=i==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(E=>`'${E}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=o?ma.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(E,y=!1,x=!0)=>{let v=s?s[E]:E,m=y?E+"|| ''":`'${v}'`,w="";return o&&x&&!y&&ma.includes(E)&&(w+=`d.style.colorScheme = '${E}';`),n==="class"?y||v?w+=`c.add(${m})`:w+="null":v&&(w+=`d[s](n,${m})`),w},h=e?`!function(){${c}${p(e)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${Cd}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${p(s?"x[e]":"e",!0)}}${u?"":"else{"+p(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${p(s?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${d}}catch(t){}}();`;return f.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})}),Sh=(e,t)=>{if(ZS)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},sE=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},Eh=e=>(e||(e=window.matchMedia(Cd)),e.matches?"dark":"light");class aE extends T.Component{constructor(){super(...arguments);Lt(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n){console.error("The application could not render",n)}render(){return this.state.failed?g.jsx("main",{children:g.jsxs("div",{className:"page",role:"alert",children:[g.jsx("h1",{children:"This page could not load"}),g.jsx("p",{children:"The site may have been updated while this tab was open."}),g.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>window.location.reload(),children:"Reload page"})]})}):this.props.children}}const ql="pwc:chunk-reload-at",Zm=6e4;function lE(e,t){if(!e)return!0;const n=Number(e);return!Number.isFinite(n)||t-n>=Zm}function uE(){if(typeof window>"u")return()=>{};const e=n=>{const r=Date.now();lE(sessionStorage.getItem(ql),r)&&(n.preventDefault(),sessionStorage.setItem(ql,String(r)),window.location.reload())};window.addEventListener("vite:preloadError",e);const t=window.setTimeout(()=>sessionStorage.removeItem(ql),Zm);return()=>{window.removeEventListener("vite:preloadError",e),window.clearTimeout(t)}}const cE="modulepreload",dE=function(e){return"/"+e},Ch={},re=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=dE(l),l in Ch)return;Ch[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":cE,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((p,h)=>{d.addEventListener("load",p),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};/** - * @remix-run/router v1.23.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Ri(){return Ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function pE(){return Math.random().toString(36).substr(2,8)}function bh(e,t){return{usr:e.state,key:e.key,idx:t}}function va(e,t,n,r){return n===void 0&&(n=null),Ri({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?kr(t):t,{state:n,key:t&&t.key||r||pE()})}function Ni(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function kr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ev(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=$n.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(Ri({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){a=$n.Pop;let x=c(),v=x==null?null:x-u;u=x,l&&l({action:a,location:y.location,delta:v})}function p(x,v){a=$n.Push;let m=va(y.location,x,v);n&&n(m,x),u=c()+1;let w=bh(m,u),S=y.createHref(m);try{s.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(S)}i&&l&&l({action:a,location:y.location,delta:1})}function h(x,v){a=$n.Replace;let m=va(y.location,x,v);n&&n(m,x),u=c();let w=bh(m,u),S=y.createHref(m);s.replaceState(w,"",S),i&&l&&l({action:a,location:y.location,delta:0})}function E(x){let v=o.location.origin!=="null"?o.location.origin:o.location.href,m=typeof x=="string"?x:Ni(x);return m=m.replace(/ $/,"%20"),ge(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let y={get action(){return a},get location(){return e(o,s)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(_h,d),l=x,()=>{o.removeEventListener(_h,d),l=null}},createHref(x){return t(o,x)},createURL:E,encodeLocation(x){let v=E(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(x){return s.go(x)}};return y}var Ph;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ph||(Ph={}));function gE(e,t,n){return n===void 0&&(n="/"),mE(e,t,n)}function mE(e,t,n,r){let o=typeof t=="string"?kr(t):t,i=Po(o.pathname||"/",n);if(i==null)return null;let s=tv(e);vE(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(ge(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Kn([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(ge(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),tv(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:_E(u,i.index),routesMeta:c})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of nv(i.path))o(i,s,l)}),t}function nv(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=nv(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function vE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:bE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const yE=/^:[\w-]+$/,wE=3,xE=2,SE=1,EE=10,CE=-2,kh=e=>e==="*";function _E(e,t){let n=e.split("/"),r=n.length;return n.some(kh)&&(r+=CE),t&&(r+=xE),n.filter(o=>!kh(o)).reduce((o,i)=>o+(yE.test(i)?wE:i===""?SE:EE),r)}function bE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function PE(e,t,n){let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a{let{paramName:p,isOptional:h}=c;if(p==="*"){let y=a[d]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const E=a[d];return h&&!E?u[p]=void 0:u[p]=(E||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function kE(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ka(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function TE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ka(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Po(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const RE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,NE=e=>RE.test(e);function OE(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?kr(e):e,i;if(n)if(NE(n))i=n;else{if(n.includes("//")){let s=n;n=n.replace(/\/\/+/g,"/"),Ka(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?i=Th(n.substring(1),"/"):i=Th(n,t)}else i=t;return{pathname:i,search:jE(r),hash:LE(o)}}function Th(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Kl(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function AE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function bd(e,t){let n=AE(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Pd(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=kr(e):(o=Ri({},e),ge(!o.pathname||!o.pathname.includes("?"),Kl("?","pathname","search",o)),ge(!o.pathname||!o.pathname.includes("#"),Kl("#","pathname","hash",o)),ge(!o.search||!o.search.includes("#"),Kl("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),d-=1;o.pathname=p.join("/")}a=d>=0?t[d]:"/"}let l=OE(o,a),u=s&&s!=="/"&&s.endsWith("/"),c=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Kn=e=>e.join("/").replace(/\/\/+/g,"/"),ME=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),jE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,LE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function IE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const rv=["post","put","patch","delete"];new Set(rv);const DE=["get",...rv];new Set(DE);/** - * React Router v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Oi(){return Oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),f.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=Pd(u,JSON.parse(s),i,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Kn([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,s,i,e])}function av(){let{matches:e}=f.useContext(pn),t=e[e.length-1];return t?t.params:{}}function Ya(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=f.useContext(hn),{matches:o}=f.useContext(pn),{pathname:i}=Mt(),s=JSON.stringify(bd(o,r.v7_relativeSplatPath));return f.useMemo(()=>Pd(e,JSON.parse(s),i,n==="path"),[e,s,i,n])}function zE(e,t){return UE(e,t)}function UE(e,t,n,r){jo()||ge(!1);let{navigator:o}=f.useContext(hn),{matches:i}=f.useContext(pn),s=i[i.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=Mt(),c;if(t){var d;let x=typeof t=="string"?kr(t):t;l==="/"||(d=x.pathname)!=null&&d.startsWith(l)||ge(!1),c=x}else c=u;let p=c.pathname||"/",h=p;if(l!=="/"){let x=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let E=gE(e,{pathname:h}),y=qE(E&&E.map(x=>Object.assign({},x,{params:Object.assign({},a,x.params),pathname:Kn([l,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:Kn([l,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&y?f.createElement(Qa.Provider,{value:{location:Oi({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:$n.Pop}},y):y}function BE(){let e=YE(),t=IE(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:o},n):null,null)}const VE=f.createElement(BE,null);class WE extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(pn.Provider,{value:this.props.routeContext},f.createElement(iv.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function HE(e){let{routeContext:t,match:n,children:r}=e,o=f.useContext(Ga);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(pn.Provider,{value:t},r)}function qE(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let c=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||ge(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,p)=>{let h,E=!1,y=null,x=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||VE,l&&(u<0&&p===0?(JE("route-fallback"),E=!0,x=null):u===p&&(E=!0,x=d.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,p+1)),m=()=>{let w;return h?w=y:E?w=x:d.route.Component?w=f.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,f.createElement(HE,{match:d,routeContext:{outlet:c,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?f.createElement(WE,{location:n.location,revalidation:n.revalidation,component:y,error:h,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()},null)}var lv=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(lv||{}),uv=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(uv||{});function KE(e){let t=f.useContext(Ga);return t||ge(!1),t}function GE(e){let t=f.useContext(ov);return t||ge(!1),t}function QE(e){let t=f.useContext(pn);return t||ge(!1),t}function cv(e){let t=QE(),n=t.matches[t.matches.length-1];return n.route.id||ge(!1),n.route.id}function YE(){var e;let t=f.useContext(iv),n=GE(),r=cv();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function XE(){let{router:e}=KE(lv.UseNavigateStable),t=cv(uv.UseNavigateStable),n=f.useRef(!1);return sv(()=>{n.current=!0}),f.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Oi({fromRouteId:t},i)))},[e,t])}const Rh={};function JE(e,t,n){Rh[e]||(Rh[e]=!0)}function dv(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function ko(e){let{to:t,replace:n,state:r,relative:o}=e;jo()||ge(!1);let{future:i,static:s}=f.useContext(hn),{matches:a}=f.useContext(pn),{pathname:l}=Mt(),u=kd(),c=Pd(t,bd(a,i.v7_relativeSplatPath),l,o==="path"),d=JSON.stringify(c);return f.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:o}),[u,d,o,n,r]),null}function te(e){ge(!1)}function fv(e){let{basename:t="/",children:n=null,location:r,navigationType:o=$n.Pop,navigator:i,static:s=!1,future:a}=e;jo()&&ge(!1);let l=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:l,navigator:i,static:s,future:Oi({v7_relativeSplatPath:!1},a)}),[l,a,i,s]);typeof r=="string"&&(r=kr(r));let{pathname:c="/",search:d="",hash:p="",state:h=null,key:E="default"}=r,y=f.useMemo(()=>{let x=Po(c,l);return x==null?null:{location:{pathname:x,search:d,hash:p,state:h,key:E},navigationType:o}},[l,c,d,p,h,E,o]);return y==null?null:f.createElement(hn.Provider,{value:u},f.createElement(Qa.Provider,{children:n,value:y}))}function ZE(e){let{children:t,location:n}=e;return zE(ic(t),n)}new Promise(()=>{});function ic(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,o)=>{if(!f.isValidElement(r))return;let i=[...t,o];if(r.type===f.Fragment){n.push.apply(n,ic(r.props.children,i));return}r.type!==te&&ge(!1),!r.props.index||!r.props.children||ge(!1);let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=ic(r.props.children,i)),n.push(s)}),n}/** - * React Router DOM v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function ya(){return ya=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function e1(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function t1(e,t){return e.button===0&&(!t||t==="_self")&&!e1(e)}function sc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function n1(e,t){let n=sc(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const r1=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],o1=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],i1="6";try{window.__reactRouterVersion=i1}catch{}const s1=f.createContext({isTransitioning:!1}),a1="startTransition",wa=Oa[a1];function l1(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=fE({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&wa?wa(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>dv(r),[r]),f.createElement(fv,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}function u1(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=hE({window:o,v5Compat:!0}));let s=i.current,[a,l]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=f.useCallback(d=>{u&&wa?wa(()=>l(d)):l(d)},[l,u]);return f.useLayoutEffect(()=>s.listen(c),[s,c]),f.useEffect(()=>dv(r),[r]),f.createElement(fv,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const c1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zt=f.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=t,p=hv(t,r1),{basename:h}=f.useContext(hn),E,y=!1;if(typeof u=="string"&&d1.test(u)&&(E=u,c1))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=Po(S.pathname,h);S.origin===w.origin&&C!=null?u=C+S.search+S.hash:y=!0}catch{}let x=$E(u,{relative:o}),v=h1(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:o,viewTransition:d});function m(w){r&&r(w),w.defaultPrevented||v(w)}return f.createElement("a",ya({},p,{href:E||x,onClick:y||i?r:m,ref:n,target:l}))}),rr=f.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:s=!1,style:a,to:l,viewTransition:u,children:c}=t,d=hv(t,o1),p=Ya(l,{relative:d.relative}),h=Mt(),E=f.useContext(ov),{navigator:y,basename:x}=f.useContext(hn),v=E!=null&&p1(p)&&u===!0,m=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,w=h.pathname,S=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;o||(w=w.toLowerCase(),S=S?S.toLowerCase():null,m=m.toLowerCase()),S&&x&&(S=Po(S,x)||S);const C=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let _=w===m||!s&&w.startsWith(m)&&w.charAt(C)==="/",P=S!=null&&(S===m||!s&&S.startsWith(m)&&S.charAt(m.length)==="/"),R={isActive:_,isPending:P,isTransitioning:v},j=_?r:void 0,M;typeof i=="function"?M=i(R):M=[i,_?"active":null,P?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let z=typeof a=="function"?a(R):a;return f.createElement(Zt,ya({},d,{"aria-current":j,className:M,ref:n,style:z,to:l,viewTransition:u}),typeof c=="function"?c(R):c)});var ac;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ac||(ac={}));var Nh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Nh||(Nh={}));function f1(e){let t=f.useContext(Ga);return t||ge(!1),t}function h1(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:a}=t===void 0?{}:t,l=kd(),u=Mt(),c=Ya(e,{relative:s});return f.useCallback(d=>{if(t1(d,n)){d.preventDefault();let p=r!==void 0?r:Ni(u)===Ni(c);l(e,{replace:p,state:o,preventScrollReset:i,relative:s,viewTransition:a})}},[u,l,c,r,o,n,e,i,s,a])}function oO(e){let t=f.useRef(sc(e)),n=f.useRef(!1),r=Mt(),o=f.useMemo(()=>n1(r.search,n.current?null:t.current),[r.search]),i=kd(),s=f.useCallback((a,l)=>{const u=sc(typeof a=="function"?a(o):a);n.current=!0,i("?"+u,l)},[i,o]);return[o,s]}function p1(e,t){t===void 0&&(t={});let n=f.useContext(s1);n==null&&ge(!1);let{basename:r}=f1(ac.useViewTransitionState),o=Ya(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Po(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=Po(n.nextLocation.pathname,r)||n.nextLocation.pathname;return oc(o.pathname,s)!=null||oc(o.pathname,i)!=null}var Xa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},dr,Nn,uo,Rp,g1=(Rp=class extends Xa{constructor(){super();ee(this,dr);ee(this,Nn);ee(this,uo);W(this,uo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,Nn)||this.setEventListener(N(this,uo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Nn))==null||t.call(this),W(this,Nn,void 0))}setEventListener(t){var n;W(this,uo,t),(n=N(this,Nn))==null||n.call(this),W(this,Nn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,dr)!==t&&(W(this,dr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,dr)=="boolean"?N(this,dr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},dr=new WeakMap,Nn=new WeakMap,uo=new WeakMap,Rp),pv=new g1,m1={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},On,Tc,Np,v1=(Np=class{constructor(){ee(this,On,m1);ee(this,Tc,!1)}setTimeoutProvider(e){W(this,On,e)}setTimeout(e,t){return N(this,On).setTimeout(e,t)}clearTimeout(e){N(this,On).clearTimeout(e)}setInterval(e,t){return N(this,On).setInterval(e,t)}clearInterval(e){N(this,On).clearInterval(e)}},On=new WeakMap,Tc=new WeakMap,Np),lc=new v1;function y1(e){setTimeout(e,0)}var w1=typeof window>"u"||"Deno"in globalThis;function _t(){}function x1(e,t){return typeof e=="function"?e(t):e}function S1(e){return typeof e=="number"&&e>=0&&e!==1/0}function E1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function uc(e,t){return typeof e=="function"?e(t):e}function C1(e,t){return typeof e=="function"?e(t):e}function Oh(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Td(s,t.options))return!1}else if(!Mi(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function Ah(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Ai(t.options.mutationKey)!==Ai(i))return!1}else if(!Mi(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Td(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ai)(e)}function Ai(e){return JSON.stringify(e,(t,n)=>cc(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Mi(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Mi(e[n],t[n])):!1}var _1=Object.prototype.hasOwnProperty;function gv(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Mh(e)&&Mh(t);if(!r&&!(cc(e)&&cc(t)))return t;const i=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),a=s.length,l=r?new Array(a):{};let u=0;for(let c=0;c{lc.setTimeout(t,e)})}function P1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gv(e,t):t}function sO(e){return e}function k1(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function T1(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Rd=Symbol();function mv(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Rd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function aO(e,t){return typeof e=="function"?e(...t):!!e}function R1(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var vv=(()=>{let e=()=>w1;return{isServer(){return e()},setIsServer(t){e=t}}})();function N1(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var O1=y1;function A1(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=O1;const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ue=A1(),co,An,fo,Op,M1=(Op=class extends Xa{constructor(){super();ee(this,co,!0);ee(this,An);ee(this,fo);W(this,fo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){N(this,An)||this.setEventListener(N(this,fo))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,An))==null||t.call(this),W(this,An,void 0))}setEventListener(t){var n;W(this,fo,t),(n=N(this,An))==null||n.call(this),W(this,An,t(this.setOnline.bind(this)))}setOnline(t){N(this,co)!==t&&(W(this,co,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,co)}},co=new WeakMap,An=new WeakMap,fo=new WeakMap,Op),xa=new M1;function j1(e){return Math.min(1e3*2**e,3e4)}function yv(e){return(e??"online")==="online"?xa.isOnline():!0}var dc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wv(e){let t=!1,n=0,r;const o=N1(),i=()=>o.status!=="pending",s=y=>{var x;if(!i()){const v=new dc(y);p(v),(x=e.onCancel)==null||x.call(e,v)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>pv.isFocused()&&(e.networkMode==="always"||xa.isOnline())&&e.canRun(),c=()=>yv(e.networkMode)&&e.canRun(),d=y=>{i()||(r==null||r(),o.resolve(y))},p=y=>{i()||(r==null||r(),o.reject(y))},h=()=>new Promise(y=>{var x;r=v=>{(i()||u())&&y(v)},(x=e.onPause)==null||x.call(e)}).then(()=>{var y;r=void 0,i()||(y=e.onContinue)==null||y.call(e)}),E=()=>{if(i())return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(d).catch(v=>{var _;if(i())return;const m=e.retry??(vv.isServer()?0:3),w=e.retryDelay??j1,S=typeof w=="function"?w(n,v):w,C=m===!0||typeof m=="number"&&nu()?void 0:h()).then(()=>{t?p(v):E()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?E():h().then(E),o)}}var fr,Ap,xv=(Ap=class{constructor(){ee(this,fr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),S1(this.gcTime)&&W(this,fr,lc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vv.isServer()?1/0:5*60*1e3))}clearGcTimeout(){N(this,fr)!==void 0&&(lc.clearTimeout(N(this,fr)),W(this,fr,void 0))}},fr=new WeakMap,Ap);function L1(e){return{onFetch:(t,n)=>{var c,d,p,h,E;const r=t.options,o=(p=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((E=t.state.data)==null?void 0:E.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const x=w=>{R1(w,()=>t.signal,()=>y=!0)},v=mv(t.options,t.fetchOptions),m=async(w,S,C)=>{if(y)return Promise.reject(t.signal.reason);if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return x(z),z})(),R=await v(P),{maxPages:j}=t.options,M=C?T1:k1;return{pages:M(w.pages,R,j),pageParams:M(w.pageParams,S,j)}};if(o&&i.length){const w=o==="backward",S=w?Sv:fc,C={pages:i,pageParams:s},_=S(r,C);a=await m(C,_,w)}else{const w=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:fc(r,a);if(l>0&&S==null)break;a=await m(a,S),l++}while(l{var y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function fc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Sv(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function lO(e,t){return t?fc(e,t)!=null:!1}function uO(e,t){return!t||!e.getPreviousPageParam?!1:Sv(e,t)!=null}var ho,hr,po,ut,pr,Pe,Di,gr,et,Ev,Xt,Mp,I1=(Mp=class extends xv{constructor(t){super();ee(this,et);ee(this,ho);ee(this,hr);ee(this,po);ee(this,ut);ee(this,pr);ee(this,Pe);ee(this,Di);ee(this,gr);W(this,gr,!1),W(this,Di,t.defaultOptions),this.setOptions(t.options),this.observers=[],W(this,pr,t.client),W(this,ut,N(this,pr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,W(this,hr,Ih(this.options)),this.state=t.state??N(this,hr),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return N(this,ho)}get promise(){var t;return(t=N(this,Pe))==null?void 0:t.promise}setOptions(t){if(this.options={...N(this,Di),...t},t!=null&&t._type&&W(this,ho,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Ih(this.options);n.data!==void 0&&(this.setState(Lh(n.data,n.dataUpdatedAt)),W(this,hr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,ut).remove(this)}setData(t,n){const r=P1(this.state.data,t,this.options);return Oe(this,et,Xt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Oe(this,et,Xt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=N(this,Pe))==null?void 0:r.promise;return(o=N(this,Pe))==null||o.cancel(t),n?n.then(_t).catch(_t):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return N(this,hr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>C1(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rd||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>uc(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!E1(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Pe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Pe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Pe)&&(N(this,gr)||Oe(this,et,Ev).call(this)?N(this,Pe).cancel({revert:!0}):N(this,Pe).cancelRetry()),this.scheduleGc()),N(this,ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,et,Xt).call(this,{type:"invalidate"})}async fetch(t,n){var u,c,d,p,h,E,y,x,v,m,w;if(this.state.fetchStatus!=="idle"&&((u=N(this,Pe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,Pe))return N(this,Pe).continueRetry(),N(this,Pe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(C=>C.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(W(this,gr,!0),r.signal)})},i=()=>{const S=mv(this.options,n),_=(()=>{const P={client:N(this,pr),queryKey:this.queryKey,meta:this.meta};return o(P),P})();return W(this,gr,!1),this.options.persister?this.options.persister(S,_,this):S(_)},a=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:N(this,pr),state:this.state,fetchFn:i};return o(S),S})(),l=N(this,ho)==="infinite"?L1(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),W(this,po,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Oe(this,et,Xt).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),W(this,Pe,wv({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof dc&&S.revert&&this.setState({...N(this,po),fetchStatus:"idle"}),r.abort()},onFail:(S,C)=>{Oe(this,et,Xt).call(this,{type:"failed",failureCount:S,error:C})},onPause:()=>{Oe(this,et,Xt).call(this,{type:"pause"})},onContinue:()=>{Oe(this,et,Xt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await N(this,Pe).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(h=(p=N(this,ut).config).onSuccess)==null||h.call(p,S,this),(y=(E=N(this,ut).config).onSettled)==null||y.call(E,S,this.state.error,this),S}catch(S){if(S instanceof dc){if(S.silent)return N(this,Pe).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Oe(this,et,Xt).call(this,{type:"error",error:S}),(v=(x=N(this,ut).config).onError)==null||v.call(x,S,this),(w=(m=N(this,ut).config).onSettled)==null||w.call(m,this.state.data,S,this),S}finally{this.scheduleGc()}}},ho=new WeakMap,hr=new WeakMap,po=new WeakMap,ut=new WeakMap,pr=new WeakMap,Pe=new WeakMap,Di=new WeakMap,gr=new WeakMap,et=new WeakSet,Ev=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Xt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...D1(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...Lh(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return W(this,po,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ue.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,ut).notify({query:this,type:"updated",action:t})})},Mp);function D1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yv(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Lh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ih(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var $i,Ft,De,mr,zt,_n,jp,$1=(jp=class extends xv{constructor(t){super();ee(this,zt);ee(this,$i);ee(this,Ft);ee(this,De);ee(this,mr);W(this,$i,t.client),this.mutationId=t.mutationId,W(this,De,t.mutationCache),W(this,Ft,[]),this.state=t.state||F1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,Ft).includes(t)||(N(this,Ft).push(t),this.clearGcTimeout(),N(this,De).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){W(this,Ft,N(this,Ft).filter(n=>n!==t)),this.scheduleGc(),N(this,De).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,Ft).length||(this.state.status==="pending"?this.scheduleGc():N(this,De).remove(this))}continue(){var t;return((t=N(this,mr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,l,u,c,d,p,h,E,y,x,v,m,w,S,C,_,P;const n=()=>{Oe(this,zt,_n).call(this,{type:"continue"})},r={client:N(this,$i),meta:this.options.meta,mutationKey:this.options.mutationKey};W(this,mr,wv({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,j)=>{Oe(this,zt,_n).call(this,{type:"failed",failureCount:R,error:j})},onPause:()=>{Oe(this,zt,_n).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,De).canRun(this)}));const o=this.state.status==="pending",i=!N(this,mr).canStart();try{if(o)n();else{Oe(this,zt,_n).call(this,{type:"pending",variables:t,isPaused:i}),N(this,De).config.onMutate&&await N(this,De).config.onMutate(t,this,r);const j=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t,r));j!==this.state.context&&Oe(this,zt,_n).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const R=await N(this,mr).start();return await((u=(l=N(this,De).config).onSuccess)==null?void 0:u.call(l,R,t,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,R,t,this.state.context,r)),await((h=(p=N(this,De).config).onSettled)==null?void 0:h.call(p,R,null,this.state.variables,this.state.context,this,r)),await((y=(E=this.options).onSettled)==null?void 0:y.call(E,R,null,t,this.state.context,r)),Oe(this,zt,_n).call(this,{type:"success",data:R}),R}catch(R){try{await((v=(x=N(this,De).config).onError)==null?void 0:v.call(x,R,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((w=(m=this.options).onError)==null?void 0:w.call(m,R,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((C=(S=N(this,De).config).onSettled)==null?void 0:C.call(S,void 0,R,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((P=(_=this.options).onSettled)==null?void 0:P.call(_,void 0,R,t,this.state.context,r))}catch(j){Promise.reject(j)}throw Oe(this,zt,_n).call(this,{type:"error",error:R}),R}finally{N(this,De).runNext(this)}}},$i=new WeakMap,Ft=new WeakMap,De=new WeakMap,mr=new WeakMap,zt=new WeakSet,_n=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ue.batch(()=>{N(this,Ft).forEach(r=>{r.onMutationUpdate(t)}),N(this,De).notify({mutation:this,type:"updated",action:t})})},jp);function F1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tn,bt,Fi,Lp,z1=(Lp=class extends Xa{constructor(t={}){super();ee(this,tn);ee(this,bt);ee(this,Fi);this.config=t,W(this,tn,new Set),W(this,bt,new Map),W(this,Fi,0)}build(t,n,r){const o=new $1({client:t,mutationCache:this,mutationId:++ts(this,Fi)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){N(this,tn).add(t);const n=ws(t);if(typeof n=="string"){const r=N(this,bt).get(n);r?r.push(t):N(this,bt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(N(this,tn).delete(t)){const n=ws(t);if(typeof n=="string"){const r=N(this,bt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&N(this,bt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=ws(t);if(typeof n=="string"){const r=N(this,bt).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=ws(t);if(typeof n=="string"){const o=(r=N(this,bt).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ue.batch(()=>{N(this,tn).forEach(t=>{this.notify({type:"removed",mutation:t})}),N(this,tn).clear(),N(this,bt).clear()})}getAll(){return Array.from(N(this,tn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ah(n,r))}findAll(t={}){return this.getAll().filter(n=>Ah(t,n))}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ue.batch(()=>Promise.all(t.map(n=>n.continue().catch(_t))))}},tn=new WeakMap,bt=new WeakMap,Fi=new WeakMap,Lp);function ws(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ut,Ip,U1=(Ip=class extends Xa{constructor(t={}){super();ee(this,Ut);this.config=t,W(this,Ut,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Td(o,n);let s=this.get(i);return s||(s=new I1({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){N(this,Ut).has(t.queryHash)||(N(this,Ut).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,Ut).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,Ut).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ue.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,Ut).get(t)}getAll(){return[...N(this,Ut).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Oh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Oh(t,r)):n}notify(t){Ue.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ue.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ut=new WeakMap,Ip),we,Mn,jn,go,mo,Ln,vo,yo,Dp,B1=(Dp=class{constructor(e={}){ee(this,we);ee(this,Mn);ee(this,jn);ee(this,go);ee(this,mo);ee(this,Ln);ee(this,vo);ee(this,yo);W(this,we,e.queryCache||new U1),W(this,Mn,e.mutationCache||new z1),W(this,jn,e.defaultOptions||{}),W(this,go,new Map),W(this,mo,new Map),W(this,Ln,0)}mount(){ts(this,Ln)._++,N(this,Ln)===1&&(W(this,vo,pv.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onFocus())})),W(this,yo,xa.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,we).onOnline())})))}unmount(){var e,t;ts(this,Ln)._--,N(this,Ln)===0&&((e=N(this,vo))==null||e.call(this),W(this,vo,void 0),(t=N(this,yo))==null||t.call(this),W(this,yo,void 0))}isFetching(e){return N(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Mn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=N(this,we).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(uc(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return N(this,we).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=N(this,we).get(r.queryHash),i=o==null?void 0:o.state.data,s=x1(t,i);if(s!==void 0)return N(this,we).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Ue.batch(()=>N(this,we).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,we).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,we);Ue.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,we);return Ue.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ue.batch(()=>N(this,we).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(_t).catch(_t)}invalidateQueries(e,t={}){return Ue.batch(()=>(N(this,we).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ue.batch(()=>N(this,we).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(_t)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(_t)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,we).build(this,t);return n.isStaleByTime(uc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_t).catch(_t)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_t).catch(_t)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return xa.isOnline()?N(this,Mn).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,we)}getMutationCache(){return N(this,Mn)}getDefaultOptions(){return N(this,jn)}setDefaultOptions(e){W(this,jn,e)}setQueryDefaults(e,t){N(this,go).set(Ai(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,go).values()],n={};return t.forEach(r=>{Mi(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){N(this,mo).set(Ai(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,mo).values()],n={};return t.forEach(r=>{Mi(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,jn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Td(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Rd&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,jn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,we).clear(),N(this,Mn).clear()}},we=new WeakMap,Mn=new WeakMap,jn=new WeakMap,go=new WeakMap,mo=new WeakMap,Ln=new WeakMap,vo=new WeakMap,yo=new WeakMap,Dp),Cv=f.createContext(void 0),cO=e=>{const t=f.useContext(Cv);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},V1=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(Cv.Provider,{value:e,children:t}));const Dh=e=>e.endsWith("/")?e.slice(0,-1):e;function Nd(){const e="https://paperswithcode.co".trim();if(!e)return"";try{const t=e.startsWith("http")?new URL(e):new URL(e,typeof window<"u"?window.location.origin:"http://localhost");return Dh(t.origin)}catch{return Dh(e)}}function cr(e){const t=e.startsWith("/")?e:`/${e}`,n=Nd();return n?`${n}${t}`:t}function Ja(e){const t=e.startsWith("/")?e:`/${e}`;return cr(t)}function W1(){return Ja("/admin-dashboard")}function dO(e){if(!e)return null;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("//"))return e;if(e.startsWith("/")){const t=Nd();return t?`${t}${e}`:e}return e}function qi(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function Sa(){const t=String("0").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}function fO(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function H1(){const t=String("1").trim().toLowerCase();return t==="1"||t==="true"||t==="yes"}const q1="/hf-logo.svg?v=20260513b",$h=({size:e=14})=>g.jsx("img",{src:q1,alt:"",width:Math.round(e*95/88),height:e,"aria-hidden":"true",draggable:!1,style:{display:"block"}});function K1(e,t=!1,n=!1){const r=Ja("/api/v1/auth/hf/login"),i=new URL(r,window.location.origin).origin===window.location.origin?e:new URL(e,window.location.origin).toString(),s=new URLSearchParams({return_to:i});return t&&s.set("authorize_inference","true"),n&&s.set("collect_email","true"),`${r}?${s.toString()}`}const _v=({returnTo:e,compact:t=!1,label:n="Sign in",authorizeInference:r=!1,collectEmail:o=!1})=>{if(qi())return null;const i=()=>{window.location.href=K1(e,r,o)};return t?g.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:i,children:g.jsx($h,{size:16})}):g.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:i,"aria-label":"Sign in with Hugging Face",children:[g.jsx($h,{size:18}),g.jsx("span",{children:n})]})};function G1(e,t=[]){let n=[];function r(i,s){const a=f.createContext(s);a.displayName=i+"Context";const l=n.length;n=[...n,s];const u=d=>{var v;const{scope:p,children:h,...E}=d,y=((v=p==null?void 0:p[e])==null?void 0:v[l])||a,x=f.useMemo(()=>E,Object.values(E));return g.jsx(y.Provider,{value:x,children:h})};u.displayName=i+"Provider";function c(d,p){var y;const h=((y=p==null?void 0:p[e])==null?void 0:y[l])||a,E=f.useContext(h);if(E)return E;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Q1(o,...t)]}function Q1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Je(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var vt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function Fh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tr(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Fh(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{let{children:i,...s}=r;bv(i)&&typeof Ea=="function"&&(i=Ea(i._payload));const a=f.Children.toArray(i),l=a.find(eC);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var hO=Pv("Slot");function J1(e){const t=f.forwardRef((n,r)=>{let{children:o,...i}=n;if(bv(o)&&typeof Ea=="function"&&(o=Ea(o._payload)),f.isValidElement(o)){const s=nC(o),a=tC(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Tr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Z1=Symbol("radix.slottable");function eC(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Z1}function tC(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function nC(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Od=rC.reduce((e,t)=>{const n=Pv(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),kv={exports:{}},Tv={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var To=f;function oC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iC=typeof Object.is=="function"?Object.is:oC,sC=To.useState,aC=To.useEffect,lC=To.useLayoutEffect,uC=To.useDebugValue;function cC(e,t){var n=t(),r=sC({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return lC(function(){o.value=n,o.getSnapshot=t,Gl(o)&&i({inst:o})},[e,n,t]),aC(function(){return Gl(o)&&i({inst:o}),e(function(){Gl(o)&&i({inst:o})})},[e]),uC(n),n}function Gl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!iC(e,n)}catch{return!0}}function dC(e,t){return t()}var fC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?dC:cC;Tv.useSyncExternalStore=To.useSyncExternalStore!==void 0?To.useSyncExternalStore:fC;kv.exports=Tv;var hC=kv.exports;function pC(){return hC.useSyncExternalStore(gC,()=>!0,()=>!1)}function gC(){return()=>{}}var Ad="Avatar",[mC]=G1(Ad),[vC,Rv]=mC(Ad),Nv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=f.useState("idle");return g.jsx(vC,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:g.jsx(Od.span,{...r,ref:t})})});Nv.displayName=Ad;var Ov="AvatarImage",Av=f.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=Rv(Ov,n),a=yC(r,i),l=Je(u=>{o(u),s.onImageLoadingStatusChange(u)});return vt(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?g.jsx(Od.img,{...i,ref:t,src:r}):null});Av.displayName=Ov;var Mv="AvatarFallback",jv=f.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=Rv(Mv,n),[s,a]=f.useState(r===void 0);return f.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?g.jsx(Od.span,{...o,ref:t}):null});jv.displayName=Mv;function zh(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function yC(e,{referrerPolicy:t,crossOrigin:n}){const r=pC(),o=f.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[s,a]=f.useState(()=>zh(i,e));return vt(()=>{a(zh(i,e))},[i,e]),vt(()=>{const l=d=>()=>{a(d)};if(!i)return;const u=l("loaded"),c=l("error");return i.addEventListener("load",u),i.addEventListener("error",c),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",c)}},[i,n,t]),s}var Lv=Nv,Iv=Av,Dv=jv;function $v(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const t=SC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Md);return a[0]===""&&a.length!==1&&a.shift(),zv(a,t)||xC(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},zv=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?zv(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Md);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},Uh=/^\[(.+)\]$/,xC=e=>{if(Uh.test(e)){const t=Uh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},SC=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return CC(Object.entries(e.classGroups),n).forEach(([i,s])=>{hc(s,r,i,t)}),r},hc=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Bh(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(EC(o)){hc(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{hc(s,Bh(t,i),n,r)})})},Bh=(e,t)=>{let n=e;return t.split(Md).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},EC=e=>e.isThemeGetter,CC=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,_C=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Uv="!",bC=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let u=0,c=0,d;for(let x=0;xc?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:E,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:s}):s},PC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},kC=e=>({cache:_C(e.cacheSize),parseClassName:bC(e),...wC(e)}),TC=/\s+/,RC=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(TC);let a="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let E=!!h,y=r(E?p.substring(0,h):p);if(!y){if(!E){a=u+(a.length>0?" "+a:a);continue}if(y=r(p),!y){a=u+(a.length>0?" "+a:a);continue}E=!1}const x=PC(c).join(":"),v=d?x+Uv:x,m=v+y;if(i.includes(m))continue;i.push(m);const w=o(y,E);for(let S=0;S0?" "+a:a)}return a};function NC(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(c),e());return n=kC(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=RC(l,n);return o(l,c),c}return function(){return i(NC.apply(null,arguments))}}const ae=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Vv=/^\[(?:([a-z-]+):)?(.+)\]$/i,AC=/^\d+\/\d+$/,MC=new Set(["px","full","screen"]),jC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LC=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,IC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,DC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$C=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yt=e=>so(e)||MC.has(e)||AC.test(e),En=e=>Lo(e,"length",qC),so=e=>!!e&&!Number.isNaN(Number(e)),Ql=e=>Lo(e,"number",so),Go=e=>!!e&&Number.isInteger(Number(e)),FC=e=>e.endsWith("%")&&so(e.slice(0,-1)),Q=e=>Vv.test(e),Cn=e=>jC.test(e),zC=new Set(["length","size","percentage"]),UC=e=>Lo(e,zC,Wv),BC=e=>Lo(e,"position",Wv),VC=new Set(["image","url"]),WC=e=>Lo(e,VC,GC),HC=e=>Lo(e,"",KC),Qo=()=>!0,Lo=(e,t,n)=>{const r=Vv.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},qC=e=>LC.test(e)&&!IC.test(e),Wv=()=>!1,KC=e=>DC.test(e),GC=e=>$C.test(e),QC=()=>{const e=ae("colors"),t=ae("spacing"),n=ae("blur"),r=ae("brightness"),o=ae("borderColor"),i=ae("borderRadius"),s=ae("borderSpacing"),a=ae("borderWidth"),l=ae("contrast"),u=ae("grayscale"),c=ae("hueRotate"),d=ae("invert"),p=ae("gap"),h=ae("gradientColorStops"),E=ae("gradientColorStopPositions"),y=ae("inset"),x=ae("margin"),v=ae("opacity"),m=ae("padding"),w=ae("saturate"),S=ae("scale"),C=ae("sepia"),_=ae("skew"),P=ae("space"),R=ae("translate"),j=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",Q,t],D=()=>[Q,t],q=()=>["",Yt,En],I=()=>["auto",so,Q],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",Q],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[so,Q];return{cacheSize:500,separator:":",theme:{colors:[Qo],spacing:[Yt,En],blur:["none","",Cn,Q],brightness:B(),borderColor:[e],borderRadius:["none","","full",Cn,Q],borderSpacing:D(),borderWidth:q(),contrast:B(),grayscale:k(),hueRotate:B(),invert:k(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[FC,En],inset:z(),margin:z(),opacity:B(),padding:D(),saturate:B(),scale:B(),sepia:k(),skew:B(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",Q]}],container:["container"],columns:[{columns:[Cn]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),Q]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Go,Q]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Q]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",Go,Q]}],"grid-cols":[{"grid-cols":[Qo]}],"col-start-end":[{col:["auto",{span:["full",Go,Q]},Q]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Qo]}],"row-start-end":[{row:["auto",{span:[Go,Q]},Q]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Q]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Q,t]}],"min-w":[{"min-w":[Q,t,"min","max","fit"]}],"max-w":[{"max-w":[Q,t,"none","full","min","max","fit","prose",{screen:[Cn]},Cn]}],h:[{h:[Q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Cn,En]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ql]}],"font-family":[{font:[Qo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Q]}],"line-clamp":[{"line-clamp":["none",so,Ql]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yt,Q]}],"list-image":[{"list-image":["none",Q]}],"list-style-type":[{list:["none","disc","decimal",Q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yt,En]}],"underline-offset":[{"underline-offset":["auto",Yt,Q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),BC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",UC]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},WC]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:U()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Yt,Q]}],"outline-w":[{outline:[Yt,En]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Yt,En]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Cn,HC]}],"shadow-color":[{shadow:[Qo]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Cn,Q]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Q]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Q]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Go,Q]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Yt,En,Ql]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},YC=OC(QC);function Ne(...e){return YC(Fv(e))}function pO(e){const t=e.trim(),n=t.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=t.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:t}function gO(e){if(e==null||e==="")return"—";const t=typeof e=="string"?parseFloat(e):e;return Number.isFinite(t)?Math.abs(t)>=100?t.toFixed(0):Math.abs(t)>=10?t.toFixed(1):t.toFixed(2):String(e)}const Hv=f.forwardRef(({className:e,...t},n)=>g.jsx(Lv,{ref:n,className:Ne("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Hv.displayName=Lv.displayName;const qv=f.forwardRef(({className:e,...t},n)=>g.jsx(Iv,{ref:n,className:Ne("aspect-square h-full w-full",e),...t}));qv.displayName=Iv.displayName;const Kv=f.forwardRef(({className:e,...t},n)=>g.jsx(Dv,{ref:n,className:Ne("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Kv.displayName=Dv.displayName;function V(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function mO(e,t){const n=f.createContext(t),r=i=>{const{children:s,...a}=i,l=f.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=f.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Rr(e,t=[]){let n=[];function r(i,s){const a=f.createContext(s),l=n.length;n=[...n,s];const u=d=>{var v;const{scope:p,children:h,...E}=d,y=((v=p==null?void 0:p[e])==null?void 0:v[l])||a,x=f.useMemo(()=>E,Object.values(E));return g.jsx(y.Provider,{value:x,children:h})};u.displayName=i+"Provider";function c(d,p){var y;const h=((y=p==null?void 0:p[e])==null?void 0:y[l])||a,E=f.useContext(h);if(E)return E;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,XC(o,...t)]}function XC(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var JC=Oa[" useInsertionEffect ".trim().toString()]||vt;function jd({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=ZC({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const c=f.useRef(e!==void 0);f.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=f.useCallback(c=>{var d;if(a){const p=e_(c)?c(e):c;p!==e&&((d=s.current)==null||d.call(s,p))}else i(c)},[a,e,i,s]);return[l,u]}function ZC({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),i=f.useRef(t);return JC(()=>{i.current=t},[t]),f.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function e_(e){return typeof e=="function"}function t_(e){const t=n_(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(o_);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function n_(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=s_(o),a=i_(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Tr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var r_=Symbol("radix.slottable");function o_(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===r_}function i_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function s_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var a_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ve=a_.reduce((e,t)=>{const n=t_(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ld(e,t){e&&Hi.flushSync(()=>e.dispatchEvent(t))}function Vh(e){const t=l_(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(c_);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function l_(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=f_(o),a=d_(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Tr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var u_=Symbol("radix.slottable");function c_(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===u_}function d_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function f_(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Id(e){const t=e+"CollectionProvider",[n,r]=Rr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:v}=y,m=T.useRef(null),w=T.useRef(new Map).current;return g.jsx(o,{scope:x,itemMap:w,collectionRef:m,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=Vh(a),u=T.forwardRef((y,x)=>{const{scope:v,children:m}=y,w=i(a,v),S=Re(x,w.collectionRef);return g.jsx(l,{ref:S,children:m})});u.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",p=Vh(c),h=T.forwardRef((y,x)=>{const{scope:v,children:m,...w}=y,S=T.useRef(null),C=Re(x,S),_=i(c,v);return T.useEffect(()=>(_.itemMap.set(S,{ref:S,...w}),()=>void _.itemMap.delete(S))),g.jsx(p,{[d]:"",ref:C,children:m})});h.displayName=c;function E(y){const x=i(e+"CollectionConsumer",y);return T.useCallback(()=>{const m=x.collectionRef.current;if(!m)return[];const w=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((_,P)=>w.indexOf(_.ref.current)-w.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},E,r]}var h_=f.createContext(void 0);function Gv(e){const t=f.useContext(h_);return e||t||"ltr"}function p_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var g_="DismissableLayer",pc="dismissableLayer.update",m_="dismissableLayer.pointerDownOutside",v_="dismissableLayer.focusOutside",Wh,Qv=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Za=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=f.useContext(Qv),[c,d]=f.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=f.useState({}),E=Re(t,P=>d(P)),y=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(x),m=c?y.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=m>=v,C=w_(P=>{const R=P.target,j=[...u.branches].some(M=>M.contains(R));!S||j||(o==null||o(P),s==null||s(P),P.defaultPrevented||a==null||a())},p),_=x_(P=>{const R=P.target;[...u.branches].some(M=>M.contains(R))||(i==null||i(P),s==null||s(P),P.defaultPrevented||a==null||a())},p);return p_(P=>{m===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},p),f.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Wh=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Hh(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Wh)}},[c,p,n,u]),f.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Hh())},[c,u]),f.useEffect(()=>{const P=()=>h({});return document.addEventListener(pc,P),()=>document.removeEventListener(pc,P)},[]),g.jsx(ve.div,{...l,ref:E,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,_.onFocusCapture),onBlurCapture:V(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});Za.displayName=g_;var y_="DismissableLayerBranch",Yv=f.forwardRef((e,t)=>{const n=f.useContext(Qv),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(ve.div,{...e,ref:o})});Yv.displayName=y_;function w_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Xv(m_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function x_(e,t=globalThis==null?void 0:globalThis.document){const n=Je(e),r=f.useRef(!1);return f.useEffect(()=>{const o=i=>{i.target&&!r.current&&Xv(v_,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Hh(){const e=new CustomEvent(pc);document.dispatchEvent(e)}function Xv(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ld(o,i):o.dispatchEvent(i)}var S_=Za,E_=Yv,Yl=0;function C_(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qh()),document.body.insertAdjacentElement("beforeend",e[1]??qh()),Yl++,()=>{Yl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yl--}},[])}function qh(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Xl="focusScope.autoFocusOnMount",Jl="focusScope.autoFocusOnUnmount",Kh={bubbles:!1,cancelable:!0},__="FocusScope",Jv=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=f.useState(null),u=Je(o),c=Je(i),d=f.useRef(null),p=Re(t,y=>l(y)),h=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let y=function(w){if(h.paused||!a)return;const S=w.target;a.contains(S)?d.current=S:bn(d.current,{select:!0})},x=function(w){if(h.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||bn(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&bn(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const m=new MutationObserver(v);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),m.disconnect()}}},[r,a,h.paused]),f.useEffect(()=>{if(a){Qh.add(h);const y=document.activeElement;if(!a.contains(y)){const v=new CustomEvent(Xl,Kh);a.addEventListener(Xl,u),a.dispatchEvent(v),v.defaultPrevented||(b_(N_(Zv(a)),{select:!0}),document.activeElement===y&&bn(a))}return()=>{a.removeEventListener(Xl,u),setTimeout(()=>{const v=new CustomEvent(Jl,Kh);a.addEventListener(Jl,c),a.dispatchEvent(v),v.defaultPrevented||bn(y??document.body,{select:!0}),a.removeEventListener(Jl,c),Qh.remove(h)},0)}}},[a,u,c,h]);const E=f.useCallback(y=>{if(!n&&!r||h.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const m=y.currentTarget,[w,S]=P_(m);w&&S?!y.shiftKey&&v===S?(y.preventDefault(),n&&bn(w,{select:!0})):y.shiftKey&&v===w&&(y.preventDefault(),n&&bn(S,{select:!0})):v===m&&y.preventDefault()}},[n,r,h.paused]);return g.jsx(ve.div,{tabIndex:-1,...s,ref:p,onKeyDown:E})});Jv.displayName=__;function b_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(bn(r,{select:t}),document.activeElement!==n)return}function P_(e){const t=Zv(e),n=Gh(t,e),r=Gh(t.reverse(),e);return[n,r]}function Zv(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 Gh(e,t){for(const n of e)if(!k_(n,{upTo:t}))return n}function k_(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function T_(e){return e instanceof HTMLInputElement&&"select"in e}function bn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&T_(e)&&t&&e.select()}}var Qh=R_();function R_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Yh(e,t),e.unshift(t)},remove(t){var n;e=Yh(e,t),(n=e[0])==null||n.resume()}}}function Yh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function N_(e){return e.filter(t=>t.tagName!=="A")}var O_=Oa[" useId ".trim().toString()]||(()=>{}),A_=0;function gc(e){const[t,n]=f.useState(O_());return vt(()=>{n(r=>r??String(A_++))},[e]),t?`radix-${t}`:""}const M_=["top","right","bottom","left"],Yn=Math.min,tt=Math.max,Ca=Math.round,xs=Math.floor,Kt=e=>({x:e,y:e}),j_={left:"right",right:"left",bottom:"top",top:"bottom"};function mc(e,t,n){return tt(e,Yn(t,n))}function cn(e,t){return typeof e=="function"?e(t):e}function dn(e){return e.split("-")[0]}function Io(e){return e.split("-")[1]}function Dd(e){return e==="x"?"y":"x"}function $d(e){return e==="y"?"height":"width"}function Wt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Fd(e){return Dd(Wt(e))}function L_(e,t,n){n===void 0&&(n=!1);const r=Io(e),o=Fd(e),i=$d(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=_a(s)),[s,_a(s)]}function I_(e){const t=_a(e);return[vc(e),t,vc(t)]}function vc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Xh=["left","right"],Jh=["right","left"],D_=["top","bottom"],$_=["bottom","top"];function F_(e,t,n){switch(e){case"top":case"bottom":return n?t?Jh:Xh:t?Xh:Jh;case"left":case"right":return t?D_:$_;default:return[]}}function z_(e,t,n,r){const o=Io(e);let i=F_(dn(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(vc)))),i}function _a(e){const t=dn(e);return j_[t]+e.slice(t.length)}function U_(e){return{top:0,right:0,bottom:0,left:0,...e}}function ey(e){return typeof e!="number"?U_(e):{top:e,right:e,bottom:e,left:e}}function ba(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Zh(e,t,n){let{reference:r,floating:o}=e;const i=Wt(t),s=Fd(t),a=$d(s),l=dn(t),u=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Io(t)){case"start":h[s]-=p*(n&&u?-1:1);break;case"end":h[s]+=p*(n&&u?-1:1);break}return h}async function B_(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=cn(t,e),E=ey(h),x=a[p?d==="floating"?"reference":"floating":d],v=ba(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),m=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=ba(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:l}):m);return{top:(v.top-C.top+E.top)/S.y,bottom:(C.bottom-v.bottom+E.bottom)/S.y,left:(v.left-C.left+E.left)/S.x,right:(C.right-v.right+E.right)/S.x}}const V_=50,W_=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:B_},l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Zh(u,r,l),p=r,h=0;const E={};for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=cn(e,t)||{};if(u==null)return{};const d=ey(c),p={x:n,y:r},h=Fd(o),E=$d(h),y=await s.getDimensions(u),x=h==="y",v=x?"top":"left",m=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[E]+i.reference[h]-p[h]-i.floating[E],C=p[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=_?_[w]:0;(!P||!await(s.isElement==null?void 0:s.isElement(_)))&&(P=a.floating[w]||i.floating[E]);const R=S/2-C/2,j=P/2-y[E]/2-1,M=Yn(d[v],j),z=Yn(d[m],j),D=M,q=P-y[E]-z,I=P/2-y[E]/2+R,Y=mc(D,I,q),U=!l.arrow&&Io(o)!=null&&I!==Y&&i.reference[E]/2-(II<=0)){var z,D;const I=(((z=i.flip)==null?void 0:z.index)||0)+1,Y=P[I];if(Y&&(!(d==="alignment"?m!==Wt(Y):!1)||M.every(O=>Wt(O.placement)===m?O.overflows[0]>0:!0)))return{data:{index:I,overflows:M},reset:{placement:Y}};let U=(D=M.filter(H=>H.overflows[0]<=0).sort((H,O)=>H.overflows[1]-O.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(h){case"bestFit":{var q;const H=(q=M.filter(O=>{if(_){const k=Wt(O.placement);return k===m||k==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(k=>k>0).reduce((k,L)=>k+L,0)]).sort((O,k)=>O[1]-k[1])[0])==null?void 0:q[0];H&&(U=H);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function ep(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tp(e){return M_.some(t=>e[t]>=0)}const K_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=cn(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=ep(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:tp(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=ep(s,n.floating);return{data:{escapedOffsets:a,escaped:tp(a)}}}default:return{}}}}},ty=new Set(["left","top"]);async function G_(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=dn(n),a=Io(n),l=Wt(n)==="y",u=ty.has(s)?-1:1,c=i&&l?-1:1,d=cn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:E}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof E=="number"&&(h=a==="end"?E*-1:E),l?{x:h*c,y:p*u}:{x:p*u,y:h*c}}const Q_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await G_(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Y_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:m,y:w}=v;return{x:m,y:w}}},...u}=cn(e,t),c={x:n,y:r},d=await i.detectOverflow(t,u),p=Wt(dn(o)),h=Dd(p);let E=c[h],y=c[p];if(s){const v=h==="y"?"top":"left",m=h==="y"?"bottom":"right",w=E+d[v],S=E-d[m];E=mc(w,E,S)}if(a){const v=p==="y"?"top":"left",m=p==="y"?"bottom":"right",w=y+d[v],S=y-d[m];y=mc(w,y,S)}const x=l.fn({...t,[h]:E,[p]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[h]:s,[p]:a}}}}}},X_=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=cn(e,t),c={x:n,y:r},d=Wt(o),p=Dd(d);let h=c[p],E=c[d];const y=cn(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const w=p==="y"?"height":"width",S=i.reference[p]-i.floating[w]+x.mainAxis,C=i.reference[p]+i.reference[w]-x.mainAxis;hC&&(h=C)}if(u){var v,m;const w=p==="y"?"width":"height",S=ty.has(dn(o)),C=i.reference[d]-i.floating[w]+(S&&((v=s.offset)==null?void 0:v[d])||0)+(S?0:x.crossAxis),_=i.reference[d]+i.reference[w]+(S?0:((m=s.offset)==null?void 0:m[d])||0)-(S?x.crossAxis:0);E_&&(E=_)}return{[p]:h,[d]:E}}}},J_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=cn(e,t),c=await s.detectOverflow(t,u),d=dn(o),p=Io(o),h=Wt(o)==="y",{width:E,height:y}=i.floating;let x,v;d==="top"||d==="bottom"?(x=d,v=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,x=p==="end"?"top":"bottom");const m=y-c.top-c.bottom,w=E-c.left-c.right,S=Yn(y-c[x],m),C=Yn(E-c[v],w),_=!t.middlewareData.shift;let P=S,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=m),_&&!p){const M=tt(c.left,0),z=tt(c.right,0),D=tt(c.top,0),q=tt(c.bottom,0);h?R=E-2*(M!==0||z!==0?M+z:tt(c.left,c.right)):P=y-2*(D!==0||q!==0?D+q:tt(c.top,c.bottom))}await l({...t,availableWidth:R,availableHeight:P});const j=await s.getDimensions(a.floating);return E!==j.width||y!==j.height?{reset:{rects:!0}}:{}}}};function el(){return typeof window<"u"}function Do(e){return ny(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gt(e){var t;return(t=(ny(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ny(e){return el()?e instanceof Node||e instanceof ot(e).Node:!1}function Ot(e){return el()?e instanceof Element||e instanceof ot(e).Element:!1}function gn(e){return el()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function np(e){return!el()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}function Ki(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Z_(e){return/^(table|td|th)$/.test(Do(e))}function tl(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const eb=/transform|translate|scale|rotate|perspective|filter/,tb=/paint|layout|strict|content/,or=e=>!!e&&e!=="none";let Zl;function zd(e){const t=Ot(e)?At(e):e;return or(t.transform)||or(t.translate)||or(t.scale)||or(t.rotate)||or(t.perspective)||!Ud()&&(or(t.backdropFilter)||or(t.filter))||eb.test(t.willChange||"")||tb.test(t.contain||"")}function nb(e){let t=Xn(e);for(;gn(t)&&!Ro(t);){if(zd(t))return t;if(tl(t))return null;t=Xn(t)}return null}function Ud(){return Zl==null&&(Zl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Zl}function Ro(e){return/^(html|body|#document)$/.test(Do(e))}function At(e){return ot(e).getComputedStyle(e)}function nl(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xn(e){if(Do(e)==="html")return e;const t=e.assignedSlot||e.parentNode||np(e)&&e.host||Gt(e);return np(t)?t.host:t}function ry(e){const t=Xn(e);return Ro(t)?e.ownerDocument?e.ownerDocument.body:e.body:gn(t)&&Ki(t)?t:ry(t)}function ji(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ry(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ot(o);if(i){const a=yc(s);return t.concat(s,s.visualViewport||[],Ki(o)?o:[],a&&n?ji(a):[])}else return t.concat(o,ji(o,[],n))}function yc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oy(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=gn(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ca(n)!==i||Ca(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Bd(e){return Ot(e)?e:e.contextElement}function ao(e){const t=Bd(e);if(!gn(t))return Kt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=oy(t);let s=(i?Ca(n.width):n.width)/r,a=(i?Ca(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const rb=Kt(0);function iy(e){const t=ot(e);return!Ud()||!t.visualViewport?rb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ob(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function _r(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Bd(e);let s=Kt(1);t&&(r?Ot(r)&&(s=ao(r)):s=ao(e));const a=ob(i,n,r)?iy(i):Kt(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,c=o.width/s.x,d=o.height/s.y;if(i){const p=ot(i),h=r&&Ot(r)?ot(r):r;let E=p,y=yc(E);for(;y&&r&&h!==E;){const x=ao(y),v=y.getBoundingClientRect(),m=At(y),w=v.left+(y.clientLeft+parseFloat(m.paddingLeft))*x.x,S=v.top+(y.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=w,u+=S,E=ot(y),y=yc(E)}}return ba({width:c,height:d,x:l,y:u})}function rl(e,t){const n=nl(e).scrollLeft;return t?t.left+n:_r(Gt(e)).left+n}function sy(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rl(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function ib(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Gt(r),a=t?tl(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Kt(1);const c=Kt(0),d=gn(r);if((d||!d&&!i)&&((Do(r)!=="body"||Ki(s))&&(l=nl(r)),d)){const h=_r(r);u=ao(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const p=s&&!d&&!i?sy(s,l):Kt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}}function sb(e){return Array.from(e.getClientRects())}function ab(e){const t=Gt(e),n=nl(e),r=e.ownerDocument.body,o=tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+rl(e);const a=-n.scrollTop;return At(r).direction==="rtl"&&(s+=tt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const rp=25;function lb(e,t){const n=ot(e),r=Gt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Ud();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=rl(r);if(u<=0){const c=r.ownerDocument,d=c.body,p=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,E=Math.abs(r.clientWidth-d.clientWidth-h);E<=rp&&(i-=E)}else u<=rp&&(i+=u);return{width:i,height:s,x:a,y:l}}function ub(e,t){const n=_r(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=gn(e)?ao(e):Kt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function op(e,t,n){let r;if(t==="viewport")r=lb(e,n);else if(t==="document")r=ab(Gt(e));else if(Ot(t))r=ub(t,n);else{const o=iy(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ba(r)}function ay(e,t){const n=Xn(e);return n===t||!Ot(n)||Ro(n)?!1:At(n).position==="fixed"||ay(n,t)}function cb(e,t){const n=t.get(e);if(n)return n;let r=ji(e,[],!1).filter(a=>Ot(a)&&Do(a)!=="body"),o=null;const i=At(e).position==="fixed";let s=i?Xn(e):e;for(;Ot(s)&&!Ro(s);){const a=At(s),l=zd(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ki(s)&&!l&&ay(e,s))?r=r.filter(c=>c!==s):o=a,s=Xn(s)}return t.set(e,r),r}function db(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?tl(t)?[]:cb(t,this._c):[].concat(n),r],a=op(t,s[0],o);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let p=1;p{s(!1,1e-7)},1e3)}P===1&&!uy(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return s(!0),i}function yb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Bd(e),c=o||i?[...u?ji(u):[],...t?ji(t):[]]:[];c.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=u&&a?vb(u,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(v=>{let[m]=v;m&&m.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),u&&!l&&h.observe(u),t&&h.observe(t));let E,y=l?_r(e):null;l&&x();function x(){const v=_r(e);y&&!uy(y,v)&&n(),y=v,E=requestAnimationFrame(x)}return n(),()=>{var v;c.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(E)}}const wb=Q_,xb=Y_,Sb=q_,Eb=J_,Cb=K_,sp=H_,_b=X_,bb=(e,t,n)=>{const r=new Map,o={platform:mb,...n},i={...o.platform,_c:r};return W_(e,t,{...o,platform:i})};var Pb=typeof document<"u",kb=function(){},Us=Pb?f.useLayoutEffect:kb;function Pa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Pa(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Pa(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function cy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ap(e,t){const n=cy(e);return Math.round(t*n)/n}function tu(e){const t=f.useRef(e);return Us(()=>{t.current=e}),t}function Tb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=f.useState(r);Pa(p,r)||h(r);const[E,y]=f.useState(null),[x,v]=f.useState(null),m=f.useCallback(O=>{O!==_.current&&(_.current=O,y(O))},[]),w=f.useCallback(O=>{O!==P.current&&(P.current=O,v(O))},[]),S=i||E,C=s||x,_=f.useRef(null),P=f.useRef(null),R=f.useRef(c),j=l!=null,M=tu(l),z=tu(o),D=tu(u),q=f.useCallback(()=>{if(!_.current||!P.current)return;const O={placement:t,strategy:n,middleware:p};z.current&&(O.platform=z.current),bb(_.current,P.current,O).then(k=>{const L={...k,isPositioned:D.current!==!1};I.current&&!Pa(R.current,L)&&(R.current=L,Hi.flushSync(()=>{d(L)}))})},[p,t,n,z,D]);Us(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[u]);const I=f.useRef(!1);Us(()=>(I.current=!0,()=>{I.current=!1}),[]),Us(()=>{if(S&&(_.current=S),C&&(P.current=C),S&&C){if(M.current)return M.current(S,C,q);q()}},[S,C,q,M,j]);const Y=f.useMemo(()=>({reference:_,floating:P,setReference:m,setFloating:w}),[m,w]),U=f.useMemo(()=>({reference:S,floating:C}),[S,C]),H=f.useMemo(()=>{const O={position:n,left:0,top:0};if(!U.floating)return O;const k=ap(U.floating,c.x),L=ap(U.floating,c.y);return a?{...O,transform:"translate("+k+"px, "+L+"px)",...cy(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:L}},[n,a,U.floating,c.x,c.y]);return f.useMemo(()=>({...c,update:q,refs:Y,elements:U,floatingStyles:H}),[c,q,Y,U,H])}const Rb=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?sp({element:r.current,padding:o}).fn(n):{}:r?sp({element:r,padding:o}).fn(n):{}}}},Nb=(e,t)=>{const n=wb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ob=(e,t)=>{const n=xb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ab=(e,t)=>({fn:_b(e).fn,options:[e,t]}),Mb=(e,t)=>{const n=Sb(e);return{name:n.name,fn:n.fn,options:[e,t]}},jb=(e,t)=>{const n=Eb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lb=(e,t)=>{const n=Cb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ib=(e,t)=>{const n=Rb(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Db="Arrow",dy=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return g.jsx(ve.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});dy.displayName=Db;var $b=dy;function Fb(e){const[t,n]=f.useState(void 0);return vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Vd="Popper",[fy,ol]=Rr(Vd),[zb,hy]=fy(Vd),py=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return g.jsx(zb,{scope:t,anchor:r,onAnchorChange:o,children:n})};py.displayName=Vd;var gy="PopperAnchor",my=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=hy(gy,n),s=f.useRef(null),a=Re(t,s),l=f.useRef(null);return f.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:g.jsx(ve.div,{...o,ref:a})});my.displayName=gy;var Wd="PopperContent",[Ub,Bb]=fy(Wd),vy=f.forwardRef((e,t)=>{var J,Qt,be,jt,mn,Mr;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:E,...y}=e,x=hy(Wd,n),[v,m]=f.useState(null),w=Re(t,vn=>m(vn)),[S,C]=f.useState(null),_=Fb(S),P=(_==null?void 0:_.width)??0,R=(_==null?void 0:_.height)??0,j=r+(i!=="center"?"-"+i:""),M=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},z=Array.isArray(u)?u:[u],D=z.length>0,q={padding:M,boundary:z.filter(Wb),altBoundary:D},{refs:I,floatingStyles:Y,placement:U,isPositioned:H,middlewareData:O}=Tb({strategy:"fixed",placement:j,whileElementsMounted:(...vn)=>yb(...vn,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[Nb({mainAxis:o+R,alignmentAxis:s}),l&&Ob({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Ab():void 0,...q}),l&&Mb({...q}),jb({...q,apply:({elements:vn,rects:Ji,availableWidth:gl,availableHeight:Zi})=>{const{width:ml,height:$o}=Ji.reference,jr=vn.floating.style;jr.setProperty("--radix-popper-available-width",`${gl}px`),jr.setProperty("--radix-popper-available-height",`${Zi}px`),jr.setProperty("--radix-popper-anchor-width",`${ml}px`),jr.setProperty("--radix-popper-anchor-height",`${$o}px`)}}),S&&Ib({element:S,padding:a}),Hb({arrowWidth:P,arrowHeight:R}),p&&Lb({strategy:"referenceHidden",...q})]}),[k,L]=xy(U),B=Je(E);vt(()=>{H&&(B==null||B())},[H,B]);const F=(J=O.arrow)==null?void 0:J.x,G=(Qt=O.arrow)==null?void 0:Qt.y,X=((be=O.arrow)==null?void 0:be.centerOffset)!==0,[fe,ye]=f.useState();return vt(()=>{v&&ye(window.getComputedStyle(v).zIndex)},[v]),g.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:H?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(jt=O.transformOrigin)==null?void 0:jt.x,(mn=O.transformOrigin)==null?void 0:mn.y].join(" "),...((Mr=O.hide)==null?void 0:Mr.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Ub,{scope:n,placedSide:k,onArrowChange:C,arrowX:F,arrowY:G,shouldHideArrow:X,children:g.jsx(ve.div,{"data-side":k,"data-align":L,...y,ref:w,style:{...y.style,animation:H?void 0:"none"}})})})});vy.displayName=Wd;var yy="PopperArrow",Vb={top:"bottom",right:"left",bottom:"top",left:"right"},wy=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Bb(yy,r),s=Vb[i.placedSide];return g.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:g.jsx($b,{...o,ref:n,style:{...o.style,display:"block"}})})});wy.displayName=yy;function Wb(e){return e!==null}var Hb=e=>({name:"transformOrigin",options:e,fn(t){var x,v,m;const{placement:n,rects:r,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,c]=xy(n),d={start:"0%",center:"50%",end:"100%"}[c],p=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,h=(((m=o.arrow)==null?void 0:m.y)??0)+l/2;let E="",y="";return u==="bottom"?(E=s?d:`${p}px`,y=`${-l}px`):u==="top"?(E=s?d:`${p}px`,y=`${r.floating.height+l}px`):u==="right"?(E=`${-l}px`,y=s?d:`${h}px`):u==="left"&&(E=`${r.floating.width+l}px`,y=s?d:`${h}px`),{data:{x:E,y}}}});function xy(e){const[t,n="center"]=e.split("-");return[t,n]}var qb=py,Sy=my,Ey=vy,Cy=wy,Kb="Portal",Hd=f.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=f.useState(!1);vt(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Xm.createPortal(g.jsx(ve.div,{...r,ref:t}),s):null});Hd.displayName=Kb;function Gb(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Nr=e=>{const{present:t,children:n}=e,r=Qb(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=Re(r.ref,Yb(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};Nr.displayName="Presence";function Qb(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Gb(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=Ss(r.current);i.current=a==="mounted"?u:"none"},[a]),vt(()=>{const u=r.current,c=o.current;if(c!==e){const p=i.current,h=Ss(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),vt(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=h=>{const y=Ss(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&y&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},p=h=>{h.target===t&&(i.current=Ss(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ss(e){return(e==null?void 0:e.animationName)||"none"}function Yb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nu="rovingFocusGroup.onEntryFocus",Xb={bubbles:!1,cancelable:!0},Gi="RovingFocusGroup",[wc,_y,Jb]=Id(Gi),[Zb,by]=Rr(Gi,[Jb]),[eP,tP]=Zb(Gi),Py=f.forwardRef((e,t)=>g.jsx(wc.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(wc.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(nP,{...e,ref:t})})}));Py.displayName=Gi;var nP=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,p=f.useRef(null),h=Re(t,p),E=Gv(i),[y,x]=jd({prop:s,defaultProp:a??null,onChange:l,caller:Gi}),[v,m]=f.useState(!1),w=Je(u),S=_y(n),C=f.useRef(!1),[_,P]=f.useState(0);return f.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(nu,w),()=>R.removeEventListener(nu,w)},[w]),g.jsx(eP,{scope:n,orientation:r,dir:E,loop:o,currentTabStopId:y,onItemFocus:f.useCallback(R=>x(R),[x]),onItemShiftTab:f.useCallback(()=>m(!0),[]),onFocusableItemAdd:f.useCallback(()=>P(R=>R+1),[]),onFocusableItemRemove:f.useCallback(()=>P(R=>R-1),[]),children:g.jsx(ve.div,{tabIndex:v||_===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,R=>{const j=!C.current;if(R.target===R.currentTarget&&j&&!v){const M=new CustomEvent(nu,Xb);if(R.currentTarget.dispatchEvent(M),!M.defaultPrevented){const z=S().filter(U=>U.focusable),D=z.find(U=>U.active),q=z.find(U=>U.id===y),Y=[D,q,...z].filter(Boolean).map(U=>U.ref.current);Ry(Y,c)}}C.current=!1}),onBlur:V(e.onBlur,()=>m(!1))})})}),ky="RovingFocusGroupItem",Ty=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=gc(),u=i||l,c=tP(ky,n),d=c.currentTabStopId===u,p=_y(n),{onFocusableItemAdd:h,onFocusableItemRemove:E,currentTabStopId:y}=c;return f.useEffect(()=>{if(r)return h(),()=>E()},[r,h,E]),g.jsx(wc.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:g.jsx(ve.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:V(e.onMouseDown,x=>{r?c.onItemFocus(u):x.preventDefault()}),onFocus:V(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:V(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=iP(x,c.orientation,c.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=p().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const S=w.indexOf(x.currentTarget);w=c.loop?sP(w,S+1):w.slice(S+1)}setTimeout(()=>Ry(w))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:y!=null}):s})})});Ty.displayName=ky;var rP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oP(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function iP(e,t,n){const r=oP(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rP[r]}function Ry(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function sP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aP=Py,lP=Ty;function uP(e){const t=cP(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,a=f.Children.toArray(i),l=a.find(fP);if(l){const u=l.props.children,c=a.map(d=>d===l?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:d);return g.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,c):null})}return g.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function cP(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=pP(o),a=hP(i,o.props);return o.type!==f.Fragment&&(a.ref=r?Tr(r,s):s),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dP=Symbol("radix.slottable");function fP(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dP}function hP(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function pP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fr=new WeakMap,Es=new WeakMap,Cs={},ru=0,Ny=function(e){return e&&(e.host||Ny(e.parentNode))},mP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ny(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},vP=function(e,t,n,r){var o=mP(t,Array.isArray(e)?e:[e]);Cs[n]||(Cs[n]=new WeakMap);var i=Cs[n],s=[],a=new Set,l=new Set(o),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};o.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))c(p);else try{var h=p.getAttribute(r),E=h!==null&&h!=="false",y=(Fr.get(p)||0)+1,x=(i.get(p)||0)+1;Fr.set(p,y),i.set(p,x),s.push(p),y===1&&E&&Es.set(p,!0),x===1&&p.setAttribute(n,"true"),E||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return c(t),a.clear(),ru++,function(){s.forEach(function(d){var p=Fr.get(d)-1,h=i.get(d)-1;Fr.set(d,p),i.set(d,h),p||(Es.has(d)||d.removeAttribute(r),Es.delete(d)),h||d.removeAttribute(n)}),ru--,ru||(Fr=new WeakMap,Fr=new WeakMap,Es=new WeakMap,Cs={})}},yP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=gP(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),vP(r,o,n,"aria-hidden")):function(){return null}},Vt=function(){return Vt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return LP;var t=IP(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$P=jy(),lo="data-scroll-locked",FP=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(xP,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(a,"px ").concat(r,`; - } - body[`).concat(lo,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Bs,` { - right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Vs,` { - margin-right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Bs," .").concat(Bs,` { - right: 0 `).concat(r,`; - } - - .`).concat(Vs," .").concat(Vs,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(lo,`] { - `).concat(SP,": ").concat(a,`px; - } -`)},up=function(){var e=parseInt(document.body.getAttribute(lo)||"0",10);return isFinite(e)?e:0},zP=function(){f.useEffect(function(){return document.body.setAttribute(lo,(up()+1).toString()),function(){var e=up()-1;e<=0?document.body.removeAttribute(lo):document.body.setAttribute(lo,e.toString())}},[])},UP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;zP();var i=f.useMemo(function(){return DP(o)},[o]);return f.createElement($P,{styles:FP(i,!t,o,n?"":"!important")})},xc=!1;if(typeof window<"u")try{var _s=Object.defineProperty({},"passive",{get:function(){return xc=!0,!0}});window.addEventListener("test",_s,_s),window.removeEventListener("test",_s,_s)}catch{xc=!1}var zr=xc?{passive:!1}:!1,BP=function(e){return e.tagName==="TEXTAREA"},Ly=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!BP(e)&&n[t]==="visible")},VP=function(e){return Ly(e,"overflowY")},WP=function(e){return Ly(e,"overflowX")},cp=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Iy(e,r);if(o){var i=Dy(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},HP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},qP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Iy=function(e,t){return e==="v"?VP(t):WP(t)},Dy=function(e,t){return e==="v"?HP(t):qP(t)},KP=function(e,t){return e==="h"&&t==="rtl"?-1:1},GP=function(e,t,n,r,o){var i=KP(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,c=s>0,d=0,p=0;do{if(!a)break;var h=Dy(e,a),E=h[0],y=h[1],x=h[2],v=y-x-i*E;(E||v)&&Iy(e,a)&&(d+=v,p+=E);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(d)<1||!c&&Math.abs(p)<1)&&(u=!0),u},bs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dp=function(e){return[e.deltaX,e.deltaY]},fp=function(e){return e&&"current"in e?e.current:e},QP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YP=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},XP=0,Ur=[];function JP(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(XP++)[0],i=f.useState(jy)[0],s=f.useRef(e);f.useEffect(function(){s.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=wP([e.lockRef.current],(e.shards||[]).map(fp),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=f.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var v=bs(y),m=n.current,w="deltaX"in y?y.deltaX:m[0]-v[0],S="deltaY"in y?y.deltaY:m[1]-v[1],C,_=y.target,P=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in y&&P==="h"&&_.type==="range")return!1;var R=window.getSelection(),j=R&&R.anchorNode,M=j?j===_||j.contains(_):!1;if(M)return!1;var z=cp(P,_);if(!z)return!0;if(z?C=P:(C=P==="v"?"h":"v",z=cp(P,_)),!z)return!1;if(!r.current&&"changedTouches"in y&&(w||S)&&(r.current=C),!C)return!0;var D=r.current||C;return GP(D,x,y,D==="h"?w:S)},[]),l=f.useCallback(function(y){var x=y;if(!(!Ur.length||Ur[Ur.length-1]!==i)){var v="deltaY"in x?dp(x):bs(x),m=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&QP(C.delta,v)})[0];if(m&&m.should){x.cancelable&&x.preventDefault();return}if(!m){var w=(s.current.shards||[]).map(fp).filter(Boolean).filter(function(C){return C.contains(x.target)}),S=w.length>0?a(x,w[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=f.useCallback(function(y,x,v,m){var w={name:y,delta:x,target:v,should:m,shadowParent:ZP(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),c=f.useCallback(function(y){n.current=bs(y),r.current=void 0},[]),d=f.useCallback(function(y){u(y.type,dp(y),y.target,a(y,e.lockRef.current))},[]),p=f.useCallback(function(y){u(y.type,bs(y),y.target,a(y,e.lockRef.current))},[]);f.useEffect(function(){return Ur.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,zr),document.addEventListener("touchmove",l,zr),document.addEventListener("touchstart",c,zr),function(){Ur=Ur.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,zr),document.removeEventListener("touchmove",l,zr),document.removeEventListener("touchstart",c,zr)}},[]);var h=e.removeScrollBar,E=e.inert;return f.createElement(f.Fragment,null,E?f.createElement(i,{styles:YP(o)}):null,h?f.createElement(UP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ZP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ek=TP(My,JP);var $y=f.forwardRef(function(e,t){return f.createElement(il,Vt({},e,{ref:t,sideCar:ek}))});$y.classNames=il.classNames;var Sc=["Enter"," "],tk=["ArrowDown","PageUp","Home"],Fy=["ArrowUp","PageDown","End"],nk=[...tk,...Fy],rk={ltr:[...Sc,"ArrowRight"],rtl:[...Sc,"ArrowLeft"]},ok={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qi="Menu",[Li,ik,sk]=Id(Qi),[Or,zy]=Rr(Qi,[sk,ol,by]),sl=ol(),Uy=by(),[ak,Ar]=Or(Qi),[lk,Yi]=Or(Qi),By=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=sl(t),[l,u]=f.useState(null),c=f.useRef(!1),d=Je(i),p=Gv(o);return f.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),g.jsx(qb,{...a,children:g.jsx(ak,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:g.jsx(lk,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:p,modal:s,children:r})})})};By.displayName=Qi;var uk="MenuAnchor",qd=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=sl(n);return g.jsx(Sy,{...o,...r,ref:t})});qd.displayName=uk;var Kd="MenuPortal",[ck,Vy]=Or(Kd,{forceMount:void 0}),Wy=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Ar(Kd,t);return g.jsx(ck,{scope:t,forceMount:n,children:g.jsx(Nr,{present:n||i.open,children:g.jsx(Hd,{asChild:!0,container:o,children:r})})})};Wy.displayName=Kd;var pt="MenuContent",[dk,Gd]=Or(pt),Hy=f.forwardRef((e,t)=>{const n=Vy(pt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ar(pt,e.__scopeMenu),s=Yi(pt,e.__scopeMenu);return g.jsx(Li.Provider,{scope:e.__scopeMenu,children:g.jsx(Nr,{present:r||i.open,children:g.jsx(Li.Slot,{scope:e.__scopeMenu,children:s.modal?g.jsx(fk,{...o,ref:t}):g.jsx(hk,{...o,ref:t})})})})}),fk=f.forwardRef((e,t)=>{const n=Ar(pt,e.__scopeMenu),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const i=r.current;if(i)return yP(i)},[]),g.jsx(Qd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),hk=f.forwardRef((e,t)=>{const n=Ar(pt,e.__scopeMenu);return g.jsx(Qd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),pk=uP("MenuContent.ScrollLock"),Qd=f.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:E,...y}=e,x=Ar(pt,n),v=Yi(pt,n),m=sl(n),w=Uy(n),S=ik(n),[C,_]=f.useState(null),P=f.useRef(null),R=Re(t,P,x.onContentChange),j=f.useRef(0),M=f.useRef(""),z=f.useRef(0),D=f.useRef(null),q=f.useRef("right"),I=f.useRef(0),Y=E?$y:f.Fragment,U=E?{as:pk,allowPinchZoom:!0}:void 0,H=k=>{var J,Qt;const L=M.current+k,B=S().filter(be=>!be.disabled),F=document.activeElement,G=(J=B.find(be=>be.ref.current===F))==null?void 0:J.textValue,X=B.map(be=>be.textValue),fe=Pk(X,L,G),ye=(Qt=B.find(be=>be.textValue===fe))==null?void 0:Qt.ref.current;(function be(jt){M.current=jt,window.clearTimeout(j.current),jt!==""&&(j.current=window.setTimeout(()=>be(""),1e3))})(L),ye&&setTimeout(()=>ye.focus())};f.useEffect(()=>()=>window.clearTimeout(j.current),[]),C_();const O=f.useCallback(k=>{var B,F;return q.current===((B=D.current)==null?void 0:B.side)&&Tk(k,(F=D.current)==null?void 0:F.area)},[]);return g.jsx(dk,{scope:n,searchRef:M,onItemEnter:f.useCallback(k=>{O(k)&&k.preventDefault()},[O]),onItemLeave:f.useCallback(k=>{var L;O(k)||((L=P.current)==null||L.focus(),_(null))},[O]),onTriggerLeave:f.useCallback(k=>{O(k)&&k.preventDefault()},[O]),pointerGraceTimerRef:z,onPointerGraceIntentChange:f.useCallback(k=>{D.current=k},[]),children:g.jsx(Y,{...U,children:g.jsx(Jv,{asChild:!0,trapped:o,onMountAutoFocus:V(i,k=>{var L;k.preventDefault(),(L=P.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:g.jsx(Za,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:g.jsx(aP,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:_,onEntryFocus:V(l,k=>{v.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(Ey,{role:"menu","aria-orientation":"vertical","data-state":aw(x.open),"data-radix-menu-content":"",dir:v.dir,...m,...y,ref:R,style:{outline:"none",...y.style},onKeyDown:V(y.onKeyDown,k=>{const B=k.target.closest("[data-radix-menu-content]")===k.currentTarget,F=k.ctrlKey||k.altKey||k.metaKey,G=k.key.length===1;B&&(k.key==="Tab"&&k.preventDefault(),!F&&G&&H(k.key));const X=P.current;if(k.target!==X||!nk.includes(k.key))return;k.preventDefault();const ye=S().filter(J=>!J.disabled).map(J=>J.ref.current);Fy.includes(k.key)&&ye.reverse(),_k(ye)}),onBlur:V(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(j.current),M.current="")}),onPointerMove:V(e.onPointerMove,Ii(k=>{const L=k.target,B=I.current!==k.clientX;if(k.currentTarget.contains(L)&&B){const F=k.clientX>I.current?"right":"left";q.current=F,I.current=k.clientX}}))})})})})})})});Hy.displayName=pt;var gk="MenuGroup",Yd=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{role:"group",...r,ref:t})});Yd.displayName=gk;var mk="MenuLabel",qy=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});qy.displayName=mk;var ka="MenuItem",hp="menu.itemSelect",al=f.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=f.useRef(null),s=Yi(ka,e.__scopeMenu),a=Gd(ka,e.__scopeMenu),l=Re(t,i),u=f.useRef(!1),c=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(hp,{bubbles:!0,cancelable:!0});d.addEventListener(hp,h=>r==null?void 0:r(h),{once:!0}),Ld(d,p),p.defaultPrevented?u.current=!1:s.onClose()}};return g.jsx(Ky,{...o,ref:l,disabled:n,onClick:V(e.onClick,c),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),u.current=!0},onPointerUp:V(e.onPointerUp,d=>{var p;u.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:V(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||Sc.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});al.displayName=ka;var Ky=f.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Gd(ka,n),a=Uy(n),l=f.useRef(null),u=Re(t,l),[c,d]=f.useState(!1),[p,h]=f.useState("");return f.useEffect(()=>{const E=l.current;E&&h((E.textContent??"").trim())},[i.children]),g.jsx(Li.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:g.jsx(lP,{asChild:!0,...a,focusable:!r,children:g.jsx(ve.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:V(e.onPointerMove,Ii(E=>{r?s.onItemLeave(E):(s.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:V(e.onPointerLeave,Ii(E=>s.onItemLeave(E))),onFocus:V(e.onFocus,()=>d(!0)),onBlur:V(e.onBlur,()=>d(!1))})})})}),vk="MenuCheckboxItem",Gy=f.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return g.jsx(Zy,{scope:e.__scopeMenu,checked:n,children:g.jsx(al,{role:"menuitemcheckbox","aria-checked":Ta(n)?"mixed":n,...o,ref:t,"data-state":Jd(n),onSelect:V(o.onSelect,()=>r==null?void 0:r(Ta(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Gy.displayName=vk;var Qy="MenuRadioGroup",[yk,wk]=Or(Qy,{value:void 0,onValueChange:()=>{}}),Yy=f.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Je(r);return g.jsx(yk,{scope:e.__scopeMenu,value:n,onValueChange:i,children:g.jsx(Yd,{...o,ref:t})})});Yy.displayName=Qy;var Xy="MenuRadioItem",Jy=f.forwardRef((e,t)=>{const{value:n,...r}=e,o=wk(Xy,e.__scopeMenu),i=n===o.value;return g.jsx(Zy,{scope:e.__scopeMenu,checked:i,children:g.jsx(al,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Jd(i),onSelect:V(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});Jy.displayName=Xy;var Xd="MenuItemIndicator",[Zy,xk]=Or(Xd,{checked:!1}),ew=f.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=xk(Xd,n);return g.jsx(Nr,{present:r||Ta(i.checked)||i.checked===!0,children:g.jsx(ve.span,{...o,ref:t,"data-state":Jd(i.checked)})})});ew.displayName=Xd;var Sk="MenuSeparator",tw=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(ve.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});tw.displayName=Sk;var Ek="MenuArrow",nw=f.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=sl(n);return g.jsx(Cy,{...o,...r,ref:t})});nw.displayName=Ek;var Ck="MenuSub",[vO,rw]=Or(Ck),ti="MenuSubTrigger",ow=f.forwardRef((e,t)=>{const n=Ar(ti,e.__scopeMenu),r=Yi(ti,e.__scopeMenu),o=rw(ti,e.__scopeMenu),i=Gd(ti,e.__scopeMenu),s=f.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},c=f.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return f.useEffect(()=>c,[c]),f.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),g.jsx(qd,{asChild:!0,...u,children:g.jsx(Ky,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":aw(n.open),...e,ref:Tr(t,o.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:V(e.onPointerMove,Ii(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:V(e.onPointerLeave,Ii(d=>{var h,E;c();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const y=(E=n.content)==null?void 0:E.dataset.side,x=y==="right",v=x?-5:5,m=p[x?"left":"right"],w=p[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:m,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:m,y:p.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:V(e.onKeyDown,d=>{var h;const p=i.searchRef.current!=="";e.disabled||p&&d.key===" "||rk[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});ow.displayName=ti;var iw="MenuSubContent",sw=f.forwardRef((e,t)=>{const n=Vy(pt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ar(pt,e.__scopeMenu),s=Yi(pt,e.__scopeMenu),a=rw(iw,e.__scopeMenu),l=f.useRef(null),u=Re(t,l);return g.jsx(Li.Provider,{scope:e.__scopeMenu,children:g.jsx(Nr,{present:r||i.open,children:g.jsx(Li.Slot,{scope:e.__scopeMenu,children:g.jsx(Qd,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:V(e.onFocusOutside,c=>{c.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:V(e.onEscapeKeyDown,c=>{s.onClose(),c.preventDefault()}),onKeyDown:V(e.onKeyDown,c=>{var h;const d=c.currentTarget.contains(c.target),p=ok[s.dir].includes(c.key);d&&p&&(i.onOpenChange(!1),(h=a.trigger)==null||h.focus(),c.preventDefault())})})})})})});sw.displayName=iw;function aw(e){return e?"open":"closed"}function Ta(e){return e==="indeterminate"}function Jd(e){return Ta(e)?"indeterminate":e?"checked":"unchecked"}function _k(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function bk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Pk(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=bk(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function kk(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function Tk(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return kk(n,t)}function Ii(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Rk=By,Nk=qd,Ok=Wy,Ak=Hy,Mk=Yd,jk=qy,Lk=al,Ik=Gy,Dk=Yy,$k=Jy,Fk=ew,zk=tw,Uk=nw,Bk=ow,Vk=sw,ll="DropdownMenu",[Wk]=Rr(ll,[zy]),He=zy(),[Hk,lw]=Wk(ll),uw=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=He(t),u=f.useRef(null),[c,d]=jd({prop:o,defaultProp:i??!1,onChange:s,caller:ll});return g.jsx(Hk,{scope:t,triggerId:gc(),triggerRef:u,contentId:gc(),open:c,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(p=>!p),[d]),modal:a,children:g.jsx(Rk,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};uw.displayName=ll;var cw="DropdownMenuTrigger",dw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=lw(cw,n),s=He(n);return g.jsx(Nk,{asChild:!0,...s,children:g.jsx(ve.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Tr(t,i.triggerRef),onPointerDown:V(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:V(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});dw.displayName=cw;var qk="DropdownMenuPortal",fw=e=>{const{__scopeDropdownMenu:t,...n}=e,r=He(t);return g.jsx(Ok,{...r,...n})};fw.displayName=qk;var hw="DropdownMenuContent",pw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=lw(hw,n),i=He(n),s=f.useRef(!1);return g.jsx(Ak,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:V(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:V(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!o.modal||c)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pw.displayName=hw;var Kk="DropdownMenuGroup",Gk=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Mk,{...o,...r,ref:t})});Gk.displayName=Kk;var Qk="DropdownMenuLabel",gw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(jk,{...o,...r,ref:t})});gw.displayName=Qk;var Yk="DropdownMenuItem",mw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Lk,{...o,...r,ref:t})});mw.displayName=Yk;var Xk="DropdownMenuCheckboxItem",vw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Ik,{...o,...r,ref:t})});vw.displayName=Xk;var Jk="DropdownMenuRadioGroup",Zk=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Dk,{...o,...r,ref:t})});Zk.displayName=Jk;var eT="DropdownMenuRadioItem",yw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx($k,{...o,...r,ref:t})});yw.displayName=eT;var tT="DropdownMenuItemIndicator",ww=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Fk,{...o,...r,ref:t})});ww.displayName=tT;var nT="DropdownMenuSeparator",xw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(zk,{...o,...r,ref:t})});xw.displayName=nT;var rT="DropdownMenuArrow",oT=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Uk,{...o,...r,ref:t})});oT.displayName=rT;var iT="DropdownMenuSubTrigger",Sw=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Bk,{...o,...r,ref:t})});Sw.displayName=iT;var sT="DropdownMenuSubContent",Ew=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=He(n);return g.jsx(Vk,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ew.displayName=sT;var aT=uw,lT=dw,uT=fw,Cw=pw,_w=gw,bw=mw,Pw=vw,kw=yw,Tw=ww,Rw=xw,Nw=Sw,Ow=Ew;/** - * @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 cT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Aw=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** - * @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. - */var dT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @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 fT=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>f.createElement("svg",{ref:l,...dT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Aw("lucide",o),...a},[...s.map(([u,c])=>f.createElement(u,c)),...Array.isArray(i)?i:[i]]));/** - * @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 ul=(e,t)=>{const n=f.forwardRef(({className:r,...o},i)=>f.createElement(fT,{ref:i,iconNode:t,className:Aw(`lucide-${cT(e)}`,r),...o}));return n.displayName=`${e}`,n};/** - * @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 hT=ul("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @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 pT=ul("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @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 gT=ul("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @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 mT=ul("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vT=aT,yT=lT,wT=f.forwardRef(({className:e,inset:t,children:n,...r},o)=>g.jsxs(Nw,{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,g.jsx(pT,{className:"ml-auto h-4 w-4"})]}));wT.displayName=Nw.displayName;const xT=f.forwardRef(({className:e,...t},n)=>g.jsx(Ow,{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}));xT.displayName=Ow.displayName;const Mw=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(uT,{children:g.jsx(Cw,{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})}));Mw.displayName=Cw.displayName;const Dt=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(bw,{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}));Dt.displayName=bw.displayName;const ST=f.forwardRef(({className:e,children:t,checked:n,...r},o)=>g.jsxs(Pw,{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:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Tw,{children:g.jsx(hT,{className:"h-4 w-4"})})}),t]}));ST.displayName=Pw.displayName;const ET=f.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(kw,{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:[g.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:g.jsx(Tw,{children:g.jsx(gT,{className:"h-2 w-2 fill-current"})})}),t]}));ET.displayName=kw.displayName;const jw=f.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(_w,{ref:r,className:Ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));jw.displayName=_w.displayName;const Ec=f.forwardRef(({className:e,...t},n)=>g.jsx(Rw,{ref:n,className:Ne("-mx-1 my-1 h-px bg-muted",e),...t}));Ec.displayName=Rw.displayName;function CT(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 _T=({user:e,onLogout:t})=>g.jsxs(vT,{children:[g.jsx(yT,{asChild:!0,children:g.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${e.username}`,children:g.jsxs(Hv,{className:"h-8 w-8",children:[e.avatar_url&&g.jsx(qv,{src:e.avatar_url,alt:e.username}),g.jsx(Kv,{className:"text-xs",children:CT(e)})]})})}),g.jsxs(Mw,{align:"end",className:"w-56",children:[g.jsxs(jw,{className:"flex flex-col gap-0.5 py-2",children:[g.jsx("span",{className:"text-sm font-medium leading-tight",children:e.name||e.username}),g.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",e.username]}),e.is_admin&&g.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"}),e.role==="contributor"&&g.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),g.jsx(Ec,{}),g.jsx(Dt,{asChild:!0,children:g.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(e.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),Sa()&&g.jsx(Dt,{asChild:!0,children:g.jsx(Zt,{to:"/chat",children:"Chat"})}),g.jsx(Dt,{asChild:!0,children:g.jsx(Zt,{to:"/frameworks",children:"Frameworks"})}),g.jsx(Dt,{asChild:!0,children:g.jsx(Zt,{to:"/trends",children:"Trends"})}),e.is_admin&&g.jsxs(g.Fragment,{children:[g.jsx(Dt,{asChild:!0,children:g.jsx(Zt,{to:"/admin-dashboard",children:"Admin dashboard"})}),g.jsx(Dt,{asChild:!0,children:g.jsx(Zt,{to:"/submissions",children:"Review submissions"})})]}),g.jsx(Dt,{asChild:!0,children:g.jsx(Zt,{to:`/${encodeURIComponent(e.username)}`,children:"My contributions"})}),g.jsx(Dt,{asChild:!0,children:g.jsx(Zt,{to:"/settings",children:"Settings"})}),g.jsx(Ec,{}),g.jsx(Dt,{onSelect:n=>{n.preventDefault(),t()},children:"Log out"})]})]}),Lw=T.createContext(null),pp="pwc:auth-stale";async function bT(){if(qi())return null;const e=await fetch(cr("/api/v1/auth/me"),{credentials:"include",cache:"no-store"});return e.status===401||!e.ok?null:await e.json()}const PT=({children:e})=>{const[t,n]=T.useState(null),[r,o]=T.useState(!0),i=T.useCallback(async()=>{o(!0);const l=await bT();n(l),o(!1)},[]),s=T.useCallback(async()=>{const l=Ja("/api/v1/auth/logout");if(new URL(l,window.location.origin).origin!==window.location.origin){const u=document.createElement("form");u.method="POST",u.action=`${l}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(u),u.submit();return}await fetch(cr("/api/v1/auth/logout"),{method:"POST",credentials:"include"}),n(null)},[]);T.useEffect(()=>{i()},[i]),T.useEffect(()=>{const l=()=>n(null);return window.addEventListener(pp,l),()=>window.removeEventListener(pp,l)},[]);const a=T.useMemo(()=>({user:t,isLoading:r,refresh:i,logout:s}),[t,r,i,s]);return g.jsx(Lw.Provider,{value:a,children:e})};function Zd(){const e=T.useContext(Lw);if(!e)throw new Error("useAuth must be used inside an ");return e}const Yo=({name:e,size:t=14})=>{const n={search:g.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:g.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:g.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:g.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})};return g.jsx("svg",{className:t===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:t,height:t,children:n[e]})},gp="https://github.com/huggingface/paperswithcode-feedback/issues",kT="https://github.com/huggingface/pwc-cli",mp=[{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:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],TT=()=>{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)},RT=()=>{const[e,t]=T.useState(!1);return T.useEffect(()=>{t(TT())},[]),g.jsx("kbd",{children:e?"⌘K":"Ctrl K"})},NT=({onOpenSearch:e})=>{const[t,n]=T.useState(!1),r=()=>n(!1),{user:o,logout:i}=Zd(),s=Mt(),a=Sa()&&(s.pathname==="/chat"||s.pathname.startsWith("/chat/")),l=`${s.pathname}${s.search}`||"/",u=qi();return g.jsxs(g.Fragment,{children:[g.jsxs("header",{className:`app-header${a?" app-header-chat":""}`,children:[g.jsxs("div",{className:"app-header-inner",children:[g.jsxs(rr,{to:"/",className:"brand",onClick:r,children:[g.jsx("span",{className:"brand-mark"}),g.jsxs("span",{className:"brand-name",children:["Papers ",g.jsx("em",{children:"With Code"})]})]}),g.jsx("nav",{className:"nav",children:mp.map(({to:c,label:d,end:p})=>g.jsx(rr,{to:c,end:p,className:({isActive:h})=>`nav-item ${h?"active":""}`,children:d},c))}),g.jsx("div",{className:"header-spacer"}),g.jsx("a",{className:"feedback-link header-feedback-link",href:gp,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),g.jsxs("button",{className:"search-trigger",onClick:e,children:[g.jsx(Yo,{name:"search",size:13}),g.jsx("span",{children:"Search papers, authors, domains…"}),g.jsx(RT,{})]}),g.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:e,children:g.jsx(Yo,{name:"search",size:14})}),!u&&g.jsx(rr,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:g.jsx(Yo,{name:"bookmark",size:13})}),u?null:o?g.jsx(_T,{user:o,onLogout:i}):g.jsx(_v,{returnTo:l}),g.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",onClick:()=>n(c=>!c),children:g.jsx(Yo,{name:t?"close":"menu",size:14})})]}),g.jsxs("div",{className:"site-announcement",role:"status",children:[g.jsx("span",{children:"New: Papers with Code CLI and Skill now "}),g.jsx("a",{href:kT,target:"_blank",rel:"noreferrer",children:"available"}),g.jsx("span",{children:" as well as "}),g.jsx(rr,{to:"/chat",children:"chat"})]})]}),t&&g.jsx("div",{className:"mobile-nav-drawer",onClick:r,children:g.jsxs("div",{className:"mobile-nav-panel",onClick:c=>c.stopPropagation(),children:[g.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{r(),e()},children:[g.jsx(Yo,{name:"search",size:14}),g.jsx("span",{children:"Search papers, authors, domains…"})]}),mp.map(({to:c,label:d,end:p})=>g.jsx(rr,{to:c,end:p,className:"mobile-nav-link",onClick:r,children:d},c)),g.jsx("a",{className:"mobile-nav-link",href:gp,target:"_blank",rel:"noreferrer",onClick:r,children:"Submit feedback"}),!u&&g.jsx(rr,{to:"/saved",className:"mobile-nav-link",onClick:r,children:"Saved papers"}),!u&&(o==null?void 0:o.is_admin)&&g.jsx(rr,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:r,children:"Admin dashboard"})]})})]})},OT=()=>{const{pathname:e}=Mt();return e==="/chat"||e.startsWith("/chat/")?null:g.jsx("footer",{className:"site-footer",children:g.jsxs("div",{className:"site-footer-inner",children:[g.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),g.jsx(Zt,{to:"/privacy",children:"Privacy"}),g.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},AT=1,MT=1e6;let au=0;function jT(){return au=(au+1)%Number.MAX_SAFE_INTEGER,au.toString()}const lu=new Map,vp=e=>{if(lu.has(e))return;const t=setTimeout(()=>{lu.delete(e),di({type:"REMOVE_TOAST",toastId:e})},MT);lu.set(e,t)},LT=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,AT)};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?vp(n):e.toasts.forEach(r=>{vp(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)}}},Ws=[];let Hs={toasts:[]};function di(e){Hs=LT(Hs,e),Ws.forEach(t=>{t(Hs)})}function IT({...e}){const t=jT(),n=o=>di({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>di({type:"DISMISS_TOAST",toastId:t});return di({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function DT(){const[e,t]=f.useState(Hs);return f.useEffect(()=>(Ws.push(t),()=>{const n=Ws.indexOf(t);n>-1&&Ws.splice(n,1)}),[e]),{...e,toast:IT,dismiss:n=>di({type:"DISMISS_TOAST",toastId:n})}}var $T=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"}),FT="VisuallyHidden",cl=f.forwardRef((e,t)=>g.jsx(ve.span,{...e,ref:t,style:{...$T,...e.style}}));cl.displayName=FT;var zT=cl,ef="ToastProvider",[tf,UT,BT]=Id("Toast"),[Iw]=Rr("Toast",[BT]),[VT,dl]=Iw(ef),Dw=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=f.useState(null),[u,c]=f.useState(0),d=f.useRef(!1),p=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ef}\`. Expected non-empty \`string\`.`),g.jsx(tf.Provider,{scope:t,children:g.jsx(VT,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:f.useCallback(()=>c(h=>h+1),[]),onToastRemove:f.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:p,children:s})})};Dw.displayName=ef;var $w="ToastViewport",WT=["F8"],Cc="toast.viewportPause",_c="toast.viewportResume",Fw=f.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=WT,label:o="Notifications ({hotkey})",...i}=e,s=dl($w,n),a=UT(n),l=f.useRef(null),u=f.useRef(null),c=f.useRef(null),d=f.useRef(null),p=Re(t,d,s.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=s.toastCount>0;f.useEffect(()=>{const x=v=>{var w;r.length!==0&&r.every(S=>v[S]||v.code===S)&&((w=d.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),f.useEffect(()=>{const x=l.current,v=d.current;if(E&&x&&v){const m=()=>{if(!s.isClosePausedRef.current){const _=new CustomEvent(Cc);v.dispatchEvent(_),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const _=new CustomEvent(_c);v.dispatchEvent(_),s.isClosePausedRef.current=!1}},S=_=>{!x.contains(_.relatedTarget)&&w()},C=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",m),x.addEventListener("focusout",S),x.addEventListener("pointermove",m),x.addEventListener("pointerleave",C),window.addEventListener("blur",m),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",m),x.removeEventListener("focusout",S),x.removeEventListener("pointermove",m),x.removeEventListener("pointerleave",C),window.removeEventListener("blur",m),window.removeEventListener("focus",w)}}},[E,s.isClosePausedRef]);const y=f.useCallback(({tabbingDirection:x})=>{const m=a().map(w=>{const S=w.ref.current,C=[S,...rR(S)];return x==="forwards"?C:C.reverse()});return(x==="forwards"?m.reverse():m).flat()},[a]);return f.useEffect(()=>{const x=d.current;if(x){const v=m=>{var C,_,P;const w=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!w){const R=document.activeElement,j=m.shiftKey;if(m.target===x&&j){(C=u.current)==null||C.focus();return}const D=y({tabbingDirection:j?"backwards":"forwards"}),q=D.findIndex(I=>I===R);uu(D.slice(q+1))?m.preventDefault():j?(_=u.current)==null||_.focus():(P=c.current)==null||P.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,y]),g.jsxs(E_,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&g.jsx(bc,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});uu(x)}}),g.jsx(tf.Slot,{scope:n,children:g.jsx(ve.ol,{tabIndex:-1,...i,ref:p})}),E&&g.jsx(bc,{ref:c,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});uu(x)}})]})});Fw.displayName=$w;var zw="ToastFocusProxy",bc=f.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=dl(zw,n);return g.jsx(cl,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});bc.displayName=zw;var Xi="Toast",HT="toast.swipeStart",qT="toast.swipeMove",KT="toast.swipeCancel",GT="toast.swipeEnd",Uw=f.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a,l]=jd({prop:r,defaultProp:o??!0,onChange:i,caller:Xi});return g.jsx(Nr,{present:n||a,children:g.jsx(XT,{open:a,...s,ref:t,onClose:()=>l(!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:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}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:c,y:d}=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",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Uw.displayName=Xi;var[QT,YT]=Iw(Xi,{onClose(){}}),XT=f.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:p,onSwipeEnd:h,...E}=e,y=dl(Xi,n),[x,v]=f.useState(null),m=Re(t,I=>v(I)),w=f.useRef(null),S=f.useRef(null),C=o||y.duration,_=f.useRef(0),P=f.useRef(C),R=f.useRef(0),{onToastAdd:j,onToastRemove:M}=y,z=Je(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=y.viewport)==null||Y.focus()),s()}),D=f.useCallback(I=>{!I||I===1/0||(window.clearTimeout(R.current),_.current=new Date().getTime(),R.current=window.setTimeout(z,I))},[z]);f.useEffect(()=>{const I=y.viewport;if(I){const Y=()=>{D(P.current),u==null||u()},U=()=>{const H=new Date().getTime()-_.current;P.current=P.current-H,window.clearTimeout(R.current),l==null||l()};return I.addEventListener(Cc,U),I.addEventListener(_c,Y),()=>{I.removeEventListener(Cc,U),I.removeEventListener(_c,Y)}}},[y.viewport,C,l,u,D]),f.useEffect(()=>{i&&!y.isClosePausedRef.current&&D(C)},[i,C,y.isClosePausedRef,D]),f.useEffect(()=>(j(),()=>M()),[j,M]);const q=f.useMemo(()=>x?Gw(x):null,[x]);return y.viewport?g.jsxs(g.Fragment,{children:[q&&g.jsx(JT,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:q}),g.jsx(QT,{scope:n,onClose:z,children:Hi.createPortal(g.jsx(tf.ItemSlot,{scope:n,children:g.jsx(S_,{asChild:!0,onEscapeKeyDown:V(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||z(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:g.jsx(ve.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...E,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:V(e.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:V(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:V(e.onPointerMove,I=>{if(!w.current)return;const Y=I.clientX-w.current.x,U=I.clientY-w.current.y,H=!!S.current,O=["left","right"].includes(y.swipeDirection),k=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,L=O?k(0,Y):0,B=O?0:k(0,U),F=I.pointerType==="touch"?10:2,G={x:L,y:B},X={originalEvent:I,delta:G};H?(S.current=G,Ps(qT,d,X,{discrete:!1})):yp(G,y.swipeDirection,F)?(S.current=G,Ps(HT,c,X,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(Y)>F||Math.abs(U)>F)&&(w.current=null)}),onPointerUp:V(e.onPointerUp,I=>{const Y=S.current,U=I.target;if(U.hasPointerCapture(I.pointerId)&&U.releasePointerCapture(I.pointerId),S.current=null,w.current=null,Y){const H=I.currentTarget,O={originalEvent:I,delta:Y};yp(Y,y.swipeDirection,y.swipeThreshold)?Ps(GT,h,O,{discrete:!0}):Ps(KT,p,O,{discrete:!0}),H.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),JT=e=>{const{__scopeToast:t,children:n,...r}=e,o=dl(Xi,t),[i,s]=f.useState(!1),[a,l]=f.useState(!1);return tR(()=>s(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:g.jsx(Hd,{asChild:!0,children:g.jsx(cl,{...r,children:i&&g.jsxs(g.Fragment,{children:[o.label," ",n]})})})},ZT="ToastTitle",Bw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Bw.displayName=ZT;var eR="ToastDescription",Vw=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(ve.div,{...r,ref:t})});Vw.displayName=eR;var Ww="ToastAction",Hw=f.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?g.jsx(Kw,{altText:n,asChild:!0,children:g.jsx(nf,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ww}\`. Expected non-empty \`string\`.`),null)});Hw.displayName=Ww;var qw="ToastClose",nf=f.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=YT(qw,n);return g.jsx(Kw,{asChild:!0,children:g.jsx(ve.button,{type:"button",...r,ref:t,onClick:V(e.onClick,o.onClose)})})});nf.displayName=qw;var Kw=f.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return g.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Gw(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),nR(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(...Gw(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?Ld(o,i):o.dispatchEvent(i)}var yp=(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 tR(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 nR(e){return e.nodeType===e.ELEMENT_NODE}function rR(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 uu(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var oR=Dw,Qw=Fw,Yw=Uw,Xw=Bw,Jw=Vw,Zw=Hw,e0=nf;const wp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xp=Fv,iR=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return xp(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 c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const p=wp(c)||wp(d);return o[u][p]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,p]=c;return p===void 0||(u[d]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...h}=c;return Object.entries(h).every(E=>{let[y,x]=E;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,d,p]:u},[]);return xp(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},sR=oR,t0=f.forwardRef(({className:e,...t},n)=>g.jsx(Qw,{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}));t0.displayName=Qw.displayName;const aR=iR("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"}}),n0=f.forwardRef(({className:e,variant:t,...n},r)=>g.jsx(Yw,{ref:r,className:Ne(aR({variant:t}),e),...n}));n0.displayName=Yw.displayName;const lR=f.forwardRef(({className:e,...t},n)=>g.jsx(Zw,{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}));lR.displayName=Zw.displayName;const r0=f.forwardRef(({className:e,...t},n)=>g.jsx(e0,{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:g.jsx(mT,{className:"h-4 w-4"})}));r0.displayName=e0.displayName;const o0=f.forwardRef(({className:e,...t},n)=>g.jsx(Xw,{ref:n,className:Ne("text-sm font-semibold",e),...t}));o0.displayName=Xw.displayName;const i0=f.forwardRef(({className:e,...t},n)=>g.jsx(Jw,{ref:n,className:Ne("text-sm opacity-90",e),...t}));i0.displayName=Jw.displayName;function uR(){const{toasts:e}=DT();return g.jsxs(sR,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return g.jsxs(n0,{...i,children:[g.jsxs("div",{className:"grid gap-1",children:[n&&g.jsx(o0,{children:n}),r&&g.jsx(i0,{children:r})]}),o,g.jsx(r0,{})]},t)}),g.jsx(t0,{})]})}var cR=e=>{switch(e){case"success":return hR;case"info":return gR;case"warning":return pR;case"error":return mR;default:return null}},dR=Array(12).fill(0),fR=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},dR.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),hR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),pR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),gR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),mR=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),vR=T.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"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),yR=()=>{let[e,t]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Pc=1,wR=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:Pc++,i=this.toasts.find(a=>a.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(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):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 l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(SR(l)&&!l.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:u,description:c})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(l):t.success,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(l):t.error,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,u)=>s.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Pc++;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}},qe=new wR,xR=(e,t)=>{let n=(t==null?void 0:t.id)||Pc++;return qe.addToast({title:e,...t,id:n}),n},SR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ER=xR,CR=()=>qe.toasts,_R=()=>qe.getActiveToasts();Object.assign(ER,{success:qe.success,info:qe.info,warning:qe.warning,error:qe.error,custom:qe.custom,message:qe.message,promise:qe.promise,dismiss:qe.dismiss,loading:qe.loading},{getHistory:CR,getToasts:_R});function bR(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))}bR(`: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 ks(e){return e.label!==void 0}var PR=3,kR="32px",TR="16px",Sp=4e3,RR=356,NR=14,OR=20,AR=200;function Et(...e){return e.filter(Boolean).join(" ")}function MR(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var jR=e=>{var t,n,r,o,i,s,a,l,u,c,d;let{invert:p,toast:h,unstyled:E,interacting:y,setHeights:x,visibleToasts:v,heights:m,index:w,toasts:S,expanded:C,removeToast:_,defaultRichColors:P,closeButton:R,style:j,cancelButtonStyle:M,actionButtonStyle:z,className:D="",descriptionClassName:q="",duration:I,position:Y,gap:U,loadingIcon:H,expandByDefault:O,classNames:k,icons:L,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:F}=e,[G,X]=T.useState(null),[fe,ye]=T.useState(null),[J,Qt]=T.useState(!1),[be,jt]=T.useState(!1),[mn,Mr]=T.useState(!1),[vn,Ji]=T.useState(!1),[gl,Zi]=T.useState(!1),[ml,$o]=T.useState(0),[jr,of]=T.useState(0),Fo=T.useRef(h.duration||I||Sp),sf=T.useRef(null),tr=T.useRef(null),m0=w===0,v0=w+1<=v,lt=h.type,Lr=h.dismissible!==!1,y0=h.className||"",w0=h.descriptionClassName||"",es=T.useMemo(()=>m.findIndex(K=>K.toastId===h.id)||0,[m,h.id]),x0=T.useMemo(()=>{var K;return(K=h.closeButton)!=null?K:R},[h.closeButton,R]),af=T.useMemo(()=>h.duration||I||Sp,[h.duration,I]),vl=T.useRef(0),Ir=T.useRef(0),lf=T.useRef(0),Dr=T.useRef(null),[S0,E0]=Y.split("-"),uf=T.useMemo(()=>m.reduce((K,ie,ce)=>ce>=es?K:K+ie.height,0),[m,es]),cf=yR(),C0=h.invert||p,yl=lt==="loading";Ir.current=T.useMemo(()=>es*U+uf,[es,uf]),T.useEffect(()=>{Fo.current=af},[af]),T.useEffect(()=>{Qt(!0)},[]),T.useEffect(()=>{let K=tr.current;if(K){let ie=K.getBoundingClientRect().height;return of(ie),x(ce=>[{toastId:h.id,height:ie,position:h.position},...ce]),()=>x(ce=>ce.filter(yt=>yt.toastId!==h.id))}},[x,h.id]),T.useLayoutEffect(()=>{if(!J)return;let K=tr.current,ie=K.style.height;K.style.height="auto";let ce=K.getBoundingClientRect().height;K.style.height=ie,of(ce),x(yt=>yt.find(wt=>wt.toastId===h.id)?yt.map(wt=>wt.toastId===h.id?{...wt,height:ce}:wt):[{toastId:h.id,height:ce,position:h.position},...yt])},[J,h.title,h.description,x,h.id]);let yn=T.useCallback(()=>{jt(!0),$o(Ir.current),x(K=>K.filter(ie=>ie.toastId!==h.id)),setTimeout(()=>{_(h)},AR)},[h,_,x,Ir]);T.useEffect(()=>{if(h.promise&<==="loading"||h.duration===1/0||h.type==="loading")return;let K;return C||y||F&&cf?(()=>{if(lf.current{var ie;(ie=h.onAutoClose)==null||ie.call(h,h),yn()},Fo.current)),()=>clearTimeout(K)},[C,y,h,lt,F,cf,yn]),T.useEffect(()=>{h.delete&&yn()},[yn,h.delete]);function _0(){var K,ie,ce;return L!=null&&L.loading?T.createElement("div",{className:Et(k==null?void 0:k.loader,(K=h==null?void 0:h.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":lt==="loading"},L.loading):H?T.createElement("div",{className:Et(k==null?void 0:k.loader,(ie=h==null?void 0:h.classNames)==null?void 0:ie.loader,"sonner-loader"),"data-visible":lt==="loading"},H):T.createElement(fR,{className:Et(k==null?void 0:k.loader,(ce=h==null?void 0:h.classNames)==null?void 0:ce.loader),visible:lt==="loading"})}return T.createElement("li",{tabIndex:0,ref:tr,className:Et(D,y0,k==null?void 0:k.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[lt],(n=h==null?void 0:h.classNames)==null?void 0:n[lt]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:P,"data-styled":!(h.jsx||h.unstyled||E),"data-mounted":J,"data-promise":!!h.promise,"data-swiped":gl,"data-removed":be,"data-visible":v0,"data-y-position":S0,"data-x-position":E0,"data-index":w,"data-front":m0,"data-swiping":mn,"data-dismissible":Lr,"data-type":lt,"data-invert":C0,"data-swipe-out":vn,"data-swipe-direction":fe,"data-expanded":!!(C||O&&J),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${be?ml:Ir.current}px`,"--initial-height":O?"auto":`${jr}px`,...j,...h.style},onDragEnd:()=>{Mr(!1),X(null),Dr.current=null},onPointerDown:K=>{yl||!Lr||(sf.current=new Date,$o(Ir.current),K.target.setPointerCapture(K.pointerId),K.target.tagName!=="BUTTON"&&(Mr(!0),Dr.current={x:K.clientX,y:K.clientY}))},onPointerUp:()=>{var K,ie,ce,yt;if(vn||!Lr)return;Dr.current=null;let wt=Number(((K=tr.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wn=Number(((ie=tr.current)==null?void 0:ie.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nr=new Date().getTime()-((ce=sf.current)==null?void 0:ce.getTime()),xt=G==="x"?wt:wn,xn=Math.abs(xt)/nr;if(Math.abs(xt)>=OR||xn>.11){$o(Ir.current),(yt=h.onDismiss)==null||yt.call(h,h),ye(G==="x"?wt>0?"right":"left":wn>0?"down":"up"),yn(),Ji(!0),Zi(!1);return}Mr(!1),X(null)},onPointerMove:K=>{var ie,ce,yt,wt;if(!Dr.current||!Lr||((ie=window.getSelection())==null?void 0:ie.toString().length)>0)return;let wn=K.clientY-Dr.current.y,nr=K.clientX-Dr.current.x,xt=(ce=e.swipeDirections)!=null?ce:MR(Y);!G&&(Math.abs(nr)>1||Math.abs(wn)>1)&&X(Math.abs(nr)>Math.abs(wn)?"x":"y");let xn={x:0,y:0};G==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&wn<0||xt.includes("bottom")&&wn>0)&&(xn.y=wn):G==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&nr<0||xt.includes("right")&&nr>0)&&(xn.x=nr),(Math.abs(xn.x)>0||Math.abs(xn.y)>0)&&Zi(!0),(yt=tr.current)==null||yt.style.setProperty("--swipe-amount-x",`${xn.x}px`),(wt=tr.current)==null||wt.style.setProperty("--swipe-amount-y",`${xn.y}px`)}},x0&&!h.jsx?T.createElement("button",{"aria-label":B,"data-disabled":yl,"data-close-button":!0,onClick:yl||!Lr?()=>{}:()=>{var K;yn(),(K=h.onDismiss)==null||K.call(h,h)},className:Et(k==null?void 0:k.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=L==null?void 0:L.close)!=null?i:vR):null,h.jsx||f.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,lt||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:Et(k==null?void 0:k.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||_0():null,h.type!=="loading"?h.icon||(L==null?void 0:L[lt])||cR(lt):null):null,T.createElement("div",{"data-content":"",className:Et(k==null?void 0:k.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:Et(k==null?void 0:k.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?T.createElement("div",{"data-description":"",className:Et(q,w0,k==null?void 0:k.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),f.isValidElement(h.cancel)?h.cancel:h.cancel&&ks(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:K=>{var ie,ce;ks(h.cancel)&&Lr&&((ce=(ie=h.cancel).onClick)==null||ce.call(ie,K),yn())},className:Et(k==null?void 0:k.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,f.isValidElement(h.action)?h.action:h.action&&ks(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||z,onClick:K=>{var ie,ce;ks(h.action)&&((ce=(ie=h.action).onClick)==null||ce.call(ie,K),!K.defaultPrevented&&yn())},className:Et(k==null?void 0:k.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function Ep(){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 LR(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?TR:kR;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${s}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=a:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var IR=f.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:p,style:h,visibleToasts:E=PR,toastOptions:y,dir:x=Ep(),gap:v=NR,loadingIcon:m,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:C}=e,[_,P]=T.useState([]),R=T.useMemo(()=>Array.from(new Set([r].concat(_.filter(F=>F.position).map(F=>F.position)))),[_,r]),[j,M]=T.useState([]),[z,D]=T.useState(!1),[q,I]=T.useState(!1),[Y,U]=T.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=T.useRef(null),O=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=T.useRef(null),L=T.useRef(!1),B=T.useCallback(F=>{P(G=>{var X;return(X=G.find(fe=>fe.id===F.id))!=null&&X.delete||qe.dismiss(F.id),G.filter(({id:fe})=>fe!==F.id)})},[]);return T.useEffect(()=>qe.subscribe(F=>{if(F.dismiss){P(G=>G.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{Xm.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]})})})}),[]),T.useEffect(()=>{if(c!=="system"){U(c);return}if(c==="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)}})}},[c]),T.useEffect(()=>{_.length<=1&&D(!1)},[_]),T.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]),T.useEffect(()=>{if(H.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,L.current=!1)}},[H.current]),T.createElement("section",{ref:t,"aria-label":`${S} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((F,G)=>{var X;let[fe,ye]=F.split("-");return _.length?T.createElement("ol",{key:F,dir:x==="auto"?Ep():x,tabIndex:-1,ref:H,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":fe,"data-lifted":z&&_.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((X=j[0])==null?void 0:X.height)||0}px`,"--width":`${RR}px`,"--gap":`${v}px`,...h,...LR(l,u)},onBlur:J=>{L.current&&!J.currentTarget.contains(J.relatedTarget)&&(L.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||L.current||(L.current=!0,k.current=J.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{q||D(!1)},onDragEnd:()=>D(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},_.filter(J=>!J.position&&G===0||J.position===F).map((J,Qt)=>{var be,jt;return T.createElement(jR,{key:J.id,icons:w,index:Qt,toast:J,defaultRichColors:d,duration:(be=y==null?void 0:y.duration)!=null?be:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:E,closeButton:(jt=y==null?void 0:y.closeButton)!=null?jt:s,interacting:q,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:_.filter(mn=>mn.position==J.position),heights:j.filter(mn=>mn.position==J.position),setHeights:M,expandByDefault:i,gap:v,loadingIcon:m,expanded:z,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const DR=({...e})=>{const{theme:t="system"}=tE();return g.jsx(IR,{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 $R=Symbol("radix.slottable");function FR(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=$R,t}var[fl]=Rr("Tooltip",[ol]),rf=ol(),s0="TooltipProvider",zR=700,Cp="tooltip.open",[UR,a0]=fl(s0),l0=e=>{const{__scopeTooltip:t,delayDuration:n=zR,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(UR,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};l0.displayName=s0;var u0="Tooltip",[yO,hl]=fl(u0),kc="TooltipTrigger",BR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=hl(kc,n),i=a0(kc,n),s=rf(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),u=f.useRef(!1),c=f.useRef(!1),d=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(Sy,{asChild:!0,...s,children:g.jsx(ve.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:V(e.onPointerMove,p=>{p.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),c.current=!0)}),onPointerLeave:V(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:V(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:V(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:V(e.onBlur,o.onClose),onClick:V(e.onClick,o.onClose)})})});BR.displayName=kc;var VR="TooltipPortal",[wO,WR]=fl(VR,{forceMount:void 0}),No="TooltipContent",c0=f.forwardRef((e,t)=>{const n=WR(No,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=hl(No,e.__scopeTooltip);return g.jsx(Nr,{present:r||s.open,children:s.disableHoverableContent?g.jsx(d0,{side:o,...i,ref:t}):g.jsx(HR,{side:o,...i,ref:t})})}),HR=f.forwardRef((e,t)=>{const n=hl(No,e.__scopeTooltip),r=a0(No,e.__scopeTooltip),o=f.useRef(null),i=Re(t,o),[s,a]=f.useState(null),{trigger:l,onClose:u}=n,c=o.current,{onPointerInTransitChange:d}=r,p=f.useCallback(()=>{a(null),d(!1)},[d]),h=f.useCallback((E,y)=>{const x=E.currentTarget,v={x:E.clientX,y:E.clientY},m=YR(v,x.getBoundingClientRect()),w=XR(v,m),S=JR(y.getBoundingClientRect()),C=eN([...w,...S]);a(C),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(l&&c){const E=x=>h(x,c),y=x=>h(x,l);return l.addEventListener("pointerleave",E),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",E),c.removeEventListener("pointerleave",y)}}},[l,c,h,p]),f.useEffect(()=>{if(s){const E=y=>{const x=y.target,v={x:y.clientX,y:y.clientY},m=(l==null?void 0:l.contains(x))||(c==null?void 0:c.contains(x)),w=!ZR(v,s);m?p():w&&(p(),u())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[l,c,s,u,p]),g.jsx(d0,{...e,ref:i})}),[qR,KR]=fl(u0,{isInside:!1}),GR=FR("TooltipContent"),d0=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=hl(No,n),u=rf(n),{onClose:c}=l;return f.useEffect(()=>(document.addEventListener(Cp,c),()=>document.removeEventListener(Cp,c)),[c]),f.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),g.jsx(Za,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:g.jsxs(Ey,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.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:[g.jsx(GR,{children:r}),g.jsx(qR,{scope:n,isInside:!0,children:g.jsx(zT,{id:l.contentId,role:"tooltip",children:o||r})})]})})});c0.displayName=No;var f0="TooltipArrow",QR=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=rf(n);return KR(f0,n).isInside?null:g.jsx(Cy,{...o,...r,ref:t})});QR.displayName=f0;function YR(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 XR(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 JR(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 ZR(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=p>r&&n<(d-u)*(r-c)/(p-c)+u&&(o=!o)}return o}function eN(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),tN(t)}function tN(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 nN=l0,h0=c0;const rN=nN,oN=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(h0,{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}));oN.displayName=h0.displayName;function iN(){const{pathname:e,hash:t}=Mt();f.useEffect(()=>{t||window.scrollTo(0,0)},[e,t])}const sN="cronAdminToken";function aN(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(sN))==null?void 0:e.trim())??""}const _p=!1;class Ra extends Error{constructor(n,r){var o;super(`API request failed: ${n.status} ${n.statusText}`);Lt(this,"status");Lt(this,"statusText");Lt(this,"response");Lt(this,"detail");Lt(this,"code");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(o=JSON.parse(r))==null?void 0:o.detail,typeof this.detail=="string"&&(this.message=this.detail),typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const i="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${i}`}}catch{this.detail=void 0}}}class lN{constructor(t){this.baseUrl=t}async request(t,n){const r=`${this.baseUrl}${t}`;try{const{headers:o,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=aN(),u=new Headers(o);u.has("Content-Type")||u.set("Content-Type","application/json"),l&&!u.has("X-Admin-Token")&&u.set("X-Admin-Token",l);const c=await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:u});if(!c.ok){const p=new Ra(c,await c.text());throw console.error("[API] Error response:",p.response),p}return c.status===204?void 0:await c.json()}catch(o){throw console.error(`[API] Request to ${r} failed:`,o),o}}}async function uN(e){try{return await e()}catch(t){throw t instanceof Ra&&t.status===401&&t.code!=="fresh_auth_required"&&t.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale")),t}}const cN=new lN(`${Nd()}/api/v1`),pl=(e,t)=>uN(()=>cN.request(e,t));class dN{constructor(t){this.request=t}getPreferences(){return this.request("/me/preferences")}updatePreferences(t){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(t)})}}const bp=new dN(pl);class fN{constructor(t){this.request=t}search(t,n=1,r=10,o,i){const s=new URLSearchParams({q:t,page:n.toString(),page_size:r.toString()});return o&&s.set("mode",o),this.request(`/papers/search?${s.toString()}`,{signal:i})}get(t,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/${t}${r}`)}getByArxivId(t,n=!0){const r=n?"?include_resources=true":"";return this.request(`/papers/arxiv/${t}${r}`)}}const cu=new fN(pl),Ts="pwc:fresh-auth-mutation";function hN(e){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",e);const t=Ja("/api/v1/auth/hf/login");window.location.assign(`${t}?return_to=${encodeURIComponent(window.location.href)}`)}class pN{constructor(t,n=hN){Lt(this,"paperLoads",new Map);Lt(this,"evaluationLoads",new Map);this.request=t,this.recoverFreshAuth=n}primePaper(t,n=!1){n&&this.paperLoads.delete(t);let r=this.paperLoads.get(t);return r||(r=this.request(`/papers/${t}/curation-state`).catch(o=>{throw this.paperLoads.delete(t),o}),this.paperLoads.set(t,r)),r}primeEvaluations(t,n=!1){n&&this.evaluationLoads.delete(t);let r=this.evaluationLoads.get(t);return r||(r=this.request(`/evaluations/curation-state?paper_id=${t}`).catch(o=>{throw this.evaluationLoads.delete(t),o}),this.evaluationLoads.set(t,r)),r}async mutatePaper(t,n,r,o,i){const s=this.paperLoads.get(t);if(!s)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const a=(await s).sections[n];if(!a)throw new Error(`Missing curation version for ${n}`);return this.mutate(n,o,r,a,i,`paper:${t}:${n}`)}async mutateEvaluations(t,n,r,o){const i=this.evaluationLoads.get(String(t));if(!i)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const s=(await i).version;return this.mutate("evaluations",r,n,s,o,`paper:${t}:evaluations`)}async mutate(t,n,r,o,i,s){const a=new Headers(i.headers);Object.entries(this.idempotencyHeaders(s,r,o)).forEach(([u,c])=>a.set(u,c));const l={...i,headers:a};try{const u=await this.request(n,l);return this.clearAttempt(l),u}catch(u){throw u instanceof Ra&&u.status===401&&u.code==="fresh_auth_required"?(this.saveFreshAuthMutation(t,n,r,l),this.recoverFreshAuth(t)):u instanceof Ra&&u.status===409&&(this.clearAttempt(l),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:n}}))),u}}freshAuthMutationDraft(){const t=sessionStorage.getItem(Ts);if(!t)return null;try{const n=JSON.parse(t);if(!n.endpoint.startsWith("/")||n.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(n.options.method))throw new Error("Invalid saved mutation draft");return n}catch{return sessionStorage.removeItem(Ts),null}}async resumeFreshAuthMutation(){const t=this.freshAuthMutationDraft();if(!t)throw new Error("No saved catalog edit is available.");const n=await this.request(t.endpoint,{method:t.options.method,body:t.options.body,headers:t.options.headers});return this.clearAttempt({headers:t.options.headers}),sessionStorage.removeItem(Ts),sessionStorage.removeItem("pwc:fresh-auth-edit"),n}saveFreshAuthMutation(t,n,r,o){const i=Object.fromEntries(new Headers(o.headers).entries()),s=typeof o.body=="string"?o.body:void 0;sessionStorage.setItem(Ts,JSON.stringify({section:t,endpoint:n,payload:r,options:{method:(o.method??"POST").toUpperCase(),body:s,headers:i}}))}idempotencyHeaders(t,n,r){const o=`pwc:mutation:${t}:${JSON.stringify(n)}`,i=sessionStorage.getItem(o);if(i){const a=JSON.parse(i);return{"Idempotency-Key":a.key,"If-Match":a.version}}const s=crypto.randomUUID();return sessionStorage.setItem(o,JSON.stringify({key:s,version:r})),sessionStorage.setItem(`pwc:mutation-key:${s}`,o),{"Idempotency-Key":s,"If-Match":r}}clearAttempt(t){const n=new Headers(t.headers).get("Idempotency-Key");if(!n)return;const r=sessionStorage.getItem(`pwc:mutation-key:${n}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${n}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}async function xO(e,t){return pl(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}class gN{constructor(){Lt(this,"curation");this.curation=new pN((t,n)=>this.request(t,n))}async request(t,n){return pl(t,n)}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()),(t==null?void 0:t.has_code)!==void 0&&n.append("has_code",t.has_code.toString()),(t==null?void 0:t.has_hf_artifacts)!==void 0&&n.append("has_hf_artifacts",t.has_hf_artifacts.toString()),t!=null&&t.framework&&n.append("framework",t.framework),t!=null&&t.repository&&n.append("repository",t.repository);const r=`/papers/${n.toString()?`?${n.toString()}`:""}`;return this.request(r,{cache:"no-cache"})}async searchPapers(t,n=1,r=10,o,i){return cu.search(t,n,r,o,i)}async getPaper(t,n=!0){return cu.get(t,n)}async getPaperByArxivId(t,n=!0){return cu.getByArxivId(t,n)}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)})}primePaperCurationState(t,n=!1){return this.curation.primePaper(t,n)}primeEvaluationCurationState(t,n=!1){return this.curation.primeEvaluations(t,n)}freshAuthMutationDraft(){return this.curation.freshAuthMutationDraft()}resumeFreshAuthMutation(){return this.curation.resumeFreshAuthMutation()}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.curation.mutatePaper(t,"tasks",n,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.curation.mutatePaper(t,"methods",n,o,{method:"PUT"})}async updatePaperOrganizations(t,n){const r=new URLSearchParams;n.forEach(i=>r.append("organization_ids",i.toString()));const o=`/papers/${t}/organizations?${r.toString()}`;return this.curation.mutatePaper(t,"organizations",n,o,{method:"PUT"})}async updatePaperRepositories(t,n){const r=`/papers/${t}/repositories`;return this.curation.mutatePaper(t,"repositories",n,r,{method:"PUT",body:JSON.stringify({repositories:n})})}async updatePaperProjectPages(t,n){const r=`/papers/${t}/project-pages`;return this.curation.mutatePaper(t,"project_pages",n,r,{method:"PUT",body:JSON.stringify({project_pages:n})})}async updatePaperSourceUrl(t,n){const r=`/papers/${t}/source-url`;return this.curation.mutatePaper(t,"source_url",n,r,{method:"PUT",body:JSON.stringify({source_url:n})})}async updatePaperHfArtifacts(t,n){const r=`/papers/${t}/hf-artifacts`;return this.curation.mutatePaper(t,"hf_artifacts",n,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 getAuthorPapers(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=r.toString();return this.request(`/authors/${t}/papers${o?`?${o}`:""}`)}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"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","true");const o=r.toString(),i=o?`/conferences/${t}/papers?${o}`:`/conferences/${t}/papers`;return this.request(i)}async getOrganizations(t=!1){return this.request(`/organizations/${t?"?featured_only=true":""}`)}async getOrganization(t){return this.request(`/organizations/${t}`)}async getOrganizationContributions(t){return this.request(`/organizations/${t}/contributions`)}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"),n!=null&&n.has_code&&r.append("has_code","true"),n!=null&&n.has_hf_artifacts&&r.append("has_hf_artifacts","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.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 getFrameworkCatalog(){return this.request("/frameworks/")}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());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()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.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?void 0:t.include_trends)!==void 0&&n.append("include_trends",t.include_trends.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 getMethodTrend(t,n){const r=new URLSearchParams;(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.history_months)!==void 0&&r.append("history_months",n.history_months.toString());const o=r.toString();return this.request(`/methods/${encodeURIComponent(t)}/trend${o?`?${o}`:""}`)}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()),(n==null?void 0:n.has_code)!==void 0&&r.append("has_code",n.has_code.toString()),(n==null?void 0:n.has_hf_artifacts)!==void 0&&r.append("has_hf_artifacts",n.has_hf_artifacts.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 a=await this.getEvaluations({paper_id:r,page:s,page_size:100,ordering:"-benchmark_popularity"});i.push(...a.results),s=a.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 a=i.next_page;for(;a;){const l=await this.getEvaluations({dataset_id:o,best_metric:n,page:a,page_size:100,ordering:"best_rank"});s.push(...l.results),a=l.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 batchEvaluations(t,n){return this.curation.mutateEvaluations(t,n,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:t,operations:n})})}async generateThumbnail(t){const n=cr(`/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=cr(`/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=cr("/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 bp.getPreferences()}async updateMyPreferences(t){return bp.updatePreferences(t)}async getOpenRouterUsage(){return this.request("/chat/usage",{cache:"no-store"})}async getChatAvailability(){return this.request("/chat/availability",{cache:"no-store"})}async prewarmChatPaperContext(t){const n=await fetch(cr("/api/v1/chat/paper-context/prewarm"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({route_id:t}),credentials:"omit",cache:"no-store"});if(!n.ok)throw new Error(`Paper context prewarm failed (${n.status})`)}async getChatSandboxSpend(t){const n=t?`?environment=${encodeURIComponent(t)}`:"";return this.request(`/chat/admin/sandbox-spend${n}`,{cache:"no-store"})}async getChatWebSearchBudget(){return this.request("/chat/admin/web-search-budget",{cache:"no-store"})}async getOpenRouterCredential(){return this.request("/chat/openrouter-key",{cache:"no-store"})}async connectOpenRouterCredential(t){return this.request("/chat/openrouter-key",{method:"PUT",body:JSON.stringify({api_key:t})})}async setOpenRouterFallback(t){return this.request("/chat/openrouter-key",{method:"PATCH",body:JSON.stringify({enabled:t})})}async disconnectOpenRouterCredential(){await this.request("/chat/openrouter-key",{method:"DELETE"})}async getCronStatus(){return this.request("/cron/status",{cache:"no-store"})}async getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}async getResearchTrends(){return this.request("/stats/trends")}async getMyContributions(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/contributions${n}`)}async getCatalogAudit(t){const n=t?`?cursor=${encodeURIComponent(t)}`:"";return this.request(`/admin/catalog-audit${n}`)}async acknowledgeCatalogAudit(){await this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}async rollbackCatalogEvent(t){return this.request(`/admin/catalog-audit/${t}/rollback`,{method:"POST"})}}const b=new gN;b.getPapers.bind(b);const SO=b.getPaper.bind(b);b.getPaperByArxivId.bind(b);const EO=b.indexPaperFromArxiv.bind(b),CO=b.submitPaper.bind(b),_O=b.updatePaperTasks.bind(b),bO=b.updatePaperMethods.bind(b),PO=b.updatePaperOrganizations.bind(b),kO=b.updatePaperRepositories.bind(b),TO=b.updatePaperProjectPages.bind(b),RO=b.updatePaperSourceUrl.bind(b),NO=b.updatePaperHfArtifacts.bind(b);b.primePaperCurationState.bind(b);b.primeEvaluationCurationState.bind(b);b.getTrendingPapers.bind(b);b.getRepositoriesForPaper.bind(b);b.getRepositories.bind(b);b.getProjectPagesForPaper.bind(b);b.getProjectPages.bind(b);b.getAuthors.bind(b);b.getAuthor.bind(b);b.getAreas.bind(b);b.getArea.bind(b);b.getAreasWithTasks.bind(b);b.getConferences.bind(b);b.getConferenceDeadlines.bind(b);b.getConference.bind(b);b.getConferenceAreasWithTasks.bind(b);b.getConferencePapers.bind(b);const OO=b.getOrganizations.bind(b);b.getOrganization.bind(b);b.getOrganizationContributions.bind(b);b.getOrganizationAreasWithTasks.bind(b);b.getOrganizationPapers.bind(b);b.getAreaTasks.bind(b);const AO=b.getTasks.bind(b),MO=b.getTask.bind(b);b.getTopTasks.bind(b);b.getTrendingTasks.bind(b);b.getTaskChildren.bind(b);b.getTaskParents.bind(b);b.getTaskPage.bind(b);b.getTaskPapers.bind(b);const jO=b.getMethods.bind(b),LO=b.getMethod.bind(b);b.getMethodPapers.bind(b);const IO=b.getDatasets.bind(b),DO=b.getDataset.bind(b);b.getDatasetBySlug.bind(b);b.getDatasetTasks.bind(b);const $O=b.getLeaderboardMetrics.bind(b);b.getEvaluations.bind(b);b.getEvaluation.bind(b);const FO=b.getEvaluationsByPaper.bind(b);b.getEvaluationsByDataset.bind(b);b.createEvaluation.bind(b);b.updateEvaluation.bind(b);b.deleteEvaluation.bind(b);const zO=b.batchEvaluations.bind(b);b.generateThumbnail.bind(b);b.getThumbnailStatus.bind(b);b.getMetrics.bind(b);b.getMetric.bind(b);b.getMetricDirections.bind(b);b.getResearchTrends.bind(b);b.healthCheck.bind(b);b.getMyBookmarkIds.bind(b);b.getMyBookmarks.bind(b);b.addBookmark.bind(b);b.getMyPreferences.bind(b);b.updateMyPreferences.bind(b);const UO=b.submitPendingPaperEdit.bind(b),BO=b.listPendingPaperEdits.bind(b);b.getPendingPaperEdit.bind(b);const VO=b.approvePendingPaperEdit.bind(b),WO=b.rejectPendingPaperEdit.bind(b);b.removeBookmark.bind(b);const du={hide_closed_source_evals:!1},p0=T.createContext(null),mN=({children:e})=>{const{user:t}=Zd(),[n,r]=T.useState(du),[o,i]=T.useState(!1);T.useEffect(()=>{let l=!1;if(!t){r(du);return}return i(!0),b.getMyPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(du)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[t]);const s=T.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!t)try{const c=await b.updateMyPreferences(u);r(c)}catch{r(n)}},[n,t]),a=T.useMemo(()=>({preferences:n,canPersist:!!t,isLoading:o,setHideClosedSourceEvals:s}),[n,t,o,s]);return g.jsx(p0.Provider,{value:a,children:e})};function HO(){const e=T.useContext(p0);if(!e)throw new Error("usePreferences must be used inside a ");return e}const g0=H1(),vN=g0?u1:l1;if(!g0&&typeof window<"u"){const e=window.location.hash;e.startsWith("#/")&&!e.startsWith("#//")&&window.history.replaceState(null,"",e.slice(1))}const yN=T.lazy(()=>re(()=>import("./FeedView-oz8sxM3L.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),wN=T.lazy(()=>re(()=>import("./ChatView-DscYSLiQ.js"),__vite__mapDeps([17,10,18,8,9,3,4,19,20,21,22,23,24,11,25]))),xN=T.lazy(()=>re(()=>import("./SharedChatView-DKbKiY7e.js"),__vite__mapDeps([26,10,18,8,9,3,4,19,20,21,22,23,24]))),SN=T.lazy(()=>re(()=>import("./PapersListView-DOq44gD8.js"),__vite__mapDeps([27,1,2,3,4,5,6,12,10,13,28,14,7,15,16]))),EN=T.lazy(()=>re(()=>import("./PaperDetailView-DEVQpo7C.js"),__vite__mapDeps([29,10,1,2,3,4,5,6,30,19,31,32,12,13,15,16,33,34,35,36,37,38,39,40,41,20,21,42,23]))),CN=T.lazy(()=>re(()=>import("./TagsIndexView-CiMTi7r2.js"),__vite__mapDeps([43,10,5,15,16,44,38,33,35,36,37,39]))),_N=T.lazy(()=>re(()=>import("./TagBrowseView-M8ve0LOV.js"),__vite__mapDeps([45,10,1,2,3,4,5,6,46,7,47,22,23,19,12,13,15,16,9,21]))),bN=T.lazy(()=>re(()=>import("./MethodsIndexView-CMQ_zbFE.js"),__vite__mapDeps([48,10,49,15,16,44,38,33,35,36,37,39]))),PN=T.lazy(()=>re(()=>import("./FrameworksIndexView-C476TwCA.js"),__vite__mapDeps([50,10,1,2,3,4,5,6]))),kN=T.lazy(()=>re(()=>import("./TrendsView-BlGLrFvK.js"),__vite__mapDeps([51,10,16,15]))),TN=T.lazy(()=>re(()=>import("./ConferencesIndexView-VmZKLP09.js"),__vite__mapDeps([52,10,15,16,44,38,33,35,36,37,39]))),RN=T.lazy(()=>re(()=>import("./AiDeadlinesView-CRbaeNb8.js"),__vite__mapDeps([53,10,54,34,15,16,6,36]))),NN=T.lazy(()=>re(()=>import("./ConferenceDetailView-B9R293-r.js"),__vite__mapDeps([55,10,47,3,4,22,23,19,5,15,16,6]))),ON=T.lazy(()=>re(()=>import("./ConferenceTaskView-tg9N-zJJ.js"),__vite__mapDeps([56,10,1,2,3,4,5,6,7,47,22,23,19,12,13,15,16]))),AN=T.lazy(()=>re(()=>import("./OrganizationsIndexView-DH89Eu3h.js"),__vite__mapDeps([57,10,16,15,58]))),MN=T.lazy(()=>re(()=>import("./OrganizationDetailView-COwL-Neo.js"),__vite__mapDeps([59,60,10,1,2,3,4,5,6,47,22,23,19,61,15,7,16,40,33,36,39,12,13,62]))),jN=T.lazy(()=>re(()=>import("./OrganizationTaskView-JO8z_y24.js"),__vite__mapDeps([63,60,10,1,2,3,4,5,6,47,22,23,19,61,15,7,16,40,33,36,39,12,13,62]))),LN=T.lazy(()=>re(()=>import("./AuthorDetailView-DWrMqjuC.js"),__vite__mapDeps([64,10,15,62]))),IN=T.lazy(()=>re(()=>import("./MethodDetailView-D8nv95w4.js"),__vite__mapDeps([65,10,13,1,2,3,4,5,6,7,47,22,23,19,49,15,16]))),DN=T.lazy(()=>re(()=>import("./BenchmarkDetailView-BWArUzbc.js"),__vite__mapDeps([66,10,15,54,34,16,2,3,4,30,19,6,31,46,1,5,67]))),$N=T.lazy(()=>re(()=>import("./SavedPapersView-t8CX70vO.js"),__vite__mapDeps([68,10,1,2,3,4,5,6,15,16,42]))),FN=T.lazy(()=>re(()=>import("./SettingsView-BDObDhiz.js"),__vite__mapDeps([69,37,54,34,32,25,10,70]))),zN=T.lazy(()=>re(()=>import("./PrivacyView-DAhZCWuE.js"),__vite__mapDeps([71,32]))),UN=T.lazy(()=>re(()=>import("./SubmitView-Dmd8F124.js"),__vite__mapDeps([72,37,16,33,35]))),BN=T.lazy(()=>re(()=>import("./CronDashboard-DFeDiILJ.js"),__vite__mapDeps([73,10,41,33,9,24,74,39,75,70,37,13,76]))),VN=T.lazy(()=>re(()=>import("./SubmissionsDashboard-CnW0soci.js"),__vite__mapDeps([77,10,37,6,74,39,75]))),WN=T.lazy(()=>re(()=>import("./UserProfileView-CR04MORR.js"),__vite__mapDeps([78,10,61,15]))),HN=T.lazy(()=>re(()=>import("./RateLimitsView-BLLHWPbs.js"),__vite__mapDeps([79,10]))),Pp=T.lazy(()=>re(()=>import("./NotFound-DLV3c5vS.js"),[])),qN=T.lazy(()=>re(()=>import("./SearchOverlay-DEmyxI4z.js"),__vite__mapDeps([80,10,2,3,4,28,5]))),KN=T.lazy(()=>re(()=>import("./StagingAccessRequestView-DQ08h6Ei.js"),__vite__mapDeps([81,75]))),kp=()=>g.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),g.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),g.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),GN=new B1({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),QN=()=>{const{arxivId:e}=av();return g.jsx(ko,{to:e?`/paper/${e}`:"/papers",replace:!0})},YN=()=>{const{taskSlug:e}=av();return g.jsx(ko,{to:e?`/tasks/${e}`:"/tasks",replace:!0})},Tp=({element:e})=>qi()?g.jsx(ko,{to:"/",replace:!0}):g.jsx(g.Fragment,{children:e}),XN=({element:e})=>{const{user:t,isLoading:n}=Zd();return qi()?g.jsx(ko,{to:"/",replace:!0}):n?g.jsx("div",{className:"page",children:g.jsx("div",{className:"submission-loading",children:g.jsx("span",{children:"Checking admin session..."})})}):t?t.is_admin?g.jsx(g.Fragment,{children:e}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Admin access required"}),g.jsxs("p",{children:["Signed in as @",t.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-empty submission-empty-warn",children:[g.jsx("h1",{children:"Sign in required"}),g.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),g.jsx(_v,{returnTo:"/admin-dashboard"})]})})},JN=()=>{const e=W1(),t=typeof window<"u"&&new URL(e,window.location.origin).origin!==window.location.origin;return T.useEffect(()=>{t&&window.location.replace(e)},[e,t]),t?g.jsx("div",{className:"page",children:g.jsxs("div",{className:"submission-loading",children:[g.jsx("span",{children:"Opening the production admin dashboard..."}),g.jsx("a",{href:e,children:"Continue"})]})}):g.jsx(XN,{element:g.jsx(BN,{})})},ZN=()=>{const[e,t]=T.useState(!1),n=Mt();return iN(),T.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),T.useEffect(()=>{const r=o=>{(o.metaKey||o.ctrlKey)&&o.key==="k"&&(o.preventDefault(),t(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?g.jsx(T.Suspense,{fallback:g.jsx(kp,{}),children:g.jsx(KN,{})}):g.jsxs(g.Fragment,{children:[g.jsx(NT,{onOpenSearch:()=>t(!0)}),g.jsx("main",{children:g.jsx(T.Suspense,{fallback:g.jsx(kp,{}),children:g.jsxs(ZE,{children:[g.jsx(te,{path:"/",element:g.jsx(yN,{})}),g.jsx(te,{path:"/chat/:sessionId?",element:Sa()?g.jsx(wN,{}):g.jsx(ko,{to:"/",replace:!0})}),g.jsx(te,{path:"/share/:shareId",element:Sa()?g.jsx(xN,{}):g.jsx(Pp,{})}),g.jsx(te,{path:"/papers",element:g.jsx(SN,{})}),g.jsx(te,{path:"/papers/:arxivId",element:g.jsx(QN,{})}),g.jsx(te,{path:"/paper/:arxivId",element:g.jsx(EN,{})}),g.jsx(te,{path:"/tasks",element:g.jsx(CN,{})}),g.jsx(te,{path:"/tasks/:taskSlug",element:g.jsx(_N,{})}),g.jsx(te,{path:"/task/:taskSlug",element:g.jsx(YN,{})}),g.jsx(te,{path:"/methods",element:g.jsx(bN,{})}),g.jsx(te,{path:"/methods/:methodSlug",element:g.jsx(IN,{})}),g.jsx(te,{path:"/frameworks",element:g.jsx(PN,{})}),g.jsx(te,{path:"/trends",element:g.jsx(kN,{})}),g.jsx(te,{path:"/conferences",element:g.jsx(TN,{})}),g.jsx(te,{path:"/ai-deadlines",element:g.jsx(RN,{})}),g.jsx(te,{path:"/conferences/:confSlug",element:g.jsx(NN,{})}),g.jsx(te,{path:"/conferences/:confSlug/:taskSlug",element:g.jsx(ON,{})}),g.jsx(te,{path:"/organizations",element:g.jsx(AN,{})}),g.jsx(te,{path:"/orgs/:orgSlug",element:g.jsx(MN,{})}),g.jsx(te,{path:"/orgs/:orgSlug/:taskSlug",element:g.jsx(jN,{})}),g.jsx(te,{path:"/authors/:authorId",element:g.jsx(LN,{})}),g.jsx(te,{path:"/benchmark/:datasetSlug",element:g.jsx(DN,{})}),g.jsx(te,{path:"/submit",element:g.jsx(UN,{})}),g.jsx(te,{path:"/saved",element:g.jsx(Tp,{element:g.jsx($N,{})})}),g.jsx(te,{path:"/settings",element:g.jsx(FN,{})}),g.jsx(te,{path:"/privacy",element:g.jsx(zN,{})}),g.jsx(te,{path:"/admin-dashboard",element:g.jsx(JN,{})}),g.jsx(te,{path:"/cron-dashboard",element:g.jsx(ko,{to:"/admin-dashboard",replace:!0})}),g.jsx(te,{path:"/submissions",element:g.jsx(Tp,{element:g.jsx(VN,{})})}),g.jsx(te,{path:"/rate-limits",element:g.jsx(HN,{})}),g.jsx(te,{path:"/:username",element:g.jsx(WN,{})}),g.jsx(te,{path:"*",element:g.jsx(Pp,{})})]})})}),g.jsx(OT,{}),e&&g.jsx(T.Suspense,{fallback:null,children:g.jsx(qN,{open:e,onClose:()=>t(!1)})})]})},eO=()=>g.jsx(V1,{client:GN,children:g.jsx(PT,{children:g.jsx(mN,{children:g.jsxs(rN,{children:[g.jsx(vN,{children:g.jsx(ZN,{})}),g.jsx(uR,{}),g.jsx(DR,{}),!1]})})})});uE();const tO=Jm(document.getElementById("root"));tO.render(g.jsx(T.StrictMode,{children:g.jsx(nE,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:g.jsx(aE,{children:g.jsx(eO,{})})})}));export{vT as $,Ra as A,jO as B,hT as C,kO as D,TO as E,RO as F,IO as G,zO as H,$O as I,NO as J,PO as K,Zt as L,OO as M,qi as N,Gv as O,Nr as P,aP as Q,T as R,lP as S,by as T,gT as U,Ja as V,xO as W,mT as X,lR as Y,pO as Z,HO as _,oO as a,yT as a0,Mw as a1,Dt as a2,dO as a3,gO as a4,EO as a5,gc as a6,vt as a7,Id as a8,Pv as a9,iO as aA,gv as aB,_t as aC,MO as aD,LO as aE,DO as aF,Hv as aG,qv as aH,Kv as aI,VO as aJ,WO as aK,BO as aL,Ai as aM,F1 as aN,aO,ko as aP,Mt as aQ,N1 as aR,C1 as aS,uc as aT,vv as aU,S1 as aV,E1 as aW,lc as aX,pv as aY,D1 as aZ,P1 as a_,iR as aa,_v as ab,Tr as ac,qb as ad,Sy as ae,ol as af,Hd as ag,yP as ah,$y as ai,C_ as aj,Jv as ak,Za as al,Ey as am,Cy as an,mO as ao,sO as ap,SO as aq,rO as ar,$p as as,tE as at,CO as au,uO as av,lO as aw,hO as ax,Xa as ay,Ue as az,fO as b,b as c,ul as d,cr as e,av as f,Zd as g,DT as h,Sa as i,g as j,cO as k,K1 as l,FO as m,ve as n,jd as o,Re as p,V as q,f as r,Fb as s,Rr as t,kd as u,Ne as v,UO as w,_O as x,AO as y,bO as z}; diff --git a/assets/index-BGBxtSYH.js b/assets/index-DzH9562Y.js similarity index 72% rename from assets/index-BGBxtSYH.js rename to assets/index-DzH9562Y.js index 6ae91cf03dfa8249c754f3befc50709580f5efc0..b556a9438d3261c215021c0ff6770a79c8eacccc 100644 --- a/assets/index-BGBxtSYH.js +++ b/assets/index-DzH9562Y.js @@ -1 +1 @@ -import{r as u}from"./index-D9_nPZtO.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}; +import{r as u}from"./index-Czt286FG.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/loader-circle-CrVj12oC.js b/assets/loader-circle-DyZRZBrM.js similarity index 85% rename from assets/loader-circle-CrVj12oC.js rename to assets/loader-circle-DyZRZBrM.js index 34d9fe07a8a5f0756658b6069c1873e6da7f7fc8..12dd0f8d1632f5250d5324b6c3c4ad0d395f3eab 100644 --- a/assets/loader-circle-CrVj12oC.js +++ b/assets/loader-circle-DyZRZBrM.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-D9_nPZtO.js";/** +import{d as e}from"./index-Czt286FG.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-D8ilQuCd.js b/assets/openrouter-D-TuExng.js similarity index 83% rename from assets/openrouter-D8ilQuCd.js rename to assets/openrouter-D-TuExng.js index 92b7edee2873c3f708a0c7717a7b411d9ed48393..9747d20b22679ae1ace8d7be93a9910e5b3decc0 100644 --- a/assets/openrouter-D8ilQuCd.js +++ b/assets/openrouter-D-TuExng.js @@ -1 +1 @@ -import{u as r}from"./useQuery-cycUreG-.js";import{c as n}from"./index-D9_nPZtO.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getOpenRouterUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{u as O,c as a,o as b,m as r,s as u}; +import{u as r}from"./useQuery-DLzEukS9.js";import{c as n}from"./index-Czt286FG.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getOpenRouterUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{u as O,c as a,o as b,m as r,s as u}; diff --git a/assets/savedPapersAuth-DSXf00GL.js b/assets/savedPapersAuth-CPfYg_9a.js similarity index 85% rename from assets/savedPapersAuth-DSXf00GL.js rename to assets/savedPapersAuth-CPfYg_9a.js index 361a23980a06cbb25a9d96b123d796b4c32202a7..edd934482f9128d6a7d5f02fe6a052ccc2822266 100644 --- a/assets/savedPapersAuth-DSXf00GL.js +++ b/assets/savedPapersAuth-CPfYg_9a.js @@ -1 +1 @@ -import{V as i}from"./index-D9_nPZtO.js";const s="saved_papers_authorized";function u(n=!1){const r=i("/api/v1/auth/hf/login"),o=new URL(r,window.location.origin).origin,t=new URL(window.location.href);n&&t.searchParams.set(s,"1");const a=o===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString(),e=new URLSearchParams({return_to:a,authorize_bucket:"true",bucket_create:"true"});return`${r}?${e.toString()}`}export{s as S,u as s}; +import{D as i}from"./index-Czt286FG.js";const s="saved_papers_authorized";function u(n=!1){const r=i("/api/v1/auth/hf/login"),o=new URL(r,window.location.origin).origin,t=new URL(window.location.href);n&&t.searchParams.set(s,"1");const a=o===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString(),e=new URLSearchParams({return_to:a,authorize_bucket:"true",bucket_create:"true"});return`${r}?${e.toString()}`}export{s as S,u as s}; diff --git a/assets/searchable-select-Css_GGu3.js b/assets/searchable-select-D6ZufK5P.js similarity index 81% rename from assets/searchable-select-Css_GGu3.js rename to assets/searchable-select-D6ZufK5P.js index 0dceff7b4385be75594effef803e7ff1d4e4f40f..eb74fc2d6e0d39ec74249ff9031bb82dd90dabcc 100644 --- a/assets/searchable-select-Css_GGu3.js +++ b/assets/searchable-select-D6ZufK5P.js @@ -1,4 +1,4 @@ -import{d as we,r as n,j as f,ac as B,o as Ye,ad as et,a6 as $,p as Re,n as A,q as G,ae as Ee,af as Pe,P as Se,ag as tt,t as rt,ah as nt,ai as ot,aj as at,ak as lt,al as st,am as it,an as ct,v as M,C as ut}from"./index-D9_nPZtO.js";import{u as dt}from"./useQuery-cycUreG-.js";import{B as ft}from"./button-B859643f.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-DnjY6ZOM.js";import{L as gt}from"./loader-circle-CrVj12oC.js";/** +import{d as we,r as n,j as f,Y as B,n as Xe,Z as et,O as $,o as Re,m as A,q as G,_ as Ee,$ as Pe,P as Se,a0 as tt,t as rt,a1 as nt,a2 as ot,a3 as at,a4 as lt,a5 as st,a6 as it,a7 as ct,v as O,C as ut}from"./index-Czt286FG.js";import{u as dt}from"./useQuery-DLzEukS9.js";import{B as ft}from"./button-vhqVRnBn.js";import{R as pt,P as mt,O as vt,C as ht}from"./dialog-CJthLFv3.js";import{L as gt}from"./loader-circle-DyZRZBrM.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -8,4 +8,4 @@ import{d as we,r as n,j as f,ac as B,o as Ye,ad as et,a6 as $,p as Re,n as A,q a * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bt=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);function yt(e){const r=Ct(e),t=n.forwardRef((s,o)=>{const{children:l,...i}=s,c=n.Children.toArray(l),v=c.find(Rt);if(v){const u=v.props.children,h=c.map(g=>g===v?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:g);return f.jsx(r,{...i,ref:o,children:n.isValidElement(u)?n.cloneElement(u,void 0,h):null})}return f.jsx(r,{...i,ref:o,children:l})});return t.displayName=`${e}.Slot`,t}function Ct(e){const r=n.forwardRef((t,s)=>{const{children:o,...l}=t;if(n.isValidElement(o)){const i=Pt(o),c=Et(l,o.props);return o.type!==n.Fragment&&(c.ref=s?B(s,i):i),n.cloneElement(o,c)}return n.Children.count(o)>1?n.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var wt=Symbol("radix.slottable");function Rt(e){return n.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wt}function Et(e,r){const t={...r};for(const s in r){const o=e[s],l=r[s];/^on[A-Z]/.test(s)?o&&l?t[s]=(...c)=>{const v=l(...c);return o(...c),v}:o&&(t[s]=o):s==="style"?t[s]={...o,...l}:s==="className"&&(t[s]=[o,l].filter(Boolean).join(" "))}return{...e,...t}}function Pt(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var X="Popover",[ke]=rt(X,[Pe]),U=Pe(),[St,D]=ke(X),je=e=>{const{__scopePopover:r,children:t,open:s,defaultOpen:o,onOpenChange:l,modal:i=!1}=e,c=U(r),v=n.useRef(null),[u,h]=n.useState(!1),[g,y]=Ye({prop:s,defaultProp:o??!1,onChange:l,caller:X});return f.jsx(et,{...c,children:f.jsx(St,{scope:r,contentId:$(),triggerRef:v,open:g,onOpenChange:y,onOpenToggle:n.useCallback(()=>y(w=>!w),[y]),hasCustomAnchor:u,onCustomAnchorAdd:n.useCallback(()=>h(!0),[]),onCustomAnchorRemove:n.useCallback(()=>h(!1),[]),modal:i,children:t})})};je.displayName=X;var Ne="PopoverAnchor",kt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ne,t),l=U(t),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=o;return n.useEffect(()=>(i(),()=>c()),[i,c]),f.jsx(Ee,{...l,...s,ref:r})});kt.displayName=Ne;var Ae="PopoverTrigger",Ie=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ae,t),l=U(t),i=Re(r,o.triggerRef),c=f.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Fe(o.open),...s,ref:i,onClick:G(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:f.jsx(Ee,{asChild:!0,...l,children:c})});Ie.displayName=Ae;var de="PopoverPortal",[jt,Nt]=ke(de,{forceMount:void 0}),Me=e=>{const{__scopePopover:r,forceMount:t,children:s,container:o}=e,l=D(de,r);return f.jsx(jt,{scope:r,forceMount:t,children:f.jsx(Se,{present:t||l.open,children:f.jsx(tt,{asChild:!0,container:o,children:s})})})};Me.displayName=de;var W="PopoverContent",Oe=n.forwardRef((e,r)=>{const t=Nt(W,e.__scopePopover),{forceMount:s=t.forceMount,...o}=e,l=D(W,e.__scopePopover);return f.jsx(Se,{present:s||l.open,children:l.modal?f.jsx(It,{...o,ref:r}):f.jsx(Mt,{...o,ref:r})})});Oe.displayName=W;var At=yt("PopoverContent.RemoveScroll"),It=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(null),o=Re(r,s),l=n.useRef(!1);return n.useEffect(()=>{const i=s.current;if(i)return nt(i)},[]),f.jsx(ot,{as:At,allowPinchZoom:!0,children:f.jsx(_e,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),l.current||(c=t.triggerRef.current)==null||c.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,v=c.button===0&&c.ctrlKey===!0,u=c.button===2||v;l.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Mt=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(!1),o=n.useRef(!1);return f.jsx(_e,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(s.current||(c=t.triggerRef.current)==null||c.focus(),l.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:l=>{var v,u;(v=e.onInteractOutside)==null||v.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=l.target;((u=t.triggerRef.current)==null?void 0:u.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),_e=n.forwardRef((e,r)=>{const{__scopePopover:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onInteractOutside:h,...g}=e,y=D(W,t),w=U(t);return at(),f.jsx(lt,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(st,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onDismiss:()=>y.onOpenChange(!1),children:f.jsx(it,{"data-state":Fe(y.open),role:"dialog",id:y.contentId,...w,...g,ref:r,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),De="PopoverClose",Ot=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(De,t);return f.jsx(A.button,{type:"button",...s,ref:r,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});Ot.displayName=De;var _t="PopoverArrow",Dt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=U(t);return f.jsx(ct,{...o,...s,ref:r})});Dt.displayName=_t;function Fe(e){return e?"open":"closed"}var Ft=je,$t=Ie,Lt=Me,$e=Oe;const Tt=Ft,Vt=$t,Le=n.forwardRef(({className:e,align:r="center",sideOffset:t=4,...s},o)=>f.jsx(Lt,{children:f.jsx($e,{ref:o,align:r,sideOffset:t,className:M("z-50 w-72 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})}));Le.displayName=$e.displayName;var be=1,qt=.9,Kt=.8,Bt=.17,le=.1,se=.999,Wt=.9999,Ht=.99,zt=/[\\\/_+.#"@\[\(\{&]/,Gt=/[\\\/_+.#"@\[\(\{&]/g,Ut=/[\s-]/,Te=/[\s-]/g;function ce(e,r,t,s,o,l,i){if(l===r.length)return o===e.length?be:Ht;var c=`${o},${l}`;if(i[c]!==void 0)return i[c];for(var v=s.charAt(l),u=t.indexOf(v,o),h=0,g,y,w,k;u>=0;)g=ce(e,r,t,s,u+1,l+1,i),g>h&&(u===o?g*=be:zt.test(e.charAt(u-1))?(g*=Kt,w=e.slice(o,u-1).match(Gt),w&&o>0&&(g*=Math.pow(se,w.length))):Ut.test(e.charAt(u-1))?(g*=qt,k=e.slice(o,u-1).match(Te),k&&o>0&&(g*=Math.pow(se,k.length))):(g*=Bt,o>0&&(g*=Math.pow(se,u-o))),e.charAt(u)!==r.charAt(l)&&(g*=Wt)),(gg&&(g=y*le)),g>h&&(h=g),u=t.indexOf(v,u+1);return i[c]=h,h}function ye(e){return e.toLowerCase().replace(Te," ")}function Qt(e,r,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,ce(e,r,ye(e),ye(r),0,0,{})}var z='[cmdk-group=""]',ie='[cmdk-group-items=""]',Zt='[cmdk-group-heading=""]',Ve='[cmdk-item=""]',Ce=`${Ve}:not([aria-disabled="true"])`,ue="cmdk-item-select",q="data-value",Jt=(e,r,t)=>Qt(e,r,t),qe=n.createContext(void 0),Q=()=>n.useContext(qe),Ke=n.createContext(void 0),fe=()=>n.useContext(Ke),Be=n.createContext(void 0),We=n.forwardRef((e,r)=>{let t=K(()=>{var a,p;return{search:"",value:(p=(a=e.value)!=null?a:e.defaultValue)!=null?p:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=K(()=>new Set),o=K(()=>new Map),l=K(()=>new Map),i=K(()=>new Set),c=He(e),{label:v,children:u,value:h,onValueChange:g,filter:y,shouldFilter:w,loop:k,disablePointerSelection:T=!1,vimBindings:j=!0,...F}=e,N=$(),Z=$(),O=$(),I=n.useRef(null),m=ir();L(()=>{if(h!==void 0){let a=h.trim();t.current.value=a,R.emit()}},[h]),L(()=>{m(6,me)},[]);let R=n.useMemo(()=>({subscribe:a=>(i.current.add(a),()=>i.current.delete(a)),snapshot:()=>t.current,setState:(a,p,x)=>{var d,b,C,S;if(!Object.is(t.current[a],p)){if(t.current[a]=p,a==="search")ne(),te(),m(1,re);else if(a==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let E=document.getElementById(O);E?E.focus():(d=document.getElementById(N))==null||d.focus()}if(m(7,()=>{var E;t.current.selectedItemId=(E=V())==null?void 0:E.id,R.emit()}),x||m(5,me),((b=c.current)==null?void 0:b.value)!==void 0){let E=p??"";(S=(C=c.current).onValueChange)==null||S.call(C,E);return}}R.emit()}},emit:()=>{i.current.forEach(a=>a())}}),[]),ee=n.useMemo(()=>({value:(a,p,x)=>{var d;p!==((d=l.current.get(a))==null?void 0:d.value)&&(l.current.set(a,{value:p,keywords:x}),t.current.filtered.items.set(a,pe(p,x)),m(2,()=>{te(),R.emit()}))},item:(a,p)=>(s.current.add(a),p&&(o.current.has(p)?o.current.get(p).add(a):o.current.set(p,new Set([a]))),m(3,()=>{ne(),te(),t.current.value||re(),R.emit()}),()=>{l.current.delete(a),s.current.delete(a),t.current.filtered.items.delete(a);let x=V();m(4,()=>{ne(),(x==null?void 0:x.getAttribute("id"))===a&&re(),R.emit()})}),group:a=>(o.current.has(a)||o.current.set(a,new Set),()=>{l.current.delete(a),o.current.delete(a)}),filter:()=>c.current.shouldFilter,label:v||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:O,labelId:Z,listInnerRef:I}),[]);function pe(a,p){var x,d;let b=(d=(x=c.current)==null?void 0:x.filter)!=null?d:Jt;return a?b(a,t.current.search,p):0}function te(){if(!t.current.search||c.current.shouldFilter===!1)return;let a=t.current.filtered.items,p=[];t.current.filtered.groups.forEach(d=>{let b=o.current.get(d),C=0;b.forEach(S=>{let E=a.get(S);C=Math.max(E,C)}),p.push([d,C])});let x=I.current;H().sort((d,b)=>{var C,S;let E=d.getAttribute("id"),J=b.getAttribute("id");return((C=a.get(J))!=null?C:0)-((S=a.get(E))!=null?S:0)}).forEach(d=>{let b=d.closest(ie);b?b.appendChild(d.parentElement===b?d:d.closest(`${ie} > *`)):x.appendChild(d.parentElement===x?d:d.closest(`${ie} > *`))}),p.sort((d,b)=>b[1]-d[1]).forEach(d=>{var b;let C=(b=I.current)==null?void 0:b.querySelector(`${z}[${q}="${encodeURIComponent(d[0])}"]`);C==null||C.parentElement.appendChild(C)})}function re(){let a=H().find(x=>x.getAttribute("aria-disabled")!=="true"),p=a==null?void 0:a.getAttribute(q);R.setState("value",p||void 0)}function ne(){var a,p,x,d;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=s.current.size;return}t.current.filtered.groups=new Set;let b=0;for(let C of s.current){let S=(p=(a=l.current.get(C))==null?void 0:a.value)!=null?p:"",E=(d=(x=l.current.get(C))==null?void 0:x.keywords)!=null?d:[],J=pe(S,E);t.current.filtered.items.set(C,J),J>0&&b++}for(let[C,S]of o.current)for(let E of S)if(t.current.filtered.items.get(E)>0){t.current.filtered.groups.add(C);break}t.current.filtered.count=b}function me(){var a,p,x;let d=V();d&&(((a=d.parentElement)==null?void 0:a.firstChild)===d&&((x=(p=d.closest(z))==null?void 0:p.querySelector(Zt))==null||x.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function V(){var a;return(a=I.current)==null?void 0:a.querySelector(`${Ve}[aria-selected="true"]`)}function H(){var a;return Array.from(((a=I.current)==null?void 0:a.querySelectorAll(Ce))||[])}function oe(a){let p=H()[a];p&&R.setState("value",p.getAttribute(q))}function ae(a){var p;let x=V(),d=H(),b=d.findIndex(S=>S===x),C=d[b+a];(p=c.current)!=null&&p.loop&&(C=b+a<0?d[d.length-1]:b+a===d.length?d[0]:d[b+a]),C&&R.setState("value",C.getAttribute(q))}function ve(a){let p=V(),x=p==null?void 0:p.closest(z),d;for(;x&&!d;)x=a>0?lr(x,z):sr(x,z),d=x==null?void 0:x.querySelector(Ce);d?R.setState("value",d.getAttribute(q)):ae(a)}let he=()=>oe(H().length-1),ge=a=>{a.preventDefault(),a.metaKey?he():a.altKey?ve(1):ae(1)},xe=a=>{a.preventDefault(),a.metaKey?oe(0):a.altKey?ve(-1):ae(-1)};return n.createElement(A.div,{ref:r,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:a=>{var p;(p=F.onKeyDown)==null||p.call(F,a);let x=a.nativeEvent.isComposing||a.keyCode===229;if(!(a.defaultPrevented||x))switch(a.key){case"n":case"j":{j&&a.ctrlKey&&ge(a);break}case"ArrowDown":{ge(a);break}case"p":case"k":{j&&a.ctrlKey&&xe(a);break}case"ArrowUp":{xe(a);break}case"Home":{a.preventDefault(),oe(0);break}case"End":{a.preventDefault(),he();break}case"Enter":{a.preventDefault();let d=V();if(d){let b=new Event(ue);d.dispatchEvent(b)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:ee.inputId,id:ee.labelId,style:ur},v),Y(e,a=>n.createElement(Ke.Provider,{value:R},n.createElement(qe.Provider,{value:ee},a))))}),Xt=n.forwardRef((e,r)=>{var t,s;let o=$(),l=n.useRef(null),i=n.useContext(Be),c=Q(),v=He(e),u=(s=(t=v.current)==null?void 0:t.forceMount)!=null?s:i==null?void 0:i.forceMount;L(()=>{if(!u)return c.item(o,i==null?void 0:i.id)},[u]);let h=ze(o,l,[e.value,e.children,l],e.keywords),g=fe(),y=_(m=>m.value&&m.value===h.current),w=_(m=>u||c.filter()===!1?!0:m.search?m.filtered.items.get(o)>0:!0);n.useEffect(()=>{let m=l.current;if(!(!m||e.disabled))return m.addEventListener(ue,k),()=>m.removeEventListener(ue,k)},[w,e.onSelect,e.disabled]);function k(){var m,R;T(),(R=(m=v.current).onSelect)==null||R.call(m,h.current)}function T(){g.setState("value",h.current,!0)}if(!w)return null;let{disabled:j,value:F,onSelect:N,forceMount:Z,keywords:O,...I}=e;return n.createElement(A.div,{ref:B(l,r),...I,id:o,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!y,"data-disabled":!!j,"data-selected":!!y,onPointerMove:j||c.getDisablePointerSelection()?void 0:T,onClick:j?void 0:k},e.children)}),Yt=n.forwardRef((e,r)=>{let{heading:t,children:s,forceMount:o,...l}=e,i=$(),c=n.useRef(null),v=n.useRef(null),u=$(),h=Q(),g=_(w=>o||h.filter()===!1?!0:w.search?w.filtered.groups.has(i):!0);L(()=>h.group(i),[]),ze(i,c,[e.value,e.heading,v]);let y=n.useMemo(()=>({id:i,forceMount:o}),[o]);return n.createElement(A.div,{ref:B(c,r),...l,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&n.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:u},t),Y(e,w=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?u:void 0},n.createElement(Be.Provider,{value:y},w))))}),er=n.forwardRef((e,r)=>{let{alwaysRender:t,...s}=e,o=n.useRef(null),l=_(i=>!i.search);return!t&&!l?null:n.createElement(A.div,{ref:B(o,r),...s,"cmdk-separator":"",role:"separator"})}),tr=n.forwardRef((e,r)=>{let{onValueChange:t,...s}=e,o=e.value!=null,l=fe(),i=_(u=>u.search),c=_(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),n.createElement(A.input,{ref:r,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":c,id:v.inputId,type:"text",value:o?e.value:i,onChange:u=>{o||l.setState("search",u.target.value),t==null||t(u.target.value)}})}),rr=n.forwardRef((e,r)=>{let{children:t,label:s="Suggestions",...o}=e,l=n.useRef(null),i=n.useRef(null),c=_(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{if(i.current&&l.current){let u=i.current,h=l.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=u.offsetHeight;h.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return y.observe(u),()=>{cancelAnimationFrame(g),y.unobserve(u)}}},[]),n.createElement(A.div,{ref:B(l,r),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":s,id:v.listId},Y(e,u=>n.createElement("div",{ref:B(i,v.listInnerRef),"cmdk-list-sizer":""},u)))}),nr=n.forwardRef((e,r)=>{let{open:t,onOpenChange:s,overlayClassName:o,contentClassName:l,container:i,...c}=e;return n.createElement(pt,{open:t,onOpenChange:s},n.createElement(mt,{container:i},n.createElement(vt,{"cmdk-overlay":"",className:o}),n.createElement(ht,{"aria-label":e.label,"cmdk-dialog":"",className:l},n.createElement(We,{ref:r,...c}))))}),or=n.forwardRef((e,r)=>_(t=>t.filtered.count===0)?n.createElement(A.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),ar=n.forwardRef((e,r)=>{let{progress:t,children:s,label:o="Loading...",...l}=e;return n.createElement(A.div,{ref:r,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Y(e,i=>n.createElement("div",{"aria-hidden":!0},i)))}),P=Object.assign(We,{List:rr,Item:Xt,Input:tr,Group:Yt,Separator:er,Dialog:nr,Empty:or,Loading:ar});function lr(e,r){let t=e.nextElementSibling;for(;t;){if(t.matches(r))return t;t=t.nextElementSibling}}function sr(e,r){let t=e.previousElementSibling;for(;t;){if(t.matches(r))return t;t=t.previousElementSibling}}function He(e){let r=n.useRef(e);return L(()=>{r.current=e}),r}var L=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(e){let r=n.useRef();return r.current===void 0&&(r.current=e()),r}function _(e){let r=fe(),t=()=>e(r.snapshot());return n.useSyncExternalStore(r.subscribe,t,t)}function ze(e,r,t,s=[]){let o=n.useRef(),l=Q();return L(()=>{var i;let c=(()=>{var u;for(let h of t){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():o.current}})(),v=s.map(u=>u.trim());l.value(e,c,v),(i=r.current)==null||i.setAttribute(q,c),o.current=c}),o}var ir=()=>{let[e,r]=n.useState(),t=K(()=>new Map);return L(()=>{t.current.forEach(s=>s()),t.current=new Map},[e]),(s,o)=>{t.current.set(s,o),r({})}};function cr(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function Y({asChild:e,children:r},t){return e&&n.isValidElement(r)?n.cloneElement(cr(r),{ref:r.ref},t(r.props.children)):t(r)}var ur={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ge=n.forwardRef(({className:e,...r},t)=>f.jsx(P,{ref:t,className:M("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));Ge.displayName=P.displayName;const Ue=n.forwardRef(({className:e,...r},t)=>f.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[f.jsx(bt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f.jsx(P.Input,{ref:t,className:M("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));Ue.displayName=P.Input.displayName;const Qe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.List,{ref:t,className:M("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));Qe.displayName=P.List.displayName;const Ze=n.forwardRef((e,r)=>f.jsx(P.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));Ze.displayName=P.Empty.displayName;const Je=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Group,{ref:t,className:M("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));Je.displayName=P.Group.displayName;const dr=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Separator,{ref:t,className:M("-mx-1 h-px bg-border",e),...r}));dr.displayName=P.Separator.displayName;const Xe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Item,{ref:t,className:M("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...r}));Xe.displayName=P.Item.displayName;const fr=250;function xr({value:e,onChange:r,placeholder:t="Select...",searchPlaceholder:s="Search...",emptyMessage:o="No results found.",disabled:l=!1,selectedOption:i,queryKey:c,queryFn:v,enabled:u=!0,className:h,ariaLabel:g}){const[y,w]=n.useState(!1),[k,T]=n.useState(""),[j,F]=n.useState("");n.useEffect(()=>{const m=window.setTimeout(()=>{F(k.trim())},fr);return()=>window.clearTimeout(m)},[k]),n.useEffect(()=>{y||(T(""),F(""))},[y]);const{data:N=[],isFetching:Z}=dt({queryKey:[...c,j],queryFn:()=>v(j),enabled:u&&y}),O=n.useMemo(()=>!e||N.some(m=>m.value===e)?N:(i==null?void 0:i.value)===e?[i,...N]:N,[N,i,e]),I=n.useMemo(()=>{if(!e)return t;const m=O.find(R=>R.value===e)??((i==null?void 0:i.value)===e?i:null);return(m==null?void 0:m.label)??t},[O,t,i,e]);return f.jsxs(Tt,{open:y,onOpenChange:w,modal:!0,children:[f.jsx(Vt,{asChild:!0,children:f.jsxs(ft,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,"aria-label":g,disabled:l,className:M("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",h),children:[f.jsx("span",{className:"truncate",children:I}),f.jsx(xt,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),f.jsx(Le,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:m=>m.stopPropagation(),children:f.jsxs(Ge,{shouldFilter:!1,className:"h-full",children:[f.jsx(Ue,{placeholder:s,value:k,onValueChange:T}),f.jsx(Qe,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:Z?f.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[f.jsx(gt,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):O.length===0?f.jsx(Ze,{children:o}):f.jsx(Je,{children:O.map(m=>f.jsxs(Xe,{value:m.value,onSelect:()=>{r(m.value),w(!1)},children:[f.jsx(ut,{className:M("mr-2 h-4 w-4",e===m.value?"opacity-100":"opacity-0")}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate",children:m.label}),m.description?f.jsx("div",{className:"truncate text-xs text-muted-foreground",children:m.description}):null]})]},m.value))})})]})})]})}export{bt as S,xr as a}; + */const bt=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);function yt(e){const r=Ct(e),t=n.forwardRef((s,o)=>{const{children:l,...i}=s,c=n.Children.toArray(l),v=c.find(Rt);if(v){const u=v.props.children,h=c.map(g=>g===v?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:g);return f.jsx(r,{...i,ref:o,children:n.isValidElement(u)?n.cloneElement(u,void 0,h):null})}return f.jsx(r,{...i,ref:o,children:l})});return t.displayName=`${e}.Slot`,t}function Ct(e){const r=n.forwardRef((t,s)=>{const{children:o,...l}=t;if(n.isValidElement(o)){const i=Pt(o),c=Et(l,o.props);return o.type!==n.Fragment&&(c.ref=s?B(s,i):i),n.cloneElement(o,c)}return n.Children.count(o)>1?n.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var wt=Symbol("radix.slottable");function Rt(e){return n.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wt}function Et(e,r){const t={...r};for(const s in r){const o=e[s],l=r[s];/^on[A-Z]/.test(s)?o&&l?t[s]=(...c)=>{const v=l(...c);return o(...c),v}:o&&(t[s]=o):s==="style"?t[s]={...o,...l}:s==="className"&&(t[s]=[o,l].filter(Boolean).join(" "))}return{...e,...t}}function Pt(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var J="Popover",[ke]=rt(J,[Pe]),U=Pe(),[St,D]=ke(J),je=e=>{const{__scopePopover:r,children:t,open:s,defaultOpen:o,onOpenChange:l,modal:i=!1}=e,c=U(r),v=n.useRef(null),[u,h]=n.useState(!1),[g,y]=Xe({prop:s,defaultProp:o??!1,onChange:l,caller:J});return f.jsx(et,{...c,children:f.jsx(St,{scope:r,contentId:$(),triggerRef:v,open:g,onOpenChange:y,onOpenToggle:n.useCallback(()=>y(w=>!w),[y]),hasCustomAnchor:u,onCustomAnchorAdd:n.useCallback(()=>h(!0),[]),onCustomAnchorRemove:n.useCallback(()=>h(!1),[]),modal:i,children:t})})};je.displayName=J;var Ne="PopoverAnchor",kt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ne,t),l=U(t),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=o;return n.useEffect(()=>(i(),()=>c()),[i,c]),f.jsx(Ee,{...l,...s,ref:r})});kt.displayName=Ne;var Ae="PopoverTrigger",Ie=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(Ae,t),l=U(t),i=Re(r,o.triggerRef),c=f.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Fe(o.open),...s,ref:i,onClick:G(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:f.jsx(Ee,{asChild:!0,...l,children:c})});Ie.displayName=Ae;var de="PopoverPortal",[jt,Nt]=ke(de,{forceMount:void 0}),Oe=e=>{const{__scopePopover:r,forceMount:t,children:s,container:o}=e,l=D(de,r);return f.jsx(jt,{scope:r,forceMount:t,children:f.jsx(Se,{present:t||l.open,children:f.jsx(tt,{asChild:!0,container:o,children:s})})})};Oe.displayName=de;var W="PopoverContent",_e=n.forwardRef((e,r)=>{const t=Nt(W,e.__scopePopover),{forceMount:s=t.forceMount,...o}=e,l=D(W,e.__scopePopover);return f.jsx(Se,{present:s||l.open,children:l.modal?f.jsx(It,{...o,ref:r}):f.jsx(Ot,{...o,ref:r})})});_e.displayName=W;var At=yt("PopoverContent.RemoveScroll"),It=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(null),o=Re(r,s),l=n.useRef(!1);return n.useEffect(()=>{const i=s.current;if(i)return nt(i)},[]),f.jsx(ot,{as:At,allowPinchZoom:!0,children:f.jsx(Me,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:G(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),l.current||(c=t.triggerRef.current)==null||c.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,v=c.button===0&&c.ctrlKey===!0,u=c.button===2||v;l.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:G(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ot=n.forwardRef((e,r)=>{const t=D(W,e.__scopePopover),s=n.useRef(!1),o=n.useRef(!1);return f.jsx(Me,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(s.current||(c=t.triggerRef.current)==null||c.focus(),l.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:l=>{var v,u;(v=e.onInteractOutside)==null||v.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=l.target;((u=t.triggerRef.current)==null?void 0:u.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),Me=n.forwardRef((e,r)=>{const{__scopePopover:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onInteractOutside:h,...g}=e,y=D(W,t),w=U(t);return at(),f.jsx(lt,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(st,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:v,onFocusOutside:u,onDismiss:()=>y.onOpenChange(!1),children:f.jsx(it,{"data-state":Fe(y.open),role:"dialog",id:y.contentId,...w,...g,ref:r,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),De="PopoverClose",_t=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=D(De,t);return f.jsx(A.button,{type:"button",...s,ref:r,onClick:G(e.onClick,()=>o.onOpenChange(!1))})});_t.displayName=De;var Mt="PopoverArrow",Dt=n.forwardRef((e,r)=>{const{__scopePopover:t,...s}=e,o=U(t);return f.jsx(ct,{...o,...s,ref:r})});Dt.displayName=Mt;function Fe(e){return e?"open":"closed"}var Ft=je,$t=Ie,Lt=Oe,$e=_e;const Tt=Ft,Vt=$t,Le=n.forwardRef(({className:e,align:r="center",sideOffset:t=4,...s},o)=>f.jsx(Lt,{children:f.jsx($e,{ref:o,align:r,sideOffset:t,className:O("z-50 w-72 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})}));Le.displayName=$e.displayName;var be=1,qt=.9,Kt=.8,Bt=.17,le=.1,se=.999,Wt=.9999,Ht=.99,zt=/[\\\/_+.#"@\[\(\{&]/,Gt=/[\\\/_+.#"@\[\(\{&]/g,Ut=/[\s-]/,Te=/[\s-]/g;function ce(e,r,t,s,o,l,i){if(l===r.length)return o===e.length?be:Ht;var c=`${o},${l}`;if(i[c]!==void 0)return i[c];for(var v=s.charAt(l),u=t.indexOf(v,o),h=0,g,y,w,k;u>=0;)g=ce(e,r,t,s,u+1,l+1,i),g>h&&(u===o?g*=be:zt.test(e.charAt(u-1))?(g*=Kt,w=e.slice(o,u-1).match(Gt),w&&o>0&&(g*=Math.pow(se,w.length))):Ut.test(e.charAt(u-1))?(g*=qt,k=e.slice(o,u-1).match(Te),k&&o>0&&(g*=Math.pow(se,k.length))):(g*=Bt,o>0&&(g*=Math.pow(se,u-o))),e.charAt(u)!==r.charAt(l)&&(g*=Wt)),(gg&&(g=y*le)),g>h&&(h=g),u=t.indexOf(v,u+1);return i[c]=h,h}function ye(e){return e.toLowerCase().replace(Te," ")}function Qt(e,r,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,ce(e,r,ye(e),ye(r),0,0,{})}var z='[cmdk-group=""]',ie='[cmdk-group-items=""]',Zt='[cmdk-group-heading=""]',Ve='[cmdk-item=""]',Ce=`${Ve}:not([aria-disabled="true"])`,ue="cmdk-item-select",q="data-value",Yt=(e,r,t)=>Qt(e,r,t),qe=n.createContext(void 0),Q=()=>n.useContext(qe),Ke=n.createContext(void 0),fe=()=>n.useContext(Ke),Be=n.createContext(void 0),We=n.forwardRef((e,r)=>{let t=K(()=>{var a,p;return{search:"",value:(p=(a=e.value)!=null?a:e.defaultValue)!=null?p:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=K(()=>new Set),o=K(()=>new Map),l=K(()=>new Map),i=K(()=>new Set),c=He(e),{label:v,children:u,value:h,onValueChange:g,filter:y,shouldFilter:w,loop:k,disablePointerSelection:T=!1,vimBindings:j=!0,...F}=e,N=$(),Z=$(),_=$(),I=n.useRef(null),m=ir();L(()=>{if(h!==void 0){let a=h.trim();t.current.value=a,R.emit()}},[h]),L(()=>{m(6,me)},[]);let R=n.useMemo(()=>({subscribe:a=>(i.current.add(a),()=>i.current.delete(a)),snapshot:()=>t.current,setState:(a,p,x)=>{var d,b,C,S;if(!Object.is(t.current[a],p)){if(t.current[a]=p,a==="search")ne(),te(),m(1,re);else if(a==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let E=document.getElementById(_);E?E.focus():(d=document.getElementById(N))==null||d.focus()}if(m(7,()=>{var E;t.current.selectedItemId=(E=V())==null?void 0:E.id,R.emit()}),x||m(5,me),((b=c.current)==null?void 0:b.value)!==void 0){let E=p??"";(S=(C=c.current).onValueChange)==null||S.call(C,E);return}}R.emit()}},emit:()=>{i.current.forEach(a=>a())}}),[]),ee=n.useMemo(()=>({value:(a,p,x)=>{var d;p!==((d=l.current.get(a))==null?void 0:d.value)&&(l.current.set(a,{value:p,keywords:x}),t.current.filtered.items.set(a,pe(p,x)),m(2,()=>{te(),R.emit()}))},item:(a,p)=>(s.current.add(a),p&&(o.current.has(p)?o.current.get(p).add(a):o.current.set(p,new Set([a]))),m(3,()=>{ne(),te(),t.current.value||re(),R.emit()}),()=>{l.current.delete(a),s.current.delete(a),t.current.filtered.items.delete(a);let x=V();m(4,()=>{ne(),(x==null?void 0:x.getAttribute("id"))===a&&re(),R.emit()})}),group:a=>(o.current.has(a)||o.current.set(a,new Set),()=>{l.current.delete(a),o.current.delete(a)}),filter:()=>c.current.shouldFilter,label:v||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:_,labelId:Z,listInnerRef:I}),[]);function pe(a,p){var x,d;let b=(d=(x=c.current)==null?void 0:x.filter)!=null?d:Yt;return a?b(a,t.current.search,p):0}function te(){if(!t.current.search||c.current.shouldFilter===!1)return;let a=t.current.filtered.items,p=[];t.current.filtered.groups.forEach(d=>{let b=o.current.get(d),C=0;b.forEach(S=>{let E=a.get(S);C=Math.max(E,C)}),p.push([d,C])});let x=I.current;H().sort((d,b)=>{var C,S;let E=d.getAttribute("id"),Y=b.getAttribute("id");return((C=a.get(Y))!=null?C:0)-((S=a.get(E))!=null?S:0)}).forEach(d=>{let b=d.closest(ie);b?b.appendChild(d.parentElement===b?d:d.closest(`${ie} > *`)):x.appendChild(d.parentElement===x?d:d.closest(`${ie} > *`))}),p.sort((d,b)=>b[1]-d[1]).forEach(d=>{var b;let C=(b=I.current)==null?void 0:b.querySelector(`${z}[${q}="${encodeURIComponent(d[0])}"]`);C==null||C.parentElement.appendChild(C)})}function re(){let a=H().find(x=>x.getAttribute("aria-disabled")!=="true"),p=a==null?void 0:a.getAttribute(q);R.setState("value",p||void 0)}function ne(){var a,p,x,d;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=s.current.size;return}t.current.filtered.groups=new Set;let b=0;for(let C of s.current){let S=(p=(a=l.current.get(C))==null?void 0:a.value)!=null?p:"",E=(d=(x=l.current.get(C))==null?void 0:x.keywords)!=null?d:[],Y=pe(S,E);t.current.filtered.items.set(C,Y),Y>0&&b++}for(let[C,S]of o.current)for(let E of S)if(t.current.filtered.items.get(E)>0){t.current.filtered.groups.add(C);break}t.current.filtered.count=b}function me(){var a,p,x;let d=V();d&&(((a=d.parentElement)==null?void 0:a.firstChild)===d&&((x=(p=d.closest(z))==null?void 0:p.querySelector(Zt))==null||x.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function V(){var a;return(a=I.current)==null?void 0:a.querySelector(`${Ve}[aria-selected="true"]`)}function H(){var a;return Array.from(((a=I.current)==null?void 0:a.querySelectorAll(Ce))||[])}function oe(a){let p=H()[a];p&&R.setState("value",p.getAttribute(q))}function ae(a){var p;let x=V(),d=H(),b=d.findIndex(S=>S===x),C=d[b+a];(p=c.current)!=null&&p.loop&&(C=b+a<0?d[d.length-1]:b+a===d.length?d[0]:d[b+a]),C&&R.setState("value",C.getAttribute(q))}function ve(a){let p=V(),x=p==null?void 0:p.closest(z),d;for(;x&&!d;)x=a>0?lr(x,z):sr(x,z),d=x==null?void 0:x.querySelector(Ce);d?R.setState("value",d.getAttribute(q)):ae(a)}let he=()=>oe(H().length-1),ge=a=>{a.preventDefault(),a.metaKey?he():a.altKey?ve(1):ae(1)},xe=a=>{a.preventDefault(),a.metaKey?oe(0):a.altKey?ve(-1):ae(-1)};return n.createElement(A.div,{ref:r,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:a=>{var p;(p=F.onKeyDown)==null||p.call(F,a);let x=a.nativeEvent.isComposing||a.keyCode===229;if(!(a.defaultPrevented||x))switch(a.key){case"n":case"j":{j&&a.ctrlKey&&ge(a);break}case"ArrowDown":{ge(a);break}case"p":case"k":{j&&a.ctrlKey&&xe(a);break}case"ArrowUp":{xe(a);break}case"Home":{a.preventDefault(),oe(0);break}case"End":{a.preventDefault(),he();break}case"Enter":{a.preventDefault();let d=V();if(d){let b=new Event(ue);d.dispatchEvent(b)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:ee.inputId,id:ee.labelId,style:ur},v),X(e,a=>n.createElement(Ke.Provider,{value:R},n.createElement(qe.Provider,{value:ee},a))))}),Jt=n.forwardRef((e,r)=>{var t,s;let o=$(),l=n.useRef(null),i=n.useContext(Be),c=Q(),v=He(e),u=(s=(t=v.current)==null?void 0:t.forceMount)!=null?s:i==null?void 0:i.forceMount;L(()=>{if(!u)return c.item(o,i==null?void 0:i.id)},[u]);let h=ze(o,l,[e.value,e.children,l],e.keywords),g=fe(),y=M(m=>m.value&&m.value===h.current),w=M(m=>u||c.filter()===!1?!0:m.search?m.filtered.items.get(o)>0:!0);n.useEffect(()=>{let m=l.current;if(!(!m||e.disabled))return m.addEventListener(ue,k),()=>m.removeEventListener(ue,k)},[w,e.onSelect,e.disabled]);function k(){var m,R;T(),(R=(m=v.current).onSelect)==null||R.call(m,h.current)}function T(){g.setState("value",h.current,!0)}if(!w)return null;let{disabled:j,value:F,onSelect:N,forceMount:Z,keywords:_,...I}=e;return n.createElement(A.div,{ref:B(l,r),...I,id:o,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!y,"data-disabled":!!j,"data-selected":!!y,onPointerMove:j||c.getDisablePointerSelection()?void 0:T,onClick:j?void 0:k},e.children)}),Xt=n.forwardRef((e,r)=>{let{heading:t,children:s,forceMount:o,...l}=e,i=$(),c=n.useRef(null),v=n.useRef(null),u=$(),h=Q(),g=M(w=>o||h.filter()===!1?!0:w.search?w.filtered.groups.has(i):!0);L(()=>h.group(i),[]),ze(i,c,[e.value,e.heading,v]);let y=n.useMemo(()=>({id:i,forceMount:o}),[o]);return n.createElement(A.div,{ref:B(c,r),...l,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},t&&n.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:u},t),X(e,w=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?u:void 0},n.createElement(Be.Provider,{value:y},w))))}),er=n.forwardRef((e,r)=>{let{alwaysRender:t,...s}=e,o=n.useRef(null),l=M(i=>!i.search);return!t&&!l?null:n.createElement(A.div,{ref:B(o,r),...s,"cmdk-separator":"",role:"separator"})}),tr=n.forwardRef((e,r)=>{let{onValueChange:t,...s}=e,o=e.value!=null,l=fe(),i=M(u=>u.search),c=M(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),n.createElement(A.input,{ref:r,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":c,id:v.inputId,type:"text",value:o?e.value:i,onChange:u=>{o||l.setState("search",u.target.value),t==null||t(u.target.value)}})}),rr=n.forwardRef((e,r)=>{let{children:t,label:s="Suggestions",...o}=e,l=n.useRef(null),i=n.useRef(null),c=M(u=>u.selectedItemId),v=Q();return n.useEffect(()=>{if(i.current&&l.current){let u=i.current,h=l.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=u.offsetHeight;h.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return y.observe(u),()=>{cancelAnimationFrame(g),y.unobserve(u)}}},[]),n.createElement(A.div,{ref:B(l,r),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":s,id:v.listId},X(e,u=>n.createElement("div",{ref:B(i,v.listInnerRef),"cmdk-list-sizer":""},u)))}),nr=n.forwardRef((e,r)=>{let{open:t,onOpenChange:s,overlayClassName:o,contentClassName:l,container:i,...c}=e;return n.createElement(pt,{open:t,onOpenChange:s},n.createElement(mt,{container:i},n.createElement(vt,{"cmdk-overlay":"",className:o}),n.createElement(ht,{"aria-label":e.label,"cmdk-dialog":"",className:l},n.createElement(We,{ref:r,...c}))))}),or=n.forwardRef((e,r)=>M(t=>t.filtered.count===0)?n.createElement(A.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),ar=n.forwardRef((e,r)=>{let{progress:t,children:s,label:o="Loading...",...l}=e;return n.createElement(A.div,{ref:r,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},X(e,i=>n.createElement("div",{"aria-hidden":!0},i)))}),P=Object.assign(We,{List:rr,Item:Jt,Input:tr,Group:Xt,Separator:er,Dialog:nr,Empty:or,Loading:ar});function lr(e,r){let t=e.nextElementSibling;for(;t;){if(t.matches(r))return t;t=t.nextElementSibling}}function sr(e,r){let t=e.previousElementSibling;for(;t;){if(t.matches(r))return t;t=t.previousElementSibling}}function He(e){let r=n.useRef(e);return L(()=>{r.current=e}),r}var L=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(e){let r=n.useRef();return r.current===void 0&&(r.current=e()),r}function M(e){let r=fe(),t=()=>e(r.snapshot());return n.useSyncExternalStore(r.subscribe,t,t)}function ze(e,r,t,s=[]){let o=n.useRef(),l=Q();return L(()=>{var i;let c=(()=>{var u;for(let h of t){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(u=h.current.textContent)==null?void 0:u.trim():o.current}})(),v=s.map(u=>u.trim());l.value(e,c,v),(i=r.current)==null||i.setAttribute(q,c),o.current=c}),o}var ir=()=>{let[e,r]=n.useState(),t=K(()=>new Map);return L(()=>{t.current.forEach(s=>s()),t.current=new Map},[e]),(s,o)=>{t.current.set(s,o),r({})}};function cr(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function X({asChild:e,children:r},t){return e&&n.isValidElement(r)?n.cloneElement(cr(r),{ref:r.ref},t(r.props.children)):t(r)}var ur={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ge=n.forwardRef(({className:e,...r},t)=>f.jsx(P,{ref:t,className:O("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));Ge.displayName=P.displayName;const Ue=n.forwardRef(({className:e,...r},t)=>f.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[f.jsx(bt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),f.jsx(P.Input,{ref:t,className:O("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));Ue.displayName=P.Input.displayName;const Qe=n.forwardRef(({className:e,...r},t)=>f.jsx(P.List,{ref:t,className:O("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));Qe.displayName=P.List.displayName;const Ze=n.forwardRef((e,r)=>f.jsx(P.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));Ze.displayName=P.Empty.displayName;const Ye=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Group,{ref:t,className:O("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));Ye.displayName=P.Group.displayName;const dr=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Separator,{ref:t,className:O("-mx-1 h-px bg-border",e),...r}));dr.displayName=P.Separator.displayName;const Je=n.forwardRef(({className:e,...r},t)=>f.jsx(P.Item,{ref:t,className:O("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...r}));Je.displayName=P.Item.displayName;const fr=250;function xr({value:e,onChange:r,placeholder:t="Select...",searchPlaceholder:s="Search...",emptyMessage:o="No results found.",disabled:l=!1,selectedOption:i,queryKey:c,queryFn:v,enabled:u=!0,className:h,ariaLabel:g}){const[y,w]=n.useState(!1),[k,T]=n.useState(""),[j,F]=n.useState("");n.useEffect(()=>{const m=window.setTimeout(()=>{F(k.trim())},fr);return()=>window.clearTimeout(m)},[k]),n.useEffect(()=>{y||(T(""),F(""))},[y]);const{data:N=[],isFetching:Z}=dt({queryKey:[...c,j],queryFn:()=>v(j),enabled:u&&y}),_=n.useMemo(()=>!e||N.some(m=>m.value===e)?N:(i==null?void 0:i.value)===e?[i,...N]:N,[N,i,e]),I=n.useMemo(()=>{if(!e)return t;const m=_.find(R=>R.value===e)??((i==null?void 0:i.value)===e?i:null);return(m==null?void 0:m.label)??t},[_,t,i,e]);return f.jsxs(Tt,{open:y,onOpenChange:w,modal:!0,children:[f.jsx(Vt,{asChild:!0,children:f.jsxs(ft,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,"aria-label":g,disabled:l,className:O("h-8 w-full justify-between px-2 text-sm font-normal",!e&&"text-muted-foreground",h),children:[f.jsx("span",{className:"truncate",children:I}),f.jsx(xt,{className:"ml-1 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),f.jsx(Le,{className:"z-[60] w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-popover-content-available-height)] overflow-hidden p-0",align:"start",collisionPadding:8,onWheel:m=>m.stopPropagation(),children:f.jsxs(Ge,{shouldFilter:!1,className:"h-full",children:[f.jsx(Ue,{placeholder:s,value:k,onValueChange:T}),f.jsx(Qe,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.75rem))] min-h-0 overscroll-contain",children:Z?f.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[f.jsx(gt,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):_.length===0?f.jsx(Ze,{children:o}):f.jsx(Ye,{children:_.map(m=>f.jsxs(Je,{value:m.value,onSelect:()=>{r(m.value),w(!1)},children:[f.jsx(ut,{className:O("mr-2 h-4 w-4",e===m.value?"opacity-100":"opacity-0")}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate",children:m.label}),m.description?f.jsx("div",{className:"truncate text-xs text-muted-foreground",children:m.description}):null]})]},m.value))})})]})})]})}export{bt as S,xr as a}; diff --git a/assets/shield-alert-CDv23c0X.js b/assets/shield-alert-CXix4gJs.js similarity index 96% rename from assets/shield-alert-CDv23c0X.js rename to assets/shield-alert-CXix4gJs.js index fb05ff365f8505567af0a2fa95af174fb7ad85fd..958af28f949c6f4862ffa07d0e0a15d3167b881c 100644 --- a/assets/shield-alert-CDv23c0X.js +++ b/assets/shield-alert-CXix4gJs.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-D9_nPZtO.js";/** +import{d as e}from"./index-Czt286FG.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/skeleton-CQ2CM4l9.js b/assets/skeleton-B7eqTJnv.js similarity index 62% rename from assets/skeleton-CQ2CM4l9.js rename to assets/skeleton-B7eqTJnv.js index 2afa5a8ee5693444c60aae2f878a680e328623ff..90bfd269c3279933958d3c9de56aa02fcbd260e3 100644 --- a/assets/skeleton-CQ2CM4l9.js +++ b/assets/skeleton-B7eqTJnv.js @@ -1 +1 @@ -import{j as t,v as n}from"./index-D9_nPZtO.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,v as n}from"./index-Czt286FG.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/submissions-BsEO_Bbg.js b/assets/submissions-BsEO_Bbg.js new file mode 100644 index 0000000000000000000000000000000000000000..490631c473f2aa921fdf3c2ee061bf22a12a1961 --- /dev/null +++ b/assets/submissions-BsEO_Bbg.js @@ -0,0 +1 @@ +import{ac as n}from"./index-Czt286FG.js";class a{constructor(e){this.request=e}submit(e){return this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)})}list(e){const t=new URLSearchParams;for(const[i,r]of Object.entries(e??{}))r!==void 0&&t.set(i,String(r));const s=t.toString();return this.request(`/admin/paper-edits${s?`?${s}`:""}`)}get(e){return this.request(`/admin/paper-edits/${e}`)}approve(e,t={}){return this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)})}reject(e,t={}){return this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)})}}const u=new a(n);export{u as s}; diff --git a/assets/switch-BM2BYYbv.js b/assets/switch-DfN0FiAU.js similarity index 92% rename from assets/switch-BM2BYYbv.js rename to assets/switch-DfN0FiAU.js index 933c52ee425599960da21de46232f4ce80455338..d17879300de53e06cd5d2c3fe3fc195d6e4a82ce 100644 --- a/assets/switch-BM2BYYbv.js +++ b/assets/switch-DfN0FiAU.js @@ -1 +1 @@ -import{r as s,p as C,o as I,j as a,n as y,q as M,s as H,t as q,v as x}from"./index-D9_nPZtO.js";import{u as A}from"./index-BGBxtSYH.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:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),g=l?i||!!l.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:u,...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:l,bubbles:!k.current,name:n,value:u,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),u=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(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,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}; +import{r as s,o as C,n as I,j as a,m as y,q as M,s as H,t as q,v as x}from"./index-Czt286FG.js";import{u as A}from"./index-DzH9562Y.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:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),g=l?i||!!l.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:u,...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:l,bubbles:!k.current,name:n,value:u,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),u=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(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,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-BVF3ykiv.js b/assets/textarea-Ov25LunA.js similarity index 93% rename from assets/textarea-BVF3ykiv.js rename to assets/textarea-Ov25LunA.js index cd89a2d8b2a45a8080cb414cfb517e31e45c4255..a78da02342343dda19ad87a968c62495e8c3584a 100644 --- a/assets/textarea-BVF3ykiv.js +++ b/assets/textarea-Ov25LunA.js @@ -1 +1 @@ -import{r as s,j as i,v as t}from"./index-D9_nPZtO.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,v as t}from"./index-Czt286FG.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-BObV5jzB.js b/assets/transform-BObV5jzB.js deleted file mode 100644 index 5f6b462fbab4eee4122e7c86b740ced1e0f7f2bd..0000000000000000000000000000000000000000 --- a/assets/transform-BObV5jzB.js +++ /dev/null @@ -1 +0,0 @@ -import{a3 as _}from"./index-D9_nPZtO.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 F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(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=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function K(t){const e=j(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/I)+1}function Q(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=Q(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/I)+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"},q={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=Q(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=j(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 U(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 U(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"+L(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"+L(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 L(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 U(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 H=(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"})}},X=(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 H(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}}",H(r,e)).replace("{{time}}",X(a,e))},It={p:X,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(q[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=q[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 B(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*A+r*R+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*A+a*R):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 G(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]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(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"?B(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(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,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),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=$.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"]),$=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=$.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{Oe as a,xe as c,Te as d,pe as h,be as s,ve as t}; diff --git a/assets/transform-IZH7YNlm.js b/assets/transform-IZH7YNlm.js new file mode 100644 index 0000000000000000000000000000000000000000..8fa507d14a0f48e1d7eabf8d5497c0b9a1137b13 --- /dev/null +++ b/assets/transform-IZH7YNlm.js @@ -0,0 +1 @@ +import{M as _}from"./index-Czt286FG.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 F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(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=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function K(t){const e=j(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/I)+1}function Q(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=Q(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/I)+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"},q={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=Q(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=j(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 U(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 U(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"+L(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"+L(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 L(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 U(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 H=(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"})}},X=(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 H(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}}",H(r,e)).replace("{{time}}",X(a,e))},It={p:X,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(q[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=q[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 B(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*A+r*R+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*A+a*R):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 G(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]||(G(t)?29:28))}function fe(t,e){return e>=1&&e<=(G(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"?B(t):t;return Zt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return B(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,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),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=$.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"]),$=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=$.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{Oe as a,xe as c,Te as d,pe as h,be as s,ve as t}; diff --git a/assets/useDebounce-BidSk3ad.js b/assets/useDebounce-DAhMNkJl.js similarity index 66% rename from assets/useDebounce-BidSk3ad.js rename to assets/useDebounce-DAhMNkJl.js index 22a42a45fd8179242e9952ec1231066cb13d359a..5a98cae4f65e9d308004bd5d19c5bc5e0328ba68 100644 --- a/assets/useDebounce-BidSk3ad.js +++ b/assets/useDebounce-DAhMNkJl.js @@ -1 +1 @@ -import{r as o}from"./index-D9_nPZtO.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-Czt286FG.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-CQNVzwuX.js b/assets/useInfiniteQuery-Dk5Z9hLn.js similarity index 89% rename from assets/useInfiniteQuery-CQNVzwuX.js rename to assets/useInfiniteQuery-Dk5Z9hLn.js index a3b7750fb148f9aa28fd9e5c8293127178666f2d..666364b0913994140ae0fd658221d4bf0b25ea98 100644 --- a/assets/useInfiniteQuery-CQNVzwuX.js +++ b/assets/useInfiniteQuery-Dk5Z9hLn.js @@ -1 +1 @@ -import{Q as v,a as p}from"./useQuery-cycUreG-.js";import{av as x,aw as b}from"./index-D9_nPZtO.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-DLzEukS9.js";import{af as x,ag as b}from"./index-Czt286FG.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-CZXk9yc2.js b/assets/useIntersectionObserver-DWuiXfmk.js similarity index 92% rename from assets/useIntersectionObserver-CZXk9yc2.js rename to assets/useIntersectionObserver-DWuiXfmk.js index 6e0ff43e26b620e9b25358cb6b0a910f1bd76624..9b66dec7b476b187f3ef6bbec2f60ce06d34c8d7 100644 --- a/assets/useIntersectionObserver-CZXk9yc2.js +++ b/assets/useIntersectionObserver-DWuiXfmk.js @@ -1 +1 @@ -import{j as e,r as c}from"./index-D9_nPZtO.js";import{I as d}from"./components-DrTew0nD.js";const h=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),u=({checked:r,icon:t,label:n,onChange:a})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${r?"active":""}`,"aria-pressed":r,onClick:()=>a(!r),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:t}),n]}),r&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),x=({hasCode:r,hasHfArtifacts:t,onHasCodeChange:n,onHasHfArtifactsChange:a,showDivider:o=!0,showHasCode:s=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[s&&e.jsx(u,{checked:r,icon:e.jsx(d,{name:"github",size:14}),label:"Has code",onChange:n}),e.jsx(u,{checked:t,icon:e.jsx(h,{}),label:"Has artifacts",onChange:a})]})]});function j(r={}){const{threshold:t=0,rootMargin:n="0px"}=r,[a,o]=c.useState(!1),s=c.useRef(null),f=c.useCallback(i=>{if(s.current&&(s.current.disconnect(),s.current=null),!i){o(!1);return}const l=new IntersectionObserver(([p])=>o(p.isIntersecting),{threshold:t,rootMargin:n});l.observe(i),s.current=l},[t,n]);return c.useEffect(()=>()=>{s.current&&(s.current.disconnect(),s.current=null)},[]),{targetRef:f,isIntersecting:a}}export{x as P,j as u}; +import{j as e,r as c}from"./index-Czt286FG.js";import{I as d}from"./components-D0aZHC0e.js";const h=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),u=({checked:r,icon:t,label:n,onChange:a})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${r?"active":""}`,"aria-pressed":r,onClick:()=>a(!r),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:t}),n]}),r&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),x=({hasCode:r,hasHfArtifacts:t,onHasCodeChange:n,onHasHfArtifactsChange:a,showDivider:o=!0,showHasCode:s=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[o&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[s&&e.jsx(u,{checked:r,icon:e.jsx(d,{name:"github",size:14}),label:"Has code",onChange:n}),e.jsx(u,{checked:t,icon:e.jsx(h,{}),label:"Has artifacts",onChange:a})]})]});function j(r={}){const{threshold:t=0,rootMargin:n="0px"}=r,[a,o]=c.useState(!1),s=c.useRef(null),f=c.useCallback(i=>{if(s.current&&(s.current.disconnect(),s.current=null),!i){o(!1);return}const l=new IntersectionObserver(([p])=>o(p.isIntersecting),{threshold:t,rootMargin:n});l.observe(i),s.current=l},[t,n]);return c.useEffect(()=>()=>{s.current&&(s.current.disconnect(),s.current=null)},[]),{targetRef:f,isIntersecting:a}}export{x as P,j as u}; diff --git a/assets/useMutation-CJCfaNMQ.js b/assets/useMutation-DqQi_NTN.js similarity index 59% rename from assets/useMutation-CJCfaNMQ.js rename to assets/useMutation-DqQi_NTN.js index 5f3d7c1ce57c244e0b59011d064a41699cb71a1a..03ef51b434c1d307bb71437c136467940cc87608 100644 --- a/assets/useMutation-CJCfaNMQ.js +++ b/assets/useMutation-DqQi_NTN.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{ay as k,aA as U,aM as j,aN as q,az as P,k as A,r as v,aC as L,aO as z}from"./index-D9_nPZtO.js";var a,c,o,h,n,g,S,w,D=(w=class extends k{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,g).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,g).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,g).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,g=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??q();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,C={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,C)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,C)}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,C)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,C)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function Q(i,t){const s=A(),[r]=v.useState(()=>new D(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(L)},[r]);if(u.error&&z(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{Q as u}; +var j=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||j("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)?j("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{ai as k,ak as q,aq as R,ar as U,aj as P,k as L,r as v,am as A,as as D}from"./index-Czt286FG.js";var a,c,o,h,n,C,S,w,I=(w=class extends k{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),q(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(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)??U();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 z(i,t){const s=L(),[r]=v.useState(()=>new I(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{z as u}; diff --git a/assets/usePapers-B3J6SKWU.js b/assets/usePapers-B3J6SKWU.js deleted file mode 100644 index ba28098fffb6d21b5c09633c36c7efa52498ceb5..0000000000000000000000000000000000000000 --- a/assets/usePapers-B3J6SKWU.js +++ /dev/null @@ -1 +0,0 @@ -import{c as p,ap as _}from"./index-D9_nPZtO.js";import{u as b}from"./useQuery-cycUreG-.js";import{u as g}from"./useInfiniteQuery-CQNVzwuX.js";function x(a,e=!0){return b({queryKey:["paper",a],queryFn:()=>p.getPaper(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function z(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:s="desc",time:n,published_after:i,published_before:u,conference:o,latest_only:c=!0,include_resources:l=!1,has_code:f=!1,has_hf_artifacts:d=!1,framework:P,repository:y,enabled:m=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:u,conference:o,latest_only:c,include_resources:l,has_code:f,has_hf_artifacts:d,framework:P,repository:y}],queryFn:({pageParam:h=1})=>p.getPapers({page:h,page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:u,conference:o,latest_only:c,include_resources:l,has_code:f,has_hf_artifacts:d,framework:P,repository:y}),getNextPageParam:h=>h.next_page,initialPageParam:1,enabled:m,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function O(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:s="desc",latest_only:n=!0,include_resources:i=!0,has_code:u=!1,has_hf_artifacts:o=!1,enabled:c=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:u,has_hf_artifacts:o}],queryFn:({pageParam:l=1})=>p.getTaskPapers(e,{page:l,page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:u,has_hf_artifacts:o}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function T(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:u=!0,include_resources:o=!0,has_code:c=!1,has_hf_artifacts:l=!1,enabled:f=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:s,order_by:n,order_dir:i,latest_only:u,include_resources:o,has_code:c,has_hf_artifacts:l}],queryFn:({pageParam:d=1})=>p.getConferencePapers(e,{task:r,presentation:t,page:d,page_size:s,order_by:n,order_dir:i,latest_only:u,include_resources:o,has_code:c,has_hf_artifacts:l}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function w(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:u=!0,has_code:o=!1,has_hf_artifacts:c=!1,enabled:l=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:u,has_code:o,has_hf_artifacts:c}],queryFn:({pageParam:f=1})=>p.getOrganizationPapers(e,{task:r,page:f,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:u,has_code:o,has_hf_artifacts:c}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}export{x as a,O as b,T as c,w as d,z as u}; diff --git a/assets/usePapers-BlskNTEC.js b/assets/usePapers-BlskNTEC.js new file mode 100644 index 0000000000000000000000000000000000000000..fb561eee312f50cdcde0b14a56012f5cf18f2fea --- /dev/null +++ b/assets/usePapers-BlskNTEC.js @@ -0,0 +1 @@ +import{p,a9 as _}from"./index-Czt286FG.js";import{u as b}from"./useQuery-DLzEukS9.js";import{u as g}from"./useInfiniteQuery-Dk5Z9hLn.js";function x(a,e=!0){return b({queryKey:["paper",a],queryFn:()=>p.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function z(a={}){const{page_size:e=20,search:r,order_by:t="date_published",order_dir:s="desc",time:n,published_after:i,published_before:o,conference:u,latest_only:f=!0,include_resources:l=!1,has_code:c=!1,has_hf_artifacts:d=!1,framework:y,repository:P,enabled:m=!0}=a;return g({queryKey:["papers-infinite",{page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:P}],queryFn:({pageParam:h=1})=>p.list({page:h,page_size:e,search:r,order_by:t,order_dir:s,time:n,published_after:i,published_before:o,conference:u,latest_only:f,include_resources:l,has_code:c,has_hf_artifacts:d,framework:y,repository:P}),getNextPageParam:h=>h.next_page,initialPageParam:1,enabled:m,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function O(a){const{taskId:e,page_size:r=20,order_by:t="date_published",order_dir:s="desc",latest_only:n=!0,include_resources:i=!0,has_code:o=!1,has_hf_artifacts:u=!1,enabled:f=!0}=a;return g({queryKey:["task-papers-infinite",e,{page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}],queryFn:({pageParam:l=1})=>p.forTask(e,{page:l,page_size:r,order_by:t,order_dir:s,latest_only:n,include_resources:i,has_code:o,has_hf_artifacts:u}),getNextPageParam:l=>l.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function T(a){const{conferenceSlug:e,taskSlug:r,presentation:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:u=!0,has_code:f=!1,has_hf_artifacts:l=!1,enabled:c=!0}=a;return g({queryKey:["conference-papers-infinite",e,r,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:f,has_hf_artifacts:l}],queryFn:({pageParam:d=1})=>p.forConference(e,{task:r,presentation:t,page:d,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:u,has_code:f,has_hf_artifacts:l}),getNextPageParam:d=>d.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}function w(a){const{organizationSlug:e,taskSlug:r,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:u=!1,has_hf_artifacts:f=!1,enabled:l=!0}=a;return g({queryKey:["organization-papers-infinite",e,r,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:f}],queryFn:({pageParam:c=1})=>p.forOrganization(e,{task:r,page:c,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:u,has_hf_artifacts:f}),getNextPageParam:c=>c.next_page,initialPageParam:1,enabled:l&&!!e,staleTime:5*60*1e3,placeholderData:_,refetchOnWindowFocus:!1})}export{x as a,O as b,T as c,w as d,z as u}; diff --git a/assets/usePeriodFilter-BkksG2SW.js b/assets/usePeriodFilter-BkksG2SW.js deleted file mode 100644 index 7cb06c552d7b5fe330bcf737eeb16af93959ea3a..0000000000000000000000000000000000000000 --- a/assets/usePeriodFilter-BkksG2SW.js +++ /dev/null @@ -1 +0,0 @@ -import"./index-D9_nPZtO.js";const e=["Today","This Week","This Month","All Time"];export{e as P}; diff --git a/assets/usePeriodFilter-D6AJqB5b.js b/assets/usePeriodFilter-D6AJqB5b.js new file mode 100644 index 0000000000000000000000000000000000000000..0f89f412c54c49773b4a9441175e0adae763fc39 --- /dev/null +++ b/assets/usePeriodFilter-D6AJqB5b.js @@ -0,0 +1 @@ +import"./index-Czt286FG.js";const e=["Today","This Week","This Month","All Time"];export{e as P}; diff --git a/assets/useQuery-cycUreG-.js b/assets/useQuery-DLzEukS9.js similarity index 63% rename from assets/useQuery-cycUreG-.js rename to assets/useQuery-DLzEukS9.js index f3436fa3bf8d42f54cb9dc8a0aaaf6a470c7bb23..9c32d2bc8f49ff4e2a4a9790d46aadfd33aa1fc4 100644 --- a/assets/useQuery-cycUreG-.js +++ b/assets/useQuery-DLzEukS9.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{ay as wt,aR as gt,aS as S,aA as q,aT as j,aC as tt,aU as et,aV as vt,aW as Mt,aX as Y,aY as Qt,aZ as _t,a_ as Rt,az as Ct,r as O,aO as Ot,k as xt}from"./index-D9_nPZtO.js";var v,a,H,g,_,D,C,T,W,P,L,x,U,w,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ut=(Et=class extends wt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,H);p(this,g);p(this,_);p(this,D);p(this,C);p(this,T);p(this,W);p(this,P);p(this,L);p(this,x);p(this,U);p(this,w);p(this,N,new Set);this.options=e,u(this,v,t),u(this,T,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,w))&&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 Dt(this,r)&&(u(this,g,r),u(this,D,this.options),u(this,_,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,_),y=i(this,D),b=t!==r?t.state:i(this,H),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const m=this.hasListeners(),B=!m&&mt(t,e),V=m&&St(t,r,e,h);(B||V)&&(d={...d,..._t(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:k,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),M=!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,P);else try{u(this,W,e.select),f=e.select(f),f=Rt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,T,null)}catch(m){u(this,T,m)}i(this,T)&&(Q=i(this,T),f=i(this,P),k=Date.now(),R="error");const Z=d.fetchStatus==="fetching",G=R==="pending",J=R==="error",lt=G&&Z,dt=f!==void 0,I={status:R,fetchStatus:d.fetchStatus,isPending:G,isSuccess:R==="success",isError:J,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:k,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:Z,isRefetching:Z&&!G,isLoadingError:J&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:J&&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,B=I.status==="error"&&!m,V=X=>{B?X.reject(I.error):m&&X.resolve(I.data)},pt=()=>{const X=u(this,C,I.promise=gt());V(X)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(B||I.data!==K.value)&&pt();break;case"rejected":(!B||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,_,i(this,a).state),u(this,D,this.options),i(this,_).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 F=y;return i(this,g)[F]!==t[F]&&c.has(F)})};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,_=new WeakMap,D=new WeakMap,C=new WeakMap,T=new WeakMap,W=new WeakMap,P=new WeakMap,L=new WeakMap,x=new WeakMap,U=new WeakMap,w=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=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,x,Y.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,w,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,w))||i(this,w)===0)&&u(this,U,Y.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,w)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,x)!==void 0&&(Y.clearTimeout(i(this,x)),u(this,x,void 0))},ht=function(){i(this,U)!==void 0&&(Y.clearInterval(i(this,U)),u(this,U,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 Ft(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 Ft(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 Dt(s,t){return!q(s.getCurrentResult(),t)}var Tt=O.createContext(!1),Pt=()=>O.useContext(Tt);Tt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),kt=()=>O.useContext(Nt),Bt=(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 M,f,Q,k;const r=Pt(),h=kt(),o=xt(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),Bt(c,h,y),At(h);const F=!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((k=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||k.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&Wt(E,r)){const R=F?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 Zt(s,t){return Vt(s,Ut)}export{Ut as Q,Vt as a,Pt as b,kt as c,Bt as d,Ht as e,At as f,yt as g,jt as h,zt as s,Zt 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{ai as Tt,av as gt,aw as S,ak as q,ax as j,am as tt,ay as et,az as vt,aA as Mt,aB as J,aC as Qt,aD as xt,aE as mt,aj as Ct,r as O,as as Ot,k as _t}from"./index-Czt286FG.js";var v,a,H,g,x,U,C,w,z,P,L,_,D,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Dt=(Et=class extends Tt{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,z);p(this,P);p(this,L);p(this,_);p(this,D);p(this,T);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),Rt(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,T))&&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},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),B=!R&&Rt(t,e),V=R&&St(t,r,e,h);(B||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:k,status:m}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,W=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(m="success",f=mt(o==null?void 0:o.data,R,e),M=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,z))f=i(this,P);else try{u(this,z,e.select),f=e.select(f),f=mt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),k=Date.now(),m="error");const X=d.fetchStatus==="fetching",Y=m==="pending",Z=m==="error",lt=Y&&X,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:m==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:k,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:M,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 R=I.data!==void 0,B=I.status==="error"&&!R,V=G=>{B?G.reject(I.error):R&&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":(B||I.data!==K.value)&&pt();break;case"rejected":(!B||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 F=y;return i(this,g)[F]!==t[F]&&c.has(F)})};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,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,D=new WeakMap,T=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=Mt(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,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,D,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,T)))},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,D)!==void 0&&(J.clearInterval(i(this,D)),u(this,D,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 Ft(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Ft(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),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),kt=()=>O.useContext(Nt),Bt=(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))}},zt=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(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 M,f,Q,k;const r=Pt(),h=kt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",Ht(c),Bt(c,h,y),At(h);const F=!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(m=>{const W=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(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((k=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||k.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const m=F?yt(c,b,h):y==null?void 0:y.promise;m==null||m.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Dt)}export{Dt as Q,Vt as a,Pt as b,kt as c,Bt as d,Ht as e,At as f,yt as g,jt as h,Wt as s,Xt as u}; diff --git a/index.html b/index.html index 60936a216fc197e425f2b246ce26ea145d215306..c7304b2affbb1c47cd8e08e2254876d00fcbfb07 100644 --- a/index.html +++ b/index.html @@ -73,7 +73,7 @@ plausible.init(); })(); - +