diff --git a/dist/index.html b/dist/index.html
index 6a7d2214..7ca79de7 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -250,4 +250,4 @@
#canvas, canvas {
cursor: none;
}
- `,document.head.appendChild(F)}clearValues(){this.level<=1&&(this.levelSpeeds=[,,,,,]),this.skip0&&0==this.level&&(this.level=1),this.lastMissileCantBeUndone=!1,this.speedFactor=2,this.speedLimit=10,this.missileSpeed=15,this.shownStatScreen=!1,this.G=100,this.vectorLimit=this.speedLimit*this.speedFactor,this.missileVectorLimit=this.missileSpeed*this.speedFactor,this.missileVectorLimitSum=42426,this.FPS=25,this.P5_FPS_MULTIPLIER=3,this.P5_FPS=this.FPS*this.P5_FPS_MULTIPLIER,this.p?.frameRate(this.P5_FPS),this.timer=(this.level>5?60:In[this.level])*this.FPS,this.deadOpacity="0.9",this.initialScoreSize=120,this.scoreSize=this.initialScoreSize,this.opac=(this.globalStyle,1),this.tailLength=1,this.tailMod="psycho"==this.globalStyle?2:1,this.explosions=[],this.missiles=[],this.stillVisibleMissiles=[],this.missileInits=[],this.bodies=[],this.witheringBodies=[],this.bodyInits=[],this.bodyFinal=[],this.missileCount=0,this.frames=0,this.p5Frames=0,this.showIt=!0,this.justStopped=!1,this.gameOver=!1,this.firstFrame=!0,this.loaded=!1,this.showPlayAgain=!1,this.handledGameOver=!1,this.statsText="",this.hasStarted=!1,this.buttons={},this.won=!1,this.finalBatchSent=!1,this.solved=!1,this.shaking=0,this.explosionSmoke=[],this.gunSmoke=[],this.date=new Date(1e3*this.day).toISOString().split("T")[0].replace(/-/g,"."),this.framesTook=!1,this.showProblemRankingsScreenAt=-1,this.saveStatus="unsaved",delete this.validatedAt,delete this.validatingAt,delete this.savingAt,delete this.savedAt}init(){this.skipAhead=!1,this.winScreenBaddies=void 0,this.seed=q7.solidityKeccak256(["uint256"],[this.day]),this.generateBodies(),this.frames=this.alreadyRun,this.startingFrame=this.alreadyRun,this.stopEvery=this.test?20:this.proverTickIndex(this.level+1),this.lastLevel=this.level,this.setPause(this.paused,!0),this.storeInits()}async start(){this.addCSS(),this.addListeners(),this.runSteps(this.preRun),this.freeze&&this.setPause(!0,!0)}destroy(){this.resizeObserver.disconnect(this.p.canvas),this.setPause(!0),this.p.noLoop(),this.removeListener(),this.sound.stop(),this.sound=null,this.p.remove()}storeInits(){this.bodyInits=this.processInits(this.bodies)}processInits(F){return this.convertBodiesToBigInts(F).map(F=>((F=this.convertScaledBigIntBodyToArray(F))[2]=BigInt(F[2]).toString(),F[3]=BigInt(F[3]).toString(),F))}runSteps(F=this.preRun){let A=0,t=!0;for(this.showIt=!1;t;)if(++A>F)t=!1,this.showIt=!0;else{let F=this.step(this.bodies,this.missiles);this.frames++,this.bodies=F.bodies,this.missiles=F.missiles||[]}}addListeners(){this.p.mouseMoved=this.handleMouseMove,this.p.touchStarted=F=>{this.hasTouched=!0,this.handleGameClick(F)},this.p.mouseClicked=this.handleGameClick,this.p.keyPressed=this.handleGameKeyDown}removeListener(){this.p.remove()}getXY(F){let A,t;return F.touches?(A=F.touches[0].pageX-this.canvasRect.left,t=F.touches[0].pageY-this.canvasRect.top):(A=F.offsetX||F.layerX,t=F.offsetY||F.layerY),{x:A=A*this.windowWidth/this.canvasRect.width,y:t=t*this.windowHeight/this.canvasRect.height}}handleMouseMove=F=>{let{x:A,y:t}=this.getXY(F);for(let F in this.mouseX=A,this.mouseY=t,this.buttons){let e=this.buttons[F];e.hover=Io(e,A,t)}};handleGameClick=F=>{this.gameOver&&this.won&&(this.skipAhead=!0);let{x:A,y:t}=this.getXY(F);for(let F in this.buttons){let e=this.buttons[F];if(e.visible&&Io(e,A,t)&&!e.disabled){e.onClick();return}}this.paused||this.gameOver||this.missileClick(A,t)};handleNFTClick=()=>{this.setPause()};handleGameKeyDown=F=>{if(this.gameOver&&this.won&&(this.skipAhead=!0),!(F.shiftKey&&F.altKey&&F.ctrlKey&&F.metaKey))switch(F.code){case"Space":(this.mouseX||this.mouseY)&&(F.preventDefault(),this.missileClick(this.mouseX,this.mouseY)),this.shownStatScreen&&(this.level++,this.restart(null,!1));break;case"KeyR":this.hasQuickReset=!0,this.restart(null,!1);break;case"KeyP":this.gameOver||this.setPause()}};handleGameOver=({won:F})=>{if(this.handledGameOver)return;if(this.handledGameOver=!0,this.gameoverTickerX=0,this.gameOver=!0,this.won=F,0!==this.level&&!this.won){let F=this.bodies.slice(1).filter(F=>0n!==F.radius).length,A=this.generateLevelData(this.day,6-F).slice(1);this.bodies.push(...A.map(F=>this.bodyDataToBodies.call(this,F)).map(F=>(F.position.x=0,F.position.y=0,F.py=0n,F.px=0n,F)))}this.P5_FPS*=2,this.p.frameRate(this.P5_FPS);var A=0;let t=this.calculateStats();A=t.timeTook,this.framesTook=t.framesTook,this.emit("done",{level:this.level,won:F,ticks:this.frames-this.startingFrame,timeTook:A,framesTook:this.framesTook}),F&&(this.bodyData=null,this.finish())};restart=(F,A=!0)=>{F&&this.setOptions(F),this.level,this.lastLevel,this.clearValues(),this.sound?.stop(),this.sound?.playStart(),this.sound?.setSong(),this.init(),this.draw(),A&&this.setPause(!0),this.addCSS()};doubleTextInverted(F){return F.slice(0,-1)+F.split("").reverse().join("")}setPause(F=!this.paused,A=!1){"boolean"!=typeof F&&(F=!this.paused),F?(this.pauseBodies=Ia.map(F=>this.bodyDataToBodies.call(this,F)),this.pauseBodies[1].c=this.getBodyColor(this.day+1,0),this.pauseBodies[2].c=this.getBodyColor(this.day+2,0),this.paused=F,this.willUnpause=!1,delete this.beganUnpauseAt):(this.justPaused=!0,this.willUnpause=!0),this.emit("paused",F),F?A||this.sound?.pause():A||this.sound?.resume()}step(){0==this.missiles.length&&this.lastMissileCantBeUndone&&(console.log("LASTMISSILECANTBEUNDONE = FALSE"),this.lastMissileCantBeUndone=!1),this.bodies=this.forceAccumulator(this.bodies);var F=this.detectCollision(this.bodies,this.missiles);if(this.bodies=F.bodies,this.missiles=F.missiles||[],this.missiles.length>0){let F=JSON.parse(JSON.stringify(this.missiles[0]));this.stillVisibleMissiles.push(F)}if(this.missiles.length>0&&0==this.missiles[0].radius)this.missiles.splice(0,1);else if(this.missiles.length>1&&0!==this.missiles[0].radius){let F=this.missiles.splice(0,1);this.missiles.splice(0,1,F[0])}return{bodies:this.bodies,missiles:this.missiles}}started(){this.emit("started",{day:this.day,level:this.level,bodyInits:JSON.parse(JSON.stringify(this.bodyInits))})}processMissileInits(F){return F.map(F=>({step:F.step,x:this.convertFloatToScaledBigInt(F.position.x).toString(),y:this.convertFloatToScaledBigInt(F.position.y).toString(),vx:this.convertFloatToScaledBigInt(F.velocity.x).toString(),vy:this.convertFloatToScaledBigInt(F.velocity.y).toString(),radius:"10"}))}finish(){if(this.finalBatchSent)return;this.calculateBodyFinal();let F=[];if("game"==this.mode){let A=0;for(let t=this.alreadyRun;t(F.step=this.frames,F)),this.emit("chunk",o),this.bodyFinal=[],"game"==this.mode&&0==this.bodies.slice(0==this.level?0:1).reduce((F,A)=>F+A.radius,0)&&(this.finalBatchSent=!0),this.missiles.length>0&&(console.log("LASTMISSILECANTBEUNDONE = TRUE"),this.lastMissileCantBeUndone=!0),0!==B&&(this.levelSpeeds[B-1]=o),o}generateLevelData(F,A){let t=[];for(let e=0;e<=A;e++){let i=q7.solidityKeccak256(["uint256","uint256","uint256"],[F,A,e]);t.push(this.getRandomValues(i,e,A))}return t}getRandomValues(F,A,t=this.level){let e=this.convertFloatToScaledBigInt(this.vectorLimit),i={};if(i.bodyIndex=A,i.seed=F,i.radius=this.genRadius(A,t),0==t)return i.px=parseInt(BigInt(this.windowWidth)*this.scalingFactor/2n),i.py=parseInt(BigInt(this.windowWidth)*this.scalingFactor/2n),i.vx=parseInt(e)-5e3,i.vy=parseInt(e),i;let B=q7.solidityKeccak256(["bytes32"],[F]);return i.px=this.randomRange(0,BigInt(this.windowWidth)*this.scalingFactor,B),B=q7.solidityKeccak256(["bytes32"],[B]),i.py=this.randomRange(0,BigInt(this.windowWidth)*this.scalingFactor,B),B=q7.solidityKeccak256(["bytes32"],[B]),i.vx=this.randomRange(e/2n,3n*e/2n,B),B=q7.solidityKeccak256(["bytes32"],[B]),i.vy=this.randomRange(e/2n,3n*e/2n,B),i}genRadius(F,A=this.level){let t=[36n,27n,23n,19n,15n,11n];return parseInt((0==A?27n:t[F%t.length])*BigInt(this.scalingFactor))}randomRange(F,A,t){if(F==A)return F;if(F="bigint"==typeof F?F:BigInt(F),A="bigint"==typeof A?A:BigInt(A),t="bigint"==typeof t?t:BigInt(t),!(F>A))return parseInt(t%(A-F)+F);{let e=t%(359n-(F-A));return ethis.bodyDataToBodies.call(this,F)),this.startingBodies=this.bodies.length}bodyDataToBodies(F,A=this.day){let t=F.bodyIndex,e=F.px/parseInt(this.scalingFactor),i=F.py/parseInt(this.scalingFactor),B=(F.vx-this.vectorLimit*parseInt(this.scalingFactor))/parseInt(this.scalingFactor),s=(F.vy-this.vectorLimit*parseInt(this.scalingFactor))/parseInt(this.scalingFactor),n=F.radius/parseInt(this.scalingFactor);return{seed:F.seed,bodyIndex:t,position:this.createVector(e,i),velocity:this.createVector(B,s),radius:n,c:this.getBodyColor(A,t)}}getBodyColor(F,A=0){let t=q7.solidityKeccak256(["uint256","uint256"],[F,A]),e=this.randomRange(0,359,t);t=q7.solidityKeccak256(["bytes32"],[t]);let i=this.randomRange(90,100,t);t=q7.solidityKeccak256(["bytes32"],[t]);let B=this.randomRange(55,60,t),s=Object.keys(Vk),n=s.length,r=q7.solidityKeccak256(["uint256","uint256"],[F,19]),o=this.randomRange(0,13,r);r=q7.solidityKeccak256(["bytes32"],[r]);let a=this.randomRange(0,9,r);r=q7.solidityKeccak256(["bytes32"],[r]);let h=this.randomRange(0,9,r);r=q7.solidityKeccak256(["bytes32"],[r]);let V=this.randomRange(0,0,r);r=q7.solidityKeccak256(["bytes32"],[r]);let q=Vk[s[this.randomRange(0,n-1,r)]];r=q7.solidityKeccak256(["bytes32"],[r]);let l=q.bg[0]?q.bg[0].split("-"):[0,359],c=this.randomRange(l[0],l[1],r);r=q7.solidityKeccak256(["bytes32"],[r]);let u=q.bg[1].split("-"),m=this.randomRange(u[0],u[1],r);r=q7.solidityKeccak256(["bytes32"],[r]);let M=q.bg[2].split("-"),I=this.randomRange(M[0],M[1],r);r=q7.solidityKeccak256(["bytes32"],[r]);let p=q.bg[0]?q.cr[0].split("-"):[0,359],g=this.randomRange(p[0],p[1],r);r=q7.solidityKeccak256(["bytes32"],[r]);let E=q.cr[1].split("-"),C=this.randomRange(E[0],E[1],r);r=q7.solidityKeccak256(["bytes32"],[r]);let d=q.cr[2].split("-"),y=this.randomRange(d[0],d[1],r);r=q7.solidityKeccak256(["bytes32"],[r]);let S=q.bg[0]?q.fg[0].split("-"):[0,359],Q=this.randomRange(S[0],S[1],r);r=q7.solidityKeccak256(["bytes32"],[r]);let w=q.fg[1].split("-"),U=this.randomRange(w[0],w[1],r);r=q7.solidityKeccak256(["bytes32"],[r]);let f=q.fg[2].split("-"),k=this.randomRange(f[0],f[1],r);return{fIndex:o,bgIndex:a,fgIndex:h,coreIndex:V,bg:`hsl(${c},${m}%,${I}%`,core:`hsl(${g},${C}%,${y}%`,fg:`hsl(${Q},${U}%,${k}%`,baddie:[e,i,B]}}setPixelDensity(F){this.p.pixelDensity(F)}prepareP5(){this.p.frameRate(this.P5_FPS),this.p.createCanvas(this.windowWidth,this.windowWidth),this.setPixelDensity(this.pixelDensity),this.p.background("white"),this.canvasRect=this.p.canvas.getBoundingClientRect(),this.resizeObserver=new ResizeObserver(()=>{this.canvasRect=this.p.canvas.getBoundingClientRect()}),this.resizeObserver.observe(this.p.canvas)}missileClick(F,A){if(this.gameOver||this.paused||0==this.bodies.reduce((F,A)=>F+A.radius,0)||this.frames-this.startingFrame>=this.timer)return;this.missiles.length>0&&(this.lastMissileCantBeUndone&&(this.emit("remove-last-missile"),this.lastMissileCantBeUndone=!1,console.log("LASTMISSILECANTBEUNDONE = FALSE")),this.missileInits.pop(),this.missileCount--),this.missileCount++;let t={step:this.frames,position:this.p.createVector(0,this.windowWidth),velocity:this.p.createVector(F,A-this.windowWidth),radius:10};t.velocity.limit(this.missileSpeed*this.speedFactor),this.missiles.push(t),this.missiles=this.missiles.slice(-1);let e=F**2+(A-this.windowWidth)**2;this.sound?.playMissile(e),this.missileInits.push(...this.processMissileInits([t])),this.makeMissileStart()}calculateStats=()=>{let F=this.bodies.length,{startingFrame:A,frames:t}=this,e=t-A-1,i=e/this.FPS;return{missilesShot:this.missileInits.reduce((F,A)=>0==A[0]?F:F+1,0),bodiesIncluded:F,timeTook:i,framesTook:e}};handleSave=()=>{"unsaved"==this.saveStatus?(this.saveStatus="validating",setTimeout(()=>{this.saveStatus="validated"},2e3)):"validated"==this.saveStatus&&(this.saveStatus="saving",setTimeout(()=>{this.saveStatus="saved"},2e3))}}"undefined"!=typeof window&&(window.Anybody=IV),BigInt.prototype.toJSON=function(){return this.toString()},Az=function(F){var A,t,e=function(F){var A=F.length;if(A%4>0)throw Error("Invalid string. Length must be a multiple of 4");var t=F.indexOf("=");-1===t&&(t=A);var e=t===A?0:4-t%4;return[t,e]}(F),i=e[0],B=e[1],s=new Ic((i+B)*3/4-B),n=0,r=B>0?i-4:i;for(t=0;t>16&255,s[n++]=A>>8&255,s[n++]=255&A;return 2===B&&(A=Il[F.charCodeAt(t)]<<2|Il[F.charCodeAt(t+1)]>>4,s[n++]=255&A),1===B&&(A=Il[F.charCodeAt(t)]<<10|Il[F.charCodeAt(t+1)]<<4|Il[F.charCodeAt(t+2)]>>2,s[n++]=A>>8&255,s[n++]=255&A),s},AG=function(F){for(var A,t=F.length,e=t%3,i=[],B=0,s=t-e;B>18&63]+Iq[e>>12&63]+Iq[e>>6&63]+Iq[63&e]);return i.join("")}(F,B,B+16383>s?s:B+16383));return 1===e?i.push(Iq[(A=F[t-1])>>2]+Iq[A<<4&63]+"=="):2===e&&i.push(Iq[(A=(F[t-2]<<8)+F[t-1])>>10]+Iq[A>>4&63]+Iq[A<<2&63]+"="),i.join("")};for(var Iq=[],Il=[],Ic="undefined"!=typeof Uint8Array?Uint8Array:Array,Iu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Im=0,IM=Iu.length;Im>1,a=-7,h=t?i-1:0,V=t?-1:1,q=F[A+h];for(h+=V,B=q&(1<<-a)-1,q>>=-a,a+=n;a>0;B=256*B+F[A+h],h+=V,a-=8);for(s=B&(1<<-a)-1,B>>=-a,a+=e;a>0;s=256*s+F[A+h],h+=V,a-=8);if(0===B)B=1-o;else{if(B===r)return s?NaN:1/0*(q?-1:1);s+=Math.pow(2,e),B-=o}return(q?-1:1)*s*Math.pow(2,B-e)},Av=function(F,A,t,e,i,B){var s,n,r,o=8*B-i-1,a=(1<>1,V=23===i?5960464477539062e-23:0,q=e?0:B-1,l=e?1:-1,c=A<0||0===A&&1/A<0?1:0;for(isNaN(A=Math.abs(A))||A===1/0?(n=isNaN(A)?1:0,s=a):(s=Math.floor(Math.log(A)/Math.LN2),A*(r=Math.pow(2,-s))<1&&(s--,r*=2),s+h>=1?A+=V/r:A+=V*Math.pow(2,1-h),A*r>=2&&(s++,r/=2),s+h>=a?(n=0,s=a):s+h>=1?(n=(A*r-1)*Math.pow(2,i),s+=h):(n=A*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;F[t+q]=255&n,q+=l,n/=256,i-=8);for(s=s<0;F[t+q]=255&s,q+=l,s/=256,o-=8);F[t+q-l]|=128*c};var II="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function Ip(F){if(F>2147483647)throw RangeError('The value "'+F+'" is invalid for option "size"');var A=new Uint8Array(F);return Object.setPrototypeOf(A,Ig.prototype),A}function Ig(F,A,t){if("number"==typeof F){if("string"==typeof A)throw TypeError('The "string" argument must be of type string. Received type number');return Id(F)}return IE(F,A,t)}function IE(F,A,t){if("string"==typeof F)return function(F,A){if(("string"!=typeof A||""===A)&&(A="utf8"),!Ig.isEncoding(A))throw TypeError("Unknown encoding: "+A);var t=0|Iw(F,A),e=Ip(t),i=e.write(F,A);return i!==t&&(e=e.slice(0,i)),e}(F,A);if(ArrayBuffer.isView(F))return function(F){if(Ix(F,Uint8Array)){var A=new Uint8Array(F);return IS(A.buffer,A.byteOffset,A.byteLength)}return Iy(F)}(F);if(null==F)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F);if(Ix(F,ArrayBuffer)||F&&Ix(F.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(Ix(F,SharedArrayBuffer)||F&&Ix(F.buffer,SharedArrayBuffer)))return IS(F,A,t);if("number"==typeof F)throw TypeError('The "value" argument must not be of type number. Received type number');var e=F.valueOf&&F.valueOf();if(null!=e&&e!==F)return Ig.from(e,A,t);var i=function(F){if(Ig.isBuffer(F)){var A,t=0|IQ(F.length),e=Ip(t);return 0===e.length||F.copy(e,0,0,t),e}return void 0!==F.length?"number"!=typeof F.length||(A=F.length)!=A?Ip(0):Iy(F):"Buffer"===F.type&&Array.isArray(F.data)?Iy(F.data):void 0}(F);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof F[Symbol.toPrimitive])return Ig.from(F[Symbol.toPrimitive]("string"),A,t);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F)}function IC(F){if("number"!=typeof F)throw TypeError('"size" argument must be of type number');if(F<0)throw RangeError('The value "'+F+'" is invalid for option "size"')}function Id(F){return IC(F),Ip(F<0?0:0|IQ(F))}function Iy(F){for(var A=F.length<0?0:0|IQ(F.length),t=Ip(A),e=0;e=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|F}function Iw(F,A){if(Ig.isBuffer(F))return F.length;if(ArrayBuffer.isView(F)||Ix(F,ArrayBuffer))return F.byteLength;if("string"!=typeof F)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof F);var t=F.length,e=arguments.length>2&&!0===arguments[2];if(!e&&0===t)return 0;for(var i=!1;;)switch(A){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return IY(F).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return IK(F).length;default:if(i)return e?-1:IY(F).length;A=(""+A).toLowerCase(),i=!0}}function IU(F,A,t){var e,i,B=!1;if((void 0===A||A<0)&&(A=0),A>this.length||((void 0===t||t>this.length)&&(t=this.length),t<=0||(t>>>=0)<=(A>>>=0)))return"";for(F||(F="utf8");;)switch(F){case"hex":return function(F,A,t){var e=F.length;(!A||A<0)&&(A=0),(!t||t<0||t>e)&&(t=e);for(var i="",B=A;B2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),(B=t=+t)!=B&&(t=i?0:F.length-1),t<0&&(t=F.length+t),t>=F.length){if(i)return -1;t=F.length-1}else if(t<0){if(!i)return -1;t=0}if("string"==typeof A&&(A=Ig.from(A,e)),Ig.isBuffer(A))return 0===A.length?-1:IT(F,A,t,e,i);if("number"==typeof A)return(A&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(F,A,t):Uint8Array.prototype.lastIndexOf.call(F,A,t):IT(F,[A],t,e,i);throw TypeError("val must be string, number or Buffer")}function IT(F,A,t,e,i){var B,s=1,n=F.length,r=A.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(F.length<2||A.length<2)return -1;s=2,n/=2,r/=2,t/=2}function o(F,A){return 1===s?F[A]:F.readUInt16BE(A*s)}if(i){var a=-1;for(B=t;Bn&&(t=n-r),B=t;B>=0;B--){for(var h=!0,V=0;V239?4:o>223?3:o>191?2:1;if(i+h<=t)switch(h){case 1:o<128&&(a=o);break;case 2:(192&(B=F[i+1]))==128&&(r=(31&o)<<6|63&B)>127&&(a=r);break;case 3:B=F[i+1],s=F[i+2],(192&B)==128&&(192&s)==128&&(r=(15&o)<<12|(63&B)<<6|63&s)>2047&&(r<55296||r>57343)&&(a=r);break;case 4:B=F[i+1],s=F[i+2],n=F[i+3],(192&B)==128&&(192&s)==128&&(192&n)==128&&(r=(15&o)<<18|(63&B)<<12|(63&s)<<6|63&n)>65535&&r<1114112&&(a=r)}null===a?(a=65533,h=1):a>65535&&(a-=65536,e.push(a>>>10&1023|55296),a=56320|1023&a),e.push(a),i+=h}return function(F){var A=F.length;if(A<=4096)return String.fromCharCode.apply(String,F);for(var t="",e=0;et)throw RangeError("Trying to access beyond buffer length")}function IR(F,A,t,e,i,B){if(!Ig.isBuffer(F))throw TypeError('"buffer" argument must be a Buffer instance');if(A>i||AF.length)throw RangeError("Index out of range")}function Iz(F,A,t,e,i,B){if(t+e>F.length||t<0)throw RangeError("Index out of range")}function IG(F,A,t,e,i){return A=+A,t>>>=0,i||Iz(F,A,t,4,34028234663852886e22,-34028234663852886e22),Av(F,A,t,e,23,4),t+4}function IL(F,A,t,e,i){return A=+A,t>>>=0,i||Iz(F,A,t,8,17976931348623157e292,-17976931348623157e292),Av(F,A,t,e,52,8),t+8}Ig.TYPED_ARRAY_SUPPORT=function(){try{var F=new Uint8Array(1),A={foo:function(){return 42}};return Object.setPrototypeOf(A,Uint8Array.prototype),Object.setPrototypeOf(F,A),42===F.foo()}catch(F){return!1}}(),Ig.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Ig.prototype,"parent",{enumerable:!0,get:function(){if(Ig.isBuffer(this))return this.buffer}}),Object.defineProperty(Ig.prototype,"offset",{enumerable:!0,get:function(){if(Ig.isBuffer(this))return this.byteOffset}}),Ig.poolSize=8192,Ig.from=function(F,A,t){return IE(F,A,t)},Object.setPrototypeOf(Ig.prototype,Uint8Array.prototype),Object.setPrototypeOf(Ig,Uint8Array),Ig.alloc=function(F,A,t){return(IC(F),F<=0)?Ip(F):void 0!==A?"string"==typeof t?Ip(F).fill(A,t):Ip(F).fill(A):Ip(F)},Ig.allocUnsafe=function(F){return Id(F)},Ig.allocUnsafeSlow=function(F){return Id(F)},Ig.isBuffer=function(F){return null!=F&&!0===F._isBuffer&&F!==Ig.prototype},Ig.compare=function(F,A){if(Ix(F,Uint8Array)&&(F=Ig.from(F,F.offset,F.byteLength)),Ix(A,Uint8Array)&&(A=Ig.from(A,A.offset,A.byteLength)),!Ig.isBuffer(F)||!Ig.isBuffer(A))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(F===A)return 0;for(var t=F.length,e=A.length,i=0,B=Math.min(t,e);ie.length?Ig.from(B).copy(e,i):Uint8Array.prototype.set.call(e,B,i);else if(Ig.isBuffer(B))B.copy(e,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=B.length}return e},Ig.byteLength=Iw,Ig.prototype._isBuffer=!0,Ig.prototype.swap16=function(){var F=this.length;if(F%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var A=0;A50&&(F+=" ... "),""},II&&(Ig.prototype[II]=Ig.prototype.inspect),Ig.prototype.compare=function(F,A,t,e,i){if(Ix(F,Uint8Array)&&(F=Ig.from(F,F.offset,F.byteLength)),!Ig.isBuffer(F))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof F);if(void 0===A&&(A=0),void 0===t&&(t=F?F.length:0),void 0===e&&(e=0),void 0===i&&(i=this.length),A<0||t>F.length||e<0||i>this.length)throw RangeError("out of range index");if(e>=i&&A>=t)return 0;if(e>=i)return -1;if(A>=t)return 1;if(A>>>=0,t>>>=0,e>>>=0,i>>>=0,this===F)return 0;for(var B=i-e,s=t-A,n=Math.min(B,s),r=this.slice(e,i),o=F.slice(A,t),a=0;a>>=0,isFinite(t)?(t>>>=0,void 0===e&&(e="utf8")):(e=t,t=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,B,s,n,r,o,a,h,V=this.length-A;if((void 0===t||t>V)&&(t=V),F.length>0&&(t<0||A<0)||A>this.length)throw RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var q=!1;;)switch(e){case"hex":return function(F,A,t,e){t=Number(t)||0;var i=F.length-t;e?(e=Number(e))>i&&(e=i):e=i;var B=A.length;e>B/2&&(e=B/2);for(var s=0;s>8,i.push(t%256),i.push(e);return i}(F,this.length-a),this,a,h);default:if(q)throw TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),q=!0}},Ig.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Ig.prototype.slice=function(F,A){var t=this.length;F=~~F,A=void 0===A?t:~~A,F<0?(F+=t)<0&&(F=0):F>t&&(F=t),A<0?(A+=t)<0&&(A=0):A>t&&(A=t),A>>=0,A>>>=0,t||IZ(F,A,this.length);for(var e=this[F],i=1,B=0;++B>>=0,A>>>=0,t||IZ(F,A,this.length);for(var e=this[F+--A],i=1;A>0&&(i*=256);)e+=this[F+--A]*i;return e},Ig.prototype.readUint8=Ig.prototype.readUInt8=function(F,A){return F>>>=0,A||IZ(F,1,this.length),this[F]},Ig.prototype.readUint16LE=Ig.prototype.readUInt16LE=function(F,A){return F>>>=0,A||IZ(F,2,this.length),this[F]|this[F+1]<<8},Ig.prototype.readUint16BE=Ig.prototype.readUInt16BE=function(F,A){return F>>>=0,A||IZ(F,2,this.length),this[F]<<8|this[F+1]},Ig.prototype.readUint32LE=Ig.prototype.readUInt32LE=function(F,A){return F>>>=0,A||IZ(F,4,this.length),(this[F]|this[F+1]<<8|this[F+2]<<16)+16777216*this[F+3]},Ig.prototype.readUint32BE=Ig.prototype.readUInt32BE=function(F,A){return F>>>=0,A||IZ(F,4,this.length),16777216*this[F]+(this[F+1]<<16|this[F+2]<<8|this[F+3])},Ig.prototype.readIntLE=function(F,A,t){F>>>=0,A>>>=0,t||IZ(F,A,this.length);for(var e=this[F],i=1,B=0;++B=(i*=128)&&(e-=Math.pow(2,8*A)),e},Ig.prototype.readIntBE=function(F,A,t){F>>>=0,A>>>=0,t||IZ(F,A,this.length);for(var e=A,i=1,B=this[F+--e];e>0&&(i*=256);)B+=this[F+--e]*i;return B>=(i*=128)&&(B-=Math.pow(2,8*A)),B},Ig.prototype.readInt8=function(F,A){return(F>>>=0,A||IZ(F,1,this.length),128&this[F])?-((255-this[F]+1)*1):this[F]},Ig.prototype.readInt16LE=function(F,A){F>>>=0,A||IZ(F,2,this.length);var t=this[F]|this[F+1]<<8;return 32768&t?4294901760|t:t},Ig.prototype.readInt16BE=function(F,A){F>>>=0,A||IZ(F,2,this.length);var t=this[F+1]|this[F]<<8;return 32768&t?4294901760|t:t},Ig.prototype.readInt32LE=function(F,A){return F>>>=0,A||IZ(F,4,this.length),this[F]|this[F+1]<<8|this[F+2]<<16|this[F+3]<<24},Ig.prototype.readInt32BE=function(F,A){return F>>>=0,A||IZ(F,4,this.length),this[F]<<24|this[F+1]<<16|this[F+2]<<8|this[F+3]},Ig.prototype.readFloatLE=function(F,A){return F>>>=0,A||IZ(F,4,this.length),AL(this,F,!0,23,4)},Ig.prototype.readFloatBE=function(F,A){return F>>>=0,A||IZ(F,4,this.length),AL(this,F,!1,23,4)},Ig.prototype.readDoubleLE=function(F,A){return F>>>=0,A||IZ(F,8,this.length),AL(this,F,!0,52,8)},Ig.prototype.readDoubleBE=function(F,A){return F>>>=0,A||IZ(F,8,this.length),AL(this,F,!1,52,8)},Ig.prototype.writeUintLE=Ig.prototype.writeUIntLE=function(F,A,t,e){if(F=+F,A>>>=0,t>>>=0,!e){var i=Math.pow(2,8*t)-1;IR(this,F,A,t,i,0)}var B=1,s=0;for(this[A]=255&F;++s>>=0,t>>>=0,!e){var i=Math.pow(2,8*t)-1;IR(this,F,A,t,i,0)}var B=t-1,s=1;for(this[A+B]=255&F;--B>=0&&(s*=256);)this[A+B]=F/s&255;return A+t},Ig.prototype.writeUint8=Ig.prototype.writeUInt8=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,1,255,0),this[A]=255&F,A+1},Ig.prototype.writeUint16LE=Ig.prototype.writeUInt16LE=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,2,65535,0),this[A]=255&F,this[A+1]=F>>>8,A+2},Ig.prototype.writeUint16BE=Ig.prototype.writeUInt16BE=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,2,65535,0),this[A]=F>>>8,this[A+1]=255&F,A+2},Ig.prototype.writeUint32LE=Ig.prototype.writeUInt32LE=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,4,4294967295,0),this[A+3]=F>>>24,this[A+2]=F>>>16,this[A+1]=F>>>8,this[A]=255&F,A+4},Ig.prototype.writeUint32BE=Ig.prototype.writeUInt32BE=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,4,4294967295,0),this[A]=F>>>24,this[A+1]=F>>>16,this[A+2]=F>>>8,this[A+3]=255&F,A+4},Ig.prototype.writeIntLE=function(F,A,t,e){if(F=+F,A>>>=0,!e){var i=Math.pow(2,8*t-1);IR(this,F,A,t,i-1,-i)}var B=0,s=1,n=0;for(this[A]=255&F;++B>0)-n&255;return A+t},Ig.prototype.writeIntBE=function(F,A,t,e){if(F=+F,A>>>=0,!e){var i=Math.pow(2,8*t-1);IR(this,F,A,t,i-1,-i)}var B=t-1,s=1,n=0;for(this[A+B]=255&F;--B>=0&&(s*=256);)F<0&&0===n&&0!==this[A+B+1]&&(n=1),this[A+B]=(F/s>>0)-n&255;return A+t},Ig.prototype.writeInt8=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,1,127,-128),F<0&&(F=255+F+1),this[A]=255&F,A+1},Ig.prototype.writeInt16LE=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,2,32767,-32768),this[A]=255&F,this[A+1]=F>>>8,A+2},Ig.prototype.writeInt16BE=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,2,32767,-32768),this[A]=F>>>8,this[A+1]=255&F,A+2},Ig.prototype.writeInt32LE=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,4,2147483647,-2147483648),this[A]=255&F,this[A+1]=F>>>8,this[A+2]=F>>>16,this[A+3]=F>>>24,A+4},Ig.prototype.writeInt32BE=function(F,A,t){return F=+F,A>>>=0,t||IR(this,F,A,4,2147483647,-2147483648),F<0&&(F=4294967295+F+1),this[A]=F>>>24,this[A+1]=F>>>16,this[A+2]=F>>>8,this[A+3]=255&F,A+4},Ig.prototype.writeFloatLE=function(F,A,t){return IG(this,F,A,!0,t)},Ig.prototype.writeFloatBE=function(F,A,t){return IG(this,F,A,!1,t)},Ig.prototype.writeDoubleLE=function(F,A,t){return IL(this,F,A,!0,t)},Ig.prototype.writeDoubleBE=function(F,A,t){return IL(this,F,A,!1,t)},Ig.prototype.copy=function(F,A,t,e){if(!Ig.isBuffer(F))throw TypeError("argument should be a Buffer");if(t||(t=0),e||0===e||(e=this.length),A>=F.length&&(A=F.length),A||(A=0),e>0&&e=this.length)throw RangeError("Index out of range");if(e<0)throw RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),F.length-A>>=0,t=void 0===t?this.length:t>>>0,F||(F=0),"number"==typeof F)for(i=A;i55295&&t<57344){if(!i){if(t>56319||s+1===e){(A-=3)>-1&&B.push(239,191,189);continue}i=t;continue}if(t<56320){(A-=3)>-1&&B.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(A-=3)>-1&&B.push(239,191,189);if(i=null,t<128){if((A-=1)<0)break;B.push(t)}else if(t<2048){if((A-=2)<0)break;B.push(t>>6|192,63&t|128)}else if(t<65536){if((A-=3)<0)break;B.push(t>>12|224,t>>6&63|128,63&t|128)}else if(t<1114112){if((A-=4)<0)break;B.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}else throw Error("Invalid code point")}return B}function IK(F){return Az(function(F){if((F=(F=F.split("=")[0]).trim().replace(Iv,"")).length<2)return"";for(;F.length%4!=0;)F+="=";return F}(F))}function IN(F,A,t,e){for(var i=0;i=A.length)&&!(i>=F.length);++i)A[i+t]=F[i];return i}function Ix(F,A){return F instanceof A||null!=F&&null!=F.constructor&&null!=F.constructor.name&&F.constructor.name===A.name}var IJ=function(){for(var F="0123456789abcdef",A=Array(256),t=0;t<16;++t)for(var e=16*t,i=0;i<16;++i)A[e+i]=F[t]+F[i];return A}();let IO=new function(F,A){return new function F(t){let e="global"==t?window:this;e.canvas=document.createElement("canvas");let i=e.canvas.getContext("2d");e.width=100,e.height=100,e.canvas.width=e.width,e.canvas.height=e.height,"offscreen"!=t&&(A?A.appendChild(e.canvas):document.body?document.body.appendChild(e.canvas):window.addEventListener("load",function(){document.body.appendChild(e.canvas)})),M(),e.MAGIC=161533525,e.RGB=0,e.HSV=1,e.HSB=1,e.CHORD=0,e.PIE=1,e.OPEN=2,e.RADIUS=1,e.CORNER=2,e.CORNERS=3,e.ROUND="round",e.SQUARE="butt",e.PROJECT="square",e.MITER="miter",e.BEVEL="bevel",e.CLOSE=1,e.BLEND="source-over",e.REMOVE="destination-out",e.ADD="lighter",e.DARKEST="darken",e.LIGHTEST="lighten",e.DIFFERENCE="difference",e.SUBTRACT="subtract",e.EXCLUSION="exclusion",e.MULTIPLY="multiply",e.SCREEN="screen",e.REPLACE="copy",e.OVERLAY="overlay",e.HARD_LIGHT="hard-light",e.SOFT_LIGHT="soft-light",e.DODGE="color-dodge",e.BURN="color-burn",e.NORMAL="normal",e.ITALIC="italic",e.BOLD="bold",e.BOLDITALIC="italic bold",e.CENTER="center",e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e.BASELINE="alphabetic",e.LANDSCAPE="landscape",e.PORTRAIT="portrait",e.ALT=18,e.BACKSPACE=8,e.CONTROL=17,e.DELETE=46,e.DOWN_ARROW=40,e.ENTER=13,e.ESCAPE=27,e.LEFT_ARROW=37,e.OPTION=18,e.RETURN=13,e.RIGHT_ARROW=39,e.SHIFT=16,e.TAB=9,e.UP_ARROW=38,e.HALF_PI=Math.PI/2,e.PI=Math.PI,e.QUARTER_PI=Math.PI/4,e.TAU=2*Math.PI,e.TWO_PI=2*Math.PI,e.THRESHOLD=1,e.GRAY=2,e.OPAQUE=3,e.INVERT=4,e.POSTERIZE=5,e.DILATE=6,e.ERODE=7,e.BLUR=8,e.ARROW="default",e.CROSS="crosshair",e.HAND="pointer",e.MOVE="move",e.TEXT="text",e.VIDEO={video:!0,audio:!1},e.AUDIO={video:!1,audio:!0},e.SHR3=1,e.LCG=2,e.HARDWARE_FILTERS=!0,e.hint=function(F,A){e[F]=A},e.frameCount=0,e.mouseX=0,e.mouseY=0,e.pmouseX=0,e.pmouseY=0,e.mouseButton=null,e.keyIsPressed=!1,e.mouseIsPressed=!1,e.key=null,e.keyCode=null,e.pixels=null,e.accelerationX=0,e.accelerationY=0,e.accelerationZ=0,e.rotationX=0,e.rotationY=0,e.rotationZ=0,e.relRotationX=0,e.relRotationY=0,e.relRotationZ=0,e.pAccelerationX=0,e.pAccelerationY=0,e.pAccelerationZ=0,e.pRotationX=0,e.pRotationY=0,e.pRotationZ=0,e.pRelRotationX=0,e.pRelRotationY=0,e.pRelRotationZ=0,e.touches=[],e._styleCache=[{colorMode:e.RGB,noStroke:!1,noFill:!1,ellipseMode:e.CENTER,rectMode:e.CORNER,curveDetail:20,curveAlpha:0,textFont:"sans-serif",textSize:12,textLeading:12,textStyle:"normal"}],e._style=e._styleCache[e._styleCache.length-1],e._noLoop=!1,e._pixelDensity=1,e._frameRate=null,e._tint=null;let B=null,s=!0,n=[],r=null,o=0,a={},h=0,V=0,q=0,l=null,c=null,u=null;for(let A of(Object.defineProperty(e,"deviceOrientation",{get:function(){return 90==Math.abs(window.orientation)?e.LANDSCAPE:e.PORTRAIT}}),Object.defineProperty(e,"windowWidth",{get:function(){return window.innerWidth}}),Object.defineProperty(e,"windowHeight",{get:function(){return window.innerHeight}}),Object.defineProperty(e,"drawingContext",{get:function(){return i}}),e.createCanvas=function(F,A){return e.width=F,e.height=A,e.canvas.width=F,e.canvas.height=A,M(),e.canvas},e.resizeCanvas=function(F,A){e.width=F,e.height=A,e.canvas.width=F,e.canvas.height=A},e.createGraphics=e.createImage=function(A,t){let e=new F("offscreen");return e.createCanvas(A,t),e.noLoop(),e},e.pixelDensity=function(F){return void 0==F||(e._pixelDensity=F,e.canvas.width=Math.ceil(e.width*F),e.canvas.height=Math.ceil(e.height*F),e.canvas.style.width=e.width+"px",e.canvas.style.height=e.height+"px",i.scale(e._pixelDensity,e._pixelDensity),M()),e._pixelDensity},e.map=function(F,A,t,e,i,B){let s=e+(F-A)*1/(t-A)*(i-e);return B?eF){let t=F/A;i.x*=t,i.y*=t,i.z*=t,B=F,s=F*F}return i},i.setMag=function(F){r();let A=F/B;return i.x*=A,i.y*=A,i.z*=A,B=F,s=F*F,i},i.heading=function(){return Math.atan2(i.y,i.x)},i.rotate=function(F){let A=Math.cos(F),t=Math.sin(F),e=i.x*A-i.y*t,B=i.x*t+i.y*A;return i.x=e,i.y=B,i},i.angleBetween=function(){let F=n.apply(null,arguments);return Math.acos(Math.min(1,Math.max(-1,i.dot(F)/(i.mag()*F.mag()))))*Math.sign(i.cross(F).z||1)},i.lerp=function(F,A){return i.x=i.x*(1-A)+F.x*A,i.y=i.y*(1-A)+F.y*A,i.z=i.z*(1-A)+F.z*A,o(),i},i.reflect=function(F){return F.normalize(),i.sub(F.mult(2*i.dot(F)))},i.array=function(){return[i.x,i.y,i.z]},i.equals=function(F,A){return void 0==A&&void 0==(A=Number.EPSILON)&&(A=0),Math.abs(F.x-i.x)360&&(s=0),s/=60,n=~~s,r=s-n,o=t*(1-A),a=t*(1-A*r),h=t*(1-A*(1-r)),n){case 0:e=t,i=h,B=o;break;case 1:e=a,i=t,B=o;break;case 2:e=o,i=t,B=h;break;case 3:e=o,i=a,B=t;break;case 4:e=h,i=o,B=t;break;default:e=t,i=o,B=a}return[255*e,255*i,255*B]}function M(){i.fillStyle="white",i.strokeStyle="black",i.lineCap="round",i.lineJoin="miter"}function I(F){if(0<=F&&F<2*Math.PI)return F;for(;F<0;)F+=2*Math.PI;for(;F>=Math.PI;)F-=2*Math.PI;return F}function p(F,A,t,B,s,n,r,o){if(e._style.noFill&&e._style.noStroke)return;let a=I(s),h=I(n);i.beginPath();for(let s=0;sA?F>t?F:t:A>t?A:t)/255))?[0,s=0,n]:0==(s=100*(B-e)/B)?[0,s,n]:[B==F?0+60*(A-t)/(B-e):B==A?120+60*(t-F)/(B-e):240+60*(F-A)/(B-e),s,n]),i._hsvInferred=!0}},i.toString=function(){return`rgba(${Math.round(i._r)},${Math.round(i._g)},${Math.round(i._b)},${~~(1e3*i._a)/1e3})`}},e.colorMode=function(F){e._style.colorMode=F},e.color=function(){if(1==arguments.length&&786698==arguments[0].MAGIC)return arguments[0];if(e._style.colorMode==e.RGB){if(1==arguments.length)return new e.Color(arguments[0],arguments[0],arguments[0],1);if(2==arguments.length)return new e.Color(arguments[0],arguments[0],arguments[0],arguments[1]/255);if(3==arguments.length)return new e.Color(arguments[0],arguments[1],arguments[2],1);if(4==arguments.length)return new e.Color(arguments[0],arguments[1],arguments[2],arguments[3]/255)}else{if(1==arguments.length)return new e.Color(...m(0,0,arguments[0]/100),1);if(2==arguments.length)return new e.Color(...m(0,0,arguments[0]/100),arguments[1]/255);if(3==arguments.length)return new e.Color(...m(arguments[0],arguments[1]/100,arguments[2]/100),1);if(4==arguments.length)return new e.Color(...m(arguments[0],arguments[1]/100,arguments[2]/100),arguments[3])}return null},e.red=function(F){return F._r},e.green=function(F){return F._g},e.blue=function(F){return F._b},e.alpha=function(F){return 255*F._a},e.hue=function(F){return F._inferHSV(),F._h},e.saturation=function(F){return F._inferHSV(),F._s},e.brightness=function(F){return F._inferHSV(),F._v},e.lightness=function(F){return(.2126*F._r+.7152*F._g+.0722*F._b)*100/255},e.lerpColor=function(F,A,t){var i,B,s;return e._style.colorMode==e.RGB?new e.Color(e.constrain(e.lerp(F._r,A._r,t),0,255),e.constrain(e.lerp(F._g,A._g,t),0,255),e.constrain(e.lerp(F._b,A._b,t),0,255),e.constrain(e.lerp(F._a,A._a,t),0,1)):(F._inferHSV(),A._inferHSV(),new e.Color(e.constrain((i=F._h,(s=[[Math.abs((B=A._h)-i),e.map(t,0,1,i,B)],[Math.abs(B+360-i),e.map(t,0,1,i,B+360)],[Math.abs(B-360-i),e.map(t,0,1,i,B-360)]]).sort((F,A)=>F[0]-A[0]),(s[0][1]+720)%360),0,360),e.constrain(e.lerp(F._s,A._s,t),0,100),e.constrain(e.lerp(F._v,A._v,t),0,100),e.constrain(e.lerp(F._a,A._a,t),0,1)))},e.strokeWeight=function(F){e._style_noStroke=!1,i.lineWidth=F},e.stroke=function(){if(e._style.noStroke=!1,"string"==typeof arguments[0]){i.strokeStyle=arguments[0];return}let F=e.color.apply(null,arguments);if(F._a<=0){e._style.noStroke=!0;return}i.strokeStyle=F},e.noStroke=function(){e._style.noStroke=!0},e.fill=function(){if(e._style.noFill=!1,"string"==typeof arguments[0]){i.fillStyle=arguments[0];return}let F=e.color.apply(null,arguments);if(F._a<=0){e._style.noFill=!0;return}i.fillStyle=F},e.noFill=function(){e._style.noFill=!0},e.blendMode=function(F){i.globalCompositeOperation=F},e.strokeCap=function(F){i.lineCap=F},e.strokeJoin=function(F){i.lineJoin=F},e.ellipseMode=function(F){e._style.ellipseMode=F},e.rectMode=function(F){e._style.rectMode=F},e.curveDetail=function(F){e._style.curveDetail=F},e.curveAlpha=function(F){e._style.curveAlpha=F},e.curveTightness=function(F){console.warn("curveTightness() sets the 'alpha' parameter of Catmull-Rom curve, and is NOT identical to p5.js counterpart. As this might change in the future, please call curveAlpha() directly."),e._style.curveAlpha=F},e.clear=function(){i.clearRect(0,0,e.width,e.height)},e.background=function(){if(arguments[0]&&arguments[0].MAGIC==e.MAGIC)return e.image(arguments[0],0,0,e.width,e.height);i.save(),i.resetTransform(),i.scale(e._pixelDensity,e._pixelDensity),"string"==typeof arguments[0]?i.fillStyle=arguments[0]:i.fillStyle=e.color(...Array.from(arguments)),i.fillRect(0,0,e.width,e.height),i.restore()},e.line=function(F,A,t,B){e._style.noStroke||(i.beginPath(),i.moveTo(F,A),i.lineTo(t,B),i.stroke())},e.arc=function(F,A,t,i,B,s,n,r){if(B==s)return e.ellipse(F,A,t,i);void 0==r&&(r=25),void 0==n&&(n=e.PIE),e._style.ellipseMode==e.CENTER?p(F,A,t,i,B,s,n,r):e._style.ellipseMode==e.RADIUS?p(F,A,2*t,2*i,B,s,n,r):e._style.ellipseMode==e.CORNER?p(F+t/2,A+i/2,t,i,B,s,n,r):e._style.ellipseMode==e.CORNERS&&p((F+t)/2,(A+i)/2,t-F,i-A,B,s,n,r)},e.ellipse=function(F,A,t,i){void 0==i&&(i=t),e._style.ellipseMode==e.CENTER?g(F,A,t,i):e._style.ellipseMode==e.RADIUS?g(F,A,2*t,2*i):e._style.ellipseMode==e.CORNER?g(F+t/2,A+i/2,t,i):e._style.ellipseMode==e.CORNERS&&g((F+t)/2,(A+i)/2,t-F,i-A)},e.circle=function(F,A,t){return e.ellipse(F,A,t,t)},e.point=function(F,A){F.x&&(A=F.y,F=F.x),i.beginPath(),i.ellipse(F,A,.4,.4,0,0,2*Math.PI),i.stroke()},e.rect=function(F,A,t,i,B,s,n,r){e._style.rectMode==e.CENTER?E(F-t/2,A-i/2,t,i,B,s,n,r):e._style.rectMode==e.RADIUS?E(F-t,A-i,2*t,2*i,B,s,n,r):e._style.rectMode==e.CORNER?E(F,A,t,i,B,s,n,r):e._style.rectMode==e.CORNERS&&E(F,A,t-F,i-A,B,s,n,r)},e.square=function(F,A,t,i,B,s,n){return e.rect(F,A,t,t,i,B,s,n)},e.beginShape=function(){C(),i.beginPath(),s=!0},e.beginContour=function(){i.closePath(),C(),s=!0},e.endContour=function(){C(),s=!0},e.vertex=function(F,A){C(),s?i.moveTo(F,A):i.lineTo(F,A),s=!1},e.bezierVertex=function(F,A,t,e,B,s){C(),i.bezierCurveTo(F,A,t,e,B,s)},e.quadraticVertex=function(F,A,t,e){C(),i.quadraticCurveTo(F,A,t,e)},e.bezier=function(F,A,t,i,B,s,n,r){e.beginShape(),e.vertex(F,A),e.bezierVertex(t,i,B,s,n,r),e.endShape()},e.triangle=function(F,A,t,i,B,s){e.beginShape(),e.vertex(F,A),e.vertex(t,i),e.vertex(B,s),e.endShape(e.CLOSE)},e.quad=function(F,A,t,i,B,s,n,r){e.beginShape(),e.vertex(F,A),e.vertex(t,i),e.vertex(B,s),e.vertex(n,r),e.endShape(e.CLOSE)},e.endShape=function(F){C(),F&&i.closePath(),e._style.noFill||i.fill(),e._style.noStroke||i.stroke(),e._style.noFill&&e._style.noStroke&&(i.save(),i.fillStyle="none",i.fill(),i.restore())},e.curveVertex=function(F,A){if(n.push([F,A]),n.length<4)return;let t=function(F,A,t,e,i,B,s,n,r,o){function a(F,A,t,e,i,B){return Math.pow(Math.pow(e-A,2)+Math.pow(i-t,2),.5*B)+F}let h=[],V=a(0,F,A,t,e,o),q=a(V,t,e,i,B,o),l=a(q,i,B,s,n,o);for(let o=0;o0?(c[F]=1,c[F+1]=0):(c[F]=0,c[F+1]=1));let u=F*c[0]+t*c[1],m=A*c[0]+e*c[1],M=t*c[2]+i*c[3],I=e*c[2]+B*c[3],p=i*c[4]+s*c[5],g=B*c[4]+n*c[5],E=u*c[6]+M*c[7],C=m*c[6]+I*c[7],d=M*c[8]+p*c[9],y=I*c[8]+g*c[9],S=E*c[2]+d*c[3],Q=C*c[2]+y*c[3];h.push([S,Q])}return h}(...n[n.length-4],...n[n.length-3],...n[n.length-2],...n[n.length-1],e._style.curveDetail,e._style.curveAlpha);for(let F=0;F=A?255:0}},d[e.GRAY]=function(F){for(let A=0;A>8)*255/t,F[e+1]=(F[e+1]*A>>8)*255/t,F[e+2]=(F[e+2]*A>>8)*255/t},d[e.DILATE]=function(F){S(),u.set(F);let[A,t]=[i.canvas.width,i.canvas.height];for(let e=0;e=1&&(o++,V--),q>=1&&(a++,q--),l>=1&&(h++,l--)}return c},e.noiseDetail=function(F,A){F>0&&(U=F),A>0&&(f=A)};let T=function(){let F,A;return{setSeed(t){A=F=(null==t?4294967296*Math.random():t)>>>0},getSeed:()=>F,rand:()=>(A=(1664525*A+1013904223)%4294967296)/4294967296}},D=function(){let F,A;return{setSeed(t){F=A=(null==t?4294967295*Math.random():t)>>>0},getSeed:()=>A,rand:()=>(F^=F<<17,F^=F>>13,((F^=F<<5)>>>0)/4294967295)}},Z=D();Z.setSeed(),e.noiseSeed=function(F){let A=void 0==F?4294967295*Math.random():F;w||(w=new Float32Array(4096));for(var t=0;t<4096;t++)A^=A<<17,A^=A>>13,A^=A<<5,w[t]=(A>>>0)/4294967295},e.randomSeed=function(F){Z.setSeed(F)},e.random=function(F,A){return void 0==F?Z.rand():"number"!=typeof F?F[~~(F.length*Z.rand())]:void 0!=A?Z.rand()*(A-F)+F:Z.rand()*F},e.randomGenerator=function(F){F==e.LCG?Z=T():F==e.SHR3&&(Z=D()),Z.setSeed()};var R=new function(){var F,A,t,e=Array(128),i=Array(256),B=Array(128),s=Array(128),n=Array(256),r=Array(256),o=function(){return 4294967296*Z.rand()-2147483648},a=function(){return .5+(o()<<0)*2328306e-16},h=function(){for(var A,i,n,r;;){if(A=t*B[F],0==F){do n=a(),r=a(),A=-(.2904764*Math.log(n)),i=-Math.log(r);while(i+i0?3.44262+A:-3.44262-A}if(s[F]+a()*(s[F-1]-s[F])>>0),A=1;A--)t=Math.sqrt(-2*Math.log(.00991256303526217/t+Math.exp(-.5*t*t))),e[A+1]=Math.floor(t/o*2147483648),o=t,s[A]=Math.exp(-.5*t*t),B[A]=t/2147483648;for(A=254,F=.003949659822581572/Math.exp(-a),i[0]=Math.floor(a/F*4294967296),i[1]=0,n[0]=F/4294967296,n[255]=a/4294967296,r[0]=1,r[255]=Math.exp(-a);A>=1;A--)a=-Math.log(.003949659822581572/a+Math.exp(-a)),i[A+1]=Math.floor(a/h*4294967296),h=a,r[A]=Math.exp(-a),n[A]=a/4294967296}};for(let F of(R.hasInit=!1,e.randomGaussian=function(F,A){return R.hasInit||(R.zigset(),R.hasInit=!0),R.RNOR()*A+F},e.randomExponential=function(){return R.hasInit||(R.zigset(),R.hasInit=!0),R.REXP()},e.print=console.log,e.cursor=function(F,A,t){let i="";F.includes(".")&&(F=`url("${F}")`,i=", auto"),void 0!=A&&(F+=" "+A+" "+t),e.canvas.style.cursor=F+i},e.noCursor=function(){e.canvas.style.cursor="none"},e.createCapture=function(F){var A=document.createElement("video");return A.playsinline="playsinline",A.autoplay="autoplay",navigator.mediaDevices.getUserMedia(F).then(function(F){A.srcObject=F}),A.style.position="absolute",A.style.opacity=1e-5,A.style.zIndex=-1e3,document.body.appendChild(A),A},["setup","draw","preload","mouseMoved","mousePressed","mouseReleased","mouseDragged","mouseClicked","keyPressed","keyReleased","keyTyped","touchStarted","touchEnded","touchMoved"])){let A="_"+F+"Fn";e[A]=function(){},e[A].isPlaceHolder=!0,e[F]?e[A]=e[F]:Object.defineProperty(e,F,{set:function(F){e[A]=F}})}function z(){e._noLoop||(B=null==e._frameRate?requestAnimationFrame(z):setTimeout(z,1e3/e._frameRate)),C(),s=!0,e.push(),e._drawFn(),e.pop(),++e.frameCount,e.frameCount%60==0&&(V=window.performance.now()-h,q=e.frameCount)}e.noLoop=function(){e._noLoop=!0,clearTimeout(B),B=null},e.loop=function(){e._noLoop=!1,null==B&&z()},e.redraw=function(){z()},e.frameRate=function(F){e._frameRate=F},setTimeout(function(){e._preloadFn(),h=window.performance.now(),function F(){if(o>0)return setTimeout(F,10);e._setupFn(),z()}()},1),e.canvas.onmousemove=function(F){e.pmouseX=e.mouseX,e.pmouseY=e.mouseY,e.mouseX=F.offsetX,e.mouseY=F.offsetY,e.mouseIsPressed?e._mouseDraggedFn(F):e._mouseMovedFn(F)},e.canvas.onmousedown=function(F){e.pmouseX=e.mouseX,e.pmouseY=e.mouseY,e.mouseX=F.offsetX,e.mouseY=F.offsetY,e.mouseIsPressed=!0,e.mouseButton=[e.LEFT,e.CENTER,e.RIGHT][F.button],e._mousePressedFn(F)},e.canvas.onmouseup=function(F){e.pmouseX=e.mouseX,e.pmouseY=e.mouseY,e.mouseX=F.offsetX,e.mouseY=F.offsetY,e.mouseIsPressed=!1,e._mouseReleasedFn(F)},e.canvas.onclick=function(F){e.pmouseX=e.mouseX,e.pmouseY=e.mouseY,e.mouseX=F.offsetX,e.mouseY=F.offsetY,e.mouseIsPressed=!0,e._mouseClickedFn(F),e.mouseIsPressed=!1};let G=function(F){e.keyIsPressed=!0,e.key=F.key,e.keyCode=F.keyCode,a[e.keyCode]=!0,e._keyPressedFn(F),1==F.key.length&&e._keyTypedFn(F)};window.addEventListener("keydown",G);let L=function(F){e.keyIsPressed=!1,e.key=F.key,e.keyCode=F.keyCode,a[e.keyCode]=!1,e._keyReleasedFn(F)};function v(F){let A=e.canvas.getBoundingClientRect(),t=e.canvas.scrollWidth/e.width||1,i=e.canvas.scrollHeight/e.height||1;return{x:(F.clientX-A.left)/t,y:(F.clientY-A.top)/i,id:F.identifier}}function Y(){return e._touchStartedFn.isPlaceHolder&&e._touchMovedFn.isPlaceHolder&&e._touchEndedFn.isPlaceHolder}window.addEventListener("keyup",L),e.keyIsDown=function(F){return!!a[F]},e.canvas.ontouchstart=function(F){e.touches=[...F.touches].map(v),Y()&&(e.pmouseX=e.mouseX,e.pmouseY=e.mouseY,e.mouseX=e.touches[0].x,e.mouseY=e.touches[0].y,e.mouseIsPressed=!0,e.mouseButton=e.LEFT,e._mousePressedFn(F)||F.preventDefault()),e._touchStartedFn(F)||F.preventDefault()},e.canvas.ontouchmove=function(F){e.touches=[...F.touches].map(v),Y()&&(e.pmouseX=e.mouseX,e.pmouseY=e.mouseY,e.mouseX=e.touches[0].x,e.mouseY=e.touches[0].y,e.mouseIsPressed=!0,e.mouseButton=e.LEFT,e._mouseDraggedFn(F)||F.preventDefault()),e._touchMovedFn(F)||F.preventDefault()},e.canvas.ontouchend=e.canvas.ontouchcancel=function(F){e.touches=[...F.touches].map(v),Y()&&(e.pmouseX=e.mouseX,e.pmouseY=e.mouseY,e.mouseX=e.touches[0].x,e.mouseY=e.touches[0].y,e.mouseIsPressed=!1,e._mouseReleasedFn(F)||F.preventDefault()),e._touchEndedFn(F)||F.preventDefault()},e.hasSensorPermission=!window.DeviceOrientationEvent&&!window.DeviceMotionEvent||!(DeviceOrientationEvent.requestPermission||DeviceMotionEvent.requestPermission),e.requestSensorPermissions=function(){DeviceOrientationEvent.requestPermission&&DeviceOrientationEvent.requestPermission().then(F=>{"granted"==F&&DeviceMotionEvent.requestPermission&&DeviceMotionEvent.requestPermission().then(F=>{"granted"==F&&(e.hasSensorPermission=!0)}).catch(alert)}).catch(alert)},e.remove=function(){e.canvas.onmousemove=null,e.canvas.onmousedown=null,e.canvas.onmouseup=null,e.canvas.onclick=null,window.removeEventListener("keydown",G),window.removeEventListener("keyup",L),e.canvas.ontouchstart=null,e.canvas.ontouchmove=null,e.canvas.ontouchend=null,e.canvas.remove()};let K=F=>[1,0,0,0,0,Math.cos(F),-Math.sin(F),0,0,Math.sin(F),Math.cos(F),0,0,0,0,1],N=F=>[Math.cos(F),0,Math.sin(F),0,0,1,0,0,-Math.sin(F),0,Math.cos(F),0,0,0,0,1],x=(F,A)=>[F[0]*A[0]+F[1]*A[4]+F[2]*A[8]+F[3]*A[12],F[0]*A[1]+F[1]*A[5]+F[2]*A[9]+F[3]*A[13],F[0]*A[2]+F[1]*A[6]+F[2]*A[10]+F[3]*A[14],F[0]*A[3]+F[1]*A[7]+F[2]*A[11]+F[3]*A[15],F[4]*A[0]+F[5]*A[4]+F[6]*A[8]+F[7]*A[12],F[4]*A[1]+F[5]*A[5]+F[6]*A[9]+F[7]*A[13],F[4]*A[2]+F[5]*A[6]+F[6]*A[10]+F[7]*A[14],F[4]*A[3]+F[5]*A[7]+F[6]*A[11]+F[7]*A[15],F[8]*A[0]+F[9]*A[4]+F[10]*A[8]+F[11]*A[12],F[8]*A[1]+F[9]*A[5]+F[10]*A[9]+F[11]*A[13],F[8]*A[2]+F[9]*A[6]+F[10]*A[10]+F[11]*A[14],F[8]*A[3]+F[9]*A[7]+F[10]*A[11]+F[11]*A[15],F[12]*A[0]+F[13]*A[4]+F[14]*A[8]+F[15]*A[12],F[12]*A[1]+F[13]*A[5]+F[14]*A[9]+F[15]*A[13],F[12]*A[2]+F[13]*A[6]+F[14]*A[10]+F[15]*A[14],F[12]*A[3]+F[13]*A[7]+F[14]*A[11]+F[15]*A[15]],J=(F,A)=>[(F[0]*A[0]+F[1]*A[1]+F[2]*A[2]+F[3])/(F[12]*A[0]+F[13]*A[1]+F[14]*A[2]+F[15]),(F[4]*A[0]+F[5]*A[1]+F[6]*A[2]+F[7])/(F[12]*A[0]+F[13]*A[1]+F[14]*A[2]+F[15]),(F[8]*A[0]+F[9]*A[1]+F[10]*A[2]+F[11])/(F[12]*A[0]+F[13]*A[1]+F[14]*A[2]+F[15])];window.ondeviceorientation=function(F){e.pRotationX=e.rotationX,e.pRotationY=e.rotationY,e.pRotationZ=e.rotationZ,e.pRelRotationX=e.relRotationX,e.pRelRotationY=e.relRotationY,e.pRelRotationZ=e.relRotationZ,e.rotationX=F.beta*(Math.PI/180),e.rotationY=F.gamma*(Math.PI/180),e.rotationZ=F.alpha*(Math.PI/180),e.relRotationX=[-e.rotationY,-e.rotationX,e.rotationY][~~(window.orientation/90)+1],e.relRotationY=[-e.rotationX,e.rotationY,e.rotationX][~~(window.orientation/90)+1],e.relRotationZ=e.rotationZ},window.ondevicemotion=function(F){if(e.pAccelerationX=e.accelerationX,e.pAccelerationY=e.accelerationY,e.pAccelerationZ=e.accelerationZ,!F.acceleration){let A=J(x(N(e.rotationY),K(e.rotationX)),[0,0,-9.80665]);e.accelerationX=F.accelerationIncludingGravity.x+A[0],e.accelerationY=F.accelerationIncludingGravity.y+A[1],e.accelerationZ=F.accelerationIncludingGravity.z-A[2]}},e.year=function(){return new Date().getFullYear()},e.day=function(){return new Date().getDay()},e.hour=function(){return new Date().getHours()},e.minute=function(){return new Date().getMinutes()},e.second=function(){return new Date().getSeconds()},e.millis=function(){return window.performance.now()-h},e.avgRate=function(){return e.frameCount/(e.millis()/1e3)},e.currRate=function(){return(e.frameCount-q)/(e.millis()-V)*1e3}}(F)},Ij=window.location.hash.slice(1),Ib=Ij.split("-")[0];try{let A=Ij.split("-")[1],t=Ig.from(A,"base64").toString("utf-8");F=JSON.parse(t)}catch(F){console.log("parsing hash failed",{hash:Ij,error:F})}window.anybody,IO.setup=()=>{let A={level:0,todaysRecords:F};Ib&&""!==Ib&&(A.day=parseInt(Ib)),window.anybody=new IV(IO,A),Ib||(console.log("no day!"),window.location.hash=window.anybody.day.toString())},IO.draw=()=>{window.anybody.draw()}}();