");return[n,t.join("")]},resurrectText=(e,t)=>{for(var n=0;n",t[n]);return e},getStc=l=>{var r=500;if(l.split("").length<=r)return[l];{for(var[l,o]=encodePunc(l),a=o.split("<#*/>"),i=0;i");e=(e=e.replaceAll(";<#*/>","<#*/>")).replaceAll("<#*/>;","<#*/>");var d=[];let t=0,n="";for(var m=(e=(e=resurrectText(e,l)).replaceAll(" "," ")).split(""),i=0;i{if(t.split("").length<=500)return[t];{var n=(t=t.replaceAll("...","etc")).split(".").filter(e=>""!==e.trim()),l=[];let e="";for(var r=0;r""!==e.trim());0===p.length&&(p=[d]),diffArr=[],document.getElementById("diff").textContent="",document.getElementById("output").innerHTML="";var l=13*Math.ceil(d.split("").length/500);showPb(l);let t=startTimer(l,null);var r=document.getElementById("choosen").textContent;let n=!0;for(var m=0;me.text()).then(e=>{e=JSON.parse(e);let t=e[0],n=e[0];t=(t=(t=t.replace(/.*<\/ins>/g,"")).replace(//g,""),n=(n=(n=n.replace(/.*<\/del>/g,"")).replace(//g,"");var l=document.createElement("div");l.innerHTML=e[0],l.style.display="none",document.getElementById("output").append(l);let r=l.querySelectorAll("del");for(let e=r.length-1;0<=e;e--)r[e].remove();r=l.querySelectorAll("ins"),l.innerHTML=l.innerHTML.split(" ").map(e=>e=e.includes("")?''+e.replace(//g,"").replace(/<\/ins>/g,"").replace(//g,"").replace(/<\/span>/g,"")+"":e).filter(e=>""!==e.trim()).join(" ");let o=0;var a=p[m].split(" ");a.filter(e=>""!==e.trim()).length;for(let e=0;e""!==e.trim()).length,e=Math.ceil(100*e/i),s=(document.getElementById("diff").textContent=e,[]);for(let e=8;e<=14;e++)s.push(5*e);document.getElementById("struct").textContent=s[Math.floor(Math.random()*s.length)];var i=l.innerHTML,e=(l.remove(),document.getElementById("input").innerHTML),c=d.indexOf(p[m].trim());"\n"===e[c-1]&&"\n"!==e[c-2]?document.getElementById("output").innerHTML+="
"+i:"\n"===e[c-1]&&"\n"===e[c-2]?document.getElementById("output").innerHTML+="
"+i:document.getElementById("output").innerHTML+=" "+i}).catch(e=>{console.log(e),alert("Unexpected error! Please retry the current operation by clicking again on the button."),n=!1,clearInterval(t)})}hidePb(),clearInterval(t)}}}document.querySelector("#rephrase").addEventListener("click",async()=>{console.log("in"),await onRephrase()})