1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5844],{564:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/punti-di-vista/factchecking/_app/_components/Quiz",function(){return n(93816)}])},93816:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return a}});var s=n(11527),r=n(50959),i=n(15637),a=!0;t.default=e=>{let{question:t,currentIndex:n,totalQuestions:a,onAnswer:d}=e,[l,o]=(0,r.useState)(null),[c,u]=(0,r.useState)(!1),x=n/a*100,b=t.choices.some(e=>e.isCorrect),m=e=>{if(c)return;o(e);let s=t.choices.find(t=>t.id===e);if(!s)return;let r=!b||!!s.isCorrect,a=b?r?"correct":"wrong":"skipped";t.explanation?u(!0):setTimeout(()=>{d(s.points,a),o(null)},300),(0,i.dispatchQuizEvent)({quiz_id:"green-deal",quiz_title:"Green Deal, energia e futuro: quanto sei pronto per la transizione verde?",event:"quiz_answer",question_id:t.id.toString(),question_text:t.explanation||"",question_number:n+1,answer_given:s.id.toString(),is_correct:r,answer_status:a})};return(0,s.jsxs)("div",{className:"flex flex-col min-h-[480px] md:min-h-[550px]",children:[(0,s.jsx)("div",{className:"bg-slate-100 h-1.5 md:h-2 w-full",children:(0,s.jsx)("div",{className:"bg-brand-blue h-full transition-all duration-700 ease-out",style:{width:"".concat(x,"%")}})}),(0,s.jsxs)("div",{className:"p-5 md:p-10 flex-grow flex flex-col",children:[(0,s.jsxs)("div",{className:"mb-4 md:mb-6 flex justify-between items-center",children:[(0,s.jsx)("span",{className:"px-2.5 py-0.5 bg-brand-blue-light text-brand-blue text-[9px] md:text-[10px] font-extrabold rounded-full uppercase tracking-widest border border-brand-blue/10",children:t.theme}),(0,s.jsxs)("p",{className:"text-slate-400 text-[10px] md:text-xs font-bold uppercase tracking-tighter",children:[n+1," / ",a]})]}),(0,s.jsx)("h2",{className:"text-lg md:text-2xl font-bold text-slate-800 mb-6 md:mb-8 leading-snug",children:t.text}),(0,s.jsx)("div",{className:"space-y-2.5 md:space-y-3 mb-6 md:mb-8",children:t.choices.map(e=>(0,s.jsxs)("button",{onClick:()=>m(e.id),disabled:c,className:"w-full text-left p-3.5 md:p-4 rounded-xl border-2 transition-all flex items-center gap-3 md:gap-4 ".concat(l===e.id?"border-brand-blue bg-brand-blue-light text-brand-blue shadow-sm":"border-slate-100 hover:border-slate-200 hover:bg-slate-50 text-slate-700"," ").concat(c&&b&&!e.isCorrect&&l===e.id?"border-red-500 bg-red-50":""," ").concat(c&&b&&e.isCorrect?"border-green-500 bg-green-50 !opacity-100":""," ").concat(c&&b&&!e.isCorrect&&l!==e.id?"opacity-40 grayscale-[0.5]":""),children:[(0,s.jsx)("div",{className:"w-7 h-7 md:w-8 md:h-8 flex-shrink-0 rounded-lg flex items-center justify-center font-bold text-xs md:text-sm ".concat(l===e.id?b&&!1===e.isCorrect&&c?"bg-red-500 text-white":"bg-brand-blue text-white":b&&e.isCorrect&&c?"bg-green-500 text-white":"bg-slate-100 text-slate-500"),children:e.id.toUpperCase()}),(0,s.jsx)("span",{className:"font-semibold text-xs md:text-base leading-tight md:leading-normal",children:e.text}),c&&b&&e.isCorrect&&(0,s.jsx)("span",{className:"ml-auto text-green-600 font-bold shrink-0",children:"â"}),c&&b&&!e.isCorrect&&l===e.id&&(0,s.jsx)("span",{className:"ml-auto text-red-600 font-bold shrink-0",children:"â"})]},e.id))}),c&&(0,s.jsxs)("div",{className:"mt-auto p-5 md:p-6 bg-blue-50 border border-blue-200 rounded-2xl md:rounded-3xl mb-4 animate-in fade-in slide-in-from-bottom-2 duration-300 shadow-sm",children:[(0,s.jsxs)("p",{className:"text-xs md:text-sm text-blue-900 leading-relaxed",children:[(0,s.jsx)("span",{className:"font-black text-[10px] md:text-xs uppercase tracking-widest text-brand-blue block mb-1.5 md:mb-2",children:"\uD83D\uDCA1 Lo sapevi che?"}),t.explanation]}),(0,s.jsx)("button",{onClick:()=>{let e=t.choices.find(e=>e.id===l);if(e){let t=!b||!!e.isCorrect,n=b?t?"correct":"wrong":"skipped";d(e.points,n),o(null),u(!1)}},className:"mt-4 md:mt-6 w-full py-3.5 md:py-4 bg-brand-blue text-white rounded-xl font-black text-xs md:text-sm uppercase tracking-widest shadow-lg shadow-brand-blue/20 hover:bg-brand-blue-hover transition-all active:scale-95",children:"Continua la sfida"})]})]})]})}},15637:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return r},default:function(){return a},dispatchQuizEvent:function(){return i}});let s=0;var r=!0;function i(e,t){window.dataLayer=window.dataLayer||[];try{let n=e.event,{event:r,...i}=e,a=window.self!==window.top;if("function"==typeof window.gtag){let e={...i,is_embed:a};t&&(e.send_to=t),e.transport_type="xhr";let r=Date.now(),d=r-s,l=d<50?50-d:0;l>0?setTimeout(()=>{window.gtag("event",n,e),s=Date.now()},l):(window.gtag("event",n,e),s=r)}else{let n={...e,is_embed:a};t&&(n.send_to=t),window.dataLayer.push(n)}}catch(t){console.error("Error dispatching quiz event:",t,e)}}function a(){return null}}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=564)}),_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.