text: let socket=null;const MessageHandler={Error:{INVALID_USER_INPUT:()=>{console.log("WS Message ERR: 无效的用户输入")},INVALID_PIN:()=>(new LoginPage(!1),new ErrorHandler("PIN码无效")),MAX_SESSION_COUNT:()=>{setTimeout((()=>{new ErrorHandler("您的IP地址当前连接了太多会话/标签。"),activateLoading(!0,!0,"会话过多。 请稍候。"),setTimeout((()=>{resetGame()}),3e4)}),5e3)},INVALID_NAME:e=>(clearTimeout(game.handshakeTimeout),"Duplicate name"!==e.description?(new ErrorHandler("连接失败: "+(e.error||e)),new LoginPage):(new ErrorHandler("名称无效。"),new LoginPage(!0))),SESSION_NOT_CONNECTED:()=>{new ErrorHandler("您还不能这样做； 您尚未加入游戏。")},EMPTY_NAME:()=>{new ErrorHandler("没有提供测验名称。 在提供此信息之前，服务器不会搜索。")},HANDSHAKE:()=>{let e;switch(clearTimeout(game.handshakeTimeout),new ErrorHandler("与Kahoot服务器的连接被阻止。 ¯\\_(ツ)_/¯"),document.getElementById("handshake-fail-div")&&(document.getElementById("handshake-fail-div").outerHTML=""),detectPlatform()){case"Windows":e="https://www.mediafire.com/file/ju7sv43qn9pcio6/kahoot-win-win.zip/file";break;case"MacOS":e="https://www.mediafire.com/file/bcvxlwlfvbswe62/Kahoot_Winner.dmg/file";break;default:e="https://www.mediafire.com/file/zb5blm6a8dyrwtb/kahoot-win-linux.tar.gz/file"}const t=document.createElement("div");t.innerHTML=`<span>嗯，我们似乎在遇到麻烦。 尝试<span class="mobihide">下载我们的应用程序或</span>按下下面的报告按钮！</span>\n      <br>\n      <a class="mobihide" href="${e}" onclick="dataLayer.push({event:'download_app'})" target="_blank">下载应用程式</a>\n      <br>\n      <button onclick="send({type:'HANDSHAKE_ISSUES',message:'AAAA!'});this.innerHTML = '已报告问题。';this.onclick = null;dataLayer.push({event:'report_error'});" title="此按钮可能会减少重置服务器的时间。">报告问题</button>`,t.id="handshake-fail-div",t.style="\n        position: fixed;\n        top: 4rem;\n        z-index: 1000;\n        width: 100%;\n        color: white;\n        background: #888;\n        text-align: center;\n        border-radius: 5rem;\n      ",document.body.append(t)},PRIVATE_ID:()=>{new ErrorHandler("提供的测验ID无效或属于私人测验")}},Message:{SetName:e=>{document.getElementById("loginInput").value=e},PinGood:e=>{const t=e.match(/\d+/g)[0];t!=game.pin&&(game.pin=t);try{TutorialDiv.innerHTML=""}catch(e){}return new LoginPage(!0)},JoinSuccess:e=>("Music"===game.theme?game.playSound("/resource/music/lobby.m4a"):"Minecraft"===game.theme&&game.playSound("/resource/music/Minecraft.mp3"),e=JSON.parse(e),game.cid=e.cid,game.quizEnded=!1,dataLayer.push({event:"join_game"}),activateLoading(!1,!1),clearTimeout(game.handshakeTimeout),new LobbyPage),QuizStart:()=>{try{game.music.pause()}catch(e){}return new QuizStartPage},QuestionGet:e=>{const t=JSON.parse(e);return new GetReadyPage(t)},QuestionBegin:e=>(game.questionAnswered=!1,new QuestionAnswererPage(JSON.parse(e))),QuestionSubmit:e=>(game.questionAnswered=!0,new QuestionSnarkPage(e)),QuestionEnd:e=>{try{game.music.pause()}catch(e){}return new QuestionEndPage(e)},QuizFinish:e=>{game.quizEnded=!0,game.end.info=JSON.parse(e),dataLayer.push(Object.assign({event:"quiz_finish"},JSON.parse(e)))},FinishText:e=>("Music"===game.theme?game.playSound("/resource/music/podium.m4a"):"Minecraft"===game.theme&&game.playSound("/resource/music/Pigstep.m4a"),new QuizEndPage(e)),QuizEnd:e=>(game.quizEnded=!0,resetGame(),setTimeout((function(){new ErrorHandler("测验结束或被踢。 ("+e+")")}),300)),RunTwoSteps:()=>(game.two=[],new TwoStepPage),Ping:()=>{console.log("Recieved ping from server")},FailTwoStep:()=>new TwoStepPage(!0),TwoStepSuccess:()=>new LobbyPage,Maintainance:e=>new ErrorHandler("Maintainance Alert: "+e),OK:()=>{game.ready=!0},GameReset:()=>{new LobbyPage,delete game.question,delete game.guesses,delete game.answers,delete game.rawData,delete game.ans,delete game.got_answers,game.index=0,game.streak=0,game.score=0,game.quizEnded=!1},NameAccept:e=>{const t=JSON.parse(e);game.name=t.playerName;try{document.getElementById("L2").innerHTML=`<p>${t.playerName}</p>`}catch(e){}},TimeOver:()=>{new TimeUpPage},Feedback:()=>{new FeedbackPage},TeamTalk:e=>{new TeamTalkPage(JSON.parse(e))}}};class Game{constructor(){this.socket=null,this.oldQuizUUID="",this.name="",this.streak=0,this.ready=!1,this.cid="",this.pin=0,this.score=0,this.answers=[],this.quizEnded=!0,this.total=0,this.index=0,this.end={},this.two=[],this.errorTimeout=null,this.jumbleAnswer=[],this.multiAnswer={0:!1,1:!1,2:!1,3:!1},this.theme="Kahoot",this.opts={},this.correctIndex=null,this.questionStarted=!1,this.questionAnswered=!1}sendPin(pin){return new Promise((res=>{this.pin=pin,grecaptcha.ready((()=>{grecaptcha.execute("6LcyeLEZAAAAAGlTegNXayibatWwSysprt2Fb22n",{action:"submit"}).then((token=>{this.socket=new WebSocket(`${"http:"==location.protocol?"ws://":"wss://"}${location.host}?token=${token}`),socket=this.socket,socket.onmessage=evt=>{evt=evt.data;const data=JSON.parse(evt);if("Error"==data.type)return MessageHandler.Error[data.message](data.data);eval(`MessageHandler.${data.type}("${data.message.replace(/\\/gim,"\\\\").replace(/"/gim,'\\"')}")`)},socket.onclose=()=>{game.disconnectTime=Date.now(),new ErrorHandler("Session disconnected."),activateLoading(!0,!0,"<br><br><br><br><p>Reconnecting</p>");let e=0;!function t(n){const a=new XMLHttpRequest;a.open("GET","/up"),a.send(),a.onerror=a.ontimeout=function(){if(++e>10)return location.href="https://theusaf.github.io/kahoot%20winner%20error.html";(n*=2)>30&&(n=30),setTimeout((function(){t(n)}),1e3*n)},a.onload=function(){if(200!=a.status||!/^-?\d+ (hours|minutes) until expected reset.*$/.test(a.response))return a.onerror(n);activateLoading(!1,!1),game.quizEnded||"0"==game.pin[0]?resetGame():resetGame(!0)}}(.5)},socket.onopen=()=>{const e=setInterval((()=>{this.ready&&(res(),send({type:"SET_PIN",message:pin}),this.loadOptions(),clearInterval(e))}),500)}})).catch((e=>{new ErrorHandler("Captcha failed: "+e),new LoginPage,activateLoading(!1)}))})),activateLoading(!0,!0)}))}join(e){this.name=e,send({type:"JOIN_GAME",message:e}),activateLoading(!0,!0),this.handshakeTimeout=setTimeout((()=>{let e;switch(document.getElementById("handshake-fail-div")&&(document.getElementById("handshake-fail-div").outerHTML=""),MessageHandler.Error.HANDSHAKE(),detectPlatform()){case"Windows":e="https://www.mediafire.com/file/ju7sv43qn9pcio6/kahoot-win-win.zip/file";break;case"MacOS":e="https://www.mediafire.com/file/bcvxlwlfvbswe62/Kahoot_Winner.dmg/file";break;default:e="https://www.mediafire.com/file/zb5blm6a8dyrwtb/kahoot-win-linux.tar.gz/file"}const t=document.createElement("div");t.innerHTML=`<span>嗯，我们似乎在遇到麻烦。 尝试<span class="mobihide">下载我们的应用程序或</span>按下下面的报告按钮！</span>\n      <br>\n      <a href="${e}" onclick="dataLayer.push({event:'download_app'})" target="_blank">下载应用程式</a>`,t.className="shortcut",t.id="handshake-fail-div",t.style="\n        position: fixed;\n        top: 4rem;\n        z-index: 1000;\n        width: 100%;\n        color: white;\n        background: #888;\n        text-align: center;\n        border-radius: 5rem;\n      ",document.body.append(t)}),1e4)}getRandom(){dataLayer.push({event:"get_random_name"}),send({type:"GET_RANDOM_NAME",message:"please?"})}saveOptions(){const e=SettingDiv.querySelectorAll("input,select"),t={};for(let n=0;n<e.length;++n)t[e[n].id]="checkbox"==e[n].type?e[n].checked:e[n].value;localStorage.options=JSON.stringify({manual:t.manual,timeout:t.timeout,brute:t.brute,fail:t.fail,teamtalk:t.teamtalk,teamMembers:t.teamMembers,theme:t.theme,previewQuestion:t.previewQuestion,searchLoosely:t.searchLoosely,ChallengeDisableAutoplay:t.ChallengeDisableAutoplay,ChallengeDisableTimer:t.ChallengeDisableTimer,div_game_options:t.div_game_options,div_search_options:t.div_search_options,div_challenge_options:t.div_search_options});const n=game.opts;game.theme=t.theme,game.opts=t,send({type:"SET_OPTS",message:JSON.stringify(t)}),game.questionStarted&&!game.questionAnswered&&n.manual&&!game.opts.manual&&send({type:"ANSWER_QUESTION",message:null})}loadOptions(){let e;try{e=JSON.parse(localStorage.options),game.opts=e,game.theme=e.theme}catch(e){return}if(e){for(const t in e){const n=document.getElementById(t);"checkbox"==n.type?n.checked=e[t]:n.value=e[t]}if(socket&&1===socket.readyState)return game.saveOptions(),dataLayer.push(Object.assign({event:"load_options"},e)),new ErrorHandler("恢复的选项！",{isNotice:!0});null!==socket&&setTimeout((()=>{this.loadOptions()}),3e3)}}answer(e){activateLoading(!0,!0),send({type:"ANSWER_QUESTION",message:e}),dataLayer.push({event:"answer",value:e,type:this.question.type})}answer2(e,t){if(t.className="faded",-1==this.two.indexOf(e))return this.two.push(e),4==this.two.length?(send({type:"DO_TWO_STEP",message:JSON.stringify(this.two)}),void activateLoading(!0,!0,"")):void 0}answerJ(e){const t=[];for(let n=0;n<e.length;n++)t.push(Number(e[n].getAttribute("index")));this.answer(t)}answerM(e,t){this.multiAnswer[e]=!this.multiAnswer[e],-1!=t.className.indexOf("correct")?t.className=this.multiAnswer[e]?"fadedm correct":"correct":t.className=this.multiAnswer[e]?"fadedm":""}updateName(){clearTimeout(this.saveTimeout);const e=/[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}/i;e.test(document.getElementById("searchTerm").value)&&(document.getElementById("uuid").value=document.getElementById("searchTerm").value.match(e)[0]),this.saveTimeout=setTimeout(this.saveOptions,500)}playSound(e){this.music||(this.music=new Audio,this.music.addEventListener("timeupdate",(()=>{this.music.currentTime>this.music.duration-.44&&(this.music.currentTime=0,this.music.play())}))),this.music.pause(),this.music.src=e,this.music.play()}}function send(e){null!==socket&&socket.send(JSON.stringify(e))}function setCookie(e){document.cookie=`lang=${e}; expires=${new Date(Date.now()+31536e6).toGMTString()}; path=/`,"serviceWorker"in navigator?navigator.serviceWorker.getRegistrations().then((async function(t){for(const e of t)await e.unregister();location.href="en"!==e?"/"+e:"/"})).catch((()=>{location.href="en"!==e?"/"+e:"/"})):location.href="en"!==e?"/"+e:"/"}let game=null;game=new Game;const eggstyle=document.createElement("style");let egg="";eggstyle.innerHTML="p,.sm span,img,h1,h2,.About h3,.tut_cont h3,h4{\n  animation: infinite windance 1s;\n}";let shouldStop=!1;function detectPlatform(){let e="Linux";return-1!=navigator.appVersion.indexOf("Win")&&(e="Windows"),-1!=navigator.appVersion.indexOf("Mac")&&(e="MacOS"),-1!=navigator.appVersion.indexOf("X11")&&(e="UNIX"),-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),e}window.addEventListener("keydown",(e=>{"Escape"==e.key&&(0==closePage?SettingSwitch.click():1==closePage?AboutSwitch.click():ChangelogSwitch.click()),egg+=e.key;try{if(0!="winner".search(egg)&&0!="return by death".search(egg)&&0!="behold an unthinkable present".search(egg)&&0!="explosion".search(egg)){egg="",shouldStop&&(game.music.pause(),shouldStop=!1);try{document.body.removeChild(eggstyle)}catch(e){}}else if("winner"==egg)document.body.append(eggstyle);else if("return by death"==egg)"ReZero"===game.theme&&(game.playSound("/resource/music/return_by_death.mp3"),shouldStop=!0,document.body.style="box-shadow:inset 0 0 10rem 5rem darkviolet;",setTimeout((()=>{game.music.pause(),document.body.style=""}),2e4*Math.random()+1e4));else if("behold an unthinkable present"==egg)"ReZero"===game.theme&&(game.playSound("/resource/music/behold_unthinkable_present.m4a"),shouldStop=!0);else if("explosion"==egg&&"KonoSuba"===game.theme&&0===game.pin){game.playSound("/resource/music/megumin_explosion.mp3"),document.body.style="box-shadow:inset 0 0 0.7rem 0.7rem #451b0e,inset 0 0 1.4rem 1.4rem #973716,inset 0 0 1.8rem 1.8rem #cd4606,inset 0 0 2.1rem 2.1rem #ec760c,inset 0 0 2.4rem 2.4rem #ffae34,inset 0 0 2.7rem 2.7rem #fefcc9";const e=document.createElement("img");e.src="/resource/red-konosuba.svg",e.style="position:fixed;top:calc(50% - 5rem);left:100%;width:10rem;transition:left 4s;",document.body.append(e),setTimeout((()=>{e.style.left="calc(75% - 5rem)"})),setTimeout((()=>{e.style.left="150%"}),16e3),setTimeout((()=>{document.body.style="";const t=document.createElement("div");document.body.append(t),t.style="position:fixed;top:0;left:0;width:100%;height:100%;z-index:5000;transition:background 2s",t.style.background="darkorange",setTimeout((()=>{t.style.background="beige",setTimeout((()=>{e.outerHTML="",t.style.background="black",game.music.pause(),setTimeout((()=>{t.outerHTML=""}),3e3)}),3e3)}),2e3)}),21e3)}}catch(e){egg="",shouldStop&&(game.music.pause(),shouldStop=!1)}})),localStorage.KW_Version="v4.0.2";const checkVersion=new XMLHttpRequest;checkVersion.open("GET","/up"),checkVersion.send(),checkVersion.onload=function(){const e=checkVersion.response.split(": ")[1],t=localStorage.KW_Version||e;"false"!=localStorage.KW_Update&&(e!=t&&new ErrorHandler("有新的更新。",{permanent:!0,onclick:(t,n)=>{n.outerHTML="";const a=document.createElement("div");a.id="UpdateDiv",a.innerHTML='<h2>有新的更新。</h2>\n        <h4>您要现在更新吗？</h4>\n        <p>如果此消息持续出现，请尝试刷新页面或清除缓存。</p>\n        <button id="UpdateYes">是</button><button id="UpdateNo">还没</button><br>\n        <button onclick="localStorage.KW_Update = false;this.parentElement.outerHTML = \'\';">禁用更新通知</button>',document.body.append(a),document.getElementById("UpdateYes").onclick=function(){"serviceWorker"in navigator?(document.getElementById("UpdateYes").innerHTML="请稍候...",navigator.serviceWorker.getRegistrations().then((async function(t){for(const e of t)await e.unregister();setTimeout((function(){localStorage.KW_Version=e,location.reload()}),3e3)})).catch((function(){document.getElementById("UpdateDiv").outerHTML="",new ErrorHandler("强制更新时出错。 请手动清除或重新加载页面缓存。")}))):(document.getElementById("UpdateDiv").outerHTML="",new ErrorHandler("强制更新时出错。 请手动清除或重新加载页面缓存。"))},document.getElementById("UpdateNo").onclick=function(){document.getElementById("UpdateDiv").outerHTML=""}}}),localStorage.KW_Version||(localStorage.KW_Version=e))};const KahootThemes={Kahoot:{red:"red.svg",blue:"blue.svg",green:"green.svg",yellow:"yellow.svg",logo:"logo-xmas.svg"},KonoSuba:{red:"red-konosuba.svg",blue:"blue-konosuba.svg",green:"green-konosuba.svg",yellow:"yellow-konosuba.svg",logo:"logo-konosuba.svg"},get Rainbow(){return KahootThemes.Kahoot},get Music(){return KahootThemes.Kahoot},FRANXX:{red:"red-franxx.svg",blue:"blue-franxx.svg",green:"green-franxx.svg",yellow:"yellow-franxx.svg",get logo(){return KahootThemes.Kahoot.logo}},ReZero:{red:"red-rezero.svg",blue:"blue-rezero.svg",green:"green-rezero.svg",yellow:"yellow-rezero.svg",logo:"logo-rezero.svg"},Minecraft:{red:"red-mc.svg",blue:"blue-mc.svg",green:"green-mc.svg",yellow:"yellow-mc.svg",logo:"logo-mc.png"}};function Element(e,t){const n=document.createElement(e);for(const e in t||{})n[e]=t[e];return n}function RemoveHandshakeFail(){document.getElementById("handshake-fail-div")&&(document.getElementById("handshake-fail-div").outerHTML="")}function NotFoundDiv(){const e=Element("div",{className:"ChallengeQuestion noQuiz"}),t=Element("span");return t.innerHTML=`<input id="nameInput" placeholder="输入测验名称" value="${document.getElementById("searchTerm").value.replace(/&/g,"&amp;").replace(/"/g,"&quot;")||""}" oninput="document.getElementById('searchTerm').value = this.value;game.updateName();"></input>`,e.append(Element("br"),Element("br"),t),e}class LoginPage{constructor(e){document.body.className="rainbow",Themer(),QuizResult.className="disabled button",QuizResult.removeAttribute("url"),ChallengeContinueButton.style.display="none",RemoveHandshakeFail(),-1==(new Date).toString().search("Apr 1")&&-1==(new Date).toString().search("Mar 31")||(game.theme="KonoSuba");const t=clearUI();t.className="Login",t.setAttribute("ui-event","Login");const n=Element("img",{alt:"Kahoot logo",src:`/resource/${KahootThemes[game.theme].logo}`}),a=Element("p",{id:"logotext",innerHTML:"WINNER",onclick:()=>{a.style.display="none"}}),s=Element("input",{type:e?"text":"tel",id:"loginInput",placeholder:e?"昵称":"游戏密码",onkeydown:e?e=>{if("Enter"===e.code)return game.join(s.value)}:e=>{if("Enter"===e.code)return game.sendPin(s.value)}}),o=Element("button",{innerHTML:e?"好，出发！":"输入",id:"loginButton",onclick:e?()=>game.join(s.value):()=>game.sendPin(s.value)});if(e){try{document.getElementById("lang").outerHTML=""}catch(e){}const e=Element("button",{innerHTML:"获取随机名称",onclick:()=>{game.getRandom()}});e.style.marginBottom="0.5rem",t.append(n,a,s,e,o),document.getElementsByClassName("grecaptcha-badge")[0].style.visibility="hidden","0"!=game.pin[0]&&(document.getElementById("div_challenge_options").parentElement.className="fadedm")}else{document.getElementById("div_challenge_options").parentElement.className="";const e=Element("label",{htmlFor:"about",innerHTML:"About",id:"abtlnk"}),l=Element("div",{id:"chnge"}),r=Element("label",{htmlFor:"changelog",innerHTML:"Changelog"}),i=Element("span",{innerHTML:"Kahoot！ 和K！ 徽标是Kahoot！的商标！ AS。"}),c=Element("span",{innerHTML:'<a href="/privacy/">隐私</a> | <a href="/terms/">条款</a>'}),m=Element("div",{id:"lang"});m.innerHTML='<label for="langToggle"><img src="/resource/language.svg"/></label>\n      <input class="ch" id="langToggle" type="checkbox"/>\n      <div class="lang">\n        <button onclick="setCookie(\'en\')">English</button>\n        <button onclick="setCookie(\'es\')">Español</button>\n        <button onclick="setCookie(\'zh\')">中文</button>\n      </div>',document.getElementById("lang")||document.body.append(m),l.append(r,i,c),t.append(n,a,s,o,e,l)}const l=Element("div",{className:"sm sidebar correct"});l.innerHTML='<div class="mobihide2 mobihide">\n    <a href="/creator" target="_blank"><img src="/resource/icon-kahoot.svg" alt="create"><span>创作者</span></a>\n    <a href="/api" target="_blank"><img src="/resource/icon-api.svg" alt="api"><span>Kahoot API</span></a>\n    <a href="/blog" target="_blank"><img src="/resource/icon-blog.svg" alt="Icon made from http://www.onlinewebfonts.com/icon is licensed by CC BY 3.0"><span>博客</span></a>\n    <a href="/blog/download" target="_blank" class="mobihide2 mobihide"><img src="/resource/icon192.png" alt="download mark"><span>应用下载</span></a>\n    </div>\n    <a href="https://discord.gg/58SHzC2" target="_blank"><img src="/resource/logo-discord.svg" alt="discord"><span>Discord</span></a>\n    <a href="https://twitter.com/theusafyt" target="_blank"><img src="/resource/logo-twitter.svg" alt="twitter"><span>Twitter</span></a>\n    <a href="https://www.facebook.com/theusafmc" target="_blank"><img src="/resource/logo-fbook.svg" alt="facebook"><span>Facebook</span></a>',e||t.append(l),UIDiv.append(t)}}class TwoStepPage{constructor(e){new ErrorHandler(e?"2 Step Auth Failed.":"2 Step Auth Required");const t=new LobbyPage;t.mid.innerHTML="",t.main.setAttribute("ui-event","TwoFactorAuth"),document.body.className="Rainbow"==game.theme?"rainbow":"purple";const n=Element("p",{innerHTML:"PIN: "+game.pin});t.top.append(n);const a=Element("div",{className:"Answers"}),s=Element("img",{src:`/resource/${KahootThemes[game.theme].red}`,alt:"Red",onclick:()=>{game.answer2(0,s)}}),o=Element("img",{src:`/resource/${KahootThemes[game.theme].blue}`,alt:"Blue",onclick:()=>{game.answer2(1,o)}}),l=Element("img",{src:`/resource/${KahootThemes[game.theme].green}`,alt:"Green",onclick:()=>{game.answer2(2,l)}}),r=Element("img",{src:`/resource/${KahootThemes[game.theme].yellow}`,alt:"Yellow",onclick:()=>{game.answer2(3,r)}});a.append(s,o,r,l),t.main.append(a),e&&activateLoading(!1,!0)}}class ErrorHandler{constructor(e,t){const n=Element("div",{className:(t=t||{}).isNotice?"NotError":"",onclick:t.onclick?e=>{t.onclick(e,n)}:null}),a=Element("span",{innerHTML:e}),s=Element("span",{innerHTML:"X",onclick:e=>{n.outerHTML="",e.preventDefault(),e.stopPropagation()},className:"ErrorCloser"});n.append(a,s),UIError.insertBefore(n,UIError.querySelector("div"));let o=7e3;n.onclick&&(o=3e4,n.className+=" Clickable"),t.time&&(o=t.time),t.permanent||setTimeout((()=>{n.style.opacity=0,setTimeout((()=>{try{n.outerHTML=""}catch(e){}}),1e3)}),o)}}class LobbyPage{constructor(){try{document.getElementById("lang").outerHTML=""}catch(e){}RemoveHandshakeFail(),window.onbeforeunload=function(e){e.returnValue="您确定要离开页面吗？"},document.querySelector(".ad-container").style.display="none",document.querySelector(".ad-container-2").style.display="none","0"==game.pin[0]&&game.opts.ChallengeDisableAutoplay&&(ChallengeContinueButton.style.display="");const e=clearUI();e.className="lobby",e.setAttribute("ui-event","Lobby"),document.body.className="Rainbow"==game.theme?"rainbow":"green";const t=Element("div",{id:"L1",className:"extra"}),n=Element("div",{id:"L2",className:"extra"});"Rainbow"==game.theme&&(t.className="extra rainbow");const a=Element("p",{innerText:game.name}),s=Element("h1",{className:"shadow",innerHTML:"你在！"}),o=Element("h2",{innerHTML:"在屏幕上看到您的昵称？",className:"shadow"}),l=Element("div",{id:"UIMid"}),r=Element("div");return s.setAttribute("text","你在！"),o.setAttribute("text","在屏幕上看到您的昵称？"),n.append(a),r.append(s,o),l.append(r),e.append(t,n,l),void 0===game.guesses&&e.append(NotFoundDiv()),UIDiv.append(e),{main:e,top:t,mid:l,bottom:n}}}class GetReadyPage{constructor(e,t){game.recievedTime=Date.now(),game.questionStarted=!1,game.jumbleAnswer=[],game.question=e;const n=new LobbyPage;try{document.querySelector(".noQuiz").outerHTML=""}catch(e){}ChallengeContinueButton.style.display="none",document.body.className="blue",n.main.setAttribute("ui-event","GetReady"),n.mid.innerHTML="";const a=Element("h1",{innerHTML:`题 ${(e.index||0)+1}`,className:"shadow"});a.setAttribute("text",a.innerText),game.answers=e.data,game.got_answers=e.cans,game.guesses=e.currentGuesses,game.total=e.ans.length,game.index=e.index||0,game.ans=e.ans,game.rawData=e.raw;const s={time:e.raw.timeAvailable||2e4};if(game.guesses.length>=1?(QuizResult.className="button",QuizResult.setAttribute("url",`https://create.kahoot.it/details/${game.guesses[0].uuid}`)):(QuizResult.className="disabled button",QuizResult.removeAttribute("url")),""!==document.getElementById("timeout_custom_1").value){const e=calculateTimeout(Number(document.getElementById("timeout_custom_1").value),s.time,0);document.getElementById("timeout").value=e/1e3,game.saveOptions()}else if(""!==document.getElementById("timeout_custom_2").value){const e=Number(document.getElementById("timeout_custom_2").value)-game.score,t=game.total-game.index;let n=0;n=e/t<500?s.time+500:calculateTimeout(e/t,s.time,game.streak),document.getElementById("timeout").value=n/1e3,game.saveOptions()}game.guesses&&game.guesses.length&&game.guesses[0].uuid!=game.oldQuizUUID&&(game.oldQuizUUID=game.guesses[0].uuid,dataLayer.push({event:"find_quiz",value:game.oldQuizUUID}));const o=Element("h2",{innerHTML:"准备",className:"shadow"});o.setAttribute("text","准备");const l=Element("p",{innerHTML:""+game.score,className:"dark"}),r=Element("p",{innerHTML:`${game.index+1} 的 ${game.total}`}),i=Element("img",{alt:"",src:`/resource/type/${e.type}.svg`}),c=Element("span",{innerHTML:{quiz:"测验",open_ended:"输入答案",survey:"轮询",jumble:"难题",word_cloud:"词云",content:"幻灯片放映",multiple_select_poll:"轮询",multiple_select_quiz:"测验"}[e.type]}),m=Element("div",{id:"quizTypeImage"});if("multiple_select_quiz"===e.type?i.src="/resource/type/quiz.svg":"multiple_select_poll"===e.type?i.src="/resource/type/survey.svg":"quiz"===e.type&&"TRUE_FALSE"===game.rawData.gameBlockLayout&&(i.src="/resource/type/true_false.svg",c.innerHTML="对或错"),m.append(i,c),n.top.append(r,m),n.bottom.append(l),"content"==game.question.type){document.body.className="blue2";const e=Element("div"),t=Element("h1",{innerHTML:"抬头",className:"shadow"});t.setAttribute("text","抬头");const a=Element("h2",{innerHTML:"这次无需回答！",className:"shadow"});a.setAttribute("text","这次无需回答！");const s=Element("img",{src:"/resource/content-slide.svg",id:"ContentImage"});return e.append(t,s,a),n.mid.append(e),n}if(t)return n;const u=Element("h2",{id:"timer",innerHTML:game.question.timeLeft||"5"}),d=Element("div"),g=Element("div"),p=Element("img",{src:"/resource/load-large.svg",className:"load_circle",alt:"load_circle"});g.append(p,u),d.append(a,g,o),n.mid.append(d);let h=game.question.timeLeft||5;const y=setInterval((()=>{try{--h<0?clearInterval(y):(u.innerHTML=h,o.innerHTML=["走！","组。","准备"][h>=3?2:h],o.setAttribute("text",o.innerText))}catch(e){clearInterval(y)}}),1e3);if(+game.opts.searchLoosely){if(2==+game.opts.searchLoosely){const e=Element("div",{innerHTML:"<span>准备</span>",className:"next"});e.addEventListener("click",(()=>{e.innerHTML="<span>等候…</span>",e.className="faded next",function e(){if(game.questionStarted)return new QuestionAnswererPage;setTimeout((function(){e()}),500)}()})),n.main.append(e)}if(activateLoading(!1,!1),clearInterval(y),u.outerHTML="",d.outerHTML="",0==game.guesses.length)n.main.append(NotFoundDiv());else{const e=game.guesses[0].questions,t=[];for(let n=0;n<e.length;n++)if(e[n].type==game.question.type&&(e[n].layout==game.rawData.gameBlockLayout||!e[n].layout)&&("object"==typeof e[n].choices&&e[n].choices.length||null)==game.ans[game.index]){let a=!0,s=0;const o=game.got_answers.slice(0);for(let t=0;t<o.length;t++){function b(e){const{text:n,correct:a,type:s,choice:l}=o[t];switch(s){case"quiz":return null!==l&&(n===e.answer&&e.correct===a);case"open_ended":return!!a&&(n===e.answer&&e.correct);case"jumble":case"multiple_select_poll":case"multiple_select_quiz":return!!n.split("|").includes(l.answer);default:return n===e.answer&&e.correct===a}}if(e[n].choices&&e[n].choices.filter(b).length){a=!1;for(let t=0;t<e.length;t++)e[t].choices.filter(b).length&&s++;break}}if(!a&&1===s)continue;t.push({i:n,q:e[n]})}const a=Element("input",{className:"looseInput",placeholder:"题"}),s=Element("div",{className:"looseDiv"}),o=Element("div",{className:"looseOptions"}),l=e=>{o.innerHTML="";let n=!1;for(let a=0;a<t.length;a++){const s=t[a].q.question||t[a].q.title,l=/<\/?[ib]>|[^a-z0-9\s]/gim,r=/<\/?[ib]>/gim;const i=s.replace(l," ").replace(/\s+/gm," ").match(new RegExp(e.replace(l," ").replace(/\s+/gm," "),"gmi")),c=s.replace(r,"").match(new RegExp(e.replace(r,"").replace(/\[/gm,"\\[").replace(/\(/gm,"\\(").replace(/\{/gm,"\\{").replace(/\*/gm,"\\*").replace(/\+/gm,"\\+").replace(/\?/gm,"\\?").replace(/\|/gm,"\\|").replace(/\^/gm,"\\^").replace(/\$/gm,"\\$").replace(/\./gm,"\\.").replace(/\\/gm,"\\\\"),"gmi")),m=s.replace(l,"").match(new RegExp(e.replace(l,""),"gmi"));if(i||c||m){n||(game.correctIndex==t[a].i||(send({type:"CHOOSE_QUESTION_INDEX",message:t[a].i}),game.correctIndex=t[a].i,game.question.data=game.guesses[0].questions[t[a].i].choices,game.question.ans=game.ans),n=!0);const e=i||c||m,l=Element("p");let r=s;for(let t=0;t<e.length;t++)r=s.replace(e[t],"<b>"+e[t]+"</b>");l.innerHTML=r,l.addEventListener("click",(()=>{send({type:"CHOOSE_QUESTION_INDEX",message:t[a].i}),game.correctIndex=t[a].i,game.question.data=game.guesses[0].questions[t[a].i].choices,game.ans[game.index]=game.question.data?game.question.data.length:4,game.question.ans=game.ans,Array.from(o.children).forEach((e=>{e.className=""})),l.className="looseChoice"})),0===o.children.length&&(l.className="looseChoice"),o.append(l)}}};l(""),s.append(a,o),n.main.append(s),a.addEventListener("input",(()=>{l(a.value)})),a.focus()}}else if(game.opts.previewQuestion){activateLoading(!1,!1),clearInterval(y),u.outerHTML="",d.outerHTML="";const e=Element("div",{className:"ChallengeQuestion"}),t=Element("span");0==game.guesses.length?(e.className="ChallengeQuestion noQuiz",t.innerHTML=`<input id="nameInput" placeholder="输入测验名称" value="${document.getElementById("searchTerm").value.replace(/&/g,"&amp;").replace(/"/g,"&quot;")||""}" oninput="document.getElementById('searchTerm').value = this.value;game.updateName();"></input><a href="https://kahoot-win.herokuapp.com/blog/quiz-not-found" target="_blank" class="error-info">[?]</a>`):t.innerHTML="题: "+(game.guesses[0].questions[game.index].question||game.guesses[0].questions[game.index].title),e.append(Element("br"),Element("br"),t);const a=Element("div",{className:"questionPreviewAnswers",innerHTML:"<h4>正确答案</h4>"}),s=[];for(const e in game.answers)game.answers[e].correct&&s.push(e);for(const e in s){const t=["red","blue","yellow","green"],n=Element("template");n.innerHTML=`<div class="${game.answers[s[e]].correct?"correct":""}">\n          <img class="icon${t[s[e]]}" src="/resource/${KahootThemes[game.theme][t[s[e]]]}" alt="answer choice icon">\n          <span>${game.answers[s[e]].answer}</span>\n        </div>`,a.append(n.content.cloneNode(!0))}n.main.append(a),n.main.append(e)}else 0==game.guesses.length&&n.main.append(NotFoundDiv());if(2==game.opts.fail){const e=Element("div",{className:"failChoice"}),t=Element("input",{type:"radio",name:"fail",id:"fail1"}),a=Element("input",{type:"radio",name:"fail",id:"fail2",checked:!0}),s=Element("label",{htmlFor:"fail1",innerHTML:"&nbsp;失败了&nbsp;"}),o=Element("label",{htmlFor:"fail2",innerHTML:"不要失败"});e.append(t,s,a,o),n.main.append(e),s.onclick=o.onclick=function(){setTimeout((()=>{t.checked?send({type:"FAIL_CURRENT_QUESTION",message:!0}):send({type:"FAIL_CURRENT_QUESTION",message:!1})}))}}return n}}class QuizStartPage{constructor(){const e=new LobbyPage;ChallengeContinueButton.style.display="none",e.main.setAttribute("ui-event","QuizStart"),e.mid.innerHTML="";const t=Element("h1",{innerHTML:"做好准备！",className:"shadow"});t.setAttribute("text","做好准备！");const n=Element("h2",{innerHTML:"载入中...",className:"shadow"});n.setAttribute("text","载入中...");const a=Element("img",{src:"/resource/load-hole.svg",alt:"loading...",className:"load_circle"}),s=Element("div");s.append(t,a,n),e.mid.append(s),document.body.className="purple2"}}class QuestionAnswererPage{constructor(e){if(!0===game.isAnswerPage)return game.isAnswerPage=!1;if(ChallengeContinueButton.style.display="none",2==game.opts.searchLoosely&&!game.questionStarted)return void(game.questionStarted=!0);2!=game.opts.searchLoosely||game.opts.manual||setTimeout((()=>{send({type:"ANSWER_QUESTION",message:null})}),1e3*game.opts.timeout-(Date.now()-game.recievedTime));const t=new GetReadyPage(e||game.question,!0);if(t.main.setAttribute("ui-event","QuestionAnswer"),game.receivedQuestion=!0,game.questionStarted=!0,document.body.className="Rainbow"==game.theme?"rainbow":"",t.mid.innerHTML="","content"==game.question.type){document.body.className="blue2";const e=Element("div"),n=Element("h1",{innerHTML:"抬头",className:"shadow"});n.setAttribute("text","抬头");const a=Element("h2",{innerHTML:"这次无需回答！",className:"shadow"});a.setAttribute("text","这次无需回答！");const s=Element("img",{src:"/resource/content-slide.svg",id:"ContentImage"});return e.append(n,s,a),void t.mid.append(e)}const n=Element("div",{className:"Answers"});if("open_ended"==game.question.type||"word_cloud"==game.question.type){const e=game.answers.filter((e=>e.correct))[0],a=Element("input",{className:"openended",placeholder:e?e.answer:"",onkeydown:e=>{"Enter"===e.code&&game.answer(a.value)}}),s=Element("div",{onclick:()=>{game.answer(a.value)},innerHTML:"Submit"}),o=Element("div",{style:"margin: auto;"});HideAnswers.checked&&(a.placeholder=""),o.append(a,s),n.append(o),t.main.append(n),a.focus(),activateLoading(!1,!document.getElementById("manual").checked)}else{const e=Element("img",{src:`/resource/${KahootThemes[game.theme].red}`,alt:"Red"}),s=Element("img",{src:`/resource/${KahootThemes[game.theme].blue}`,alt:"Blue"}),o=Element("img",{src:`/resource/${KahootThemes[game.theme].green}`,alt:"Green"}),l=Element("img",{src:`/resource/${KahootThemes[game.theme].yellow}`,alt:"Yellow"}),r=[e,s,l,o],i=game.ans[game.index];for(let e=0;e<i;e++)r[e].setAttribute("draggable","false"),n.append(r[e]);if(2==game.ans[game.index]&&(e.style.maxHeight="100%",s.style.maxHeight="100%","TRUE_FALSE"==game.rawData.gameBlockLayout&&(e.setAttribute("css","layout-tfb"),s.setAttribute("css","layout-tfr"),e.src=s.src=`/resource/${KahootThemes[game.theme].blue}`,s.src=`/resource/${KahootThemes[game.theme].red}`)),t.main.append(n),activateLoading(!1,!document.getElementById("manual").checked),"jumble"==game.question.type){function a(e,t){const a=e.cloneNode(!0);n.append(a),a.style.left=(t.x||t.touches[0].clientX)+"px",e.style.visibility="hidden",a.className="draggable";const s=function(e){a.style.left=(e.x||e.touches[0].clientX)-16+"px",function(e,t){const a=[];let s=0,o=0;for(let e=0;e<t.length;e++){"hidden"===t[e].style.visibility&&(o=e);const n=t[e].getBoundingClientRect();s=n.width/2-16,a.push([n.x,n.x+n.width])}const l=(e.x||e.touches[0].clientX)+s;let r=0,i=1/0;for(let e=0;e<a.length;e++)Math.abs(l-a[e][0])<i&&(i=Math.abs(l-a[e][0]),r=e),Math.abs(l-a[e][1])<i&&(i=Math.abs(l-a[e][1]),r=e);"hidden"!==t[r].style.visibility&&(o>r?n.insertBefore(t[o],t[r]):n.insertBefore(t[o],t[r].nextSibling))}(e,n.querySelectorAll("img.jumble"))},o=function(){a.outerHTML="",e.style.visibility="",window.removeEventListener("mousemove",s),window.removeEventListener("touchmove",s),window.removeEventListener("mouseup",o),window.removeEventListener("touchend",o)};window.addEventListener("mousemove",s),window.addEventListener("touchmove",s),window.addEventListener("mouseup",o),window.addEventListener("touchend",o)}[e,s,l,o].forEach(((e,t)=>{e.className="jumble",e.setAttribute("index",t);const n=function(t){a(e,t)};e.addEventListener("touchstart",n),e.addEventListener("mousedown",n)})),n.className="Answers jumble";const t=Element("div",{className:"AnswerOptions"}),r=Element("img",{src:"/resource/check.svg",onclick:()=>{game.answerJ(n.querySelectorAll("img.jumble"))}}),i=Element("img",{src:"/resource/reset.svg",onclick:()=>{game.jumbleAnswer=[],new QuestionAnswererPage}});t.append(r,i),n.append(t)}else if("multiple_select_quiz"==game.question.type||"multiple_select_poll"==game.question.type){game.multiAnswer={0:!1,1:!1,2:!1,3:!1},e.onclick=()=>{game.answerM(0,e)},s.onclick=()=>{game.answerM(1,s)},l.onclick=()=>{game.answerM(2,l)},o.onclick=()=>{game.answerM(3,o)};const t=Element("div",{className:"AnswerOptions"}),a=Element("img",{src:"/resource/check.svg",onclick:()=>{const e=[];for(const t in game.multiAnswer)game.multiAnswer[t]&&e.push(Number(t));game.answer(e)}}),r=Element("img",{src:"/resource/reset.svg",onclick:()=>{game.multiAnswer={0:!1,1:!1,2:!1,3:!1},new QuestionAnswererPage}});t.append(a,r),n.append(t)}else e.onclick=()=>{game.answer(0)},s.onclick=()=>{game.answer(1)},l.onclick=()=>{game.answer(2)},o.onclick=()=>{game.answer(3)};if(HideAnswers.checked&&"0"!=game.pin[0])return;const c=Element("div",{className:"textAnswer"});n.append(c);for(let e=0;e<game.answers.length;e++){game.answers[e].image&&(r[e].style.backgroundRepeat="no-repeat",r[e].style.backgroundSize="50% 50%",r[e].style.backgroundPosition="50% 50%",r[e].style.backgroundImage="url(https://media.kahoot.it/"+game.answers[e].image.id+")",r[e].src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),game.answers[e].correct&&(r[e].className=("jumble"===game.question.type?"jumble ":"")+"correct");const t=Element("p");void 0===game.answers[e].answer?t.innerHTML="":t.innerHTML=("jumble"===game.question.type?e+1+". ":"")+game.answers[e].answer,c.append(t)}}try{if("Music"===game.theme)if(e.raw.timeAvailable<=5e3){const e=["005","005-1"];game.playSound(`/resource/music/${e[Math.floor(Math.random()*e.length)]}.m4a`)}else if(e.raw.timeAvailable<=1e4)game.playSound("/resource/music/010.m4a");else if(e.raw.timeAvailable<=2e4){const e=["020","020-1","020-2"];game.playSound(`/resource/music/${e[Math.floor(Math.random()*e.length)]}.m4a`)}else if(e.raw.timeAvailable<=3e4)game.playSound("/resource/music/030.m4a");else if(e.raw.timeAvailable<=6e4)game.playSound("/resource/music/060.m4a");else{const e=["120","120-1"];game.playSound(`/resource/music/${e[Math.floor(Math.random()*e.length)]}.m4a`)}}catch(e){console.warn("[MUSIC] - Failed to play.\n"+e)}if("0"==game.pin[0]){const a=Element("div",{className:"ChallengeQuestion"}),s=Element("span",{innerHTML:game.rawData.question||game.rawData.title});if(a.append(s),n.append(a),game.options.ChallengeDisableTimer)return;let o=e.raw.timeAvailable/1e3;const l=Element("p",{className:"chtimer",innerHTML:o}),r=setInterval((()=>{l.innerHTML=--o,l.isConnected||clearInterval(r)}),1e3);t.bottom.prepend(l)}else 0===game.guesses.length&&t.main.append(NotFoundDiv())}}class QuestionSnarkPage{constructor(e){const t=new GetReadyPage(game.question,!0);t.main.setAttribute("ui-event","Answered"),document.body.className="rainbow",ChallengeContinueButton.style.display="none",t.top.querySelector("div").outerHTML="";const n=Element("h2",{innerHTML:e});n.setAttribute("text",n.innerText);const a=Element("div"),s=Element("img",{src:"/resource/load-hole.svg",className:"load_circle"});a.append(n,s),t.mid.append(a),0===game.guesses.length&&t.main.append(NotFoundDiv()),activateLoading(!1,!1,"",!1)}}class QuestionEndPage{constructor(e){(e=JSON.parse(e)).isCorrect?game.streak++:game.streak=0,game.score=e.totalScore;const t=new GetReadyPage(game.question||e,!0);t.main.setAttribute("ui-event","QuestionEnd"),"0"==game.pin[0]&&game.opts.ChallengeDisableAutoplay?ChallengeContinueButton.style.display="":0===game.guesses.length&&t.main.append(NotFoundDiv()),t.mid.innerHTML="",document.body.className=e.isCorrect?"green":"red",t.bottom.querySelector(".dark").innerHTML=e.totalScore;const n=Element("h1",{innerHTML:e.isCorrect?"正确":"不正确的",className:"shadow"});n.setAttribute("text",n.innerText);const a=Element("h2",{innerHTML:`你在 ${e.rank||0}${1==e.rank?"st":2==e.rank?"nd":3==e.rank?"rd":"th"} 秩`,className:"shadow"});a.setAttribute("text",a.innerText);const s=Element("h2",{className:"shadow"});try{s.innerHTML=e.nemesis.name.replace(/</gm,"&lt;")?`Just ${e.nemesis.totalScore-e.totalScore} from ${e.nemesis.name}`:"",s.setAttribute("text",s.innerHTML)}catch(e){}const o=Element("img",{id:"correctMark",src:e.isCorrect?"/resource/check.svg":"/resource/cross.svg"}),l=Element("h3",{innerHTML:e.isCorrect?"+"+(e.points+e.pointsData.answerStreakPoints.streakBonus):"继续尝试！",className:"shadow"}),r=Element("img",{src:"/resource/fire.svg"}),i=Element("div",{id:"streakImage"}),c=Element("div"),m=Element("h2",{innerHTML:"连胜",className:"shadow",style:"display: inline-block; font-size: 1.5rem; margin: 0"});m.setAttribute("text","连胜"),c.style.position="relative",c.append(m);const u=Element("p",{innerHTML:e.pointsData.answerStreakPoints.streakLevel});i.append(r),i.append(u),c.append(i),e.pointsData.answerStreakPoints.streakLevel<1?(m.style.display="none",game.hadStreak&&(m.style.display="inline-block",m.innerHTML="答案消失",m.setAttribute("text","答案消失"),game.hadStreak=!1),i.style.display="none"):(game.hadStreak=!0,i.style.display="inline-block");const d=Element("div");d.append(n,o,c,l,a,s),t.mid.append(d),activateLoading(!1,!1)}}class QuizEndPage{constructor(e){let t;e=JSON.parse(e),game.endData=e,t=1==game.end.info.rank?"1<sup>st</sup>place!":2==game.end.info.rank?"2<sup>nd</sup>place!":3==game.end.info.rank?"3<sup>rd</sup>place!":game.end.info.rank<=5?"前5！":"差不多了！";const n=new GetReadyPage(game.question,!0);n.main.setAttribute("ui-event","QuizEnd"),n.mid.innerHTML="","0"==game.pin[0]&&game.opts.ChallengeDisableAutoplay&&(ChallengeContinueButton.style.display=""),document.body.className="purple";const a=Element("h1",{innerHTML:t}),s=Element("h2",{innerHTML:"好游戏！"}),o=Element("p",{innerText:"享受Kahoot赢家吗？🔥与您的朋友分享此网站并赢取更多Kahoot！"});if(game.endData.podiumMedalType){const e=Element("img",{src:`/resource/${game.endData.podiumMedalType}.svg`,alt:"Victory Medal",id:"resultMedal"});n.main.append(e)}if(n.main.append(a,s,o),!game.opts.hideAnswers){const e=Element("div",{id:"finalGuess"});e.innerHTML=`<span id="closeend">X</span>\n      <span id="kahootguess" class="out block" url="https://create.kahoot.it/details/${game.end.info.quizId}">Kahoot测验</span>\n      ${game.guesses.length?`<span id="outguess" class="out block" url="https://create.kahoot.it/details/${game.guesses[0].uuid}">猜测验</span>`:'<span class="block disabled out">（未找到）</span>'}`,n.main.append(e),document.getElementById("closeend").addEventListener("click",(()=>{e.outerHTML=""}));const t=Array.from(document.getElementsByClassName("out"));if(document.getElementById("outguess")){const e=document.getElementById("outguess"),t=document.getElementById("kahootguess");e.getAttribute("url")===t.getAttribute("url")&&(e.className="out block correct")}for(const e of t)e.addEventListener("click",(()=>{e.getAttribute("url")&&window.open(e.getAttribute("url"),"_blank")}))}activateLoading(!1,!1)}}class TeamTalkPage{constructor(e){if(game.opts.teamtalk){const t=new QuestionAnswererPage(this.question||e);return game.isAnswerPage=!0,t}const{main:t,mid:n}=new GetReadyPage(this.question||e,!0);t.setAttribute("ui-event","TeamTalk"),n.innerHTML="",document.body.className="Rainbow"==game.theme?"rainbow":"cyan";const a=Element("h2",{innerHTML:"5"}),s=Element("h1",{innerHTML:"团队谈话",className:"shadow"});s.setAttribute("text","团队谈话");const o=Element("h2",{innerHTML:"讨论答案！",className:"shadow"});o.setAttribute("text","讨论答案！"),a.id="timer";const l=Element("img",{src:"/resource/load-large.svg",className:"load_circle",alt:"load_circle"}),r=Element("div"),i=Element("div");i.append(l,a),r.append(s,i,o),n.append(r);let c=game.question.teamTalkDuration||5;const m=setInterval((()=>{try{--c<0?clearInterval(m):a.innerHTML=c}catch(e){clearInterval(m)}}),1e3)}}class TimeUpPage{constructor(){if(game.receivedQuestion)return;const{main:e,mid:t}=new LobbyPage;e.setAttribute("ui-event","TimeUp"),t.innerHTML="";try{document.querySelector(".noQuiz").outerHTML=""}catch(e){}game.guesses&&0!==game.guesses.length||e.append(NotFoundDiv()),document.body.className="Rainbow"==game.theme?"rainbow":"red";const n=Element("h1",{innerHTML:"时间到",className:"shadow"});n.setAttribute("text","时间到");const a=Element("h2",{innerHTML:"你在 0th 秩",className:"shadow"});a.setAttribute("text","你在 0th 秩");const s=Element("h3",{innerHTML:"我们信任你！"});s.setAttribute("text","我们信任你！");const o=Element("div");o.append(n,a,s),t.append(o)}}class FeedbackPage{constructor(){const{main:e,mid:t,top:n,bottom:a}=new LobbyPage;e.setAttribute("ui-event","Feedback"),t.innerHTML="";try{document.querySelector(".noQuiz").outerHTML=""}catch(e){}document.body.className="Rainbow"==game.theme?"rainbow":"",a.outerHTML="",n.className="gameOver",n.innerHTML="<p>游戏结束</p>";try{document.querySelector("noQuiz").outerHTML=""}catch(e){}e.className="Feedback",e.style.padding="0";const s=Element("div",{className:"feedback"});s.innerHTML='\n    <p>您如何评价这个kahoot？</p>\n    <div class="star-container">\n      <input id="star1" type="radio" name="star" value="1"/>\n      <label for="star1"></label>\n      <input id="star2" type="radio" name="star" value="2"/>\n      <label for="star2"></label>\n      <input id="star3" type="radio" name="star" value="3"/>\n      <label for="star3"></label>\n      <input id="star4" type="radio" name="star" value="4"/>\n      <label for="star4"></label>\n      <input id="star5" type="radio" name="star" value="5"/>\n      <label for="star5"></label>\n    </div>\n    <div class="thumb-container">\n      <p>你学到了什么吗？</p>\n      <div>\n        <input type="radio" name="learn" id="learn1" value="1"/>\n        <label for="learn1"></label>\n        <input type="radio" name="learn" id="learn2" value="0"/>\n        <label for="learn2"></label>\n      </div>\n    </div>\n    <div class="thumb-container">\n      <p>你会推荐吗？</p>\n      <div>\n        <input type="radio" name="rec" id="rec1" value="1"/>\n        <label for="rec1"></label>\n        <input type="radio" name="rec" id="rec2" value="0"/>\n        <label for="rec2"></label>\n      </div>\n    </div>\n    <p>要继续，请告诉我们您的感受</p>\n    <div class="face-container">\n      <input type="radio" name="feel" id="feel1" value="1"/>\n      <label for="feel1"></label>\n      <input type="radio" name="feel" id="feel2" value="0"/>\n      <label for="feel2"></label>\n      <input type="radio" name="feel" id="feel3" value="-1"/>\n      <label for="feel3"></label>\n    </div>',e.append(s);const o=Array.from(document.querySelectorAll('[name="star"]'));for(const e of o)e.addEventListener("click",(()=>{for(const e of o)e.className="";for(let t=+e.id.split("star")[1];t>0;t--)document.getElementById("star"+t).className="selected"}));const l=document.getElementById("feel1"),r=document.getElementById("feel2"),i=document.getElementById("feel3");l.onclick=i.onclick=r.onclick=()=>{const e=(document.querySelector('input[name="star"]:checked')||{}).value,t=(document.querySelector('input[name="learn"]:checked')||{}).value,n=(document.querySelector('input[name="rec"]:checked')||{}).value,a=document.querySelector('input[name="feel"]:checked').value;return send({type:"SEND_FEEDBACK",message:{fun:+e,learn:+t,recommend:+n,overall:+a}}),new QuizEndPage(JSON.stringify(game.endData))}}}function calculateTimeout(e,t){const n=-2*t*(e/1e3-1);return n<.1?0:n}function activateLoading(e,t,n,a){HideDiv.style.background=t?"rgba(0,0,0,0.3)":"transparent",HideDiv.style.pointerEvents=t?"all":"none",HideDiv.children[0].children[0].style.display=e?"inline-block":"none",LoadingText.innerHTML=n||"",HideDiv.children[0].children[0].src=a?"/resource/load-large.svg":"/resource/load-hole.svg"}function setSchema(e,t,n,a){n&&e.setAttribute("itemscope",""),a&&e.setAttribute("itemtype","https://schema.org/"+t),a&&e.setAttribute("itemprop",a)}function sleep(e){return new Promise((t=>{setTimeout(t,1e3*e)}))}async function resetGame(e){try{game.music.pause()}catch(e){}const t=game;if(socket&&(socket.onclose=null,socket.close(),socket=null),game=new Game,e){await game.sendPin(t.pin);const e=async n=>{n=n.data;if("Message.PinGood"==JSON.parse(n).type){new LobbyPage;let e=(25e3-(Date.now()-t.disconnectTime))/1e3;e<=2&&(e=2),new ErrorHandler("Reconnecting... Please wait. You should be reconnected when this message dissappears.",{time:1e3*e}),await sleep(e),send({message:{cid:t.cid,answers:t.got_answers},type:"RECOVER_DATA"}),t.oldQuizUUID&&(document.getElementById("uuid").value=t.oldQuizUUID),game.saveOptions()}else resetGame();socket.removeEventListener("message",e)};socket.addEventListener("message",e)}else new LoginPage,document.body.className="rainbow",document.getElementById("author").value="",document.getElementById("uuid").value="",document.getElementById("searchTerm").value="",document.getElementById("timeout_custom_1").value="",document.getElementById("timeout_custom_2").value="",game.loadOptions()}function clearUI(){return activateLoading(!1,!1),UIDiv.innerHTML="",Element("div")}let presetNumber=0;function loadSetting(e,t){for(const t in e){const n=document.getElementById(t);"checkbox"==n.type||"radio"==n.type?n.checked=e[t]:n.value=e[t]}game.saveOptions(),new ErrorHandler("恢复预设 '"+t+"'",{isNotice:!0})}function addPreset(e){game.saveOptions(),document.querySelectorAll(".preset.remove").forEach((e=>{e.outerHTML=""}));let t=[];if(localStorage.presets)try{t=JSON.parse(localStorage.presets)}catch(e){}t.push({name:e,options:{brute:game.opts.brute,fail:game.opts.fail,teamtalk:game.opts.teamtalk,manual:game.opts.manual,previewQuestion:game.opts.previewQuestion,searchLoosely:game.opts.searchLoosely,teamMembers:game.opts.teamMembers,theme:game.opts.theme,timeout:game.opts.timeout}}),localStorage.presets=JSON.stringify(t),loadPresets()}function loadPresets(){document.querySelectorAll(".preset.remove").forEach((e=>{e.outerHTML=""}));try{const e=JSON.parse(localStorage.presets),t=document.getElementById("preset_add_div");for(const n of e){const e=n.options,a=Element("template");a.innerHTML=`<div class="preset flex remove">\n        <div class="center">\n          <span class="presetTitle">${n.name} <label for="preset_${presetNumber}">(?)</label></span>\n          <input type="checkbox" id="preset_${presetNumber}" class="ch nosend">\n          <div>\n            <p>主题 <span class="yellow">${e.theme}</span></p>\n            <p>超时 <span class="yellow">${e.timeout||"0"}</span></p>\n            <p>球队 <span class="yellow">${e.teamMembers||"(unset)"}</span></p>\n            <p>失败 <span class="${Number(e.fail)?"green":"red"}">${Number(e.fail)?"开":"关"}</span></p>\n            <p>疏松 <span class="${Number(e.searchLoosely)?"green":"red"}">${Number(e.searchLoosely)?"开":"关"}</span></p>\n            <p>蛮力 <span class="${e.brute?"green":"red"}">${e.brute?"开":"关"}</span></p>\n            <p>手册 <span class="${e.manual?"green":"red"}">${e.manual?"开":"关"}</span></p>\n            <p>预习 <span class="${e.previewQuestion?"green":"red"}">${e.previewQuestion?"开":"关"}</span></p>\n            <p>跳过团队谈话 <span class="${e.teamtalk?"green":"red"}">${e.teamtalk?"开":"关"}</span></p>\n          </div>\n          <button id="restore_${presetNumber}" class="block">恢复</button>\n          <img src="/resource/cross.svg" alt="delete" id="delete_${presetNumber}">\n        </div>\n      </div>`,document.getElementById("preset_container").insertBefore(a.content.cloneNode(!0),t),document.getElementById("restore_"+presetNumber).onclick=function(){loadSetting({theme:e.theme,timeout:e.timeout,teamMembers:e.teamMembers,fail:e.fail,searchLoosely:e.searchLoosely,brute:e.brute,manual:e.manual,previewQuestion:e.previewQuestion},n.name)},document.getElementById("delete_"+presetNumber).onclick=function(){try{let e=JSON.parse(localStorage.presets);e=e.filter((e=>e.name!=n.name)),localStorage.presets=JSON.stringify(e),loadPresets()}catch(e){}},presetNumber++}}catch(e){}}const ChallengeContinueButton=document.getElementById("ChallengeNext"),SettingDiv=document.getElementById("settings"),SettingSwitch=document.getElementById("menu_toggle"),AboutSwitch=document.getElementById("about"),ChangelogSwitch=document.getElementById("changelog"),HideDiv=document.getElementsByClassName("Loading")[0],UIError=document.getElementsByClassName("Error")[0],UIDiv=document.getElementsByClassName("Main")[0],HideAnswers=document.getElementById("hideAnswers"),LoadingText=document.getElementById("loadingText"),ThemeChooser=document.getElementById("theme"),QuizResult=document.getElementById("quizresult");new LoginPage(!1),loadPresets();let closePage=0;const SearchDivSettings=document.getElementById("div_search_options"),GameDivSettings=document.getElementById("div_game_options"),ChallengeDivSettings=document.getElementById("div_challenge_options"),dso=document.getElementById("dso"),dgo=document.getElementById("dgo"),dco=document.getElementById("dco");function Themer(){game.theme=ThemeChooser.value,"Rainbow"===game.theme?(SettingDiv.className="rainbow correct",document.querySelector(".About").className="About rainbow"):"FRANXX"===game.theme?(SettingDiv.className="franxx",document.querySelector(".About").className="About"):(SettingDiv.className="",document.querySelector(".About").className="About");const e=document.querySelector('.Login>img[alt="Kahoot logo"]');e&&(e.src="/resource/"+KahootThemes[game.theme].logo)}SearchDivSettings.onchange=GameDivSettings.onchange=ChallengeDivSettings.onchange=function(e){switch(e.target.id){case"div_search_options":dso.className="flex selected",dgo.className="flex",dco.className="flex";break;case"div_game_options":dso.className="flex",dgo.className="flex selected",dco.className="flex";break;case"div_challenge_options":dso.className="flex",dgo.className="flex",dco.className="flex selected"}},dgo.className="flex selected",AboutSwitch.addEventListener("click",(()=>{closePage=AboutSwitch.checked?1:0})),ChangelogSwitch.addEventListener("click",(()=>{closePage=ChangelogSwitch.checked?2:0})),ChallengeContinueButton.addEventListener("click",(()=>{send({message:"",type:"NEXT_CHALLENGE"})})),SettingSwitch.onclick=()=>{SettingSwitch.checked||(dataLayer.push({event:"toggle_settings"}),document.getElementById("preset_toggle").checked&&(document.getElementById("preset_toggle").checked=!1),game.saveOptions()),closePage=0},ThemeChooser.addEventListener("change",Themer),QuizResult.addEventListener("click",(e=>{"LABEL"!==e.target.nodeName&&QuizResult.getAttribute("url")&&window.open(QuizResult.getAttribute("url"),"_blank")}));const shortcuts=e=>{if(e.ctrlKey){switch(e.key){case"e":send({type:"RECONNECT",message:"I think i lost connection"}),dataLayer.push({type:"reconnect",value:""});break;case"b":document.getElementById("brute").click(),new ErrorHandler("绕过2FA: "+(document.getElementById("brute").checked?"开":"关"),{isNotice:!0}),dataLayer.push({type:"brute",value:document.getElementById("brute").checked});break;case"p":document.getElementById("fail").value=0==document.getElementById("fail").value?.9:0,new ErrorHandler("故意失败: "+(0!=document.getElementById("fail").value?"开":"关"),{isNotice:!0}),dataLayer.push({type:"fail",value:document.getElementById("fail").value});break;case"m":document.getElementById("manual").click(),new ErrorHandler("手动控制: "+(document.getElementById("manual").checked?"开":"关"),{isNotice:!0}),dataLayer.push({type:"manual",value:document.getElementById("manual").checked});break;case"h":document.getElementById("hideAnswers").click(),new ErrorHandler("隐藏正确的: "+(document.getElementById("hideAnswers").checked?"开":"关"),{isNotice:!0}),dataLayer.push({type:"hide",value:document.getElementById("hideAnswers").checked});break;case"o":document.getElementById("challengeCorrect").click(),new ErrorHandler("挑战永远正确: "+(document.getElementById("challengeCorrect").checked?"开":"关"),{isNotice:!0}),dataLayer.push({type:"correct",value:document.getElementById("challengeCorrect").checked});break;case"u":document.getElementById("previewQuestion").click(),new ErrorHandler("预览问题: "+(document.getElementById("previewQuestion").checked?"开":"关"),{isNotice:!0}),dataLayer.push({type:"preview",value:document.getElementById("previewQuestion").checked});break;case"j":try{if(SettingDiv.style.display){SettingDiv.style="",document.querySelector(".Changelog").style="",document.querySelector(".About").style="",document.getElementById("tutorial").style="",document.querySelector(".misc").style="",document.querySelector(".Error").style="";try{document.getElementById("logotext").style=""}catch(e){}try{document.querySelector(".sm.sidebar").style=""}catch(e){}try{document.getElementById("abtlnk").style=""}catch(e){}try{document.getElementById("chnge").style=""}catch(e){}try{document.getElementById("lang").style=""}catch(e){}}else{SettingDiv.style="display: none",document.querySelector(".Changelog").style="display: none",document.querySelector(".About").style="display: none",document.getElementById("tutorial").style="display: none",document.querySelector(".misc").style="opacity: 0",document.querySelector(".Error").style="display: none";try{document.getElementById("logotext").style="display: none"}catch(e){}try{document.querySelector(".sm.sidebar").style="display: none"}catch(e){}try{document.getElementById("abtlnk").style="display: none"}catch(e){}try{document.getElementById("chnge").style="display: none"}catch(e){}try{document.getElementById("lang").style="display: none"}catch(e){}try{document.querySelector(".grecaptcha-badge").style.visibility="hidden"}catch(e){}try{document.querySelector(".ad-container").style.display="none",document.querySelector(".ad-container-2").style.display="none"}catch(e){}}}catch(e){console.log(e)}finally{const e=document.head.querySelector('[rel="shortcut icon"]')||Element("link");e.isConnected||(e.rel="shortcut icon",e.href="https://kahoot.it/favicon.ico",document.head.append(e),document.title="Play Kahoot!"),document.getElementById("manual").checked=!0,document.getElementById("hideAnswers").checked=Boolean(SettingDiv.style.display),game.saveOptions(),dataLayer.push({type:"panick",value:""})}break;case"d":document.getElementById("ChallengeDisableAutoplay").click(),new ErrorHandler("挑战自动游戏: "+(document.getElementById("ChallengeDisableAutoplay").checked?"关":"开"),{isNotice:!0}),dataLayer.push({type:"autoplay",value:document.getElementById("ChallengeDisableAutoplay").checked});break;case"k":document.getElementById("searchLoosely").value=Number(document.getElementById("searchLoosely").value)?0:1,new ErrorHandler("松散搜索: "+(Number(document.getElementById("searchLoosely").value)?"开":"关"),{isNotice:!0}),dataLayer.push({type:"loose",value:document.getElementById("searchLoosely").value});break;case"t":document.getElementById("teamtalk").click(),new ErrorHandler("跳过团队谈话: "+(Number(document.getElementById("teamtalk").checked)?"开":"关"),{isNotice:!0}),dataLayer.push({type:"teamtalk",value:document.getElementById("teamtalk").checked});break;default:return}dataLayer.push({event:"shortcut"}),e.preventDefault(),e.stopPropagation(),game.saveOptions()}};window.addEventListener("keydown",shortcuts),window.addEventListener("keydown",(e=>{if(game.question&&["quiz","multiple_select_quiz","multiple_select_poll","survey"].includes(game.question.type)&&document.querySelector('[alt="Red"]')&&+e.code.split("Digit")[1]<=4)switch(+e.code.split("Digit")[1]){case 0:send({type:"ANSWER_QUESTION",message:null});break;case 1:document.querySelector('[alt="Red"]').click();break;case 2:document.querySelector('[alt="Blue"]').click();break;case 3:document.querySelector('[alt="Yellow"]').click();break;case 4:document.querySelector('[alt="Green"]').click()}})),UIError.addEventListener("click",(()=>{clearTimeout(game.errorTimeout),UIError.style.right="",dataLayer.push({event:"close_error"})}));let pressTime=-1;SettingSwitch.addEventListener("click",(()=>{if(Date.now()-pressTime<500)return pressTime=-1,void shortcuts({ctrlKey:!0,key:"j",preventDefault:()=>{},stopPropagation:()=>{}});pressTime=Date.now()}));const SearchInput=document.getElementById("sub-quiz-input"),SearchOutput=document.getElementById("sub-quiz-output");let SearchIndex=0;function Search(e,t){SearchOutput.innerHTML="载入中...";const n=new XMLHttpRequest;n.open("GET",`/search?q=${encodeURIComponent(e)}&c=${Number(t)}`),n.send(),n.onload=function(){const a=JSON.parse(n.response);if(0===a.length)return void(SearchOutput.innerHTML="没有结果。");FormatSearch(a),document.getElementById("sub-quiz-next").addEventListener("click",(()=>{Search(e,(t||0)+25)}));Array.from(document.getElementsByClassName("sub-quiz-button")).forEach((e=>{e.addEventListener("click",(()=>{const t=e.nextElementSibling.value;document.getElementById("uuid").value=t,document.getElementById("sub-uuid").checked=!1}))}))}}function FormatSearch(e){SearchOutput.innerHTML='\n  <span>\n    <span class="sub-quiz-img"><img src="/resource/red-konosuba.svg"/></span>\n    <span class="sub-quiz-title">测验标题</span>\n    <span class="sub-quiz-author">测验创作者</span>\n    <span class="sub-quiz-questions">问题数</span>\n    <button id="sub-quiz-next">下一个</button>\n  </span>\n  <hr/>\n  ';for(const t in e){const n=e[t],a=Element("template");a.innerHTML=`<span>\n      <span class="sub-quiz-img"><img src="${n.cover}"/></span>\n      <span class="sub-quiz-title">${n.title}</span>\n      <span class="sub-quiz-author">${n.creator_username}</span>\n      <span class="sub-quiz-questions">${n.questions.length}</span>\n      <button class="sub-quiz-button">Use</button>\n      <input type="text" class="ch" value="${n.uuid}"/>\n    </span>`,SearchOutput.append(a.content.cloneNode(!0))}}SearchInput.addEventListener("keydown",(e=>{"Enter"===e.code&&(SearchIndex=0,Search(SearchInput.value,SearchIndex))})),game.loadOptions(),game.theme=ThemeChooser.value,"Kahoot"!=game.theme&&new LoginPage;window.addEventListener("load",(()=>{"4.0.0"!==localStorage.seenNotice&&new ErrorHandler("Important Notice! Click to show",{isNotice:!0,onclick:(e,t)=>{t.outerHTML="",showNotice()},permanent:!0}),"3.3.0"!==localStorage.returningUser&&activateTutorial()}));const TutorialDiv=document.getElementById("tutorial");function activateTutorial(){if(localStorage.returningUser="3.3.0",TutorialDiv&&TutorialDiv.innerHTML)return;AboutSwitch.checked&&AboutSwitch.click();const e=document.createElement("template");e.innerHTML='\n    <div class="tut_cont">\n      <div id="tut_data">\n        <div id="tut_info">\n          <strong>嘿！ 看来您是新来的。 您要教程吗？</strong>\n        </div>\n        <button id="tut_next" tut-step="0" onclick="tutorialSteps(this.getAttribute(\'tut-step\'))">是的，请！</button>\n        <button onclick="dataLayer.push({event:\'close_tutorial\'});document.getElementById(\'tutorial\').innerHTML = \'\';new ErrorHandler(\'如果您再次需要我，请单击“关于”部分中的教程按钮！\',{isNotice:true});resetGame();">不，谢谢。</button>\n      </div>\n    </div>\n  ',TutorialDiv.append(e.content.cloneNode(!0))}function tutorialSteps(e){dataLayer.push({event:"do_tutorial",value:e});const t=document.getElementById("tut_data"),[n,i]=Array.from(document.querySelectorAll("#tut_data>button")),o=document.getElementById("tut_info");switch(n.setAttribute("tut-step",+e+1),n.innerHTML="下一个",i.innerHTML="完成",e+""){case"0":SettingSwitch.checked&&SettingSwitch.click(),o.innerHTML="<em>注意：在本教程中实际上不要执行任何操作。 只需按“下一步”和“完成”。</em>\n      <p><strong>加入游戏：PIN</strong></p>\n      <p>要加入游戏，请首先输入游戏密码。</p>\n      <p>有效的游戏密码包括：</p>\n      <ul>\n        <li>现场游戏图钉 <code>12345</code></li>\n        <li>挑战游戏图钉 <code>012345</code></li>\n        <li>挑战游戏链接 <code>https://kahoot.it/challenge/012345?challenge-id=really-long-string</code></li>\n        <li>特别挑战赛 <code>weekly</code>, <code>weekly-previous</code></li>\n      </ul>";break;case"1":SettingSwitch.checked&&SettingSwitch.click(),new LoginPage(!0),o.innerHTML="<strong>加入游戏：姓名</strong>\n      <p>接下来，输入名称。 您也可以按“随机名称”按钮。</p>\n      <p>准备好后，按“好，出发”</p>";break;case"2":SettingSwitch.checked&&SettingSwitch.click(),game.name="讲解",game.pin="12345-LUGGAGE",new LobbyPage,t.style.marginTop="8rem",t.style.height="calc(100% - 10rem)",o.innerHTML="<p><strong>游戏中：提供测验名称</strong></p>\n      <p>加入游戏后，您可能会看到上面的输入。 在此输入中，应放置测验名称或测验ID。</p>\n      <p>测验名称不必精确。 如果您知道测验的一般主题，则可以尝试将其作为“测验名称”</p>\n      <p><strong>如何获得测验名称/编号：</strong></p>\n      <p>测验名称在载入测验之前（启动页面）出现在主机的屏幕上，并在测验开始时显示几秒钟。</p>\n      <p>测验ID位于主持人屏幕的网址中。 它是紧随其后的长字符串 <code>quizId=</code></p>";break;case"3":SettingSwitch.checked&&SettingSwitch.click(),o.innerHTML="<p><strong>游戏中：提供测验名称</strong></p>\n      <p>此输入将继续保持顶部，直到找到测验。</p>\n      <p>如果您不提供测验名称或ID，Kahoot Winner将使用超过50,000个测验的大型列表来尝试找到您的测验。 这可能仅适用于非常流行的测验。</p>";break;case"4":SettingSwitch.checked&&SettingSwitch.click(),t.style.marginTop="",game.question={type:"quiz",index:0,data:[{answer:"正确",correct:!0},{answer:"不正确的",correct:!1},{answer:"讲解",correct:!1},{answer:"",correct:!1,image:{id:"dfa9fc36-1122-4dc2-a00b-04d490c07765"}}],total:"42.069",currentGuesses:[{questions:[{time:2e4}]}],raw:{},ans:[4]},game.score=-1/0,new QuestionAnswererPage,activateLoading(!1),o.innerHTML="<p><strong>回答：基本概述</strong></p>\n      <p>默认情况下，Kahoot Winner会自动使用最佳答案来回答问题。</p>\n      <p>如果您想自己回答问题，请在设置中启用手动控制。</p>";break;case"5":SettingSwitch.checked&&SettingSwitch.click(),o.innerHTML="<p><strong>回答：信息</strong></p>\n      <p>如下所示，正确的答案周围会有彩虹边框。 此外，每个选项的文本都列在每个选项上方。</p>\n      <p>当选择使用一个图像时，图像将替换的形状。</p>";break;case"6":SettingSwitch.checked||SettingSwitch.click(),document.querySelector('[for="div_search_options"]').click(),t.style.position="absolute",o.innerHTML="<p><strong>设置：搜索选项</strong></p>\n      <p>搜索选项控制服务器如何找到您的测验。</p>\n      <p>测验作者-指定创建者以过滤测验</p>\n      <p>测验UUID-指定要使用的测验ID。 您也可以在子设置区域中直接搜索测验。</p>\n      <p>搜索词-指定测验名称/关键字以搜索测验</p>\n      <p>当前猜测-此按钮显示Kahoot Winner当前正在使用的测验。 您可以通过按锁将其锁定。</p>";break;case"7":SettingSwitch.checked||SettingSwitch.click(),document.querySelector('[for="div_game_options"]').click(),o.innerHTML="<p><strong>设置：游戏选项</strong></p>\n      <p>游戏选项控制Kahoot Winner与游戏互动的方式。</p>\n      <p>应答超时-延迟服务器的应答时间，以减少您的怀疑。</p>\n      <p>团队成员-在团队模式下自定义您的团队成员</p>\n      <p>故意失败-故意失败问题</p>\n      <p>松散搜索-当问题顺序随机化时使用。 需要用户输入才能选择正确的问题。</p>\n      <p>旁路2FA-如果启用，则跳过两个因素的步骤</p>\n      <p>手动控制-允许您回答问题而不是服务器</p>\n      <p>跳过团队交谈-允许您在团队交谈期间进行回答</p>\n      <p>预览问题-允许您查看即将出现的问题</p>\n      <p>隐藏正确-用来使Kahoot Winner在回答时看起来像普通的Kahoot。</p>";break;case"8":SettingSwitch.checked||SettingSwitch.click(),document.querySelector('[for="div_challenge_options"]').click(),o.innerHTML="<p><strong>设置：挑战选项</strong></p>\n      <p>注意：这些选项对<b>现场游戏</b>不起作用</p>\n      <p>积分-允许您自定义挑战问题中的积分/问题数量。</p>\n      <p>始终正确-使所有答案正确，即使您故意将其设置为错误。</p>\n      <p>启用条纹点-计算点时使用条纹</p>\n      <p>禁用问题计时器-您可以等待回答问题而不必担心计时器。</p>";break;case"9":t.style.position="",o.innerHTML="<p><strong>设置：更多信息</strong></p>\n      <p>如果需要更多说明，请打开设置，然后按每个选项旁边的“？”。</p>";break;case"10":i.addEventListener("click",(function e(){dataLayer.push({event:"complete_tutorial"}),setTimeout((function(){return new ErrorHandler("完成教程！ 要走的路！",{isNotice:!0})}),300);try{i.removeEventListener(e)}catch(e){}})),SettingSwitch.checked&&SettingSwitch.click(),game.end={info:{rank:1}},new QuizEndPage(JSON.stringify({metal:"upvote-filled"})),n.outerHTML="",o.innerHTML="<p><strong>没用！</strong></p>\n      <p>通常，当Kahoot Winner无法正常工作时，它是以下问题之一：</p>\n      <ol>\n        <li>测验是私人的。</li>\n        <ul><li>没有解决方法。 Kahoot Winner不适用于私人现场游戏。</li></ul>\n        <li>您未提供测验名称</li>\n        <ul><li>尽管Kahoot Winner缓存了很多测验，但数据库中还有很多测验。 提供测验名称，以确保Kahoot Winner能够找到它。</li></ul>\n        <li>测验不受欢迎</li>\n        <ul><li>如果您的测验有一个通用名称并且不受欢迎，那么它在Kahoots列表中可能就太远了，Kahoot Winner找不到它。</li></ul>\n        <li>问题是随机的</li>\n        <ul><li>如果问题是随机的，请启用<code>宽松搜索</code>并在问题开始时键入问题</li></ul>\n        <li>答案是随机的</li>\n        <ul><li>如果答案是随机的，请启用<code>手动</code>并正确回答问题。</li></ul>\n      </ol>"}}function showNotice(){localStorage.seenNotice="4.0.0";const e=document.createElement("template");e.innerHTML='<div class="notice">\n    <button onclick="document.querySelector(\'.notice\').outerHTML = \'\';">OK</button>\n    <h3><b>重要通知: </b><span class="red">Kahoot不再将测验名称发送给客户端。</span></h3>\n    <h4>这是什么意思？</h4>\n    <p>现在，您需要自己输入测验名称。 如果测验非常受欢迎，您可能会很幸运，因为我们现在将已播放的Kahoot测验存储在数据库中。</p>\n    <p>您可以将测验名称放在顶部的输入中：</p>\n    <div>\n      <img src="/resource/misc/notice-2020-07-03.png" alt="input at the top">\n    </div>\n  </div>',document.body.append(e.content.cloneNode(!0))}