diff --git a/assets/index-4b5f155d.js b/assets/index-cd6cb535.js similarity index 97% rename from assets/index-4b5f155d.js rename to assets/index-cd6cb535.js index aba9d5f..71e6589 100644 --- a/assets/index-4b5f155d.js +++ b/assets/index-cd6cb535.js @@ -80,4 +80,4 @@ var Dn=Object.defineProperty;var Bn=(s,e,r)=>e in s?Dn(s,e,{enumerable:!0,config `+a.line+" | "+f+` `+h+" | "+peg$padEnd("",o.column-1," ")+peg$padEnd("",g,"^")}else e+=` at `+l}return e},peg$SyntaxError.buildMessage=function(s,e){var r={literal:function(f){return'"'+o(f.text)+'"'},class:function(f){var d=f.parts.map(function(g){return Array.isArray(g)?a(g[0])+"-"+a(g[1]):a(g)});return"["+(f.inverted?"^":"")+d.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(f){return f.description}};function n(f){return f.charCodeAt(0).toString(16).toUpperCase()}function o(f){return f.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+n(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+n(d)})}function a(f){return f.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+n(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+n(d)})}function l(f){return r[f.type](f)}function c(f){var d=f.map(l),g,y;if(d.sort(),d.length>0){for(g=1,y=1;g",peg$c9="[",peg$c10="+",peg$c11="*",peg$c12="%",peg$c13="&",peg$c14="|",peg$c15="<<",peg$c16=">>",peg$r0=/^[' '\t\r\n]/,peg$r1=/^[0-9]/,peg$e0=peg$classExpectation(["'"," ","'"," ","\r",` -`],!1,!1),peg$e1=peg$literalExpectation("(",!1),peg$e2=peg$literalExpectation(",",!1),peg$e3=peg$literalExpectation(")",!1),peg$e4=peg$classExpectation([["0","9"]],!1,!1),peg$e5=peg$literalExpectation(".",!1),peg$e6=peg$literalExpectation("-",!1),peg$e7=peg$literalExpectation("/",!1),peg$e8=peg$literalExpectation("\\",!1),peg$e9=peg$literalExpectation("<",!1),peg$e10=peg$literalExpectation(">",!1),peg$e11=peg$literalExpectation("[",!1),peg$e12=peg$literalExpectation("+",!1),peg$e13=peg$literalExpectation("*",!1),peg$e14=peg$literalExpectation("%",!1),peg$e15=peg$literalExpectation("&",!1),peg$e16=peg$literalExpectation("|",!1),peg$e17=peg$literalExpectation("<<",!1),peg$e18=peg$literalExpectation(">>",!1),peg$f0=function(s){return centsToSemitones(s.filter(e=>e))},peg$f1=function(){},peg$f2=function(s,e){return Math.floor(Math.random()*(e-s+1)+s)},peg$f3=function(s,e){return Math.random()*(e-s)+s},peg$f4=function(){return parseFloat(text())},peg$f5=function(){return parseInt(text())},peg$f6=function(s){return ratioToCents(s)},peg$f7=function(s,e){return s/e},peg$f8=function(s,e){return Math.pow(2,s/e)},peg$f9=function(s,e,r,n){var o=n?r/n:r;return Math.pow(o,s/e)},peg$f10=function(s,e){return parseFloat(s.toString()+"."+e.toString())},peg$f11=function(s){return s.filter(e=>e)},peg$f12=function(s){return monzoToCents(s)},peg$f13=function(){return eval(text())},peg$currPos=0,peg$savedPos=0,peg$posDetailsCache=[{line:1,column:1}],peg$maxFailPos=0,peg$maxFailExpected=[],peg$resultsCache={},peg$result;if("startRule"in options){if(!(options.startRule in peg$startRuleFunctions))throw new Error(`Can't start parsing from rule "`+options.startRule+'".');peg$startRuleFunction=peg$startRuleFunctions[options.startRule]}function text(){return input.substring(peg$savedPos,peg$currPos)}function peg$literalExpectation(s,e){return{type:"literal",text:s,ignoreCase:e}}function peg$classExpectation(s,e,r){return{type:"class",parts:s,inverted:e,ignoreCase:r}}function peg$endExpectation(){return{type:"end"}}function peg$computePosDetails(s){var e=peg$posDetailsCache[s],r;if(e)return e;for(r=s-1;!peg$posDetailsCache[r];)r--;for(e=peg$posDetailsCache[r],e={line:e.line,column:e.column};rpeg$maxFailPos&&(peg$maxFailPos=peg$currPos,peg$maxFailExpected=[]),peg$maxFailExpected.push(s))}function peg$buildStructuredError(s,e,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(s,e),s,e,r)}function peg$parselines(){var s,e,r,n=peg$currPos*17+0,o=peg$resultsCache[n];if(o)return peg$currPos=o.nextPos,o.result;if(s=peg$currPos,e=[],r=peg$parseratio(),r===peg$FAILED&&(r=peg$parsevalue(),r===peg$FAILED&&(r=peg$parsemonzo(),r===peg$FAILED&&(r=peg$parseoperation(),r===peg$FAILED&&(r=peg$parsesep())))),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),r=peg$parseratio(),r===peg$FAILED&&(r=peg$parsevalue(),r===peg$FAILED&&(r=peg$parsemonzo(),r===peg$FAILED&&(r=peg$parseoperation(),r===peg$FAILED&&(r=peg$parsesep()))));else e=peg$FAILED;return e!==peg$FAILED&&(peg$savedPos=s,e=peg$f0(e)),s=e,peg$resultsCache[n]={nextPos:peg$currPos,result:s},s}function peg$parsesep(){var s,e,r=peg$currPos*17+1,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(s=peg$currPos,peg$r0.test(input.charAt(peg$currPos))?(e=input.charAt(peg$currPos),peg$currPos++):(e=peg$FAILED,peg$fail(peg$e0)),e!==peg$FAILED&&(peg$savedPos=s,e=peg$f1()),s=e,peg$resultsCache[r]={nextPos:peg$currPos,result:s},s)}function peg$parsevalue(){var s,e=peg$currPos*17+2,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(s=peg$parsefloat(),s===peg$FAILED&&(s=peg$parseint(),s===peg$FAILED&&(s=peg$parserandom_int(),s===peg$FAILED&&(s=peg$parserandom_float()))),peg$resultsCache[e]={nextPos:peg$currPos,result:s},s)}function peg$parserandom_int(){var s,e,r,n,o,a,l=peg$currPos*17+3,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(s=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parseint(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(n=peg$c1,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e2)),n!==peg$FAILED?(o=peg$parseint(),o!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(a=peg$c2,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e3)),a!==peg$FAILED?(peg$savedPos=s,s=peg$f2(r,o)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:s},s)}function peg$parserandom_float(){var s,e,r,n,o,a,l=peg$currPos*17+4,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(s=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parsefloat(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(n=peg$c1,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e2)),n!==peg$FAILED?(o=peg$parsefloat(),o!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(a=peg$c2,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e3)),a!==peg$FAILED?(peg$savedPos=s,s=peg$f3(r,o)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:s},s)}function peg$parsefloat(){var s,e,r,n,o,a,l,c=peg$currPos*17+5,h=peg$resultsCache[c];if(h)return peg$currPos=h.nextPos,h.result;if(s=peg$currPos,e=peg$currPos,r=[],peg$r1.test(input.charAt(peg$currPos))?(n=input.charAt(peg$currPos),peg$currPos++):(n=peg$FAILED,peg$fail(peg$e4)),n!==peg$FAILED)for(;n!==peg$FAILED;)r.push(n),peg$r1.test(input.charAt(peg$currPos))?(n=input.charAt(peg$currPos),peg$currPos++):(n=peg$FAILED,peg$fail(peg$e4));else r=peg$FAILED;if(r!==peg$FAILED?(input.charCodeAt(peg$currPos)===46?(n=peg$c3,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e5)),n!==peg$FAILED?(r=[r,n],e=r):(peg$currPos=e,e=peg$FAILED)):(peg$currPos=e,e=peg$FAILED),e===peg$FAILED){for(e=peg$currPos,input.charCodeAt(peg$currPos)===45?(r=peg$c4,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e6)),r===peg$FAILED&&(r=null),n=[],peg$r1.test(input.charAt(peg$currPos))?(o=input.charAt(peg$currPos),peg$currPos++):(o=peg$FAILED,peg$fail(peg$e4));o!==peg$FAILED;)n.push(o),peg$r1.test(input.charAt(peg$currPos))?(o=input.charAt(peg$currPos),peg$currPos++):(o=peg$FAILED,peg$fail(peg$e4));if(input.charCodeAt(peg$currPos)===46?(o=peg$c3,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e5)),o!==peg$FAILED){if(a=[],peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4)),l!==peg$FAILED)for(;l!==peg$FAILED;)a.push(l),peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4));else a=peg$FAILED;a!==peg$FAILED?(r=[r,n,o,a],e=r):(peg$currPos=e,e=peg$FAILED)}else peg$currPos=e,e=peg$FAILED;if(e===peg$FAILED)if(e=peg$currPos,input.charCodeAt(peg$currPos)===46?(r=peg$c3,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e5)),r!==peg$FAILED){if(n=[],peg$r1.test(input.charAt(peg$currPos))?(o=input.charAt(peg$currPos),peg$currPos++):(o=peg$FAILED,peg$fail(peg$e4)),o!==peg$FAILED)for(;o!==peg$FAILED;)n.push(o),peg$r1.test(input.charAt(peg$currPos))?(o=input.charAt(peg$currPos),peg$currPos++):(o=peg$FAILED,peg$fail(peg$e4));else n=peg$FAILED;n!==peg$FAILED?(r=[r,n],e=r):(peg$currPos=e,e=peg$FAILED)}else peg$currPos=e,e=peg$FAILED}return e!==peg$FAILED&&(peg$savedPos=s,e=peg$f4()),s=e,peg$resultsCache[c]={nextPos:peg$currPos,result:s},s}function peg$parseint(){var s,e,r,n=peg$currPos*17+6,o=peg$resultsCache[n];if(o)return peg$currPos=o.nextPos,o.result;if(s=peg$currPos,input.charCodeAt(peg$currPos)===45?peg$currPos++:peg$fail(peg$e6),e=[],peg$r1.test(input.charAt(peg$currPos))?(r=input.charAt(peg$currPos),peg$currPos++):(r=peg$FAILED,peg$fail(peg$e4)),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),peg$r1.test(input.charAt(peg$currPos))?(r=input.charAt(peg$currPos),peg$currPos++):(r=peg$FAILED,peg$fail(peg$e4));else e=peg$FAILED;return e!==peg$FAILED?(peg$savedPos=s,s=peg$f5()):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[n]={nextPos:peg$currPos,result:s},s}function peg$parseratio(){var s,e,r=peg$currPos*17+7,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(s=peg$currPos,e=peg$parseedji_ratio(),e===peg$FAILED&&(e=peg$parseedo_ratio(),e===peg$FAILED&&(e=peg$parsefrac_ratio(),e===peg$FAILED&&(e=peg$parsedecimal_ratio()))),e!==peg$FAILED&&(peg$savedPos=s,e=peg$f6(e)),s=e,peg$resultsCache[r]={nextPos:peg$currPos,result:s},s)}function peg$parsefrac_ratio(){var s,e,r,n,o=peg$currPos*17+8,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===47?(r=peg$c5,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e7)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(peg$savedPos=s,s=peg$f7(e,n)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}function peg$parseedo_ratio(){var s,e,r,n,o=peg$currPos*17+9,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===92?(r=peg$c6,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e8)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(peg$savedPos=s,s=peg$f8(e,n)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}function peg$parseedji_ratio(){var s,e,r,n,o,a,l,c,h=peg$currPos*17+10,f=peg$resultsCache[h];return f?(peg$currPos=f.nextPos,f.result):(s=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===92?(r=peg$c6,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e8)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(input.charCodeAt(peg$currPos)===60?(o=peg$c7,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e9)),o!==peg$FAILED?(a=peg$parseint(),a===peg$FAILED&&(a=peg$parserandom_int()),a!==peg$FAILED?(input.charCodeAt(peg$currPos)===47?peg$currPos++:peg$fail(peg$e7),l=peg$parseint(),l===peg$FAILED&&(l=peg$parserandom_int()),l===peg$FAILED&&(l=null),input.charCodeAt(peg$currPos)===62?(c=peg$c8,peg$currPos++):(c=peg$FAILED,peg$fail(peg$e10)),c!==peg$FAILED?(peg$savedPos=s,s=peg$f9(e,n,a,l)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[h]={nextPos:peg$currPos,result:s},s)}function peg$parsedecimal_ratio(){var s,e,r,n,o=peg$currPos*17+11,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,e=peg$parseint(),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(r=peg$c1,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e2)),r!==peg$FAILED?(n=peg$parseint(),n!==peg$FAILED?(peg$savedPos=s,s=peg$f10(e,n)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}function peg$parseints(){var s,e,r,n=peg$currPos*17+12,o=peg$resultsCache[n];if(o)return peg$currPos=o.nextPos,o.result;if(s=peg$currPos,e=[],r=peg$parseint(),r===peg$FAILED&&(r=peg$parsesep()),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),r=peg$parseint(),r===peg$FAILED&&(r=peg$parsesep());else e=peg$FAILED;return e!==peg$FAILED&&(peg$savedPos=s,e=peg$f11(e)),s=e,peg$resultsCache[n]={nextPos:peg$currPos,result:s},s}function peg$parsemonzo(){var s,e,r,n,o=peg$currPos*17+13,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,input.charCodeAt(peg$currPos)===91?(e=peg$c9,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e11)),e!==peg$FAILED?(r=peg$parseints(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===62?(n=peg$c8,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e10)),n!==peg$FAILED?(peg$savedPos=s,s=peg$f12(r)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}function peg$parseoperation(){var s,e,r,n,o,a,l,c=peg$currPos*17+14,h=peg$resultsCache[c];if(h)return peg$currPos=h.nextPos,h.result;if(s=peg$currPos,e=peg$parsevalue(),e===peg$FAILED&&(e=peg$parseratio(),e===peg$FAILED&&(e=peg$parsemonzo(),e===peg$FAILED)))for(e=[],r=peg$parsesep();r!==peg$FAILED;)e.push(r),r=peg$parsesep();if(e!==peg$FAILED){if(r=[],n=peg$currPos,o=peg$parseoperator(),o!==peg$FAILED){if(a=peg$parsevalue(),a===peg$FAILED&&(a=peg$parseratio(),a===peg$FAILED&&(a=peg$parsemonzo(),a===peg$FAILED&&(a=peg$parsesub_operations(),a===peg$FAILED&&(a=peg$parseoperation(),a===peg$FAILED)))))for(a=[],l=peg$parsesep();l!==peg$FAILED;)a.push(l),l=peg$parsesep();a!==peg$FAILED?(o=[o,a],n=o):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;if(n!==peg$FAILED)for(;n!==peg$FAILED;)if(r.push(n),n=peg$currPos,o=peg$parseoperator(),o!==peg$FAILED){if(a=peg$parsevalue(),a===peg$FAILED&&(a=peg$parseratio(),a===peg$FAILED&&(a=peg$parsemonzo(),a===peg$FAILED&&(a=peg$parsesub_operations(),a===peg$FAILED&&(a=peg$parseoperation(),a===peg$FAILED)))))for(a=[],l=peg$parsesep();l!==peg$FAILED;)a.push(l),l=peg$parsesep();a!==peg$FAILED?(o=[o,a],n=o):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;else r=peg$FAILED;r!==peg$FAILED?(peg$savedPos=s,s=peg$f13()):(peg$currPos=s,s=peg$FAILED)}else peg$currPos=s,s=peg$FAILED;return peg$resultsCache[c]={nextPos:peg$currPos,result:s},s}function peg$parseoperator(){var s,e=peg$currPos*17+15,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(input.charCodeAt(peg$currPos)===43?(s=peg$c10,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e12)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===45?(s=peg$c4,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e6)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===42?(s=peg$c11,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e13)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===37?(s=peg$c12,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e14)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===38?(s=peg$c13,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e15)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===124?(s=peg$c14,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e16)),s===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c15?(s=peg$c15,peg$currPos+=2):(s=peg$FAILED,peg$fail(peg$e17)),s===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c16?(s=peg$c16,peg$currPos+=2):(s=peg$FAILED,peg$fail(peg$e18))))))))),peg$resultsCache[e]={nextPos:peg$currPos,result:s},s)}function peg$parsesub_operations(){var s,e,r,n,o=peg$currPos*17+16,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parseoperation(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(n=peg$c2,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e3)),n!==peg$FAILED?(e=[e,r,n],s=e):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}if(peg$result=peg$startRuleFunction(),peg$result!==peg$FAILED&&peg$currPos===input.length)return peg$result;throw peg$result!==peg$FAILED&&peg$currPos{typeof PROCESS.emitWarning=="function"?PROCESS.emitWarning(s,e,r,n):console.error(`[${r}] ${e}: ${s}`)};let AC=globalThis.AbortController,AS=globalThis.AbortSignal;var Sn;if(typeof AC>"u"){AS=class{constructor(){$e(this,"onabort");$e(this,"_onabort",[]);$e(this,"reason");$e(this,"aborted",!1)}addEventListener(n,o){this._onabort.push(o)}},AC=class{constructor(){$e(this,"signal",new AS);e()}abort(n){var o,a;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const l of this.signal._onabort)l(n);(a=(o=this.signal).onabort)==null||a.call(o,n)}}};let s=((Sn=PROCESS.env)==null?void 0:Sn.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{s&&(s=!1,emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const shouldWarn=s=>!warned.has(s),isPosInt=s=>s&&s===Math.floor(s)&&s>0&&isFinite(s),getUintArray=s=>isPosInt(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(e){super(e),this.fill(0)}}var Vi;const Ti=class Ti{constructor(e,r){$e(this,"heap");$e(this,"length");if(!B(Ti,Vi))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}static create(e){const r=getUintArray(e);if(!r)return[];ze(Ti,Vi,!0);const n=new Ti(e,r);return ze(Ti,Vi,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Vi=new WeakMap,lt(Ti,Vi,!1);let Stack=Ti;var ti,Ut,ii,ri,_i,At,ni,Pt,vt,nt,Zt,zt,Bt,Mt,si,Et,fi,di,oi,ai,xi,Vt,or,Kr,Li,pi,ar,jt,Lr,vn,Qi,Gi,lr,ci,Ii,hi,wi,cr,Jr,Hi,Pr,Wi,Tr,St,Ct,hr,en,Ri,nr;const tn=class tn{constructor(e){lt(this,or);lt(this,Lr);lt(this,ci);lt(this,hi);lt(this,cr);lt(this,Hi);lt(this,Wi);lt(this,St);lt(this,hr);lt(this,Ri);lt(this,ti,void 0);lt(this,Ut,void 0);lt(this,ii,void 0);lt(this,ri,void 0);lt(this,_i,void 0);$e(this,"ttl");$e(this,"ttlResolution");$e(this,"ttlAutopurge");$e(this,"updateAgeOnGet");$e(this,"updateAgeOnHas");$e(this,"allowStale");$e(this,"noDisposeOnSet");$e(this,"noUpdateTTL");$e(this,"maxEntrySize");$e(this,"sizeCalculation");$e(this,"noDeleteOnFetchRejection");$e(this,"noDeleteOnStaleGet");$e(this,"allowStaleOnFetchAbort");$e(this,"allowStaleOnFetchRejection");$e(this,"ignoreFetchAbort");lt(this,At,void 0);lt(this,ni,void 0);lt(this,Pt,void 0);lt(this,vt,void 0);lt(this,nt,void 0);lt(this,Zt,void 0);lt(this,zt,void 0);lt(this,Bt,void 0);lt(this,Mt,void 0);lt(this,si,void 0);lt(this,Et,void 0);lt(this,fi,void 0);lt(this,di,void 0);lt(this,oi,void 0);lt(this,ai,void 0);lt(this,xi,void 0);lt(this,Vt,void 0);lt(this,Li,()=>{});lt(this,pi,()=>{});lt(this,ar,()=>{});lt(this,jt,()=>!1);lt(this,Qi,e=>{});lt(this,Gi,(e,r,n)=>{});lt(this,lr,(e,r,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:a,updateAgeOnGet:l,updateAgeOnHas:c,allowStale:h,dispose:f,disposeAfter:d,noDisposeOnSet:g,noUpdateTTL:y,maxSize:I=0,maxEntrySize:P=0,sizeCalculation:N,fetchMethod:Y,noDeleteOnFetchRejection:H,noDeleteOnStaleGet:Se,allowStaleOnFetchRejection:Re,allowStaleOnFetchAbort:oe,ignoreFetchAbort:ke}=e;if(r!==0&&!isPosInt(r))throw new TypeError("max option must be a nonnegative integer");const Te=r?getUintArray(r):Array;if(!Te)throw new Error("invalid max value: "+r);if(ze(this,ti,r),ze(this,Ut,I),this.maxEntrySize=P||B(this,Ut),this.sizeCalculation=N,this.sizeCalculation){if(!B(this,Ut)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Y!==void 0&&typeof Y!="function")throw new TypeError("fetchMethod must be a function if specified");if(ze(this,_i,Y),ze(this,xi,!!Y),ze(this,Pt,new Map),ze(this,vt,new Array(r).fill(void 0)),ze(this,nt,new Array(r).fill(void 0)),ze(this,Zt,new Te(r)),ze(this,zt,new Te(r)),ze(this,Bt,0),ze(this,Mt,0),ze(this,si,Stack.create(r)),ze(this,At,0),ze(this,ni,0),typeof f=="function"&&ze(this,ii,f),typeof d=="function"?(ze(this,ri,d),ze(this,Et,[])):(ze(this,ri,void 0),ze(this,Et,void 0)),ze(this,ai,!!B(this,ii)),ze(this,Vt,!!B(this,ri)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!H,this.allowStaleOnFetchRejection=!!Re,this.allowStaleOnFetchAbort=!!oe,this.ignoreFetchAbort=!!ke,this.maxEntrySize!==0){if(B(this,Ut)!==0&&!isPosInt(B(this,Ut)))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");We(this,Lr,vn).call(this)}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!Se,this.updateAgeOnGet=!!l,this.updateAgeOnHas=!!c,this.ttlResolution=isPosInt(o)||o===0?o:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");We(this,or,Kr).call(this)}if(B(this,ti)===0&&this.ttl===0&&B(this,Ut)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!B(this,ti)&&!B(this,Ut)){const Qe="LRU_CACHE_UNBOUNDED";shouldWarn(Qe)&&(warned.add(Qe),emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Qe,tn))}}static unsafeExposeInternals(e){return{starts:B(e,di),ttls:B(e,oi),sizes:B(e,fi),keyMap:B(e,Pt),keyList:B(e,vt),valList:B(e,nt),next:B(e,Zt),prev:B(e,zt),get head(){return B(e,Bt)},get tail(){return B(e,Mt)},free:B(e,si),isBackgroundFetch:r=>{var n;return We(n=e,St,Ct).call(n,r)},backgroundFetch:(r,n,o,a)=>{var l;return We(l=e,Wi,Tr).call(l,r,n,o,a)},moveToTail:r=>{var n;return We(n=e,Ri,nr).call(n,r)},indexes:r=>{var n;return We(n=e,ci,Ii).call(n,r)},rindexes:r=>{var n;return We(n=e,hi,wi).call(n,r)},isStale:r=>{var n;return B(n=e,jt).call(n,r)}}}get max(){return B(this,ti)}get maxSize(){return B(this,Ut)}get calculatedSize(){return B(this,ni)}get size(){return B(this,At)}get fetchMethod(){return B(this,_i)}get dispose(){return B(this,ii)}get disposeAfter(){return B(this,ri)}getRemainingTTL(e){return B(this,Pt).has(e)?1/0:0}*entries(){for(const e of We(this,ci,Ii).call(this))B(this,nt)[e]!==void 0&&B(this,vt)[e]!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield[B(this,vt)[e],B(this,nt)[e]])}*rentries(){for(const e of We(this,hi,wi).call(this))B(this,nt)[e]!==void 0&&B(this,vt)[e]!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield[B(this,vt)[e],B(this,nt)[e]])}*keys(){for(const e of We(this,ci,Ii).call(this)){const r=B(this,vt)[e];r!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield r)}}*rkeys(){for(const e of We(this,hi,wi).call(this)){const r=B(this,vt)[e];r!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield r)}}*values(){for(const e of We(this,ci,Ii).call(this))B(this,nt)[e]!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield B(this,nt)[e])}*rvalues(){for(const e of We(this,hi,wi).call(this))B(this,nt)[e]!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield B(this,nt)[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(const n of We(this,ci,Ii).call(this)){const o=B(this,nt)[n],a=We(this,St,Ct).call(this,o)?o.__staleWhileFetching:o;if(a!==void 0&&e(a,B(this,vt)[n],this))return this.get(B(this,vt)[n],r)}}forEach(e,r=this){for(const n of We(this,ci,Ii).call(this)){const o=B(this,nt)[n],a=We(this,St,Ct).call(this,o)?o.__staleWhileFetching:o;a!==void 0&&e.call(r,a,B(this,vt)[n],this)}}rforEach(e,r=this){for(const n of We(this,hi,wi).call(this)){const o=B(this,nt)[n],a=We(this,St,Ct).call(this,o)?o.__staleWhileFetching:o;a!==void 0&&e.call(r,a,B(this,vt)[n],this)}}purgeStale(){let e=!1;for(const r of We(this,hi,wi).call(this,{allowStale:!0}))B(this,jt).call(this,r)&&(this.delete(B(this,vt)[r]),e=!0);return e}dump(){const e=[];for(const r of We(this,ci,Ii).call(this,{allowStale:!0})){const n=B(this,vt)[r],o=B(this,nt)[r],a=We(this,St,Ct).call(this,o)?o.__staleWhileFetching:o;if(a===void 0||n===void 0)continue;const l={value:a};if(B(this,oi)&&B(this,di)){l.ttl=B(this,oi)[r];const c=perf.now()-B(this,di)[r];l.start=Math.floor(Date.now()-c)}B(this,fi)&&(l.size=B(this,fi)[r]),e.unshift([n,l])}return e}load(e){this.clear();for(const[r,n]of e){if(n.start){const o=Date.now()-n.start;n.start=perf.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){var y,I,P,N,Y;if(r===void 0)return this.delete(e),this;const{ttl:o=this.ttl,start:a,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:h}=n;let{noUpdateTTL:f=this.noUpdateTTL}=n;const d=B(this,lr).call(this,e,r,n.size||0,c);if(this.maxEntrySize&&d>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.delete(e),this;let g=B(this,At)===0?void 0:B(this,Pt).get(e);if(g===void 0)g=B(this,At)===0?B(this,Mt):B(this,si).length!==0?B(this,si).pop():B(this,At)===B(this,ti)?We(this,Hi,Pr).call(this,!1):B(this,At),B(this,vt)[g]=e,B(this,nt)[g]=r,B(this,Pt).set(e,g),B(this,Zt)[B(this,Mt)]=g,B(this,zt)[g]=B(this,Mt),ze(this,Mt,g),Ar(this,At)._++,B(this,Gi).call(this,g,d,h),h&&(h.set="add"),f=!1;else{We(this,Ri,nr).call(this,g);const H=B(this,nt)[g];if(r!==H){if(B(this,xi)&&We(this,St,Ct).call(this,H)){H.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:Se}=H;Se!==void 0&&!l&&(B(this,ai)&&((y=B(this,ii))==null||y.call(this,Se,e,"set")),B(this,Vt)&&((I=B(this,Et))==null||I.push([Se,e,"set"])))}else l||(B(this,ai)&&((P=B(this,ii))==null||P.call(this,H,e,"set")),B(this,Vt)&&((N=B(this,Et))==null||N.push([H,e,"set"])));if(B(this,Qi).call(this,g),B(this,Gi).call(this,g,d,h),B(this,nt)[g]=r,h){h.set="replace";const Se=H&&We(this,St,Ct).call(this,H)?H.__staleWhileFetching:H;Se!==void 0&&(h.oldValue=Se)}}else h&&(h.set="update")}if(o!==0&&!B(this,oi)&&We(this,or,Kr).call(this),B(this,oi)&&(f||B(this,ar).call(this,g,o,a),h&&B(this,pi).call(this,h,g)),!l&&B(this,Vt)&&B(this,Et)){const H=B(this,Et);let Se;for(;Se=H==null?void 0:H.shift();)(Y=B(this,ri))==null||Y.call(this,...Se)}return this}pop(){var e;try{for(;B(this,At);){const r=B(this,nt)[B(this,Bt)];if(We(this,Hi,Pr).call(this,!0),We(this,St,Ct).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(B(this,Vt)&&B(this,Et)){const r=B(this,Et);let n;for(;n=r==null?void 0:r.shift();)(e=B(this,ri))==null||e.call(this,...n)}}}has(e,r={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,a=B(this,Pt).get(e);if(a!==void 0){const l=B(this,nt)[a];if(We(this,St,Ct).call(this,l)&&l.__staleWhileFetching===void 0)return!1;if(B(this,jt).call(this,a))o&&(o.has="stale",B(this,pi).call(this,o,a));else return n&&B(this,Li).call(this,a),o&&(o.has="hit",B(this,pi).call(this,o,a)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){const{allowStale:n=this.allowStale}=r,o=B(this,Pt).get(e);if(o!==void 0&&(n||!B(this,jt).call(this,o))){const a=B(this,nt)[o];return We(this,St,Ct).call(this,a)?a.__staleWhileFetching:a}}async fetch(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:l=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:h=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:N,forceRefresh:Y=!1,status:H,signal:Se}=r;if(!B(this,xi))return H&&(H.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:a,status:H});const Re={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:a,ttl:l,noDisposeOnSet:c,size:h,sizeCalculation:f,noUpdateTTL:d,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:P,ignoreFetchAbort:I,status:H,signal:Se};let oe=B(this,Pt).get(e);if(oe===void 0){H&&(H.fetch="miss");const ke=We(this,Wi,Tr).call(this,e,oe,Re,N);return ke.__returned=ke}else{const ke=B(this,nt)[oe];if(We(this,St,Ct).call(this,ke)){const De=n&&ke.__staleWhileFetching!==void 0;return H&&(H.fetch="inflight",De&&(H.returnedStale=!0)),De?ke.__staleWhileFetching:ke.__returned=ke}const Te=B(this,jt).call(this,oe);if(!Y&&!Te)return H&&(H.fetch="hit"),We(this,Ri,nr).call(this,oe),o&&B(this,Li).call(this,oe),H&&B(this,pi).call(this,H,oe),ke;const Qe=We(this,Wi,Tr).call(this,e,oe,Re,N),Ze=Qe.__staleWhileFetching!==void 0&&n;return H&&(H.fetch=Te?"stale":"refresh",Ze&&Te&&(H.returnedStale=!0)),Ze?Qe.__staleWhileFetching:Qe.__returned=Qe}}get(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:l}=r,c=B(this,Pt).get(e);if(c!==void 0){const h=B(this,nt)[c],f=We(this,St,Ct).call(this,h);return l&&B(this,pi).call(this,l,c),B(this,jt).call(this,c)?(l&&(l.get="stale"),f?(l&&n&&h.__staleWhileFetching!==void 0&&(l.returnedStale=!0),n?h.__staleWhileFetching:void 0):(a||this.delete(e),l&&n&&(l.returnedStale=!0),n?h:void 0)):(l&&(l.get="hit"),f?h.__staleWhileFetching:(We(this,Ri,nr).call(this,c),o&&B(this,Li).call(this,c),h))}else l&&(l.get="miss")}delete(e){var n,o,a,l;let r=!1;if(B(this,At)!==0){const c=B(this,Pt).get(e);if(c!==void 0)if(r=!0,B(this,At)===1)this.clear();else{B(this,Qi).call(this,c);const h=B(this,nt)[c];We(this,St,Ct).call(this,h)?h.__abortController.abort(new Error("deleted")):(B(this,ai)||B(this,Vt))&&(B(this,ai)&&((n=B(this,ii))==null||n.call(this,h,e,"delete")),B(this,Vt)&&((o=B(this,Et))==null||o.push([h,e,"delete"]))),B(this,Pt).delete(e),B(this,vt)[c]=void 0,B(this,nt)[c]=void 0,c===B(this,Mt)?ze(this,Mt,B(this,zt)[c]):c===B(this,Bt)?ze(this,Bt,B(this,Zt)[c]):(B(this,Zt)[B(this,zt)[c]]=B(this,Zt)[c],B(this,zt)[B(this,Zt)[c]]=B(this,zt)[c]),Ar(this,At)._--,B(this,si).push(c)}}if(B(this,Vt)&&((a=B(this,Et))!=null&&a.length)){const c=B(this,Et);let h;for(;h=c==null?void 0:c.shift();)(l=B(this,ri))==null||l.call(this,...h)}return r}clear(){var e,r,n;for(const o of We(this,hi,wi).call(this,{allowStale:!0})){const a=B(this,nt)[o];if(We(this,St,Ct).call(this,a))a.__abortController.abort(new Error("deleted"));else{const l=B(this,vt)[o];B(this,ai)&&((e=B(this,ii))==null||e.call(this,a,l,"delete")),B(this,Vt)&&((r=B(this,Et))==null||r.push([a,l,"delete"]))}}if(B(this,Pt).clear(),B(this,nt).fill(void 0),B(this,vt).fill(void 0),B(this,oi)&&B(this,di)&&(B(this,oi).fill(0),B(this,di).fill(0)),B(this,fi)&&B(this,fi).fill(0),ze(this,Bt,0),ze(this,Mt,0),B(this,si).length=0,ze(this,ni,0),ze(this,At,0),B(this,Vt)&&B(this,Et)){const o=B(this,Et);let a;for(;a=o==null?void 0:o.shift();)(n=B(this,ri))==null||n.call(this,...a)}}};ti=new WeakMap,Ut=new WeakMap,ii=new WeakMap,ri=new WeakMap,_i=new WeakMap,At=new WeakMap,ni=new WeakMap,Pt=new WeakMap,vt=new WeakMap,nt=new WeakMap,Zt=new WeakMap,zt=new WeakMap,Bt=new WeakMap,Mt=new WeakMap,si=new WeakMap,Et=new WeakMap,fi=new WeakMap,di=new WeakMap,oi=new WeakMap,ai=new WeakMap,xi=new WeakMap,Vt=new WeakMap,or=new WeakSet,Kr=function(){const e=new ZeroArray(B(this,ti)),r=new ZeroArray(B(this,ti));ze(this,oi,e),ze(this,di,r),ze(this,ar,(a,l,c=perf.now())=>{if(r[a]=l!==0?c:0,e[a]=l,l!==0&&this.ttlAutopurge){const h=setTimeout(()=>{B(this,jt).call(this,a)&&this.delete(B(this,vt)[a])},l+1);h.unref&&h.unref()}}),ze(this,Li,a=>{r[a]=e[a]!==0?perf.now():0}),ze(this,pi,(a,l)=>{if(e[l]){const c=e[l],h=r[l];a.ttl=c,a.start=h,a.now=n||o();const f=a.now-h;a.remainingTTL=c-f}});let n=0;const o=()=>{const a=perf.now();if(this.ttlResolution>0){n=a;const l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return a};this.getRemainingTTL=a=>{const l=B(this,Pt).get(a);if(l===void 0)return 0;const c=e[l],h=r[l];if(c===0||h===0)return 1/0;const f=(n||o())-h;return c-f},ze(this,jt,a=>e[a]!==0&&r[a]!==0&&(n||o())-r[a]>e[a])},Li=new WeakMap,pi=new WeakMap,ar=new WeakMap,jt=new WeakMap,Lr=new WeakSet,vn=function(){const e=new ZeroArray(B(this,ti));ze(this,ni,0),ze(this,fi,e),ze(this,Qi,r=>{ze(this,ni,B(this,ni)-e[r]),e[r]=0}),ze(this,lr,(r,n,o,a)=>{if(We(this,St,Ct).call(this,n))return 0;if(!isPosInt(o))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(o=a(n,r),!isPosInt(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o}),ze(this,Gi,(r,n,o)=>{if(e[r]=n,B(this,Ut)){const a=B(this,Ut)-e[r];for(;B(this,ni)>a;)We(this,Hi,Pr).call(this,!0)}ze(this,ni,B(this,ni)+e[r]),o&&(o.entrySize=n,o.totalCalculatedSize=B(this,ni))})},Qi=new WeakMap,Gi=new WeakMap,lr=new WeakMap,ci=new WeakSet,Ii=function*({allowStale:e=this.allowStale}={}){if(B(this,At))for(let r=B(this,Mt);!(!We(this,cr,Jr).call(this,r)||((e||!B(this,jt).call(this,r))&&(yield r),r===B(this,Bt)));)r=B(this,zt)[r]},hi=new WeakSet,wi=function*({allowStale:e=this.allowStale}={}){if(B(this,At))for(let r=B(this,Bt);!(!We(this,cr,Jr).call(this,r)||((e||!B(this,jt).call(this,r))&&(yield r),r===B(this,Mt)));)r=B(this,Zt)[r]},cr=new WeakSet,Jr=function(e){return e!==void 0&&B(this,Pt).get(B(this,vt)[e])===e},Hi=new WeakSet,Pr=function(e){var a,l;const r=B(this,Bt),n=B(this,vt)[r],o=B(this,nt)[r];return B(this,xi)&&We(this,St,Ct).call(this,o)?o.__abortController.abort(new Error("evicted")):(B(this,ai)||B(this,Vt))&&(B(this,ai)&&((a=B(this,ii))==null||a.call(this,o,n,"evict")),B(this,Vt)&&((l=B(this,Et))==null||l.push([o,n,"evict"]))),B(this,Qi).call(this,r),e&&(B(this,vt)[r]=void 0,B(this,nt)[r]=void 0,B(this,si).push(r)),B(this,At)===1?(ze(this,Bt,ze(this,Mt,0)),B(this,si).length=0):ze(this,Bt,B(this,Zt)[r]),B(this,Pt).delete(n),Ar(this,At)._--,r},Wi=new WeakSet,Tr=function(e,r,n,o){const a=r===void 0?void 0:B(this,nt)[r];if(We(this,St,Ct).call(this,a))return a;const l=new AC,{signal:c}=n;c==null||c.addEventListener("abort",()=>l.abort(c.reason),{signal:l.signal});const h={signal:l.signal,options:n,context:o},f=(N,Y=!1)=>{const{aborted:H}=l.signal,Se=n.ignoreFetchAbort&&N!==void 0;if(n.status&&(H&&!Y?(n.status.fetchAborted=!0,n.status.fetchError=l.signal.reason,Se&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),H&&!Se&&!Y)return g(l.signal.reason);const Re=I;return B(this,nt)[r]===I&&(N===void 0?Re.__staleWhileFetching?B(this,nt)[r]=Re.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,N,h.options))),N},d=N=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=N),g(N)),g=N=>{const{aborted:Y}=l.signal,H=Y&&n.allowStaleOnFetchAbort,Se=H||n.allowStaleOnFetchRejection,Re=Se||n.noDeleteOnFetchRejection,oe=I;if(B(this,nt)[r]===I&&(!Re||oe.__staleWhileFetching===void 0?this.delete(e):H||(B(this,nt)[r]=oe.__staleWhileFetching)),Se)return n.status&&oe.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),oe.__staleWhileFetching;if(oe.__returned===oe)throw N},y=(N,Y)=>{var Se;const H=(Se=B(this,_i))==null?void 0:Se.call(this,e,a,h);H&&H instanceof Promise&&H.then(Re=>N(Re===void 0?void 0:Re),Y),l.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(N(void 0),n.allowStaleOnFetchAbort&&(N=Re=>f(Re,!0)))})};n.status&&(n.status.fetchDispatched=!0);const I=new Promise(y).then(f,d),P=Object.assign(I,{__abortController:l,__staleWhileFetching:a,__returned:void 0});return r===void 0?(this.set(e,P,{...h.options,status:void 0}),r=B(this,Pt).get(e)):B(this,nt)[r]=P,P},St=new WeakSet,Ct=function(e){if(!B(this,xi))return!1;const r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AC},hr=new WeakSet,en=function(e,r){B(this,zt)[r]=e,B(this,Zt)[e]=r},Ri=new WeakSet,nr=function(e){e!==B(this,Mt)&&(e===B(this,Bt)?ze(this,Bt,B(this,Zt)[e]):We(this,hr,en).call(this,B(this,zt)[e],B(this,Zt)[e]),We(this,hr,en).call(this,B(this,Mt),e),ze(this,Mt,e))};let LRUCache=tn;const zcache=new LRUCache({max:1e3,ttl:1e3*60*5});class Ziffers{constructor(e,r={}){$e(this,"values");$e(this,"evaluated");$e(this,"options");$e(this,"index");$e(this,"redo");this.index=0,r={...DEFAULT_OPTIONS,...r},r.scale&&(typeof r.scale=="string"&&(isScale(r.scale)?(r.scaleName=r.scale,r.scale=getScale(r.scale)):r.scale=parse(r.scale)),r.parsedScale=r.scale,delete r.scale),r.redo!==void 0?this.redo=r.redo:this.redo=1,this.options={nodeOptions:r};try{this.values=parse$1(e,this.options),this.evaluated=this.evaluate()}catch(n){console.log(n),this.values=[],this.evaluated=[]}}update(){this.evaluated=this.evaluate()}pitches(){return this.evaluated.map(e=>e.collect("pitch"))}notes(){return this.evaluated.map(e=>e.collect("note"))}freqs(){return this.evaluated.map(e=>e.collect("freq"))}durations(){return this.evaluated.map(e=>e.collect("duration"))}next(){const e=this.evaluated[this.index%this.evaluated.length];return this.index++,this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.index=0,this.update()),e}evaluate(){return this.values.map(e=>e.evaluate()).flat(1/0).filter(e=>e!==void 0)}}const generateCacheKey=(...s)=>s.map(e=>JSON.stringify(e)).join(","),cachedCall=(s,e)=>{const r=generateCacheKey(s,e);if(zcache.has(r))return zcache.get(r);{const n=new Ziffers(s,e);return zcache.set(r,n),n}},next=(s,e={})=>cachedCall(s,e).next();let listenerQueue=[],atom=(s,e)=>{let r,n=[],o={lc:0,l:e||0,value:s,set(a){o.value=a,o.notify()},get(){return o.lc||o.listen(()=>{})(),o.value},notify(a){r=n;let l=!listenerQueue.length;for(let c=0;c{n===r&&(n=n.slice());let c=n.indexOf(a);~c&&(n.splice(c,2),o.lc--,o.lc||o.off())}},subscribe(a,l){let c=o.listen(a,l);return a(o.value),c},off(){}};return o},map=(s={})=>{let e=atom(s);return e.setKey=function(r,n){typeof n>"u"?r in e.value&&(e.value={...e.value},delete e.value[r],e.notify(r)):e.value[r]!==n&&(e.value={...e.value,[r]:n},e.notify(r))},e};if(typeof DelayNode<"u"){class s extends DelayNode{constructor(r,n,o,a){super(r),n=Math.abs(n),this.delayTime.value=o;const l=r.createGain();l.gain.value=Math.min(Math.abs(a),.995),this.feedback=l.gain;const c=r.createGain();return c.gain.value=n,this.delayGain=c,this.connect(l),this.connect(c),l.connect(this),this.connect=h=>c.connect(h),this}start(r){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,r+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,r,n){return new s(this,e,r,n)}}typeof AudioContext<"u"&&(AudioContext.prototype.impulseResponse=function(s,e=1){const r=this.sampleRate*s,n=this.createBuffer(e,r,this.sampleRate),o=n.getChannelData(0);for(let a=0;a(e.buffer=this.impulseResponse(r),e.duration=s,e),e.setDuration(s),e});var q={a:{freqs:[660,1120,2750,3e3,3350],gains:[1,.5012,.0708,.0631,.0126],qs:[80,90,120,130,140]},e:{freqs:[440,1800,2700,3e3,3300],gains:[1,.1995,.1259,.1,.1],qs:[70,80,100,120,120]},i:{freqs:[270,1850,2900,3350,3590],gains:[1,.0631,.0631,.0158,.0158],qs:[40,90,100,120,120]},o:{freqs:[430,820,2700,3e3,3300],gains:[1,.3162,.0501,.0794,.01995],qs:[40,80,100,120,120]},u:{freqs:[370,630,2750,3e3,3400],gains:[1,.1,.0708,.0316,.01995],qs:[40,60,100,120,120]}};if(typeof GainNode<"u"){class s extends GainNode{constructor(r,n){if(super(r),!q[n])throw new Error("vowel: unknown vowel "+n);const{gains:o,qs:a,freqs:l}=q[n],c=r.createGain();for(let h=0;h<5;h++){const f=r.createGain();f.gain.value=o[h];const d=r.createBiquadFilter();d.type="bandpass",d.Q.value=a[h],d.frequency.value=l[h],this.connect(d),d.connect(f),f.connect(c)}return c.gain.value=8,this.connect=h=>c.connect(h),this}}AudioContext.prototype.createVowelFilter=function(e){return new s(this,e)}}const ce=s=>{var o;if(typeof s!="string")return[];const[e,r="",n]=((o=s.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:o.slice(1))||[];return e?[e,r,n?Number(n):void 0]:[]},re={c:0,d:2,e:4,f:5,g:7,a:9,b:11},ie={"#":1,b:-1,s:1,f:-1},L=(s,e=3)=>{const[r,n,o=e]=ce(s);if(!r)throw new Error('not a note: "'+s+'"');const a=re[r.toLowerCase()],l=(n==null?void 0:n.split("").reduce((c,h)=>c+ie[h],0))||0;return(Number(o)+1)*12+a+l},se=s=>Math.pow(2,(s-69)/12)*440,ae=(s,e,r)=>Math.min(Math.max(s,e),r),ge=s=>12*Math.log(s/440)/Math.LN2+69,de=(s,e)=>{if(typeof s!="object")throw new Error("valueToMidi: expected object value");let{freq:r,note:n}=s;if(typeof r=="number")return ge(r);if(typeof n=="string")return L(n);if(typeof n=="number")return n;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},ue="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdGh1Yi5jb20vZGt0cjAvV2ViRGlydC9ibG9iL21haW4vTElDRU5TRQovLyBhbGwgdGhlIGNyZWRpdCBnb2VzIHRvIGRrdHIwJ3Mgd2ViZGlydDogaHR0cHM6Ly9naXRodWIuY29tL2RrdHIwL1dlYkRpcnQvYmxvYi81Y2UzZDY5ODM2MmM1NGQ2ZTFiNjhhY2M0N2ViMjk1NWFjNjJjNzkzL2Rpc3QvQXVkaW9Xb3JrbGV0cy5qcwovLyA8MwoKY2xhc3MgQ29hcnNlUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgZ2V0IHBhcmFtZXRlckRlc2NyaXB0b3JzKCkgewogICAgcmV0dXJuIFt7IG5hbWU6ICdjb2Fyc2UnLCBkZWZhdWx0VmFsdWU6IDEgfV07CiAgfQoKICBjb25zdHJ1Y3RvcigpIHsKICAgIHN1cGVyKCk7CiAgICB0aGlzLm5vdFN0YXJ0ZWQgPSB0cnVlOwogIH0KCiAgcHJvY2VzcyhpbnB1dHMsIG91dHB1dHMsIHBhcmFtZXRlcnMpIHsKICAgIGNvbnN0IGlucHV0ID0gaW5wdXRzWzBdOwogICAgY29uc3Qgb3V0cHV0ID0gb3V0cHV0c1swXTsKICAgIGNvbnN0IGNvYXJzZSA9IHBhcmFtZXRlcnMuY29hcnNlOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBvdXRwdXRbMF1bMF0gPSBpbnB1dFswXVswXTsKICAgICAgZm9yIChsZXQgbiA9IDE7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3V0cHV0Lmxlbmd0aDsgbysrKSB7CiAgICAgICAgICBvdXRwdXRbb11bbl0gPSBuICUgY29hcnNlID09IDAgPyBpbnB1dFswXVtuXSA6IG91dHB1dFtvXVtuIC0gMV07CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ2NvYXJzZS1wcm9jZXNzb3InLCBDb2Fyc2VQcm9jZXNzb3IpOwoKY2xhc3MgQ3J1c2hQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ2NydXNoJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBjcnVzaCA9IHBhcmFtZXRlcnMuY3J1c2g7CiAgICBjb25zdCBibG9ja1NpemUgPSAxMjg7CiAgICBjb25zdCBoYXNJbnB1dCA9ICEoaW5wdXRbMF0gPT09IHVuZGVmaW5lZCk7CiAgICBpZiAoaGFzSW5wdXQpIHsKICAgICAgdGhpcy5ub3RTdGFydGVkID0gZmFsc2U7CiAgICAgIGlmIChjcnVzaC5sZW5ndGggPT09IDEpIHsKICAgICAgICBjb25zdCB4ID0gTWF0aC5wb3coMiwgY3J1c2hbMF0gLSAxKTsKICAgICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgICBjb25zdCB2YWx1ZSA9IE1hdGgucm91bmQoaW5wdXRbMF1bbl0gKiB4KSAvIHg7CiAgICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgICBvdXRwdXRbb11bbl0gPSB2YWx1ZTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yIChsZXQgbiA9IDA7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgICAgbGV0IHggPSBNYXRoLnBvdygyLCBjcnVzaFtuXSAtIDEpOwogICAgICAgICAgY29uc3QgdmFsdWUgPSBNYXRoLnJvdW5kKGlucHV0WzBdW25dICogeCkgLyB4OwogICAgICAgICAgZm9yIChsZXQgbyA9IDA7IG8gPCBvdXRwdXQubGVuZ3RoOyBvKyspIHsKICAgICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQpyZWdpc3RlclByb2Nlc3NvcignY3J1c2gtcHJvY2Vzc29yJywgQ3J1c2hQcm9jZXNzb3IpOwoKY2xhc3MgU2hhcGVQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ3NoYXBlJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBzaGFwZTAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function k(s){const e=C().createGain();return e.gain.value=s,e}const Ie=({s,freq:e,t:r})=>{const n=C().createOscillator();return n.type=s||"triangle",n.frequency.value=Number(e),n.start(r),{node:n,stop:o=>n.stop(o)}},ee=(s,e,r,n,o,a)=>{const l=C().createGain();return l.gain.setValueAtTime(0,a),l.gain.linearRampToValueAtTime(o,a+s),l.gain.linearRampToValueAtTime(r*o,a+s+e),{node:l,stop:c=>{l.gain.setValueAtTime(r*o,c),l.gain.linearRampToValueAtTime(0,c+n)}}},Q=(s,e,r)=>{const n=C().createBiquadFilter();return n.type=s,n.frequency.value=e,n.Q.value=r,n},E=map();function te(s,e,r={}){E.setKey(s,{onTrigger:e,data:r})}function U(s){return E.get()[s]}let J;const C=()=>(J||(J=new AudioContext),J);let W;const j=()=>{const s=C();return W||(W=s.createGain(),W.connect(s.destination)),W};let D;function le(){return D||(D=C().audioWorklet.addModule(ue),D)}function x(s,e,r){const n=new AudioWorkletNode(s,e);return Object.entries(r).forEach(([o,a])=>{n.parameters.get(o).value=a}),n}async function Ce(s={}){const{disableWorklets:e=!1}=s;typeof window<"u"&&(await C().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await le().catch(r=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",r)}))}async function ve(s){return new Promise(e=>{document.addEventListener("click",async function r(){await Ce(s),e(),document.removeEventListener("click",r)})})}let G={};function fe(s,e,r,n){var o;if(r=ae(r,0,.98),!G[s]){const a=C().createFeedbackDelay(1,e,r);(o=a.start)==null||o.call(a,n),a.connect(j()),G[s]=a}return G[s].delayTime.value!==e&&G[s].delayTime.setValueAtTime(e,n),G[s].feedback.value!==r&&G[s].feedback.setValueAtTime(r,n),G[s]}let w={};function Ae(s,e=2){if(!w[s]){const r=C().createReverb(e);r.connect(j()),w[s]=r}return w[s].duration!==e&&(w[s]=w[s].setDuration(e),w[s].duration=e),w[s]}function _(s,e,r){const n=k(r);return s.connect(n),n.connect(e),n}const he=async(s,e,r)=>{const n=C();if(typeof s!="object")throw new Error(`expected hap.value to be an object, but got "${s}". Hint: append .note() or .s() to the end`,"error");let o=n.currentTime+e,{s:a="triangle",bank:l,source:c,gain:h=.8,cutoff:f,resonance:d=1,hcutoff:g,hresonance:y=1,bandf:I,bandq:P=1,coarse:N,crush:Y,shape:H,pan:Se,vowel:Re,delay:oe=0,delayfeedback:ke=.5,delaytime:Te=.25,orbit:Qe=1,room:Ve,size:Ze=2,velocity:De=1}=s;h*=De;let je=[];const at=()=>{je.forEach(ut=>ut==null?void 0:ut.disconnect())};l&&a&&(a=`${l}_${a}`);let tt;if(c)tt=c(o,s,r);else if(U(a)){const{onTrigger:ut}=U(a),ct=await ut(o,s,at);ct&&(tt=ct.node,ct.stop(o+r))}else throw new Error(`sound ${a} not found! Is it loaded?`);if(!tt||n.currentTime>o)return;const qe=[];if(qe.push(tt),qe.push(k(h)),f!==void 0&&qe.push(Q("lowpass",f,d)),g!==void 0&&qe.push(Q("highpass",g,y)),I!==void 0&&qe.push(Q("bandpass",I,P)),Re!==void 0&&qe.push(n.createVowelFilter(Re)),N!==void 0&&qe.push(x(n,"coarse-processor",{coarse:N})),Y!==void 0&&qe.push(x(n,"crush-processor",{crush:Y})),H!==void 0&&qe.push(x(n,"shape-processor",{shape:H})),Se!==void 0){const ut=n.createStereoPanner();ut.pan.value=2*Se-1,qe.push(ut)}const ht=k(1);qe.push(ht),ht.connect(j());let Je;if(oe>0&&Te>0&&ke>0){const ut=fe(Qe,Te,ke,o);Je=_(ht,ut,oe)}let pt;if(Ve>0&&Ze>0){const ut=Ae(Qe,Ze);pt=_(ht,ut,Ve)}qe.slice(1).reduce((ut,ct)=>ut.connect(ct),qe[0]),je=qe.concat([Je,pt])},O={};function pe(s,e){var r=e?1e3:1024;if(s=r);return s.toFixed(1)+" "+n[o]}const be=async(s,e,r,n,o,a,l)=>{let c=0,h=de({freq:o,note:r},36);c=h-36;const f=C();let d;if(Array.isArray(a))d=a[e%a.length];else{const P=Y=>L(Y)-h,N=Object.keys(a).filter(Y=>!Y.startsWith("_")).reduce((Y,H,Se)=>!Y||Math.abs(P(H))(O[s]||(O[s]=fetch(s).then(o=>o.arrayBuffer()).then(async o=>(pe(o.byteLength),await e.decodeAudioData(o)))),O[s]);function ye(s){const e=C(),r=e.createBuffer(s.numberOfChannels,s.length,e.sampleRate);for(let n=0;nObject.entries(s).forEach(([n,o])=>{if(typeof o=="string"&&(o=[o]),typeof o!="object")throw new Error("wrong sample map format for "+n);r=o._base||r;const a=l=>(r+l).replace("github:","https://raw.githubusercontent.com/");Array.isArray(o)?o=o.map(a):o=Object.fromEntries(Object.entries(o).map(([l,c])=>[l,(typeof c=="string"?[c]:c).map(a)])),e(n,o)});let ne={};function Ge(s){const e=Object.entries(ne).find(([r])=>s.startsWith(r));if(e)return e[1]}const we=async(s,e=s._base||"",r={})=>{if(typeof s=="string"){const a=Ge(s);if(a)return a(s);if(s.startsWith("github:")){let[c,h]=s.split("github:");h=h.endsWith("/")?h.slice(0,-1):h,s=`https://raw.githubusercontent.com/${h}/strudel.json`}if(typeof fetch!="function")return;const l=s.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(s).then(c=>c.json()).then(c=>we(c,e||c._base||l,r)).catch(c=>{throw console.error(c),new Error(`error loading "${s}"`)})}const{prebake:n,tag:o}=r;me(s,(a,l)=>te(a,(c,h,f)=>Xe(c,h,f,l),{type:"sample",samples:l,baseUrl:e,prebake:n,tag:o}),e)},$=[];async function Xe(s,e,r,n,o){const{s:a,freq:l,unit:c,nudge:h=0,cut:f,loop:d,clip:g=void 0,n:y=0,note:I,speed:P=1,begin:N=0,end:Y=1}=e;if(P===0)return;const H=C(),{attack:Se=.001,decay:Re=.001,sustain:oe=1,release:ke=.001}=e,Te=s+h,Qe=await be(a,y,I,P,l,n,o);if(H.currentTime>s||!Qe)return;Qe.playbackRate.value=Math.abs(P)*Qe.playbackRate.value,c==="c"&&(Qe.playbackRate.value=Qe.playbackRate.value*Qe.buffer.duration*1);const Ve=N*Qe.buffer.duration;Qe.start(Te,Ve);const Ze=Qe.buffer.duration/Qe.playbackRate.value,{node:De,stop:je}=ee(Se,Re,oe,ke,1,s);Qe.connect(De);const at=H.createGain();De.connect(at),Qe.onended=function(){Qe.disconnect(),De.disconnect(),at.disconnect(),r()};const tt={node:at,bufferSource:Qe,stop:(qe,ht=g===void 0)=>{let Je=qe;ht&&(Je=s+(Y-N)*Ze),Qe.stop(Je+ke),je(Je)}};if(f!==void 0){const qe=$[f];qe&&(qe.node.gain.setValueAtTime(1,Te),qe.node.gain.linearRampToValueAtTime(0,Te+.01)),$[f]=tt}return tt}function Ke(){["sine","square","triangle","sawtooth"].forEach(s=>{te(s,(e,r,n)=>{const{attack:o=.001,decay:a=.05,sustain:l=.6,release:c=.01}=r;let{n:h,note:f,freq:d}=r;h=f||h||36,typeof h=="string"&&(h=L(h)),!d&&typeof h=="number"&&(d=se(h));const{node:g,stop:y}=Ie({t:e,s,freq:d}),I=k(.3),{node:P,stop:N}=ee(o,a,l,c,1,e);return g.onended=()=>{g.disconnect(),I.disconnect(),n()},{node:g.connect(I).connect(P),stop:Y=>{N(Y),y(Y+c)}}},{type:"synth",prebake:!0})})}Array.prototype.in=function(s){return this.includes(s)};Promise.all([ve(),we("github:tidalcycles/Dirt-Samples/master"),we("github:kindohm/expedition/tree/master/samples"),Ke()]);class UserAPI{constructor(e){$e(this,"variables",{});$e(this,"iterators",{});$e(this,"_drunk",new DrunkWalk(-100,100,!1));$e(this,"MidiConnection",new MidiConnection);$e(this,"load");$e(this,"log",console.log);$e(this,"scale",scale);$e(this,"s",this.script);$e(this,"cs",this.clearscript);$e(this,"cps",this.copyscript);$e(this,"$",this.iterator);$e(this,"v",this.variable);$e(this,"dv",this.delete_variable);$e(this,"cv",this.clear_variables);$e(this,"rI",this.randI);$e(this,"r",this.rand);$e(this,"quant",this.quantize);$e(this,"cmp",this.clamp);$e(this,"tempo",this.bpm);$e(this,"silence",this.stop);$e(this,"hush",this.stop);$e(this,"abs",Math.abs);$e(this,"sound",async(e,r=0)=>{he(e,r)});$e(this,"d",this.sound);this.app=e,this.load=we("github:tidalcycles/Dirt-Samples/master")}get time(){return this.app.audioContext.currentTime}get mouseX(){return this.app._mouseX}get mouseY(){return this.app._mouseY}rate(e){}script(...e){e.forEach(r=>{tryEvaluate(this.app,this.app.universes[this.app.selected_universe].locals[r])})}clearscript(e){this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}}copyscript(e,r){this.app.universes[this.app.selected_universe].locals[r]=this.app.universes[this.app.selected_universe].locals[e]}midi_outputs(){return console.log(this.MidiConnection.listMidiOutputs()),this.MidiConnection.midiOutputs}midi_output(e){e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())}note(e,r={}){const n=r.channel?r.channel:0,o=r.velocity?r.velocity:100,a=r.duration?r.duration:.5;this.MidiConnection.sendMidiNote(e,n,o,a)}zn(e,r={}){const n=next(e,r),o=r.channel?r.channel:0,a=r.velocity?r.velocity:100,l=r.sustain?r.sustain:.5;return n instanceof Pitch?(n.bend&&this.MidiConnection.sendPitchBend(n.bend,o),this.MidiConnection.sendMidiNote(n.note,o,a,l),n.bend&&this.MidiConnection.sendPitchBend(8192,o)):n instanceof Chord&&n.pitches.forEach(c=>{c.bend&&this.MidiConnection.sendPitchBend(c.bend,o),this.MidiConnection.sendMidiNote(c.note,o,a,l),c.bend&&this.MidiConnection.sendPitchBend(8192,o)}),n}sysex(e){this.MidiConnection.sendSysExMessage(e)}pitch_bend(e,r){this.MidiConnection.sendPitchBend(e,r)}program_change(e,r){this.MidiConnection.sendProgramChange(e,r)}midi_clock(){this.MidiConnection.sendMidiClock()}cc(e,r){this.MidiConnection.sendMidiControlChange(e,r)}midi_panic(){this.MidiConnection.panic()}iterator(e,r,n){return e in this.iterators?(this.iterators[e].limit!==r&&(this.iterators[e].value=0,this.iterators[e].limit=r),this.iterators[e].step!==n&&(this.iterators[e].step=n??this.iterators[e].step),this.iterators[e].value+=this.iterators[e].step,this.iterators[e].limit!==void 0&&this.iterators[e].value>this.iterators[e].limit&&(this.iterators[e].value=0)):this.iterators[e]={value:0,step:n??1,limit:r},this.iterators[e].value}get drunk(){return this._drunk.step(),this._drunk.getPosition()}set drunk(e){this._drunk.position=e}set drunk_max(e){this._drunk.max=e}set drunk_min(e){this._drunk.min=e}set drunk_wrap(e){this._drunk.toggleWrap(e)}variable(e,r){return typeof e=="string"&&r===void 0?this.variables[e]:(this.variables[e]=r,this.variables[e])}delete_variable(e){delete this.variables[e]}clear_variables(){this.variables={}}pick(...e){return e[Math.floor(Math.random()*e.length)]}seqbeat(...e){return e[this.app.clock.time_position.beat%e.length]}mel(e,r){return r[e%r.length]}seqbar(...e){return e[this.app.clock.time_position.bar%e.length]}seqpulse(...e){return e[this.app.clock.time_position.pulse%e.length]}randI(e,r){return Math.floor(Math.random()*(r-e+1))+e}rand(e,r){return Math.random()*(r-e)+e}quantize(e,r){if(r.length===0)return e;let n=r[0];return r.forEach(o=>{Math.abs(o-e)500)&&console.log(`Setting bpm to ${e}`),this.app.clock.bpm=e,e)}time_signature(e,r){this.app.clock.time_signature=[e,r]}almostNever(){return Math.random()>.9}sometimes(){return Math.random()>.5}rarely(){return Math.random()>.75}often(){return Math.random()>.25}almostAlways(){return Math.random()>.1}dice(e){return Math.floor(Math.random()*e)+1}get i(){return this.app.universes[this.app.selected_universe].global.evaluations}set i(e){this.app.universes[this.app.selected_universe].global.evaluations=e}get bar(){return this.app.clock.time_position.bar}get tick(){return this.app.clock.tick}get pulse(){return this.app.clock.time_position.pulse}get beat(){return this.app.clock.time_position.beat}get ebeat(){return this.app.clock.beats_since_origin}onbar(e,...r){const n=[...Array(e).keys()].map(o=>o+1);return console.log(r.some(o=>n.includes(o%e))),r.some(o=>n.includes(o%e))}onbeat(...e){let r=[];return e.forEach(n=>{n=1+n%this.app.clock.time_signature[0];let o=Math.floor(n),a=n-o;r.push(o===this.app.clock.time_position.beat&&this.app.clock.time_position.pulse===a*this.app.clock.ppqn)}),r.some(n=>n==!0)}stop(){this.app.clock.pause(),this.app.setButtonHighlighting("pause",!0)}prob(e){return Math.random()*100.5}min(...e){return Math.min(...e)}max(...e){return Math.max(...e)}limit(e,r,n){return Math.min(Math.max(e,r),n)}delay(e,r){setTimeout(r,e)}delayr(e,r,n){[...Array(r).keys()].map(a=>e*a).forEach((a,l)=>{setTimeout(n,a)})}mod(...e){return e.some(r=>this.app.clock.time_position.pulse%r===0)}modbar(...e){return e.some(r=>this.app.clock.time_position.bar%r===0)}euclid(e,r,n,o=0){return this._euclidean_cycle(r,n,o)[e%n]}_euclidean_cycle(e,r,n=0){function o(c,h){const f=c.length,d=(h+1)%f;return c[h]>c[d]}if(e>=r)return[!0];const a=Array.from({length:r},(c,h)=>(e*(h-1)%r+r)%r);let l=a.map((c,h)=>o(a,h));return n!=0&&(l=l.slice(n).concat(l.slice(0,n))),l}bin(e,r){let o=r.toString(2).split("").map(a=>a==="1");return o[e%o.length]}line(e,r,n=1){const o=[];if(r>e&&n>0||r0?1:-1}noise(){return Math.random()*2-1}}class Editor{constructor(){$e(this,"universes",template_universes);$e(this,"selected_universe");$e(this,"local_index",1);$e(this,"editor_mode","local");$e(this,"fontSize");$e(this,"withLineNumbers");$e(this,"vimModeCompartment");$e(this,"chosenLanguage");$e(this,"settings",new AppSettings);$e(this,"editorExtensions",[]);$e(this,"userPlugins",[]);$e(this,"state");$e(this,"api");$e(this,"audioContext");$e(this,"view");$e(this,"clock");$e(this,"manualPlay",!1);$e(this,"_mouseX",0);$e(this,"_mouseY",0);$e(this,"play_buttons",[document.getElementById("play-button-1"),document.getElementById("play-button-2")]);$e(this,"pause_buttons",[document.getElementById("pause-button-1"),document.getElementById("pause-button-2")]);$e(this,"stop_buttons",[document.getElementById("stop-button-1"),document.getElementById("stop-button-2")]);$e(this,"clear_buttons",[document.getElementById("clear-button-1"),document.getElementById("clear-button-2")]);$e(this,"local_button",document.getElementById("local-button"));$e(this,"global_button",document.getElementById("global-button"));$e(this,"init_button",document.getElementById("init-button"));$e(this,"note_button",document.getElementById("note-button"));$e(this,"settings_button",document.getElementById("settings-button"));$e(this,"close_settings_button",document.getElementById("close-settings-button"));$e(this,"universe_viewer",document.getElementById("universe-viewer"));$e(this,"buffer_modal",document.getElementById("modal-buffers"));$e(this,"buffer_search",document.getElementById("buffer-search"));$e(this,"local_script_tabs",document.getElementById("local-script-tabs"));$e(this,"font_size_slider",document.getElementById("font-size-slider"));$e(this,"font_size_witness",document.getElementById("font-size-witness"));$e(this,"line_numbers_checkbox",document.getElementById("show-line-numbers"));$e(this,"normal_mode_button",document.getElementById("normal-mode"));$e(this,"vim_mode_button",document.getElementById("vim-mode"));this.selected_universe=this.settings.selected_universe,this.universe_viewer.innerHTML=`Topos: ${this.selected_universe}`,this.universes={...template_universes,...this.settings.universes},this.audioContext=new AudioContext({latencyHint:"playback"}),this.clock=new Clock(this,this.audioContext),this.api=new UserAPI(this),this.vimModeCompartment=new Compartment,this.withLineNumbers=new Compartment,this.chosenLanguage=new Compartment,this.fontSize=new Compartment;const e=this.settings.vimMode?vim():[],r=this.settings.line_numbers?lineNumbers():[],n=EditorView.theme({"&":{fontSize:`${this.settings.font_size}px`},".cm-gutters":{fontSize:`${this.settings.font_size}px`}});this.editorExtensions=[this.withLineNumbers.of(r),this.fontSize.of(n),this.vimModeCompartment.of(e),editorSetup,oneDark,this.chosenLanguage.of(javascript()),EditorView.updateListener.of(l=>{})];let o=new Compartment;this.state=EditorState.create({extensions:[...this.editorExtensions,EditorView.lineWrapping,o.of(this.userPlugins)],doc:this.universes[this.selected_universe].locals[this.local_index].candidate}),this.view=new EditorView({parent:document.getElementById("editor"),state:this.state}),document.addEventListener("keydown",l=>{l.key==="Tab"&&l.preventDefault(),l.ctrlKey&&l.key==="s"&&(l.preventDefault(),this.setButtonHighlighting("pause",!0),this.clock.pause()),l.ctrlKey&&l.key==="r"&&(l.preventDefault(),this.setButtonHighlighting("stop",!0),this.clock.stop()),l.ctrlKey&&l.key==="p"&&(l.preventDefault(),this.setButtonHighlighting("play",!0),this.clock.start()),(l.key==="v"||l.key==="V")&&l.ctrlKey&&l.shiftKey&&(this.settings.vimMode=!this.settings.vimMode,l.preventDefault(),this.userPlugins=this.settings.vimMode?[]:[vim()],this.view.dispatch({effects:o.reconfigure(this.userPlugins)})),(l.key==="Enter"||l.key==="Return")&&l.ctrlKey&&(l.preventDefault(),this.currentFile().candidate=this.view.state.doc.toString(),this.flashBackground("#2d313d",200)),(l.key==="Enter"&&l.shiftKey||l.key==="e"&&l.ctrlKey)&&(l.preventDefault(),this.currentFile().candidate=this.view.state.doc.toString(),this.flashBackground("#2d313d",200)),l.ctrlKey&&l.key==="b"&&this.openBuffersModal(),l.shiftKey&&l.key==="Escape"&&this.openSettingsModal(),l.ctrlKey&&l.key==="l"&&(l.preventDefault(),this.changeModeFromInterface("local"),this.view.focus()),l.ctrlKey&&l.key==="n"&&(l.preventDefault(),this.changeModeFromInterface("notes"),this.view.focus()),l.ctrlKey&&l.key==="g"&&(l.preventDefault(),this.changeModeFromInterface("global"),this.view.focus()),l.ctrlKey&&l.key==="i"&&(l.preventDefault(),this.changeModeFromInterface("init"),this.changeToLocalBuffer(0),this.view.focus()),[112,113,114,115,116,117,118,119,120].forEach((c,h)=>{l.keyCode===c&&(l.preventDefault(),l.ctrlKey?this.api.script(c-111):(this.changeModeFromInterface("local"),this.changeToLocalBuffer(h)))}),l.keyCode==121&&this.changeModeFromInterface("global"),l.keyCode==122&&this.changeModeFromInterface("init")});const a=document.querySelectorAll('[id^="tab-"]');for(let l=0;l{a[l].classList.add("bg-orange-300");for(let d=0;d{l.addEventListener("click",()=>{this.setButtonHighlighting("play",!0),this.clock.start()})}),this.clear_buttons.forEach(l=>{l.addEventListener("click",()=>{this.setButtonHighlighting("clear",!0),confirm("Do you want to reset the current universe?")&&(this.universes[this.selected_universe]=template_universe,this.updateEditorView())})}),this.pause_buttons.forEach(l=>{l.addEventListener("click",()=>{this.setButtonHighlighting("pause",!0),this.clock.pause()})}),this.stop_buttons.forEach(l=>{l.addEventListener("click",()=>{this.setButtonHighlighting("stop",!0),this.clock.stop()})}),this.local_button.addEventListener("click",()=>this.changeModeFromInterface("local")),this.global_button.addEventListener("click",()=>this.changeModeFromInterface("global")),this.init_button.addEventListener("click",()=>this.changeModeFromInterface("init")),this.note_button.addEventListener("click",()=>this.changeModeFromInterface("notes")),this.settings_button.addEventListener("click",()=>{var h;this.font_size_slider.value=this.settings.font_size.toString(),this.font_size_witness.innerHTML=`Font Size: ${this.settings.font_size}px`,(h=this.font_size_witness)==null||h.setAttribute("style",`font-size: ${this.settings.font_size}px;`),this.line_numbers_checkbox.checked=this.settings.line_numbers;let l=document.getElementById("modal-settings"),c=document.getElementById("editor");l==null||l.classList.remove("invisible"),c==null||c.classList.add("invisible")}),this.close_settings_button.addEventListener("click",()=>{let l=document.getElementById("modal-settings"),c=document.getElementById("editor");l==null||l.classList.add("invisible"),c==null||c.classList.remove("invisible")}),this.font_size_slider.addEventListener("input",()=>{const l=this.font_size_slider.value;this.settings.font_size=parseInt(l),this.font_size_witness.style.fontSize=`${l}px`,this.font_size_witness.innerHTML=`Font Size: ${l}px`;let c=EditorView.theme({"&":{fontSize:l+"px"},".cm-gutters":{fontSize:l+"px"}});this.view.dispatch({effects:this.fontSize.reconfigure(c)}),this.settings.font_size=parseInt(l)}),this.normal_mode_button.addEventListener("click",()=>{this.settings.vimMode=!1,this.view.dispatch({effects:this.vimModeCompartment.reconfigure([])})}),this.line_numbers_checkbox.addEventListener("change",()=>{let l=!!this.line_numbers_checkbox.checked;this.settings.line_numbers=l,this.view.dispatch({effects:this.withLineNumbers.reconfigure(l?[lineNumbers()]:[])})}),this.vim_mode_button.addEventListener("click",()=>{this.settings.vimMode=!0,this.view.dispatch({effects:this.vimModeCompartment.reconfigure(vim())})}),this.buffer_search.addEventListener("keydown",l=>{if(l.key==="Enter"){let c=this.buffer_search.value;c.length>2&&c.length<20&&(this.loadUniverse(c),this.settings.selected_universe=c,this.buffer_search.value="",this.closeBuffersModal(),this.view.focus())}}),tryEvaluate(this,this.universes[this.selected_universe.toString()].init)}get note_buffer(){return this.universes[this.selected_universe.toString()].notes}get global_buffer(){return this.universes[this.selected_universe.toString()].global}get init_buffer(){return this.universes[this.selected_universe.toString()].init}get local_buffer(){return this.universes[this.selected_universe.toString()].locals[this.local_index]}changeToLocalBuffer(e){const r=document.querySelectorAll('[id^="tab-"]'),n=r[e];n.classList.add("bg-orange-300");for(let a=0;a{r.forEach(a=>{let l=a.children[0];l.classList.contains("text-orange-300")&&(l.classList.remove("text-orange-300"),a.classList.remove("text-orange-300"))}),o.children[0].classList.remove("text-white"),o.children[0].classList.add("text-orange-300"),o.classList.add("text-orange-300")};switch(e){case"local":this.local_script_tabs.classList.contains("hidden")&&this.local_script_tabs.classList.remove("hidden"),this.editor_mode="local",this.local_index=0,this.changeToLocalBuffer(this.local_index),n(this.local_button);break;case"global":this.local_script_tabs.classList.contains("hidden")||this.local_script_tabs.classList.add("hidden"),this.editor_mode="global",n(this.global_button);break;case"init":this.local_script_tabs.classList.contains("hidden")||this.local_script_tabs.classList.add("hidden"),this.editor_mode="init",n(this.init_button);break;case"notes":this.local_script_tabs.classList.contains("hidden")||this.local_script_tabs.classList.add("hidden"),this.editor_mode="notes",n(this.note_button);break}this.view.dispatch({effects:this.chosenLanguage.reconfigure(this.editor_mode=="notes"?[markdown()]:[javascript()])}),this.updateEditorView()}setButtonHighlighting(e,r){this.flashBackground("#2d313d",200);const n=['[id^="play-button-"]','[id^="pause-button-"]','[id^="clear-button-"]','[id^="stop-button-"]'];let o;switch(e){case"play":o=0;break;case"pause":o=1;break;case"clear":o=2;break;case"stop":o=3;break}document.querySelectorAll(n[o]).forEach(a=>{r&&a.children[0].classList.add("fill-orange-300")}),document.querySelectorAll(n.filter((a,l)=>l!=o).join(",")).forEach(a=>{a.children[0].classList.remove("fill-orange-300"),a.children[0].classList.remove("text-orange-300"),a.children[0].classList.remove("bg-orange-300")})}unfocusPlayButtons(){document.querySelectorAll('[id^="play-button-"]').forEach(e=>{e.children[0].classList.remove("fill-orange-300")})}updateEditorView(){this.view.dispatch({changes:{from:0,to:this.view.state.doc.toString().length,insert:this.currentFile().candidate}})}currentFile(){switch(this.editor_mode){case"global":return this.global_buffer;case"local":return this.local_buffer;case"init":return this.init_buffer;case"notes":return this.note_buffer}}loadUniverse(e){this.currentFile().candidate=this.view.state.doc.toString();let r=e.trim();this.universes[r]===void 0&&(this.universes[r]=template_universe),this.selected_universe=r,this.settings.selected_universe=this.selected_universe,this.universe_viewer.innerHTML=`Topos: ${r}`,this.updateEditorView(),tryEvaluate(this,this.universes[this.selected_universe.toString()].init)}openSettingsModal(){document.getElementById("modal-settings").classList.contains("invisible")?(document.getElementById("editor").classList.add("invisible"),document.getElementById("modal-settings").classList.remove("invisible")):this.closeSettingsModal()}closeSettingsModal(){document.getElementById("editor").classList.remove("invisible"),document.getElementById("modal-settings").classList.add("invisible")}openBuffersModal(){document.getElementById("modal-buffers").classList.contains("invisible")?(document.getElementById("editor").classList.add("invisible"),document.getElementById("modal-buffers").classList.remove("invisible"),document.getElementById("buffer-search").focus()):this.closeBuffersModal()}closeBuffersModal(){document.getElementById("buffer-search").value="",document.getElementById("editor").classList.remove("invisible"),document.getElementById("modal").classList.add("invisible"),document.getElementById("modal-buffers").classList.add("invisible")}flashBackground(e,r){this.view.dom.style.backgroundColor=e;const n=this.view.dom.getElementsByClassName("cm-gutter");Array.from(n).forEach(o=>o.style.backgroundColor=e),setTimeout(()=>{this.view.dom.style.backgroundColor="",Array.from(n).forEach(o=>o.style.backgroundColor="")},r)}}const app=new Editor;function startClock(){document.getElementById("editor").classList.remove("invisible"),document.getElementById("modal").classList.add("hidden"),document.getElementById("modal-container").classList.remove("motion-safe:animate-pulse"),document.getElementById("start-button").removeEventListener("click",startClock),document.removeEventListener("click",startClock),document.removeEventListener("keydown",startOnEnter),document.removeEventListener("click",startOnClick),app.clock.start(),app.view.focus(),app.setButtonHighlighting("play",!0)}function startOnEnter(s){(s.code==="Enter"||s.code==="Space")&&startClock()}function startOnClick(s){s.button===0&&startClock()}document.addEventListener("keydown",startOnEnter);document.addEventListener("click",startOnClick);function reportMouseCoordinates(s){app._mouseX=s.clientX,app._mouseY=s.clientY}window.addEventListener("mousemove",reportMouseCoordinates);window.addEventListener("beforeunload",()=>(event.preventDefault(),app.currentFile().candidate=app.view.state.doc.toString(),app.currentFile().committed=app.view.state.doc.toString(),app.settings.saveApplicationToLocalStorage(app.universes,app.settings),app.clock.stop(),null)); +`],!1,!1),peg$e1=peg$literalExpectation("(",!1),peg$e2=peg$literalExpectation(",",!1),peg$e3=peg$literalExpectation(")",!1),peg$e4=peg$classExpectation([["0","9"]],!1,!1),peg$e5=peg$literalExpectation(".",!1),peg$e6=peg$literalExpectation("-",!1),peg$e7=peg$literalExpectation("/",!1),peg$e8=peg$literalExpectation("\\",!1),peg$e9=peg$literalExpectation("<",!1),peg$e10=peg$literalExpectation(">",!1),peg$e11=peg$literalExpectation("[",!1),peg$e12=peg$literalExpectation("+",!1),peg$e13=peg$literalExpectation("*",!1),peg$e14=peg$literalExpectation("%",!1),peg$e15=peg$literalExpectation("&",!1),peg$e16=peg$literalExpectation("|",!1),peg$e17=peg$literalExpectation("<<",!1),peg$e18=peg$literalExpectation(">>",!1),peg$f0=function(s){return centsToSemitones(s.filter(e=>e))},peg$f1=function(){},peg$f2=function(s,e){return Math.floor(Math.random()*(e-s+1)+s)},peg$f3=function(s,e){return Math.random()*(e-s)+s},peg$f4=function(){return parseFloat(text())},peg$f5=function(){return parseInt(text())},peg$f6=function(s){return ratioToCents(s)},peg$f7=function(s,e){return s/e},peg$f8=function(s,e){return Math.pow(2,s/e)},peg$f9=function(s,e,r,n){var o=n?r/n:r;return Math.pow(o,s/e)},peg$f10=function(s,e){return parseFloat(s.toString()+"."+e.toString())},peg$f11=function(s){return s.filter(e=>e)},peg$f12=function(s){return monzoToCents(s)},peg$f13=function(){return eval(text())},peg$currPos=0,peg$savedPos=0,peg$posDetailsCache=[{line:1,column:1}],peg$maxFailPos=0,peg$maxFailExpected=[],peg$resultsCache={},peg$result;if("startRule"in options){if(!(options.startRule in peg$startRuleFunctions))throw new Error(`Can't start parsing from rule "`+options.startRule+'".');peg$startRuleFunction=peg$startRuleFunctions[options.startRule]}function text(){return input.substring(peg$savedPos,peg$currPos)}function peg$literalExpectation(s,e){return{type:"literal",text:s,ignoreCase:e}}function peg$classExpectation(s,e,r){return{type:"class",parts:s,inverted:e,ignoreCase:r}}function peg$endExpectation(){return{type:"end"}}function peg$computePosDetails(s){var e=peg$posDetailsCache[s],r;if(e)return e;for(r=s-1;!peg$posDetailsCache[r];)r--;for(e=peg$posDetailsCache[r],e={line:e.line,column:e.column};rpeg$maxFailPos&&(peg$maxFailPos=peg$currPos,peg$maxFailExpected=[]),peg$maxFailExpected.push(s))}function peg$buildStructuredError(s,e,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(s,e),s,e,r)}function peg$parselines(){var s,e,r,n=peg$currPos*17+0,o=peg$resultsCache[n];if(o)return peg$currPos=o.nextPos,o.result;if(s=peg$currPos,e=[],r=peg$parseratio(),r===peg$FAILED&&(r=peg$parsevalue(),r===peg$FAILED&&(r=peg$parsemonzo(),r===peg$FAILED&&(r=peg$parseoperation(),r===peg$FAILED&&(r=peg$parsesep())))),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),r=peg$parseratio(),r===peg$FAILED&&(r=peg$parsevalue(),r===peg$FAILED&&(r=peg$parsemonzo(),r===peg$FAILED&&(r=peg$parseoperation(),r===peg$FAILED&&(r=peg$parsesep()))));else e=peg$FAILED;return e!==peg$FAILED&&(peg$savedPos=s,e=peg$f0(e)),s=e,peg$resultsCache[n]={nextPos:peg$currPos,result:s},s}function peg$parsesep(){var s,e,r=peg$currPos*17+1,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(s=peg$currPos,peg$r0.test(input.charAt(peg$currPos))?(e=input.charAt(peg$currPos),peg$currPos++):(e=peg$FAILED,peg$fail(peg$e0)),e!==peg$FAILED&&(peg$savedPos=s,e=peg$f1()),s=e,peg$resultsCache[r]={nextPos:peg$currPos,result:s},s)}function peg$parsevalue(){var s,e=peg$currPos*17+2,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(s=peg$parsefloat(),s===peg$FAILED&&(s=peg$parseint(),s===peg$FAILED&&(s=peg$parserandom_int(),s===peg$FAILED&&(s=peg$parserandom_float()))),peg$resultsCache[e]={nextPos:peg$currPos,result:s},s)}function peg$parserandom_int(){var s,e,r,n,o,a,l=peg$currPos*17+3,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(s=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parseint(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(n=peg$c1,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e2)),n!==peg$FAILED?(o=peg$parseint(),o!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(a=peg$c2,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e3)),a!==peg$FAILED?(peg$savedPos=s,s=peg$f2(r,o)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:s},s)}function peg$parserandom_float(){var s,e,r,n,o,a,l=peg$currPos*17+4,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(s=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parsefloat(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(n=peg$c1,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e2)),n!==peg$FAILED?(o=peg$parsefloat(),o!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(a=peg$c2,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e3)),a!==peg$FAILED?(peg$savedPos=s,s=peg$f3(r,o)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:s},s)}function peg$parsefloat(){var s,e,r,n,o,a,l,c=peg$currPos*17+5,h=peg$resultsCache[c];if(h)return peg$currPos=h.nextPos,h.result;if(s=peg$currPos,e=peg$currPos,r=[],peg$r1.test(input.charAt(peg$currPos))?(n=input.charAt(peg$currPos),peg$currPos++):(n=peg$FAILED,peg$fail(peg$e4)),n!==peg$FAILED)for(;n!==peg$FAILED;)r.push(n),peg$r1.test(input.charAt(peg$currPos))?(n=input.charAt(peg$currPos),peg$currPos++):(n=peg$FAILED,peg$fail(peg$e4));else r=peg$FAILED;if(r!==peg$FAILED?(input.charCodeAt(peg$currPos)===46?(n=peg$c3,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e5)),n!==peg$FAILED?(r=[r,n],e=r):(peg$currPos=e,e=peg$FAILED)):(peg$currPos=e,e=peg$FAILED),e===peg$FAILED){for(e=peg$currPos,input.charCodeAt(peg$currPos)===45?(r=peg$c4,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e6)),r===peg$FAILED&&(r=null),n=[],peg$r1.test(input.charAt(peg$currPos))?(o=input.charAt(peg$currPos),peg$currPos++):(o=peg$FAILED,peg$fail(peg$e4));o!==peg$FAILED;)n.push(o),peg$r1.test(input.charAt(peg$currPos))?(o=input.charAt(peg$currPos),peg$currPos++):(o=peg$FAILED,peg$fail(peg$e4));if(input.charCodeAt(peg$currPos)===46?(o=peg$c3,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e5)),o!==peg$FAILED){if(a=[],peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4)),l!==peg$FAILED)for(;l!==peg$FAILED;)a.push(l),peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4));else a=peg$FAILED;a!==peg$FAILED?(r=[r,n,o,a],e=r):(peg$currPos=e,e=peg$FAILED)}else peg$currPos=e,e=peg$FAILED;if(e===peg$FAILED)if(e=peg$currPos,input.charCodeAt(peg$currPos)===46?(r=peg$c3,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e5)),r!==peg$FAILED){if(n=[],peg$r1.test(input.charAt(peg$currPos))?(o=input.charAt(peg$currPos),peg$currPos++):(o=peg$FAILED,peg$fail(peg$e4)),o!==peg$FAILED)for(;o!==peg$FAILED;)n.push(o),peg$r1.test(input.charAt(peg$currPos))?(o=input.charAt(peg$currPos),peg$currPos++):(o=peg$FAILED,peg$fail(peg$e4));else n=peg$FAILED;n!==peg$FAILED?(r=[r,n],e=r):(peg$currPos=e,e=peg$FAILED)}else peg$currPos=e,e=peg$FAILED}return e!==peg$FAILED&&(peg$savedPos=s,e=peg$f4()),s=e,peg$resultsCache[c]={nextPos:peg$currPos,result:s},s}function peg$parseint(){var s,e,r,n=peg$currPos*17+6,o=peg$resultsCache[n];if(o)return peg$currPos=o.nextPos,o.result;if(s=peg$currPos,input.charCodeAt(peg$currPos)===45?peg$currPos++:peg$fail(peg$e6),e=[],peg$r1.test(input.charAt(peg$currPos))?(r=input.charAt(peg$currPos),peg$currPos++):(r=peg$FAILED,peg$fail(peg$e4)),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),peg$r1.test(input.charAt(peg$currPos))?(r=input.charAt(peg$currPos),peg$currPos++):(r=peg$FAILED,peg$fail(peg$e4));else e=peg$FAILED;return e!==peg$FAILED?(peg$savedPos=s,s=peg$f5()):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[n]={nextPos:peg$currPos,result:s},s}function peg$parseratio(){var s,e,r=peg$currPos*17+7,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(s=peg$currPos,e=peg$parseedji_ratio(),e===peg$FAILED&&(e=peg$parseedo_ratio(),e===peg$FAILED&&(e=peg$parsefrac_ratio(),e===peg$FAILED&&(e=peg$parsedecimal_ratio()))),e!==peg$FAILED&&(peg$savedPos=s,e=peg$f6(e)),s=e,peg$resultsCache[r]={nextPos:peg$currPos,result:s},s)}function peg$parsefrac_ratio(){var s,e,r,n,o=peg$currPos*17+8,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===47?(r=peg$c5,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e7)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(peg$savedPos=s,s=peg$f7(e,n)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}function peg$parseedo_ratio(){var s,e,r,n,o=peg$currPos*17+9,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===92?(r=peg$c6,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e8)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(peg$savedPos=s,s=peg$f8(e,n)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}function peg$parseedji_ratio(){var s,e,r,n,o,a,l,c,h=peg$currPos*17+10,f=peg$resultsCache[h];return f?(peg$currPos=f.nextPos,f.result):(s=peg$currPos,e=peg$parseint(),e===peg$FAILED&&(e=peg$parserandom_int()),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===92?(r=peg$c6,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e8)),r!==peg$FAILED?(n=peg$parseint(),n===peg$FAILED&&(n=peg$parserandom_int()),n!==peg$FAILED?(input.charCodeAt(peg$currPos)===60?(o=peg$c7,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e9)),o!==peg$FAILED?(a=peg$parseint(),a===peg$FAILED&&(a=peg$parserandom_int()),a!==peg$FAILED?(input.charCodeAt(peg$currPos)===47?peg$currPos++:peg$fail(peg$e7),l=peg$parseint(),l===peg$FAILED&&(l=peg$parserandom_int()),l===peg$FAILED&&(l=null),input.charCodeAt(peg$currPos)===62?(c=peg$c8,peg$currPos++):(c=peg$FAILED,peg$fail(peg$e10)),c!==peg$FAILED?(peg$savedPos=s,s=peg$f9(e,n,a,l)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[h]={nextPos:peg$currPos,result:s},s)}function peg$parsedecimal_ratio(){var s,e,r,n,o=peg$currPos*17+11,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,e=peg$parseint(),e!==peg$FAILED?(input.charCodeAt(peg$currPos)===44?(r=peg$c1,peg$currPos++):(r=peg$FAILED,peg$fail(peg$e2)),r!==peg$FAILED?(n=peg$parseint(),n!==peg$FAILED?(peg$savedPos=s,s=peg$f10(e,n)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}function peg$parseints(){var s,e,r,n=peg$currPos*17+12,o=peg$resultsCache[n];if(o)return peg$currPos=o.nextPos,o.result;if(s=peg$currPos,e=[],r=peg$parseint(),r===peg$FAILED&&(r=peg$parsesep()),r!==peg$FAILED)for(;r!==peg$FAILED;)e.push(r),r=peg$parseint(),r===peg$FAILED&&(r=peg$parsesep());else e=peg$FAILED;return e!==peg$FAILED&&(peg$savedPos=s,e=peg$f11(e)),s=e,peg$resultsCache[n]={nextPos:peg$currPos,result:s},s}function peg$parsemonzo(){var s,e,r,n,o=peg$currPos*17+13,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,input.charCodeAt(peg$currPos)===91?(e=peg$c9,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e11)),e!==peg$FAILED?(r=peg$parseints(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===62?(n=peg$c8,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e10)),n!==peg$FAILED?(peg$savedPos=s,s=peg$f12(r)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}function peg$parseoperation(){var s,e,r,n,o,a,l,c=peg$currPos*17+14,h=peg$resultsCache[c];if(h)return peg$currPos=h.nextPos,h.result;if(s=peg$currPos,e=peg$parsevalue(),e===peg$FAILED&&(e=peg$parseratio(),e===peg$FAILED&&(e=peg$parsemonzo(),e===peg$FAILED)))for(e=[],r=peg$parsesep();r!==peg$FAILED;)e.push(r),r=peg$parsesep();if(e!==peg$FAILED){if(r=[],n=peg$currPos,o=peg$parseoperator(),o!==peg$FAILED){if(a=peg$parsevalue(),a===peg$FAILED&&(a=peg$parseratio(),a===peg$FAILED&&(a=peg$parsemonzo(),a===peg$FAILED&&(a=peg$parsesub_operations(),a===peg$FAILED&&(a=peg$parseoperation(),a===peg$FAILED)))))for(a=[],l=peg$parsesep();l!==peg$FAILED;)a.push(l),l=peg$parsesep();a!==peg$FAILED?(o=[o,a],n=o):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;if(n!==peg$FAILED)for(;n!==peg$FAILED;)if(r.push(n),n=peg$currPos,o=peg$parseoperator(),o!==peg$FAILED){if(a=peg$parsevalue(),a===peg$FAILED&&(a=peg$parseratio(),a===peg$FAILED&&(a=peg$parsemonzo(),a===peg$FAILED&&(a=peg$parsesub_operations(),a===peg$FAILED&&(a=peg$parseoperation(),a===peg$FAILED)))))for(a=[],l=peg$parsesep();l!==peg$FAILED;)a.push(l),l=peg$parsesep();a!==peg$FAILED?(o=[o,a],n=o):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;else r=peg$FAILED;r!==peg$FAILED?(peg$savedPos=s,s=peg$f13()):(peg$currPos=s,s=peg$FAILED)}else peg$currPos=s,s=peg$FAILED;return peg$resultsCache[c]={nextPos:peg$currPos,result:s},s}function peg$parseoperator(){var s,e=peg$currPos*17+15,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(input.charCodeAt(peg$currPos)===43?(s=peg$c10,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e12)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===45?(s=peg$c4,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e6)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===42?(s=peg$c11,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e13)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===37?(s=peg$c12,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e14)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===38?(s=peg$c13,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e15)),s===peg$FAILED&&(input.charCodeAt(peg$currPos)===124?(s=peg$c14,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e16)),s===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c15?(s=peg$c15,peg$currPos+=2):(s=peg$FAILED,peg$fail(peg$e17)),s===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c16?(s=peg$c16,peg$currPos+=2):(s=peg$FAILED,peg$fail(peg$e18))))))))),peg$resultsCache[e]={nextPos:peg$currPos,result:s},s)}function peg$parsesub_operations(){var s,e,r,n,o=peg$currPos*17+16,a=peg$resultsCache[o];return a?(peg$currPos=a.nextPos,a.result):(s=peg$currPos,input.charCodeAt(peg$currPos)===40?(e=peg$c0,peg$currPos++):(e=peg$FAILED,peg$fail(peg$e1)),e!==peg$FAILED?(r=peg$parseoperation(),r!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(n=peg$c2,peg$currPos++):(n=peg$FAILED,peg$fail(peg$e3)),n!==peg$FAILED?(e=[e,r,n],s=e):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED)):(peg$currPos=s,s=peg$FAILED),peg$resultsCache[o]={nextPos:peg$currPos,result:s},s)}if(peg$result=peg$startRuleFunction(),peg$result!==peg$FAILED&&peg$currPos===input.length)return peg$result;throw peg$result!==peg$FAILED&&peg$currPos{typeof PROCESS.emitWarning=="function"?PROCESS.emitWarning(s,e,r,n):console.error(`[${r}] ${e}: ${s}`)};let AC=globalThis.AbortController,AS=globalThis.AbortSignal;var Sn;if(typeof AC>"u"){AS=class{constructor(){$e(this,"onabort");$e(this,"_onabort",[]);$e(this,"reason");$e(this,"aborted",!1)}addEventListener(n,o){this._onabort.push(o)}},AC=class{constructor(){$e(this,"signal",new AS);e()}abort(n){var o,a;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const l of this.signal._onabort)l(n);(a=(o=this.signal).onabort)==null||a.call(o,n)}}};let s=((Sn=PROCESS.env)==null?void 0:Sn.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{s&&(s=!1,emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const shouldWarn=s=>!warned.has(s),isPosInt=s=>s&&s===Math.floor(s)&&s>0&&isFinite(s),getUintArray=s=>isPosInt(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(e){super(e),this.fill(0)}}var Vi;const Ti=class Ti{constructor(e,r){$e(this,"heap");$e(this,"length");if(!B(Ti,Vi))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}static create(e){const r=getUintArray(e);if(!r)return[];ze(Ti,Vi,!0);const n=new Ti(e,r);return ze(Ti,Vi,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Vi=new WeakMap,lt(Ti,Vi,!1);let Stack=Ti;var ti,Ut,ii,ri,_i,At,ni,Pt,vt,nt,Zt,zt,Bt,Mt,si,Et,fi,di,oi,ai,xi,Vt,or,Kr,Li,pi,ar,jt,Lr,vn,Qi,Gi,lr,ci,Ii,hi,wi,cr,Jr,Hi,Pr,Wi,Tr,St,Ct,hr,en,Ri,nr;const tn=class tn{constructor(e){lt(this,or);lt(this,Lr);lt(this,ci);lt(this,hi);lt(this,cr);lt(this,Hi);lt(this,Wi);lt(this,St);lt(this,hr);lt(this,Ri);lt(this,ti,void 0);lt(this,Ut,void 0);lt(this,ii,void 0);lt(this,ri,void 0);lt(this,_i,void 0);$e(this,"ttl");$e(this,"ttlResolution");$e(this,"ttlAutopurge");$e(this,"updateAgeOnGet");$e(this,"updateAgeOnHas");$e(this,"allowStale");$e(this,"noDisposeOnSet");$e(this,"noUpdateTTL");$e(this,"maxEntrySize");$e(this,"sizeCalculation");$e(this,"noDeleteOnFetchRejection");$e(this,"noDeleteOnStaleGet");$e(this,"allowStaleOnFetchAbort");$e(this,"allowStaleOnFetchRejection");$e(this,"ignoreFetchAbort");lt(this,At,void 0);lt(this,ni,void 0);lt(this,Pt,void 0);lt(this,vt,void 0);lt(this,nt,void 0);lt(this,Zt,void 0);lt(this,zt,void 0);lt(this,Bt,void 0);lt(this,Mt,void 0);lt(this,si,void 0);lt(this,Et,void 0);lt(this,fi,void 0);lt(this,di,void 0);lt(this,oi,void 0);lt(this,ai,void 0);lt(this,xi,void 0);lt(this,Vt,void 0);lt(this,Li,()=>{});lt(this,pi,()=>{});lt(this,ar,()=>{});lt(this,jt,()=>!1);lt(this,Qi,e=>{});lt(this,Gi,(e,r,n)=>{});lt(this,lr,(e,r,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:a,updateAgeOnGet:l,updateAgeOnHas:c,allowStale:h,dispose:f,disposeAfter:d,noDisposeOnSet:g,noUpdateTTL:y,maxSize:I=0,maxEntrySize:P=0,sizeCalculation:N,fetchMethod:Y,noDeleteOnFetchRejection:H,noDeleteOnStaleGet:Se,allowStaleOnFetchRejection:Re,allowStaleOnFetchAbort:oe,ignoreFetchAbort:ke}=e;if(r!==0&&!isPosInt(r))throw new TypeError("max option must be a nonnegative integer");const Te=r?getUintArray(r):Array;if(!Te)throw new Error("invalid max value: "+r);if(ze(this,ti,r),ze(this,Ut,I),this.maxEntrySize=P||B(this,Ut),this.sizeCalculation=N,this.sizeCalculation){if(!B(this,Ut)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Y!==void 0&&typeof Y!="function")throw new TypeError("fetchMethod must be a function if specified");if(ze(this,_i,Y),ze(this,xi,!!Y),ze(this,Pt,new Map),ze(this,vt,new Array(r).fill(void 0)),ze(this,nt,new Array(r).fill(void 0)),ze(this,Zt,new Te(r)),ze(this,zt,new Te(r)),ze(this,Bt,0),ze(this,Mt,0),ze(this,si,Stack.create(r)),ze(this,At,0),ze(this,ni,0),typeof f=="function"&&ze(this,ii,f),typeof d=="function"?(ze(this,ri,d),ze(this,Et,[])):(ze(this,ri,void 0),ze(this,Et,void 0)),ze(this,ai,!!B(this,ii)),ze(this,Vt,!!B(this,ri)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!H,this.allowStaleOnFetchRejection=!!Re,this.allowStaleOnFetchAbort=!!oe,this.ignoreFetchAbort=!!ke,this.maxEntrySize!==0){if(B(this,Ut)!==0&&!isPosInt(B(this,Ut)))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");We(this,Lr,vn).call(this)}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!Se,this.updateAgeOnGet=!!l,this.updateAgeOnHas=!!c,this.ttlResolution=isPosInt(o)||o===0?o:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");We(this,or,Kr).call(this)}if(B(this,ti)===0&&this.ttl===0&&B(this,Ut)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!B(this,ti)&&!B(this,Ut)){const Qe="LRU_CACHE_UNBOUNDED";shouldWarn(Qe)&&(warned.add(Qe),emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Qe,tn))}}static unsafeExposeInternals(e){return{starts:B(e,di),ttls:B(e,oi),sizes:B(e,fi),keyMap:B(e,Pt),keyList:B(e,vt),valList:B(e,nt),next:B(e,Zt),prev:B(e,zt),get head(){return B(e,Bt)},get tail(){return B(e,Mt)},free:B(e,si),isBackgroundFetch:r=>{var n;return We(n=e,St,Ct).call(n,r)},backgroundFetch:(r,n,o,a)=>{var l;return We(l=e,Wi,Tr).call(l,r,n,o,a)},moveToTail:r=>{var n;return We(n=e,Ri,nr).call(n,r)},indexes:r=>{var n;return We(n=e,ci,Ii).call(n,r)},rindexes:r=>{var n;return We(n=e,hi,wi).call(n,r)},isStale:r=>{var n;return B(n=e,jt).call(n,r)}}}get max(){return B(this,ti)}get maxSize(){return B(this,Ut)}get calculatedSize(){return B(this,ni)}get size(){return B(this,At)}get fetchMethod(){return B(this,_i)}get dispose(){return B(this,ii)}get disposeAfter(){return B(this,ri)}getRemainingTTL(e){return B(this,Pt).has(e)?1/0:0}*entries(){for(const e of We(this,ci,Ii).call(this))B(this,nt)[e]!==void 0&&B(this,vt)[e]!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield[B(this,vt)[e],B(this,nt)[e]])}*rentries(){for(const e of We(this,hi,wi).call(this))B(this,nt)[e]!==void 0&&B(this,vt)[e]!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield[B(this,vt)[e],B(this,nt)[e]])}*keys(){for(const e of We(this,ci,Ii).call(this)){const r=B(this,vt)[e];r!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield r)}}*rkeys(){for(const e of We(this,hi,wi).call(this)){const r=B(this,vt)[e];r!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield r)}}*values(){for(const e of We(this,ci,Ii).call(this))B(this,nt)[e]!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield B(this,nt)[e])}*rvalues(){for(const e of We(this,hi,wi).call(this))B(this,nt)[e]!==void 0&&!We(this,St,Ct).call(this,B(this,nt)[e])&&(yield B(this,nt)[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(const n of We(this,ci,Ii).call(this)){const o=B(this,nt)[n],a=We(this,St,Ct).call(this,o)?o.__staleWhileFetching:o;if(a!==void 0&&e(a,B(this,vt)[n],this))return this.get(B(this,vt)[n],r)}}forEach(e,r=this){for(const n of We(this,ci,Ii).call(this)){const o=B(this,nt)[n],a=We(this,St,Ct).call(this,o)?o.__staleWhileFetching:o;a!==void 0&&e.call(r,a,B(this,vt)[n],this)}}rforEach(e,r=this){for(const n of We(this,hi,wi).call(this)){const o=B(this,nt)[n],a=We(this,St,Ct).call(this,o)?o.__staleWhileFetching:o;a!==void 0&&e.call(r,a,B(this,vt)[n],this)}}purgeStale(){let e=!1;for(const r of We(this,hi,wi).call(this,{allowStale:!0}))B(this,jt).call(this,r)&&(this.delete(B(this,vt)[r]),e=!0);return e}dump(){const e=[];for(const r of We(this,ci,Ii).call(this,{allowStale:!0})){const n=B(this,vt)[r],o=B(this,nt)[r],a=We(this,St,Ct).call(this,o)?o.__staleWhileFetching:o;if(a===void 0||n===void 0)continue;const l={value:a};if(B(this,oi)&&B(this,di)){l.ttl=B(this,oi)[r];const c=perf.now()-B(this,di)[r];l.start=Math.floor(Date.now()-c)}B(this,fi)&&(l.size=B(this,fi)[r]),e.unshift([n,l])}return e}load(e){this.clear();for(const[r,n]of e){if(n.start){const o=Date.now()-n.start;n.start=perf.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){var y,I,P,N,Y;if(r===void 0)return this.delete(e),this;const{ttl:o=this.ttl,start:a,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:h}=n;let{noUpdateTTL:f=this.noUpdateTTL}=n;const d=B(this,lr).call(this,e,r,n.size||0,c);if(this.maxEntrySize&&d>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.delete(e),this;let g=B(this,At)===0?void 0:B(this,Pt).get(e);if(g===void 0)g=B(this,At)===0?B(this,Mt):B(this,si).length!==0?B(this,si).pop():B(this,At)===B(this,ti)?We(this,Hi,Pr).call(this,!1):B(this,At),B(this,vt)[g]=e,B(this,nt)[g]=r,B(this,Pt).set(e,g),B(this,Zt)[B(this,Mt)]=g,B(this,zt)[g]=B(this,Mt),ze(this,Mt,g),Ar(this,At)._++,B(this,Gi).call(this,g,d,h),h&&(h.set="add"),f=!1;else{We(this,Ri,nr).call(this,g);const H=B(this,nt)[g];if(r!==H){if(B(this,xi)&&We(this,St,Ct).call(this,H)){H.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:Se}=H;Se!==void 0&&!l&&(B(this,ai)&&((y=B(this,ii))==null||y.call(this,Se,e,"set")),B(this,Vt)&&((I=B(this,Et))==null||I.push([Se,e,"set"])))}else l||(B(this,ai)&&((P=B(this,ii))==null||P.call(this,H,e,"set")),B(this,Vt)&&((N=B(this,Et))==null||N.push([H,e,"set"])));if(B(this,Qi).call(this,g),B(this,Gi).call(this,g,d,h),B(this,nt)[g]=r,h){h.set="replace";const Se=H&&We(this,St,Ct).call(this,H)?H.__staleWhileFetching:H;Se!==void 0&&(h.oldValue=Se)}}else h&&(h.set="update")}if(o!==0&&!B(this,oi)&&We(this,or,Kr).call(this),B(this,oi)&&(f||B(this,ar).call(this,g,o,a),h&&B(this,pi).call(this,h,g)),!l&&B(this,Vt)&&B(this,Et)){const H=B(this,Et);let Se;for(;Se=H==null?void 0:H.shift();)(Y=B(this,ri))==null||Y.call(this,...Se)}return this}pop(){var e;try{for(;B(this,At);){const r=B(this,nt)[B(this,Bt)];if(We(this,Hi,Pr).call(this,!0),We(this,St,Ct).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(B(this,Vt)&&B(this,Et)){const r=B(this,Et);let n;for(;n=r==null?void 0:r.shift();)(e=B(this,ri))==null||e.call(this,...n)}}}has(e,r={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,a=B(this,Pt).get(e);if(a!==void 0){const l=B(this,nt)[a];if(We(this,St,Ct).call(this,l)&&l.__staleWhileFetching===void 0)return!1;if(B(this,jt).call(this,a))o&&(o.has="stale",B(this,pi).call(this,o,a));else return n&&B(this,Li).call(this,a),o&&(o.has="hit",B(this,pi).call(this,o,a)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){const{allowStale:n=this.allowStale}=r,o=B(this,Pt).get(e);if(o!==void 0&&(n||!B(this,jt).call(this,o))){const a=B(this,nt)[o];return We(this,St,Ct).call(this,a)?a.__staleWhileFetching:a}}async fetch(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:l=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:h=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:P=this.allowStaleOnFetchAbort,context:N,forceRefresh:Y=!1,status:H,signal:Se}=r;if(!B(this,xi))return H&&(H.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:a,status:H});const Re={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:a,ttl:l,noDisposeOnSet:c,size:h,sizeCalculation:f,noUpdateTTL:d,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:P,ignoreFetchAbort:I,status:H,signal:Se};let oe=B(this,Pt).get(e);if(oe===void 0){H&&(H.fetch="miss");const ke=We(this,Wi,Tr).call(this,e,oe,Re,N);return ke.__returned=ke}else{const ke=B(this,nt)[oe];if(We(this,St,Ct).call(this,ke)){const De=n&&ke.__staleWhileFetching!==void 0;return H&&(H.fetch="inflight",De&&(H.returnedStale=!0)),De?ke.__staleWhileFetching:ke.__returned=ke}const Te=B(this,jt).call(this,oe);if(!Y&&!Te)return H&&(H.fetch="hit"),We(this,Ri,nr).call(this,oe),o&&B(this,Li).call(this,oe),H&&B(this,pi).call(this,H,oe),ke;const Qe=We(this,Wi,Tr).call(this,e,oe,Re,N),Ze=Qe.__staleWhileFetching!==void 0&&n;return H&&(H.fetch=Te?"stale":"refresh",Ze&&Te&&(H.returnedStale=!0)),Ze?Qe.__staleWhileFetching:Qe.__returned=Qe}}get(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:l}=r,c=B(this,Pt).get(e);if(c!==void 0){const h=B(this,nt)[c],f=We(this,St,Ct).call(this,h);return l&&B(this,pi).call(this,l,c),B(this,jt).call(this,c)?(l&&(l.get="stale"),f?(l&&n&&h.__staleWhileFetching!==void 0&&(l.returnedStale=!0),n?h.__staleWhileFetching:void 0):(a||this.delete(e),l&&n&&(l.returnedStale=!0),n?h:void 0)):(l&&(l.get="hit"),f?h.__staleWhileFetching:(We(this,Ri,nr).call(this,c),o&&B(this,Li).call(this,c),h))}else l&&(l.get="miss")}delete(e){var n,o,a,l;let r=!1;if(B(this,At)!==0){const c=B(this,Pt).get(e);if(c!==void 0)if(r=!0,B(this,At)===1)this.clear();else{B(this,Qi).call(this,c);const h=B(this,nt)[c];We(this,St,Ct).call(this,h)?h.__abortController.abort(new Error("deleted")):(B(this,ai)||B(this,Vt))&&(B(this,ai)&&((n=B(this,ii))==null||n.call(this,h,e,"delete")),B(this,Vt)&&((o=B(this,Et))==null||o.push([h,e,"delete"]))),B(this,Pt).delete(e),B(this,vt)[c]=void 0,B(this,nt)[c]=void 0,c===B(this,Mt)?ze(this,Mt,B(this,zt)[c]):c===B(this,Bt)?ze(this,Bt,B(this,Zt)[c]):(B(this,Zt)[B(this,zt)[c]]=B(this,Zt)[c],B(this,zt)[B(this,Zt)[c]]=B(this,zt)[c]),Ar(this,At)._--,B(this,si).push(c)}}if(B(this,Vt)&&((a=B(this,Et))!=null&&a.length)){const c=B(this,Et);let h;for(;h=c==null?void 0:c.shift();)(l=B(this,ri))==null||l.call(this,...h)}return r}clear(){var e,r,n;for(const o of We(this,hi,wi).call(this,{allowStale:!0})){const a=B(this,nt)[o];if(We(this,St,Ct).call(this,a))a.__abortController.abort(new Error("deleted"));else{const l=B(this,vt)[o];B(this,ai)&&((e=B(this,ii))==null||e.call(this,a,l,"delete")),B(this,Vt)&&((r=B(this,Et))==null||r.push([a,l,"delete"]))}}if(B(this,Pt).clear(),B(this,nt).fill(void 0),B(this,vt).fill(void 0),B(this,oi)&&B(this,di)&&(B(this,oi).fill(0),B(this,di).fill(0)),B(this,fi)&&B(this,fi).fill(0),ze(this,Bt,0),ze(this,Mt,0),B(this,si).length=0,ze(this,ni,0),ze(this,At,0),B(this,Vt)&&B(this,Et)){const o=B(this,Et);let a;for(;a=o==null?void 0:o.shift();)(n=B(this,ri))==null||n.call(this,...a)}}};ti=new WeakMap,Ut=new WeakMap,ii=new WeakMap,ri=new WeakMap,_i=new WeakMap,At=new WeakMap,ni=new WeakMap,Pt=new WeakMap,vt=new WeakMap,nt=new WeakMap,Zt=new WeakMap,zt=new WeakMap,Bt=new WeakMap,Mt=new WeakMap,si=new WeakMap,Et=new WeakMap,fi=new WeakMap,di=new WeakMap,oi=new WeakMap,ai=new WeakMap,xi=new WeakMap,Vt=new WeakMap,or=new WeakSet,Kr=function(){const e=new ZeroArray(B(this,ti)),r=new ZeroArray(B(this,ti));ze(this,oi,e),ze(this,di,r),ze(this,ar,(a,l,c=perf.now())=>{if(r[a]=l!==0?c:0,e[a]=l,l!==0&&this.ttlAutopurge){const h=setTimeout(()=>{B(this,jt).call(this,a)&&this.delete(B(this,vt)[a])},l+1);h.unref&&h.unref()}}),ze(this,Li,a=>{r[a]=e[a]!==0?perf.now():0}),ze(this,pi,(a,l)=>{if(e[l]){const c=e[l],h=r[l];a.ttl=c,a.start=h,a.now=n||o();const f=a.now-h;a.remainingTTL=c-f}});let n=0;const o=()=>{const a=perf.now();if(this.ttlResolution>0){n=a;const l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return a};this.getRemainingTTL=a=>{const l=B(this,Pt).get(a);if(l===void 0)return 0;const c=e[l],h=r[l];if(c===0||h===0)return 1/0;const f=(n||o())-h;return c-f},ze(this,jt,a=>e[a]!==0&&r[a]!==0&&(n||o())-r[a]>e[a])},Li=new WeakMap,pi=new WeakMap,ar=new WeakMap,jt=new WeakMap,Lr=new WeakSet,vn=function(){const e=new ZeroArray(B(this,ti));ze(this,ni,0),ze(this,fi,e),ze(this,Qi,r=>{ze(this,ni,B(this,ni)-e[r]),e[r]=0}),ze(this,lr,(r,n,o,a)=>{if(We(this,St,Ct).call(this,n))return 0;if(!isPosInt(o))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(o=a(n,r),!isPosInt(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o}),ze(this,Gi,(r,n,o)=>{if(e[r]=n,B(this,Ut)){const a=B(this,Ut)-e[r];for(;B(this,ni)>a;)We(this,Hi,Pr).call(this,!0)}ze(this,ni,B(this,ni)+e[r]),o&&(o.entrySize=n,o.totalCalculatedSize=B(this,ni))})},Qi=new WeakMap,Gi=new WeakMap,lr=new WeakMap,ci=new WeakSet,Ii=function*({allowStale:e=this.allowStale}={}){if(B(this,At))for(let r=B(this,Mt);!(!We(this,cr,Jr).call(this,r)||((e||!B(this,jt).call(this,r))&&(yield r),r===B(this,Bt)));)r=B(this,zt)[r]},hi=new WeakSet,wi=function*({allowStale:e=this.allowStale}={}){if(B(this,At))for(let r=B(this,Bt);!(!We(this,cr,Jr).call(this,r)||((e||!B(this,jt).call(this,r))&&(yield r),r===B(this,Mt)));)r=B(this,Zt)[r]},cr=new WeakSet,Jr=function(e){return e!==void 0&&B(this,Pt).get(B(this,vt)[e])===e},Hi=new WeakSet,Pr=function(e){var a,l;const r=B(this,Bt),n=B(this,vt)[r],o=B(this,nt)[r];return B(this,xi)&&We(this,St,Ct).call(this,o)?o.__abortController.abort(new Error("evicted")):(B(this,ai)||B(this,Vt))&&(B(this,ai)&&((a=B(this,ii))==null||a.call(this,o,n,"evict")),B(this,Vt)&&((l=B(this,Et))==null||l.push([o,n,"evict"]))),B(this,Qi).call(this,r),e&&(B(this,vt)[r]=void 0,B(this,nt)[r]=void 0,B(this,si).push(r)),B(this,At)===1?(ze(this,Bt,ze(this,Mt,0)),B(this,si).length=0):ze(this,Bt,B(this,Zt)[r]),B(this,Pt).delete(n),Ar(this,At)._--,r},Wi=new WeakSet,Tr=function(e,r,n,o){const a=r===void 0?void 0:B(this,nt)[r];if(We(this,St,Ct).call(this,a))return a;const l=new AC,{signal:c}=n;c==null||c.addEventListener("abort",()=>l.abort(c.reason),{signal:l.signal});const h={signal:l.signal,options:n,context:o},f=(N,Y=!1)=>{const{aborted:H}=l.signal,Se=n.ignoreFetchAbort&&N!==void 0;if(n.status&&(H&&!Y?(n.status.fetchAborted=!0,n.status.fetchError=l.signal.reason,Se&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),H&&!Se&&!Y)return g(l.signal.reason);const Re=I;return B(this,nt)[r]===I&&(N===void 0?Re.__staleWhileFetching?B(this,nt)[r]=Re.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,N,h.options))),N},d=N=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=N),g(N)),g=N=>{const{aborted:Y}=l.signal,H=Y&&n.allowStaleOnFetchAbort,Se=H||n.allowStaleOnFetchRejection,Re=Se||n.noDeleteOnFetchRejection,oe=I;if(B(this,nt)[r]===I&&(!Re||oe.__staleWhileFetching===void 0?this.delete(e):H||(B(this,nt)[r]=oe.__staleWhileFetching)),Se)return n.status&&oe.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),oe.__staleWhileFetching;if(oe.__returned===oe)throw N},y=(N,Y)=>{var Se;const H=(Se=B(this,_i))==null?void 0:Se.call(this,e,a,h);H&&H instanceof Promise&&H.then(Re=>N(Re===void 0?void 0:Re),Y),l.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(N(void 0),n.allowStaleOnFetchAbort&&(N=Re=>f(Re,!0)))})};n.status&&(n.status.fetchDispatched=!0);const I=new Promise(y).then(f,d),P=Object.assign(I,{__abortController:l,__staleWhileFetching:a,__returned:void 0});return r===void 0?(this.set(e,P,{...h.options,status:void 0}),r=B(this,Pt).get(e)):B(this,nt)[r]=P,P},St=new WeakSet,Ct=function(e){if(!B(this,xi))return!1;const r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AC},hr=new WeakSet,en=function(e,r){B(this,zt)[r]=e,B(this,Zt)[e]=r},Ri=new WeakSet,nr=function(e){e!==B(this,Mt)&&(e===B(this,Bt)?ze(this,Bt,B(this,Zt)[e]):We(this,hr,en).call(this,B(this,zt)[e],B(this,Zt)[e]),We(this,hr,en).call(this,B(this,Mt),e),ze(this,Mt,e))};let LRUCache=tn;const zcache=new LRUCache({max:1e3,ttl:1e3*60*5});class Ziffers{constructor(e,r={}){$e(this,"values");$e(this,"evaluated");$e(this,"options");$e(this,"index");$e(this,"redo");this.index=0,r={...DEFAULT_OPTIONS,...r},r.scale&&(typeof r.scale=="string"&&(isScale(r.scale)?(r.scaleName=r.scale,r.scale=getScale(r.scale)):r.scale=parse(r.scale)),r.parsedScale=r.scale,delete r.scale),r.redo!==void 0?this.redo=r.redo:this.redo=1,this.options={nodeOptions:r};try{this.values=parse$1(e,this.options),this.evaluated=this.evaluate()}catch(n){console.log(n),this.values=[],this.evaluated=[]}}update(){this.evaluated=this.evaluate()}pitches(){return this.evaluated.map(e=>e.collect("pitch"))}notes(){return this.evaluated.map(e=>e.collect("note"))}freqs(){return this.evaluated.map(e=>e.collect("freq"))}durations(){return this.evaluated.map(e=>e.collect("duration"))}next(){const e=this.evaluated[this.index%this.evaluated.length];return this.index++,this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.index=0,this.update()),e}evaluate(){return this.values.map(e=>e.evaluate()).flat(1/0).filter(e=>e!==void 0)}}const generateCacheKey=(...s)=>s.map(e=>JSON.stringify(e)).join(","),cachedCall=(s,e)=>{const r=generateCacheKey(s,e);if(zcache.has(r))return zcache.get(r);{const n=new Ziffers(s,e);return zcache.set(r,n),n}},next=(s,e={})=>cachedCall(s,e).next();let listenerQueue=[],atom=(s,e)=>{let r,n=[],o={lc:0,l:e||0,value:s,set(a){o.value=a,o.notify()},get(){return o.lc||o.listen(()=>{})(),o.value},notify(a){r=n;let l=!listenerQueue.length;for(let c=0;c{n===r&&(n=n.slice());let c=n.indexOf(a);~c&&(n.splice(c,2),o.lc--,o.lc||o.off())}},subscribe(a,l){let c=o.listen(a,l);return a(o.value),c},off(){}};return o},map=(s={})=>{let e=atom(s);return e.setKey=function(r,n){typeof n>"u"?r in e.value&&(e.value={...e.value},delete e.value[r],e.notify(r)):e.value[r]!==n&&(e.value={...e.value,[r]:n},e.notify(r))},e};if(typeof DelayNode<"u"){class s extends DelayNode{constructor(r,n,o,a){super(r),n=Math.abs(n),this.delayTime.value=o;const l=r.createGain();l.gain.value=Math.min(Math.abs(a),.995),this.feedback=l.gain;const c=r.createGain();return c.gain.value=n,this.delayGain=c,this.connect(l),this.connect(c),l.connect(this),this.connect=h=>c.connect(h),this}start(r){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,r+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,r,n){return new s(this,e,r,n)}}typeof AudioContext<"u"&&(AudioContext.prototype.impulseResponse=function(s,e=1){const r=this.sampleRate*s,n=this.createBuffer(e,r,this.sampleRate),o=n.getChannelData(0);for(let a=0;a(e.buffer=this.impulseResponse(r),e.duration=s,e),e.setDuration(s),e});var q={a:{freqs:[660,1120,2750,3e3,3350],gains:[1,.5012,.0708,.0631,.0126],qs:[80,90,120,130,140]},e:{freqs:[440,1800,2700,3e3,3300],gains:[1,.1995,.1259,.1,.1],qs:[70,80,100,120,120]},i:{freqs:[270,1850,2900,3350,3590],gains:[1,.0631,.0631,.0158,.0158],qs:[40,90,100,120,120]},o:{freqs:[430,820,2700,3e3,3300],gains:[1,.3162,.0501,.0794,.01995],qs:[40,80,100,120,120]},u:{freqs:[370,630,2750,3e3,3400],gains:[1,.1,.0708,.0316,.01995],qs:[40,60,100,120,120]}};if(typeof GainNode<"u"){class s extends GainNode{constructor(r,n){if(super(r),!q[n])throw new Error("vowel: unknown vowel "+n);const{gains:o,qs:a,freqs:l}=q[n],c=r.createGain();for(let h=0;h<5;h++){const f=r.createGain();f.gain.value=o[h];const d=r.createBiquadFilter();d.type="bandpass",d.Q.value=a[h],d.frequency.value=l[h],this.connect(d),d.connect(f),f.connect(c)}return c.gain.value=8,this.connect=h=>c.connect(h),this}}AudioContext.prototype.createVowelFilter=function(e){return new s(this,e)}}const ce=s=>{var o;if(typeof s!="string")return[];const[e,r="",n]=((o=s.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:o.slice(1))||[];return e?[e,r,n?Number(n):void 0]:[]},re={c:0,d:2,e:4,f:5,g:7,a:9,b:11},ie={"#":1,b:-1,s:1,f:-1},L=(s,e=3)=>{const[r,n,o=e]=ce(s);if(!r)throw new Error('not a note: "'+s+'"');const a=re[r.toLowerCase()],l=(n==null?void 0:n.split("").reduce((c,h)=>c+ie[h],0))||0;return(Number(o)+1)*12+a+l},se=s=>Math.pow(2,(s-69)/12)*440,ae=(s,e,r)=>Math.min(Math.max(s,e),r),ge=s=>12*Math.log(s/440)/Math.LN2+69,de=(s,e)=>{if(typeof s!="object")throw new Error("valueToMidi: expected object value");let{freq:r,note:n}=s;if(typeof r=="number")return ge(r);if(typeof n=="string")return L(n);if(typeof n=="number")return n;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},ue="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdGh1Yi5jb20vZGt0cjAvV2ViRGlydC9ibG9iL21haW4vTElDRU5TRQovLyBhbGwgdGhlIGNyZWRpdCBnb2VzIHRvIGRrdHIwJ3Mgd2ViZGlydDogaHR0cHM6Ly9naXRodWIuY29tL2RrdHIwL1dlYkRpcnQvYmxvYi81Y2UzZDY5ODM2MmM1NGQ2ZTFiNjhhY2M0N2ViMjk1NWFjNjJjNzkzL2Rpc3QvQXVkaW9Xb3JrbGV0cy5qcwovLyA8MwoKY2xhc3MgQ29hcnNlUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgZ2V0IHBhcmFtZXRlckRlc2NyaXB0b3JzKCkgewogICAgcmV0dXJuIFt7IG5hbWU6ICdjb2Fyc2UnLCBkZWZhdWx0VmFsdWU6IDEgfV07CiAgfQoKICBjb25zdHJ1Y3RvcigpIHsKICAgIHN1cGVyKCk7CiAgICB0aGlzLm5vdFN0YXJ0ZWQgPSB0cnVlOwogIH0KCiAgcHJvY2VzcyhpbnB1dHMsIG91dHB1dHMsIHBhcmFtZXRlcnMpIHsKICAgIGNvbnN0IGlucHV0ID0gaW5wdXRzWzBdOwogICAgY29uc3Qgb3V0cHV0ID0gb3V0cHV0c1swXTsKICAgIGNvbnN0IGNvYXJzZSA9IHBhcmFtZXRlcnMuY29hcnNlOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBvdXRwdXRbMF1bMF0gPSBpbnB1dFswXVswXTsKICAgICAgZm9yIChsZXQgbiA9IDE7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3V0cHV0Lmxlbmd0aDsgbysrKSB7CiAgICAgICAgICBvdXRwdXRbb11bbl0gPSBuICUgY29hcnNlID09IDAgPyBpbnB1dFswXVtuXSA6IG91dHB1dFtvXVtuIC0gMV07CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ2NvYXJzZS1wcm9jZXNzb3InLCBDb2Fyc2VQcm9jZXNzb3IpOwoKY2xhc3MgQ3J1c2hQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ2NydXNoJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBjcnVzaCA9IHBhcmFtZXRlcnMuY3J1c2g7CiAgICBjb25zdCBibG9ja1NpemUgPSAxMjg7CiAgICBjb25zdCBoYXNJbnB1dCA9ICEoaW5wdXRbMF0gPT09IHVuZGVmaW5lZCk7CiAgICBpZiAoaGFzSW5wdXQpIHsKICAgICAgdGhpcy5ub3RTdGFydGVkID0gZmFsc2U7CiAgICAgIGlmIChjcnVzaC5sZW5ndGggPT09IDEpIHsKICAgICAgICBjb25zdCB4ID0gTWF0aC5wb3coMiwgY3J1c2hbMF0gLSAxKTsKICAgICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgICBjb25zdCB2YWx1ZSA9IE1hdGgucm91bmQoaW5wdXRbMF1bbl0gKiB4KSAvIHg7CiAgICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgICBvdXRwdXRbb11bbl0gPSB2YWx1ZTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yIChsZXQgbiA9IDA7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgICAgbGV0IHggPSBNYXRoLnBvdygyLCBjcnVzaFtuXSAtIDEpOwogICAgICAgICAgY29uc3QgdmFsdWUgPSBNYXRoLnJvdW5kKGlucHV0WzBdW25dICogeCkgLyB4OwogICAgICAgICAgZm9yIChsZXQgbyA9IDA7IG8gPCBvdXRwdXQubGVuZ3RoOyBvKyspIHsKICAgICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQpyZWdpc3RlclByb2Nlc3NvcignY3J1c2gtcHJvY2Vzc29yJywgQ3J1c2hQcm9jZXNzb3IpOwoKY2xhc3MgU2hhcGVQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ3NoYXBlJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBzaGFwZTAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function k(s){const e=C().createGain();return e.gain.value=s,e}const Ie=({s,freq:e,t:r})=>{const n=C().createOscillator();return n.type=s||"triangle",n.frequency.value=Number(e),n.start(r),{node:n,stop:o=>n.stop(o)}},ee=(s,e,r,n,o,a)=>{const l=C().createGain();return l.gain.setValueAtTime(0,a),l.gain.linearRampToValueAtTime(o,a+s),l.gain.linearRampToValueAtTime(r*o,a+s+e),{node:l,stop:c=>{l.gain.setValueAtTime(r*o,c),l.gain.linearRampToValueAtTime(0,c+n)}}},Q=(s,e,r)=>{const n=C().createBiquadFilter();return n.type=s,n.frequency.value=e,n.Q.value=r,n},E=map();function te(s,e,r={}){E.setKey(s,{onTrigger:e,data:r})}function U(s){return E.get()[s]}let J;const C=()=>(J||(J=new AudioContext),J);let W;const j=()=>{const s=C();return W||(W=s.createGain(),W.connect(s.destination)),W};let D;function le(){return D||(D=C().audioWorklet.addModule(ue),D)}function x(s,e,r){const n=new AudioWorkletNode(s,e);return Object.entries(r).forEach(([o,a])=>{n.parameters.get(o).value=a}),n}async function Ce(s={}){const{disableWorklets:e=!1}=s;typeof window<"u"&&(await C().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await le().catch(r=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",r)}))}async function ve(s){return new Promise(e=>{document.addEventListener("click",async function r(){await Ce(s),e(),document.removeEventListener("click",r)})})}let G={};function fe(s,e,r,n){var o;if(r=ae(r,0,.98),!G[s]){const a=C().createFeedbackDelay(1,e,r);(o=a.start)==null||o.call(a,n),a.connect(j()),G[s]=a}return G[s].delayTime.value!==e&&G[s].delayTime.setValueAtTime(e,n),G[s].feedback.value!==r&&G[s].feedback.setValueAtTime(r,n),G[s]}let w={};function Ae(s,e=2){if(!w[s]){const r=C().createReverb(e);r.connect(j()),w[s]=r}return w[s].duration!==e&&(w[s]=w[s].setDuration(e),w[s].duration=e),w[s]}function _(s,e,r){const n=k(r);return s.connect(n),n.connect(e),n}const he=async(s,e,r)=>{const n=C();if(typeof s!="object")throw new Error(`expected hap.value to be an object, but got "${s}". Hint: append .note() or .s() to the end`,"error");let o=n.currentTime+e,{s:a="triangle",bank:l,source:c,gain:h=.8,cutoff:f,resonance:d=1,hcutoff:g,hresonance:y=1,bandf:I,bandq:P=1,coarse:N,crush:Y,shape:H,pan:Se,vowel:Re,delay:oe=0,delayfeedback:ke=.5,delaytime:Te=.25,orbit:Qe=1,room:Ve,size:Ze=2,velocity:De=1}=s;h*=De;let je=[];const at=()=>{je.forEach(ut=>ut==null?void 0:ut.disconnect())};l&&a&&(a=`${l}_${a}`);let tt;if(c)tt=c(o,s,r);else if(U(a)){const{onTrigger:ut}=U(a),ct=await ut(o,s,at);ct&&(tt=ct.node,ct.stop(o+r))}else throw new Error(`sound ${a} not found! Is it loaded?`);if(!tt||n.currentTime>o)return;const qe=[];if(qe.push(tt),qe.push(k(h)),f!==void 0&&qe.push(Q("lowpass",f,d)),g!==void 0&&qe.push(Q("highpass",g,y)),I!==void 0&&qe.push(Q("bandpass",I,P)),Re!==void 0&&qe.push(n.createVowelFilter(Re)),N!==void 0&&qe.push(x(n,"coarse-processor",{coarse:N})),Y!==void 0&&qe.push(x(n,"crush-processor",{crush:Y})),H!==void 0&&qe.push(x(n,"shape-processor",{shape:H})),Se!==void 0){const ut=n.createStereoPanner();ut.pan.value=2*Se-1,qe.push(ut)}const ht=k(1);qe.push(ht),ht.connect(j());let Je;if(oe>0&&Te>0&&ke>0){const ut=fe(Qe,Te,ke,o);Je=_(ht,ut,oe)}let pt;if(Ve>0&&Ze>0){const ut=Ae(Qe,Ze);pt=_(ht,ut,Ve)}qe.slice(1).reduce((ut,ct)=>ut.connect(ct),qe[0]),je=qe.concat([Je,pt])},O={};function pe(s,e){var r=e?1e3:1024;if(s=r);return s.toFixed(1)+" "+n[o]}const be=async(s,e,r,n,o,a,l)=>{let c=0,h=de({freq:o,note:r},36);c=h-36;const f=C();let d;if(Array.isArray(a))d=a[e%a.length];else{const P=Y=>L(Y)-h,N=Object.keys(a).filter(Y=>!Y.startsWith("_")).reduce((Y,H,Se)=>!Y||Math.abs(P(H))(O[s]||(O[s]=fetch(s).then(o=>o.arrayBuffer()).then(async o=>(pe(o.byteLength),await e.decodeAudioData(o)))),O[s]);function ye(s){const e=C(),r=e.createBuffer(s.numberOfChannels,s.length,e.sampleRate);for(let n=0;nObject.entries(s).forEach(([n,o])=>{if(typeof o=="string"&&(o=[o]),typeof o!="object")throw new Error("wrong sample map format for "+n);r=o._base||r;const a=l=>(r+l).replace("github:","https://raw.githubusercontent.com/");Array.isArray(o)?o=o.map(a):o=Object.fromEntries(Object.entries(o).map(([l,c])=>[l,(typeof c=="string"?[c]:c).map(a)])),e(n,o)});let ne={};function Ge(s){const e=Object.entries(ne).find(([r])=>s.startsWith(r));if(e)return e[1]}const we=async(s,e=s._base||"",r={})=>{if(typeof s=="string"){const a=Ge(s);if(a)return a(s);if(s.startsWith("github:")){let[c,h]=s.split("github:");h=h.endsWith("/")?h.slice(0,-1):h,s=`https://raw.githubusercontent.com/${h}/strudel.json`}if(typeof fetch!="function")return;const l=s.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(s).then(c=>c.json()).then(c=>we(c,e||c._base||l,r)).catch(c=>{throw console.error(c),new Error(`error loading "${s}"`)})}const{prebake:n,tag:o}=r;me(s,(a,l)=>te(a,(c,h,f)=>Xe(c,h,f,l),{type:"sample",samples:l,baseUrl:e,prebake:n,tag:o}),e)},$=[];async function Xe(s,e,r,n,o){const{s:a,freq:l,unit:c,nudge:h=0,cut:f,loop:d,clip:g=void 0,n:y=0,note:I,speed:P=1,begin:N=0,end:Y=1}=e;if(P===0)return;const H=C(),{attack:Se=.001,decay:Re=.001,sustain:oe=1,release:ke=.001}=e,Te=s+h,Qe=await be(a,y,I,P,l,n,o);if(H.currentTime>s||!Qe)return;Qe.playbackRate.value=Math.abs(P)*Qe.playbackRate.value,c==="c"&&(Qe.playbackRate.value=Qe.playbackRate.value*Qe.buffer.duration*1);const Ve=N*Qe.buffer.duration;Qe.start(Te,Ve);const Ze=Qe.buffer.duration/Qe.playbackRate.value,{node:De,stop:je}=ee(Se,Re,oe,ke,1,s);Qe.connect(De);const at=H.createGain();De.connect(at),Qe.onended=function(){Qe.disconnect(),De.disconnect(),at.disconnect(),r()};const tt={node:at,bufferSource:Qe,stop:(qe,ht=g===void 0)=>{let Je=qe;ht&&(Je=s+(Y-N)*Ze),Qe.stop(Je+ke),je(Je)}};if(f!==void 0){const qe=$[f];qe&&(qe.node.gain.setValueAtTime(1,Te),qe.node.gain.linearRampToValueAtTime(0,Te+.01)),$[f]=tt}return tt}function Ke(){["sine","square","triangle","sawtooth"].forEach(s=>{te(s,(e,r,n)=>{const{attack:o=.001,decay:a=.05,sustain:l=.6,release:c=.01}=r;let{n:h,note:f,freq:d}=r;h=f||h||36,typeof h=="string"&&(h=L(h)),!d&&typeof h=="number"&&(d=se(h));const{node:g,stop:y}=Ie({t:e,s,freq:d}),I=k(.3),{node:P,stop:N}=ee(o,a,l,c,1,e);return g.onended=()=>{g.disconnect(),I.disconnect(),n()},{node:g.connect(I).connect(P),stop:Y=>{N(Y),y(Y+c)}}},{type:"synth",prebake:!0})})}Array.prototype.in=function(s){return this.includes(s)};Promise.all([ve(),we("github:tidalcycles/Dirt-Samples/master"),Ke()]);class UserAPI{constructor(e){$e(this,"variables",{});$e(this,"iterators",{});$e(this,"_drunk",new DrunkWalk(-100,100,!1));$e(this,"MidiConnection",new MidiConnection);$e(this,"load");$e(this,"log",console.log);$e(this,"scale",scale);$e(this,"s",this.script);$e(this,"cs",this.clearscript);$e(this,"cps",this.copyscript);$e(this,"$",this.iterator);$e(this,"v",this.variable);$e(this,"dv",this.delete_variable);$e(this,"cv",this.clear_variables);$e(this,"rI",this.randI);$e(this,"r",this.rand);$e(this,"quant",this.quantize);$e(this,"cmp",this.clamp);$e(this,"tempo",this.bpm);$e(this,"silence",this.stop);$e(this,"hush",this.stop);$e(this,"abs",Math.abs);$e(this,"sound",async(e,r=0)=>{he(e,r)});$e(this,"d",this.sound);this.app=e,this.load=we("github:tidalcycles/Dirt-Samples/master")}get time(){return this.app.audioContext.currentTime}get mouseX(){return this.app._mouseX}get mouseY(){return this.app._mouseY}rate(e){}script(...e){e.forEach(r=>{tryEvaluate(this.app,this.app.universes[this.app.selected_universe].locals[r])})}clearscript(e){this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}}copyscript(e,r){this.app.universes[this.app.selected_universe].locals[r]=this.app.universes[this.app.selected_universe].locals[e]}midi_outputs(){return console.log(this.MidiConnection.listMidiOutputs()),this.MidiConnection.midiOutputs}midi_output(e){e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())}note(e,r={}){const n=r.channel?r.channel:0,o=r.velocity?r.velocity:100,a=r.duration?r.duration:.5;this.MidiConnection.sendMidiNote(e,n,o,a)}zn(e,r={}){const n=next(e,r),o=r.channel?r.channel:0,a=r.velocity?r.velocity:100,l=r.sustain?r.sustain:.5;return n instanceof Pitch?(n.bend&&this.MidiConnection.sendPitchBend(n.bend,o),this.MidiConnection.sendMidiNote(n.note,o,a,l),n.bend&&this.MidiConnection.sendPitchBend(8192,o)):n instanceof Chord&&n.pitches.forEach(c=>{c.bend&&this.MidiConnection.sendPitchBend(c.bend,o),this.MidiConnection.sendMidiNote(c.note,o,a,l),c.bend&&this.MidiConnection.sendPitchBend(8192,o)}),n}sysex(e){this.MidiConnection.sendSysExMessage(e)}pitch_bend(e,r){this.MidiConnection.sendPitchBend(e,r)}program_change(e,r){this.MidiConnection.sendProgramChange(e,r)}midi_clock(){this.MidiConnection.sendMidiClock()}cc(e,r){this.MidiConnection.sendMidiControlChange(e,r)}midi_panic(){this.MidiConnection.panic()}iterator(e,r,n){return e in this.iterators?(this.iterators[e].limit!==r&&(this.iterators[e].value=0,this.iterators[e].limit=r),this.iterators[e].step!==n&&(this.iterators[e].step=n??this.iterators[e].step),this.iterators[e].value+=this.iterators[e].step,this.iterators[e].limit!==void 0&&this.iterators[e].value>this.iterators[e].limit&&(this.iterators[e].value=0)):this.iterators[e]={value:0,step:n??1,limit:r},this.iterators[e].value}get drunk(){return this._drunk.step(),this._drunk.getPosition()}set drunk(e){this._drunk.position=e}set drunk_max(e){this._drunk.max=e}set drunk_min(e){this._drunk.min=e}set drunk_wrap(e){this._drunk.toggleWrap(e)}variable(e,r){return typeof e=="string"&&r===void 0?this.variables[e]:(this.variables[e]=r,this.variables[e])}delete_variable(e){delete this.variables[e]}clear_variables(){this.variables={}}pick(...e){return e[Math.floor(Math.random()*e.length)]}seqbeat(...e){return e[this.app.clock.time_position.beat%e.length]}mel(e,r){return r[e%r.length]}seqbar(...e){return e[this.app.clock.time_position.bar%e.length]}seqpulse(...e){return e[this.app.clock.time_position.pulse%e.length]}randI(e,r){return Math.floor(Math.random()*(r-e+1))+e}rand(e,r){return Math.random()*(r-e)+e}quantize(e,r){if(r.length===0)return e;let n=r[0];return r.forEach(o=>{Math.abs(o-e)500)&&console.log(`Setting bpm to ${e}`),this.app.clock.bpm=e,e)}time_signature(e,r){this.app.clock.time_signature=[e,r]}almostNever(){return Math.random()>.9}sometimes(){return Math.random()>.5}rarely(){return Math.random()>.75}often(){return Math.random()>.25}almostAlways(){return Math.random()>.1}dice(e){return Math.floor(Math.random()*e)+1}get i(){return this.app.universes[this.app.selected_universe].global.evaluations}set i(e){this.app.universes[this.app.selected_universe].global.evaluations=e}get bar(){return this.app.clock.time_position.bar}get tick(){return this.app.clock.tick}get pulse(){return this.app.clock.time_position.pulse}get beat(){return this.app.clock.time_position.beat}get ebeat(){return this.app.clock.beats_since_origin}onbar(e,...r){const n=[...Array(e).keys()].map(o=>o+1);return console.log(r.some(o=>n.includes(o%e))),r.some(o=>n.includes(o%e))}onbeat(...e){let r=[];return e.forEach(n=>{n=1+n%this.app.clock.time_signature[0];let o=Math.floor(n),a=n-o;r.push(o===this.app.clock.time_position.beat&&this.app.clock.time_position.pulse===a*this.app.clock.ppqn)}),r.some(n=>n==!0)}stop(){this.app.clock.pause(),this.app.setButtonHighlighting("pause",!0)}prob(e){return Math.random()*100.5}min(...e){return Math.min(...e)}max(...e){return Math.max(...e)}limit(e,r,n){return Math.min(Math.max(e,r),n)}delay(e,r){setTimeout(r,e)}delayr(e,r,n){[...Array(r).keys()].map(a=>e*a).forEach((a,l)=>{setTimeout(n,a)})}mod(...e){return e.some(r=>this.app.clock.time_position.pulse%r===0)}modbar(...e){return e.some(r=>this.app.clock.time_position.bar%r===0)}euclid(e,r,n,o=0){return this._euclidean_cycle(r,n,o)[e%n]}_euclidean_cycle(e,r,n=0){function o(c,h){const f=c.length,d=(h+1)%f;return c[h]>c[d]}if(e>=r)return[!0];const a=Array.from({length:r},(c,h)=>(e*(h-1)%r+r)%r);let l=a.map((c,h)=>o(a,h));return n!=0&&(l=l.slice(n).concat(l.slice(0,n))),l}bin(e,r){let o=r.toString(2).split("").map(a=>a==="1");return o[e%o.length]}line(e,r,n=1){const o=[];if(r>e&&n>0||r0?1:-1}noise(){return Math.random()*2-1}}class Editor{constructor(){$e(this,"universes",template_universes);$e(this,"selected_universe");$e(this,"local_index",1);$e(this,"editor_mode","local");$e(this,"fontSize");$e(this,"withLineNumbers");$e(this,"vimModeCompartment");$e(this,"chosenLanguage");$e(this,"settings",new AppSettings);$e(this,"editorExtensions",[]);$e(this,"userPlugins",[]);$e(this,"state");$e(this,"api");$e(this,"audioContext");$e(this,"view");$e(this,"clock");$e(this,"manualPlay",!1);$e(this,"_mouseX",0);$e(this,"_mouseY",0);$e(this,"play_buttons",[document.getElementById("play-button-1"),document.getElementById("play-button-2")]);$e(this,"pause_buttons",[document.getElementById("pause-button-1"),document.getElementById("pause-button-2")]);$e(this,"stop_buttons",[document.getElementById("stop-button-1"),document.getElementById("stop-button-2")]);$e(this,"clear_buttons",[document.getElementById("clear-button-1"),document.getElementById("clear-button-2")]);$e(this,"local_button",document.getElementById("local-button"));$e(this,"global_button",document.getElementById("global-button"));$e(this,"init_button",document.getElementById("init-button"));$e(this,"note_button",document.getElementById("note-button"));$e(this,"settings_button",document.getElementById("settings-button"));$e(this,"close_settings_button",document.getElementById("close-settings-button"));$e(this,"universe_viewer",document.getElementById("universe-viewer"));$e(this,"buffer_modal",document.getElementById("modal-buffers"));$e(this,"buffer_search",document.getElementById("buffer-search"));$e(this,"local_script_tabs",document.getElementById("local-script-tabs"));$e(this,"font_size_slider",document.getElementById("font-size-slider"));$e(this,"font_size_witness",document.getElementById("font-size-witness"));$e(this,"line_numbers_checkbox",document.getElementById("show-line-numbers"));$e(this,"normal_mode_button",document.getElementById("normal-mode"));$e(this,"vim_mode_button",document.getElementById("vim-mode"));this.selected_universe=this.settings.selected_universe,this.universe_viewer.innerHTML=`Topos: ${this.selected_universe}`,this.universes={...template_universes,...this.settings.universes},this.audioContext=new AudioContext({latencyHint:"playback"}),this.clock=new Clock(this,this.audioContext),this.api=new UserAPI(this),this.vimModeCompartment=new Compartment,this.withLineNumbers=new Compartment,this.chosenLanguage=new Compartment,this.fontSize=new Compartment;const e=this.settings.vimMode?vim():[],r=this.settings.line_numbers?lineNumbers():[],n=EditorView.theme({"&":{fontSize:`${this.settings.font_size}px`},".cm-gutters":{fontSize:`${this.settings.font_size}px`}});this.editorExtensions=[this.withLineNumbers.of(r),this.fontSize.of(n),this.vimModeCompartment.of(e),editorSetup,oneDark,this.chosenLanguage.of(javascript()),EditorView.updateListener.of(l=>{})];let o=new Compartment;this.state=EditorState.create({extensions:[...this.editorExtensions,EditorView.lineWrapping,o.of(this.userPlugins)],doc:this.universes[this.selected_universe].locals[this.local_index].candidate}),this.view=new EditorView({parent:document.getElementById("editor"),state:this.state}),document.addEventListener("keydown",l=>{l.key==="Tab"&&l.preventDefault(),l.ctrlKey&&l.key==="s"&&(l.preventDefault(),this.setButtonHighlighting("pause",!0),this.clock.pause()),l.ctrlKey&&l.key==="r"&&(l.preventDefault(),this.setButtonHighlighting("stop",!0),this.clock.stop()),l.ctrlKey&&l.key==="p"&&(l.preventDefault(),this.setButtonHighlighting("play",!0),this.clock.start()),(l.key==="v"||l.key==="V")&&l.ctrlKey&&l.shiftKey&&(this.settings.vimMode=!this.settings.vimMode,l.preventDefault(),this.userPlugins=this.settings.vimMode?[]:[vim()],this.view.dispatch({effects:o.reconfigure(this.userPlugins)})),(l.key==="Enter"||l.key==="Return")&&l.ctrlKey&&(l.preventDefault(),this.currentFile().candidate=this.view.state.doc.toString(),this.flashBackground("#2d313d",200)),(l.key==="Enter"&&l.shiftKey||l.key==="e"&&l.ctrlKey)&&(l.preventDefault(),this.currentFile().candidate=this.view.state.doc.toString(),this.flashBackground("#2d313d",200)),l.ctrlKey&&l.key==="b"&&this.openBuffersModal(),l.shiftKey&&l.key==="Escape"&&this.openSettingsModal(),l.ctrlKey&&l.key==="l"&&(l.preventDefault(),this.changeModeFromInterface("local"),this.view.focus()),l.ctrlKey&&l.key==="n"&&(l.preventDefault(),this.changeModeFromInterface("notes"),this.view.focus()),l.ctrlKey&&l.key==="g"&&(l.preventDefault(),this.changeModeFromInterface("global"),this.view.focus()),l.ctrlKey&&l.key==="i"&&(l.preventDefault(),this.changeModeFromInterface("init"),this.changeToLocalBuffer(0),this.view.focus()),[112,113,114,115,116,117,118,119,120].forEach((c,h)=>{l.keyCode===c&&(l.preventDefault(),l.ctrlKey?this.api.script(c-111):(this.changeModeFromInterface("local"),this.changeToLocalBuffer(h)))}),l.keyCode==121&&this.changeModeFromInterface("global"),l.keyCode==122&&this.changeModeFromInterface("init")});const a=document.querySelectorAll('[id^="tab-"]');for(let l=0;l{a[l].classList.add("bg-orange-300");for(let d=0;d{l.addEventListener("click",()=>{this.setButtonHighlighting("play",!0),this.clock.start()})}),this.clear_buttons.forEach(l=>{l.addEventListener("click",()=>{this.setButtonHighlighting("clear",!0),confirm("Do you want to reset the current universe?")&&(this.universes[this.selected_universe]=template_universe,this.updateEditorView())})}),this.pause_buttons.forEach(l=>{l.addEventListener("click",()=>{this.setButtonHighlighting("pause",!0),this.clock.pause()})}),this.stop_buttons.forEach(l=>{l.addEventListener("click",()=>{this.setButtonHighlighting("stop",!0),this.clock.stop()})}),this.local_button.addEventListener("click",()=>this.changeModeFromInterface("local")),this.global_button.addEventListener("click",()=>this.changeModeFromInterface("global")),this.init_button.addEventListener("click",()=>this.changeModeFromInterface("init")),this.note_button.addEventListener("click",()=>this.changeModeFromInterface("notes")),this.settings_button.addEventListener("click",()=>{var h;this.font_size_slider.value=this.settings.font_size.toString(),this.font_size_witness.innerHTML=`Font Size: ${this.settings.font_size}px`,(h=this.font_size_witness)==null||h.setAttribute("style",`font-size: ${this.settings.font_size}px;`),this.line_numbers_checkbox.checked=this.settings.line_numbers;let l=document.getElementById("modal-settings"),c=document.getElementById("editor");l==null||l.classList.remove("invisible"),c==null||c.classList.add("invisible")}),this.close_settings_button.addEventListener("click",()=>{let l=document.getElementById("modal-settings"),c=document.getElementById("editor");l==null||l.classList.add("invisible"),c==null||c.classList.remove("invisible")}),this.font_size_slider.addEventListener("input",()=>{const l=this.font_size_slider.value;this.settings.font_size=parseInt(l),this.font_size_witness.style.fontSize=`${l}px`,this.font_size_witness.innerHTML=`Font Size: ${l}px`;let c=EditorView.theme({"&":{fontSize:l+"px"},".cm-gutters":{fontSize:l+"px"}});this.view.dispatch({effects:this.fontSize.reconfigure(c)}),this.settings.font_size=parseInt(l)}),this.normal_mode_button.addEventListener("click",()=>{this.settings.vimMode=!1,this.view.dispatch({effects:this.vimModeCompartment.reconfigure([])})}),this.line_numbers_checkbox.addEventListener("change",()=>{let l=!!this.line_numbers_checkbox.checked;this.settings.line_numbers=l,this.view.dispatch({effects:this.withLineNumbers.reconfigure(l?[lineNumbers()]:[])})}),this.vim_mode_button.addEventListener("click",()=>{this.settings.vimMode=!0,this.view.dispatch({effects:this.vimModeCompartment.reconfigure(vim())})}),this.buffer_search.addEventListener("keydown",l=>{if(l.key==="Enter"){let c=this.buffer_search.value;c.length>2&&c.length<20&&(this.loadUniverse(c),this.settings.selected_universe=c,this.buffer_search.value="",this.closeBuffersModal(),this.view.focus())}}),tryEvaluate(this,this.universes[this.selected_universe.toString()].init)}get note_buffer(){return this.universes[this.selected_universe.toString()].notes}get global_buffer(){return this.universes[this.selected_universe.toString()].global}get init_buffer(){return this.universes[this.selected_universe.toString()].init}get local_buffer(){return this.universes[this.selected_universe.toString()].locals[this.local_index]}changeToLocalBuffer(e){const r=document.querySelectorAll('[id^="tab-"]'),n=r[e];n.classList.add("bg-orange-300");for(let a=0;a{r.forEach(a=>{let l=a.children[0];l.classList.contains("text-orange-300")&&(l.classList.remove("text-orange-300"),a.classList.remove("text-orange-300"))}),o.children[0].classList.remove("text-white"),o.children[0].classList.add("text-orange-300"),o.classList.add("text-orange-300")};switch(e){case"local":this.local_script_tabs.classList.contains("hidden")&&this.local_script_tabs.classList.remove("hidden"),this.editor_mode="local",this.local_index=0,this.changeToLocalBuffer(this.local_index),n(this.local_button);break;case"global":this.local_script_tabs.classList.contains("hidden")||this.local_script_tabs.classList.add("hidden"),this.editor_mode="global",n(this.global_button);break;case"init":this.local_script_tabs.classList.contains("hidden")||this.local_script_tabs.classList.add("hidden"),this.editor_mode="init",n(this.init_button);break;case"notes":this.local_script_tabs.classList.contains("hidden")||this.local_script_tabs.classList.add("hidden"),this.editor_mode="notes",n(this.note_button);break}this.view.dispatch({effects:this.chosenLanguage.reconfigure(this.editor_mode=="notes"?[markdown()]:[javascript()])}),this.updateEditorView()}setButtonHighlighting(e,r){this.flashBackground("#2d313d",200);const n=['[id^="play-button-"]','[id^="pause-button-"]','[id^="clear-button-"]','[id^="stop-button-"]'];let o;switch(e){case"play":o=0;break;case"pause":o=1;break;case"clear":o=2;break;case"stop":o=3;break}document.querySelectorAll(n[o]).forEach(a=>{r&&a.children[0].classList.add("fill-orange-300")}),document.querySelectorAll(n.filter((a,l)=>l!=o).join(",")).forEach(a=>{a.children[0].classList.remove("fill-orange-300"),a.children[0].classList.remove("text-orange-300"),a.children[0].classList.remove("bg-orange-300")})}unfocusPlayButtons(){document.querySelectorAll('[id^="play-button-"]').forEach(e=>{e.children[0].classList.remove("fill-orange-300")})}updateEditorView(){this.view.dispatch({changes:{from:0,to:this.view.state.doc.toString().length,insert:this.currentFile().candidate}})}currentFile(){switch(this.editor_mode){case"global":return this.global_buffer;case"local":return this.local_buffer;case"init":return this.init_buffer;case"notes":return this.note_buffer}}loadUniverse(e){this.currentFile().candidate=this.view.state.doc.toString();let r=e.trim();this.universes[r]===void 0&&(this.universes[r]=template_universe),this.selected_universe=r,this.settings.selected_universe=this.selected_universe,this.universe_viewer.innerHTML=`Topos: ${r}`,this.updateEditorView(),tryEvaluate(this,this.universes[this.selected_universe.toString()].init)}openSettingsModal(){document.getElementById("modal-settings").classList.contains("invisible")?(document.getElementById("editor").classList.add("invisible"),document.getElementById("modal-settings").classList.remove("invisible")):this.closeSettingsModal()}closeSettingsModal(){document.getElementById("editor").classList.remove("invisible"),document.getElementById("modal-settings").classList.add("invisible")}openBuffersModal(){document.getElementById("modal-buffers").classList.contains("invisible")?(document.getElementById("editor").classList.add("invisible"),document.getElementById("modal-buffers").classList.remove("invisible"),document.getElementById("buffer-search").focus()):this.closeBuffersModal()}closeBuffersModal(){document.getElementById("buffer-search").value="",document.getElementById("editor").classList.remove("invisible"),document.getElementById("modal").classList.add("invisible"),document.getElementById("modal-buffers").classList.add("invisible")}flashBackground(e,r){this.view.dom.style.backgroundColor=e;const n=this.view.dom.getElementsByClassName("cm-gutter");Array.from(n).forEach(o=>o.style.backgroundColor=e),setTimeout(()=>{this.view.dom.style.backgroundColor="",Array.from(n).forEach(o=>o.style.backgroundColor="")},r)}}const app=new Editor;function startClock(){document.getElementById("editor").classList.remove("invisible"),document.getElementById("modal").classList.add("hidden"),document.getElementById("modal-container").classList.remove("motion-safe:animate-pulse"),document.getElementById("start-button").removeEventListener("click",startClock),document.removeEventListener("click",startClock),document.removeEventListener("keydown",startOnEnter),document.removeEventListener("click",startOnClick),app.clock.start(),app.view.focus(),app.setButtonHighlighting("play",!0)}function startOnEnter(s){(s.code==="Enter"||s.code==="Space")&&startClock()}function startOnClick(s){s.button===0&&startClock()}document.addEventListener("keydown",startOnEnter);document.addEventListener("click",startOnClick);function reportMouseCoordinates(s){app._mouseX=s.clientX,app._mouseY=s.clientY}window.addEventListener("mousemove",reportMouseCoordinates);window.addEventListener("beforeunload",()=>(event.preventDefault(),app.currentFile().candidate=app.view.state.doc.toString(),app.currentFile().committed=app.view.state.doc.toString(),app.settings.saveApplicationToLocalStorage(app.universes,app.settings),app.clock.stop(),null)); diff --git a/index.html b/index.html index 796cd43..1477cb4 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Topos - +