PageSourceSearch

https://ensinosocial.com.br/assets/js/dori-pet.js?v=1790200746

js ensinosocial.com.br collected 2026-10-02 00:26:28 UTC 59,509 bytes, 1 lines download raw bytes

1(function(){"use strict";var _=document.getElementById("dpetYard"),R=document.getElementById("doriWidget"),C=document.getElementById("dpetPanel");if(!_||!R||!C)return;var A=document.getElementById("dpetStage"),f=document.getElementById("dpetStageSprite"),no=document.getElementById("dpetHud"),Oe=document.getElementById("dpetAcoes"),Wt=document.getElementById("dpetMsg"),ro=document.getElementById("dpetViewLogin"),io=document.getElementById("dpetViewAdotar"),it=document.getElementById("dpetViewOvo"),j=document.getElementById("dpetStageOvo"),ue=document.getElementById("dpetBadge"),X=document.getElementById("dpetBubbleHeader"),b=document.getElementById("dpetBubble"),Gt=document.getElementById("dpetConfete"),so=document.getElementById("dpetNome"),dt=document.getElementById("dpetMoedas"),uo=document.getElementById("dpetFome"),lo=document.getElementById("dpetNomeInput"),co=document.getElementById("dpetBtnAdotar"),st=document.getElementById("dpetFechar"),ee=document.getElementById("dpetNivel"),Ne=document.getElementById("dpetStreak"),Re=document.getElementById("dpetStreakFila"),Ht=document.getElementById("dpetStreakTxt"),le=document.getElementById("dpetFaseFio"),ce=document.getElementById("dpetFaseBarra"),fe=document.getElementById("dpetQuer"),Qt=document.getElementById("dpetQuerTitulo"),Zt=document.getElementById("dpetQuerSub"),Y=document.getElementById("dpetQuerCta"),ut=document.getElementById("dpetTruquesGrid"),Be=document.getElementById("dpetLojaTruques"),V=document.getElementById("dpetTruquesMenu"),lt=document.getElementById("dpetFaseAlvo"),ct=document.getElementById("dpetFaseFalta"),Fe=null,Xt=!1,je=document.getElementById("dpetViewLoja"),te=document.getElementById("dpetLojaLista"),xe=document.getElementById("dpetLojaQuintal"),ze=document.getElementById("dpetLojaSementes"),Yt=1,me=document.getElementById("dpetLojaAbas"),$t=document.getElementById("dpetLojaDica"),Kt=document.getElementById("dpetLojaSaldo"),fo=document.getElementById("dpetLojaVoltar"),ae=document.getElementById("dpetQuintal"),ft=ae?Array.prototype.slice.call(ae.querySelectorAll(".dq-canteiro")):[],ea=document.getElementById("dpetQuintalPlaca"),ta=_.getAttribute("data-aluno")||"",M=parseInt(_.getAttribute("data-tesouro")||"0",10)||0,Ie=document.getElementById("dpetTesouro"),Ae=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,oe=_.getAttribute("data-logado")==="1",n=null,mt=!1,aa=!1,$=null,ve=localStorage.getItem("dpet-mudo")==="1",Ve=document.getElementById("dpetSom"),l={clique:[[660,.06]],come:[[330,.08],[392,.08],[494,.14]],moeda:[[988,.07],[1319,.16]],pula:[[392,.05],[587,.12]],fanfarra:[[523,.1],[659,.1],[784,.1],[1047,.22]],triste:[[330,.12],[247,.22]],foguete:[[196,.07],[262,.07],[330,.07],[523,.16]],atchim:[[880,.05],[440,.16]],carinho:[[784,.05],[988,.09]],falha:[[587,.05],[440,.06],[294,.07],[147,.18]]};function c(e){if(!ve)try{$=$||new(window.AudioContext||window.webkitAudioContext),$.state==="suspended"&&$.resume();var t=$.currentTime;e.forEach(function(a){var o=$.createOscillator(),r=$.createGain();o.type="square",o.frequency.value=a[0],r.gain.setValueAtTime(.04,t),r.gain.exponentialRampToValueAtTime(5e-4,t+a[1]),o.connect(r).connect($.destination),o.start(t),o.stop(t+a[1]),t+=a[1]*.9})}catch(a){}}function oa(){Ve&&(Ve.textContent=ve?"🔇":"🔊")}oa(),Ve&&Ve.addEventListener("click",function(){ve=!ve;try{localStorage.setItem("dpet-mudo",ve?"1":"0")}catch(e){}oa(),ve||c(l.clique)});var an={feliz:["bip!","Oi! 😊","Bora estudar?","Tô de boa!","bip bip!","Que dia bom!"],radiante:["TURBINADO! ⚡","BZZZT!","Energia no máximo!","ZUM ZUM!"],fominha:["...","hmm, um lanchinho?","barriguinha roncando...","bip... fome..."],muita_fome:["fominha...","...","sem energia..."],soneca:["Zzz...","zzZzz..."],saudade:["Zzz... *poeira*"]},mo={aula_concluida:"Aula concluída!",curso_concluido:"Curso concluído! 🎉",achado_diario:"Achado do dia!",revisao_em_dia:"Revisão em dia! 🧠",cofre_juros:"Rendimento do cofrinho! 🐖",aluguel_predio:"Aluguel do prédio! 🏢"},na={11:"Era nova: Bit! O quintal te espera. 🌱",31:"Era nova: Super Bit! ⚡",51:"Era nova: Mega Bit! 1 megabyte guarda uma música inteira. 🎵",71:"Era nova: Giga Bit! 1 gigabyte guarda um filme inteiro. 🎬",91:"Era nova: Tera Bit! 1 terabyte guarda uma biblioteca inteira. 📚",100:"Bit de Ouro! De um bit a um mundo de conhecimento. ✨"},ra=["feliz","radiante","fominha","muita_fome","soneca","saudade"],ia=!1;function vo(){var e=new Date().getHours(),t=e<5?["ainda acordado? 🌙","bip... que horas são?"]:e<12?["bom dia! ☀️","dia novo, aula nova!"]:e<18?["boa tarde!","bora estudar um tiquinho?"]:["boa noite! 🌙","estudo noturno? gosto!"],a=t[Math.floor(Math.random()*t.length)];return ta&&Math.random()<.5&&(a=ta+", "+a),a}function po(){var e=document.querySelector('meta[name="csrf-token"]');return e?e.getAttribute("content"):""}function D(e,t){var a=new FormData;a.append("csrf_token",po()),Object.keys(e).forEach(function(o){a.append(o,e[o])}),fetch("/?a=api.pet",{method:"POST",body:a,credentials:"same-origin"}).then(function(o){return o.json()}).then(function(o){o&&o.erro&&typeof o.ok=="undefined"&&(o.ok=!1),t(o||{ok:!1,erro:"Resposta vazia."})}).catch(function(){t({ok:!1,erro:"Sem conexão. Tente de novo."})})}function da(e,t){ra.forEach(function(r){e.classList.remove("dpet-e-"+r)}),e.classList.add("dpet-e-"+t.estado),["dpet-nv-1","dpet-nv-2","dpet-nv-3"].forEach(function(r){e.classList.remove(r)}),e.classList.add("dpet-nv-"+(t.nivel||2)),Array.prototype.slice.call(e.classList).forEach(function(r){r.indexOf("dpet-cos-")===0&&e.classList.remove(r)}),e.classList.remove("dpet-has-chapeu");var a=t.equipados,o=t.cosmeticos||{};
1a?(Object.keys(a).forEach(function(r){a[r]&&e.classList.add("dpet-cos-"+a[r])}),a.cabeca==="chapeu"&&e.classList.add("dpet-has-chapeu")):(o.oculos&&e.classList.add("dpet-cos-oculos"),t.cabeca==="chapeu"?e.classList.add("dpet-has-chapeu"):t.cabeca==="laco"?e.classList.add("dpet-cos-laco"):t.cabeca==="foguete"&&e.classList.add("dpet-cos-foguete"))}function vt(e){e=e||"rosa",Array.prototype.slice.call(R.classList).forEach(function(t){t.indexOf("dpet-cor-")===0&&R.classList.remove(t)}),R.classList.add("dpet-cor-"+e),["dpetCoresAdotar","dpetCoresLoja"].forEach(function(t){var a=document.getElementById(t);a&&Array.prototype.forEach.call(a.querySelectorAll("button"),function(o){var r=o.getAttribute("data-cor")===e;o.classList.toggle("dpet-cor-sel",r),o.setAttribute("aria-pressed",r?"true":"false")})})}var go=["fominha","muita_fome","soneca","saudade"];function ho(){return Array.prototype.slice.call(document.querySelectorAll(".dpet-icone[data-dpet-icone]"))}function bo(){var e=f.querySelector("svg.dpet-sprite");if(e){[[_,"header"],[document.getElementById("doriMenuBtn"),"nav"]].forEach(function(a){var o=a[0];if(o){var r=o.querySelector(".dpet-ovo");if(r&&r.remove(),!o.querySelector(".dpet-icone")){var u=o.querySelector(":scope > svg"),d=document.createElement("span");if(d.className="dpet-icone",d.setAttribute("data-dpet-icone",a[1]),d.appendChild(e.cloneNode(!0)),a[1]==="nav"){var s=document.createElement("span");s.className="dpet-badge",s.setAttribute("aria-hidden","true"),d.appendChild(s)}u?o.replaceChild(d,u):o.insertBefore(d,o.firstChild),a[1]==="nav"&&o.classList.add("dpet-casa")}}});var t=document.getElementById("dpetOvoTopo");t&&t.remove(),j&&(j.hidden=!0)}}
1function Eo(e){bo(),ho().forEach(function(t){da(t,e)}),_.setAttribute("data-estado",e.estado||"")}function P(){if(!(!n||!n.pet)){var e=n.pet;da(f,e),Eo(e),e.cor&&vt(e.cor),so.textContent=e.nome;var t=e.trancado||0;dt.textContent=t>0?e.livre+" 🐖"+t:String(e.moedas),dt.parentElement&&(dt.parentElement.title=t>0?e.livre+" pra gastar · "+t+" guardados no cofrinho":"Parafusos");for(var a=uo.children,o=Math.round(e.fome/10),r=0;r<a.length;r++)a[r].classList.toggle("dpet-cheia",r<o);var u=n.revisoes_vencidas||0,d=n.revisoes_novas||0;ue.hidden=go.indexOf(e.estado)<0&&u===0&&d===0,ca&&(ca.textContent=u>0?u+" pra hoje!":d>0?d+(d===1?" nova ✨":" novas ✨"):"em dia ✔");var s=document.getElementById("dpetMissao");s&&(s.hidden=!0),yo(n.missao||null);var m=Oe.querySelector('button[data-acao="brincar"]');if(m){m.disabled=e.brincadeiras_restantes<=0;var g=m.querySelector("em");g&&(g.textContent=e.brincadeiras_restantes>0?e.brincadeiras_restantes+"x hoje":"amanhã!")}var i=n.progresso||null;if(ee&&i)ee.textContent="Fase "+i.fase+" · "+i.era,ee.title=i.custo_fase>0?"XP: "+(e.xp||0)+" — faltam "+(i.custo_fase-i.xp_na_fase)+"🔩 de estudo pra fase "+(i.fase+1):"Fase máxima! XP: "+(e.xp||0),ee.hidden=!1;else if(ee){var E=e.nivel||2;ee.textContent="Nv "+E+(E===1?" Filhote":E===3?" SUPER":""),ee.hidden=!1}if(le&&i){var h=i.custo_fase>0?Math.round(100*i.xp_na_fase/i.custo_fase):100;if(le.firstElementChild.style.width=h+"%",le.hidden=!1,ce){if(lt&&ct)if(i.custo_fase>0){var I=Math.max(1,Math.ceil((i.custo_fase-i.xp_na_fase)/10));lt.textContent="Fase "+(i.fase+1),ct.textContent="faltam "+I+(I===1?" aula":" aulas")}else lt.textContent="Fase máxima! 🏆",ct.textContent="";ce.hidden=!1}}if(i&&(Fe!==null&&i.fase>Fe&&i.fase>(n.fase_vista||0)&&ko(i,Fe),Fe=i.fase),Ne){var k=n.streak||0;Ne.hidden=k<1;var O=Ne.querySelector("b");O&&(O.textContent=String(k)),Ne.title=k+(k===1?" dia":" dias")+" seguidos visitando — o achado do dia paga até +5🔩 de bônus",xo(k,e)}Ao(),je&&!je.hidden&&z(),Se&&!Se.hidden&&Oa()}}function yo(e){if(fe){if(!e||!e.titulo){fe.hidden=!0;return}if(fe.hidden=!1,fe.classList.toggle("dpet-quer-ok",!!e.cumprida),e.cumprida){Qt.textContent="✓ "+e.titulo,Zt.textContent="Missão de hoje cumprida! Amanhã tem outra.",Y.hidden=!0;return}Qt.textContent=e.titulo,Zt.textContent=(e.sub||"")+(e.truque?" · truque novo: "+e.truque.emoji+" "+e.truque.nome:""),e.tipo==="rev"?(Y.textContent="Revisar agora",Y.hidden=!1):e.url?(Y.textContent=e.tipo==="aula"?"Continuar a aula →":"Ver meus cursos →",Y.hidden=!1):Y.hidden=!0}}Y&&Y.addEventListener("click",function(){var e=n&&n.missao;if(e){if(c(l.clique),e.tipo==="rev"){he();return}e.url&&(window.location.href=e.url)}});function sa(e){if(e==="confete"){p(f,"dpet-anim-pula",700),J();return}p(f,"dpet-anim-"+e,1300)}var pt=!1;function Co(e){if(!(pt||!e||!e.length||!f)){pt=!0;var t=e.slice(0,3);(function a(){var o=t.shift();if(!o){pt=!1;return}c(l.fanfarra),sa(o.id),v("Aprendi "+o.emoji+" "+o.nome+"!",b),y(o.emoji),D({acao:"truque_visto",truque:o.id},function(){}),H(a,2100)})()}}var gt=null,De=!1;function Bo(){if(!V||!n)return!1;var e=(n.truques||[]).filter(function(t){return t.tem});return e.length?(V.textContent="",e.forEach(function(t){var a=document.createElement("button");a.type="button",a.textContent=t.emoji+" "+t.nome,a.setAttribute("data-truque",t.id),V.appendChild(a)}),!0):!1}A&&V&&(A.addEventListener("pointerdown",function(){De=!1,clearTimeout(gt),gt=setTimeout(function(){!n||!n.adotado||Bo()&&(De=!0,c(l.clique),V.hidden=!1)},550)}),["pointerup","pointerleave","pointercancel"].forEach(function(e){A.addEventListener(e,function(){clearTimeout(gt)})}),V.addEventListener("click",function(e){e.stopPropagation();var t=e.target.closest("button[data-truque]");t&&(V.hidden=!0,c(l.clique),sa(t.getAttribute("data-truque")))}),document.addEventListener("click",function(e){V.hidden||e.target.closest("#dpetTruquesMenu")||(V.hidden=!0)},!0));function xo(e,t){if(Re){if(e<1){Re.hidden=!0;return}Re.hidden=!1;
1for(var a=Re.querySelectorAll(".dpet-streak-casas i"),o=(e-1)%7+1,r=0;r<a.length;r++){var u=r+1;a[r].classList.toggle("dpet-casa-on",u<=o),a[r].classList.toggle("dpet-casa-prox",u===o+1),a[r].textContent=u<=o?"✓":String(u)}if(Ht){var d=t&&t.congelador,s;n.gelo_usado_hoje?s="🧊 O congelador segurou seu 🔥 ontem! <b>"+e+(e===1?" dia":" dias")+"</b> seguidos.":e>=7?s="🔥 <b>"+e+" dias</b> seguidos! "+(d?"🧊 congelador guardado.":"Um 🧊 na Lojinha segura o fogo por 1 dia."):e===1?s="🔥 volte amanhã e acende a casa 2.":s="🔥 <b>"+e+" dias</b> seguidos · volte amanhã e acende a "+(o+1)+"ª."+(d?" 🧊 guardado.":""),Ht.innerHTML=s}}}function Io(){var e=new Date().getHours();return e>=18||e<6}var Je=null;function Ao(){if(!(!ae||!ft.length)){var e=n&&n.quintal||null,t=!!(e&&e.ativo);if(ae.hidden=!t,A.classList.toggle("dpet-tem-quintal",t),A.classList.toggle("dq-noite",t&&(Je!==null?Je:Io())),!t){ea.textContent="";return}var a=["dpet-quintal"];(e.cenario||[]).forEach(function(u){a.push("dq-on-"+u)}),ae.className=a.join(" ");var o=e.slots||[],r=[];ft.forEach(function(u){var d=parseInt(u.getAttribute("data-slot"),10),s=null;o.forEach(function(h){h.slot===d&&(s=h)});var m=s&&s.planta,g=["dq-item","dq-canteiro","dq-slot-"+d];if(m){g.push("dq-t-"+m.tipo);var i=3;m.pronta||(i=m.regas<=0?0:m.regas/m.precisa<.5?1:2),g.push("dq-e-"+i)}u.className=g.join(" ");var E;m?m.pronta?(r.push("🌻 colher! +"+m.colheita+"🔩"),E=m.nome+" madura — colher e ganhar "+m.colheita+" Parafusos"):(r.push(m.regas+"/"+m.precisa+" 🌱"),E=m.nome+" crescendo: "+m.regas+" de "+m.precisa+" regas"):(r.push(o.length>1?"🌱 plantar ("+d+")":"🌱 plantar · "+e.semente+"🔩"),E="Canteiro "+d+" vazio — plantar uma semente"),u.setAttribute("aria-label",E)}),ea.textContent=o.length>1?r.join("  ·  "):r[0]||""}}function z(){if(!(!n||!n.pet||!te)){var e=n.pet,t=n.loja||null,a=t&&t.armario;if(Kt){var o=(e.trancado||0)>0?e.livre:e.moedas;Kt.textContent="🔩 "+o+(a?" · ✨ "+a.tem+"/"+a.total:"")}var r={};(t&&t.itens||[]).forEach(function(L){r[L.item]=L});var u=e.equipados||{},d=n.congelador||null,s=n.cofre||null,m=document.getElementById("dpetCofreResumo"),g=document.getElementById("dpetCofreSelo"),i=document.getElementById("dpetCofreAbrir"),E=i?i.closest("li"):null;s&&m&&i&&(E&&(E.classList.toggle("dpet-item-on",!!s.tem),E.classList.toggle("dpet-item-lock",!s.aberto&&!s.tem)),g&&(g.hidden=!(s.tem&&s.pode_resgatar),g.hidden||(g.textContent="pode abrir!")),s.tem?(m.textContent=s.valor+"🔩 rendendo · "+s.dias+"/"+s.dias_min+" dias",i.disabled=!1,i.textContent="ver"):s.aberto?(m.textContent=s.taxa+"% por dia de visita · abre com "+s.minimo+"🔩",i.disabled=!1,i.textContent="abrir"):(m.textContent="abre na "+(s.trava||"fase "+s.fase_min)+" 🔒",i.disabled=!1,i.textContent="ver"));var h=n.predio||null,I=document.getElementById("dpetPredioResumo"),k=document.getElementById("dpetPredioSelo"),O=document.getElementById("dpetPredioAbrir"),se=O?O.closest("li"):null;h&&I&&O&&(se&&(se.classList.toggle("dpet-item-on",!!h.tem),se.classList.toggle("dpet-item-lock",!h.aberto&&!h.tem)),k&&(k.hidden=!(h.tem&&h.vago_dias!==null&&h.vago_dias>=2),k.hidden||(k.textContent="vago!")),h.tem?(I.textContent=h.cotas+(h.cotas===1?" cota":" cotas")+" · até "+h.aluguel_cheio+"🔩 por dia estudado",O.disabled=!1,O.textContent="ver"):h.aberto?(I.textContent=h.preco+"🔩 a cota · paga "+h.aluguel_cota+"🔩 por dia estudado",O.disabled=!1,O.textContent="abrir"):(I.textContent=h.trava==="feche um 🐖"?"feche um 🐖 Cofrinho pra abrir 🔒":"abre na "+(h.trava||"fase "+h.fase_min)+" 🔒",O.disabled=!1,O.textContent="ver")),Array.prototype.forEach.call(te.querySelectorAll("li[data-util]"),function(L){var S=L.querySelector("button");if(S){var x=d?!!d.tem:!!e.congelador;L.classList.toggle("dpet-item-on",x),L.classList.toggle("dpet-item-lock",!!(d&&!x&&!d.aberto)),x?(S.disabled=!0,S.setAttribute("data-modo","guardado"),S.textContent="guardado ✔"):d&&!d.aberto?(S.disabled=!0,S.removeAttribute("data-modo"),S.textContent=(d.trava||"fase "+d.fase_min)+" 🔒"):(S.disabled=!1,S.setAttribute("data-modo","congelar"),S.textContent=(d?d.preco:parseInt(S.getAttribute("data-preco"),10)||40)+"🔩")}}),Array.prototype.forEach.call(te.querySelectorAll("li[data-item]:not([data-util])"),function(L){var S=L.getAttribute("data-item"),x=L.querySelector("button"),nt=L.querySelector(".dpet-selo");if(!(!S||!x)){var N=r[S]||null,Jt=N?N.tem:!!(e.cosmeticos||{})[S],Ut=!1;if(Object.keys(u).forEach(function(tn){u[tn]===S&&(Ut=!0)}),L.classList.toggle("dpet-item-on",Ut),L.classList.toggle("dpet-item-lock",!!(N&&!Jt&&!N.aberto)),nt&&(nt.hidden=!(N&&N.oferta&&!Jt),nt.hidden||(nt.textContent="-"+t.desconto+"% hoje")),Jt)Ut?(x.disabled=!1,x.setAttribute("data-modo","tirar"),x.textContent="tirar"):(x.disabled=!1,x.setAttribute("data-modo","usar"),x.textContent="usar");else if(N&&!N.aberto)x.disabled=!0,x.removeAttribute("data-modo"),x.textContent=(N.trava||"fase "+N.fase_min)+" ðŸ”
1’";else{x.disabled=!1,x.setAttribute("data-modo","comprar");var rt=N?N.preco:parseInt(x.getAttribute("data-preco"),10)||0,oo=N?N.preco_hoje:rt;x.innerHTML=oo<rt?"<s>"+rt+"</s>"+oo+"🔩":rt+"🔩"}}}),qo(),Lo()}}function qo(){if(!(!ut||!Be)){var e=n&&n.truques||[];if(!e.length){Be.hidden=!0;return}ut.textContent="",e.forEach(function(t){var a=document.createElement("li");a.className=t.tem?"dpet-truque-on":"dpet-truque-lock";var o=document.createElement("i");o.className="e",o.textContent=t.tem?t.emoji:"🔒";var r=document.createTextNode(t.nome),u=document.createElement("small");u.textContent=t.rotulo,a.appendChild(o),a.appendChild(r),a.appendChild(u),ut.appendChild(a)}),Be.hidden=te.hidden}}function Lo(){if(!(!xe||!n||!n.quintal)){var e=!!n.quintal.ativo;if(me){var t=me.querySelector('button[data-aba="quintal"]');t&&(t.hidden=!e)}if(!e){ht("bit");return}var a={};(n.quintal.loja||[]).forEach(function(o){a[o.item]=o}),Array.prototype.forEach.call(xe.querySelectorAll("li"),function(o){var r=o.getAttribute("data-item"),u=o.querySelector("button"),d=a[r];!u||!d||(u.disabled=d.tem,u.textContent=d.tem?"seu ✔":d.preco+"🔩")})}}var ua={bit:"Um item por parte do Bit. Toque pra vestir, de novo pra tirar.",quintal:"Enfeite é pra sempre — o quintal vai ficando com a sua cara.",sementes:"Quanto mais tempo a planta leva, mais ela rende. Escolha a sua."};function ht(e){me&&(Array.prototype.forEach.call(me.querySelectorAll("button"),function(t){var a=t.getAttribute("data-aba")===e;t.classList.toggle("dpet-aba-on",a),t.setAttribute("aria-selected",a?"true":"false")}),te.hidden=e!=="bit",Be&&(Be.hidden=e!=="bit"),xe.hidden=e!=="quintal",ze&&(ze.hidden=e!=="sementes"),$t&&($t.textContent=ua[e]||ua.bit))}function v(e,t){t.textContent=e,t.hidden=!1,clearTimeout(t._dpetTimer),t._dpetTimer=setTimeout(function(){t.hidden=!0},2400)}function w(e){Wt.textContent=e}function So(){Wt.innerHTML='Sem Parafusos! <a href="/?a=aluno.cursos">Concluir uma aula</a> enche o bolso 🔩',v("Conclua uma aula e ganhe Parafusos!",b)}function p(e,t,a){e.classList.remove(t),e.offsetWidth,e.classList.add(t),setTimeout(function(){e.classList.remove(t)},a||700),t==="dpet-anim-pula"&&(A.classList.add("dq-vento"),setTimeout(function(){A.classList.remove("dq-vento")},a||700))}function J(){Gt.hidden=!1,setTimeout(function(){Gt.hidden=!0},900)}function y(e){var t=document.createElement("span");t.className="dpet-part",t.textContent=e,t.style.left=35+Math.random()*30+"%",A.appendChild(t),setTimeout(function(){t.remove()},1100)}(function e(){setTimeout(function(){[f].forEach(function(t){/dpet-e-(soneca|saudade)/.test(t.className)||(t.classList.add("dpet-blink"),setTimeout(function(){t.classList.remove("dpet-blink")},140),Math.random()<.3&&setTimeout(function(){t.classList.add("dpet-blink"),setTimeout(function(){t.classList.remove("dpet-blink")},140)},260))}),e()},3e3+Math.random()*5e3)})(),(function e(){setTimeout(function(){if(C.hidden)if(n&&n.pet){var t=n.pet.estado;n.revisoes_vencidas>0?v("revisão? 🧠",X):n.revisoes_novas>0?v("perguntas novas! ✨",X):t==="fominha"||t==="muita_fome"?v("...",X):(t==="soneca"||t==="saudade")&&v("Zzz",X)}else M>0?v(M+"🔩 te esperando!",X):oe||v("Zzz",X);e()},18e3+Math.random()*8e3)})();var pe=document.getElementById("dpetComo");if(pe){try{localStorage.getItem("dpet-como-aberto")==="1"&&(pe.open=!0)}catch(e){}pe.addEventListener("toggle",function(){try{localStorage.setItem("dpet-como-aberto",pe.open?"1":"0")}catch(e){}})}var la=document.getElementById("dpetViewRevisao"),ca=document.getElementById("dpetRevisaoInfo"),bt=document.getElementById("dpetRevProgresso"),Et=document.getElementById("dpetRevCurso"),fa=document.getElementById("dpetRevCard"),Ue=document.getElementById("dpetRevPergunta"),qe=document.getElementById("dpetRevResposta"),ge=document.getElementById("dpetRevMostrar"),Le=document.getElementById("dpetRevBotoes"),yt=document.getElementById("dpetRevFim"),ne=document.getElementById("dpetRevGibis"),_o=document.getElementById("dpetRevVoltar"),Se=document.getElementById("dpetViewJogos"),ma=document.getElementById("dpetViewJogo"),We=document.getElementById("dpetViewCofre"),Ge=document.getElementById("dpetViewPredio");function B(e){et(),ro.hidden=e!=="login",C.classList.toggle("dpet-modo-login",e==="login"),io.hidden=e!=="adotar",it&&(it.hidden=e!=="ovo"),e!=="ovo"&&(C.classList.remove("dpet-modo-ovo"),j&&(j.hidden=!0),A&&A.setAttribute("aria-label","Fazer carinho no pet")),la&&(la.hidden=e!=="revisao"),je&&(je.hidden=e!=="loja"),Se&&(Se.hidden=e!=="jogos"),ma&&(ma.hidden=e!=="jogo"),We&&(We.hidden=e!=="cofre"),Ge&&(Ge.hidden=e!=="predio"),no.hidden=e!=="main",Oe.hidden=e!=="main",pe&&(pe.hidden=e!=="main");var t=document.getElementById("dpetMissao");t&&e!=="main"&&(t.hidden=!0),ce&&e!=="main"&&(ce.hidden=!0),fe&&e!=="main"&&(fe.hidden=!0),V&&(V.hidden=!0),st&&(st.hidden=e==="revisao"||e==="loja"||e==="jogos"||e==="jogo"||e==="cofre"||e==="predio"),w("")}var He=[],U=null,Qe=0,Ze=0,Ct=!1,va=!0,pa=!1,_e=[],we={};function he(){B("revisao"),yt.hidden=!0,ne&&(ne.hidden=!0),ge.hidden=!0,Le.hidden=!0,qe.hidden=!0,fa.hidden=!1,Et.textContent="",bt.textContent="",Ue.textContent="Carregando…",D({acao:"revisao_fila"},function(e){if(!e.ok){Ue.textContent=e.erro||"Não deu pra buscar a fila.";return}if(He=e.cards||[],Qe=He.length,Ze=0,va=e.tem_cards!==!1,pa=e.aguardando_estudo===!0,_e=e.gibis||[],we={},!Qe){ha(!0);return}ga()})}function wo(){if(!(!ne||!_e.length)){ne.textContent="";var e=document.createElement("p");e.className="dpet-rev-gibis-titulo",e.textContent="📖 Revisão em quadrinhos:",ne.appendChild(e);var t=_e.slice().sort(function(a,o){return(we[o.url]?1:0)-(we[a.url]?1:0)});t.forEach(function(a){var o=document.createElement("a");if(o.className="dpet-rev-gibi",o.href=a.url,o.setAttribute("data-nav","1"),o.textContent="📖 "+a.titulo,we[a.url]){var r=document.createElement("span");r.className="dpet-rev-gibi-selo",r.textContent="reforça o que errou 💪",o.appendChild(r)}ne.appendChild(o)}),ne.hidden=!1}}function ga(){if(U=He.shift()||null,!U){ha(!1);return}bt.textContent=Qe-He.length+"/"+Qe,Et.textContent=(U.curso||"")+(U.nova?(U.curso?" · ":"")+"card novo ✨":""),Ue.textContent=U.pergunta,qe.textContent=U.resposta,qe.hidden=!0,ge.hidden=!1,Le.hidden=!0}function ha(e){U=null,ge.hidden=!0,Le.hidden=!0,qe.hidden=!0,fa.hidden=!0,Et.textContent="",bt.textContent="",Ue.textContent="",w(""),yt.hidden=!1,yt.textContent=e?pa?"Conclua uma aula e as revisões dela nascem aqui — o Bit guarda as perguntas! ✨":va?"Tudo em dia por hoje! O Bit te chama na hora certa. 🧠":"Seus cursos ainda não têm revisões — o Bit avisa quando chegarem! 🌱":"Revisões em dia! 🎉"+(Ze>0?" +"+Ze+" 🔩":""),wo(),e||(c(l.fanfarra),J(),p(f,"dpet-anim-pula",700)),D({acao:"estado"},function(t){t.ok&&t.adotado&&(n=t,P())})}function To(e){if(!(Ct||!U)){Ct=!0;var t=U;
1D({acao:"revisao_responder",flashcard_id:t.id,resultado:e?"acertei":"errei"},function(a){if(Ct=!1,!a.ok){w(a.erro||"Ops, não deu. Tenta de novo.");return}if(a.moedas_ganhas>0&&(Ze+=a.moedas_ganhas,c(l.moeda),y("+"+a.moedas_ganhas+" 🔩"),n&&n.pet&&(n.pet.moedas+=a.moedas_ganhas)),e)p(f,"dpet-anim-pula",700),w("Esse volta em "+a.proxima_em_dias+(a.proxima_em_dias===1?" dia.":" dias."));else if(c(l.triste),p(f,"dpet-anim-atchim",500),w("Sem stress — esse volta amanhã. 💪"),t.gibi){we[t.gibi]=!0;var o=_e.some(function(r){return r.url===t.gibi});o||_e.push({titulo:t.gibi_titulo||"a aula deste card",url:t.gibi})}n&&!t.nova&&n.revisoes_vencidas>0&&n.revisoes_vencidas--,n&&t.nova&&n.revisoes_novas>0&&n.revisoes_novas--,ga()})}}ge&&(ge.addEventListener("click",function(){c(l.clique),qe.hidden=!1,ge.hidden=!0,Le.hidden=!1}),Le.addEventListener("click",function(e){var t=e.target.closest("button");t&&To(t.id==="dpetRevAcertei")}),_o.addEventListener("click",function(){B("main"),P()}));function ba(e,t){var a=null;return Object.keys(na).forEach(function(o){o=parseInt(o,10),t<o&&e>=o&&(a=na[o])}),a}function Ea(e){D({acao:"fase_vista",fase:e},function(){}),n&&(n.fase_vista=e)}function ko(e,t){Ea(e.fase),H(function(){c(l.fanfarra),p(f,"dpet-anim-pula",700),J(),v(ba(e.fase,t)||"Fase "+e.fase+"! 🎉",b)},2600)}var be=!1;function ya(e){if(!Xt){Xt=!0;var t=e.progresso;if(t){var a=e.fase_vista||0;if(!(t.fase<=a)){if(be=!0,le&&!Ae){ce&&(ce.hidden=!1),le.hidden=!1;var o=le.firstElementChild;o.style.transition="none",o.style.width="0%",o.offsetWidth,o.style.transition=""}c(l.fanfarra),v(a===0?"Seu Bit está na fase "+t.fase+"! 🎉":ba(t.fase,a)||"Fase "+t.fase+"! 🎉",b),Ea(t.fase)}}}}function Bt(e){e.gelo_usado_hoje&&!be&&(c(l.moeda),y("🧊"),v("o congelador segurou seu 🔥! 🧊",b),be=!0),e.saudade?(p(f,"dpet-anim-atchim",700),be||(c(l.atchim),v("ATCHIM! 🌪️ ...que bom te ver!",b))):!be&&e.pet&&(e.pet.estado==="feliz"||e.pet.estado==="radiante")&&v(vo(),b),be=!1,e.truques_novos&&e.truques_novos.length&&H(function(){Co(e.truques_novos)},1900),e.aluguel_pago>0&&H(function(){c(l.moeda),y("🏢"),w("🏢 O prédio te pagou "+e.aluguel_pago+"🔩 de aluguel pelos dias que você estudou.")},900);var t=(e.novidades||[]).slice(0,6);(function a(){var o=t.shift();o&&(c(l.moeda),p(f,"dpet-anim-pula",700),J(),y("+"+o.delta+" 🔩"),w("+"+o.delta+" 🔩 — "+(mo[o.motivo]||"Recompensa!")),H(a,1400))})()}var G=!1;function Ee(){if(C.hidden=!1,St=!1,!oe){B("login");return}if(n&&n.adotado){B("main"),P(),D({acao:"estado",visita:"1"},function(e){e.ok&&e.adotado&&(n=e,ya(e),P(),Bt(e)),G&&(G=!1,he())});return}F&&Za(),D({acao:"estado",visita:"1"},function(e){if(!e.ok){if(G=!1,F)return;B("main"),w(e.erro||"Não deu pra falar com o Bit agora.");return}if(!e.adotado&&F){G=!1,e.ovo&&e.ovo.continuar&&Ho(e.ovo.continuar);return}if(!e.adotado){G=!1,ot(),B("adotar"),Dt();return}n=e,B("main"),ya(e),P(),Bt(e),G&&(G=!1,he())})}var xt=[];function H(e,t){var a=setTimeout(function(){C.hidden||e()},t);return xt.push(a),a}function Mo(){xt.forEach(clearTimeout),xt=[]}function Xe(){C.hidden=!0,Mo(),et()}_.addEventListener("click",function(){c(l.clique),C.hidden?Ee():Xe()}),st.addEventListener("click",Xe),document.addEventListener("click",function(e){if(!C.hidden){var t=e.target&&e.target.closest?e.target.closest("#doriWidgetClose"):null;t&&(e.preventDefault(),e.stopPropagation(),Xe())}},!0),document.addEventListener("keydown",function(e){if(!(e.key!=="Escape"||C.hidden)){if(e.stopPropagation(),re&&!re.hidden){et();return}Xe()}},!0);function It(e){var t=document.getElementById("doriMenuBtn");if(!e&&!R.classList.contains("active")&&t){t.click(),setTimeout(function(){It(!0)},450);return}if(!C.hidden&&n&&n.adotado){he();return}G=!0,C.hidden&&Ee()}document.addEventListener("click",function(e){var t=e.target&&e.target.closest?e.target.closest('[data-dpet-revisar], a[href$="#bit-revisar"]'):null;if(t){if(e.preventDefault(),t.hasAttribute("data-dpet-revisar")){if(!C.hidden&&n&&n.adotado){he();return}G=!0,C.hidden&&Ee();return}if(!oe){window.location.href="/bit";return}It()}});
1function T(e,t){mt||(mt=!0,D(e,function(a){if(mt=!1,!a.ok){c(l.triste),a.sem_saldo?So():w(a.erro||"Ops, não deu."),p(f,"dpet-anim-atchim",500),D({acao:"estado"},function(o){o.ok&&o.adotado&&(n=o,P())});return}n=a,P(),t&&t(a)}))}Oe.addEventListener("click",function(e){var t=e.target.closest("button");if(!(!t||t.disabled)){var a=t.getAttribute("data-acao");if(a==="alimentar"){if(n&&n.pet&&n.pet.fome>=100){v(n.pet.nome+" ainda tá cheinho!",b);return}var o=t.getAttribute("data-item")||"bateriazinha";T({acao:"alimentar",item:o},function(r){c(l.come),p(f,"dpet-anim-come",1300),H(function(){y("❤"),v(o==="pilha"?"BZZZT! ⚡":"nham nham",b),o==="pilha"?(J(),c(l.fanfarra),p(f,"dpet-anim-amor",2e3),y("🧡"),setTimeout(function(){y("🧡")},500),setTimeout(function(){y("🧡")},1e3)):p(f,"dpet-anim-pula",700)},1300)})}else a==="brincar"?(c(l.clique),Pa()):a==="revisao"?(c(l.clique),he()):a==="loja"&&(c(l.clique),B("loja"),z(),!ia&&n&&n.loja&&n.loja.desconto>0&&(ia=!0,v("tem oferta hoje! 🏷️",b)))}});function Ca(){return n&&n.cofre||null}function Po(){B("cofre"),At()}function At(){var e=Ca();if(!(!e||!We)){var t=document.getElementById("dpetCofreVazio"),a=document.getElementById("dpetCofreCheio"),o=document.getElementById("dpetCofreSaldo");if(o&&(o.textContent="🔩 "+e.livre+" livres"),t&&(t.hidden=e.tem),a&&(a.hidden=!e.tem),!e.tem){var r=document.getElementById("dpetCofreTaxa"),u=document.getElementById("dpetCofreMin");if(r&&(r.textContent=e.taxa+"%"),u&&(u.textContent=String(e.dias_min)),e.aberto)Oo(e);else{var d=document.getElementById("dpetCofreValores");if(d){d.textContent="";var s=document.createElement("p");s.className="dpet-cofre-regra",s.textContent="🔒 O cofrinho abre na "+(e.trava||"fase "+e.fase_min)+" — estude um pouco e ele te espera aqui.",d.appendChild(s)}}return}var m=document.getElementById("dpetCofreTotal"),g=document.getElementById("dpetCofreDetalhe"),i=document.getElementById("dpetCofreDias"),E=document.getElementById("dpetCofreBarra"),h=document.getElementById("dpetCofreResgatar"),I=document.getElementById("dpetCofreAviso");if(m&&(m.textContent=String(e.total)),g&&(g.textContent=e.valor+"🔩 guardados + "+e.juros+"🔩 de rendimento"+(e.no_teto?" (no teto)":"")),E){var k=Math.min(100,Math.round(e.dias/e.dias_min*100));E.firstElementChild.style.width=k+"%",E.setAttribute("aria-label",e.dias+" de "+e.dias_min+" dias de visita")}i&&(e.pode_resgatar?i.textContent="✅ "+e.dias+" dias de visita — pode abrir com o rendimento!":e.dias===0?i.textContent="🔒 0/"+e.dias_min+" · o rendimento começa na sua próxima visita":i.textContent="🔒 "+e.dias+"/"+e.dias_min+" dias de visita · faltam "+e.falta_dias),h&&(h.textContent=e.pode_resgatar?"Abrir e pegar "+e.total+"🔩":"Quebrar o cofrinho"),I&&(I.textContent=e.pode_resgatar?"Ou deixe render mais — o teto é +"+e.teto_pct+"% do que você guardou.":"Quebrar agora devolve seus "+e.valor+"🔩, mas você perde os "+e.juros+"🔩 de rendimento.")}}function Oo(e){var t=document.getElementById("dpetCofreValores");if(t){t.textContent="";var a=(e.sugestoes||[]).slice();if(e.livre>=e.minimo&&a.indexOf(e.livre)===-1&&a.push(e.livre),!a.length){var o=document.createElement("p");o.className="dpet-cofre-regra",o.textContent="Junte "+e.minimo+"🔩 estudando e volte aqui — é daí que o cofrinho começa.",t.appendChild(o);return}a.forEach(function(r,u){var d=document.createElement("button");d.type="button",d.setAttribute("data-valor",String(r)),d.textContent=(u===a.length-1&&r===e.livre?"tudo: ":"")+r+"🔩",t.appendChild(d)})}}if(We){var Ba=document.getElementById("dpetCofreValores");Ba&&Ba.addEventListener("click",function(e){var t=e.target.closest("button[data-valor]");if(t){var a=parseInt(t.getAttribute("data-valor"),10)||0;T({acao:"cofre_guardar",valor:a},function(o){n=o,c(l.moeda),y("🐖"),p(f,"dpet-anim-pula",700),v("guardei "+a+"🔩 no cofrinho! 🐖",b),P(),z(),At()})}});var xa=document.getElementById("dpetCofreResgatar");xa&&xa.addEventListener("click",function(){var e=Ca(),t=e&&!e.pode_resgatar;t&&!window.confirm("Faltam "+e.falta_dias+" dias de visita. Abrir agora devolve seus "+e.valor+"🔩, mas você perde "+e.juros+"🔩 de rendimento. Abrir mesmo assim?")||T({acao:"cofre_resgatar"},function(a){n=a,a.juros>0?(Ma(a.juros>=20),w("Você guardou "+a.valor+"🔩 e tirou "+(a.valor+a.juros)+"🔩 — os "+a.juros+"🔩 a mais vieram de esperar. Isso são juros. 🐖")):(c(l.triste),w("Cofrinho aberto: seus "+a.valor+"🔩 voltaram. O rendimento ficou pra próxima — ele só é seu depois de "+(e?e.dias_min:7)+" dias de visita.")),P(),z(),At()})});var Ia=document.getElementById("dpetCofreVoltar");Ia&&Ia.addEventListener("click",function(){B("loja"),z()})}function No(){B("predio"),Aa()}function Aa(){var e=n&&n.predio||null;if(!(!e||!Ge)){var t=document.getElementById("dpetPredioVazio"),a=document.getElementById("dpetPredioCheio"),o=document.getElementById("dpetPredioSaldo");if(o&&(o.textContent="🔩 "+e.livre+" livres"),t&&(t.hidden=e.tem),a&&(a.hidden=!e.tem),!e.tem){var r=document.getElementById("dpetPredioPayback");r&&(r.textContent="1 cota custa "+e.preco+"🔩 e paga "+e.aluguel_cota+"🔩 por dia estudado — ela se paga em ~"+e.payback+" dias de estudo. Depois disso, é lucro pra sempre.");var u=document.getElementById("dpetPredioComprar"),d=document.getElementById("dpetPredioTrava");u&&(u.disabled=!e.pode_comprar,u.textContent=e.aberto?"Comprar 1 cota · "+e.preco+"🔩":"Ainda não 🔒"),d&&(e.aberto?e.pode_comprar?d.hidden=!0:(d.hidden=!1,d.textContent="Faltam "+(e.preco-e.livre)+"🔩 pra primeira cota. Estudar é o caminho. 📖"):(d.hidden=!1,d.textContent=e.trava==="feche um 🐖"?"🔒 Antes do prédio, feche um 🐖 Cofrinho até o fim — quem investe começa poupando.":"🔒 O prédio abre na "+e.trava+" (é onde o Bit vira Bit de verdade)."));return}var s=document.getElementById("dpetPredioDesenho"),m=document.getElementById("dpetPredioCotas"),g=document.getElementById("dpetPredioLinha"),i=document.getElementById("dpetPredioExtrato"),E=document.getElementById("dpetPredioVago"),h=document.getElementById("dpetPredioComprarMais");if(s&&(s.textContent=new Array(e.cotas+1).join("🏢")),m&&(m.textContent=String(e.cotas)),g&&(g.textContent="pagam até "+e.aluguel_cheio+"🔩 por dia que você estudar"+(e.lotado?" · prédio completo 🏆":"")),i&&(i.textContent=e.rendeu_total>0?"💰 Já te pagou "+e.rendeu_total+"🔩 de aluguel. Nos últimos 30 dias foram "+e.rendeu_mes+"🔩 em "+e.dias_pagos_mes+" dias — "+e.fatia_mes+"% de tudo que você ganhou no período.":"💰 Ainda não recebeu aluguel: ele fecha no dia seguinte ao que você estuda."),E){var I=e.vago_dias;E.hidden=!(I!==null&&I>=2),E.hidden||(E.textContent="🏚️ Vago há "+I+" dias — sem estudo o prédio não paga. Uma aula hoje já traz o inquilino de volta.")}h&&(h.hidden=e.lotado,h.disabled=!e.pode_comprar,h.textContent=e.pode_comprar?"Comprar mais 1 cota · "+e.preco+"🔩":"Faltam "+Math.max(0,e.preco-e.livre)+"🔩 pra próxima cota")}}function Ro(){T({acao:"predio_cota"},function(e){n=e,c(l.moeda),y("🏢"),p(f,"dpet-anim-pula",700),v("mais um andar! 🏢 cota "+e.cotas,b),z(),w("Cota "+e.cotas+" comprada! Ela paga aluguel em todo dia que você estudar — e se paga em ~"+(n.predio?n.predio.payback:34)+" dias de estudo."),P(),Aa()})}if(Ge){["dpetPredioComprar","dpetPredioComprarMais"].forEach(function(e){var t=document.getElementById(e);t&&t.addEventListener("click",Ro)});var qa=document.getElementById("dpetPredioVoltar");qa&&qa.addEventListener("click",function(){B("loja"),z()})}te&&(te.addEventListener("click",function(e){var t=e.target.closest("button");if(!(!t||t.disabled)){var a=t.closest("li");if(a&&a.getAttribute("data-cofre")){c(l.clique),Po();return}if(a&&a.getAttribute("data-predio")){c(l.clique),No();return}var o=a?a.getAttribute("data-item"):"";if(o){var r=t.getAttribute("data-modo");if(r!=="guardado"){if(r==="congelar"){T({acao:"congelador"},function(){c(l.clique),y("🧊"),p(f,"dpet-anim-pula",700),v("guardei o gelo! 🧊 seu 🔥 tá protegido por 1 dia",b),z()});return}r==="usar"?T({acao:"usar",item:o},function(){c(l.clique),z(),v("pronto! ✨",b)}):r==="tirar"?T({acao:"usar",item:"",slot:a.getAttribute("data-slot")||""},function(){c(l.clique),z(),v("guardei! 🧺",b)}):T({acao:"cosmetico",item:o},function(){c(l.fanfarra),J(),y(a.getAttribute("data-emoji")||"🎁"),p(f,"dpet-anim-pula",700),setTimeout(function(){p(f,"dpet-anim-serelepe",550)},750),v(o==="chapeu"?"Formei! 🎓":"olha meu look!",b),z()})}}}}),fo.addEventListener("click",function(){B("main"),P()}));var La=document.getElementById("dpetCoresLoja");La&&La.addEventListener("click",function(e){var t=e.target.closest("button[data-cor]");if(t){var a=t.getAttribute("data-cor")||"rosa";
1n&&n.pet&&n.pet.cor===a||(vt(a),T({acao:"cor",cor:a},function(){c(l.carinho),y("🎨"),v("cantinho novo! 🎨",b)}))}}),me&&me.addEventListener("click",function(e){var t=e.target.closest("button");t&&(c(l.clique),ht(t.getAttribute("data-aba")))}),ze&&ze.addEventListener("click",function(e){var t=e.target.closest("button");if(!(!t||t.disabled)){var a=t.closest("li"),o=a?a.getAttribute("data-tipo"):"";o&&T({acao:"quintal_plantar",tipo:o,slot:Yt},function(){c(l.clique),B("main"),P(),y("🌱"),v("plantei! agora é estudar 🌱",b),p(f,"dpet-anim-serelepe",550)})}}),xe&&xe.addEventListener("click",function(e){var t=e.target.closest("button");if(!(!t||t.disabled)){var a=t.closest("li"),o=a?a.getAttribute("data-item"):"";o&&T({acao:"quintal_enfeite",item:o},function(){c(l.fanfarra),J(),y("🏡"),p(f,"dpet-anim-pula",700),v("olha meu quintal! 🏡",b)})}});var Ye=document.getElementById("dpetJogosGrid"),Sa=document.getElementById("dpetJogosInfo"),_a=document.getElementById("dpetJogosVoltar"),wa=document.getElementById("dpetJogoTitulo"),qt=document.getElementById("dpetJogoPlacar"),Fo=document.getElementById("dpetJogoArea"),Lt=document.getElementById("dpetJogoMsg"),Ta=document.getElementById("dpetJogoVoltar"),ka={treino:{nome:"🧮 Atividade do dia",fase:1,dica:"a de hoje"},ppt:{nome:"✊✋✌️ Bit, papel, tesoura",fase:1,dica:"melhor de 5"},memoria:{nome:"🃏 Memória",fase:11,dica:"ache os 6 pares"},cobrinha:{nome:"🐍 Cobrinha",fase:31,dica:"coma os parafusos"},nave:{nome:"🚀 Navinha",fase:51,dica:"desvie das nuvens"}};function jo(){if(n&&n.progresso&&n.progresso.fase)return n.progresso.fase;var e=n&&n.pet&&n.pet.nivel||2;return e===3?31:e===2?11:1}function Ma(e){J(),c(e?l.fanfarra:l.carinho),p(f,"dpet-anim-pula",700),setTimeout(function(){p(f,"dpet-anim-serelepe",550)},750),e&&setTimeout(function(){p(f,"dpet-anim-aceno",950)},1350),v(e?["UHUU! 🎉","que jogo!","bip bip bip! 🎉"][Math.floor(Math.random()*3)]:["boa! 👏","de novo!","hihi 🎾"][Math.floor(Math.random()*3)],b)}function Pa(){B("jogos"),Oa()}function Oa(){if(!(!Ye||!n||!n.pet)){var e=n.pet.brincadeiras_restantes||0,t=jo();
1Sa&&(Sa.textContent=e>0?e+(e===1?" brincadeira hoje":" brincadeiras hoje"):"amanhã tem mais!"),Array.prototype.forEach.call(Ye.querySelectorAll("button[data-jogo]"),function(a){var o=ka[a.getAttribute("data-jogo")];if(o){var r=t<o.fase,u=a.querySelector("em");a.disabled=r||e<=0,u&&(u.textContent=r?"fase "+o.fase+" 🔒":o.dica),r?a.title="Estudar destrava: esse jogo abre na fase "+o.fase:a.removeAttribute("title")}})}}var $e=!1;function zo(e){if(window.dpetJogos){e();return}if(!$e){$e=!0;var t=document.createElement("script");t.src=Se.getAttribute("data-src"),t.onload=function(){$e=!1,e()},t.onerror=function(){$e=!1,w("Não deu pra carregar os jogos. Tenta de novo?")},document.head.appendChild(t)}}Ye&&Ye.addEventListener("click",function(e){var t=e.target.closest("button[data-jogo]");if(!(!t||t.disabled)){var a=t.getAttribute("data-jogo"),o=ka[a];o&&(c(l.clique),zo(function(){if(!window.dpetJogos||!window.dpetJogos.tem(a)){w("Esse jogo chega em breve! 🔜");return}T({acao:"brincar"},function(r){B("jogo"),wa&&(wa.textContent=o.nome),qt&&(qt.textContent=""),Lt&&(Lt.textContent="");var u=r&&r.recarga_fome||0;u>0&&(y("⚡"),v("⚡ +"+u+" de bateria!",b)),window.dpetJogos.inicia(a,{area:Fo,placar:qt,msg:Lt,toca:c,SOM:l,particula:y,torcida:Ma,animaBit:function(d,s){p(f,d,s)},falaBit:function(d){v(d,b)},nomeBit:n&&n.pet&&n.pet.nome||"Bit",reduzMovimento:Ae})})}))}}),_a&&_a.addEventListener("click",function(){B("main"),P()}),Ta&&Ta.addEventListener("click",function(){window.dpetJogos&&window.dpetJogos.para(),Pa()});var Te=[],St=!1;function Na(){if(C.classList.contains("dpet-modo-ovo")){Qo();return}if(!(!n||!n.adotado)){if(n.pet&&n.pet.estado==="soneca"){if(c(l.falha),p(f,"dpet-anim-fraco",500),y("🪫"),!St){St=!0;var e=(n.pet.trancado||0)>0?n.pet.livre:n.pet.moedas;v(e<10?"Brinca comigo pra eu ganhar um pouquinho de energia? ⚡":"Sem bateria… me dá uma bateriazinha? 🪫",b);var t=Oe.querySelector('button[data-item="bateriazinha"]');t&&p(t,"dpet-btn-chama",3700)}return}var a=Date.now();if(Te=Te.filter(function(r){return a-r<3e3}),Te.push(a),Te.length>=5){Te=[],c(l.fanfarra),J(),p(f,"dpet-anim-amor",2e3),y("🧡"),H(function(){y("🧡")},400),H(function(){y("🧡")},800),v("COMBO! ❤❤❤",b);return}var o=Math.random();y("❤"),o<.05?(c(l.foguete),p(f,"dpet-anim-foguete",1700),setTimeout(function(){v("oops",b)},1500)):o<.3?(c(l.carinho),p(f,"dpet-anim-aceno",950),v("bip!",b)):o<.6?(c(l.pula),p(f,"dpet-anim-pula",700)):(c(l.carinho),p(f,"dpet-anim-serelepe",550),v(["hihi","❤","bip bip!"][Math.floor(Math.random()*3)],b))}}A.addEventListener("click",function(){if(De){De=!1;return}Na()}),A.addEventListener("keydown",function(e){e.target===A&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),Na())}),ft.forEach(function(e){e.addEventListener("click",function(t){t.stopPropagation();var a=n&&n.quintal||null;if(!(!a||!a.ativo)){var o=parseInt(e.getAttribute("data-slot"),10)||1,r=null;(a.slots||[]).forEach(function(s){s.slot===o&&(r=s)});var u=r&&r.planta;if(!u){if(c(l.clique),Yt=o,(a.sementes||[]).length>1){B("loja"),ht("sementes"),z();return}T({acao:"quintal_plantar",slot:o},function(){y("🌱"),v("plantei! agora é estudar 🌱",b),p(f,"dpet-anim-serelepe",550)});return}if(!u.pronta){c(l.clique);var d=u.precisa-u.regas;v(d===1?"falta 1 aula pra colher 🌱":"faltam "+d+" aulas pra colher 🌱",b);return}T({acao:"quintal_colher",slot:o},function(s){c(l.fanfarra),J(),y("+"+s.ganho+" 🔩"),p(f,"dpet-anim-pula",700),setTimeout(function(){p(f,"dpet-anim-amor",2e3)},750),w("+"+s.ganho+" 🔩 — colheita do quintal! 🌻"),v("colhemos! 🌻",b)})}})}),(function e(){setTimeout(function(){if(e(),!(Ae||C.hidden)&&!(!n||!n.quintal||!n.quintal.ativo)&&!((n.quintal.cenario||[]).indexOf("banquinho")<0)&&!(n.pet&&["soneca","saudade","muita_fome"].indexOf(n.pet.estado)>=0)&&!/dpet-anim-/.test(f.className)){var t=ae&&ae.querySelector(".dq-banquinho");if(t){var a=t.getBoundingClientRect(),o=f.getBoundingClientRect();if(!(!a.width||!o.width)){var r=Math.round(a.left+a.width/2-(o.left+o.width/2));f.style.setProperty("--dq-banco-dx",r+"px"),p(f,"dpet-anim-senta",9e3),setTimeout(function(){v("só um minutinho... 😌",b)},1400)}}}},45e3+Math.random()*3e4)})();var _t=f.querySelectorAll(".dpet-olhos-abertos");_t.length&&!Ae&&window.matchMedia&&window.matchMedia("(pointer: fine)").matches&&(A.addEventListener("mousemove",function(e){var t=A.getBoundingClientRect(),a=Math.max(-1,Math.min(1,(e.clientX-(t.left+t.width/2))/(t.width/2))),o=Math.max(-1,Math.min(1,(e.clientY-(t.top+t.height/2))/(t.height/2))),r="translate("+(a*.9).toFixed(2)+"px,"+(o*.6).toFixed(2)+"px)";Array.prototype.forEach.call(_t,function(u){u.style.transform=r})}),A.addEventListener("mouseleave",function(){Array.prototype.forEach.call(_t,function(e){e.style.transform=""})}));var Ra=document.getElementById("dpetFoto");function Vo(){var e=f.querySelector("svg.dpet-sprite");if(!e)return null;var t=null;ra.forEach(function(g){f.classList.contains("dpet-e-"+g)&&(t=g)}),t&&t!=="feliz"&&(f.classList.remove("dpet-e-"+t),f.classList.add("dpet-e-feliz"));for(var a=e.cloneNode(!0),o=e.querySelectorAll("*"),r=a.querySelectorAll("*"),u=[],d=0;d<o.length;d++){var s=getComputedStyle(o[d]);if(s.display==="none"){u.push(r[d]);continue}var m="display:"+s.display+";fill:"+s.fill+";";s.opacity&&s.opacity!=="1"&&(m+="opacity:"+s.opacity+";"),r[d].setAttribute("style",m)}return u.forEach(function(g){g.parentNode&&g.parentNode.removeChild(g)}),t&&t!=="feliz"&&(f.classList.remove("dpet-e-feliz"),f.classList.add("dpet-e-"+t)),a.setAttribute("width","16"),a.setAttribute("height","16"),new XMLSerializer().serializeToString(a)}function Do(e,t,a){e.fillStyle="rgba(255,255,255,.16)";for(var o=0;o<a;o+=28)for(var r=0;r<t;r+=28)e.beginPath(),e.arc(r,o,3,0,7),e.fill();for(e.fillStyle="rgba(255,255,255,.10)",o=14;o<a;o+=28)for(r=14;r<t;r+=28)e.beginPath(),e.arc(r,o,3,0,7),e.fill()}function wt(e,t,a,o,r,u,d,s,m,g,i,E){e.font=u+" "+r+"px "+d;var h=e.measureText(o).width+g*2,I=r+i*2;return e.fillStyle=s,e.beginPath(),e.roundRect(t-h/2,a,h,I,E),e.fill(),e.strokeStyle="#14181f",e.lineWidth=6,e.stroke(),e.fillStyle=m,e.textAlign="center",e.textBaseline="middle",e.fillText(o,t,a+I/2+2),I}function Jo(){if(!(!n||!n.pet)){var e=Vo();if(e){var t=n.pet,a=n.progresso||{},o=n.estudo||{},r=[["🔥 "+(n.streak||0),(n.streak||0)===1?"dia seguido":"dias seguidos"],["📖 "+(o.aulas||0),(o.aulas||0)===1?"aula concluída":"aulas concluídas"],["🎓 "+(o.cursos||0),(o.cursos||0)===1?"curso terminado":"cursos terminados"]],u=function(){var s=1080,m=1350,g=document.createElement("canvas");g.width=s,g.height=m;var i=g.getContext("2d"),E='"Lexend Deca", system-ui, sans-serif';i.fillStyle="#4d9a45",i.fillRect(0,0,s,m),Do(i,s,m),i.strokeStyle="#14181f",i.lineWidth=24,i.beginPath(),i.roundRect(12,12,s-24,m-24,44),i.stroke(),wt(i,s/2,70,"MEU BIT",34,"800",E,"#f6f3e9","#14181f",30,16,22),i.imageSmoothingEnabled=!1,i.drawImage(d,(s-480)/2,170,480,480),i.imageSmoothingEnabled=!0,i.font="800 104px "+E,i.textAlign="center",i.textBaseline="alphabetic",i.fillStyle="#f6f3e9",i.fillText(t.nome,s/2+6,762),i.fillStyle="#14181f",i.fillText(t.nome,s/2,756),a.fase&&wt(i,s/2,790,"Fase "+a.fase+" · "+(a.era||""),38,"700",E,"#fbbf24","#14181f",28,16,20);var h=300,I=170,k=24,O=(s-h*3-k*2)/2,se=920;r.forEach(function(L,S){var x=O+S*(h+k);i.fillStyle="#f6f3e9",i.beginPath(),i.roundRect(x,se,h,I,26),i.fill(),i.strokeStyle="#14181f",i.lineWidth=6,i.stroke(),i.fillStyle="#14181f",i.textAlign="center",i.textBaseline="middle",i.font="800 56px "+E,i.fillText(L[0],x+h/2,se+66),i.font="500 26px "+E,i.fillStyle="#3f3f46",i.fillText(L[1],x+h/2,se+126)}),i.font="500 30px "+E,i.fillStyle="#14181f",i.textBaseline="middle",i.textAlign="center",i.fillText("criado estudando no Ensino Social",s/2,1160),wt(i,s/2,1210,"ensinosocial.com.br/bit",34,"700",E,"#14181f","#f6f3e9",34,18,18),g.toBlob(function(L){L&&Uo(L)},"image/png")},d=new Image;d.onload=function(){var s=['800 104px "Lexend Deca"','800 56px "Lexend Deca"','700 38px "Lexend Deca"'];Promise.all(s.map(function(m){return document.fonts.load(m)})).then(u,u)},d.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e)}}}var re=document.getElementById("dpetCartao"),Fa=document.getElementById("dpetCartaoImg"),Tt=document.getElementById("dpetCartaoCopiar"),ja=document.getElementById("dpetCartaoBaixar"),kt=document.getElementById("dpetCartaoShare"),Mt=document.getElementById("dpetCartaoDica"),Ke=document.getElementById("dpetCartaoFechar"),ye=null,K=null;function za(){if(!ye)return null;try{return new File([ye],"meu-bit.png",{type:"image/png"})}catch(e){return null}}function Uo(e){if(re){ye=e,K&&URL.revokeObjectURL(K),K=URL.createObjectURL(e),Fa.src=K,ja.href=K;var t=za();kt.hidden=!(t&&navigator.canShare&&navigator.canShare({files:[t]})),Tt.hidden=!(navigator.clipboard&&navigator.clipboard.write&&window.ClipboardItem),Mt.textContent="",re.hidden=!1,Ke&&Ke.focu
1s()}}function et(){!re||re.hidden||(re.hidden=!0,Fa.removeAttribute("src"),ja.removeAttribute("href"),K&&(URL.revokeObjectURL(K),K=null),ye=null)}Ke&&Ke.addEventListener("click",et),Tt&&Tt.addEventListener("click",function(){ye&&navigator.clipboard.write([new ClipboardItem({"image/png":ye})]).then(function(){Mt.textContent="Copiado! Agora é só colar na conversa 📋"},function(){Mt.textContent="Não deu pra copiar aqui — use o Baixar 😉"})}),kt&&kt.addEventListener("click",function(){var e=za();e&&navigator.share({files:[e],title:"Meu Bit"}).catch(function(){})}),Ra&&Ra.addEventListener("click",function(){if(!(!n||!n.pet)){c(l.clique),p(f,"dpet-anim-pula",700),v("diz xis! 📸",b);try{Jo(),D({acao:"cartao_gerado"},function(){})}catch(e){w("Não deu pra montar o cartão agora.")}}}),document.addEventListener("aula:concluida",function(e){var t=e.detail&&parseInt(e.detail.pet_ganhou,10)||0;if(!(t<=0)){n&&n.pet&&(n.pet.moedas+=t),M=M>0?M+t:M;var a=_.getAttribute("data-pet-nome")||"";if(!a&&F){q=Math.min(q+1,W),Qa(!0),ot(),Ha(),e.detail&&e.detail.primeira_conclusao||Ya(t);return}ue.hidden=!1,p(_,"dpet-festa",900),v("+"+t+"🔩 "+(a?"pro "+a+"! 🎉":"pro Bit! 🎉"),X)}}),document.addEventListener("visibilitychange",function(){document.visibilityState==="visible"&&(!n||!n.adotado||C.hidden||(p(f,"dpet-anim-aceno",950),v("oi de novo! 👋",b)))});var Pt="rosa",Va=document.getElementById("dpetCoresAdotar");Va&&Va.addEventListener("click",function(e){var t=e.target.closest("button[data-cor]");t&&(c(l.clique),Pt=t.getAttribute("data-cor")||"rosa",vt(Pt))}),co.addEventListener("click",function(){var e=(lo.value||"Bit").trim().slice(0,30);T({acao:"adotar",nome:e||"Bit",cor:Pt},function(t){M=0,$o(t.pet.nome),_.setAttribute("title","Pet virtual"),Ie&&(Ie.hidden=!0),B("main"),c(l.fanfarra),p(f,"dpet-anim-pula",700),v("bip! eu sou "+t.pet.nome+"!",b),Bt(t)})});var q=parseInt(_.getAttribute("data-ovo")||"",10),W=parseInt(_.getAttribute("data-ovo-meta")||"5",10)||5,F=oe&&!isNaN(q)&&q>=1,Ot={};try{Ot=JSON.parse(_.getAttribute("data-ovo-falas")||"{}")||{}}catch(e){Ot={}}var tt="dpet-ovo:"+(_.getAttribute("data-ovo-chave")||"x"),Da=document.getElementById("dpetOvoTitulo"),Ja=document.getElementById("dpetOvoSub"),Nt=document.getElementById("dpetOvoToques"),Rt=document.getElementById("dpetOvoFita"),ke=document.getElementById("dpetOvoContinuar"),Me=document.getElementById("dpetOvoTopo"),Ce=0,at=!1,Q=null,ie=null,Wo=1800*1e3;function Pe(e){return Ot[String(Math.max(1,Math.min(e,W)))]||null}function Z(){return F&&q>=W}function Ua(e){return Math.max(0,Math.min(e,W)-1)}function Go(){return Array.prototype.slice.call(document.querySelectorAll(".dpet-ovo[data-dpet-ovo]"))}function Wa(e){try{return localStorage.getItem(e)}catch(t){return null}}function Ga(e,t){try{localStorage.setItem(e,String(t))}catch(a){}}function Ha(){Ga(tt+":visto",Math.min(q,W))}function Qa(e){if(F){var t=Ua(q);Go().forEach(function(o){for(var r=0;r<W;r++)o.classList.remove("dpet-ovo-e"+r);o.classList.add("dpet-ovo-e"+t),Array.prototype.forEach.call(o.querySelectorAll(".dpet-ovo-pips i"),function(u,d){u.classList.toggle("on",d<Math.min(q,W))}),e&&(o.classList.remove("dpet-ovo-balanca"),o.offsetWidth,o.classList.add("dpet-ovo-balanca"),setTimeout(function(){o.classList.remove("dpet-ovo-balanca")},950))});var a=Pe(q);a&&[document.getElementById("doriMenuBtn"),Me,_].forEach(function(o){o&&(o.setAttribute("aria-label",a.rotulo),o.hasAttribute("title")&&o.setAttribute("title",a.dica),o.hasAttribute("data-dica")&&o.setAttribute("data-dica",a.dica))}),ue.hidden=!Z(),Ft()}}function ot(){if(Z()){var e=document.getElementById("dpetAdotarTitulo"),t=document.getElementById("dpetAdotarSub");e&&(e.textContent="Ele nasceu! 🎉 Como vai se chamar?"),t&&(t.textContent="Você chocou o ovo estudando. Agora é cuidar: cada aula concluída vale Parafusos 🔩.");var a=document.getElementById("dpetBtnAdotar");a&&(a.textContent="Dar as boas-vindas!")}}function Ft(){if(it){var e=Pe(q);e&&Da&&(Da.textContent=e.titulo),e&&Ja&&(Ja.textContent=e.sub);var t=Z();Nt&&(Nt.hidden=!t,Array.prototype.forEach.call(Nt.children,function(a,o){a.classList.toggle("on",o<Ce)})),Rt&&(Rt.hidden=t,Array.prototype.forEach.call(Rt.children,function(a){var o=parseInt(a.getAttribute("data-n"),10);a.classList.toggle("feito",o<q),a.classList.toggle("aqui",o===Math.min(q,W));var r=a.querySelector(".dpet-ovo-passo-rot");r&&(r.textContent=o===Math.min(q,W)?"você":o+(o===1?" aula":" aulas"))})),ke&&(ke.hidden=t)}}function Za(){if(at){ot(),B("adotar"),Dt();return}B("ovo"),C.classList.add("dpet-modo-ovo"),j&&(j.hidden=!1),A&&A.setAttribute("aria-label",Z()?"Tocar no ovo pra ajudar o Bit a sair":"Tocar no ovo"),Ft()}function Ho(e){!ke||!e||!e.url||(ke.setAttribute("href",e.url),ke.setAttribute("title",e.titulo||""))}function Qo(){if(!(!j||at)){if(!Z()){c(l.clique),p(j,"dpet-ovo-cambaleia",650);var e=Pe(q);e&&v(e.balao,b);return}if(Ce++,Ft(),Ce<3){c(Ce===1?l.pula:l.atchim),p(j,"dpet-ovo-cambaleia",650),Ce===2&&j.classList.add("dpet-ovo-trincado"),v(Ce===1?"tuc!":"tuc tuc!",b);return}Zo()}}function Zo(){at=!0,c(l.fanfarra),j.classList.add("dpet-ovo-estoura"),J(),H(function(){j.classList.remove("dpet-ovo-estoura","dpet-ovo-trincado"),["dpet-nv-2","dpet-nv-3"].forEach(function(e){f.classList.remove(e)}),f.classList.add("dpet-nv-1","dpet-e-feliz"),ot(),B("adotar"),Dt(),p(f,"dpet-anim-pula",700),v("bip! 👋",b)},700)}var jt=!1;document.addEventListener("click",function(e){if(F){var t=e.target&&e.target.closest?e.target.closest("#doriMenuBtn"):null;if(!(!t||R.classList.contains("active"))&&!(!e.isTrusted&&!jt)){Vt();var a=0;(function o(){if(R.classList.contains("active")){C.hidden&&Ee();return}++a<10&&setTimeout(o,60)})()}}},!0);function zt(){if(Vt(),R.classList.contains("active")){C.hidden?Ee():Z
1a();return}var e=document.getElementById("doriMenuBtn");if(e){jt=!0;try{e.click()}finally{jt=!1}}}Me&&Me.addEventListener("click",function(){c(l.clique),zt()});function Xo(){for(var e=[Me,document.getElementById("doriMenuBtn")],t=0;t<e.length;t++){var a=e[t];if(!(!a||!a.isConnected)){var o=a.getBoundingClientRect();if(o.width>0&&o.height>0&&o.right>0&&o.left<window.innerWidth&&o.bottom>0&&o.top<window.innerHeight)return a}}return null}function de(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Vt(){de(Q),de(ie),Q=null,ie=null}function Xa(){var e=document.getElementById("bpOverlay");return R.classList.contains("active")||e&&!e.hidden}function Yo(){if(!(!F||Xa())&&!(Date.now()-(+Wa(tt+":balao")||0)<Wo)){var e=Xo(),t=Pe(q);if(!(!e||!t)){Ga(tt+":balao",Date.now()),de(Q);var a=document.createElement("button");a.type="button",a.className="dpet-ovo-balao",a.textContent=t.balao;var o=e.getBoundingClientRect();if(e===Me){var r=Math.max(8,Math.round(window.innerWidth-o.right-6));a.classList.add("dpet-ovo-balao--baixo"),a.style.top=Math.round(o.bottom+12)+"px",a.style.right=r+"px",a.style.setProperty("--rabo",Math.round(window.innerWidth-r-(o.left+o.width/2))+"px")}else o.left>window.innerWidth/2?(a.classList.add("dpet-ovo-balao--esq"),a.style.top=Math.round(o.top+o.height/2)+"px",a.style.right=Math.round(window.innerWidth-o.left+12)+"px"):(a.classList.add("dpet-ovo-balao--dir"),a.style.top=Math.round(o.top+o.height/2)+"px",a.style.left=Math.round(o.right+12)+"px");a.addEventListener("click",function(){c(l.clique),zt()}),document.body.appendChild(a),Q=a,setTimeout(function(){Q===a&&(a.classList.add("dpet-ovo-sai"),setTimeout(function(){Q===a&&(de(a),Q=null)},400))},6e3)}}}function Ya(e){var t=Pe(q);if(!(!F||!t)){de(Q),Q=null,de(ie);var a=document.createElement("div");a.className="dpet-ovo-aviso"+(Z()?" dpet-ovo-aviso--pronto":""),a.setAttribute("role","status");var o=document.createElement("button");o.type="button",o.className="dpet-ovo-aviso-btn";var r=document.createElement("span");r.className="dpet-ovo-aviso-tile";var u=document.querySelector(".dpet-ovo[data-dpet-ovo] .dpet-ovo-svg");if(u){var d=document.createElement("span");d.className="dpet-ovo dpet-ovo-balanca dpet-ovo-e"+Ua(q),d.appendChild(u.cloneNode(!0)),r.appendChild(d)}var s=document.createElement("span");s.className="dpet-ovo-aviso-tx";var m=document.createElement("b");m.textContent="Aula concluída!"+(e>0?" +"+e+" 🔩":"");var g=document.createElement("span");if(g.textContent=t.toast,Z()){var i=document.createElement("u");i.textContent="Ver agora",g.appendChild(document.createTextNode(" ")),g.appendChild(i)}s.appendChild(m),s.appendChild(g),o.appendChild(r),o.appendChild(s),o.addEventListener("click",function(){c(l.clique),zt()}),a.appendChild(o),document.body.appendChild(a),ie=a,setTimeout(function(){ie===a&&(a.classList.add("dpet-ovo-sai"),setTimeout(function(){ie===a&&(de(a),ie=null)},400))},6500)}}function $o(e){if(F){F=!1,at=!1,Vt();var t=document.getElementById("doriMenuBtn");t&&(t.removeAttribute("data-dica"),t.hasAttribute("title")&&t.removeAttribute("title"),t.setAttribute("aria-label","Abrir a Dóri e o "+(e||"Bit"))),_.setAttribute("aria-label","Pet virtual da Dóri: clique para cuidar dele")}}function $a(e,t){setTimeout(function(){if(document.visibilityState==="visible"){e();return}document.addEventListener("visibilitychange",function a(){document.visibilityState==="visible"&&(document.removeEventListener("visibilitychange",a),setTimeout(e,900))})},t)}if(F){ue.hidden=!Z();var Ka=Wa(tt+":visto"),eo=Ka===null?null:parseInt(Ka,10)||0;Ha(),eo!==null&&eo<Math.min(q,W)?$a(function(){Xa()||(Qa(!0),Ya(0))},1200):$a(Yo,2500)}else M>0&&(ue.hidden=!1,_.setAttribute("title","Você tem "+M+" Parafusos guardados. Adote o Bit!"),setTimeout(function(){v(M+"🔩 te esperando!",X)},2500));function Dt(){Ie&&(Ie.hidden=M<=0,M>0&&(Ie.textContent="🔩 Você já tem "+M+(M===1?" Parafuso guardado":" Parafusos guardados")+" de tanto estudar. Eles vão pro seu Bit assim que ele ganhar um nome."))}function to(){aa||!oe||(aa=!0,D({acao:"estado"},function(e){e.ok&&e.adotado?(n=e,P(),en(e.revisao_vencida)):e.ok&&!e.adotado&&(ue.hidden=F?!Z():!1)}))}var ao=!1,Ko=1440*60*1e3;function en(e){if(!(ao||!e||!e.pergunta||(location.pathname||"").indexOf("/biblia")===0)){try{if(Date.now()-(+localStorage.getItem("dpet-lembra-fechado")||0)<Ko)return}catch(g){}var t=document.getElementById("doriWidgetMessages");if(t){ao=!0;var a=document.createElement("div");a.className="dw-msg dw-msg-dori dpet-lembra";var o=document.createElement("button");
1o.type="button",o.className="dpet-lembra-x",o.title="Fechar (volta amanhã)",o.setAttribute("aria-label","Fechar o lembrete"),o.textContent="✕",o.addEventListener("click",function(g){g.stopPropagation();try{localStorage.setItem("dpet-lembra-fechado",String(Date.now()))}catch(i){}a.remove()}),a.appendChild(o);var r=document.createElement("div");r.className="dpet-lembra-cab",r.textContent="🧠 Lembra disso?"+(e.curso?" · "+e.curso:"");var u=document.createElement("div");u.className="dpet-lembra-perg",u.textContent=e.pergunta;var d=document.createElement("div");d.className="dpet-lembra-rod";var s=e.vencidas||1;d.appendChild(document.createTextNode((s===1?"1 revisão te esperando":s+" revisões te esperando")+" — o Bit guarda a resposta. "));var m=document.createElement("button");m.type="button",m.setAttribute("data-dpet-revisar","1"),m.className="dpet-lembra-btn",m.textContent="Revisar agora",d.appendChild(m),a.appendChild(r),a.appendChild(u),a.appendChild(d),t.appendChild(a);try{t.scrollTop=t.scrollHeight}catch(g){}}}}if(document.addEventListener("dori:gesto",function(e){var t=e.detail||{};t.gesto==="luz"&&(Je=t.param!=="dia",n&&n.quintal&&n.quintal.ativo&&A.classList.toggle("dq-noite",Je),t.param==="dormir"&&!C.hidden&&document.visibilityState==="visible"&&(Ae||p(f,"dpet-anim-soninho",1300),v("Zzz...",b)))}),new MutationObserver(function(){R.classList.contains("active")&&to()}).observe(R,{attributes:!0,attributeFilter:["class"]}),R.classList.contains("active")&&to(),oe&&window.location.hash==="#bit"&&setTimeout(function(){var e=document.getElementById("doriMenuBtn");e&&!R.classList.contains("active")&&e.click(),setTimeout(function(){C.hidden&&Ee()},450);try{history.replaceState(null,"",window.location.pathname+window.location.search)}catch(t){}},500),oe&&window.location.hash==="#bit-revisar"){try{history.replaceState(null,"",window.location.pathname+window.location.search)}catch(e){}setTimeout(function(){It(!1)},500)}})();

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.