PageSourceSearch

https://www.quotidiano.net/_next/static/chunks/pages/punti-di-vist…/_app/_components/Quiz-ad6e2dd638426126.js

js quotidiano.net collected 2026-09-24 08:47:08 UTC 5,342 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2987],{83918:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/punti-di-vista/euroquiz/_app/_components/Quiz",function(){return n(81535)}])},81535:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return s}});var i=n(11527),l=n(50959),r=n(15637),s=!0;t.default=e=>{var t,n;let{question:s,currentIndex:d,totalQuestions:a,onAnswer:o}=e,[c,u]=(0,l.useState)(null),[x,b]=(0,l.useState)(!1);if(!s)return null;let m=d/a*100,p=null==s?void 0:null===(t=s.choices)||void 0===t?void 0:t.some(e=>e.isCorrect),h=e=>{var t;if(x)return;u(e);let n=null==s?void 0:null===(t=s.choices)||void 0===t?void 0:t.find(t=>t.id===e);if(!n)return;(null==s?void 0:s.explanation)&&p?b(!0):b(!1);let i=!p||!!n.isCorrect;(0,r.dispatchQuizEvent)({quiz_id:"euroquiz",quiz_title:"Sei un vero europeista?",event:"quiz_answer",question_id:s.id.toString(),question_text:s.explanation||"",question_number:d+1,answer_given:n.id.toString(),is_correct:i,answer_status:p?i?"correct":"wrong":"skipped"})},f=()=>{var e;let t=null==s?void 0:null===(e=s.choices)||void 0===e?void 0:e.find(e=>e.id===c);if(t){let e=!p||!!t.isCorrect;o(t.points,p?e?"correct":"wrong":"skipped"),u(null),b(!1)}};return(0,i.jsxs)("div",{className:"flex flex-col min-h-[480px] md:min-h-[550px]",children:[(0,i.jsx)("div",{className:"bg-slate-100 h-1.5 md:h-2 w-full",children:(0,i.jsx)("div",{className:"bg-brand-blue h-full transition-all duration-700 ease-out",style:{width:"".concat(m,"%")}})}),(0,i.jsxs)("div",{className:"p-5 md:p-10 flex-grow flex flex-col",children:[(0,i.jsxs)("div",{className:"mb-4 md:mb-6 flex justify-between items-center",children:[(0,i.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:null==s?void 0:s.theme}),(0,i.jsxs)("p",{className:"text-slate-400 text-[10px] md:text-xs font-bold uppercase tracking-tighter",children:[d+1," / ",a]})]}),(0,i.jsx)("h2",{className:"text-lg md:text-2xl font-bold text-slate-800 mb-6 md:mb-8 leading-snug",children:null==s?void 0:s.text}),(0,i.jsx)("div",{className:"space-y-2.5 md:space-y-3 mb-6 md:mb-8",children:null==s?void 0:null===(n=s.choices)||void 0===n?void 0:n.map(e=>(0,i.jsxs)("button",{onClick:()=>h(e.id),disabled:x,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(c===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(x&&!e.isCorrect&&c!==e.id?"opacity-40 grayscale-[0.5]":""," ").concat(x&&e.isCorrect?"border-green-500 bg-green-50 !opacity-100":""," ").concat(x&&!e.isCorrect&&c===e.id?"border-red-500 bg-red-50":""),children:[(0,i.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(c===e.id?!1===e.isCorrect&&x?"bg-red-500 text-white":"bg-brand-blue text-white":e.isCorrect&&x?"bg-green-500 text-white":"bg-slate-100 text-slate-500"),children:e.id.toUpperCase()}),(0,i.jsx)("span",{className:"font-semibold text-xs md:text-base leading-tight md:leading-normal",children:e.text}),x&&e.isCorrect&&(0,i.jsx)("span",{className:"ml-auto text-green-600 font-bold shrink-0",children:"✓"}),x&&!e.isCorrect&&c===e.id&&(0,i.jsx)("span",{className:"ml-auto text-red-600 font-bold shrink-0",children:"✕"})]},e.id))}),c&&!x&&(0,i.jsx)("button",{onClick:f,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"}),x&&(0,i.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,i.jsxs)("p",{className:"text-xs md:text-sm text-blue-900 leading-relaxed",children:[(0,i.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?"}),null==s?void 0:s.explanation]}),(0,i.jsx)("button",{onClick:f,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 l},default:function(){return s},dispatchQuizEvent:function(){return r}});let i=0;var l=!0;function r(e,t){window.dataLayer=window.dataLayer||[];try{let n=e.event,{event:l,...r}=e,s=window.self!==window.top;if("function"==typeof window.gtag){let e={...r,is_embed:s};t&&(e.send_to=t),e.transport_type="xhr";let l=Date.now(),d=l-i,a=d<50?50-d:0;a>0?setTimeout(()=>{window.gtag("event",n,e),i=Date.now()},a):(window.gtag("event",n,e),i=l)}else{let n={...e,is_embed:s};t&&(n.send_to=t),window.dataLayer.push(n)}}catch(t){console.error("Error dispatching quiz event:",t,e)}}function s(){return null}}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=83918)}),_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.