=x&&(x=v+1);!(y=b[x])&&++x=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=ET);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==t?LT:"function"===typeof t?DT:IT)(e,t,null==n?"":n)):FT(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?UT:"function"===typeof t?qT:BT)(e,t)):this.node()[e]},classed:function(e,t){var n=WT(e+"");if(arguments.length<2){for(var r=VT(this.node()),i=-1,a=n.length;++i=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}(e+""),o=a.length;if(!(arguments.length<2)){for(s=t?hM:dM,r=0;r{}};function _M(){for(var e,t=0,n=arguments.length,r={};t=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++o0)for(var n,r,i=new Array(n),a=0;a=0&&t._call.call(void 0,e),t=t._next;--MM}()}finally{MM=0,function(){var e,t,n=CM,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:CM=t);TM=e,VM(r)}(),NM=0}}function WM(){var e=LM.now(),t=e-PM;t>RM&&(zM-=t,PM=e)}function VM(e){MM||(OM&&(OM=clearTimeout(OM)),e-NM>24?(e<1/0&&(OM=setTimeout(qM,e-LM.now()-zM)),AM&&(AM=clearInterval(AM))):(AM||(PM=LM.now(),AM=setInterval(WM,RM)),MM=1,IM(qM)))}function HM(e,t,n){var r=new UM;return t=null==t?0:+t,r.restart((n=>{r.stop(),e(n+t)}),t,n),r}UM.prototype=BM.prototype={constructor:UM,restart:function(e,t,n){if("function"!==typeof e)throw new TypeError("callback is not a function");n=(null==n?DM():+n)+(null==t?0:+t),this._next||TM===this||(TM?TM._next=this:CM=this,TM=this),this._call=e,this._time=n,VM()},stop:function(){this._call&&(this._call=null,this._time=1/0,VM())}};var $M=jM("start","end","cancel","interrupt"),YM=[],GM=0,XM=1,KM=2,QM=3,JM=4,ZM=5,eO=6;function tO(e,t,n,r,i,a){var o=e.__transition;if(o){if(n in o)return}else e.__transition={};!function(e,t,n){var r,i=e.__transition;function a(e){n.state=XM,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var c,u,f,d;if(n.state!==XM)return l();for(c in i)if((d=i[c]).name===n.name){if(d.state===QM)return HM(o);d.state===JM?(d.state=eO,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[c]):+cGM)throw new Error("too late; already scheduled");return n}function rO(e,t){var n=iO(e,t);if(n.state>QM)throw new Error("too late; already running");return n}function iO(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}var aO,oO=180/Math.PI,sO={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function lO(e,t,n,r,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Uu(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(a.rotate,o.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Uu(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(a.skewX,o.skewX,s,l),function(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:Uu(e,n)},{i:s-2,x:Uu(t,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(e){for(var t,n=-1,r=l.length;++n=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?nO:rO;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}(n,e,t))},attr:function(e,t){var n=TT(e),r="transform"===n?fO:mO;return this.attrTween(e,"function"===typeof t?(n.local?wO:xO)(n,r,pO(this,"attr."+e,t)):null==t?(n.local?gO:bO)(n):(n.local?vO:yO)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!==typeof t)throw new Error;var r=TT(e);return this.tween(n,(r.local?_O:kO)(r,t))},style:function(e,t,n){var r="transform"===(e+="")?uO:mO;return null==t?this.styleTween(e,function(e,t){var n,r,i;return function(){var a=FT(this,e),o=(this.style.removeProperty(e),FT(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}(e,r)).on("end.style."+e,MO(e)):"function"===typeof t?this.styleTween(e,function(e,t,n){var r,i,a;return function(){var o=FT(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=FT(this,e)),o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s))}}(e,r,pO(this,"style."+e,t))).each(function(e,t){var n,r,i,a,o="style."+t,s="end."+o;return function(){var l=rO(this,e),c=l.on,u=null==l.value[o]?a||(a=MO(t)):void 0;c===n&&i===u||(r=(n=c).copy()).on(s,i=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,i,a=n+"";return function(){var o=FT(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!==typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"===typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(pO(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!==typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,i=iO(this.node(),n).tween,a=0,o=i.length;aKM&&n.state{const l="tooltip_"+YO()([e[0].x,e[0].y,e[1].x,e[1].y]);var c=o.append("path").attr("d",a(e)).attr("id","".concat(l)).attr("stroke",t).attr("fill","none").attr("stroke-width",1).attr("marker-end","url(#arrow-&".concat(s,")")).style("opacity",0),u=o.append("foreignObject").append("div").attr("id","#".concat(l)).attr("class","tooltip").style("opacity",0).attr("class","absolute");c.transition().duration(r/2).delay(i).style("opacity",1).on("end",(function(){o.append("circle").attr("r",5).attr("fill","".concat(n)).attr("cx",e[0][0]).attr("cy",e[0][1]).style("opacity",0).transition().duration(r/2).style("opacity",1).attrTween("cx",(function(){return function(e){return c.node().getPointAtLength(e*c.node().getTotalLength()).x}})).attrTween("cy",(function(){return function(e){return c.node().getPointAtLength(e*c.node().getTotalLength()).y}}))})),qO("#".concat(l)).on("mouseover",(function(e,t){u.transition().duration(200).style("opacity",1)})).on("mousemove",(function(e,t){u.html("Tooltip text here").style("left",e.pageX+"px").style("top",e.pageY-28+"px")})).on("mouseout",(function(){u.transition().duration(500).style("opacity",0)}))},XO=()=>{const{speed:e,changeSpeed:t}=(0,r.useContext)(ca),{messageHistory:n,currentTransaction:i}=(0,r.useContext)(To),[a,o]=yo(),{TRANSDURATION:s,REQUEST_BUFFER:l,PREPREPARE_BUFFER:c,PREPARE_BUFFER:u,COMMIT_BUFFER:f,REPLY_BUFFER:d}=Xe[e],{TRANSDURATION_NP:h,REQUEST_BUFFER_NP:p,PREPREPARE_BUFFER_NP:m,PREPARE_BUFFER_NP:b,COMMIT_BUFFER_NP:g,REPLY_BUFFER_NP:y}=Ke[e],{theme:v}=(0,r.useContext)(fa),{clear:x,changeClear:w}=(0,r.useContext)(ua),_=v?"#c4c4c4":"black",k=v?"#edf0f5":"#464747",[S,E]=(0,r.useState)(!0),j=(0,r.useRef)(null),C=(0,r.useRef)(null),T=(0,r.useRef)(null),M=(0,r.useRef)(null),O=(0,r.useRef)(null),A=(0,r.useRef)(1),R=(0,r.useRef)({}),P=(0,r.useRef)({}),[N,z]=(0,r.useState)({width:0,height:0});(0,r.useEffect)((()=>{const e=HO()((()=>{if(O.current){const{clientWidth:e,clientHeight:t}=O.current;z({width:e,height:t})}}),200);return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),e.cancel()}}),[]);const L=(0,r.useCallback)((()=>{qO(j.current).selectAll("*").remove(),qO(C.current).selectAll("*").remove(),qO(T.current).selectAll("*").remove(),qO(M.current).selectAll("*").remove();const{width:e,height:t}=N,r=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;const o=Math.floor(n/2)+Math.floor(r/1.8),s=Math.floor(n/2)+Math.floor(r/2.3),l=a+1,c=t-Math.floor((r+n)/1.5),u=e-(r+n),f=Math.floor(u/a),d=Math.floor(c/i);let h=new Array((i+1)*l).fill({x:0,y:0}),p=o,m=s,b=[];for(let g=0;g{let n=[],r=[],i=[],a=[];for(let o=0;o<=t;o++)i.push(e[o].x);for(let o=0;o{let s={};a in i||(a=Object.keys(i)[0]);let l=i[a];const c=o?We:Ve,{primaryIndex:u,transactions:f}=So(l);$e.forEach(((e,t)=>s={...s,[e]:{color:"".concat(c[t]),start:[],end:[]}})),s.request.start.push({flag:!0,points:e[0]});let d={};if(-1===u){let i=[];for(const[n,r]of Object.entries(ko))i.push(e[t+r]);s.request.end.push({flag:!0,points:i});for(let e=0;e{e.length>0&&e.map(((e,t)=>{let n=d[e.points.y];f.has(n)&&!o.has(n)&&(o.add(n),s.prepare.start.push({x:a,y:e.points.y}))}))}));for(const e of s.prepare.start)s.prepare.end.push([]);for(let e=0;e{f.has(d[e.points.y])&&s.prepare.start.push(e.points)}));for(const e of s.prepare.start)s.prepare.end.push([]);for(let e=0;e{let n=[],r=[];if(e.length<2||t.length<2)return n;for(let i=0;ie.x)).attr("cy",(e=>e.y)).attr("r","1.5").attr("fill","".concat(v?"white":"black"));const U=rE().x((e=>e.x)).y((e=>e.y));$e.forEach(((e,t)=>F.append("defs").append("marker").attr("id","arrow-".concat(e)).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto-start-reverse").append("path").attr("fill","".concat(We[t])).attr("d","M 0 0 L 10 5 L 0 10 z"))),w.forEach(((e,t)=>F.append("path").attr("d",U(e)).attr("stroke",_).attr("fill","none").attr("stroke-width",.2).attr("stroke-dasharray","5,10"))),S.forEach(((e,t)=>F.append("path").attr("d",U(e)).attr("stroke",_).attr("fill","none").attr("stroke-width",.2).attr("stroke-dasharray","5,10")));const B=Math.floor((t+e)/120),q=Math.floor(B/2),W=q-4;if(I.forEach((e=>F.append("text").attr("transform","translate("+e.x+" ,"+(e.y+q-3)+")").attr("fill",_).attr("font-size",B).style("text-anchor","middle").text("".concat(e.title)))),D.forEach(((e,t)=>F.append("text").attr("transform","translate("+(e.x+W+10)+" ,"+e.y+")").attr("font-size",B).style("text-anchor","middle").text("".concat(e.title)).attr("fill",_))),!x){let n;const r=qO(M.current).attr("width",e).attr("height",t);-1!==O&&(n=qO(T.current).attr("width",e).attr("height",t));const i=qO(C.current).attr("width",e).attr("height",t).classed("flex",!0).classed("justify-center",!0).classed("items-center",!0);let a=new Set;for(let[e,t]of Object.entries(R.current))P.current.has(t)||a.add(t);Math.floor((t+e)/120);D.forEach(((e,t)=>{if(a.has(t))return((e,t,n)=>(e.append("text").attr("transform","translate("+(t.x+10)+" ,"+(t.y+20)+")").attr("fill","#fc453f").style("font-size","12px").style("text-anchor","middle").text("Faulty"),e))(r,e)})),-1===O?(E.request.end[0].points.length>0&&E.request.end[0].points.forEach(((e,t)=>{GO([E.request.start[0].points,e],E.request.color,k,h,t*p,U,i,"request")})),E.prePrepare.start.length>0&&E.prePrepare.start.map(((e,t)=>E.prePrepare.end[t].map(((t,n)=>t.flag&&GO([e,t.points],E.prePrepare.color,k,h,1*n+m,U,i,"prePrepare"))))),E.prepare.start.length>0&&E.prepare.start.map(((e,t)=>E.prepare.end[t].map(((t,n)=>t.flag&&GO([e,t.points],E.prepare.color,k,h,1*n+b,U,i,"prepare"))))),E.commit.start.length>0&&E.commit.start.map(((e,t)=>E.commit.end[t].map(((t,n)=>t.flag&&GO([e,t.points],E.commit.color,k,h,1*n+g,U,i,"commit"))))),E.reply.start.length>0&&E.reply.start.forEach(((e,t)=>e.flag&&GO([e.points,E.reply.end[0].points],E.reply.color,k,h,1*t+y,U,i,"reply")))):(D.forEach(((e,t)=>{if(t===O)return((e,t)=>(e.append("text").attr("transform","translate("+(t.x+10)+" ,"+(t.y+20)+")").attr("fill","#02c415").style("text-anchor","middle").style("font-size","12px").text("Primary"),e))(n,e)})),E.request.end.length>0&&E.request.end.forEach(((e,t)=>{e.flag&&GO([E.request.start[0].points,e.points],E.request.color,k,s,t*l,U,i,"request")})),E.prePrepare.end.length>0&&E.prePrepare.end.forEach(((e,t)=>{e.flag&&GO([E.prePrepare.start[0].points,e.points],E.prePrepare.color,k,s,1*t+c,U,i,"prePrepare")})),E.prepare.start.length>0&&E.prepare.start.map(((e,t)=>E.prepare.end[t].map(((t,n)=>t.flag&&GO([e,t.points],E.prepare.color,k,s,1*n+u,U,i,"prepare"))))),E.commit.start.length>0&&E.commit.start.map(((e,t)=>E.commit.end[t].map(((t,n)=>t.flag&&GO([e,t.points],E.commit.color,k,s,1*n+f,U,i,"commit"))))),E.reply.start.length>0&&E.reply.start.forEach(((e,t)=>e.flag&&GO([e.points,E.reply.end[0].points],E.reply.color,k,s,1*t+d,U,i,"reply"))))}}),[v,N,n,i,x]);(0,r.useEffect)((()=>{L()}),[L]),(0,r.useEffect)((()=>{w(!0),setTimeout((()=>{w(!1)}),500)}),[e,i,o,a]);const I=v&&x?"gray":v&&!x?"white":!v&&x?"gray":"black";return(0,et.jsxs)(Oo,{title:"Practical Byzantine Fault Tolerance",heightBig:!0,children:[(0,et.jsxs)("div",{className:"flex items-center justify-around w-full flex-row mt-8",children:[(0,et.jsx)("div",{className:"basis-1/4",children:-1===A.current&&(0,et.jsx)("div",{className:"text-amber-600 font-18p border-1p rounded-md p-1 border-amber-600 w-180p flex items-center justify-center ml-8",children:"No Primary Exists"})}),(0,et.jsxs)("div",{className:"flex items-center justify-center gap-x-16 basis-1/2",children:[(0,et.jsx)(ht,{title:x?"Play":"Playing",onClick:()=>(w(!1),void E(!0)),disabled:!x,children:(0,et.jsx)(da,{path:x?"M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80V432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z":"M48 64C21.5 64 0 85.5 0 112V400c0 26.5 21.5 48 48 48H80c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H48zm192 0c-26.5 0-48 21.5-48 48V400c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H240z",viewBox:"0 0 384 512",height:"11px",fill:I})}),S&&(0,et.jsx)(pt,{selected:e,elements:["1x","0.5x","2x"],onClick:e=>t(e)}),(0,et.jsx)(ht,{title:"Clear",onClick:()=>(w(!0),void E(!1)),disabled:x,children:(0,et.jsx)(da,{path:st,viewBox:"0 0 384 512",height:"12px",fill:I})})]}),(0,et.jsx)("div",{className:"basis-1/4"})]}),(0,et.jsxs)("div",{ref:O,className:"relative w-full h-full pl-5 pr-0 pb-1",children:[(0,et.jsx)("svg",{id:"svg-one",ref:j,className:"absolute"}),!x&&(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("svg",{ref:C,className:"absolute"}),(0,et.jsx)("svg",{ref:T,className:"absolute"}),(0,et.jsx)("svg",{ref:M,className:"absolute"})]})]})]})},KO=()=>(0,et.jsx)(XO,{}),QO=e=>{let{onNext:t,onPrev:n,nextDisabled:i,prevDisabled:a,currentData:o,startRecord:s,endRecord:l}=e;const{loading:c,totalHistoryLength:u}=(0,r.useContext)(To);return(0,et.jsxs)("div",{className:"flex items-center justify-between px-8 border-t-1p border-gray-700 dark:border-gray-50 h-40p","aria-label":"Table navigation",children:[c?(0,et.jsx)("div",{className:"w-120p h-3 px-4 bg-gray-200 dark:bg-gray-700 animate-pulse rounded"}):(0,et.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,et.jsxs)("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400 block w-full md:inline md:w-auto",children:["Showing ",(0,et.jsx)("span",{className:"font-semibold text-gray-900 dark:text-white",children:"".concat(s,"-").concat(l)})," of ",(0,et.jsx)("span",{className:"font-semibold text-gray-900 dark:text-white",children:null!==u&&void 0!==u?u:"N/A"})]})}),(0,et.jsxs)("div",{className:"flex items-center justify-center gap-x-10 pt-1",children:[(0,et.jsx)(dt,{title:"Previous",onClick:n,disabled:a||c}),(0,et.jsx)(dt,{title:"Next",onClick:t,disabled:i||c})]})]})},JO={1:["Sr #","Transaction #","Primary","Faulty Replicas","Replica Details"],2:["Replica Number","Commit Time","Execution Time","Prepare Time"]},ZO=e=>{let{value:t,loading:n,replicaDetailsKeys:r,replicaDetailsBool:i,primaryDoesNotExist:a}=e;return(0,et.jsx)("td",{rowSpan:i?"":r.length+1,className:rt()("px-6 py-3 border-r-1p border-gray-700 dark:border-gray-50",{"animate-pulse":n},{"text-red-50":a===Qe}),children:n?(0,et.jsx)("div",{className:"w-full h-3 px-4 bg-gray-200 dark:bg-gray-700 animate-pulse rounded"}):(0,et.jsx)(et.Fragment,{children:t})})},eA=e=>{let{srNo:t,transaction:n,replicaDetailsKeys:i,loading:a,goToPbftGraph:o}=e;const{changeCurrentTransaction:s}=(0,r.useContext)(To),[l,c]=(0,r.useState)(!1);return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(la,{arrow:!0,placement:"top-start",open:l,onClose:()=>{n.transactionNumber<0&&c(!1)},onOpen:()=>{n.transactionNumber<0&&c(!0)},title:"SYNTHETIC DATA",children:(0,et.jsxs)("tr",{className:rt()({"cursor-pointer dark:hover:bg-gray-700 hover:bg-gray-400":!a}),onClick:()=>!a&&(e=>{s(e),o()})(n.transactionNumber),children:[(0,et.jsx)(ZO,{value:t,loading:a,replicaDetailsKeys:i,transaction:n,primaryDoesNotExist:n.primary}),Object.keys(n).length>0&&Object.keys(n).map(((e,t)=>{if("replicaDetails"!==e)return(0,et.jsx)(ZO,{value:n[e],loading:a,replicaDetailsKeys:i,primaryDoesNotExist:n.primary},t)}))]})}),i.map(((e,t)=>{const r=n.replicaDetails[e];return(0,et.jsxs)("tr",{className:"border-b-2p",children:[(0,et.jsx)(ZO,{value:e,loading:a,replicaDetailsKeys:i,primaryDoesNotExist:n.primary,replicaDetailsBool:!0},t),Object.keys(r).length>0&&Object.keys(r).map(((e,t)=>(0,et.jsx)(ZO,{value:r[e],loading:a,replicaDetailsKeys:i,primaryDoesNotExist:n.primary,replicaDetailsBool:!0},t)))]},e)}))]})},tA=e=>{let{goToPbftGraph:t}=e;const{data:n,loading:i}=(0,r.useContext)(To),[a,o]=(0,r.useState)(1),s=n?Math.ceil(Object.keys(n).length/5):1,l=5*(a-1)+1,c=Math.min(5*a,n?Object.keys(n).length:0),u=e=>{o((t=>"next"===e&&t1?t-1:t))},f=n?Object.keys(n).slice(5*(a-1),5*a):[];return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)("div",{className:"mb-10",children:(0,et.jsx)(ka,{title:"Current Transactions"})}),(0,et.jsxs)("div",{className:"relative overflow-x-auto rounded-md border-3p bg-blue-10 dark:border-solid border-gray-700 dark:border-gray-50 h-600p",children:[(0,et.jsx)("div",{className:"overflow-y-auto h-550p scrollbar",children:(0,et.jsxs)("table",{className:"w-full text-sm text-center rtl:text-right dark:text-gray-300 text-gray-700",children:[(0,et.jsxs)("thead",{className:"text-xs uppercase dark:text-gray-300 text-gray-700 w-full border-gray-700 dark:border-gray-50 bg-gray-100 dark:bg-gray-800 sticky top-0 z-10",children:[(0,et.jsx)("tr",{children:JO[1].map(((e,t)=>{let n="Replica Details"===e;return(0,et.jsx)("th",{scope:"col",className:rt()("px-6 py-3 border-r-1p border-gray-700 dark:border-gray-50",{"border-r-0":n}),rowSpan:!n&&"2",colSpan:n&&"4",children:e},t)}))}),(0,et.jsx)("tr",{children:JO[2].map(((e,t)=>(0,et.jsx)("th",{scope:"col",className:rt()("px-6 py-3 border-gray-700 dark:border-gray-50 border-t-1p border-r-1p"),children:e},t)))})]}),(0,et.jsx)("tbody",{children:i?(0,et.jsx)(et.Fragment,{children:Object.keys(wo).map(((e,n)=>{const r=wo[e],a=Object.keys(r.replicaDetails);return(0,et.jsx)(eA,{className:"cursor-pointer",srNo:n+1,transaction:r,replicaDetailsKeys:a,loading:i,goToPbftGraph:t},e)}))}):(0,et.jsx)(et.Fragment,{children:f.map(((e,r)=>{const i=n[e],o=Object.keys(i.replicaDetails);return(0,et.jsx)(eA,{className:"cursor-pointer",srNo:r+1+5*(a-1),transaction:i,replicaDetailsKeys:o,goToPbftGraph:t},e)}))})})]})}),(0,et.jsx)(QO,{onPrev:()=>u("prev"),onNext:()=>u("next"),nextDisabled:a===s,prevDisabled:1===a,startRecord:l,endRecord:c,currentData:f})]})]})},nA=e=>{let{title:t,info:n}=e;return(0,et.jsxs)("div",{className:"flex flex-col justify-center items-center",children:[(0,et.jsx)("div",{className:"text-16p md:text-14p sm:text-10p font-bold py-1",children:n}),(0,et.jsx)("div",{className:"text-14p md:text-12p sm:text-8p pt-1",children:t})]})},rA=e=>{let{replica:t,status:n}=e;return(0,et.jsxs)("div",{className:"flex flex-col justify-center items-center",children:[(0,et.jsx)("div",{className:"",children:(0,et.jsx)(da,{path:n?"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z":st,viewBox:n?"0 0 448 512":"0 0 384 512",height:"18px",fill:n?"#0ac24d":"#ed1123"})}),(0,et.jsx)("div",{className:"text-14p md:text-12p sm:text-10p pt-2",children:t})]})},iA=e=>{let{title:t,link:n}=e;return(0,et.jsx)("div",{className:"relative flex h-11 w-full items-center justify-center px-6 before:absolute before:inset-0 before:rounded-full before:border-3p before:border-blue-500 before:bg-primary/10 before:bg-gradient-to-b before:transition before:duration-300 hover:before:scale-105 active:duration-75 active:before:scale-95 dark: before:border-gray-700 dark:before:bg-gray-800 sm:w-max cursor-pointer",children:(0,et.jsx)(Te,{to:n,children:(0,et.jsx)("span",{className:"relative text-base font-semibold text-primary dark:text-white",children:t})})})},aA=()=>{const{primaryIndexVal:e,currentTransaction:t,replicaStatus:n}=(0,r.useContext)(To),{theme:i}=(0,r.useContext)(fa),a=i?Le:Ie,o=-1===e?"No Primary":"Replica ".concat(e),[s,l]=(0,r.useState)([!1,!1,!1,!1]);function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;return Promise.race([fetch(e,t),new Promise(((e,t)=>setTimeout((()=>t(new Error("Timeout"))),n)))])}return(0,r.useEffect)((()=>{const e=setInterval((()=>{t<0?l(n):function(){let e=[],t=[!1,!1,!1,!1];for(let n=0;n<4;n++){let r=parseInt(18501)+n,i=c("http://localhost:"+String(r)+"/get_status").then((e=>e.text())).then((e=>{"Not Faulty"===e&&(t[n]=!0)})).catch((e=>{console.error("Error:",e)}));e.push(i)}Promise.all(e).then((()=>{l(t)}))}()}),3e3);return()=>clearInterval(e)}),[n]),(0,et.jsxs)("div",{className:"h-full w-220p fixed z-1 top-0 left-0 overflow-x-hidden p-2 py-6 flex flex-col items-center justify-around opacity-1 border-r-3p border-solid border-gray-700 dark:border-gray-50 dark:text-gray-300 gap-y-6 scrollbar",children:[(0,et.jsxs)(Te,{to:Pe,className:"flex items-center justify-center gap-x-2 w-full cursor-pointer",children:[(0,et.jsx)("img",{src:a,alt:"ResDb View Logo",className:"h-30p w-30p"}),(0,et.jsx)("div",{className:"text-blue-190 text-18p font-sans font-bold",children:(0,et.jsx)("span",{className:"text-20p font-bold text-gray-900 dark:text-white",children:"ResView"})})]}),(0,et.jsx)("div",{className:"w-full px-4",children:(0,et.jsx)(vo,{})}),(0,et.jsx)("div",{className:"px-6 w-full",children:(0,et.jsx)(iA,{title:"Home",link:Pe,external:!1})}),(0,et.jsx)("div",{className:"w-full px-4",children:(0,et.jsx)(vo,{})}),(0,et.jsx)("div",{className:"text-16p md:text-14p sm:text-10p font-bold py-1",children:"Current Transaction"}),(0,et.jsx)("div",{children:(0,et.jsx)(nA,{title:"Transaction #",info:null!==t&&void 0!==t?t:"17"})}),(0,et.jsx)("div",{children:(0,et.jsx)(nA,{title:"Primary",info:o})}),(0,et.jsx)("div",{children:(0,et.jsx)(nA,{title:"# Replicas",info:"4"})}),(0,et.jsx)("div",{className:"w-full px-4",children:(0,et.jsx)(vo,{})}),(0,et.jsx)("div",{className:"text-16p md:text-14p sm:text-10p font-bold py-1",children:"Replica Status"}),(0,et.jsx)("div",{className:"flex flex-col items-center justify-center gap-y-10",children:s.length>0&&s.map(((e,t)=>(0,et.jsx)(rA,{replica:"Replica ".concat(t+1),status:e},t)))})]})},oA=e=>{let{title:t,value:n}=e;return(0,et.jsxs)("div",{className:"flex flex-col items-center justify-center px-2 py-2 pt-3 gap-y-4",children:[(0,et.jsx)("div",{className:"dark:text-gray-300 text-gray-700 font-semibold text-center text-20p",children:n}),(0,et.jsx)("div",{className:"dark:text-gray-300 text-gray-700 text-14p text-center",children:t})]})},sA=()=>{const{theme:e}=(0,r.useContext)(fa),{totalPercentFaulty:t,totalHistoryLength:n,noPrimaryCount:i}=(0,r.useContext)(To);return(0,et.jsxs)("div",{className:rt()("flex flex-col rounded-md bg-blue-10 border-3p border-solid border-gray-700 dark:border-gray-50 dark:bg-blue-450 relative w-full"),children:[(0,et.jsxs)("div",{className:"flex items-center justify-center gap-x-2 w-full border-b-2p border-solid border-gray-700 dark:border-gray-50 h-60p",children:[(0,et.jsx)("div",{children:(0,et.jsx)(da,{fill:e?"rgb(209,213,219)":"black",height:"1em",path:it,viewBox:"0 0 448 512"})}),(0,et.jsx)(ka,{title:"Analytics"})]}),(0,et.jsxs)("div",{className:"grid grid-rows-2 h-full w-full",children:[(0,et.jsx)("div",{className:"flex items-center justify-center w-full border-b-2p border-solid border-gray-700 dark:border-gray-50",children:(0,et.jsx)(oA,{value:n,title:"Total Transactions"})}),(0,et.jsxs)("div",{className:"grid grid-cols-2 flex-items-center-justify-center w-full",children:[(0,et.jsx)("div",{className:"border-r-2p border-solid border-gray-700 dark:border-gray-50 flex items-center justify-center",children:(0,et.jsx)(oA,{title:"Avg. Faultiness",value:"".concat((100*t).toFixed(2),"%")})}),(0,et.jsx)("div",{className:"flex items-center justify-center",children:(0,et.jsx)(oA,{title:"No Primary",value:i})})]})]})]})},lA=["Sr #","Transaction","Primary","Faulty Replicas"],cA=e=>{let{value:t,loading:n,primaryDoesNotExist:r}=e;return(0,et.jsx)("td",{className:rt()("px-3 py-3 border-r-1p border-gray-700 dark:border-gray-50",{"animate-pulse":n},{"text-red-50":r===Qe}),children:n?(0,et.jsx)("div",{className:"w-full h-3 px-3 bg-gray-200 dark:bg-gray-700 animate-pulse rounded"}):(0,et.jsx)("div",{className:"text-12p",children:t})})},uA=e=>{let{srNo:t,transaction:n,loading:i}=e;const{transactionNumber:a}=n,{changeCurrentTransaction:o,currentTransaction:s}=(0,r.useContext)(To),[l,c]=(0,r.useState)(!1);return(0,et.jsx)(la,{arrow:!0,placement:"left",open:l,onClose:()=>{a<0&&c(!1)},onOpen:()=>{a<0&&c(!0)},title:"SYNTHETIC DATA",children:(0,et.jsxs)("tr",{className:rt()({"dark:bg-gray-700 bg-gray-400":a==s&&!i,"cursor-pointer dark:hover:bg-gray-700 hover:bg-gray-400":!i,"cursor-not-allowed":i}),onClick:()=>!i&&(e=>{o(e)})(null!==a&&void 0!==a?a:-1),children:[(0,et.jsx)(cA,{value:t,loading:i,transaction:n,primaryDoesNotExist:n.primary}),Object.keys(n).length>0&&Object.keys(n).map(((e,t)=>"replicaDetails"!==e?(0,et.jsx)(cA,{value:n[e],loading:i,primaryDoesNotExist:n.primary},t):null))]})})},fA=()=>{const{loading:e,truncatedData:t}=(0,r.useContext)(To);return(0,et.jsxs)("table",{className:"text-sm text-center rtl:text-right dark:text-gray-300 text-gray-700 h-full w-full",children:[(0,et.jsx)("thead",{className:"text-xs uppercase dark:text-gray-300 text-gray-700 border-b-1p border-solid border-gray-700 dark:border-gray-50",children:(0,et.jsx)("tr",{className:"h-50p",children:lA.map(((e,t)=>{let n="Replica Details"===e;return(0,et.jsx)("th",{scope:"col",className:rt()("px-1 py-2 border-r-1p border-gray-700 dark:border-gray-50 text-8p",{"w-[20%]":0===t||3===t,"w-[30%]":1===t||2===t,"border-r-0":n}),rowSpan:!n&&"2",colSpan:n&&"4",children:e},t)}))})}),(0,et.jsx)("tbody",{children:e?(0,et.jsx)(et.Fragment,{children:Object.keys(_o).length>0&&Object.keys(_o).map(((e,t)=>{const n=_o[e];return(0,et.jsx)(uA,{className:"cursor-pointer",srNo:t+1,transaction:n,loading:!0},e)}))}):(0,et.jsx)(et.Fragment,{children:Object.keys(t).length>0&&Object.keys(t).map(((n,r)=>{const i=t[n];return(0,et.jsx)(uA,{className:"cursor-pointer",srNo:r+1,transaction:i,loading:e},n)}))})})]})},dA=e=>{let{goToElement:t}=e;const{theme:n}=(0,r.useContext)(fa);return(0,et.jsxs)("div",{className:rt()("flex flex-col rounded-md bg-blue-10 border-3p border-solid border-gray-700 dark:border-gray-50 dark:bg-blue-450 relative w-full"),children:[(0,et.jsxs)("div",{className:"flex items-center justify-center gap-x-2 w-full border-b-2p border-solid border-gray-700 dark:border-gray-50 h-60p",children:[(0,et.jsx)(da,{fill:n?"rgb(209,213,219)":"black",height:"1em",path:"M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z",viewBox:"0 0 576 512"}),(0,et.jsx)(ka,{title:"Overview"})]}),(0,et.jsx)("div",{className:"overflow-y-scroll h-full scrollbar",children:(0,et.jsx)(fA,{})}),(0,et.jsxs)("div",{className:"w-full flex items-center justify-center gap-x-2 border-t-3p border-solid border-gray-700 dark:border-gray-50 cursor-pointer hover:dark:bg-green-80 h-60p",onClick:()=>t("transaction-table"),children:[(0,et.jsx)("div",{children:(0,et.jsx)(da,{path:"M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z",fill:n?"rgb(209,213,219)":"black",height:"1.1em",viewBox:"0 0 448 512"})}),(0,et.jsx)("div",{className:"dark:text-gray-300 text-gray-700 font-bold text-center text-14p",children:"All Transactions"})]})]})},hA=()=>{const[e,t]=yo();let n=Math.floor(t/2)+200;const r=e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})};return(0,et.jsxs)("div",{className:"h-full w-screen",children:[(0,et.jsx)(aA,{}),(0,et.jsxs)("div",{className:"ml-[220px] px-8 pt-12 h-full",children:[(0,et.jsxs)("div",{className:"grid grid-cols-3.5f-1f gap-x-6 w-full h-full",id:"pbft-graph",children:[(0,et.jsx)(KO,{}),(0,et.jsxs)("div",{className:"grid grid-rows-2 gap-y-4",style:{height:n},children:[(0,et.jsx)(dA,{goToElement:r}),(0,et.jsx)(sA,{})]})]}),(0,et.jsx)("div",{className:"my-8 px-24 w-full",children:(0,et.jsx)(vo,{})}),(0,et.jsx)(sT,{}),(0,et.jsx)("div",{className:"my-10 px-24 w-full",children:(0,et.jsx)(vo,{})}),(0,et.jsx)("div",{className:"px-24",id:"transaction-table",children:(0,et.jsx)(tA,{goToPbftGraph:()=>r("pbft-graph"),delay:3e3})}),(0,et.jsx)("div",{className:"mt-10 mb-24 px-24 w-full",children:(0,et.jsx)(vo,{})}),(0,et.jsx)("div",{className:"mb-4",children:(0,et.jsx)(mt,{})})]})]})},pA=()=>(0,et.jsx)(hA,{}),mA=()=>(0,et.jsx)("div",{className:"h-screen",children:(0,et.jsxs)(ba,{children:[(0,et.jsxs)("div",{className:"dark:text-white text-gray text-48p font-sans font-bold mt-10p mb-8",children:["Res ",(0,et.jsx)("span",{className:"text-red-50",children:"NO"})," ",(0,et.jsx)("span",{children:"View"})]}),(0,et.jsxs)("div",{className:"flex flex-col items-center justify-center gap-y-2 my-4",children:[(0,et.jsx)("div",{className:"text-gray dark:text-white text-36p bold",children:"Error 404"}),(0,et.jsx)("div",{className:"text-gray dark:text-white text-30p bold",children:"Page Not Found"})]}),(0,et.jsx)("div",{className:"mt-8",children:(0,et.jsx)(ut,{title:"Go Back",link:Pe,external:!1})})]})});var bA=n(4409);const gA=e=>{var t;const n=null!==(t=e.id)&&void 0!==t?t:"tsparticles";return(0,r.useEffect)((()=>{let t;return bA.$k.load({id:n,url:e.url,options:e.options}).then((n=>{var r;t=n,null==(r=e.particlesLoaded)||r.call(e,n)})),()=>{null==t||t.destroy()}}),[n,e,e.url,e.options]),(0,et.jsx)("div",{id:n,className:e.className})};const yA={background:{color:{value:"transparent"}},fpsLimit:120,interactivity:{events:{onClick:{enable:!0,mode:"pop"}}},particles:{destroy:{mode:"split",split:{count:1,factor:{value:{min:2,max:4}},rate:{value:100},particles:{life:{count:1,duration:{value:{min:2,max:3}}},move:{speed:{min:2,max:5}}}}},number:{value:50},shape:{type:"circle"},opacity:{value:{min:0,max:.3}},size:{value:{min:2,max:4}},collisions:{enable:!0,mode:"bounce"},move:{enable:!0,speed:1,outModes:"bounce"}}},vA=e=>{let{init:t,particlesLoaded:n}=e;const{theme:i}=(0,r.useContext)(fa),a=(0,r.useMemo)((()=>i?{...yA,particles:{...yA.particles,color:{value:"#fff"}}}:{...yA,particles:{...yA.particles,color:{value:"#0d98db"},collisions:{enable:!1}}}),[i]);return t?(0,et.jsx)(gA,{id:"tsparticles",particlesLoaded:n,options:a}):(0,et.jsx)(et.Fragment,{})},xA=(wA=[[e=>{let{children:t}=e;const[n,i]=(0,r.useState)(!0),{Provider:a}=fa;return(0,et.jsx)(a,{value:{theme:n,toggleDarkTheme:()=>{i(!0),localStorage.setItem("theme","dark")},toggleLightTheme:()=>{i(!1),localStorage.setItem("theme","light")}},children:t})}],[e=>{let{children:t}=e;const[n,i]=(0,r.useState)(!1),{Provider:a}=tt,o=(0,r.useRef)(),s=(0,r.useCallback)((e=>{o.current&&o.current.disconnect(),o.current=new IntersectionObserver((e=>{e[0].isIntersecting?i(!1):i(!0)}),{root:null,threshold:0}),e&&o.current.observe(e)}),[]);return(0,et.jsx)(a,{value:{borderToggle:n,bToggleElement:s},children:t})}],[e=>{let{children:t}=e;const{Provider:n}=ca,[i,a]=(0,r.useState)("1x");return(0,et.jsx)(n,{value:{speed:i,changeSpeed:e=>a(e)},children:t})}],[e=>{let{children:t}=e;const{Provider:n}=ua,[i,a]=(0,r.useState)(!1);return(0,et.jsx)(n,{value:{clear:i,changeClear:e=>a(e)},children:t})}],[e=>{let{children:t}=e;const{Provider:n}=To,[i,a]=(0,r.useState)(xo),[o,s]=(0,r.useState)(-1),[l,c]=(0,r.useState)([!1,!1,!1,!1]),[u,f]=(0,r.useState)(-1),[d,h]=(0,r.useState)({}),[p,m]=(0,r.useState)({}),[b,g]=(0,r.useState)(0),[y,v]=(0,r.useState)(0),[x,w]=(0,r.useState)(0),[_,k]=(0,r.useState)(!1),S=(0,r.useRef)(0),E=(0,r.useRef)({}),j=(0,r.useRef)([[],[],[],[]]);let C;const T=e=>{a(e)};return(0,r.useEffect)((()=>{k(!0);const{primaryIndex:e,currentStatus:t}=jo(i,o,[!1,!1,!1,!1]);c(t),f(e);const{data:n,totalPctFaulty:r,totalHistLength:a,noPrimaryCnt:s}=(e=>{let t={},n=0,r=0;Object.entries(e).forEach((i=>{let[a,o]=i;const{primaryIndex:s,faultReplicas:l,percentFaulty:c}=jo(e,a,Eo);let u="";-1===s?(u=Qe,r+=1):u="Replica ".concat(s),t[a]={transactionNumber:a,primary:u,faultReplicas:"".concat(l),replicaDetails:{}},n+=c;for(let n in e[a]){const r=e[a][n];t[a].replicaDetails[n]={commitTime:r.commit_time,execTime:r.execution_time,prepTime:r.prepare_time}}}));const i=Object.keys(t).length,a=(n/i).toFixed(2);return{data:t,totalPctFaulty:a,totalHistLength:i,noPrimaryCnt:r}})(i),l=Co(n,o);h(n),g(r),v(a),w(s),m(l),k(!1)}),[o,i]),(0,r.useEffect)((()=>{const e=async e=>{try{let t=parseInt(18501)+e;const n=await fetch("http://localhost:"+String(t)+"/consensus_data"),r=await n.json();null!==r&&Object.keys(r).map((t=>{j.current[e].includes(t)||(j.current[e].push(t),(e=>{if(null===e)return;const t=(new Date).getTime();let n={...e,reply_time:t};const r=String(n.txn_number),i=String(n.replica_id);if(C=E.current,r in C){let e=C[r];e={...e,[i]:n},C[r]=e,E.current=C}else{let e={[i]:n};C[r]=e,E.current=C,S.current=S.current+1}})(r[t]),((e,t)=>{if(i){let t=JSON.parse(JSON.stringify(e));T({...i,...t})}else T(JSON.parse(JSON.stringify(e)))})(E.current))}))}catch(t){console.error("Error fetching data:",t)}},t=async()=>{k(!0);const t=Date.now();try{const n=[];for(let t=0;t<4;t++)n.push(e(t));await Promise.all(n);const r=1e3-(Date.now()-t);r>0&&await new Promise((e=>setTimeout(e,r)))}finally{k(!1)}};t();const n=setInterval(t,2e4);return()=>clearInterval(n)}),[]),(0,et.jsx)(n,{value:{messageHistory:i,changeMessageHistory:T,changeCurrentTransaction:e=>{k(!0),s(e);const t=Co(d,e);m(t),k(!1)},replicaStatus:l,currentTransaction:o,primaryIndexVal:u,data:d,totalPercentFaulty:b,totalHistoryLength:y,noPrimaryCount:x,loading:_,truncatedData:p},children:t})}]],wA.reduce(((e,t)=>{let[n,r={}]=t;return t=>{let{children:i}=t;return(0,et.jsx)(e,{children:(0,et.jsx)(n,{...r,children:i})})}}),(e=>{let{children:t}=e;return(0,et.jsx)(et.Fragment,{children:t})})));var wA;const _A=()=>{const{bToggleElement:e}=(0,r.useContext)(tt);return(0,et.jsx)("div",{className:"relative mt-30p",ref:e})},kA=()=>{const[e,t]=(0,r.useState)(!1),[i,a]=(0,r.useState)(!1),{toggleLightTheme:o,toggleDarkTheme:s}=(0,r.useContext)(fa);"light"===localStorage.getItem("theme")?(o(),document.documentElement.setAttribute("data-theme","light")):(s(),document.documentElement.setAttribute("data-theme","dark")),(0,r.useEffect)((()=>{(async()=>{try{t(!0),await async function(e){await e(bA.$k)}((async e=>{await async function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{loadParallaxMover:r}=await n.e(7590).then(n.bind(n,7590)),{loadExternalAttractInteraction:i}=await n.e(6725).then(n.bind(n,6725)),{loadExternalBounceInteraction:a}=await n.e(8122).then(n.bind(n,5741)),{loadExternalBubbleInteraction:o}=await n.e(3764).then(n.bind(n,3764)),{loadExternalConnectInteraction:s}=await n.e(1070).then(n.bind(n,1070)),{loadExternalGrabInteraction:l}=await n.e(1604).then(n.bind(n,1604)),{loadExternalPauseInteraction:c}=await n.e(4570).then(n.bind(n,2189)),{loadExternalPushInteraction:u}=await n.e(2314).then(n.bind(n,2314)),{loadExternalRemoveInteraction:f}=await n.e(2330).then(n.bind(n,2330)),{loadExternalRepulseInteraction:d}=await n.e(6646).then(n.bind(n,6646)),{loadExternalSlowInteraction:h}=await n.e(599).then(n.bind(n,599)),{loadParticlesAttractInteraction:p}=await n.e(175).then(n.bind(n,175)),{loadParticlesCollisionsInteraction:m}=await n.e(5817).then(n.bind(n,5817)),{loadParticlesLinksInteraction:b}=await n.e(2427).then(n.bind(n,2427)),{loadEasingQuadPlugin:g}=await n.e(4708).then(n.bind(n,4708)),{loadEmojiShape:y}=await n.e(615).then(n.bind(n,615)),{loadImageShape:v}=await n.e(464).then(n.bind(n,464)),{loadLineShape:x}=await n.e(3739).then(n.bind(n,3739)),{loadPolygonShape:w}=await n.e(9295).then(n.bind(n,9295)),{loadSquareShape:_}=await n.e(9482).then(n.bind(n,9482)),{loadStarShape:k}=await n.e(6341).then(n.bind(n,6341)),{loadLifeUpdater:S}=await n.e(2975).then(n.bind(n,2975)),{loadRotateUpdater:E}=await n.e(2478).then(n.bind(n,2478)),{loadStrokeColorUpdater:j}=await n.e(3579).then(n.bind(n,3579)),{loadBasic:C}=await n.e(719).then(n.bind(n,719));await r(e,!1),await i(e,!1),await a(e,!1),await o(e,!1),await s(e,!1),await l(e,!1),await c(e,!1),await u(e,!1),await f(e,!1),await d(e,!1),await h(e,!1),await p(e,!1),await m(e,!1),await b(e,!1),await g(),await y(e,!1),await v(e,!1),await x(e,!1),await w(e,!1),await _(e,!1),await k(e,!1),await S(e,!1),await E(e,!1),await j(e,!1),await C(e,t)}(e)})),a(!0)}catch(e){console.error("Initialization failed:",e)}finally{t(!1)}})()}),[]);return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(Ee,{children:(0,et.jsxs)(ge,{children:[(0,et.jsx)(me,{index:!0,element:(0,et.jsx)(pe,{to:"".concat("/pages/home")})}),(0,et.jsx)(me,{path:"".concat(Ne),element:(0,et.jsx)(co,{loading:e})}),(0,et.jsx)(me,{path:"".concat(Pe),element:(0,et.jsx)(Ra,{})}),(0,et.jsx)(me,{path:"".concat(ze),element:(0,et.jsx)(pA,{})}),(0,et.jsx)(me,{path:"*",element:(0,et.jsx)(mA,{})})]})}),(0,et.jsx)(vA,{init:i,particlesLoaded:e=>{}})]})};const SA=function(){return(0,et.jsx)(xA,{children:(0,et.jsx)(r.Suspense,{fallback:(0,et.jsx)(Pa,{}),children:(0,et.jsx)(kA,{})})})};a.createRoot(document.getElementById("root")).render((0,et.jsx)(r.StrictMode,{children:(0,et.jsx)(SA,{})}))})()})();
-//# sourceMappingURL=main.e77bf12d.js.map
\ No newline at end of file
+/*! For license information please see main.39cee612.js.LICENSE.txt */
+(()=>{var e={5513:(e,t,n)=>{"use strict";n.d(t,{A:()=>ie});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?u(x,--y):0,b--,10===v&&(b=1,m--),v}function S(){return v=y2||T(v)>3?"":" "}function P(e,t){for(;--t&&S()&&!(v<48||v>102||v>57&&v<65||v>70&&v<97););return C(e,j()+(t<6&&32==E()&&32==S()))}function N(e){for(;S();)switch(v){case e:return y;case 34:case 39:34!==e&&39!==e&&N(v);break;case 40:41===e&&N(e);break;case 92:S()}return y}function z(e,t){for(;S()&&e+v!==57&&(e+v!==84||47!==E()););return"/*"+C(t,y-1)+"*"+a(47===e?e:S())}function L(e){for(;!T(E());)S();return C(e,y)}var I="-ms-",D="-moz-",F="-webkit-",U="comm",B="rule",q="decl",W="@keyframes";function V(e,t){for(var n="",r=h(e),i=0;i0&&d(D)-g&&p(v>32?K(D+";",r,n,g-1):K(l(D," ","")+";",r,n,g-2),h);break;case 59:D+=";";default:if(p(I=G(D,t,n,m,b,i,f,M,O=[],N=[],g),o),123===T)if(0===b)Y(D,t,I,I,O,o,g,f,N);else switch(99===y&&110===u(D,3)?100:y){case 100:case 108:case 109:case 115:Y(e,I,I,r&&p(G(e,I,I,0,0,i,f,M,i,O=[],g),N),i,N,g,f,r?O:N);break;default:Y(D,I,I,I,[""],N,0,f,N)}}m=b=v=0,w=C=1,M=D="",g=s;break;case 58:g=1+d(D),v=x;default:if(w<1)if(123==T)--w;else if(125==T&&0==w++&&125==k())continue;switch(D+=a(T),T*w){case 38:C=b>0?1:(D+="\f",-1);break;case 44:f[m++]=(d(D)-1)*C,C=1;break;case 64:45===E()&&(D+=A(S())),y=E(),b=g=d(M=D+=L(j())),T++;break;case 45:45===x&&2==d(D)&&(w=0)}}return o}function G(e,t,n,r,a,o,c,u,d,p,m){for(var b=a-1,g=0===a?o:[""],y=h(g),v=0,x=0,_=0;v