"use strict";(self.webpackChunkWebComponents=self.webpackChunkWebComponents||[]).push([[824],{8824:(e,t,i)=>{i.r(t),i.d(t,{ShowEval:()=>o});var s=i(78673),n=i(34089);class o extends s.A{constructor(e){super(e),this.divid=e.orig.id,this.containerDiv=e.orig,this.containerDiv.classList.add("showEval");let t=[];for(let i of e.raw)t.push(i.replace(/\\/g,""));this.steps=t.slice(),this.currentStep=0,this.createTrace=(0,n.Qt)(e.orig,"tracemode"),this.currentStepDiv=document.createElement("div"),this.currentStepDiv.classList.add("currentStepDiv"),this.containerDiv.appendChild(this.currentStepDiv);for(const e of["pre","eval","post"]){let t=document.createElement("span");t.classList.add(e),this.currentStepDiv.appendChild(t)}this.annoDiv=document.createElement("div"),this.annoDiv.classList.add("anno"),this.currentStepDiv.appendChild(this.annoDiv),this.evalSpan=this.currentStepDiv.querySelector(".eval"),this.setNextButton(`#${this.divid}_nextStep`),this.setResetButton(`#${this.divid}_reset`);for(var i=0;i{this.evaluateStep(t)}))}setResetButton(e){document.querySelector(e)?.addEventListener("click",(()=>{this.reset()}))}reset(){for(const e of this.containerDiv.querySelectorAll(".previousStep"))e.remove();this.setStep(0),this.logBookEvent({event:"showeval",act:"reset",div_id:this.containerDiv.id})}setStep(e){this.currentStep=e;let t=this.getWidth(this.steps[this.currentStep][1]);this.steps[e][4]?(this.annoDiv.innerHTML=this.steps[e][4],this.annoDiv.style.display=""):this.annoDiv.style.display="none",this.evalSpan.style.width=t+"px",this.currentStepDiv.querySelector(".pre").innerHTML=this.steps[e][0],this.evalSpan.innerHTML=this.steps[e][1],this.currentStepDiv.querySelector(".post").innerHTML=this.steps[e][3]}getWidth(e){var t=document.createElement("div");t.classList.add("showEval","evalCont"),t.style.display="none",t.innerHTML=e,document.body.appendChild(t);var i=t.offsetWidth+1;return t.remove(),i}createPreviousStepDiv(e){let t=document.createElement("div");t.classList.add("previousStep"),t.innerHTML=this.steps[e][0]+this.steps[e][1]+this.steps[e][3],this.currentStepDiv.before(t)}evaluateStep(e,t){if(this.annoDiv.style.display="none",e&&(e.disabled=!0),void 0===t&&(t=this.currentStep),this.currentStep>=this.steps.length)return void(e&&(e.disabled=!1));var i=0;this.createTrace&&(this.createPreviousStepDiv(t),this.currentStepDiv.style.display="none",i=200);let s=this.getWidth(this.steps[t][2]);var n=this.evalSpan,o=this;n.style.color="red",this.fadeToOpacity(this.currentStepDiv,1,i,(function(){window.setTimeout((function(){o.fadeToOpacity(n,0,400,(function(){o.animateWidth(n,s,400,(function(){n.innerHTML=o.steps[t][2],o.fadeToOpacity(n,1,400,(function(){window.setTimeout((function(){n.style.color="#333",o.currentStep+=1,o.currentStep