PageSourceSearch

https://m29.ai/_next/static/chunks/app/factcheck/page-412eeddc1913c72b.js

js m29.ai collected 2026-10-05 15:38:33 UTC 14,528 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4675],{83964:function(e,t,r){Promise.resolve().then(r.bind(r,35115))},22271:function(e,t,r){"use strict";var s=r(57437);t.Z=e=>{let{type:t="decor"}=e;return(0,s.jsx)("div",{className:"absolute top-0 left-0 w-full h-screen overflow-hidden -z-10",children:(0,s.jsx)("div",{style:{backgroundImage:"".concat("union"===t?"url('/background/Union.png')":"url('/background/decor.png')"),backgroundRepeat:"no-repeat",backgroundSize:"contain"},className:"absolute top-0 -z-10 w-[1227px] h-[599px] ".concat("union"===t?" max-w-7xl mx-auto left-1/2 -translate-x-1/2":"left-0")})})}},35115:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return ee}});var s,a,n=r(57437),l=r(2265),o=r(99376),i=r(20092),c=r(22271),d=r(61994),u=r(53335);function m(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,u.m6)((0,d.W)(t))}let x=l.forwardRef((e,t)=>{let{className:r,type:s,...a}=e;return(0,n.jsx)("input",{type:s,className:m("flex h-12 w-full rounded-full px-4 py-2 text-sm bg-white border border-gray-300 focus:outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-200 transition-all duration-200",r),ref:t,...a})});x.displayName="Input";let f={default:"bg-blue-600 text-white hover:bg-blue-700",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},h=l.forwardRef((e,t)=>{let{className:r,variant:s="default",size:a="default",...l}=e;return(0,n.jsx)("button",{className:m("inline-flex items-center justify-center rounded-full text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none",f[s],{default:"h-12 px-6 py-2",sm:"h-9 rounded-md px-3",lg:"h-14 roun
1ded-md px-8",icon:"h-10 w-10"}[a],r),ref:t,...l})});h.displayName="Button";var g=r(90535);let p=(0,g.j)("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-red-500 text-red-700 bg-red-50"}},defaultVariants:{variant:"default"}}),b=l.forwardRef((e,t)=>{let{className:r,variant:s,...a}=e;return(0,n.jsx)("div",{ref:t,role:"alert",className:m(p({variant:s}),r),...a})});b.displayName="Alert";var v=r(51817),j=r(74847),w=r(49089);let N=[{name:"Processing",icon:w.KoQ,color:"text-blue-500"},{name:"Information Gathering",icon:w.DAO,color:"text-yellow-500"},{name:"Fact Checking",icon:w.pno,color:"text-purple-500"},{name:"Analysis",icon:w.NMh,color:"text-red-500"},{name:"Finalizing",icon:w.FJM,color:"text-green-500"}];var y=e=>{let{progress:t}=e,r=Math.floor(t/(100/N.length));return(0,n.jsxs)("div",{className:"relative w-full max-w-3xl mx-auto p-8 bg-white-100 rounded-lg shadow-lg",children:[(0,n.jsx)(j.E.div,{className:"absolute top-0 left-0 h-2 bg-gradient-to-r from-blue-500 via-yellow-500 to-red-500 rounded-t-lg",initial:{width:0},animate:{width:"".concat(t,"%")},transition:{duration:.5}}),(0,n.jsx)("div",{className:"flex justify-between items-start mb-4 relative",children:N.map((e,t)=>{let s=e.icon,a=t<=r,l=t===r;return(0,n.jsxs)("div",{className:"flex flex-col items-center w-1/5",children:[(0,n.jsx)(j.E.div,{className:"w-16 h-16 rounded-full flex items-center justify-center ".concat(a?"bg-white shadow-lg":"bg-gray-200"," ").concat(l?"ring-4 ring-green-400 animate-pulse":""),initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.2*t},children:(0,n.jsx)(s,{className:"w-8 h-8 ".concat(a?e.color:"text-gray-400")})}),(0,n.jsx)(j.E.p,{className:"mt-2 text-xs font-medium text-center ".concat(a?"text-gray-800":"text-gray-400"),initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.2*t+.1},children:e.name})]},t)})})]})},k=()=>{let[e,t]=(0,l.useState)({url:"",isChecking:!1,error:null,factChecks:[],progress:0,message:""}),r=(0,l.useCallback)(e=>{console.log("Setting URL: ".concat(e)),t(t=>({...t,url:e}))},[]),s=(0,l.useCallback)(async()=>{t(e=>({...e,isChecking:!0,error:null,factChecks:[],progress:0,message:"Starting fact check..."}));try{var r;let s=await fetch("/api/factcheck",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e.url})});if(!s.ok)throw console.error("Failed to fetch fact checks"),Error("Failed to fetch fact checks");let a=null===(r=s.body)||void 0===r?void 0:r.getReader(),n=new TextDecoder,l=!1;for(;!l;){let{value:e,done:r}=await (null==a?void 0:a.read());for(let s of(l=r,n.decode(e,{stream:!0}).split("\n")))if(s.trim()){let{progress:e,message:r,factChecks:a}=JSON.parse(s);t(t=>({...t,progress:e,message:r,factChecks:a||t.factChecks}))}}t(e=>({...e,isChecking:!1,progress:100,message:"Fact check completed successfully"}))}catch(e){console.error("Error during fact check:",e),t(t=>({...t,isChecking:!1,error:e instanceof Error?e.message:"An error occurred",progress:0,message:"Error during fact check"}))}},[e.url]);return{...e,setUrl:r,startFactCheck:s}};let C=(0,g.j)("rounded-lg border bg-card text-card-foreground shadow-sm transition-all duration-200",{variants:{variant:{default:"border-gray-200",outline:"border-2",ghost:"border-transparent shadow-none"},size:{default:"p-6",sm:"p-4",lg:"p-8"},hover:{default:"hover:shadow-md",lift:"hover:-translate-y-1 hover:shadow-md",glow:"hover:shadow-lg hover:shadow-primary/50"}},defaultVariants:{variant:"default",size:"default",hover:"default"}}),R=l.forwardRef((e,t)=>{let{className:r,variant:s,size:a,hover:l,...o}=e;return(0,n.jsx)("div",{ref:t,className:m(C({variant:s,size:a,hover:l,className:r})),...o})});R.displayName="Card";let E=l.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:m("flex flex-col space-y-1.5 p-6",r),...s})});E.displayName="CardHeader",l.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("h3",{ref:t,className:m("text-2xl font-semibold leading-none tracking-tight",r),...s})}).displayName="CardTitle",l.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("p",{ref:t,className:m("text-sm text-muted-foreground",r),...s})}).displayName="CardDescription";let F=l.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:m("p-6 pt-0",r),...s})});F.displayName="CardContent";let T=l.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)("div",{ref:t,className:m("flex items-center p-6 pt-0",r),...s})});T.displayName="CardFooter";let S=(0,g.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-100 text-green-800 hover:bg-green-200",warning:"border-transparent bg-yellow-100 text-yellow-800 hover:bg-yellow-200",info:"border-transparent bg-blue-100 text-blue-800 hover:bg-blue-200"}},defaultVariants:{variant:"default"}});function L(e){let{className:t,variant:r,icon:s,children:a,...l}=e;return(0,n.jsxs)("div",{className:m(S({variant:r}),t),...l,children:[s&&(0,n.jsx)("span",{className:"mr-1",children:s}),a]})}var Z=r(41671),A=r(76865),U=r(99388),z=r(75368),I=r(68919),_=r(71769),O=r(96362),M=r(86595),P=r(22135),V=r(40875),Y=r(33245),B=r(69711);let D=B.zt,J=B.fC,W=B.xz,G=l.forwardRef((e,t)=>{let{className:r,sideOffset:s=4,...a}=e;return(0,n.jsx)(B.VY,{ref:t,sideOffset:s,className:m("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]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...a})});G.displayName=B.VY.displayName,(s=a||(a={})).TRUE="TRUE",s.PARTLY_TRUE="PARTLY TRUE",s.FALSE="FALSE",s.UNVERIFIABLE="UNVERIFIABLE";let H=e=>{switch(e){case a.TRUE:return{color:"bg-green-100 text-green-800",icon:Z.Z,label:"True"};case a.PARTLY_TRUE:return{color:"bg-yellow-100 text-yellow-800",icon:A.Z,label:"Partly True"};case a.FALSE:return{color:"bg-red-100 text-red-800",icon:U.Z,label:"False"};default:return{color:"bg-blue-100 text-blue-800",icon:z.Z,label:"Unverifiable"}}},K=e=>{let t='Fact check: "'.concat(e.statement,'" - ').concat(e.rating,". ").concat(window.location.href),r="https://twitter.com/intent/tweet?text=".concat(encodeURIComponent(t));window.open(r,"_blank")},Q=e=>{let{check:t}=e,[r,s]=(0,l.useState)(!1),{color:a,icon:o,label:i}=H(t.rating),c=void 0!==t.confidence?(100*t.confidence).toFixed(0)+"%":"N/A";return(0,n.jsxs)(R,{className:"w-full",children:[(0,n.jsxs)(E,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)(L,{variant:"outline",className:"".concat(a," px-2 py-1"),children:[(0,n.jsx)(o,{className:"w-4 h-4 mr-2"}),i]}),(0,n.jsx)(D,{children:(0,n.jsxs)(J,{children:[(0,n.jsx)(W,{asChild:!0,children:(0,n.jsx)(h,{variant:"ghost",size:"icon",onClick:()=>K(t),children:(0,n.jsx)(I.Z,{className:"w-5 h-5"})})}),(0,n.jsx)(G,{children:(0,n.jsx)("p",{children:"Share on Twitter"})})]})})]}),(0,n.jsx)("h3",{className:"text-lg font-semibold mt-2",children:t.statement})]}),(0,n.jsxs)(F,{children:[(0,n.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:r?t.explanation:"".concat(t.explanation.slice(0,100),"...")}),r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsx)("h4",{className:"text-sm font-semibold mb-2",children:"Evidence:"}),(0,n.jsx)("p",{className:"text-sm text-gray-600",children:t.evidence})]}),(0,n.jsxs)("div",{className:"mt-4",children:[t.sources&&t.sources.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("h4",{className:"text-sm font-semibold mb-2 flex items-center",children:[(0,n.jsx)(_.Z,{className:"w-4 h-4 mr-2"}),"Sources:"]}),(0,n.jsx)("ul",{className:"list-disc pl-5",children:t.sources.map((e,t)=>(0,n.jsx)("li",{children:(0,n.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline text-sm",children:[e.name||"Source Link",(0,n.jsx)(O.Z,{className:"w-3 h-3 inline ml-1"})]})},t))})]}),(0,n.jsxs)("div",{className:"mt-4 flex items-center",children:[(0,n.jsx)(M.Z,{className:"w-4 h-4 text-gray-600 mr-2"}),(0,n.jsxs)("span",{className:"text-sm font-medium text-gray-600",children:["Confidence: ",c]})]})]})]})]}),(0,n.jsx)(T,{children:(0,n.jsx)(h,{variant:"ghost",onClick:()=>s(!r),className:"w-full",children:r?(0,n.jsxs)(n.Fragment,{children:["Show Less ",(0,n.jsx)(P.Z,{className:"ml-2 w-4 h-4"})]}):(0,n.jsxs)(n.Fragment,{children:["Show More ",(0,n.jsx)(V.Z,{className:"ml-2 w-4 h-4"})]})})})]})};var q=e=>{let{factChecks:t}=e;return(0,n.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold text-center mb-8",children:"Fact-Checking Results"}),(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map((e,t)=>(0,n.jsx)(Q,{check:e},t))}),(0,n.jsxs)("div",{className:"mt-12 text-sm text-gray-600 p-6 bg-yellow-50 rounded-lg flex items-start",children:[(0,n.jsx)(Y.Z,{className:"w-5 h-5 mr-3 mt-0.5 flex-shrink-0"}),(0,n.jsx)("p",{children:"Note: Fact check results may contain biases. We strive for objectivity and involve humans to validate the checks. This is a work in progress. Over time, our models aim to provide accurate, current, and objective facts."})]})]})};function X(){let{url:e,setUrl:t,isChecking:r,error:s,factChecks:a,startFactCheck:o}=k(),[i,c]=(0,l.useState)(0);return(0,l.useEffect)(()=>{if(r){let e=setInterval(()=>{c(e=>e>=75?75:Math.floor(e+5*Math.random()))},500);return()=>clearInterval(e)}c(0)},[r]),(0,n.jsx)("div",{className:"min-h-screen bg-white-50 py-12 px-4 sm:px-6 lg:px-8",children:(0,n.jsxs)("div",{className:"w-full mx-auto",children:[(0,n.jsxs)("div",{className:"text-center mb-8",children:[(0,n.jsx)("h1",{className:"text-4xl font-bold text-gray-900 mb-2",children:"Fact Check"}),(0,n.jsx)("p",{className:"text-xl text-gray-600",children:"For more truth in politics"})]}),(0,n.jsx)("form",{onSubmit:e=>{e.preventDefault(),o()},className:"mb-8",children:(0,n.jsxs)("div",{className:"flex items-center bg-white shadow-lg rounded-lg overflow-hidden border border-gray-300 hover:shadow-xl transition-shadow duration-200 w-full",children:[(0,n.jsx)(x,{value:e,onCh
1ange:e=>t(e.target.value),placeholder:"Enter YouTube URL",className:"flex-grow border-none focus:ring-0 text-lg py-3 px-4"}),(0,n.jsxs)(h,{type:"submit",disabled:r,className:"px-8 py-3 bg-blue-500 hover:bg-blue-600 text-white transition-colors duration-200",children:[r?(0,n.jsx)(v.Z,{className:"mr-2 h-5 w-5 animate-spin"}):(0,n.jsx)("svg",{className:"mr-2 h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),r?"Checking...":"Check"]})]})}),s&&(0,n.jsx)(b,{variant:"destructive",className:"mb-8",children:s}),r&&(0,n.jsx)("div",{className:"mt-10",children:(0,n.jsx)(y,{progress:i})}),!r&&a.length>0&&(0,n.jsx)(q,{factChecks:a}),!r&&0===a.length&&(0,n.jsx)("div",{className:"text-center mt-12",children:(0,n.jsx)("p",{className:"text-gray-600",children:"Enter a YouTube URL to begin."})})]})})}var $=r(17171),ee=()=>{let{user:e,loading:t}=(0,$.b)(),r=(0,o.useRouter)();return((0,l.useEffect)(()=>{t||e||r.push("/login")},[e,t,r]),t)?(0,n.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,n.jsx)("div",{className:"spinner-border animate-spin inline-block w-8 h-8 border-4 rounded-full",role:"status"})}):e?(0,n.jsxs)("div",{className:"relative w-full min-h-screen flex flex-col items-center",children:[(0,n.jsx)(i.Z,{}),(0,n.jsx)(c.Z,{type:"decor"}),(0,n.jsxs)("main",{className:"w-full flex-grow flex flex-col items-center justify-center p-4",children:[(0,n.jsx)("p",{className:"text-lg text-gray-600 text-center mb-8"}),(0,n.jsx)(X,{})]})]}):null}}},function(e){e.O(0,[4533,7699,3876,3240,3145,9658,92,2971,2117,1744],function(){return e(e.s=83964)}),_N_E=e.O()}]);

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.