diff --git a/assets/index-0d9eb102.js b/assets/index-2f895918.js
similarity index 97%
rename from assets/index-0d9eb102.js
rename to assets/index-2f895918.js
index 8fd0ff6..0a62177 100644
--- a/assets/index-0d9eb102.js
+++ b/assets/index-2f895918.js
@@ -320,9 +320,7 @@ No sound will play until you add .out() at the end of the chain.
## The Topos Project
-Topos is an experimental web based algorithmic sequencer programmed by **BuboBubo** (Raphaël Forment) and **Amiika** (Miika Alonen). It is written using [TypeScript](https://google.fr) and [Vite](https://google.fr). Many thanks to Felix Roos for making the [Superdough](https://www.npmjs.com/package/superdough) audio backend available for experimentation.
-
-This project is based on the [Monome Teletype](https://monome.org) by Brian Crabtree. We hope to follow and honor the same spirit of sharing and experimentation. How much can the Teletype be extended while staying accessible and installation-free?
+Topos is an experimental web based algorithmic sequencer programmed by **BuboBubo** ([Raphaël Forment](https://raphaelforment.fr) and **Amiika** ([Miika Alonen](https//github.com/amiika). It is written using [TypeScript](https://google.fr) and [Vite](https://google.fr). Many thanks to Felix Roos for making the [Superdough](https://www.npmjs.com/package/superdough) audio backend available for experimentation. This project is based on the [Monome Teletype](https://monome.org) by [Brian Crabtree](https://nnnnnnnn.co/) and [Kelli Cain](https://kellicain.com/). We hope to follow and honor the same spirit of sharing and experimentation. How much can the Teletype be extended while staying accessible and installation-free?
## About Live Coding
@@ -330,15 +328,13 @@ This project is based on the [Monome Teletype](https://monome.org) by Brian Crab
## Free and open-source software
-Topos is a free and open-source software distributed under [GPL-3.0](https://github.com/Bubobubobubobubo/Topos/blob/main/LICENSE) licence.
-We welcome all contributions and ideas. You can find the source code on [GitHub](https://github.com/Bubobubobubobubo/topos).
-You can also join us on [Discord](https://discord.gg/8Q2QV6Z6) to discuss about the project and live coding in general.
+Topos is a free and open-source software distributed under [GPL-3.0](https://github.com/Bubobubobubobubo/Topos/blob/main/LICENSE) licence. We welcome all contributions and ideas. You can find the source code on [GitHub](https://github.com/Bubobubobubobubo/topos). You can also join us on [Discord](https://discord.gg/8Q2QV6Z6) to discuss about the project and live coding in general.
**Have fun!**
`,code=`
# Code
-Topos is using the [JavaScript](https://en.wikipedia.org/wiki/JavaScript) syntax because it lives in a web browser where JS is the default programming language. It is also a language that you can learn to speak quite fast if you are already familiar with other programming lanugages. You are not going to write a lot of code anyway but familiarity with the language can help. Here are some good resources:
+Topos is using the [JavaScript](https://en.wikipedia.org/wiki/JavaScript) syntax because it lives in a web browser where JS is the default programming language. It is also a language that you can learn to speak quite fast if you are already familiar with other programming languages. You are not going to write a lot of code anyway but familiarity with the language can help. Here are some good resources:
- [MDN (Mozilla Web Docs)](https://developer.mozilla.org/): it covers pretty much anything and is considered to be a reliable source to learn how the web currently works. We use it quite a lot to develop Topos.
@@ -399,7 +395,7 @@ Topos is made to be controlled entirely with a keyboard. It is recommanded to st
`+o.line+" | "+p+`
`+u+" | "+peg$padEnd("",s.column-1," ")+peg$padEnd("",f,"^")}else e+=`
at `+l}return e},peg$SyntaxError.buildMessage=function(a,e){var r={literal:function(p){return'"'+s(p.text)+'"'},class:function(p){var h=p.parts.map(function(f){return Array.isArray(f)?o(f[0])+"-"+o(f[1]):o(f)});return"["+(p.inverted?"^":"")+h.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(p){return p.description}};function n(p){return p.charCodeAt(0).toString(16).toUpperCase()}function s(p){return p.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(h){return"\\x0"+n(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+n(h)})}function o(p){return p.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(h){return"\\x0"+n(h)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(h){return"\\x"+n(h)})}function l(p){return r[p.type](p)}function c(p){var h=p.map(l),f,b;if(h.sort(),h.length>0){for(f=1,b=1;f",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(a){return centsToSemitones(a.filter(e=>e))},peg$f1=function(){},peg$f2=function(a,e){return Math.floor(Math.random()*(e-a+1)+a)},peg$f3=function(a,e){return Math.random()*(e-a)+a},peg$f4=function(){return parseFloat(text())},peg$f5=function(){return parseInt(text())},peg$f6=function(a){return ratioToCents(a)},peg$f7=function(a,e){return a/e},peg$f8=function(a,e){return Math.pow(2,a/e)},peg$f9=function(a,e,r,n){var s=n?r/n:r;return Math.pow(s,a/e)},peg$f10=function(a,e){return parseFloat(a.toString()+"."+e.toString())},peg$f11=function(a){return a.filter(e=>e)},peg$f12=function(a){return monzoToCents(a)},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(a,e){return{type:"literal",text:a,ignoreCase:e}}function peg$classExpectation(a,e,r){return{type:"class",parts:a,inverted:e,ignoreCase:r}}function peg$endExpectation(){return{type:"end"}}function peg$computePosDetails(a){var e=peg$posDetailsCache[a],r;if(e)return e;for(r=a-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(a))}function peg$buildStructuredError(a,e,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(a,e),a,e,r)}function peg$parselines(){var a,e,r,n=peg$currPos*17+0,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=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=a,e=peg$f0(e)),a=e,peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parsesep(){var a,e,r=peg$currPos*17+1,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(a=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=a,e=peg$f1()),a=e,peg$resultsCache[r]={nextPos:peg$currPos,result:a},a)}function peg$parsevalue(){var a,e=peg$currPos*17+2,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(a=peg$parsefloat(),a===peg$FAILED&&(a=peg$parseint(),a===peg$FAILED&&(a=peg$parserandom_int(),a===peg$FAILED&&(a=peg$parserandom_float()))),peg$resultsCache[e]={nextPos:peg$currPos,result:a},a)}function peg$parserandom_int(){var a,e,r,n,s,o,l=peg$currPos*17+3,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(a=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?(s=peg$parseint(),s!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(o=peg$c2,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e3)),o!==peg$FAILED?(peg$savedPos=a,a=peg$f2(r,s)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:a},a)}function peg$parserandom_float(){var a,e,r,n,s,o,l=peg$currPos*17+4,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(a=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?(s=peg$parsefloat(),s!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(o=peg$c2,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e3)),o!==peg$FAILED?(peg$savedPos=a,a=peg$f3(r,s)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:a},a)}function peg$parsefloat(){var a,e,r,n,s,o,l,c=peg$currPos*17+5,u=peg$resultsCache[c];if(u)return peg$currPos=u.nextPos,u.result;if(a=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))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));s!==peg$FAILED;)n.push(s),peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));if(input.charCodeAt(peg$currPos)===46?(s=peg$c3,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e5)),s!==peg$FAILED){if(o=[],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;)o.push(l),peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4));else o=peg$FAILED;o!==peg$FAILED?(r=[r,n,s,o],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))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4)),s!==peg$FAILED)for(;s!==peg$FAILED;)n.push(s),peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=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=a,e=peg$f4()),a=e,peg$resultsCache[c]={nextPos:peg$currPos,result:a},a}function peg$parseint(){var a,e,r,n=peg$currPos*17+6,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=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=a,a=peg$f5()):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parseratio(){var a,e,r=peg$currPos*17+7,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(a=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=a,e=peg$f6(e)),a=e,peg$resultsCache[r]={nextPos:peg$currPos,result:a},a)}function peg$parsefrac_ratio(){var a,e,r,n,s=peg$currPos*17+8,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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=a,a=peg$f7(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseedo_ratio(){var a,e,r,n,s=peg$currPos*17+9,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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=a,a=peg$f8(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseedji_ratio(){var a,e,r,n,s,o,l,c,u=peg$currPos*17+10,p=peg$resultsCache[u];return p?(peg$currPos=p.nextPos,p.result):(a=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?(s=peg$c7,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e9)),s!==peg$FAILED?(o=peg$parseint(),o===peg$FAILED&&(o=peg$parserandom_int()),o!==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=a,a=peg$f9(e,n,o,l)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[u]={nextPos:peg$currPos,result:a},a)}function peg$parsedecimal_ratio(){var a,e,r,n,s=peg$currPos*17+11,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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=a,a=peg$f10(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseints(){var a,e,r,n=peg$currPos*17+12,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=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=a,e=peg$f11(e)),a=e,peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parsemonzo(){var a,e,r,n,s=peg$currPos*17+13,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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=a,a=peg$f12(r)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseoperation(){var a,e,r,n,s,o,l,c=peg$currPos*17+14,u=peg$resultsCache[c];if(u)return peg$currPos=u.nextPos,u.result;if(a=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,s=peg$parseoperator(),s!==peg$FAILED){if(o=peg$parsevalue(),o===peg$FAILED&&(o=peg$parseratio(),o===peg$FAILED&&(o=peg$parsemonzo(),o===peg$FAILED&&(o=peg$parsesub_operations(),o===peg$FAILED&&(o=peg$parseoperation(),o===peg$FAILED)))))for(o=[],l=peg$parsesep();l!==peg$FAILED;)o.push(l),l=peg$parsesep();o!==peg$FAILED?(s=[s,o],n=s):(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,s=peg$parseoperator(),s!==peg$FAILED){if(o=peg$parsevalue(),o===peg$FAILED&&(o=peg$parseratio(),o===peg$FAILED&&(o=peg$parsemonzo(),o===peg$FAILED&&(o=peg$parsesub_operations(),o===peg$FAILED&&(o=peg$parseoperation(),o===peg$FAILED)))))for(o=[],l=peg$parsesep();l!==peg$FAILED;)o.push(l),l=peg$parsesep();o!==peg$FAILED?(s=[s,o],n=s):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;else r=peg$FAILED;r!==peg$FAILED?(peg$savedPos=a,a=peg$f13()):(peg$currPos=a,a=peg$FAILED)}else peg$currPos=a,a=peg$FAILED;return peg$resultsCache[c]={nextPos:peg$currPos,result:a},a}function peg$parseoperator(){var a,e=peg$currPos*17+15,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(input.charCodeAt(peg$currPos)===43?(a=peg$c10,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e12)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===45?(a=peg$c4,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e6)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===42?(a=peg$c11,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e13)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===37?(a=peg$c12,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e14)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===38?(a=peg$c13,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e15)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===124?(a=peg$c14,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e16)),a===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c15?(a=peg$c15,peg$currPos+=2):(a=peg$FAILED,peg$fail(peg$e17)),a===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c16?(a=peg$c16,peg$currPos+=2):(a=peg$FAILED,peg$fail(peg$e18))))))))),peg$resultsCache[e]={nextPos:peg$currPos,result:a},a)}function peg$parsesub_operations(){var a,e,r,n,s=peg$currPos*17+16,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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],a=e):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}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(a,e,r,n):console.error(`[${r}] ${e}: ${a}`)};let AC=globalThis.AbortController,AS=globalThis.AbortSignal;var Di;if(typeof AC>"u"){AS=class{constructor(){_e(this,"onabort");_e(this,"_onabort",[]);_e(this,"reason");_e(this,"aborted",!1)}addEventListener(n,s){this._onabort.push(s)}},AC=class{constructor(){_e(this,"signal",new AS);e()}abort(n){var s,o;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const l of this.signal._onabort)l(n);(o=(s=this.signal).onabort)==null||o.call(s,n)}}};let a=((Di=PROCESS.env)==null?void 0:Di.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{a&&(a=!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=a=>!warned.has(a),isPosInt=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),getUintArray=a=>isPosInt(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(e){super(e),this.fill(0)}}var Dn;const pn=class pn{constructor(e,r){_e(this,"heap");_e(this,"length");if(!Oe(pn,Dn))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[];St(pn,Dn,!0);const n=new pn(e,r);return St(pn,Dn,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Dn=new WeakMap,Dt(pn,Dn,!1);let Stack=pn;var Nr,Or,Dr,wr,wn,tr,Lr,rr,qt,Rt,gr,br,cr,ir,xr,ar,Vr,Hr,Pr,kr,nn,mr,qn,_i,hn,zr,Vn,Tr,ii,Li,fn,Ln,Hn,Ur,tn,Yr,rn,zn,Si,xn,ri,Pn,ni,Yt,zt,Wn,Ei,gn,Qn;const Oi=class Oi{constructor(e){Dt(this,qn);Dt(this,ii);Dt(this,Ur);Dt(this,Yr);Dt(this,zn);Dt(this,xn);Dt(this,Pn);Dt(this,Yt);Dt(this,Wn);Dt(this,gn);Dt(this,Nr,void 0);Dt(this,Or,void 0);Dt(this,Dr,void 0);Dt(this,wr,void 0);Dt(this,wn,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");Dt(this,tr,void 0);Dt(this,Lr,void 0);Dt(this,rr,void 0);Dt(this,qt,void 0);Dt(this,Rt,void 0);Dt(this,gr,void 0);Dt(this,br,void 0);Dt(this,cr,void 0);Dt(this,ir,void 0);Dt(this,xr,void 0);Dt(this,ar,void 0);Dt(this,Vr,void 0);Dt(this,Hr,void 0);Dt(this,Pr,void 0);Dt(this,kr,void 0);Dt(this,nn,void 0);Dt(this,mr,void 0);Dt(this,hn,()=>{});Dt(this,zr,()=>{});Dt(this,Vn,()=>{});Dt(this,Tr,()=>!1);Dt(this,fn,e=>{});Dt(this,Ln,(e,r,n)=>{});Dt(this,Hn,(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:l,updateAgeOnHas:c,allowStale:u,dispose:p,disposeAfter:h,noDisposeOnSet:f,noUpdateTTL:b,maxSize:A=0,maxEntrySize:N=0,sizeCalculation:F,fetchMethod:B,noDeleteOnFetchRejection:H,noDeleteOnStaleGet:Ee,allowStaleOnFetchRejection:Pe,allowStaleOnFetchAbort:g,ignoreFetchAbort:R}=e;if(r!==0&&!isPosInt(r))throw new TypeError("max option must be a nonnegative integer");const y=r?getUintArray(r):Array;if(!y)throw new Error("invalid max value: "+r);if(St(this,Nr,r),St(this,Or,A),this.maxEntrySize=N||Oe(this,Or),this.sizeCalculation=F,this.sizeCalculation){if(!Oe(this,Or)&&!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(B!==void 0&&typeof B!="function")throw new TypeError("fetchMethod must be a function if specified");if(St(this,wn,B),St(this,nn,!!B),St(this,rr,new Map),St(this,qt,new Array(r).fill(void 0)),St(this,Rt,new Array(r).fill(void 0)),St(this,gr,new y(r)),St(this,br,new y(r)),St(this,cr,0),St(this,ir,0),St(this,xr,Stack.create(r)),St(this,tr,0),St(this,Lr,0),typeof p=="function"&&St(this,Dr,p),typeof h=="function"?(St(this,wr,h),St(this,ar,[])):(St(this,wr,void 0),St(this,ar,void 0)),St(this,kr,!!Oe(this,Dr)),St(this,mr,!!Oe(this,wr)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!H,this.allowStaleOnFetchRejection=!!Pe,this.allowStaleOnFetchAbort=!!g,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(Oe(this,Or)!==0&&!isPosInt(Oe(this,Or)))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");ht(this,ii,Li).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!Ee,this.updateAgeOnGet=!!l,this.updateAgeOnHas=!!c,this.ttlResolution=isPosInt(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ht(this,qn,_i).call(this)}if(Oe(this,Nr)===0&&this.ttl===0&&Oe(this,Or)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!Oe(this,Nr)&&!Oe(this,Or)){const M="LRU_CACHE_UNBOUNDED";shouldWarn(M)&&(warned.add(M),emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,Oi))}}static unsafeExposeInternals(e){return{starts:Oe(e,Hr),ttls:Oe(e,Pr),sizes:Oe(e,Vr),keyMap:Oe(e,rr),keyList:Oe(e,qt),valList:Oe(e,Rt),next:Oe(e,gr),prev:Oe(e,br),get head(){return Oe(e,cr)},get tail(){return Oe(e,ir)},free:Oe(e,xr),isBackgroundFetch:r=>{var n;return ht(n=e,Yt,zt).call(n,r)},backgroundFetch:(r,n,s,o)=>{var l;return ht(l=e,Pn,ni).call(l,r,n,s,o)},moveToTail:r=>{var n;return ht(n=e,gn,Qn).call(n,r)},indexes:r=>{var n;return ht(n=e,Ur,tn).call(n,r)},rindexes:r=>{var n;return ht(n=e,Yr,rn).call(n,r)},isStale:r=>{var n;return Oe(n=e,Tr).call(n,r)}}}get max(){return Oe(this,Nr)}get maxSize(){return Oe(this,Or)}get calculatedSize(){return Oe(this,Lr)}get size(){return Oe(this,tr)}get fetchMethod(){return Oe(this,wn)}get dispose(){return Oe(this,Dr)}get disposeAfter(){return Oe(this,wr)}getRemainingTTL(e){return Oe(this,rr).has(e)?1/0:0}*entries(){for(const e of ht(this,Ur,tn).call(this))Oe(this,Rt)[e]!==void 0&&Oe(this,qt)[e]!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield[Oe(this,qt)[e],Oe(this,Rt)[e]])}*rentries(){for(const e of ht(this,Yr,rn).call(this))Oe(this,Rt)[e]!==void 0&&Oe(this,qt)[e]!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield[Oe(this,qt)[e],Oe(this,Rt)[e]])}*keys(){for(const e of ht(this,Ur,tn).call(this)){const r=Oe(this,qt)[e];r!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield r)}}*rkeys(){for(const e of ht(this,Yr,rn).call(this)){const r=Oe(this,qt)[e];r!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield r)}}*values(){for(const e of ht(this,Ur,tn).call(this))Oe(this,Rt)[e]!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield Oe(this,Rt)[e])}*rvalues(){for(const e of ht(this,Yr,rn).call(this))Oe(this,Rt)[e]!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield Oe(this,Rt)[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(const n of ht(this,Ur,tn).call(this)){const s=Oe(this,Rt)[n],o=ht(this,Yt,zt).call(this,s)?s.__staleWhileFetching:s;if(o!==void 0&&e(o,Oe(this,qt)[n],this))return this.get(Oe(this,qt)[n],r)}}forEach(e,r=this){for(const n of ht(this,Ur,tn).call(this)){const s=Oe(this,Rt)[n],o=ht(this,Yt,zt).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&e.call(r,o,Oe(this,qt)[n],this)}}rforEach(e,r=this){for(const n of ht(this,Yr,rn).call(this)){const s=Oe(this,Rt)[n],o=ht(this,Yt,zt).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&e.call(r,o,Oe(this,qt)[n],this)}}purgeStale(){let e=!1;for(const r of ht(this,Yr,rn).call(this,{allowStale:!0}))Oe(this,Tr).call(this,r)&&(this.delete(Oe(this,qt)[r]),e=!0);return e}dump(){const e=[];for(const r of ht(this,Ur,tn).call(this,{allowStale:!0})){const n=Oe(this,qt)[r],s=Oe(this,Rt)[r],o=ht(this,Yt,zt).call(this,s)?s.__staleWhileFetching:s;if(o===void 0||n===void 0)continue;const l={value:o};if(Oe(this,Pr)&&Oe(this,Hr)){l.ttl=Oe(this,Pr)[r];const c=perf.now()-Oe(this,Hr)[r];l.start=Math.floor(Date.now()-c)}Oe(this,Vr)&&(l.size=Oe(this,Vr)[r]),e.unshift([n,l])}return e}load(e){this.clear();for(const[r,n]of e){if(n.start){const s=Date.now()-n.start;n.start=perf.now()-s}this.set(r,n.value,n)}}set(e,r,n={}){var b,A,N,F,B;if(r===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=n;let{noUpdateTTL:p=this.noUpdateTTL}=n;const h=Oe(this,Hn).call(this,e,r,n.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(e),this;let f=Oe(this,tr)===0?void 0:Oe(this,rr).get(e);if(f===void 0)f=Oe(this,tr)===0?Oe(this,ir):Oe(this,xr).length!==0?Oe(this,xr).pop():Oe(this,tr)===Oe(this,Nr)?ht(this,xn,ri).call(this,!1):Oe(this,tr),Oe(this,qt)[f]=e,Oe(this,Rt)[f]=r,Oe(this,rr).set(e,f),Oe(this,gr)[Oe(this,ir)]=f,Oe(this,br)[f]=Oe(this,ir),St(this,ir,f),ti(this,tr)._++,Oe(this,Ln).call(this,f,h,u),u&&(u.set="add"),p=!1;else{ht(this,gn,Qn).call(this,f);const H=Oe(this,Rt)[f];if(r!==H){if(Oe(this,nn)&&ht(this,Yt,zt).call(this,H)){H.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:Ee}=H;Ee!==void 0&&!l&&(Oe(this,kr)&&((b=Oe(this,Dr))==null||b.call(this,Ee,e,"set")),Oe(this,mr)&&((A=Oe(this,ar))==null||A.push([Ee,e,"set"])))}else l||(Oe(this,kr)&&((N=Oe(this,Dr))==null||N.call(this,H,e,"set")),Oe(this,mr)&&((F=Oe(this,ar))==null||F.push([H,e,"set"])));if(Oe(this,fn).call(this,f),Oe(this,Ln).call(this,f,h,u),Oe(this,Rt)[f]=r,u){u.set="replace";const Ee=H&&ht(this,Yt,zt).call(this,H)?H.__staleWhileFetching:H;Ee!==void 0&&(u.oldValue=Ee)}}else u&&(u.set="update")}if(s!==0&&!Oe(this,Pr)&&ht(this,qn,_i).call(this),Oe(this,Pr)&&(p||Oe(this,Vn).call(this,f,s,o),u&&Oe(this,zr).call(this,u,f)),!l&&Oe(this,mr)&&Oe(this,ar)){const H=Oe(this,ar);let Ee;for(;Ee=H==null?void 0:H.shift();)(B=Oe(this,wr))==null||B.call(this,...Ee)}return this}pop(){var e;try{for(;Oe(this,tr);){const r=Oe(this,Rt)[Oe(this,cr)];if(ht(this,xn,ri).call(this,!0),ht(this,Yt,zt).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(Oe(this,mr)&&Oe(this,ar)){const r=Oe(this,ar);let n;for(;n=r==null?void 0:r.shift();)(e=Oe(this,wr))==null||e.call(this,...n)}}}has(e,r={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,o=Oe(this,rr).get(e);if(o!==void 0){const l=Oe(this,Rt)[o];if(ht(this,Yt,zt).call(this,l)&&l.__staleWhileFetching===void 0)return!1;if(Oe(this,Tr).call(this,o))s&&(s.has="stale",Oe(this,zr).call(this,s,o));else return n&&Oe(this,hn).call(this,o),s&&(s.has="hit",Oe(this,zr).call(this,s,o)),!0}else s&&(s.has="miss");return!1}peek(e,r={}){const{allowStale:n=this.allowStale}=r,s=Oe(this,rr).get(e);if(s!==void 0&&(n||!Oe(this,Tr).call(this,s))){const o=Oe(this,Rt)[s];return ht(this,Yt,zt).call(this,o)?o.__staleWhileFetching:o}}async fetch(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:l=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:A=this.ignoreFetchAbort,allowStaleOnFetchAbort:N=this.allowStaleOnFetchAbort,context:F,forceRefresh:B=!1,status:H,signal:Ee}=r;if(!Oe(this,nn))return H&&(H.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:H});const Pe={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:l,noDisposeOnSet:c,size:u,sizeCalculation:p,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:N,ignoreFetchAbort:A,status:H,signal:Ee};let g=Oe(this,rr).get(e);if(g===void 0){H&&(H.fetch="miss");const R=ht(this,Pn,ni).call(this,e,g,Pe,F);return R.__returned=R}else{const R=Oe(this,Rt)[g];if(ht(this,Yt,zt).call(this,R)){const W=n&&R.__staleWhileFetching!==void 0;return H&&(H.fetch="inflight",W&&(H.returnedStale=!0)),W?R.__staleWhileFetching:R.__returned=R}const y=Oe(this,Tr).call(this,g);if(!B&&!y)return H&&(H.fetch="hit"),ht(this,gn,Qn).call(this,g),s&&Oe(this,hn).call(this,g),H&&Oe(this,zr).call(this,H,g),R;const M=ht(this,Pn,ni).call(this,e,g,Pe,F),se=M.__staleWhileFetching!==void 0&&n;return H&&(H.fetch=y?"stale":"refresh",se&&y&&(H.returnedStale=!0)),se?M.__staleWhileFetching:M.__returned=M}}get(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:l}=r,c=Oe(this,rr).get(e);if(c!==void 0){const u=Oe(this,Rt)[c],p=ht(this,Yt,zt).call(this,u);return l&&Oe(this,zr).call(this,l,c),Oe(this,Tr).call(this,c)?(l&&(l.get="stale"),p?(l&&n&&u.__staleWhileFetching!==void 0&&(l.returnedStale=!0),n?u.__staleWhileFetching:void 0):(o||this.delete(e),l&&n&&(l.returnedStale=!0),n?u:void 0)):(l&&(l.get="hit"),p?u.__staleWhileFetching:(ht(this,gn,Qn).call(this,c),s&&Oe(this,hn).call(this,c),u))}else l&&(l.get="miss")}delete(e){var n,s,o,l;let r=!1;if(Oe(this,tr)!==0){const c=Oe(this,rr).get(e);if(c!==void 0)if(r=!0,Oe(this,tr)===1)this.clear();else{Oe(this,fn).call(this,c);const u=Oe(this,Rt)[c];ht(this,Yt,zt).call(this,u)?u.__abortController.abort(new Error("deleted")):(Oe(this,kr)||Oe(this,mr))&&(Oe(this,kr)&&((n=Oe(this,Dr))==null||n.call(this,u,e,"delete")),Oe(this,mr)&&((s=Oe(this,ar))==null||s.push([u,e,"delete"]))),Oe(this,rr).delete(e),Oe(this,qt)[c]=void 0,Oe(this,Rt)[c]=void 0,c===Oe(this,ir)?St(this,ir,Oe(this,br)[c]):c===Oe(this,cr)?St(this,cr,Oe(this,gr)[c]):(Oe(this,gr)[Oe(this,br)[c]]=Oe(this,gr)[c],Oe(this,br)[Oe(this,gr)[c]]=Oe(this,br)[c]),ti(this,tr)._--,Oe(this,xr).push(c)}}if(Oe(this,mr)&&((o=Oe(this,ar))!=null&&o.length)){const c=Oe(this,ar);let u;for(;u=c==null?void 0:c.shift();)(l=Oe(this,wr))==null||l.call(this,...u)}return r}clear(){var e,r,n;for(const s of ht(this,Yr,rn).call(this,{allowStale:!0})){const o=Oe(this,Rt)[s];if(ht(this,Yt,zt).call(this,o))o.__abortController.abort(new Error("deleted"));else{const l=Oe(this,qt)[s];Oe(this,kr)&&((e=Oe(this,Dr))==null||e.call(this,o,l,"delete")),Oe(this,mr)&&((r=Oe(this,ar))==null||r.push([o,l,"delete"]))}}if(Oe(this,rr).clear(),Oe(this,Rt).fill(void 0),Oe(this,qt).fill(void 0),Oe(this,Pr)&&Oe(this,Hr)&&(Oe(this,Pr).fill(0),Oe(this,Hr).fill(0)),Oe(this,Vr)&&Oe(this,Vr).fill(0),St(this,cr,0),St(this,ir,0),Oe(this,xr).length=0,St(this,Lr,0),St(this,tr,0),Oe(this,mr)&&Oe(this,ar)){const s=Oe(this,ar);let o;for(;o=s==null?void 0:s.shift();)(n=Oe(this,wr))==null||n.call(this,...o)}}};Nr=new WeakMap,Or=new WeakMap,Dr=new WeakMap,wr=new WeakMap,wn=new WeakMap,tr=new WeakMap,Lr=new WeakMap,rr=new WeakMap,qt=new WeakMap,Rt=new WeakMap,gr=new WeakMap,br=new WeakMap,cr=new WeakMap,ir=new WeakMap,xr=new WeakMap,ar=new WeakMap,Vr=new WeakMap,Hr=new WeakMap,Pr=new WeakMap,kr=new WeakMap,nn=new WeakMap,mr=new WeakMap,qn=new WeakSet,_i=function(){const e=new ZeroArray(Oe(this,Nr)),r=new ZeroArray(Oe(this,Nr));St(this,Pr,e),St(this,Hr,r),St(this,Vn,(o,l,c=perf.now())=>{if(r[o]=l!==0?c:0,e[o]=l,l!==0&&this.ttlAutopurge){const u=setTimeout(()=>{Oe(this,Tr).call(this,o)&&this.delete(Oe(this,qt)[o])},l+1);u.unref&&u.unref()}}),St(this,hn,o=>{r[o]=e[o]!==0?perf.now():0}),St(this,zr,(o,l)=>{if(e[l]){const c=e[l],u=r[l];o.ttl=c,o.start=u,o.now=n||s();const p=o.now-u;o.remainingTTL=c-p}});let n=0;const s=()=>{const o=perf.now();if(this.ttlResolution>0){n=o;const l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return o};this.getRemainingTTL=o=>{const l=Oe(this,rr).get(o);if(l===void 0)return 0;const c=e[l],u=r[l];if(c===0||u===0)return 1/0;const p=(n||s())-u;return c-p},St(this,Tr,o=>e[o]!==0&&r[o]!==0&&(n||s())-r[o]>e[o])},hn=new WeakMap,zr=new WeakMap,Vn=new WeakMap,Tr=new WeakMap,ii=new WeakSet,Li=function(){const e=new ZeroArray(Oe(this,Nr));St(this,Lr,0),St(this,Vr,e),St(this,fn,r=>{St(this,Lr,Oe(this,Lr)-e[r]),e[r]=0}),St(this,Hn,(r,n,s,o)=>{if(ht(this,Yt,zt).call(this,n))return 0;if(!isPosInt(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(n,r),!isPosInt(s))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 s}),St(this,Ln,(r,n,s)=>{if(e[r]=n,Oe(this,Or)){const o=Oe(this,Or)-e[r];for(;Oe(this,Lr)>o;)ht(this,xn,ri).call(this,!0)}St(this,Lr,Oe(this,Lr)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=Oe(this,Lr))})},fn=new WeakMap,Ln=new WeakMap,Hn=new WeakMap,Ur=new WeakSet,tn=function*({allowStale:e=this.allowStale}={}){if(Oe(this,tr))for(let r=Oe(this,ir);!(!ht(this,zn,Si).call(this,r)||((e||!Oe(this,Tr).call(this,r))&&(yield r),r===Oe(this,cr)));)r=Oe(this,br)[r]},Yr=new WeakSet,rn=function*({allowStale:e=this.allowStale}={}){if(Oe(this,tr))for(let r=Oe(this,cr);!(!ht(this,zn,Si).call(this,r)||((e||!Oe(this,Tr).call(this,r))&&(yield r),r===Oe(this,ir)));)r=Oe(this,gr)[r]},zn=new WeakSet,Si=function(e){return e!==void 0&&Oe(this,rr).get(Oe(this,qt)[e])===e},xn=new WeakSet,ri=function(e){var o,l;const r=Oe(this,cr),n=Oe(this,qt)[r],s=Oe(this,Rt)[r];return Oe(this,nn)&&ht(this,Yt,zt).call(this,s)?s.__abortController.abort(new Error("evicted")):(Oe(this,kr)||Oe(this,mr))&&(Oe(this,kr)&&((o=Oe(this,Dr))==null||o.call(this,s,n,"evict")),Oe(this,mr)&&((l=Oe(this,ar))==null||l.push([s,n,"evict"]))),Oe(this,fn).call(this,r),e&&(Oe(this,qt)[r]=void 0,Oe(this,Rt)[r]=void 0,Oe(this,xr).push(r)),Oe(this,tr)===1?(St(this,cr,St(this,ir,0)),Oe(this,xr).length=0):St(this,cr,Oe(this,gr)[r]),Oe(this,rr).delete(n),ti(this,tr)._--,r},Pn=new WeakSet,ni=function(e,r,n,s){const o=r===void 0?void 0:Oe(this,Rt)[r];if(ht(this,Yt,zt).call(this,o))return o;const l=new AC,{signal:c}=n;c==null||c.addEventListener("abort",()=>l.abort(c.reason),{signal:l.signal});const u={signal:l.signal,options:n,context:s},p=(F,B=!1)=>{const{aborted:H}=l.signal,Ee=n.ignoreFetchAbort&&F!==void 0;if(n.status&&(H&&!B?(n.status.fetchAborted=!0,n.status.fetchError=l.signal.reason,Ee&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),H&&!Ee&&!B)return f(l.signal.reason);const Pe=A;return Oe(this,Rt)[r]===A&&(F===void 0?Pe.__staleWhileFetching?Oe(this,Rt)[r]=Pe.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,F,u.options))),F},h=F=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=F),f(F)),f=F=>{const{aborted:B}=l.signal,H=B&&n.allowStaleOnFetchAbort,Ee=H||n.allowStaleOnFetchRejection,Pe=Ee||n.noDeleteOnFetchRejection,g=A;if(Oe(this,Rt)[r]===A&&(!Pe||g.__staleWhileFetching===void 0?this.delete(e):H||(Oe(this,Rt)[r]=g.__staleWhileFetching)),Ee)return n.status&&g.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),g.__staleWhileFetching;if(g.__returned===g)throw F},b=(F,B)=>{var Ee;const H=(Ee=Oe(this,wn))==null?void 0:Ee.call(this,e,o,u);H&&H instanceof Promise&&H.then(Pe=>F(Pe===void 0?void 0:Pe),B),l.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(F(void 0),n.allowStaleOnFetchAbort&&(F=Pe=>p(Pe,!0)))})};n.status&&(n.status.fetchDispatched=!0);const A=new Promise(b).then(p,h),N=Object.assign(A,{__abortController:l,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(e,N,{...u.options,status:void 0}),r=Oe(this,rr).get(e)):Oe(this,Rt)[r]=N,N},Yt=new WeakSet,zt=function(e){if(!Oe(this,nn))return!1;const r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AC},Wn=new WeakSet,Ei=function(e,r){Oe(this,br)[r]=e,Oe(this,gr)[e]=r},gn=new WeakSet,Qn=function(e){e!==Oe(this,ir)&&(e===Oe(this,cr)?St(this,cr,Oe(this,gr)[e]):ht(this,Wn,Ei).call(this,Oe(this,br)[e],Oe(this,gr)[e]),ht(this,Wn,Ei).call(this,Oe(this,ir),e),St(this,ir,e))};let LRUCache=Oi;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",0);_e(this,"redo");_e(this,"_current");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,r&&r.seed&&(r.randomSeed=r.seed,r.seededRandom=seededRandom(r.seed)),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(){if(this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.update(),this._current=void 0,this.index=0),this._current!==void 0){const r=this.evaluated[this._current%this.evaluated.length];r.modifiedEvent&&r.modifiedEvent==null,this._current=this._current+1r.evaluate()).flat(1/0).filter(r=>r!==void 0);return e.forEach((r,n)=>{r._next=n0?n-1:e.length-1}),e}}const generateCacheKey=(...a)=>a.map(e=>JSON.stringify(e)).join(","),cachedCall=(a,e)=>{const r=generateCacheKey(a,e);if(zcache.has(r))return zcache.get(r);{const n=new Ziffers(a,e);return zcache.set(r,n),n}},cachedPattern=(a,e={})=>cachedCall(a,e);class MidiConnection{constructor(){_e(this,"midiAccess",null);_e(this,"midiOutputs",[]);_e(this,"currentOutputIndex",0);_e(this,"scheduledNotes",{});this.initializeMidiAccess()}async initializeMidiAccess(){try{this.midiAccess=await navigator.requestMIDIAccess(),this.midiOutputs=Array.from(this.midiAccess.outputs.values()),this.midiOutputs.length===0&&console.warn("No MIDI outputs available.")}catch(e){console.error("Failed to initialize MIDI:",e)}}getCurrentMidiPort(){return this.midiOutputs.length>0&&this.currentOutputIndex>=0&&this.currentOutputIndexn.name===e);return r!==-1?(this.currentOutputIndex=r,!0):(console.error(`MIDI output "${e}" not found.`),!1)}listMidiOutputs(){console.log("Available MIDI Outputs:"),this.midiOutputs.forEach((e,r)=>{console.log(`${r+1}. ${e.name}`)})}sendMidiNote(e,r,n,s){const o=this.midiOutputs[this.currentOutputIndex];if(e=Math.min(Math.max(e,0),127),o){const l=[144+r,e,n],c=[128+r,e,0];o.send(l);const u=setTimeout(()=>{o.send(c),delete this.scheduledNotes[e]},(s-.02)*1e3);this.scheduledNotes[e]=u}else console.error("MIDI output not available.")}sendSysExMessage(e){const r=this.midiOutputs[this.currentOutputIndex];r?r.send(e):console.error("MIDI output not available.")}sendPitchBend(e,r){(e<0||e>16383)&&console.error("Invalid pitch bend value. Value must be in the range 0-16383."),(r<0||r>15)&&console.error("Invalid MIDI channel. Channel must be in the range 0-15.");const n=this.midiOutputs[this.currentOutputIndex];if(n){const s=e&127,o=e>>7&127;n.send([224|r,s,o])}else console.error("MIDI output not available.")}sendProgramChange(e,r){const n=this.midiOutputs[this.currentOutputIndex];n?n.send([192+r,e]):console.error("MIDI output not available.")}sendMidiControlChange(e,r,n){const s=this.midiOutputs[this.currentOutputIndex];s?s.send([176+n,e,r]):console.error("MIDI output not available.")}panic(){const e=this.midiOutputs[this.currentOutputIndex];if(e){for(const r in this.scheduledNotes){const n=this.scheduledNotes[r];clearTimeout(n),e.send([128,parseInt(r),0])}this.scheduledNotes={}}else console.error("MIDI output not available.")}}class DrunkWalk{constructor(e,r,n){_e(this,"min");_e(this,"max");_e(this,"wrap");_e(this,"position");this.min=e,this.max=r,this.wrap=n,this.position=0}step(){const e=Math.floor(Math.random()*3)-1;this.position+=e,this.wrap?this.position>this.max?this.position=this.min:this.positionthis.max&&(this.position=this.max)}getPosition(){return this.position}toggleWrap(e){this.wrap=e}}const SCALES={major:[0,2,4,5,7,9,11],naturalMinor:[0,2,3,5,7,8,10],harmonicMinor:[0,2,3,5,7,8,11],melodicMinor:[0,2,3,5,7,9,11],dorian:[0,2,3,5,7,9,10],phrygian:[0,1,3,5,7,8,10],lydian:[0,2,4,6,7,9,11],mixolydian:[0,2,4,5,7,9,10],aeolian:[0,2,3,5,7,8,10],locrian:[0,1,3,5,6,8,10],wholeTone:[0,2,4,6,8,10],majorPentatonic:[0,2,4,7,9],minorPentatonic:[0,3,5,7,10],chromatic:[0,1,2,3,4,5,6,7,8,9,10,11],blues:[0,3,5,6,7,10],diminished:[0,2,3,5,6,8,9,11],neapolitanMinor:[0,1,3,5,7,8,11],neapolitanMajor:[0,1,3,5,7,9,11],enigmatic:[0,1,4,6,8,10,11],doubleHarmonic:[0,1,4,5,7,8,11],octatonic:[0,2,3,5,6,8,9,11],bebopDominant:[0,2,4,5,7,9,10,11],bebopMajor:[0,2,4,5,7,8,9,11],bebopMinor:[0,2,3,5,7,8,9,11],bebopDorian:[0,2,3,4,5,7,9,10],harmonicMajor:[0,2,4,5,7,8,11],hungarianMinor:[0,2,3,6,7,8,11],hungarianMajor:[0,3,4,6,7,9,10],oriental:[0,1,4,5,6,9,10],romanianMinor:[0,2,3,6,7,9,10],spanishGypsy:[0,1,4,5,7,8,10],jewish:[0,1,4,5,7,8,10],hindu:[0,2,4,5,7,8,10],japanese:[0,1,5,7,8],hirajoshi:[0,2,3,7,8],kumoi:[0,2,3,7,9],inSen:[0,1,5,7,10],iwato:[0,1,5,6,10],yo:[0,2,5,7,9],minorBlues:[0,3,5,6,7,10],algerian:[0,2,3,5,6,7,8,11],augmented:[0,3,4,7,8,11],balinese:[0,1,3,7,8],byzantine:[0,1,4,5,7,8,11],chinese:[0,4,6,7,11],egyptian:[0,2,5,7,10],eightToneSpanish:[0,1,3,4,5,6,8,10],hawaiian:[0,2,3,5,7,9,10],hindustan:[0,2,4,5,7,8,10],persian:[0,1,4,5,6,8,11],eastIndianPurvi:[0,1,4,6,7,8,11],orientalA:[0,1,4,5,6,9,10]};function scale(a,e="major",r=4){const n=SCALES[e];if(!n)throw new Error(`Unknown scale ${e}`);let s=a%n.length;s<0&&(s+=n.length);let o=Math.floor(a/n.length);return 60+(r+o)*12+n[s]}let listenerQueue=[],atom=(a,e)=>{let r,n=[],s={lc:0,l:e||0,value:a,set(o){s.value=o,s.notify()},get(){return s.lc||s.listen(()=>{})(),s.value},notify(o){r=n;let l=!listenerQueue.length;for(let c=0;c{n===r&&(n=n.slice());let c=n.indexOf(o);~c&&(n.splice(c,2),s.lc--,s.lc||s.off())}},subscribe(o,l){let c=s.listen(o,l);return o(s.value),c},off(){}};return s},map=(a={})=>{let e=atom(a);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 a extends DelayNode{constructor(r,n,s,o){super(r),n=Math.abs(n),this.delayTime.value=s;const l=r.createGain();l.gain.value=Math.min(Math.abs(o),.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=u=>c.connect(u),this}start(r){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,r+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,r,n){return new a(this,e,r,n)}}typeof AudioContext<"u"&&(AudioContext.prototype.impulseResponse=function(a,e=1){const r=this.sampleRate*a,n=this.createBuffer(e,r,this.sampleRate),s=n.getChannelData(0);for(let o=0;o(e.buffer=this.impulseResponse(r),e.duration=a,e),e.setDuration(a),e});var U={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 a extends GainNode{constructor(r,n){if(super(r),!U[n])throw new Error("vowel: unknown vowel "+n);const{gains:s,qs:o,freqs:l}=U[n],c=r.createGain();for(let u=0;u<5;u++){const p=r.createGain();p.gain.value=s[u];const h=r.createBiquadFilter();h.type="bandpass",h.Q.value=o[u],h.frequency.value=l[u],this.connect(h),h.connect(p),p.connect(c)}return c.gain.value=8,this.connect=u=>c.connect(u),this}}AudioContext.prototype.createVowelFilter=function(e){return new a(this,e)}}const re=a=>{var s;if(typeof a!="string")return[];const[e,r="",n]=((s=a.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:s.slice(1))||[];return e?[e,r,n?Number(n):void 0]:[]},ie={c:0,d:2,e:4,f:5,g:7,a:9,b:11},ae={"#":1,b:-1,s:1,f:-1},E=(a,e=3)=>{const[r,n,s=e]=re(a);if(!r)throw new Error('not a note: "'+a+'"');const o=ie[r.toLowerCase()],l=(n==null?void 0:n.split("").reduce((c,u)=>c+ae[u],0))||0;return(Number(s)+1)*12+o+l},ge=a=>Math.pow(2,(a-69)/12)*440,de=(a,e,r)=>Math.min(Math.max(a,e),r),ue=a=>12*Math.log(a/440)/Math.LN2+69,le=(a,e)=>{if(typeof a!="object")throw new Error("valueToMidi: expected object value");let{freq:r,note:n}=a;if(typeof r=="number")return ue(r);if(typeof n=="string")return E(n);if(typeof n=="number")return n;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},Ie="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdGh1Yi5jb20vZGt0cjAvV2ViRGlydC9ibG9iL21haW4vTElDRU5TRQovLyBhbGwgdGhlIGNyZWRpdCBnb2VzIHRvIGRrdHIwJ3Mgd2ViZGlydDogaHR0cHM6Ly9naXRodWIuY29tL2RrdHIwL1dlYkRpcnQvYmxvYi81Y2UzZDY5ODM2MmM1NGQ2ZTFiNjhhY2M0N2ViMjk1NWFjNjJjNzkzL2Rpc3QvQXVkaW9Xb3JrbGV0cy5qcwovLyA8MwoKY2xhc3MgQ29hcnNlUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgZ2V0IHBhcmFtZXRlckRlc2NyaXB0b3JzKCkgewogICAgcmV0dXJuIFt7IG5hbWU6ICdjb2Fyc2UnLCBkZWZhdWx0VmFsdWU6IDEgfV07CiAgfQoKICBjb25zdHJ1Y3RvcigpIHsKICAgIHN1cGVyKCk7CiAgICB0aGlzLm5vdFN0YXJ0ZWQgPSB0cnVlOwogIH0KCiAgcHJvY2VzcyhpbnB1dHMsIG91dHB1dHMsIHBhcmFtZXRlcnMpIHsKICAgIGNvbnN0IGlucHV0ID0gaW5wdXRzWzBdOwogICAgY29uc3Qgb3V0cHV0ID0gb3V0cHV0c1swXTsKICAgIGNvbnN0IGNvYXJzZSA9IHBhcmFtZXRlcnMuY29hcnNlOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBvdXRwdXRbMF1bMF0gPSBpbnB1dFswXVswXTsKICAgICAgZm9yIChsZXQgbiA9IDE7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3V0cHV0Lmxlbmd0aDsgbysrKSB7CiAgICAgICAgICBvdXRwdXRbb11bbl0gPSBuICUgY29hcnNlID09IDAgPyBpbnB1dFswXVtuXSA6IG91dHB1dFtvXVtuIC0gMV07CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ2NvYXJzZS1wcm9jZXNzb3InLCBDb2Fyc2VQcm9jZXNzb3IpOwoKY2xhc3MgQ3J1c2hQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ2NydXNoJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBjcnVzaCA9IHBhcmFtZXRlcnMuY3J1c2g7CiAgICBjb25zdCBibG9ja1NpemUgPSAxMjg7CiAgICBjb25zdCBoYXNJbnB1dCA9ICEoaW5wdXRbMF0gPT09IHVuZGVmaW5lZCk7CiAgICBpZiAoaGFzSW5wdXQpIHsKICAgICAgdGhpcy5ub3RTdGFydGVkID0gZmFsc2U7CiAgICAgIGlmIChjcnVzaC5sZW5ndGggPT09IDEpIHsKICAgICAgICBjb25zdCB4ID0gTWF0aC5wb3coMiwgY3J1c2hbMF0gLSAxKTsKICAgICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgICBjb25zdCB2YWx1ZSA9IE1hdGgucm91bmQoaW5wdXRbMF1bbl0gKiB4KSAvIHg7CiAgICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgICBvdXRwdXRbb11bbl0gPSB2YWx1ZTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yIChsZXQgbiA9IDA7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgICAgbGV0IHggPSBNYXRoLnBvdygyLCBjcnVzaFtuXSAtIDEpOwogICAgICAgICAgY29uc3QgdmFsdWUgPSBNYXRoLnJvdW5kKGlucHV0WzBdW25dICogeCkgLyB4OwogICAgICAgICAgZm9yIChsZXQgbyA9IDA7IG8gPCBvdXRwdXQubGVuZ3RoOyBvKyspIHsKICAgICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQpyZWdpc3RlclByb2Nlc3NvcignY3J1c2gtcHJvY2Vzc29yJywgQ3J1c2hQcm9jZXNzb3IpOwoKY2xhc3MgU2hhcGVQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ3NoYXBlJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBzaGFwZTAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function j(a){const e=C().createGain();return e.gain.value=a,e}const Ce=({s:a,freq:e,t:r})=>{const n=C().createOscillator();return n.type=a||"triangle",n.frequency.value=Number(e),n.start(r),{node:n,stop:s=>n.stop(s)}},ne=(a,e,r,n,s,o)=>{const l=C().createGain();return l.gain.setValueAtTime(0,o),l.gain.linearRampToValueAtTime(s,o+a),l.gain.linearRampToValueAtTime(r*s,o+a+e),{node:l,stop:c=>{l.gain.setValueAtTime(r*s,c),l.gain.linearRampToValueAtTime(0,c+n)}}},J=(a,e,r)=>{const n=C().createBiquadFilter();return n.type=a,n.frequency.value=e,n.Q.value=r,n};let te=a=>console.log(a);const V=(...a)=>te(...a),P=map();function oe(a,e,r={}){P.setKey(a,{onTrigger:e,data:r})}function $(a){return P.get()[a]}let x;const C=()=>(x||(x=new AudioContext),x);let Y;const Q=()=>{const a=C();return Y||(Y=a.createGain(),Y.connect(a.destination)),Y};let k;function fe(){return k||(k=C().audioWorklet.addModule(Ie),k)}function O(a,e,r){const n=new AudioWorkletNode(a,e);return Object.entries(r).forEach(([s,o])=>{n.parameters.get(s).value=o}),n}async function he$2(a={}){const{disableWorklets:e=!1}=a;typeof window<"u"&&(await C().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await fe().catch(r=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",r)}))}async function We(a){return new Promise(e=>{document.addEventListener("click",async function r(){await he$2(a),e(),document.removeEventListener("click",r)})})}let w={};function Ae(a,e,r,n){var s;if(r=de(r,0,.98),!w[a]){const o=C().createFeedbackDelay(1,e,r);(s=o.start)==null||s.call(o,n),o.connect(Q()),w[a]=o}return w[a].delayTime.value!==e&&w[a].delayTime.setValueAtTime(e,n),w[a].feedback.value!==r&&w[a].feedback.setValueAtTime(r,n),w[a]}let G={};function pe(a,e=2){if(!G[a]){const r=C().createReverb(e);r.connect(Q()),G[a]=r}return G[a].duration!==e&&(G[a]=G[a].setDuration(e),G[a].duration=e),G[a]}function _(a,e,r){const n=j(r);return a.connect(n),n.connect(e),n}const be=async(a,e,r)=>{const n=C();if(typeof a!="object")throw new Error(`expected hap.value to be an object, but got "${a}". Hint: append .note() or .s() to the end`,"error");let s=n.currentTime+e,{s:o="triangle",bank:l,source:c,gain:u=.8,cutoff:p,resonance:h=1,hcutoff:f,hresonance:b=1,bandf:A,bandq:N=1,coarse:F,crush:B,shape:H,pan:Ee,vowel:Pe,delay:g=0,delayfeedback:R=.5,delaytime:y=.25,orbit:M=1,room:z,size:se=2,velocity:W=1}=a;u*=W;let Se=[];const ze=()=>{Se.forEach(ke=>ke==null?void 0:ke.disconnect())};l&&o&&(o=`${l}_${o}`);let Qe;if(c)Qe=c(s,a,r);else if($(o)){const{onTrigger:ke}=$(o),xe=await ke(s,a,ze);xe&&(Qe=xe.node,xe.stop(s+r))}else throw new Error(`sound ${o} not found! Is it loaded?`);if(!Qe)return;if(n.currentTime>s){V("[webaudio] skip hap: still loading",n.currentTime-s);return}const $e=[];if($e.push(Qe),$e.push(j(u)),p!==void 0&&$e.push(J("lowpass",p,h)),f!==void 0&&$e.push(J("highpass",f,b)),A!==void 0&&$e.push(J("bandpass",A,N)),Pe!==void 0&&$e.push(n.createVowelFilter(Pe)),F!==void 0&&$e.push(O(n,"coarse-processor",{coarse:F})),B!==void 0&&$e.push(O(n,"crush-processor",{crush:B})),H!==void 0&&$e.push(O(n,"shape-processor",{shape:H})),Ee!==void 0){const ke=n.createStereoPanner();ke.pan.value=2*Ee-1,$e.push(ke)}const Ue=j(1);$e.push(Ue),Ue.connect(Q());let Z;if(g>0&&y>0&&R>0){const ke=Ae(M,y,R,s);Z=_(Ue,ke,g)}let ve;if(z>0&&se>0){const ke=pe(M,se);ve=_(Ue,ke,z)}$e.slice(1).reduce((ke,xe)=>ke.connect(xe),$e[0]),Se=$e.concat([Z,ve])},L={};function Be(a,e){var r=e?1e3:1024;if(a=r);return a.toFixed(1)+" "+n[s]}const me=async(a,e,r,n,s,o,l)=>{let c=0;s!==void 0&&r!==void 0&&V("[sampler] hap has note and freq. ignoring note","warning");let u=le({freq:s,note:r},36);c=u-36;const p=C();let h;if(Array.isArray(o))h=o[e%o.length];else{const N=B=>E(B)-u,F=Object.keys(o).filter(B=>!B.startsWith("_")).reduce((B,H,Ee)=>!B||Math.abs(N(H)){const s=r?`sound "${r}:${n}"`:"sample";if(!L[a]){V(`[sampler] load ${s}..`,"load-sample",{url:a});const o=Date.now();L[a]=fetch(a).then(l=>l.arrayBuffer()).then(async l=>{const c=Date.now()-o,u=Be(l.byteLength);return V(`[sampler] load ${s}... done! loaded ${u} in ${c}ms`,"loaded-sample",{url:a}),await e.decodeAudioData(l)})}return L[a]};function we(a){const e=C(),r=e.createBuffer(a.numberOfChannels,a.length,e.sampleRate);for(let n=0;nObject.entries(a).forEach(([n,s])=>{if(typeof s=="string"&&(s=[s]),typeof s!="object")throw new Error("wrong sample map format for "+n);r=s._base||r;const o=l=>(r+l).replace("github:","https://raw.githubusercontent.com/");Array.isArray(s)?s=s.map(o):s=Object.fromEntries(Object.entries(s).map(([l,c])=>[l,(typeof c=="string"?[c]:c).map(o)])),e(n,s)});let ce={};function Xe(a){const e=Object.entries(ce).find(([r])=>a.startsWith(r));if(e)return e[1]}const Re=async(a,e=a._base||"",r={})=>{if(typeof a=="string"){const o=Xe(a);if(o)return o(a);if(a.startsWith("github:")){let[c,u]=a.split("github:");u=u.endsWith("/")?u.slice(0,-1):u,a=`https://raw.githubusercontent.com/${u}/strudel.json`}if(typeof fetch!="function")return;const l=a.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(a).then(c=>c.json()).then(c=>Re(c,e||c._base||l,r)).catch(c=>{throw console.error(c),new Error(`error loading "${a}"`)})}const{prebake:n,tag:s}=r;Ge(a,(o,l)=>oe(o,(c,u,p)=>Ve(c,u,p,l),{type:"sample",samples:l,baseUrl:e,prebake:n,tag:s}),e)},ee=[];async function Ve(a,e,r,n,s){const{s:o,freq:l,unit:c,nudge:u=0,cut:p,loop:h,clip:f=void 0,n:b=0,note:A,speed:N=1,begin:F=0,end:B=1}=e;if(N===0)return;const H=C(),{attack:Ee=.001,decay:Pe=.001,sustain:g=1,release:R=.001}=e,y=a+u,M=await me(o,b,A,N,l,n,s);if(H.currentTime>a){V(`[sampler] still loading sound "${o}:${b}"`,"highlight");return}if(!M){V(`[sampler] could not load "${o}:${b}"`,"error");return}M.playbackRate.value=Math.abs(N)*M.playbackRate.value,c==="c"&&(M.playbackRate.value=M.playbackRate.value*M.buffer.duration*1);const z=F*M.buffer.duration;M.start(y,z);const se=M.buffer.duration/M.playbackRate.value,{node:W,stop:Se}=ne(Ee,Pe,g,R,1,a);M.connect(W);const ze=H.createGain();W.connect(ze),M.onended=function(){M.disconnect(),W.disconnect(),ze.disconnect(),r()};const Qe={node:ze,bufferSource:M,stop:($e,Ue=f===void 0)=>{let Z=$e;Ue&&(Z=a+(B-F)*se),M.stop(Z+R),Se(Z)}};if(p!==void 0){const $e=ee[p];$e&&($e.node.gain.setValueAtTime(1,y),$e.node.gain.linearRampToValueAtTime(0,y+.01)),ee[p]=Qe}return Qe}function Fe(){["sine","square","triangle","sawtooth"].forEach(a=>{oe(a,(e,r,n)=>{const{attack:s=.001,decay:o=.05,sustain:l=.6,release:c=.01}=r;let{n:u,note:p,freq:h}=r;u=p||u||36,typeof u=="string"&&(u=E(u)),!h&&typeof u=="number"&&(h=ge(u));const{node:f,stop:b}=Ce({t:e,s:a,freq:h}),A=j(.3),{node:N,stop:F}=ne(s,o,l,c,1,e);return f.onended=()=>{f.disconnect(),A.disconnect(),n()},{node:f.connect(A).connect(N),stop:B=>{F(B),b(B+c)}}},{type:"synth",prebake:!0})})}class Sound{constructor(e,r){_e(this,"values");_e(this,"unit",e=>(this.values.unit=e,this));_e(this,"freq",e=>(this.values.freq=e,this));_e(this,"nudge",e=>(this.values.nudge=e,this));_e(this,"cut",e=>(this.values.cut=e,this));_e(this,"loop",e=>(this.values.loop=e,this));_e(this,"clip",e=>(this.values.clip=e,this));_e(this,"n",e=>(this.values.n=e,this));_e(this,"note",e=>(this.values.note=e,this));_e(this,"speed",e=>(this.values.speed=e,this));_e(this,"begin",e=>(this.values.begin=e,this));_e(this,"end",e=>(this.values.end=e,this));_e(this,"gain",e=>(this.values.gain=e,this));_e(this,"cutoff",e=>(this.values.cutoff=e,this));_e(this,"resonance",e=>(this.values.resonance=e,this));_e(this,"hcutoff",e=>(this.values.hcutoff=e,this));_e(this,"hresonance",e=>(this.values.hresonance=e,this));_e(this,"bandf",e=>(this.values.bandf=e,this));_e(this,"bandq",e=>(this.values.bandq=e,this));_e(this,"coarse",e=>(this.values.coarse=e,this));_e(this,"crush",e=>(this.values.crush=e,this));_e(this,"shape",e=>(this.values.shape=e,this));_e(this,"pan",e=>(this.values.pan=e,this));_e(this,"vowel",e=>(this.values.vowel=e,this));_e(this,"delay",e=>(this.values.delay=e,this));_e(this,"delayfeedback",e=>(this.values.delayfeedback=e,this));_e(this,"delaytime",e=>(this.values.delaytime=e,this));_e(this,"orbit",e=>(this.values.orbit=e,this));_e(this,"room",e=>(this.values.room=e,this));_e(this,"size",e=>(this.values.size=e,this));_e(this,"velocity",e=>(this.values.velocity=e,this));_e(this,"out",()=>be(this.values,this.app.clock.pulse_duration));this.app=r,this.values={s:e}}}const cache=new LRUCache({max:1e3,ttl:1e3*60*5});Array.prototype.in=function(a){return this.includes(a)};async function loadSamples(){const a="https://raw.githubusercontent.com/felixroos/dough-samples/main/";return Promise.all([We(),Re("github:Bubobubobubobubo/Topos-Samples/main"),Re(`${a}/tidal-drum-machines.json`),Re(`${a}/piano.json`),Re(`${a}/Dirt-Samples.json`),Re(`${a}/EmuSP12.json`),Re(`${a}/vcsl.json`),Fe()])}loadSamples();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,"time",()=>this.app.audioContext.currentTime);_e(this,"mouseX",()=>this.app._mouseX);_e(this,"mouseY",()=>this.app._mouseY);_e(this,"script",(...e)=>{e.forEach(r=>{tryEvaluate(this.app,this.app.universes[this.app.selected_universe].locals[r])})});_e(this,"s",this.script);_e(this,"clear_script",e=>{this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}});_e(this,"cs",this.clear_script);_e(this,"copy_script",(e,r)=>{this.app.universes[this.app.selected_universe].locals[r]=this.app.universes[this.app.selected_universe].locals[e]});_e(this,"cps",this.copy_script);_e(this,"midi_outputs",()=>(console.log(this.MidiConnection.listMidiOutputs()),this.MidiConnection.midiOutputs));_e(this,"midi_output",e=>{e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())});_e(this,"note",(e,r={})=>{const n=r.channel?r.channel:0,s=r.velocity?r.velocity:100,o=r.duration?r.duration:.5;this.MidiConnection.sendMidiNote(e,n,s,o)});_e(this,"sysex",e=>{this.MidiConnection.sendSysExMessage(e)});_e(this,"pitch_bend",(e,r)=>{this.MidiConnection.sendPitchBend(e,r)});_e(this,"program_change",(e,r)=>{this.MidiConnection.sendProgramChange(e,r)});_e(this,"midi_clock",()=>{this.MidiConnection.sendMidiClock()});_e(this,"control_change",({control:e=20,value:r=0,channel:n=0})=>{this.MidiConnection.sendMidiControlChange(e,r,n)});_e(this,"midi_panic",()=>{this.MidiConnection.panic()});_e(this,"zn",(e,r={})=>{const n=cachedPattern(e,r);if(n.hasStarted()){const s=n.peek(),o=s.modifiedEvent?s.modifiedEvent:s,l=r.channel?r.channel:0,c=r.velocity?r.velocity:100,u=r.sustain?r.sustain:.5;o instanceof Pitch?(o.bend&&this.MidiConnection.sendPitchBend(o.bend,l),this.MidiConnection.sendMidiNote(o.note,l,c,u),o.bend&&this.MidiConnection.sendPitchBend(8192,l)):o instanceof Chord&&o.pitches.forEach(p=>{p.bend&&this.MidiConnection.sendPitchBend(p.bend,l),this.MidiConnection.sendMidiNote(p.note,l,c,u),p.bend&&this.MidiConnection.sendPitchBend(8192,l)}),s.modifiedEvent&&(s.modifiedEvent=void 0)}return n.next()});_e(this,"iterator",(e,r,n)=>(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));_e(this,"$",this.iterator);_e(this,"drunk",e=>e!==void 0?(this._drunk.position=e,this._drunk.getPosition()):(this._drunk.step(),this._drunk.getPosition()));_e(this,"drunk_max",e=>{this._drunk.max=e});_e(this,"drunk_min",e=>{this._drunk.min=e});_e(this,"drunk_wrap",e=>{this._drunk.toggleWrap(e)});_e(this,"variable",(e,r)=>typeof e=="string"&&r===void 0?this.variables[e]:(this.variables[e]=r,this.variables[e]));_e(this,"v",this.variable);_e(this,"delete_variable",e=>{delete this.variables[e]});_e(this,"dv",this.delete_variable);_e(this,"clear_variables",()=>{this.variables={}});_e(this,"cv",this.clear_variables);_e(this,"seqmod",(...e)=>{if(cache.has(this._sequence_key_generator(e))){let r=cache.get(this._sequence_key_generator(e));return r.options.currentIteration++,r.options.currentIteration===r.options.nextTarget&&(r.options.index++,r.options.nextTarget=e[r.options.index%e.length],r.options.currentIteration=0),cache.set(this._sequence_key_generator(e),{pattern:e,options:r.options}),r.options.currentIteration===0}else{let r={index:-1,nextTarget:this.app.clock.ticks_before_new_bar,currentIteration:0};return typeof e[e.length-1]=="object"&&(r={...e.pop(),...r}),r.nextTarget=this.app.clock.ticks_before_new_bar,r.currentIteration===r.nextTarget&&(r.index++,r.nextTarget=e[r.index%e.length],r.currentIteration=0),cache.set(this._sequence_key_generator(e),{pattern:e,options:r}),r.currentIteration===0}});_e(this,"seq",(...e)=>{if(cache.has(this._sequence_key_generator(e))){let r=cache.get(this._sequence_key_generator(e));return r.options.index+=1,cache.set(this._sequence_key_generator(e),r),r.pattern[r.options.index%r.pattern.length]}else{let r={index:0};return typeof e[e.length-1]=="object"&&(r={...e.pop(),...r}),cache.set(this._sequence_key_generator(e),{pattern:e,options:r}),cache.get(this._sequence_key_generator(e))}});_e(this,"pick",(...e)=>e[Math.floor(Math.random()*e.length)]);_e(this,"seqbeat",(...e)=>e[this.ebeat()%e.length]);_e(this,"mel",(e,r)=>r[e%r.length]);_e(this,"seqbar",(...e)=>e[(this.app.clock.time_position.bar+1)%e.length]);_e(this,"seqpulse",(...e)=>e[this.app.clock.time_position.pulse%e.length]);_e(this,"randI",(e,r)=>Math.floor(Math.random()*(r-e+1))+e);_e(this,"rand",(e,r)=>Math.random()*(r-e)+e);_e(this,"rI",this.randI);_e(this,"r",this.rand);_e(this,"quantize",(e,r)=>{if(r.length===0)return e;let n=r[0];return r.forEach(s=>{Math.abs(s-e)Math.min(Math.max(e,r),n));_e(this,"cmp",this.clamp);_e(this,"bpm",e=>e===void 0?this.app.clock.bpm:((e<1||e>500)&&console.log(`Setting bpm to ${e}`),this.app.clock.bpm=e,e));_e(this,"tempo",this.bpm);_e(this,"bpb",e=>e===void 0?this.app.clock.time_signature[0]:(e<1&&console.log(`Setting bpb to ${e}`),this.app.clock.time_signature[0]=e,e));_e(this,"ppqn",e=>e===void 0?this.app.clock.ppqn:(e<1&&console.log(`Setting ppqn to ${e}`),this.app.clock.ppqn=e,e));_e(this,"time_signature",(e,r)=>{this.app.clock.time_signature=[e,r]});_e(this,"almostNever",()=>Math.random()>.9);_e(this,"sometimes",()=>Math.random()>.5);_e(this,"rarely",()=>Math.random()>.75);_e(this,"often",()=>Math.random()>.25);_e(this,"almostAlways",()=>Math.random()>.1);_e(this,"dice",e=>Math.floor(Math.random()*e)+1);_e(this,"i",e=>e!==void 0?(this.app.universes[this.app.selected_universe].global.evaluations=e,this.app.universes[this.app.selected_universe]):this.app.universes[this.app.selected_universe].global.evaluations);_e(this,"bar",()=>this.app.clock.time_position.bar);_e(this,"tick",()=>this.app.clock.tick);_e(this,"pulse",()=>this.app.clock.time_position.pulse);_e(this,"beat",()=>this.app.clock.time_position.beat);_e(this,"ebeat",()=>this.app.clock.beats_since_origin);_e(this,"epulse",()=>this.app.clock.pulses_since_origin);_e(this,"onbar",(e,...r)=>{const n=[...Array(e).keys()].map(s=>s+1);return console.log(r.some(s=>n.includes(s%e))),r.some(s=>n.includes(s%e))});_e(this,"onbeat",(...e)=>{let r=[];return e.forEach(n=>{n=n%this.app.clock.time_signature[0]+1;let s=Math.floor(n),o=n-s;r.push(s===this.app.clock.time_position.beat&&this.app.clock.time_position.pulse===o*this.app.clock.ppqn)}),r.some(n=>n==!0)});_e(this,"stop",()=>{this.app.clock.pause(),this.app.setButtonHighlighting("pause",!0)});_e(this,"silence",this.stop);_e(this,"hush",this.stop);_e(this,"prob",e=>Math.random()*100Math.random()>.5);_e(this,"min",(...e)=>Math.min(...e));_e(this,"max",(...e)=>Math.max(...e));_e(this,"limit",(e,r,n)=>Math.min(Math.max(e,r),n));_e(this,"delay",(e,r)=>{setTimeout(r,e)});_e(this,"delayr",(e,r,n)=>{[...Array(r).keys()].map(o=>e*o).forEach((o,l)=>{setTimeout(n,o)})});_e(this,"mod",(...e)=>e.some(r=>this.app.clock.time_position.pulse%r===0));_e(this,"modbar",(...e)=>e.some(r=>this.app.clock.time_position.bar%r===0));_e(this,"euclid",(e,r,n,s=0)=>this._euclidean_cycle(r,n,s)[e%n]);_e(this,"bin",(e,r)=>{let s=r.toString(2).split("").map(o=>o==="1");return s[e%s.length]});_e(this,"line",(e,r,n=1)=>{const s=[];if(r>e&&n>0||rMath.sin(this.app.clock.ctx.currentTime*Math.PI*2*e)+r);_e(this,"usine",(e=1,r=0)=>(this.sine(e,r)+1)/2);_e(this,"saw",(e=1,r=0)=>this.app.clock.ctx.currentTime*e%1*2-1+r);_e(this,"usaw",(e=1,r=0)=>(this.saw(e,r)+1)/2);_e(this,"triangle",(e=1,r=0)=>Math.abs(this.saw(e,r))*2-1);_e(this,"utriangle",(e=1,r=0)=>(this.triangle(e,r)+1)/2);_e(this,"square",(e=1,r=0)=>this.saw(e,r)>0?1:-1);_e(this,"usquare",(e=1,r=0)=>(this.square(e,r)+1)/2);_e(this,"noise",()=>Math.random()*2-1);_e(this,"abs",Math.abs);_e(this,"sound",e=>new Sound(e,this.app));_e(this,"samples",Re);_e(this,"log",console.log);_e(this,"scale",scale);_e(this,"rate",e=>{});this.app=e,this.load=Re("github:tidalcycles/Dirt-Samples/master")}_sequence_key_generator(e){return btoa(JSON.stringify(e))}_euclidean_cycle(e,r,n=0){if(e==r)return Array.from({length:r},()=>!0);function s(c,u){const p=c.length,h=(u+1)%p;return c[u]>c[h]}if(e>=r)return[!0];const o=Array.from({length:r},(c,u)=>(e*(u-1)%r+r)%r);let l=o.map((c,u)=>s(o,u));return n!=0&&(l=l.slice(n).concat(l.slice(0,n))),l}}const style="";var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var showdown$2={exports:{}};(function(a){(function(){function e(g){var R={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as
(GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: foo
",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(g===!1)return JSON.parse(JSON.stringify(R));var y={};for(var M in R)R.hasOwnProperty(M)&&(y[M]=R[M].defaultValue);return y}function r(){var g=e(!0),R={};for(var y in g)g.hasOwnProperty(y)&&(R[y]=!0);return R}var n={},s={},o={},l=e(!0),c="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:r()};n.helper={},n.extensions={},n.setOption=function(g,R){return l[g]=R,this},n.getOption=function(g){return l[g]},n.getOptions=function(){return l},n.resetOptions=function(){l=e(!0)},n.setFlavor=function(g){if(!u.hasOwnProperty(g))throw Error(g+" flavor was not found");n.resetOptions();var R=u[g];c=g;for(var y in R)R.hasOwnProperty(y)&&(l[y]=R[y])},n.getFlavor=function(){return c},n.getFlavorOptions=function(g){if(u.hasOwnProperty(g))return u[g]},n.getDefaultOptions=function(g){return e(g)},n.subParser=function(g,R){if(n.helper.isString(g))if(typeof R<"u")s[g]=R;else{if(s.hasOwnProperty(g))return s[g];throw Error("SubParser named "+g+" not registered!")}},n.extension=function(g,R){if(!n.helper.isString(g))throw Error("Extension 'name' must be a string");if(g=n.helper.stdExtName(g),n.helper.isUndefined(R)){if(!o.hasOwnProperty(g))throw Error("Extension named "+g+" is not registered!");return o[g]}else{typeof R=="function"&&(R=R()),n.helper.isArray(R)||(R=[R]);var y=p(R,g);if(y.valid)o[g]=R;else throw Error(y.error)}},n.getAllExtensions=function(){return o},n.removeExtension=function(g){delete o[g]},n.resetExtensions=function(){o={}};function p(g,R){var y=R?"Error in "+R+" extension->":"Error in unnamed extension",M={valid:!0,error:""};n.helper.isArray(g)||(g=[g]);for(var z=0;z"u"},n.helper.forEach=function(g,R){if(n.helper.isUndefined(g))throw new Error("obj param is required");if(n.helper.isUndefined(R))throw new Error("callback param is required");if(!n.helper.isFunction(R))throw new Error("callback param must be a function/closure");if(typeof g.forEach=="function")g.forEach(R);else if(n.helper.isArray(g))for(var y=0;y").replace(/&/g,"&")};var f=function(g,R,y,M){var z=M||"",se=z.indexOf("g")>-1,W=new RegExp(R+"|"+y,"g"+z.replace(/g/g,"")),Se=new RegExp(R,z.replace(/g/g,"")),ze=[],Qe,$e,Ue,Z,ve;do for(Qe=0;Ue=W.exec(g);)if(Se.test(Ue[0]))Qe++||($e=W.lastIndex,Z=$e-Ue[0].length);else if(Qe&&!--Qe){ve=Ue.index+Ue[0].length;var ke={left:{start:Z,end:$e},match:{start:$e,end:Ue.index},right:{start:Ue.index,end:ve},wholeMatch:{start:Z,end:ve}};if(ze.push(ke),!se)return ze}while(Qe&&(W.lastIndex=$e));return ze};n.helper.matchRecursiveRegExp=function(g,R,y,M){for(var z=f(g,R,y,M),se=[],W=0;W0){var Qe=[];W[0].wholeMatch.start!==0&&Qe.push(g.slice(0,W[0].wholeMatch.start));for(var $e=0;$e=0?M+(y||0):M},n.helper.splitAtIndex=function(g,R){if(!n.helper.isString(g))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[g.substring(0,R),g.substring(R)]},n.helper.encodeEmailAddress=function(g){var R=[function(y){return""+y.charCodeAt(0)+";"},function(y){return""+y.charCodeAt(0).toString(16)+";"},function(y){return y}];return g=g.replace(/./g,function(y){if(y==="@")y=R[Math.floor(Math.random()*2)](y);else{var M=Math.random();y=M>.9?R[2](y):M>.45?R[1](y):R[0](y)}return y}),g},n.helper.padEnd=function(R,y,M){return y=y>>0,M=String(M||" "),R.length>y?String(R):(y=y-R.length,y>M.length&&(M+=M.repeat(y/M.length)),String(R)+M.slice(0,y))},typeof console>"u"&&(console={warn:function(g){alert(g)},log:function(g){alert(g)},error:function(g){throw g}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨❤️👨",couple_with_heart_woman_woman:"👩❤️👩",couplekiss_man_man:"👨❤️💋👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩❤️💋👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨👦",family_man_boy_boy:"👨👦👦",family_man_girl:"👨👧",family_man_girl_boy:"👨👧👦",family_man_girl_girl:"👨👧👧",family_man_man_boy:"👨👨👦",family_man_man_boy_boy:"👨👨👦👦",family_man_man_girl:"👨👨👧",family_man_man_girl_boy:"👨👨👧👦",family_man_man_girl_girl:"👨👨👧👧",family_man_woman_boy_boy:"👨👩👦👦",family_man_woman_girl:"👨👩👧",family_man_woman_girl_boy:"👨👩👧👦",family_man_woman_girl_girl:"👨👩👧👧",family_woman_boy:"👩👦",family_woman_boy_boy:"👩👦👦",family_woman_girl:"👩👧",family_woman_girl_boy:"👩👧👦",family_woman_girl_girl:"👩👧👧",family_woman_woman_boy:"👩👩👦",family_woman_woman_boy_boy:"👩👩👦👦",family_woman_woman_girl:"👩👩👧",family_woman_woman_girl_boy:"👩👩👧👦",family_woman_woman_girl_girl:"👩👩👧👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨🎨",man_astronaut:"👨🚀",man_cartwheeling:"🤸♂️",man_cook:"👨🍳",man_dancing:"🕺",man_facepalming:"🤦♂️",man_factory_worker:"👨🏭",man_farmer:"👨🌾",man_firefighter:"👨🚒",man_health_worker:"👨⚕️",man_in_tuxedo:"🤵",man_judge:"👨⚖️",man_juggling:"🤹♂️",man_mechanic:"👨🔧",man_office_worker:"👨💼",man_pilot:"👨✈️",man_playing_handball:"🤾♂️",man_playing_water_polo:"🤽♂️",man_scientist:"👨🔬",man_shrugging:"🤷♂️",man_singer:"👨🎤",man_student:"👨🎓",man_teacher:"👨🏫",man_technologist:"👨💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩🎨",woman_astronaut:"👩🚀",woman_cartwheeling:"🤸♀️",woman_cook:"👩🍳",woman_facepalming:"🤦♀️",woman_factory_worker:"👩🏭",woman_farmer:"👩🌾",woman_firefighter:"👩🚒",woman_health_worker:"👩⚕️",woman_judge:"👩⚖️",woman_juggling:"🤹♀️",woman_mechanic:"👩🔧",woman_office_worker:"👩💼",woman_pilot:"👩✈️",woman_playing_handball:"🤾♀️",woman_playing_water_polo:"🤽♀️",woman_scientist:"👩🔬",woman_shrugging:"🤷♀️",woman_singer:"👩🎤",woman_student:"👩🎓",woman_teacher:"👩🏫",woman_technologist:"👩💻",woman_with_turban:"👳♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'
',showdown:`S`},n.Converter=function(g){var R={},y=[],M=[],z={},se=c,W={parsed:{},raw:"",format:""};Se();function Se(){g=g||{};for(var Z in l)l.hasOwnProperty(Z)&&(R[Z]=l[Z]);if(typeof g=="object")for(var ve in g)g.hasOwnProperty(ve)&&(R[ve]=g[ve]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof g+" was passed instead.");R.extensions&&n.helper.forEach(R.extensions,ze)}function ze(Z,ve){if(ve=ve||null,n.helper.isString(Z))if(Z=n.helper.stdExtName(Z),ve=Z,n.extensions[Z]){console.warn("DEPRECATION WARNING: "+Z+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),Qe(n.extensions[Z],Z);return}else if(!n.helper.isUndefined(o[Z]))Z=o[Z];else throw Error('Extension "'+Z+'" could not be loaded. It was either not found or is not a valid extension.');typeof Z=="function"&&(Z=Z()),n.helper.isArray(Z)||(Z=[Z]);var ke=p(Z,ve);if(!ke.valid)throw Error(ke.error);for(var xe=0;xe",!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(a){return centsToSemitones(a.filter(e=>e))},peg$f1=function(){},peg$f2=function(a,e){return Math.floor(Math.random()*(e-a+1)+a)},peg$f3=function(a,e){return Math.random()*(e-a)+a},peg$f4=function(){return parseFloat(text())},peg$f5=function(){return parseInt(text())},peg$f6=function(a){return ratioToCents(a)},peg$f7=function(a,e){return a/e},peg$f8=function(a,e){return Math.pow(2,a/e)},peg$f9=function(a,e,r,n){var s=n?r/n:r;return Math.pow(s,a/e)},peg$f10=function(a,e){return parseFloat(a.toString()+"."+e.toString())},peg$f11=function(a){return a.filter(e=>e)},peg$f12=function(a){return monzoToCents(a)},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(a,e){return{type:"literal",text:a,ignoreCase:e}}function peg$classExpectation(a,e,r){return{type:"class",parts:a,inverted:e,ignoreCase:r}}function peg$endExpectation(){return{type:"end"}}function peg$computePosDetails(a){var e=peg$posDetailsCache[a],r;if(e)return e;for(r=a-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(a))}function peg$buildStructuredError(a,e,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(a,e),a,e,r)}function peg$parselines(){var a,e,r,n=peg$currPos*17+0,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=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=a,e=peg$f0(e)),a=e,peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parsesep(){var a,e,r=peg$currPos*17+1,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(a=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=a,e=peg$f1()),a=e,peg$resultsCache[r]={nextPos:peg$currPos,result:a},a)}function peg$parsevalue(){var a,e=peg$currPos*17+2,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(a=peg$parsefloat(),a===peg$FAILED&&(a=peg$parseint(),a===peg$FAILED&&(a=peg$parserandom_int(),a===peg$FAILED&&(a=peg$parserandom_float()))),peg$resultsCache[e]={nextPos:peg$currPos,result:a},a)}function peg$parserandom_int(){var a,e,r,n,s,o,l=peg$currPos*17+3,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(a=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?(s=peg$parseint(),s!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(o=peg$c2,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e3)),o!==peg$FAILED?(peg$savedPos=a,a=peg$f2(r,s)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:a},a)}function peg$parserandom_float(){var a,e,r,n,s,o,l=peg$currPos*17+4,c=peg$resultsCache[l];return c?(peg$currPos=c.nextPos,c.result):(a=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?(s=peg$parsefloat(),s!==peg$FAILED?(input.charCodeAt(peg$currPos)===41?(o=peg$c2,peg$currPos++):(o=peg$FAILED,peg$fail(peg$e3)),o!==peg$FAILED?(peg$savedPos=a,a=peg$f3(r,s)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[l]={nextPos:peg$currPos,result:a},a)}function peg$parsefloat(){var a,e,r,n,s,o,l,c=peg$currPos*17+5,u=peg$resultsCache[c];if(u)return peg$currPos=u.nextPos,u.result;if(a=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))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));s!==peg$FAILED;)n.push(s),peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4));if(input.charCodeAt(peg$currPos)===46?(s=peg$c3,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e5)),s!==peg$FAILED){if(o=[],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;)o.push(l),peg$r1.test(input.charAt(peg$currPos))?(l=input.charAt(peg$currPos),peg$currPos++):(l=peg$FAILED,peg$fail(peg$e4));else o=peg$FAILED;o!==peg$FAILED?(r=[r,n,s,o],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))?(s=input.charAt(peg$currPos),peg$currPos++):(s=peg$FAILED,peg$fail(peg$e4)),s!==peg$FAILED)for(;s!==peg$FAILED;)n.push(s),peg$r1.test(input.charAt(peg$currPos))?(s=input.charAt(peg$currPos),peg$currPos++):(s=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=a,e=peg$f4()),a=e,peg$resultsCache[c]={nextPos:peg$currPos,result:a},a}function peg$parseint(){var a,e,r,n=peg$currPos*17+6,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=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=a,a=peg$f5()):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parseratio(){var a,e,r=peg$currPos*17+7,n=peg$resultsCache[r];return n?(peg$currPos=n.nextPos,n.result):(a=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=a,e=peg$f6(e)),a=e,peg$resultsCache[r]={nextPos:peg$currPos,result:a},a)}function peg$parsefrac_ratio(){var a,e,r,n,s=peg$currPos*17+8,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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=a,a=peg$f7(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseedo_ratio(){var a,e,r,n,s=peg$currPos*17+9,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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=a,a=peg$f8(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseedji_ratio(){var a,e,r,n,s,o,l,c,u=peg$currPos*17+10,p=peg$resultsCache[u];return p?(peg$currPos=p.nextPos,p.result):(a=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?(s=peg$c7,peg$currPos++):(s=peg$FAILED,peg$fail(peg$e9)),s!==peg$FAILED?(o=peg$parseint(),o===peg$FAILED&&(o=peg$parserandom_int()),o!==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=a,a=peg$f9(e,n,o,l)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[u]={nextPos:peg$currPos,result:a},a)}function peg$parsedecimal_ratio(){var a,e,r,n,s=peg$currPos*17+11,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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=a,a=peg$f10(e,n)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseints(){var a,e,r,n=peg$currPos*17+12,s=peg$resultsCache[n];if(s)return peg$currPos=s.nextPos,s.result;if(a=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=a,e=peg$f11(e)),a=e,peg$resultsCache[n]={nextPos:peg$currPos,result:a},a}function peg$parsemonzo(){var a,e,r,n,s=peg$currPos*17+13,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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=a,a=peg$f12(r)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}function peg$parseoperation(){var a,e,r,n,s,o,l,c=peg$currPos*17+14,u=peg$resultsCache[c];if(u)return peg$currPos=u.nextPos,u.result;if(a=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,s=peg$parseoperator(),s!==peg$FAILED){if(o=peg$parsevalue(),o===peg$FAILED&&(o=peg$parseratio(),o===peg$FAILED&&(o=peg$parsemonzo(),o===peg$FAILED&&(o=peg$parsesub_operations(),o===peg$FAILED&&(o=peg$parseoperation(),o===peg$FAILED)))))for(o=[],l=peg$parsesep();l!==peg$FAILED;)o.push(l),l=peg$parsesep();o!==peg$FAILED?(s=[s,o],n=s):(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,s=peg$parseoperator(),s!==peg$FAILED){if(o=peg$parsevalue(),o===peg$FAILED&&(o=peg$parseratio(),o===peg$FAILED&&(o=peg$parsemonzo(),o===peg$FAILED&&(o=peg$parsesub_operations(),o===peg$FAILED&&(o=peg$parseoperation(),o===peg$FAILED)))))for(o=[],l=peg$parsesep();l!==peg$FAILED;)o.push(l),l=peg$parsesep();o!==peg$FAILED?(s=[s,o],n=s):(peg$currPos=n,n=peg$FAILED)}else peg$currPos=n,n=peg$FAILED;else r=peg$FAILED;r!==peg$FAILED?(peg$savedPos=a,a=peg$f13()):(peg$currPos=a,a=peg$FAILED)}else peg$currPos=a,a=peg$FAILED;return peg$resultsCache[c]={nextPos:peg$currPos,result:a},a}function peg$parseoperator(){var a,e=peg$currPos*17+15,r=peg$resultsCache[e];return r?(peg$currPos=r.nextPos,r.result):(input.charCodeAt(peg$currPos)===43?(a=peg$c10,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e12)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===45?(a=peg$c4,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e6)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===42?(a=peg$c11,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e13)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===37?(a=peg$c12,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e14)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===38?(a=peg$c13,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e15)),a===peg$FAILED&&(input.charCodeAt(peg$currPos)===124?(a=peg$c14,peg$currPos++):(a=peg$FAILED,peg$fail(peg$e16)),a===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c15?(a=peg$c15,peg$currPos+=2):(a=peg$FAILED,peg$fail(peg$e17)),a===peg$FAILED&&(input.substr(peg$currPos,2)===peg$c16?(a=peg$c16,peg$currPos+=2):(a=peg$FAILED,peg$fail(peg$e18))))))))),peg$resultsCache[e]={nextPos:peg$currPos,result:a},a)}function peg$parsesub_operations(){var a,e,r,n,s=peg$currPos*17+16,o=peg$resultsCache[s];return o?(peg$currPos=o.nextPos,o.result):(a=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],a=e):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED)):(peg$currPos=a,a=peg$FAILED),peg$resultsCache[s]={nextPos:peg$currPos,result:a},a)}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(a,e,r,n):console.error(`[${r}] ${e}: ${a}`)};let AC=globalThis.AbortController,AS=globalThis.AbortSignal;var Di;if(typeof AC>"u"){AS=class{constructor(){_e(this,"onabort");_e(this,"_onabort",[]);_e(this,"reason");_e(this,"aborted",!1)}addEventListener(n,s){this._onabort.push(s)}},AC=class{constructor(){_e(this,"signal",new AS);e()}abort(n){var s,o;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const l of this.signal._onabort)l(n);(o=(s=this.signal).onabort)==null||o.call(s,n)}}};let a=((Di=PROCESS.env)==null?void 0:Di.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{a&&(a=!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=a=>!warned.has(a),isPosInt=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),getUintArray=a=>isPosInt(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(e){super(e),this.fill(0)}}var Dn;const pn=class pn{constructor(e,r){_e(this,"heap");_e(this,"length");if(!Oe(pn,Dn))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[];St(pn,Dn,!0);const n=new pn(e,r);return St(pn,Dn,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Dn=new WeakMap,Dt(pn,Dn,!1);let Stack=pn;var Nr,Or,Dr,wr,wn,tr,Lr,rr,qt,Rt,gr,br,cr,ir,xr,ar,Vr,Hr,Pr,kr,nn,mr,qn,_i,hn,zr,Vn,Tr,ii,Li,fn,Ln,Hn,Ur,tn,Yr,rn,zn,Si,xn,ri,Pn,ni,Yt,zt,Wn,Ei,gn,Qn;const Oi=class Oi{constructor(e){Dt(this,qn);Dt(this,ii);Dt(this,Ur);Dt(this,Yr);Dt(this,zn);Dt(this,xn);Dt(this,Pn);Dt(this,Yt);Dt(this,Wn);Dt(this,gn);Dt(this,Nr,void 0);Dt(this,Or,void 0);Dt(this,Dr,void 0);Dt(this,wr,void 0);Dt(this,wn,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");Dt(this,tr,void 0);Dt(this,Lr,void 0);Dt(this,rr,void 0);Dt(this,qt,void 0);Dt(this,Rt,void 0);Dt(this,gr,void 0);Dt(this,br,void 0);Dt(this,cr,void 0);Dt(this,ir,void 0);Dt(this,xr,void 0);Dt(this,ar,void 0);Dt(this,Vr,void 0);Dt(this,Hr,void 0);Dt(this,Pr,void 0);Dt(this,kr,void 0);Dt(this,nn,void 0);Dt(this,mr,void 0);Dt(this,hn,()=>{});Dt(this,zr,()=>{});Dt(this,Vn,()=>{});Dt(this,Tr,()=>!1);Dt(this,fn,e=>{});Dt(this,Ln,(e,r,n)=>{});Dt(this,Hn,(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:l,updateAgeOnHas:c,allowStale:u,dispose:p,disposeAfter:h,noDisposeOnSet:f,noUpdateTTL:b,maxSize:A=0,maxEntrySize:N=0,sizeCalculation:F,fetchMethod:B,noDeleteOnFetchRejection:H,noDeleteOnStaleGet:Ee,allowStaleOnFetchRejection:Pe,allowStaleOnFetchAbort:g,ignoreFetchAbort:R}=e;if(r!==0&&!isPosInt(r))throw new TypeError("max option must be a nonnegative integer");const y=r?getUintArray(r):Array;if(!y)throw new Error("invalid max value: "+r);if(St(this,Nr,r),St(this,Or,A),this.maxEntrySize=N||Oe(this,Or),this.sizeCalculation=F,this.sizeCalculation){if(!Oe(this,Or)&&!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(B!==void 0&&typeof B!="function")throw new TypeError("fetchMethod must be a function if specified");if(St(this,wn,B),St(this,nn,!!B),St(this,rr,new Map),St(this,qt,new Array(r).fill(void 0)),St(this,Rt,new Array(r).fill(void 0)),St(this,gr,new y(r)),St(this,br,new y(r)),St(this,cr,0),St(this,ir,0),St(this,xr,Stack.create(r)),St(this,tr,0),St(this,Lr,0),typeof p=="function"&&St(this,Dr,p),typeof h=="function"?(St(this,wr,h),St(this,ar,[])):(St(this,wr,void 0),St(this,ar,void 0)),St(this,kr,!!Oe(this,Dr)),St(this,mr,!!Oe(this,wr)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!H,this.allowStaleOnFetchRejection=!!Pe,this.allowStaleOnFetchAbort=!!g,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(Oe(this,Or)!==0&&!isPosInt(Oe(this,Or)))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");ht(this,ii,Li).call(this)}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!Ee,this.updateAgeOnGet=!!l,this.updateAgeOnHas=!!c,this.ttlResolution=isPosInt(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ht(this,qn,_i).call(this)}if(Oe(this,Nr)===0&&this.ttl===0&&Oe(this,Or)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!Oe(this,Nr)&&!Oe(this,Or)){const M="LRU_CACHE_UNBOUNDED";shouldWarn(M)&&(warned.add(M),emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,Oi))}}static unsafeExposeInternals(e){return{starts:Oe(e,Hr),ttls:Oe(e,Pr),sizes:Oe(e,Vr),keyMap:Oe(e,rr),keyList:Oe(e,qt),valList:Oe(e,Rt),next:Oe(e,gr),prev:Oe(e,br),get head(){return Oe(e,cr)},get tail(){return Oe(e,ir)},free:Oe(e,xr),isBackgroundFetch:r=>{var n;return ht(n=e,Yt,zt).call(n,r)},backgroundFetch:(r,n,s,o)=>{var l;return ht(l=e,Pn,ni).call(l,r,n,s,o)},moveToTail:r=>{var n;return ht(n=e,gn,Qn).call(n,r)},indexes:r=>{var n;return ht(n=e,Ur,tn).call(n,r)},rindexes:r=>{var n;return ht(n=e,Yr,rn).call(n,r)},isStale:r=>{var n;return Oe(n=e,Tr).call(n,r)}}}get max(){return Oe(this,Nr)}get maxSize(){return Oe(this,Or)}get calculatedSize(){return Oe(this,Lr)}get size(){return Oe(this,tr)}get fetchMethod(){return Oe(this,wn)}get dispose(){return Oe(this,Dr)}get disposeAfter(){return Oe(this,wr)}getRemainingTTL(e){return Oe(this,rr).has(e)?1/0:0}*entries(){for(const e of ht(this,Ur,tn).call(this))Oe(this,Rt)[e]!==void 0&&Oe(this,qt)[e]!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield[Oe(this,qt)[e],Oe(this,Rt)[e]])}*rentries(){for(const e of ht(this,Yr,rn).call(this))Oe(this,Rt)[e]!==void 0&&Oe(this,qt)[e]!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield[Oe(this,qt)[e],Oe(this,Rt)[e]])}*keys(){for(const e of ht(this,Ur,tn).call(this)){const r=Oe(this,qt)[e];r!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield r)}}*rkeys(){for(const e of ht(this,Yr,rn).call(this)){const r=Oe(this,qt)[e];r!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield r)}}*values(){for(const e of ht(this,Ur,tn).call(this))Oe(this,Rt)[e]!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield Oe(this,Rt)[e])}*rvalues(){for(const e of ht(this,Yr,rn).call(this))Oe(this,Rt)[e]!==void 0&&!ht(this,Yt,zt).call(this,Oe(this,Rt)[e])&&(yield Oe(this,Rt)[e])}[Symbol.iterator](){return this.entries()}find(e,r={}){for(const n of ht(this,Ur,tn).call(this)){const s=Oe(this,Rt)[n],o=ht(this,Yt,zt).call(this,s)?s.__staleWhileFetching:s;if(o!==void 0&&e(o,Oe(this,qt)[n],this))return this.get(Oe(this,qt)[n],r)}}forEach(e,r=this){for(const n of ht(this,Ur,tn).call(this)){const s=Oe(this,Rt)[n],o=ht(this,Yt,zt).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&e.call(r,o,Oe(this,qt)[n],this)}}rforEach(e,r=this){for(const n of ht(this,Yr,rn).call(this)){const s=Oe(this,Rt)[n],o=ht(this,Yt,zt).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&e.call(r,o,Oe(this,qt)[n],this)}}purgeStale(){let e=!1;for(const r of ht(this,Yr,rn).call(this,{allowStale:!0}))Oe(this,Tr).call(this,r)&&(this.delete(Oe(this,qt)[r]),e=!0);return e}dump(){const e=[];for(const r of ht(this,Ur,tn).call(this,{allowStale:!0})){const n=Oe(this,qt)[r],s=Oe(this,Rt)[r],o=ht(this,Yt,zt).call(this,s)?s.__staleWhileFetching:s;if(o===void 0||n===void 0)continue;const l={value:o};if(Oe(this,Pr)&&Oe(this,Hr)){l.ttl=Oe(this,Pr)[r];const c=perf.now()-Oe(this,Hr)[r];l.start=Math.floor(Date.now()-c)}Oe(this,Vr)&&(l.size=Oe(this,Vr)[r]),e.unshift([n,l])}return e}load(e){this.clear();for(const[r,n]of e){if(n.start){const s=Date.now()-n.start;n.start=perf.now()-s}this.set(r,n.value,n)}}set(e,r,n={}){var b,A,N,F,B;if(r===void 0)return this.delete(e),this;const{ttl:s=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=n;let{noUpdateTTL:p=this.noUpdateTTL}=n;const h=Oe(this,Hn).call(this,e,r,n.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(e),this;let f=Oe(this,tr)===0?void 0:Oe(this,rr).get(e);if(f===void 0)f=Oe(this,tr)===0?Oe(this,ir):Oe(this,xr).length!==0?Oe(this,xr).pop():Oe(this,tr)===Oe(this,Nr)?ht(this,xn,ri).call(this,!1):Oe(this,tr),Oe(this,qt)[f]=e,Oe(this,Rt)[f]=r,Oe(this,rr).set(e,f),Oe(this,gr)[Oe(this,ir)]=f,Oe(this,br)[f]=Oe(this,ir),St(this,ir,f),ti(this,tr)._++,Oe(this,Ln).call(this,f,h,u),u&&(u.set="add"),p=!1;else{ht(this,gn,Qn).call(this,f);const H=Oe(this,Rt)[f];if(r!==H){if(Oe(this,nn)&&ht(this,Yt,zt).call(this,H)){H.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:Ee}=H;Ee!==void 0&&!l&&(Oe(this,kr)&&((b=Oe(this,Dr))==null||b.call(this,Ee,e,"set")),Oe(this,mr)&&((A=Oe(this,ar))==null||A.push([Ee,e,"set"])))}else l||(Oe(this,kr)&&((N=Oe(this,Dr))==null||N.call(this,H,e,"set")),Oe(this,mr)&&((F=Oe(this,ar))==null||F.push([H,e,"set"])));if(Oe(this,fn).call(this,f),Oe(this,Ln).call(this,f,h,u),Oe(this,Rt)[f]=r,u){u.set="replace";const Ee=H&&ht(this,Yt,zt).call(this,H)?H.__staleWhileFetching:H;Ee!==void 0&&(u.oldValue=Ee)}}else u&&(u.set="update")}if(s!==0&&!Oe(this,Pr)&&ht(this,qn,_i).call(this),Oe(this,Pr)&&(p||Oe(this,Vn).call(this,f,s,o),u&&Oe(this,zr).call(this,u,f)),!l&&Oe(this,mr)&&Oe(this,ar)){const H=Oe(this,ar);let Ee;for(;Ee=H==null?void 0:H.shift();)(B=Oe(this,wr))==null||B.call(this,...Ee)}return this}pop(){var e;try{for(;Oe(this,tr);){const r=Oe(this,Rt)[Oe(this,cr)];if(ht(this,xn,ri).call(this,!0),ht(this,Yt,zt).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(Oe(this,mr)&&Oe(this,ar)){const r=Oe(this,ar);let n;for(;n=r==null?void 0:r.shift();)(e=Oe(this,wr))==null||e.call(this,...n)}}}has(e,r={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,o=Oe(this,rr).get(e);if(o!==void 0){const l=Oe(this,Rt)[o];if(ht(this,Yt,zt).call(this,l)&&l.__staleWhileFetching===void 0)return!1;if(Oe(this,Tr).call(this,o))s&&(s.has="stale",Oe(this,zr).call(this,s,o));else return n&&Oe(this,hn).call(this,o),s&&(s.has="hit",Oe(this,zr).call(this,s,o)),!0}else s&&(s.has="miss");return!1}peek(e,r={}){const{allowStale:n=this.allowStale}=r,s=Oe(this,rr).get(e);if(s!==void 0&&(n||!Oe(this,Tr).call(this,s))){const o=Oe(this,Rt)[s];return ht(this,Yt,zt).call(this,o)?o.__staleWhileFetching:o}}async fetch(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:l=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:A=this.ignoreFetchAbort,allowStaleOnFetchAbort:N=this.allowStaleOnFetchAbort,context:F,forceRefresh:B=!1,status:H,signal:Ee}=r;if(!Oe(this,nn))return H&&(H.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:H});const Pe={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:l,noDisposeOnSet:c,size:u,sizeCalculation:p,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:N,ignoreFetchAbort:A,status:H,signal:Ee};let g=Oe(this,rr).get(e);if(g===void 0){H&&(H.fetch="miss");const R=ht(this,Pn,ni).call(this,e,g,Pe,F);return R.__returned=R}else{const R=Oe(this,Rt)[g];if(ht(this,Yt,zt).call(this,R)){const W=n&&R.__staleWhileFetching!==void 0;return H&&(H.fetch="inflight",W&&(H.returnedStale=!0)),W?R.__staleWhileFetching:R.__returned=R}const y=Oe(this,Tr).call(this,g);if(!B&&!y)return H&&(H.fetch="hit"),ht(this,gn,Qn).call(this,g),s&&Oe(this,hn).call(this,g),H&&Oe(this,zr).call(this,H,g),R;const M=ht(this,Pn,ni).call(this,e,g,Pe,F),se=M.__staleWhileFetching!==void 0&&n;return H&&(H.fetch=y?"stale":"refresh",se&&y&&(H.returnedStale=!0)),se?M.__staleWhileFetching:M.__returned=M}}get(e,r={}){const{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:l}=r,c=Oe(this,rr).get(e);if(c!==void 0){const u=Oe(this,Rt)[c],p=ht(this,Yt,zt).call(this,u);return l&&Oe(this,zr).call(this,l,c),Oe(this,Tr).call(this,c)?(l&&(l.get="stale"),p?(l&&n&&u.__staleWhileFetching!==void 0&&(l.returnedStale=!0),n?u.__staleWhileFetching:void 0):(o||this.delete(e),l&&n&&(l.returnedStale=!0),n?u:void 0)):(l&&(l.get="hit"),p?u.__staleWhileFetching:(ht(this,gn,Qn).call(this,c),s&&Oe(this,hn).call(this,c),u))}else l&&(l.get="miss")}delete(e){var n,s,o,l;let r=!1;if(Oe(this,tr)!==0){const c=Oe(this,rr).get(e);if(c!==void 0)if(r=!0,Oe(this,tr)===1)this.clear();else{Oe(this,fn).call(this,c);const u=Oe(this,Rt)[c];ht(this,Yt,zt).call(this,u)?u.__abortController.abort(new Error("deleted")):(Oe(this,kr)||Oe(this,mr))&&(Oe(this,kr)&&((n=Oe(this,Dr))==null||n.call(this,u,e,"delete")),Oe(this,mr)&&((s=Oe(this,ar))==null||s.push([u,e,"delete"]))),Oe(this,rr).delete(e),Oe(this,qt)[c]=void 0,Oe(this,Rt)[c]=void 0,c===Oe(this,ir)?St(this,ir,Oe(this,br)[c]):c===Oe(this,cr)?St(this,cr,Oe(this,gr)[c]):(Oe(this,gr)[Oe(this,br)[c]]=Oe(this,gr)[c],Oe(this,br)[Oe(this,gr)[c]]=Oe(this,br)[c]),ti(this,tr)._--,Oe(this,xr).push(c)}}if(Oe(this,mr)&&((o=Oe(this,ar))!=null&&o.length)){const c=Oe(this,ar);let u;for(;u=c==null?void 0:c.shift();)(l=Oe(this,wr))==null||l.call(this,...u)}return r}clear(){var e,r,n;for(const s of ht(this,Yr,rn).call(this,{allowStale:!0})){const o=Oe(this,Rt)[s];if(ht(this,Yt,zt).call(this,o))o.__abortController.abort(new Error("deleted"));else{const l=Oe(this,qt)[s];Oe(this,kr)&&((e=Oe(this,Dr))==null||e.call(this,o,l,"delete")),Oe(this,mr)&&((r=Oe(this,ar))==null||r.push([o,l,"delete"]))}}if(Oe(this,rr).clear(),Oe(this,Rt).fill(void 0),Oe(this,qt).fill(void 0),Oe(this,Pr)&&Oe(this,Hr)&&(Oe(this,Pr).fill(0),Oe(this,Hr).fill(0)),Oe(this,Vr)&&Oe(this,Vr).fill(0),St(this,cr,0),St(this,ir,0),Oe(this,xr).length=0,St(this,Lr,0),St(this,tr,0),Oe(this,mr)&&Oe(this,ar)){const s=Oe(this,ar);let o;for(;o=s==null?void 0:s.shift();)(n=Oe(this,wr))==null||n.call(this,...o)}}};Nr=new WeakMap,Or=new WeakMap,Dr=new WeakMap,wr=new WeakMap,wn=new WeakMap,tr=new WeakMap,Lr=new WeakMap,rr=new WeakMap,qt=new WeakMap,Rt=new WeakMap,gr=new WeakMap,br=new WeakMap,cr=new WeakMap,ir=new WeakMap,xr=new WeakMap,ar=new WeakMap,Vr=new WeakMap,Hr=new WeakMap,Pr=new WeakMap,kr=new WeakMap,nn=new WeakMap,mr=new WeakMap,qn=new WeakSet,_i=function(){const e=new ZeroArray(Oe(this,Nr)),r=new ZeroArray(Oe(this,Nr));St(this,Pr,e),St(this,Hr,r),St(this,Vn,(o,l,c=perf.now())=>{if(r[o]=l!==0?c:0,e[o]=l,l!==0&&this.ttlAutopurge){const u=setTimeout(()=>{Oe(this,Tr).call(this,o)&&this.delete(Oe(this,qt)[o])},l+1);u.unref&&u.unref()}}),St(this,hn,o=>{r[o]=e[o]!==0?perf.now():0}),St(this,zr,(o,l)=>{if(e[l]){const c=e[l],u=r[l];o.ttl=c,o.start=u,o.now=n||s();const p=o.now-u;o.remainingTTL=c-p}});let n=0;const s=()=>{const o=perf.now();if(this.ttlResolution>0){n=o;const l=setTimeout(()=>n=0,this.ttlResolution);l.unref&&l.unref()}return o};this.getRemainingTTL=o=>{const l=Oe(this,rr).get(o);if(l===void 0)return 0;const c=e[l],u=r[l];if(c===0||u===0)return 1/0;const p=(n||s())-u;return c-p},St(this,Tr,o=>e[o]!==0&&r[o]!==0&&(n||s())-r[o]>e[o])},hn=new WeakMap,zr=new WeakMap,Vn=new WeakMap,Tr=new WeakMap,ii=new WeakSet,Li=function(){const e=new ZeroArray(Oe(this,Nr));St(this,Lr,0),St(this,Vr,e),St(this,fn,r=>{St(this,Lr,Oe(this,Lr)-e[r]),e[r]=0}),St(this,Hn,(r,n,s,o)=>{if(ht(this,Yt,zt).call(this,n))return 0;if(!isPosInt(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(n,r),!isPosInt(s))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 s}),St(this,Ln,(r,n,s)=>{if(e[r]=n,Oe(this,Or)){const o=Oe(this,Or)-e[r];for(;Oe(this,Lr)>o;)ht(this,xn,ri).call(this,!0)}St(this,Lr,Oe(this,Lr)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=Oe(this,Lr))})},fn=new WeakMap,Ln=new WeakMap,Hn=new WeakMap,Ur=new WeakSet,tn=function*({allowStale:e=this.allowStale}={}){if(Oe(this,tr))for(let r=Oe(this,ir);!(!ht(this,zn,Si).call(this,r)||((e||!Oe(this,Tr).call(this,r))&&(yield r),r===Oe(this,cr)));)r=Oe(this,br)[r]},Yr=new WeakSet,rn=function*({allowStale:e=this.allowStale}={}){if(Oe(this,tr))for(let r=Oe(this,cr);!(!ht(this,zn,Si).call(this,r)||((e||!Oe(this,Tr).call(this,r))&&(yield r),r===Oe(this,ir)));)r=Oe(this,gr)[r]},zn=new WeakSet,Si=function(e){return e!==void 0&&Oe(this,rr).get(Oe(this,qt)[e])===e},xn=new WeakSet,ri=function(e){var o,l;const r=Oe(this,cr),n=Oe(this,qt)[r],s=Oe(this,Rt)[r];return Oe(this,nn)&&ht(this,Yt,zt).call(this,s)?s.__abortController.abort(new Error("evicted")):(Oe(this,kr)||Oe(this,mr))&&(Oe(this,kr)&&((o=Oe(this,Dr))==null||o.call(this,s,n,"evict")),Oe(this,mr)&&((l=Oe(this,ar))==null||l.push([s,n,"evict"]))),Oe(this,fn).call(this,r),e&&(Oe(this,qt)[r]=void 0,Oe(this,Rt)[r]=void 0,Oe(this,xr).push(r)),Oe(this,tr)===1?(St(this,cr,St(this,ir,0)),Oe(this,xr).length=0):St(this,cr,Oe(this,gr)[r]),Oe(this,rr).delete(n),ti(this,tr)._--,r},Pn=new WeakSet,ni=function(e,r,n,s){const o=r===void 0?void 0:Oe(this,Rt)[r];if(ht(this,Yt,zt).call(this,o))return o;const l=new AC,{signal:c}=n;c==null||c.addEventListener("abort",()=>l.abort(c.reason),{signal:l.signal});const u={signal:l.signal,options:n,context:s},p=(F,B=!1)=>{const{aborted:H}=l.signal,Ee=n.ignoreFetchAbort&&F!==void 0;if(n.status&&(H&&!B?(n.status.fetchAborted=!0,n.status.fetchError=l.signal.reason,Ee&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),H&&!Ee&&!B)return f(l.signal.reason);const Pe=A;return Oe(this,Rt)[r]===A&&(F===void 0?Pe.__staleWhileFetching?Oe(this,Rt)[r]=Pe.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,F,u.options))),F},h=F=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=F),f(F)),f=F=>{const{aborted:B}=l.signal,H=B&&n.allowStaleOnFetchAbort,Ee=H||n.allowStaleOnFetchRejection,Pe=Ee||n.noDeleteOnFetchRejection,g=A;if(Oe(this,Rt)[r]===A&&(!Pe||g.__staleWhileFetching===void 0?this.delete(e):H||(Oe(this,Rt)[r]=g.__staleWhileFetching)),Ee)return n.status&&g.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),g.__staleWhileFetching;if(g.__returned===g)throw F},b=(F,B)=>{var Ee;const H=(Ee=Oe(this,wn))==null?void 0:Ee.call(this,e,o,u);H&&H instanceof Promise&&H.then(Pe=>F(Pe===void 0?void 0:Pe),B),l.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(F(void 0),n.allowStaleOnFetchAbort&&(F=Pe=>p(Pe,!0)))})};n.status&&(n.status.fetchDispatched=!0);const A=new Promise(b).then(p,h),N=Object.assign(A,{__abortController:l,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(e,N,{...u.options,status:void 0}),r=Oe(this,rr).get(e)):Oe(this,Rt)[r]=N,N},Yt=new WeakSet,zt=function(e){if(!Oe(this,nn))return!1;const r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AC},Wn=new WeakSet,Ei=function(e,r){Oe(this,br)[r]=e,Oe(this,gr)[e]=r},gn=new WeakSet,Qn=function(e){e!==Oe(this,ir)&&(e===Oe(this,cr)?St(this,cr,Oe(this,gr)[e]):ht(this,Wn,Ei).call(this,Oe(this,br)[e],Oe(this,gr)[e]),ht(this,Wn,Ei).call(this,Oe(this,ir),e),St(this,ir,e))};let LRUCache=Oi;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",0);_e(this,"redo");_e(this,"_current");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,r&&r.seed&&(r.randomSeed=r.seed,r.seededRandom=seededRandom(r.seed)),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(){if(this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.update(),this._current=void 0,this.index=0),this._current!==void 0){const r=this.evaluated[this._current%this.evaluated.length];r.modifiedEvent&&r.modifiedEvent==null,this._current=this._current+1r.evaluate()).flat(1/0).filter(r=>r!==void 0);return e.forEach((r,n)=>{r._next=n0?n-1:e.length-1}),e}}const generateCacheKey=(...a)=>a.map(e=>JSON.stringify(e)).join(","),cachedCall=(a,e)=>{const r=generateCacheKey(a,e);if(zcache.has(r))return zcache.get(r);{const n=new Ziffers(a,e);return zcache.set(r,n),n}},cachedPattern=(a,e={})=>cachedCall(a,e);class MidiConnection{constructor(){_e(this,"midiAccess",null);_e(this,"midiOutputs",[]);_e(this,"currentOutputIndex",0);_e(this,"scheduledNotes",{});this.initializeMidiAccess()}async initializeMidiAccess(){try{this.midiAccess=await navigator.requestMIDIAccess(),this.midiOutputs=Array.from(this.midiAccess.outputs.values()),this.midiOutputs.length===0&&console.warn("No MIDI outputs available.")}catch(e){console.error("Failed to initialize MIDI:",e)}}getCurrentMidiPort(){return this.midiOutputs.length>0&&this.currentOutputIndex>=0&&this.currentOutputIndexn.name===e);return r!==-1?(this.currentOutputIndex=r,!0):(console.error(`MIDI output "${e}" not found.`),!1)}listMidiOutputs(){console.log("Available MIDI Outputs:"),this.midiOutputs.forEach((e,r)=>{console.log(`${r+1}. ${e.name}`)})}sendMidiNote(e,r,n,s){const o=this.midiOutputs[this.currentOutputIndex];if(e=Math.min(Math.max(e,0),127),o){const l=[144+r,e,n],c=[128+r,e,0];o.send(l);const u=setTimeout(()=>{o.send(c),delete this.scheduledNotes[e]},(s-.02)*1e3);this.scheduledNotes[e]=u}else console.error("MIDI output not available.")}sendSysExMessage(e){const r=this.midiOutputs[this.currentOutputIndex];r?r.send(e):console.error("MIDI output not available.")}sendPitchBend(e,r){(e<0||e>16383)&&console.error("Invalid pitch bend value. Value must be in the range 0-16383."),(r<0||r>15)&&console.error("Invalid MIDI channel. Channel must be in the range 0-15.");const n=this.midiOutputs[this.currentOutputIndex];if(n){const s=e&127,o=e>>7&127;n.send([224|r,s,o])}else console.error("MIDI output not available.")}sendProgramChange(e,r){const n=this.midiOutputs[this.currentOutputIndex];n?n.send([192+r,e]):console.error("MIDI output not available.")}sendMidiControlChange(e,r,n){const s=this.midiOutputs[this.currentOutputIndex];s?s.send([176+n,e,r]):console.error("MIDI output not available.")}panic(){const e=this.midiOutputs[this.currentOutputIndex];if(e){for(const r in this.scheduledNotes){const n=this.scheduledNotes[r];clearTimeout(n),e.send([128,parseInt(r),0])}this.scheduledNotes={}}else console.error("MIDI output not available.")}}class DrunkWalk{constructor(e,r,n){_e(this,"min");_e(this,"max");_e(this,"wrap");_e(this,"position");this.min=e,this.max=r,this.wrap=n,this.position=0}step(){const e=Math.floor(Math.random()*3)-1;this.position+=e,this.wrap?this.position>this.max?this.position=this.min:this.positionthis.max&&(this.position=this.max)}getPosition(){return this.position}toggleWrap(e){this.wrap=e}}const SCALES={major:[0,2,4,5,7,9,11],naturalMinor:[0,2,3,5,7,8,10],harmonicMinor:[0,2,3,5,7,8,11],melodicMinor:[0,2,3,5,7,9,11],dorian:[0,2,3,5,7,9,10],phrygian:[0,1,3,5,7,8,10],lydian:[0,2,4,6,7,9,11],mixolydian:[0,2,4,5,7,9,10],aeolian:[0,2,3,5,7,8,10],locrian:[0,1,3,5,6,8,10],wholeTone:[0,2,4,6,8,10],majorPentatonic:[0,2,4,7,9],minorPentatonic:[0,3,5,7,10],chromatic:[0,1,2,3,4,5,6,7,8,9,10,11],blues:[0,3,5,6,7,10],diminished:[0,2,3,5,6,8,9,11],neapolitanMinor:[0,1,3,5,7,8,11],neapolitanMajor:[0,1,3,5,7,9,11],enigmatic:[0,1,4,6,8,10,11],doubleHarmonic:[0,1,4,5,7,8,11],octatonic:[0,2,3,5,6,8,9,11],bebopDominant:[0,2,4,5,7,9,10,11],bebopMajor:[0,2,4,5,7,8,9,11],bebopMinor:[0,2,3,5,7,8,9,11],bebopDorian:[0,2,3,4,5,7,9,10],harmonicMajor:[0,2,4,5,7,8,11],hungarianMinor:[0,2,3,6,7,8,11],hungarianMajor:[0,3,4,6,7,9,10],oriental:[0,1,4,5,6,9,10],romanianMinor:[0,2,3,6,7,9,10],spanishGypsy:[0,1,4,5,7,8,10],jewish:[0,1,4,5,7,8,10],hindu:[0,2,4,5,7,8,10],japanese:[0,1,5,7,8],hirajoshi:[0,2,3,7,8],kumoi:[0,2,3,7,9],inSen:[0,1,5,7,10],iwato:[0,1,5,6,10],yo:[0,2,5,7,9],minorBlues:[0,3,5,6,7,10],algerian:[0,2,3,5,6,7,8,11],augmented:[0,3,4,7,8,11],balinese:[0,1,3,7,8],byzantine:[0,1,4,5,7,8,11],chinese:[0,4,6,7,11],egyptian:[0,2,5,7,10],eightToneSpanish:[0,1,3,4,5,6,8,10],hawaiian:[0,2,3,5,7,9,10],hindustan:[0,2,4,5,7,8,10],persian:[0,1,4,5,6,8,11],eastIndianPurvi:[0,1,4,6,7,8,11],orientalA:[0,1,4,5,6,9,10]};function scale(a,e="major",r=4){const n=SCALES[e];if(!n)throw new Error(`Unknown scale ${e}`);let s=a%n.length;s<0&&(s+=n.length);let o=Math.floor(a/n.length);return 60+(r+o)*12+n[s]}let listenerQueue=[],atom=(a,e)=>{let r,n=[],s={lc:0,l:e||0,value:a,set(o){s.value=o,s.notify()},get(){return s.lc||s.listen(()=>{})(),s.value},notify(o){r=n;let l=!listenerQueue.length;for(let c=0;c{n===r&&(n=n.slice());let c=n.indexOf(o);~c&&(n.splice(c,2),s.lc--,s.lc||s.off())}},subscribe(o,l){let c=s.listen(o,l);return o(s.value),c},off(){}};return s},map=(a={})=>{let e=atom(a);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 a extends DelayNode{constructor(r,n,s,o){super(r),n=Math.abs(n),this.delayTime.value=s;const l=r.createGain();l.gain.value=Math.min(Math.abs(o),.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=u=>c.connect(u),this}start(r){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,r+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,r,n){return new a(this,e,r,n)}}typeof AudioContext<"u"&&(AudioContext.prototype.impulseResponse=function(a,e=1){const r=this.sampleRate*a,n=this.createBuffer(e,r,this.sampleRate),s=n.getChannelData(0);for(let o=0;o(e.buffer=this.impulseResponse(r),e.duration=a,e),e.setDuration(a),e});var U={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 a extends GainNode{constructor(r,n){if(super(r),!U[n])throw new Error("vowel: unknown vowel "+n);const{gains:s,qs:o,freqs:l}=U[n],c=r.createGain();for(let u=0;u<5;u++){const p=r.createGain();p.gain.value=s[u];const h=r.createBiquadFilter();h.type="bandpass",h.Q.value=o[u],h.frequency.value=l[u],this.connect(h),h.connect(p),p.connect(c)}return c.gain.value=8,this.connect=u=>c.connect(u),this}}AudioContext.prototype.createVowelFilter=function(e){return new a(this,e)}}const re=a=>{var s;if(typeof a!="string")return[];const[e,r="",n]=((s=a.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:s.slice(1))||[];return e?[e,r,n?Number(n):void 0]:[]},ie={c:0,d:2,e:4,f:5,g:7,a:9,b:11},ae={"#":1,b:-1,s:1,f:-1},E=(a,e=3)=>{const[r,n,s=e]=re(a);if(!r)throw new Error('not a note: "'+a+'"');const o=ie[r.toLowerCase()],l=(n==null?void 0:n.split("").reduce((c,u)=>c+ae[u],0))||0;return(Number(s)+1)*12+o+l},ge=a=>Math.pow(2,(a-69)/12)*440,de=(a,e,r)=>Math.min(Math.max(a,e),r),ue=a=>12*Math.log(a/440)/Math.LN2+69,le=(a,e)=>{if(typeof a!="object")throw new Error("valueToMidi: expected object value");let{freq:r,note:n}=a;if(typeof r=="number")return ue(r);if(typeof n=="string")return E(n);if(typeof n=="number")return n;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},Ie="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdGh1Yi5jb20vZGt0cjAvV2ViRGlydC9ibG9iL21haW4vTElDRU5TRQovLyBhbGwgdGhlIGNyZWRpdCBnb2VzIHRvIGRrdHIwJ3Mgd2ViZGlydDogaHR0cHM6Ly9naXRodWIuY29tL2RrdHIwL1dlYkRpcnQvYmxvYi81Y2UzZDY5ODM2MmM1NGQ2ZTFiNjhhY2M0N2ViMjk1NWFjNjJjNzkzL2Rpc3QvQXVkaW9Xb3JrbGV0cy5qcwovLyA8MwoKY2xhc3MgQ29hcnNlUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgZ2V0IHBhcmFtZXRlckRlc2NyaXB0b3JzKCkgewogICAgcmV0dXJuIFt7IG5hbWU6ICdjb2Fyc2UnLCBkZWZhdWx0VmFsdWU6IDEgfV07CiAgfQoKICBjb25zdHJ1Y3RvcigpIHsKICAgIHN1cGVyKCk7CiAgICB0aGlzLm5vdFN0YXJ0ZWQgPSB0cnVlOwogIH0KCiAgcHJvY2VzcyhpbnB1dHMsIG91dHB1dHMsIHBhcmFtZXRlcnMpIHsKICAgIGNvbnN0IGlucHV0ID0gaW5wdXRzWzBdOwogICAgY29uc3Qgb3V0cHV0ID0gb3V0cHV0c1swXTsKICAgIGNvbnN0IGNvYXJzZSA9IHBhcmFtZXRlcnMuY29hcnNlOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBvdXRwdXRbMF1bMF0gPSBpbnB1dFswXVswXTsKICAgICAgZm9yIChsZXQgbiA9IDE7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgIGZvciAobGV0IG8gPSAwOyBvIDwgb3V0cHV0Lmxlbmd0aDsgbysrKSB7CiAgICAgICAgICBvdXRwdXRbb11bbl0gPSBuICUgY29hcnNlID09IDAgPyBpbnB1dFswXVtuXSA6IG91dHB1dFtvXVtuIC0gMV07CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ2NvYXJzZS1wcm9jZXNzb3InLCBDb2Fyc2VQcm9jZXNzb3IpOwoKY2xhc3MgQ3J1c2hQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ2NydXNoJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBjcnVzaCA9IHBhcmFtZXRlcnMuY3J1c2g7CiAgICBjb25zdCBibG9ja1NpemUgPSAxMjg7CiAgICBjb25zdCBoYXNJbnB1dCA9ICEoaW5wdXRbMF0gPT09IHVuZGVmaW5lZCk7CiAgICBpZiAoaGFzSW5wdXQpIHsKICAgICAgdGhpcy5ub3RTdGFydGVkID0gZmFsc2U7CiAgICAgIGlmIChjcnVzaC5sZW5ndGggPT09IDEpIHsKICAgICAgICBjb25zdCB4ID0gTWF0aC5wb3coMiwgY3J1c2hbMF0gLSAxKTsKICAgICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgICBjb25zdCB2YWx1ZSA9IE1hdGgucm91bmQoaW5wdXRbMF1bbl0gKiB4KSAvIHg7CiAgICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgICBvdXRwdXRbb11bbl0gPSB2YWx1ZTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0gZWxzZSB7CiAgICAgICAgZm9yIChsZXQgbiA9IDA7IG4gPCBibG9ja1NpemU7IG4rKykgewogICAgICAgICAgbGV0IHggPSBNYXRoLnBvdygyLCBjcnVzaFtuXSAtIDEpOwogICAgICAgICAgY29uc3QgdmFsdWUgPSBNYXRoLnJvdW5kKGlucHV0WzBdW25dICogeCkgLyB4OwogICAgICAgICAgZm9yIChsZXQgbyA9IDA7IG8gPCBvdXRwdXQubGVuZ3RoOyBvKyspIHsKICAgICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQpyZWdpc3RlclByb2Nlc3NvcignY3J1c2gtcHJvY2Vzc29yJywgQ3J1c2hQcm9jZXNzb3IpOwoKY2xhc3MgU2hhcGVQcm9jZXNzb3IgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3IgewogIHN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKSB7CiAgICByZXR1cm4gW3sgbmFtZTogJ3NoYXBlJywgZGVmYXVsdFZhbHVlOiAwIH1dOwogIH0KCiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBzaGFwZTAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function j(a){const e=C().createGain();return e.gain.value=a,e}const Ce=({s:a,freq:e,t:r})=>{const n=C().createOscillator();return n.type=a||"triangle",n.frequency.value=Number(e),n.start(r),{node:n,stop:s=>n.stop(s)}},ne=(a,e,r,n,s,o)=>{const l=C().createGain();return l.gain.setValueAtTime(0,o),l.gain.linearRampToValueAtTime(s,o+a),l.gain.linearRampToValueAtTime(r*s,o+a+e),{node:l,stop:c=>{l.gain.setValueAtTime(r*s,c),l.gain.linearRampToValueAtTime(0,c+n)}}},J=(a,e,r)=>{const n=C().createBiquadFilter();return n.type=a,n.frequency.value=e,n.Q.value=r,n};let te=a=>console.log(a);const V=(...a)=>te(...a),P=map();function oe(a,e,r={}){P.setKey(a,{onTrigger:e,data:r})}function $(a){return P.get()[a]}let x;const C=()=>(x||(x=new AudioContext),x);let Y;const Q=()=>{const a=C();return Y||(Y=a.createGain(),Y.connect(a.destination)),Y};let k;function fe(){return k||(k=C().audioWorklet.addModule(Ie),k)}function O(a,e,r){const n=new AudioWorkletNode(a,e);return Object.entries(r).forEach(([s,o])=>{n.parameters.get(s).value=o}),n}async function he$2(a={}){const{disableWorklets:e=!1}=a;typeof window<"u"&&(await C().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await fe().catch(r=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",r)}))}async function We(a){return new Promise(e=>{document.addEventListener("click",async function r(){await he$2(a),e(),document.removeEventListener("click",r)})})}let w={};function Ae(a,e,r,n){var s;if(r=de(r,0,.98),!w[a]){const o=C().createFeedbackDelay(1,e,r);(s=o.start)==null||s.call(o,n),o.connect(Q()),w[a]=o}return w[a].delayTime.value!==e&&w[a].delayTime.setValueAtTime(e,n),w[a].feedback.value!==r&&w[a].feedback.setValueAtTime(r,n),w[a]}let G={};function pe(a,e=2){if(!G[a]){const r=C().createReverb(e);r.connect(Q()),G[a]=r}return G[a].duration!==e&&(G[a]=G[a].setDuration(e),G[a].duration=e),G[a]}function _(a,e,r){const n=j(r);return a.connect(n),n.connect(e),n}const be=async(a,e,r)=>{const n=C();if(typeof a!="object")throw new Error(`expected hap.value to be an object, but got "${a}". Hint: append .note() or .s() to the end`,"error");let s=n.currentTime+e,{s:o="triangle",bank:l,source:c,gain:u=.8,cutoff:p,resonance:h=1,hcutoff:f,hresonance:b=1,bandf:A,bandq:N=1,coarse:F,crush:B,shape:H,pan:Ee,vowel:Pe,delay:g=0,delayfeedback:R=.5,delaytime:y=.25,orbit:M=1,room:z,size:se=2,velocity:W=1}=a;u*=W;let Se=[];const ze=()=>{Se.forEach(ke=>ke==null?void 0:ke.disconnect())};l&&o&&(o=`${l}_${o}`);let Qe;if(c)Qe=c(s,a,r);else if($(o)){const{onTrigger:ke}=$(o),xe=await ke(s,a,ze);xe&&(Qe=xe.node,xe.stop(s+r))}else throw new Error(`sound ${o} not found! Is it loaded?`);if(!Qe)return;if(n.currentTime>s){V("[webaudio] skip hap: still loading",n.currentTime-s);return}const $e=[];if($e.push(Qe),$e.push(j(u)),p!==void 0&&$e.push(J("lowpass",p,h)),f!==void 0&&$e.push(J("highpass",f,b)),A!==void 0&&$e.push(J("bandpass",A,N)),Pe!==void 0&&$e.push(n.createVowelFilter(Pe)),F!==void 0&&$e.push(O(n,"coarse-processor",{coarse:F})),B!==void 0&&$e.push(O(n,"crush-processor",{crush:B})),H!==void 0&&$e.push(O(n,"shape-processor",{shape:H})),Ee!==void 0){const ke=n.createStereoPanner();ke.pan.value=2*Ee-1,$e.push(ke)}const Ue=j(1);$e.push(Ue),Ue.connect(Q());let Z;if(g>0&&y>0&&R>0){const ke=Ae(M,y,R,s);Z=_(Ue,ke,g)}let ve;if(z>0&&se>0){const ke=pe(M,se);ve=_(Ue,ke,z)}$e.slice(1).reduce((ke,xe)=>ke.connect(xe),$e[0]),Se=$e.concat([Z,ve])},L={};function Be(a,e){var r=e?1e3:1024;if(a=r);return a.toFixed(1)+" "+n[s]}const me=async(a,e,r,n,s,o,l)=>{let c=0;s!==void 0&&r!==void 0&&V("[sampler] hap has note and freq. ignoring note","warning");let u=le({freq:s,note:r},36);c=u-36;const p=C();let h;if(Array.isArray(o))h=o[e%o.length];else{const N=B=>E(B)-u,F=Object.keys(o).filter(B=>!B.startsWith("_")).reduce((B,H,Ee)=>!B||Math.abs(N(H)){const s=r?`sound "${r}:${n}"`:"sample";if(!L[a]){V(`[sampler] load ${s}..`,"load-sample",{url:a});const o=Date.now();L[a]=fetch(a).then(l=>l.arrayBuffer()).then(async l=>{const c=Date.now()-o,u=Be(l.byteLength);return V(`[sampler] load ${s}... done! loaded ${u} in ${c}ms`,"loaded-sample",{url:a}),await e.decodeAudioData(l)})}return L[a]};function we(a){const e=C(),r=e.createBuffer(a.numberOfChannels,a.length,e.sampleRate);for(let n=0;nObject.entries(a).forEach(([n,s])=>{if(typeof s=="string"&&(s=[s]),typeof s!="object")throw new Error("wrong sample map format for "+n);r=s._base||r;const o=l=>(r+l).replace("github:","https://raw.githubusercontent.com/");Array.isArray(s)?s=s.map(o):s=Object.fromEntries(Object.entries(s).map(([l,c])=>[l,(typeof c=="string"?[c]:c).map(o)])),e(n,s)});let ce={};function Xe(a){const e=Object.entries(ce).find(([r])=>a.startsWith(r));if(e)return e[1]}const Re=async(a,e=a._base||"",r={})=>{if(typeof a=="string"){const o=Xe(a);if(o)return o(a);if(a.startsWith("github:")){let[c,u]=a.split("github:");u=u.endsWith("/")?u.slice(0,-1):u,a=`https://raw.githubusercontent.com/${u}/strudel.json`}if(typeof fetch!="function")return;const l=a.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(a).then(c=>c.json()).then(c=>Re(c,e||c._base||l,r)).catch(c=>{throw console.error(c),new Error(`error loading "${a}"`)})}const{prebake:n,tag:s}=r;Ge(a,(o,l)=>oe(o,(c,u,p)=>Ve(c,u,p,l),{type:"sample",samples:l,baseUrl:e,prebake:n,tag:s}),e)},ee=[];async function Ve(a,e,r,n,s){const{s:o,freq:l,unit:c,nudge:u=0,cut:p,loop:h,clip:f=void 0,n:b=0,note:A,speed:N=1,begin:F=0,end:B=1}=e;if(N===0)return;const H=C(),{attack:Ee=.001,decay:Pe=.001,sustain:g=1,release:R=.001}=e,y=a+u,M=await me(o,b,A,N,l,n,s);if(H.currentTime>a){V(`[sampler] still loading sound "${o}:${b}"`,"highlight");return}if(!M){V(`[sampler] could not load "${o}:${b}"`,"error");return}M.playbackRate.value=Math.abs(N)*M.playbackRate.value,c==="c"&&(M.playbackRate.value=M.playbackRate.value*M.buffer.duration*1);const z=F*M.buffer.duration;M.start(y,z);const se=M.buffer.duration/M.playbackRate.value,{node:W,stop:Se}=ne(Ee,Pe,g,R,1,a);M.connect(W);const ze=H.createGain();W.connect(ze),M.onended=function(){M.disconnect(),W.disconnect(),ze.disconnect(),r()};const Qe={node:ze,bufferSource:M,stop:($e,Ue=f===void 0)=>{let Z=$e;Ue&&(Z=a+(B-F)*se),M.stop(Z+R),Se(Z)}};if(p!==void 0){const $e=ee[p];$e&&($e.node.gain.setValueAtTime(1,y),$e.node.gain.linearRampToValueAtTime(0,y+.01)),ee[p]=Qe}return Qe}function Fe(){["sine","square","triangle","sawtooth"].forEach(a=>{oe(a,(e,r,n)=>{const{attack:s=.001,decay:o=.05,sustain:l=.6,release:c=.01}=r;let{n:u,note:p,freq:h}=r;u=p||u||36,typeof u=="string"&&(u=E(u)),!h&&typeof u=="number"&&(h=ge(u));const{node:f,stop:b}=Ce({t:e,s:a,freq:h}),A=j(.3),{node:N,stop:F}=ne(s,o,l,c,1,e);return f.onended=()=>{f.disconnect(),A.disconnect(),n()},{node:f.connect(A).connect(N),stop:B=>{F(B),b(B+c)}}},{type:"synth",prebake:!0})})}class Sound{constructor(e,r){_e(this,"values");_e(this,"unit",e=>(this.values.unit=e,this));_e(this,"freq",e=>(this.values.freq=e,this));_e(this,"nudge",e=>(this.values.nudge=e,this));_e(this,"cut",e=>(this.values.cut=e,this));_e(this,"loop",e=>(this.values.loop=e,this));_e(this,"clip",e=>(this.values.clip=e,this));_e(this,"n",e=>(this.values.n=e,this));_e(this,"note",e=>(this.values.note=e,this));_e(this,"speed",e=>(this.values.speed=e,this));_e(this,"begin",e=>(this.values.begin=e,this));_e(this,"end",e=>(this.values.end=e,this));_e(this,"gain",e=>(this.values.gain=e,this));_e(this,"cutoff",e=>(this.values.cutoff=e,this));_e(this,"resonance",e=>(this.values.resonance=e,this));_e(this,"hcutoff",e=>(this.values.hcutoff=e,this));_e(this,"hresonance",e=>(this.values.hresonance=e,this));_e(this,"bandf",e=>(this.values.bandf=e,this));_e(this,"bandq",e=>(this.values.bandq=e,this));_e(this,"coarse",e=>(this.values.coarse=e,this));_e(this,"crush",e=>(this.values.crush=e,this));_e(this,"shape",e=>(this.values.shape=e,this));_e(this,"pan",e=>(this.values.pan=e,this));_e(this,"vowel",e=>(this.values.vowel=e,this));_e(this,"delay",e=>(this.values.delay=e,this));_e(this,"delayfeedback",e=>(this.values.delayfeedback=e,this));_e(this,"delaytime",e=>(this.values.delaytime=e,this));_e(this,"orbit",e=>(this.values.orbit=e,this));_e(this,"room",e=>(this.values.room=e,this));_e(this,"size",e=>(this.values.size=e,this));_e(this,"velocity",e=>(this.values.velocity=e,this));_e(this,"out",()=>be(this.values,this.app.clock.pulse_duration));this.app=r,this.values={s:e}}}const cache=new LRUCache({max:1e3,ttl:1e3*60*5});Array.prototype.in=function(a){return this.includes(a)};async function loadSamples(){const a="https://raw.githubusercontent.com/felixroos/dough-samples/main/";return Promise.all([We(),Re("github:Bubobubobubobubo/Topos-Samples/main"),Re(`${a}/tidal-drum-machines.json`),Re(`${a}/piano.json`),Re(`${a}/Dirt-Samples.json`),Re(`${a}/EmuSP12.json`),Re(`${a}/vcsl.json`),Fe()])}loadSamples();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,"time",()=>this.app.audioContext.currentTime);_e(this,"mouseX",()=>this.app._mouseX);_e(this,"mouseY",()=>this.app._mouseY);_e(this,"script",(...e)=>{e.forEach(r=>{tryEvaluate(this.app,this.app.universes[this.app.selected_universe].locals[r])})});_e(this,"s",this.script);_e(this,"clear_script",e=>{this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}});_e(this,"cs",this.clear_script);_e(this,"copy_script",(e,r)=>{this.app.universes[this.app.selected_universe].locals[r]=this.app.universes[this.app.selected_universe].locals[e]});_e(this,"cps",this.copy_script);_e(this,"midi_outputs",()=>(console.log(this.MidiConnection.listMidiOutputs()),this.MidiConnection.midiOutputs));_e(this,"midi_output",e=>{e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())});_e(this,"note",(e,r={})=>{const n=r.channel?r.channel:0,s=r.velocity?r.velocity:100,o=r.duration?r.duration:.5;this.MidiConnection.sendMidiNote(e,n,s,o)});_e(this,"sysex",e=>{this.MidiConnection.sendSysExMessage(e)});_e(this,"pitch_bend",(e,r)=>{this.MidiConnection.sendPitchBend(e,r)});_e(this,"program_change",(e,r)=>{this.MidiConnection.sendProgramChange(e,r)});_e(this,"midi_clock",()=>{this.MidiConnection.sendMidiClock()});_e(this,"control_change",({control:e=20,value:r=0,channel:n=0})=>{this.MidiConnection.sendMidiControlChange(e,r,n)});_e(this,"midi_panic",()=>{this.MidiConnection.panic()});_e(this,"zn",(e,r={})=>{const n=cachedPattern(e,r);if(n.hasStarted()){const s=n.peek(),o=s.modifiedEvent?s.modifiedEvent:s,l=r.channel?r.channel:0,c=r.velocity?r.velocity:100,u=r.sustain?r.sustain:.5;o instanceof Pitch?(o.bend&&this.MidiConnection.sendPitchBend(o.bend,l),this.MidiConnection.sendMidiNote(o.note,l,c,u),o.bend&&this.MidiConnection.sendPitchBend(8192,l)):o instanceof Chord&&o.pitches.forEach(p=>{p.bend&&this.MidiConnection.sendPitchBend(p.bend,l),this.MidiConnection.sendMidiNote(p.note,l,c,u),p.bend&&this.MidiConnection.sendPitchBend(8192,l)}),s.modifiedEvent&&(s.modifiedEvent=void 0)}return n.next()});_e(this,"iterator",(e,r,n)=>(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));_e(this,"$",this.iterator);_e(this,"drunk",e=>e!==void 0?(this._drunk.position=e,this._drunk.getPosition()):(this._drunk.step(),this._drunk.getPosition()));_e(this,"drunk_max",e=>{this._drunk.max=e});_e(this,"drunk_min",e=>{this._drunk.min=e});_e(this,"drunk_wrap",e=>{this._drunk.toggleWrap(e)});_e(this,"variable",(e,r)=>typeof e=="string"&&r===void 0?this.variables[e]:(this.variables[e]=r,this.variables[e]));_e(this,"v",this.variable);_e(this,"delete_variable",e=>{delete this.variables[e]});_e(this,"dv",this.delete_variable);_e(this,"clear_variables",()=>{this.variables={}});_e(this,"cv",this.clear_variables);_e(this,"slice",e=>{const r=this.epulse();return Math.floor(r/e)%2===0});_e(this,"barslice",e=>{const r=this.bar()-1;return Math.floor(r/e)%2===0});_e(this,"seqslice",(...e)=>{const r=e[0],n=e.slice(1),s=this.epulse(),o=Math.floor(s/r);return n[o%n.length]});_e(this,"seqmod",(...e)=>{if(cache.has(this._sequence_key_generator(e))){let r=cache.get(this._sequence_key_generator(e));return r.options.currentIteration++,r.options.currentIteration===r.options.nextTarget&&(r.options.index++,r.options.nextTarget=e[r.options.index%e.length],r.options.currentIteration=0),cache.set(this._sequence_key_generator(e),{pattern:e,options:r.options}),r.options.currentIteration===0}else{let r={index:-1,nextTarget:this.app.clock.ticks_before_new_bar,currentIteration:0};return typeof e[e.length-1]=="object"&&(r={...e.pop(),...r}),r.nextTarget=this.app.clock.ticks_before_new_bar,r.currentIteration===r.nextTarget&&(r.index++,r.nextTarget=e[r.index%e.length],r.currentIteration=0),cache.set(this._sequence_key_generator(e),{pattern:e,options:r}),r.currentIteration===0}});_e(this,"seq",(...e)=>{if(cache.has(this._sequence_key_generator(e))){let r=cache.get(this._sequence_key_generator(e));return r.options.index+=1,cache.set(this._sequence_key_generator(e),r),r.pattern[r.options.index%r.pattern.length]}else{let r={index:0};return typeof e[e.length-1]=="object"&&(r={...e.pop(),...r}),cache.set(this._sequence_key_generator(e),{pattern:e,options:r}),cache.get(this._sequence_key_generator(e))}});_e(this,"pick",(...e)=>e[Math.floor(Math.random()*e.length)]);_e(this,"seqbeat",(...e)=>e[this.ebeat()%e.length]);_e(this,"mel",(e,r)=>r[e%r.length]);_e(this,"seqbar",(...e)=>e[(this.app.clock.time_position.bar+1)%e.length]);_e(this,"seqpulse",(...e)=>e[this.app.clock.time_position.pulse%e.length]);_e(this,"randI",(e,r)=>Math.floor(Math.random()*(r-e+1))+e);_e(this,"rand",(e,r)=>Math.random()*(r-e)+e);_e(this,"rI",this.randI);_e(this,"r",this.rand);_e(this,"quantize",(e,r)=>{if(r.length===0)return e;let n=r[0];return r.forEach(s=>{Math.abs(s-e)Math.min(Math.max(e,r),n));_e(this,"cmp",this.clamp);_e(this,"bpm",e=>e===void 0?this.app.clock.bpm:((e<1||e>500)&&console.log(`Setting bpm to ${e}`),this.app.clock.bpm=e,e));_e(this,"tempo",this.bpm);_e(this,"bpb",e=>e===void 0?this.app.clock.time_signature[0]:(e<1&&console.log(`Setting bpb to ${e}`),this.app.clock.time_signature[0]=e,e));_e(this,"ppqn",e=>e===void 0?this.app.clock.ppqn:(e<1&&console.log(`Setting ppqn to ${e}`),this.app.clock.ppqn=e,e));_e(this,"time_signature",(e,r)=>{this.app.clock.time_signature=[e,r]});_e(this,"almostNever",()=>Math.random()>.9);_e(this,"sometimes",()=>Math.random()>.5);_e(this,"rarely",()=>Math.random()>.75);_e(this,"often",()=>Math.random()>.25);_e(this,"almostAlways",()=>Math.random()>.1);_e(this,"dice",e=>Math.floor(Math.random()*e)+1);_e(this,"i",e=>e!==void 0?(this.app.universes[this.app.selected_universe].global.evaluations=e,this.app.universes[this.app.selected_universe]):this.app.universes[this.app.selected_universe].global.evaluations);_e(this,"bar",()=>this.app.clock.time_position.bar);_e(this,"tick",()=>this.app.clock.tick);_e(this,"pulse",()=>this.app.clock.time_position.pulse);_e(this,"beat",()=>this.app.clock.time_position.beat);_e(this,"ebeat",()=>this.app.clock.beats_since_origin);_e(this,"epulse",()=>this.app.clock.pulses_since_origin);_e(this,"onbar",(e,...r)=>{const n=[...Array(e).keys()].map(s=>s+1);return console.log(r.some(s=>n.includes(s%e))),r.some(s=>n.includes(s%e))});_e(this,"onbeat",(...e)=>{let r=[];return e.forEach(n=>{n=n%this.app.clock.time_signature[0]+1;let s=Math.floor(n),o=n-s;r.push(s===this.app.clock.time_position.beat&&this.app.clock.time_position.pulse===o*this.app.clock.ppqn)}),r.some(n=>n==!0)});_e(this,"stop",()=>{this.app.clock.pause(),this.app.setButtonHighlighting("pause",!0)});_e(this,"silence",this.stop);_e(this,"hush",this.stop);_e(this,"prob",e=>Math.random()*100Math.random()>.5);_e(this,"min",(...e)=>Math.min(...e));_e(this,"max",(...e)=>Math.max(...e));_e(this,"limit",(e,r,n)=>Math.min(Math.max(e,r),n));_e(this,"delay",(e,r)=>{setTimeout(r,e)});_e(this,"delayr",(e,r,n)=>{[...Array(r).keys()].map(o=>e*o).forEach((o,l)=>{setTimeout(n,o)})});_e(this,"mod",(...e)=>e.map(n=>this.epulse()%n===0).some(n=>n===!0));_e(this,"modbar",(...e)=>e.map(n=>this.bar()%n===0).some(n=>n===!0));_e(this,"euclid",(e,r,n,s=0)=>this._euclidean_cycle(r,n,s)[e%n]);_e(this,"bin",(e,r)=>{let s=r.toString(2).split("").map(o=>o==="1");return s[e%s.length]});_e(this,"line",(e,r,n=1)=>{const s=[];if(r>e&&n>0||rMath.sin(this.app.clock.ctx.currentTime*Math.PI*2*e)+r);_e(this,"usine",(e=1,r=0)=>(this.sine(e,r)+1)/2);_e(this,"saw",(e=1,r=0)=>this.app.clock.ctx.currentTime*e%1*2-1+r);_e(this,"usaw",(e=1,r=0)=>(this.saw(e,r)+1)/2);_e(this,"triangle",(e=1,r=0)=>Math.abs(this.saw(e,r))*2-1);_e(this,"utriangle",(e=1,r=0)=>(this.triangle(e,r)+1)/2);_e(this,"square",(e=1,r=0)=>this.saw(e,r)>0?1:-1);_e(this,"usquare",(e=1,r=0)=>(this.square(e,r)+1)/2);_e(this,"noise",()=>Math.random()*2-1);_e(this,"abs",Math.abs);_e(this,"sound",e=>new Sound(e,this.app));_e(this,"samples",Re);_e(this,"log",console.log);_e(this,"scale",scale);_e(this,"rate",e=>{});this.app=e,this.load=Re("github:tidalcycles/Dirt-Samples/master")}_sequence_key_generator(e){return btoa(JSON.stringify(e))}_euclidean_cycle(e,r,n=0){if(e==r)return Array.from({length:r},()=>!0);function s(c,u){const p=c.length,h=(u+1)%p;return c[u]>c[h]}if(e>=r)return[!0];const o=Array.from({length:r},(c,u)=>(e*(u-1)%r+r)%r);let l=o.map((c,u)=>s(o,u));return n!=0&&(l=l.slice(n).concat(l.slice(0,n))),l}}const style="";var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var showdown$2={exports:{}};(function(a){(function(){function e(g){var R={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as
(GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: foo
",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(g===!1)return JSON.parse(JSON.stringify(R));var y={};for(var M in R)R.hasOwnProperty(M)&&(y[M]=R[M].defaultValue);return y}function r(){var g=e(!0),R={};for(var y in g)g.hasOwnProperty(y)&&(R[y]=!0);return R}var n={},s={},o={},l=e(!0),c="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:r()};n.helper={},n.extensions={},n.setOption=function(g,R){return l[g]=R,this},n.getOption=function(g){return l[g]},n.getOptions=function(){return l},n.resetOptions=function(){l=e(!0)},n.setFlavor=function(g){if(!u.hasOwnProperty(g))throw Error(g+" flavor was not found");n.resetOptions();var R=u[g];c=g;for(var y in R)R.hasOwnProperty(y)&&(l[y]=R[y])},n.getFlavor=function(){return c},n.getFlavorOptions=function(g){if(u.hasOwnProperty(g))return u[g]},n.getDefaultOptions=function(g){return e(g)},n.subParser=function(g,R){if(n.helper.isString(g))if(typeof R<"u")s[g]=R;else{if(s.hasOwnProperty(g))return s[g];throw Error("SubParser named "+g+" not registered!")}},n.extension=function(g,R){if(!n.helper.isString(g))throw Error("Extension 'name' must be a string");if(g=n.helper.stdExtName(g),n.helper.isUndefined(R)){if(!o.hasOwnProperty(g))throw Error("Extension named "+g+" is not registered!");return o[g]}else{typeof R=="function"&&(R=R()),n.helper.isArray(R)||(R=[R]);var y=p(R,g);if(y.valid)o[g]=R;else throw Error(y.error)}},n.getAllExtensions=function(){return o},n.removeExtension=function(g){delete o[g]},n.resetExtensions=function(){o={}};function p(g,R){var y=R?"Error in "+R+" extension->":"Error in unnamed extension",M={valid:!0,error:""};n.helper.isArray(g)||(g=[g]);for(var z=0;z"u"},n.helper.forEach=function(g,R){if(n.helper.isUndefined(g))throw new Error("obj param is required");if(n.helper.isUndefined(R))throw new Error("callback param is required");if(!n.helper.isFunction(R))throw new Error("callback param must be a function/closure");if(typeof g.forEach=="function")g.forEach(R);else if(n.helper.isArray(g))for(var y=0;y").replace(/&/g,"&")};var f=function(g,R,y,M){var z=M||"",se=z.indexOf("g")>-1,W=new RegExp(R+"|"+y,"g"+z.replace(/g/g,"")),Se=new RegExp(R,z.replace(/g/g,"")),ze=[],Qe,$e,Ue,Z,ve;do for(Qe=0;Ue=W.exec(g);)if(Se.test(Ue[0]))Qe++||($e=W.lastIndex,Z=$e-Ue[0].length);else if(Qe&&!--Qe){ve=Ue.index+Ue[0].length;var ke={left:{start:Z,end:$e},match:{start:$e,end:Ue.index},right:{start:Ue.index,end:ve},wholeMatch:{start:Z,end:ve}};if(ze.push(ke),!se)return ze}while(Qe&&(W.lastIndex=$e));return ze};n.helper.matchRecursiveRegExp=function(g,R,y,M){for(var z=f(g,R,y,M),se=[],W=0;W0){var Qe=[];W[0].wholeMatch.start!==0&&Qe.push(g.slice(0,W[0].wholeMatch.start));for(var $e=0;$e=0?M+(y||0):M},n.helper.splitAtIndex=function(g,R){if(!n.helper.isString(g))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[g.substring(0,R),g.substring(R)]},n.helper.encodeEmailAddress=function(g){var R=[function(y){return""+y.charCodeAt(0)+";"},function(y){return""+y.charCodeAt(0).toString(16)+";"},function(y){return y}];return g=g.replace(/./g,function(y){if(y==="@")y=R[Math.floor(Math.random()*2)](y);else{var M=Math.random();y=M>.9?R[2](y):M>.45?R[1](y):R[0](y)}return y}),g},n.helper.padEnd=function(R,y,M){return y=y>>0,M=String(M||" "),R.length>y?String(R):(y=y-R.length,y>M.length&&(M+=M.repeat(y/M.length)),String(R)+M.slice(0,y))},typeof console>"u"&&(console={warn:function(g){alert(g)},log:function(g){alert(g)},error:function(g){throw g}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨❤️👨",couple_with_heart_woman_woman:"👩❤️👩",couplekiss_man_man:"👨❤️💋👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩❤️💋👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨👦",family_man_boy_boy:"👨👦👦",family_man_girl:"👨👧",family_man_girl_boy:"👨👧👦",family_man_girl_girl:"👨👧👧",family_man_man_boy:"👨👨👦",family_man_man_boy_boy:"👨👨👦👦",family_man_man_girl:"👨👨👧",family_man_man_girl_boy:"👨👨👧👦",family_man_man_girl_girl:"👨👨👧👧",family_man_woman_boy_boy:"👨👩👦👦",family_man_woman_girl:"👨👩👧",family_man_woman_girl_boy:"👨👩👧👦",family_man_woman_girl_girl:"👨👩👧👧",family_woman_boy:"👩👦",family_woman_boy_boy:"👩👦👦",family_woman_girl:"👩👧",family_woman_girl_boy:"👩👧👦",family_woman_girl_girl:"👩👧👧",family_woman_woman_boy:"👩👩👦",family_woman_woman_boy_boy:"👩👩👦👦",family_woman_woman_girl:"👩👩👧",family_woman_woman_girl_boy:"👩👩👧👦",family_woman_woman_girl_girl:"👩👩👧👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨🎨",man_astronaut:"👨🚀",man_cartwheeling:"🤸♂️",man_cook:"👨🍳",man_dancing:"🕺",man_facepalming:"🤦♂️",man_factory_worker:"👨🏭",man_farmer:"👨🌾",man_firefighter:"👨🚒",man_health_worker:"👨⚕️",man_in_tuxedo:"🤵",man_judge:"👨⚖️",man_juggling:"🤹♂️",man_mechanic:"👨🔧",man_office_worker:"👨💼",man_pilot:"👨✈️",man_playing_handball:"🤾♂️",man_playing_water_polo:"🤽♂️",man_scientist:"👨🔬",man_shrugging:"🤷♂️",man_singer:"👨🎤",man_student:"👨🎓",man_teacher:"👨🏫",man_technologist:"👨💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩🎨",woman_astronaut:"👩🚀",woman_cartwheeling:"🤸♀️",woman_cook:"👩🍳",woman_facepalming:"🤦♀️",woman_factory_worker:"👩🏭",woman_farmer:"👩🌾",woman_firefighter:"👩🚒",woman_health_worker:"👩⚕️",woman_judge:"👩⚖️",woman_juggling:"🤹♀️",woman_mechanic:"👩🔧",woman_office_worker:"👩💼",woman_pilot:"👩✈️",woman_playing_handball:"🤾♀️",woman_playing_water_polo:"🤽♀️",woman_scientist:"👩🔬",woman_shrugging:"🤷♀️",woman_singer:"👩🎤",woman_student:"👩🎓",woman_teacher:"👩🏫",woman_technologist:"👩💻",woman_with_turban:"👳♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'
',showdown:`S`},n.Converter=function(g){var R={},y=[],M=[],z={},se=c,W={parsed:{},raw:"",format:""};Se();function Se(){g=g||{};for(var Z in l)l.hasOwnProperty(Z)&&(R[Z]=l[Z]);if(typeof g=="object")for(var ve in g)g.hasOwnProperty(ve)&&(R[ve]=g[ve]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof g+" was passed instead.");R.extensions&&n.helper.forEach(R.extensions,ze)}function ze(Z,ve){if(ve=ve||null,n.helper.isString(Z))if(Z=n.helper.stdExtName(Z),ve=Z,n.extensions[Z]){console.warn("DEPRECATION WARNING: "+Z+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),Qe(n.extensions[Z],Z);return}else if(!n.helper.isUndefined(o[Z]))Z=o[Z];else throw Error('Extension "'+Z+'" could not be loaded. It was either not found or is not a valid extension.');typeof Z=="function"&&(Z=Z()),n.helper.isArray(Z)||(Z=[Z]);var ke=p(Z,ve);if(!ke.valid)throw Error(ke.error);for(var xe=0;xe
Topos
-
+