PageSourceSearch

https://unbserved.com/assets/AdminAuthorEnrichmentPage-DAA5MO-E.js

js unbserved.com collected 2026-09-24 14:57:25 UTC 21,298 bytes, 1 lines download raw bytes

1import{j as e,Z as Ie,U as X,u as Re,N as Ee,c as Se,m as Y,X as qe,e as Pe}from"./vendor-ui-BeVD6iDL.js";import{d as g,a as f}from"./vendor-react-Dmhbt9i7.js";import{u as Z,a as W,b as De}from"./vendor-query-vEtoV3ax.js";import{aD as U,p as Me,v as ee,dJ as se,Y as p,ae as F,w as ae,x as re,y as te,z as ne,G as ie,I as oe,J as K,bx as L,aE as ze,aF as Te,aG as R,ap as ce,r as v,s as C,E as le,X as O,af as J,U as Ve,bq as $e,L as $,aA as Fe}from"./index-cXBC_5Uy.js";import{B as y}from"./badge-CuxBpOEs.js";import{C as S,a as q,b as Ke,c as Le}from"./card-BAupyZPp.js";import{R as Oe,T as Ge,c as Ue,d as de}from"./index-BbTZ3W28.js";import{A as Qe}from"./AdminPageShell-B5XdvC8l.js";import"./vendor-motion-CENv1AvF.js";import"./BackIcon-B0Ptl-7G.js";var j="Accordion",Be=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Q,He,Je]=Ie(j),[D]=Pe(j,[Je,de]),B=de(),me=g.forwardRef((s,t)=>{const{type:a,...o}=s,l=o,i=o;return e.jsx(Q.Provider,{scope:s.__scopeAccordion,children:a==="multiple"?e.jsx(We,{...i,ref:t}):e.jsx(Ze,{...l,ref:t})})});me.displayName=j;var[ue,Xe]=D(j),[xe,Ye]=D(j,{collapsible:!1}),Ze=g.forwardRef((s,t)=>{const{value:a,defaultValue:o,onValueChange:l=()=>{},collapsible:i=!1,...n}=s,[x,m]=X({prop:a,defaultProp:o??"",onChange:l,caller:j});return e.jsx(ue,{scope:s.__scopeAccordion,value:g.useMemo(()=>x?[x]:[],[x]),onItemOpen:m,onItemClose:g.useCallback(()=>i&&m(""),[i,m]),children:e.jsx(xe,{scope:s.__scopeAccordion,collapsible:i,children:e.jsx(he,{...n,ref:t})})})}),We=g.forwardRef((s,t)=>{const{value:a,defaultValue:o,onValueChange:l=()=>{},...i}=s,[n,x]=X({prop:a,defaultProp:o??[],onChange:l,caller:j}),m=g.useCallback(d=>x((h=[])=>[...h,d]),[x]),u=g.useCallback(d=>x((h=[])=>h.filter(N=>N!==d)),[x]);return e.jsx(ue,{scope:s.__scopeAccordion,value:n,onItemOpen:m,onItemClose:u,children:e.jsx(xe,{scope:s.__scopeAccordion,collapsible:!0,children:e.jsx(he,{...i,ref:t})})})}),[es,M]=D(j),he=g.forwardRef((s,t)=>{const{__scopeAccordion:a,disabled:o,dir:l,orientation:i="vertical",...n}=s,x=g.useRef(null),m=Re(x,t),u=He(a),h=Ee(l)==="ltr",N=Se(s.onKeyDown,_=>{if(!Be.includes(_.key))return;const k=_.target,b=u().filter(V=>!V.ref.current?.disabled),w=b.findIndex(V=>V.ref.current===k),r=b.length;if(w===-1)return;_.preventDefault();let c=w;const A=0,I=r-1,z=()=>{c=w+1,c>I&&(c=A)},T=()=>{c=w-1,c<A&&(c=I)};switch(_.key){case"Home":c=A;break;case"End":c=I;break;case"ArrowRight":i==="horizontal"&&(h?z():T());break;case"ArrowDown":i==="vertical"&&z();break;case"ArrowLeft":i==="horizontal"&&(h?T():z());break;case"ArrowUp":i==="vertical"&&T();break}const ke=c%r;b[ke].ref.current?.focus()});return e.jsx(es,{scope:a,disabled:o,direction:l,orientation:i,children:e.jsx(Q.Slot,{scope:a,children:e.jsx(Y.div,{...n,"data-orientation":i,ref:m,onKeyDown:o?void 0:N})})})}),P="AccordionItem",[ss,H]=D(P),pe=g.forwardRef((s,t)=>{const{__scopeAccordion:a,value:o,...l}=s,i=M(P,a),n=Xe(P,a),x=B(a),m=qe(),u=o&&n.value.includes(o)||!1,d=i.disabled||s.disabled;return e.jsx(ss,{scope:a,open:u,disabled:d,triggerId:m,children:e.jsx(Oe,{"data-orientation":i.orientation,"data-state":_e(u),...x,...l,ref:t,disabled:d,open:u,onOpenChange:h=>{h?n.onItemOpen(o):n.onItemClose(o)}})})});pe.displayName=P;var fe="AccordionHeader",ge=g.forwardRef((s,t)=>{const{__scopeAccordion:a,...o}=s,l=M(j,a),i=H(fe,a);return e.jsx(Y.h3,{"data-orientation":l.orientation,"data-state":_e(i.open),"data-disabled":i.disabled?"":void 0,...o,ref:t})});ge.displayName=fe;var G="AccordionTrigger",ve=g.forwardRef((s,t)=>{const{__scopeAccordion:a,...o}=s,l=M(j,a),i=H(G,a),n=Ye(G,a),x=B(a);return e.jsx(Q.ItemSlot,{scope:a,children:e.jsx(Ge,{"aria-disabled":i.open&&!n.collapsible||void 0,"data-orientation":l.orientation,id:i.triggerId,...x,...o,ref:t})})});ve.displayName=G;var je="AccordionContent",Ne=g.forwardRef((s,t)=>{const{__scopeAccordion:a,...o}=s,l=M(j,a),i=H(je,a),n=B(a);return e.jsx(Ue,{role:"region","aria-labelledby":i.triggerId,"data-orientation":l.orientation,...n,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...s.style}})});Ne.displayName=je;function _e(s){return s?"open":"closed"}var as=me,rs=pe,ts=ge,we=ve,Ce=Ne;const ns=as,ye=f.forwardRef(({className:s,...t},a)=>e.jsx(rs,{ref:a,className:U("border-b",s),...t}));ye.displayName="AccordionItem";const be=f.forwardRef(({className:s,children:t,...a},o)=>e.jsx(ts,{className:"flex",children:e.jsxs(we,{ref:o,className:U("flex flex-1 items-center justify-between py-4 font-medium transition hover:underline [&[data-state=open]>svg]:rotate-180",s),...a,children:[t,e.jsx(Me,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));be.displayName=we.displayName;const Ae=f.forwardRef(({className:s,children:t,...a},o)=>e.jsx(Ce,{ref:o,className:"overflow-hidden text-sm transition data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...a,children:e.jsx("div",{className:U("pb-4 pt-0",s),children:t})}));Ae.displayName=Ce.displayName;const E=200;function is(s,t){return W({queryKey:["admin-author-enrichment",s,t],queryFn:async()=>{let a=C.from("clip_vectors").select("id, title, image_url, source_url, author_name, author_profile_url, ai_needs_review, metadata",{count:"exact"}).eq("metadata->>author_enriched","true").order("updated_at",{ascending:!1}).range(t*E,(t+1)*E-1);s==="needs_review"?a=a.eq("ai_needs_review",!0):s==="cross_validated"?a=a.eq("metadata->>cross_validated","true"):s==="vision"?a=a.eq("metadata->>used_vision","true"):s==="gemini"&&(a=a.eq("metadata->>used_gemini","true"));const{data:o,error:l,count:i}=await a;if(l)throw l;return{items:o||[],total:i||0}}})}function os(){return W({queryKey:["admin-author-enrichment-stats"],queryFn:async()=>{const[s,t,a]=await Promise.all([C.from("clip_vectors").select("id",{count:"exact",head:!0}).eq("metadata->>author_enriched","true"),C.from("clip_vectors").select("id",{count:"exact",head:!0}).eq("metadata->>author_enriched","true").eq("ai_needs_review",!0),C.from("clip_vectors").select("id",{count:"exact",head:!0}).eq("metadata->>author_enriched","true").eq("metadata->>cross_validated","true")]);return{total:s.count||0,needsReview:t.count||0,crossValidated:a.count||0}}})}function cs({confidence:s}){if(s==null)return null;const t=Math.round(s*100),a=t>=80?"default":t>=50?"secondary":"destructive";return e.jsxs(y,{variant:a,children:[t,"%"]})}function ls({item:s}){const[t,a]=f.useState(s.author_name||""),[o,l]=f.useState(!1),i=Z(),n=s.metadata||{},x=f.useCallback(()=>{i.setQueriesData({queryKey:["admin-author-enrichment"]},r=>r&&{...r,items:r.items.filter(c=>
1c.id!==s.id),total:Math.max(0,(r.total||0)-1)})},[s.id,i]),m=De({mutationFn:async r=>{const{error:c}=await C.from("clip_vectors").update(r).eq("id",s.id);if(c)throw c},onSuccess:()=>{x(),i.invalidateQueries({queryKey:["admin-author-enrichment-stats"]})}}),u=()=>{m.mutate({author_name:t.trim()||null}),l(!1),v.success("Nome do autor atualizado")},d=()=>{m.mutate({ai_needs_review:!1}),v.success("Autor confirmado")},h=()=>{m.mutate({author_name:null,author_profile_url:null,ai_needs_review:!1,metadata:{...n,author_enriched:!1}}),v.info("Autor removido")},N=n.agreement_groups,_=n.vision_urls,k=n.fullMatchingUrls,b=n.partialMatchingUrls,w=n.extraction_layers;return e.jsxs(ye,{value:s.id,className:"border border-border rounded-lg mb-2 overflow-hidden",children:[e.jsx(be,{className:"px-3 py-2 hover:no-underline gap-3",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:s.image_url,alt:s.title,className:"h-10 w-10 rounded object-cover shrink-0",loading:"lazy"}),e.jsxs("div",{className:"flex flex-col items-start min-w-0 flex-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground truncate w-full text-left",children:s.title}),e.jsxs("span",{className:"text-sm font-medium truncate w-full text-left",children:[s.author_name||e.jsx("span",{className:"text-muted-foreground italic",children:"Sem autor"}),n.author_username&&e.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:["@",n.author_username]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(cs,{confidence:n.author_extraction_confidence}),n.cross_validated&&e.jsxs(y,{variant:"outline",className:"text-[10px] border-green-500/40 text-green-600",children:[e.jsx(F,{className:"h-3 w-3 mr-0.5"})," Cross"]}),s.ai_needs_review&&e.jsxs(y,{variant:"destructive",className:"text-[10px]",children:[e.jsx(le,{className:"h-3 w-3 mr-0.5"})," Review"]}),n.used_vision&&e.jsx(y,{variant:"secondary",className:"text-[10px]",children:"V"}),n.used_gemini&&e.jsx(y,{variant:"secondary",className:"text-[10px]",children:"G"})]})]})}),e.jsx(Ae,{className:"px-3 pb-3",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-4 w-4 text-muted-foreground shrink-0"}),o?e.jsxs(e.Fragment,{children:[e.jsx(Ve,{value:t,onChange:r=>a(r.target.value),className:"h-8 text-sm flex-1",placeholder:"Nome do autor"}),e.jsx(p,{size:"sm",variant:"filled",onClick:u,disabled:m.isPending,children:"Salvar"}),e.jsx(p,{size:"sm",variant:"ghost",onClick:()=>{l(!1),a(s.author_name||"")},children:e.jsx(O,{className:"h-4 w-4"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm font-medium flex-1",children:s.author_name||"—"}),e.jsx(p,{size:"icon-sm",variant:"ghost",onClick:()=>l(!0),children:e.jsx($e,{className:"h-3.5 w-3.5"})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Fonte de extração:"}),e.jsx("span",{className:"ml-1 font-medium",children:n.author_extraction_source||"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Plataforma:"}),e.jsx("span",{className:"ml-1 font-medium",children:n.author_extraction_platform||"—"})]}),n.author_username&&e.jsxs("div",{className:"col-span-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Username:"}),e.jsxs("span",{className:"ml-1 font-medium text-primary",children:["@",n.author_username]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Confiança:"}),e.jsx("span",{className:"ml-1 font-medium",children:n.author_extraction_confidence!=null?`${Math.round(n.author_extraction_confidence*100)}%`:"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Agreement score:"}),e.jsx("span",{className:"ml-1 font-medium",children:n.agreement_score!=null?`${Math.round(n.agreement_score*100)}%`:"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Vision:"}),e.jsx("span",{className:"ml-1 font-medium",children:n.used_vision?"Sim":"Não"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Gemini:"}),e.jsx("span",{className:"ml-1 font-medium",children:n.used_gemini?"Sim":"Não"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Enriquecido em:"}),e.jsx("span",{className:"ml-1 font-medium",children:n.enriched_at?new Date(n.enriched_at).toLocaleStr
1ing("pt-BR"):"—"})]})]}),N&&N.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Grupos que concordaram:"}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:N.map(r=>e.jsx(y,{variant:"outline",className:"text-[10px]",children:r},r))})]}),w&&Object.keys(w).length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Camadas de extração:"}),e.jsx("div",{className:"mt-1 space-y-1",children:Object.entries(w).map(([r,c])=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(y,{variant:"secondary",className:"text-[10px] shrink-0",children:r}),e.jsx("span",{className:"truncate",children:typeof c=="string"?c:JSON.stringify(c)})]},r))})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Links utilizados:"}),s.source_url&&e.jsxs("a",{href:s.source_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-primary hover:underline truncate",children:[e.jsx($,{className:"h-3 w-3 shrink-0"})," Source: ",s.source_url]}),s.author_profile_url&&e.jsxs("a",{href:s.author_profile_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-primary hover:underline truncate",children:[e.jsx(J,{className:"h-3 w-3 shrink-0"})," Profile: ",s.author_profile_url]}),k?.map((r,c)=>e.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-primary hover:underline truncate",children:[e.jsx($,{className:"h-3 w-3 shrink-0"})," Full match: ",r]},`full-${c}`)),b?.map((r,c)=>e.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:underline truncate",children:[e.jsx($,{className:"h-3 w-3 shrink-0"})," Partial: ",r]},`partial-${c}`)),_?.map((r,c)=>e.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:underline truncate",children:[e.jsx(Fe,{className:"h-3 w-3 shrink-0"})," Vision: ",r]},`vision-${c}`))]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[s.ai_needs_review&&e.jsxs(p,{size:"sm",variant:"filled",onClick:d,disabled:m.isPending,children:[e.jsx(F,{className:"h-3.5 w-3.5 mr-1"})," Confirmar"]}),e.jsxs(p,{size:"sm",variant:"destructive",onClick:h,disabled:m.isPending,children:[e.jsx(O,{className:"h-3.5 w-3.5 mr-1"})," Remover Autor"]})]})]})})]})}function ds({onComplete:s}){const[t,a]=f.useState(null),[o,l]=f.useState(!1),[i,n]=f.useState(!1),x=async()=>{l(!0);try{const{data:u,error:d}=await C.functions.invoke("cleanup-generic-authors",{body:{dry_run:!0,limit:2e3}});if(d)throw d;a(u)}catch(u){v.error("Erro ao escanear: "+u.message)}finally{l(!1)}},m=async u=>{n(!0);try{const{data:d,error:h}=await C.functions.invoke("cleanup-generic-authors",{body:{dry_run:!1,re_enrich:u,limit:2e3}});if(h)throw h;v.success(`Limpeza concluída: ${d.cleaned} itens limpos${u?`, ${d.re_enrich_queued} re-enriquecendo`:""}`),a(null),s()}catch(d){v.error("Erro na limpeza: "+d.message)}finally{n(!1)}};return e.jsxs(S,{className:"mb-6",children:[e.jsx(Ke,{className:"p-3 pb-2",children:e.jsxs(Le,{className:"text-sm flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4"}),"Limpar Nomes Genéricos"]})}),e.jsxs(q,{className:"p-3 pt-0 space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:'Escaneia autores com nomes genéricos (ex: "pin", "behance", "The Brand Identity") e reseta para reprocessamento.'}),t?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-muted rounded-lg p-3",children:[e.jsxs("p",{className:"text-sm font-medium text-foreground",children:[t.generic_found," nomes genéricos encontrados",e.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:["(de ",t.total_scanned," escaneados)"]})]}),t.generic_names?.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:t.generic_names.slice(0,20).map(u=>e.jsxs(y,{variant:"destructive",className:"text-[10px]",children:[u.name," (",u.count,")"]},u.name))})]}),t.generic_found>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(p,{size:"sm",variant:"destructive",disabled:i,children:[e.jsx(O,{className:"h-3.5 w-3.5 mr-1"}),"Limpar ",t.generic_found," itens"]})}),e.jsxs(ae,{children:[e.jsxs(re,{children:[e.jsx(te,{children:"Confirmar limpeza"}),e.jsxs(ne,{children:["Isso vai resetar ",t.generic_found," autores com nomes genéricos. Os itens serão marcados para reprocessamento."]})]}),e.jsxs(ie,{children:[e.jsx(oe,{children:"Cancelar"}),e.jsx(K,{onClick:()=>m(!1),children:"Só limpar"}),e.jsx(K,{onClick:()=>
1m(!0),children:"Limpar + Re-enriquecer"})]})]})]}),e.jsx(p,{size:"sm",variant:"ghost",onClick:()=>a(null),disabled:i,children:"Cancelar"})]})]}):e.jsxs(p,{size:"sm",variant:"outline",onClick:x,disabled:o,children:[o?e.jsx(ce,{className:"h-3.5 w-3.5 mr-1 animate-spin"}):e.jsx(le,{className:"h-3.5 w-3.5 mr-1"}),o?"Escaneando...":"Escanear Genéricos"]})]})]})}function _s(){const[s,t]=f.useState("all"),[a,o]=f.useState(0),[l,i]=f.useState(!1),[n,x]=f.useState(!1),m=Z(),{data:u}=os(),{data:d,isLoading:h,refetch:N}=is(s,a),_=d?Math.ceil(d.total/E):0,k=()=>{m.invalidateQueries({queryKey:["admin-author-enrichment"]}),m.invalidateQueries({queryKey:["admin-author-enrichment-stats"]}),N()},b=async()=>{if(!d?.items.length)return;const r=d.items.filter(c=>c.ai_needs_review);if(r.length===0){v.info("Nenhum item para confirmar");return}i(!0);try{const c=r.map(I=>I.id),{error:A}=await C.from("clip_vectors").update({ai_needs_review:!1}).in("id",c);if(A)throw A;v.success(`${c.length} itens confirmados`),m.invalidateQueries({queryKey:["admin-author-enrichment"]}),m.invalidateQueries({queryKey:["admin-author-enrichment-stats"]})}catch(c){v.error("Erro: "+c.message)}finally{i(!1)}},w=async()=>{x(!0);try{const{data:r,error:c}=await C.functions.invoke("re-enrich-authors",{body:{dry_run:!1,limit:50,include_no_author:!0,include_failed:!0}});if(c)throw c;v.success(`Re-enriquecimento: ${r.enriched||0} enriquecidos, ${r.skipped||0} pulados, ${r.failed||0} falharam`),m.invalidateQueries({queryKey:["admin-author-enrichment"]}),m.invalidateQueries({queryKey:["admin-author-enrichment-stats"]})}catch(r){v.error("Erro ao buscar novos: "+r.message)}finally{x(!1)}};return e.jsxs(Qe,{title:"Revisão de autores por IA",description:"Revisão dos resultados do sistema de busca por autor via IA",width:"narrow",actions:e.jsx(p,{variant:"ghost",size:"icon-sm",onClick:()=>N(),children:e.jsx(ce,{className:"h-4 w-4"})}),children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(p,{size:"sm",variant:"outline",disabled:l||!d?.items.some(r=>r.ai_needs_review),children:[e.jsx(F,{className:"h-3.5 w-3.5 mr-1"}),l?"Confirmando...":"Confirmar Todos Visíveis"]})}),e.jsxs(ae,{children:[e.jsxs(re,{children:[e.jsx(te,{children:"Confirmar todos visíveis?"}),e.jsxs(ne,{children:["Isso vai marcar ",d?.items.filter(r=>r.ai_needs_review).length||0," itens como revisados (ai_needs_review = false)."]})]}),e.jsxs(ie,{children:[e.jsx(oe,{children:"Cancelar"}),e.jsx(K,{onClick:b,children:"Confirmar Todos"})]})]})]}),e.jsxs(p,{size:"sm",variant:"outline",onClick:w,disabled:n,children:[e.jsx(L,{className:"h-3.5 w-3.5 mr-1"}),n?"Buscando...":"Buscar Novos"]})]}),u&&e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-6",children:[e.jsx(S,{children:e.jsxs(q,{className:"p-3 text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-foreground",children:u.total}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wide",children:"Enriquecidas"})]})}),e.jsx(S,{children:e.jsxs(q,{className:"p-3 text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-destructive",children:u.needsReview}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wide",children:"Pendentes"})]})}),e.jsx(S,{children:e.jsxs(q,{className:"p-3 text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-green-600",children:u.crossValidated}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wide",children:"Cross-Validated"})]})})]}),e.jsx(ds,{onComplete:k}),e.jsx(ze,{value:s,onValueChange:r=>{t(r),o(0)},className:"mb-6",children:e.jsxs(Te,{className:"w-full flex-wrap h-auto",children:[e.jsx(R,{value:"all",className:"text-xs",children:"Todas"}),e.jsx(R,{value:"needs_review",className:"text-xs",children:"Needs Review"}),e.jsx(R,{value:"cross_validated",className:"text-xs",children:"Cross-Validated"}),e.jsx(R,{value:"vision",className:"text-xs",children:"Vision"}),e.jsx(R,{value:"gemini",className:"text-xs",children:"Gemini"})]})}),h?e.jsx("div",{className:"space-y-2",children:Array.from({length:10}).map((r,c)=>
1e.jsx("div",{className:"h-14 rounded-lg bg-muted animate-pulse"},c))}):d&&d.items.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:["Mostrando ",a*E+1,"–",Math.min((a+1)*E,d.total)," de ",d.total]}),e.jsx(ns,{type:"multiple",className:"space-y-0",children:d.items.map(r=>e.jsx(ls,{item:r},r.id))}),_>1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-6",children:[e.jsx(p,{variant:"outline",size:"sm",disabled:a===0,onClick:()=>o(r=>r-1),children:"Anterior"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[a+1," / ",_]}),e.jsx(p,{variant:"outline",size:"sm",disabled:a>=_-1,onClick:()=>o(r=>r+1),children:"Próxima"})]})]}):e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(L,{className:"h-10 w-10 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"Nenhuma imagem enriquecida encontrada para este filtro."})]})]})}export{_s as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.