From f425d1de1c3f8a1934acfddf8c31508d1ad204d7 Mon Sep 17 00:00:00 2001 From: Bubobubobubobubo Date: Mon, 23 Oct 2023 13:55:05 +0000 Subject: [PATCH] deploy: ae29bab982e5db0003e8380159ea1cd886982d49 --- assets/{index-418da4b4.js => index-3d0d974d.js} | 5 +++-- index.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) rename assets/{index-418da4b4.js => index-3d0d974d.js} (93%) diff --git a/assets/index-418da4b4.js b/assets/index-3d0d974d.js similarity index 93% rename from assets/index-418da4b4.js rename to assets/index-3d0d974d.js index 6aebf1c..ee75855 100644 --- a/assets/index-418da4b4.js +++ b/assets/index-3d0d974d.js @@ -1,4 +1,4 @@ -var xR=Object.defineProperty;var kR=(r,e,t)=>e in r?xR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var E=(r,e,t)=>(kR(r,typeof e!="symbol"?e+"":e,t),t),mu=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var V=(r,e,t)=>(mu(r,e,"read from private field"),t?t.call(r):e.get(r)),at=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},We=(r,e,t,n)=>(mu(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);var gl=(r,e,t,n)=>({set _(i){We(r,e,i,t)},get _(){return V(r,e,n)}}),ze=(r,e,t)=>(mu(r,e,"access private method"),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=t(i);fetch(i.href,a)}})();let xn=[],LR=(r,e)=>{let t,n=[],i={lc:0,l:e||0,value:r,set(a){i.value=a,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(a){t=n;let s=!xn.length;for(let o=0;o{n===t&&(n=n.slice());let o=n.indexOf(a);~o&&(n.splice(o,2),i.lc--,i.lc||i.off())}},subscribe(a,s){let o=i.listen(a,s);return a(i.value),o},off(){}};return i},MR=(r={})=>{let e=LR(r);return e.setKey=function(t,n){typeof n>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==n&&(e.value={...e.value,[t]:n},e.notify(t))},e};if(typeof DelayNode<"u"){class r extends DelayNode{constructor(t,n,i,a){super(t),n=Math.abs(n),this.delayTime.value=i;const s=t.createGain();s.gain.value=Math.min(Math.abs(a),.995),this.feedback=s.gain;const o=t.createGain();return o.gain.value=n,this.delayGain=o,this.connect(s),this.connect(o),s.connect(this),this.connect=l=>o.connect(l),this}start(t){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,t+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,t,n){return new r(this,e,t,n)}}var cg={};cg.generateReverb=function(r,e){for(var t=r.audioContext||new AudioContext,n=t.sampleRate,i=r.numChannels||2,a=r.decayTime*1.5,s=Math.round(r.decayTime*n),o=Math.round(a*n),l=Math.round((r.fadeInTime||0)*n),c=Math.pow(1/1e3,1/s),u=t.createBuffer(i,o,n),p=0;p{cg.generateReverb({audioContext:this,numChannels:2,decayTime:a,fadeInTime:s,lpFreqStart:o,lpFreqEnd:l},c=>{i.buffer=c}),i.duration=a,i.fade=s,i.lp=o,i.dim=l},i.generate(r,e,t,n),i});var k_={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 r extends GainNode{constructor(t,n){if(super(t),!k_[n])throw new Error("vowel: unknown vowel "+n);const{gains:i,qs:a,freqs:s}=k_[n],o=t.createGain();for(let l=0;l<5;l++){const c=t.createGain();c.gain.value=i[l];const u=t.createBiquadFilter();u.type="bandpass",u.Q.value=a[l],u.frequency.value=s[l],this.connect(u),u.connect(c),c.connect(o)}return o.gain.value=8,this.connect=l=>o.connect(l),this}}AudioContext.prototype.createVowelFilter=function(e){return new r(this,e)}}const FR=r=>{var i;if(typeof r!="string")return[];const[e,t="",n]=((i=r.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:i.slice(1))||[];return e?[e,t,n?Number(n):void 0]:[]},YR={c:0,d:2,e:4,f:5,g:7,a:9,b:11},$R={"#":1,b:-1,s:1,f:-1},Hc=(r,e=3)=>{const[t,n,i=e]=FR(r);if(!t)throw new Error('not a note: "'+r+'"');const a=YR[t.toLowerCase()],s=(n==null?void 0:n.split("").reduce((o,l)=>o+$R[l],0))||0;return(Number(i)+1)*12+a+s},bT=r=>Math.pow(2,(r-69)/12)*440,Vh=(r,e,t)=>Math.min(Math.max(r,e),t),GR=r=>12*Math.log(r/440)/Math.LN2+69,QR=(r,e)=>{if(typeof r!="object")throw new Error("valueToMidi: expected object value");let{freq:t,note:n}=r;if(typeof t=="number")return GR(t);if(typeof n=="string")return Hc(n);if(typeof n=="number")return n;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},qR="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdG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TAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function sc(r){const e=Bt().createGain();return e.gain.value=r,e}const ug=(r,e,t,n,i,a)=>{const s=Bt().createGain();return s.gain.setValueAtTime(0,a),s.gain.linearRampToValueAtTime(i,a+r),s.gain.linearRampToValueAtTime(t*i,a+r+e),{node:s,stop:o=>{s.gain.setValueAtTime(t*i,o),s.gain.linearRampToValueAtTime(0,o+n)}}},VR=(r,e,t,n,i,a)=>{t=Math.max(.001,t),i=Math.max(.001,i);const s=Bt().createGain();return s.gain.setValueAtTime(1e-4,a),s.gain.exponentialRampToValueAtTime(i,a+r),s.gain.exponentialRampToValueAtTime(t*i,a+r+e),{node:s,stop:o=>{s.gain.exponentialRampToValueAtTime(1e-4,o+n)}}},zR=(r,e,t,n,i,a,s,o,l)=>{const c=s-a,u=a+c,p=a+n*c;r.setValueAtTime(a,o),r.linearRampToValueAtTime(u,o+e),r.linearRampToValueAtTime(p,o+e+t),r.setValueAtTime(p,l),r.linearRampToValueAtTime(a,l+Math.max(i,.1))};function HR(r,e,t,n,i,a){const s={threshold:e??-3,ratio:t??10,knee:n??10,attack:i??.005,release:a??.05};return new DynamicsCompressorNode(r,s)}function gu(r,e,t,n,i,a,s,o,l,c,u,p=.5){const m=r.createBiquadFilter();if(m.type=e,m.Q.value=n,m.frequency.value=t,!isNaN(l)&&l!==0){const _=l*p,v=Vh(2**-_*t,0,2e4),I=Vh(2**(l-_)*t,0,2e4);return zR(m.frequency,i,a,s,o,v,I,c,u),m}return m}let L_=r=>r<.5?1:1-(r-.5)/.5;function WR(r,e,t=0){const n=Bt();if(!t)return r;let i=n.createGain(),a=n.createGain();r.connect(i),e.connect(a),i.gain.value=L_(t),a.gain.value=L_(1-t);let s=n.createGain();return i.connect(s),a.connect(s),s}let XR=r=>console.log(r);const hs=(...r)=>XR(...r),dg=MR();function pg(r,e,t={}){dg.setKey(r,{onTrigger:e,data:t})}function M_(r){return dg.get()[r]}let _u;const Bt=()=>(_u||(_u=new AudioContext),_u);let _l;const fg=()=>{const r=Bt();return _l||(_l=r.createGain(),_l.connect(r.destination)),_l};let Su;function ZR(){return Su||(Su=Bt().audioWorklet.addModule(qR),Su)}function Ou(r,e,t){const n=new AudioWorkletNode(r,e);return Object.entries(t).forEach(([i,a])=>{n.parameters.get(i).value=a}),n}async function KR(r={}){const{disableWorklets:e=!1}=r;typeof window<"u"&&(await Bt().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await ZR().catch(t=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",t)}))}async function jR(r){return new Promise(e=>{document.addEventListener("click",async function t(){await KR(r),e(),document.removeEventListener("click",t)})})}let oa={};function JR(r,e,t,n){var i;if(t=Vh(t,0,.98),!oa[r]){const a=Bt().createFeedbackDelay(1,e,t);(i=a.start)==null||i.call(a,n),a.connect(fg()),oa[r]=a}return oa[r].delayTime.value!==e&&oa[r].delayTime.setValueAtTime(e,n),oa[r].feedback.value!==t&&oa[r].feedback.setValueAtTime(t,n),oa[r]}let ki={},Sl=(r,e)=>r!==void 0&&r!==e;function e2(r,e,t,n,i){if(!ki[r]){const a=Bt().createReverb(e,t,n,i);a.connect(fg()),ki[r]=a}return(Sl(e,ki[r].duration)||Sl(t,ki[r].fade)||Sl(n,ki[r].lp)||Sl(i,ki[r].dim))&&ki[r].generate(e,t,n,i),ki[r]}let la;function zh(r=2048){if(!la){const e=Bt().createAnalyser();e.fftSize=r,la=e,new Float32Array(la.frequencyBinCount)}return la.fftSize!==r&&(la.fftSize=r,new Float32Array(la.frequencyBinCount)),la}function bu(r,e,t){const n=sc(t);return r.connect(n),n.connect(e),n}const P_=async(r,e,t)=>{const n=Bt();if(typeof r!="object")throw new Error(`expected hap.value to be an object, but got "${r}". Hint: append .note() or .s() to the end`,"error");r.duration=t;let i=n.currentTime+e,{s:a="triangle",bank:s,source:o,gain:l=.8,postgain:c=1,ftype:u="12db",fanchor:p=.5,cutoff:m,lpenv:_,lpattack:v=.01,lpdecay:I=.01,lpsustain:R=1,lprelease:x=.01,resonance:$=1,hpenv:Z,hcutoff:h,hpattack:b=.01,hpdecay:S=.01,hpsustain:N=1,hprelease:k=.01,hresonance:L=1,bpenv:M,bandf:G,bpattack:te=.01,bpdecay:re=.01,bpsustain:ne=1,bprelease:ee=.01,bandq:B=1,coarse:Q,crush:j,shape:K,pan:ue,vowel:le,delay:be=0,delayfeedback:De=.5,delaytime:xe=.25,orbit:Ee=1,room:Ne,roomfade:ce,roomlp:Le,roomdim:Xe,roomsize:Be,velocity:tt=1,analyze:rt,fft:ht=8,compressor:vt,compressorRatio:mt,compressorKnee:At,compressorAttack:Nt,compressorRelease:Rn}=r;l*=tt;let qe=[];const rn=()=>{qe.forEach(fe=>fe==null?void 0:fe.disconnect())};s&&a&&(a=`${s}_${a}`);let Ze;if(o)Ze=o(i,r,t);else if(M_(a)){const{onTrigger:fe}=M_(a),Ie=await fe(i,r,rn);Ie&&(Ze=Ie.node,Ie.stop(i+t))}else throw new Error(`sound ${a} not found! Is it loaded?`);if(!Ze)return;if(n.currentTime>i){hs("[webaudio] skip hap: still loading",n.currentTime-i);return}const ke=[];if(ke.push(Ze),ke.push(sc(l)),m!==void 0){let fe=()=>gu(n,"lowpass",m,$,v,I,R,x,_,i,i+t,p);ke.push(fe()),u==="24db"&&ke.push(fe())}if(h!==void 0){let fe=()=>gu(n,"highpass",h,L,b,S,N,k,Z,i,i+t,p);ke.push(fe()),u==="24db"&&ke.push(fe())}if(G!==void 0){let fe=()=>gu(n,"bandpass",G,B,te,re,ne,ee,M,i,i+t,p);ke.push(fe()),u==="24db"&&ke.push(fe())}if(le!==void 0){const fe=n.createVowelFilter(le);ke.push(fe)}if(Q!==void 0&&ke.push(Ou(n,"coarse-processor",{coarse:Q})),j!==void 0&&ke.push(Ou(n,"crush-processor",{crush:j})),K!==void 0&&ke.push(Ou(n,"shape-processor",{shape:K})),vt!==void 0&&ke.push(HR(n,vt,mt,At,Nt,Rn)),ue!==void 0){const fe=n.createStereoPanner();fe.pan.value=2*ue-1,ke.push(fe)}const en=sc(c);ke.push(en),en.connect(fg());let Zt;if(be>0&&xe>0&&De>0){const fe=JR(Ee,xe,De,i);Zt=bu(en,fe,be)}let an;if(Ne>0){const fe=e2(Ee,Be,ce,Le,Xe);an=bu(en,fe,Ne)}let H;if(rt){const fe=zh(2**(ht+5));H=bu(en,fe,rt)}ke.slice(1).reduce((fe,Ie)=>fe.connect(Ie),ke[0]),qe=ke.concat([Zt,an,H])},Eu={};function t2(r,e){var t=e?1e3:1024;if(r=t);return r.toFixed(1)+" "+n[i]}const n2=async(r,e,t,n,i,a,s)=>{let o=0;i!==void 0&&t!==void 0&&hs("[sampler] hap has note and freq. ignoring note","warning");let l=QR({freq:i,note:t},36);o=l-36;const c=Bt();let u;if(Array.isArray(a))u=a[e%a.length];else{const v=R=>Hc(R)-l,I=Object.keys(a).filter(R=>!R.startsWith("_")).reduce((R,x,$)=>!R||Math.abs(v(x)){const i=t?`sound "${t}:${n}"`:"sample";if(r=r.replace("#","%23"),!Eu[r]){hs(`[sampler] load ${i}..`,"load-sample",{url:r});const a=Date.now();Eu[r]=fetch(r).then(s=>s.arrayBuffer()).then(async s=>{const o=Date.now()-a,l=t2(s.byteLength);return hs(`[sampler] load ${i}... done! loaded ${l} in ${o}ms`,"loaded-sample",{url:r}),await e.decodeAudioData(s)})}return Eu[r]};function i2(r){const e=Bt(),t=e.createBuffer(r.numberOfChannels,r.length,e.sampleRate);for(let n=0;nObject.entries(r).forEach(([n,i])=>{if(typeof i=="string"&&(i=[i]),typeof i!="object")throw new Error("wrong sample map format for "+n);t=i._base||t;const a=s=>(t+s).replace("github:","https://raw.githubusercontent.com/");Array.isArray(i)?i=i.map(a):i=Object.fromEntries(Object.entries(i).map(([s,o])=>[s,(typeof o=="string"?[o]:o).map(a)])),e(n,i)});let s2={};function o2(r){const e=Object.entries(s2).find(([t])=>r.startsWith(t));if(e)return e[1]}const Yi=async(r,e=r._base||"",t={})=>{if(typeof r=="string"){const a=o2(r);if(a)return a(r);if(r.startsWith("github:")){let[o,l]=r.split("github:");l=l.endsWith("/")?l.slice(0,-1):l,r=`https://raw.githubusercontent.com/${l}/strudel.json`}if(typeof fetch!="function")return;const s=r.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(r).then(o=>o.json()).then(o=>Yi(o,e||o._base||s,t)).catch(o=>{throw console.error(o),new Error(`error loading "${r}"`)})}const{prebake:n,tag:i}=t;a2(r,(a,s)=>pg(a,(o,l,c)=>l2(o,l,c,s),{type:"sample",samples:s,baseUrl:e,prebake:n,tag:i}),e)},B_=[];async function l2(r,e,t,n,i){let{s:a,freq:s,unit:o,nudge:l=0,cut:c,loop:u,clip:p=void 0,n:m=0,note:_,speed:v=1,loopBegin:I=0,begin:R=0,loopEnd:x=1,end:$=1}=e;if(v===0)return;u=a.startsWith("wt_")?1:e.loop;const Z=Bt(),{attack:h=.001,decay:b=.001,sustain:S=1,release:N=.001}=e,k=r+l,L=await n2(a,m,_,v,s,n,i);if(Z.currentTime>r){hs(`[sampler] still loading sound "${a}:${m}"`,"highlight");return}if(!L){hs(`[sampler] could not load "${a}:${m}"`,"error");return}L.playbackRate.value=Math.abs(v)*L.playbackRate.value,o==="c"&&(L.playbackRate.value=L.playbackRate.value*L.buffer.duration*1);const M=R*L.buffer.duration;u&&(L.loop=!0,L.loopStart=I*L.buffer.duration-M,L.loopEnd=x*L.buffer.duration-M),L.start(k,M);const{node:G,stop:te}=ug(h,b,S,N,1,r);L.connect(G);const re=Z.createGain();G.connect(re),L.onended=function(){L.disconnect(),G.disconnect(),re.disconnect(),t()};const ne={node:re,bufferSource:L,stop:(ee,B=p===void 0&&u===void 0)=>{let Q=ee;if(B){const j=L.buffer.duration/L.playbackRate.value;Q=r+($-R)*j}L.stop(Q+N),te(Q)}};if(c!==void 0){const ee=B_[c];ee&&(ee.node.gain.setValueAtTime(1,k),ee.node.gain.linearRampToValueAtTime(0,k+.01)),B_[c]=ne}return ne}let vu={};function c2(r){const e=Bt();if(vu[r])return vu[r];const t=2*e.sampleRate,n=e.createBuffer(1,t,e.sampleRate),i=n.getChannelData(0);let a=0,s,o,l,c,u,p,m;s=o=l=c=u=p=m=0;for(let _=0;_t.stop(n)}}function u2(r,e,t){const n=ET("pink",t);return{node:WR(r,n.node,e),stop:i=>n==null?void 0:n.stop(i)}}const d2=(r,e=1,t="sine")=>{const n=Bt(),i=n.createOscillator();i.type=t,i.frequency.value=r,i.start();const a=new GainNode(n,{gain:e});return i.connect(a),{node:a,stop:s=>i.stop(s)}},p2=(r,e,t,n="sine")=>{const i=r.frequency.value*e,a=i*t;return d2(i,a,n)},U_=["sine","square","triangle","sawtooth"],f2=["pink","white","brown"];function h2(){[...U_,...f2].forEach(r=>{pg(r,(e,t,n)=>{let{attack:i=.001,decay:a=.05,sustain:s=.6,release:o=.01}=t,l;U_.includes(r)?l=g2(r,e,t):l=ET(r,e);let{node:c,stop:u,triggerRelease:p}=l;const m=sc(.3),{node:_,stop:v}=ug(i,a,s,o,1,e);return c.onended=()=>{c.disconnect(),m.disconnect(),n()},{node:c.connect(m).connect(_),stop:I=>{v(I),p==null||p(I);let R=I+o;u(R)}}},{type:"synth",prebake:!0})})}function m2(r,e){const t=new Float32Array(r+1),n=new Float32Array(r+1),i=Bt(),a=i.createOscillator(),s={sawtooth:c=>1/c,square:c=>c%2===0?0:1/c,triangle:c=>c%2===0?0:1/(c*c)};if(!s[e])throw new Error(`unknown wave type ${e}`);t[0]=0,n[0]=0;let o=1;for(;o<=r;)t[o]=s[e](o),n[o]=0,o++;const l=i.createPeriodicWave(t,n);return a.setPeriodicWave(l),a}function g2(r,e,{n:t,note:n,freq:i,vib:a=0,vibmod:s=.5,noise:o=0,fmh:l=1,fmi:c,fmenv:u="lin",fmattack:p,fmdecay:m,fmsustain:_,fmrelease:v,fmvelocity:I,fmwave:R="sine"}){Bt();let x;!t||r==="sine"?(x=Bt().createOscillator(),x.type=r||"triangle"):x=m2(t,r),n=n||36,typeof n=="string"&&(n=Hc(n)),!i&&typeof n=="number"&&(i=bT(n)),x.frequency.value=Number(i),x.start(e);let $,Z;if(c){const{node:S,stop:N}=p2(x,l,c,R);[p,m,_,v,I].find(k=>k!==void 0)?(p=p??.001,m=m??.001,_=_??1,v=v??.001,I=I??1,Z=ug(p,m,_,v,I,e),u==="exp"&&(Z=VR(p,m,_,v,I,e),Z.node.maxValue=c*2,Z.node.minValue=1e-5),S.connect(Z.node),Z.node.connect(x.frequency)):S.connect(x.frequency),$=N}let h;if(a>0){h=Bt().createOscillator(),h.frequency.value=a;const S=Bt().createGain();S.gain.value=s*100,h.connect(S),S.connect(x.detune),h.start(e)}let b;return o&&(b=u2(x,o,e)),{node:(b==null?void 0:b.node)||x,stop:S=>{h==null||h.stop(S),b==null||b.stop(S),$==null||$(S),x.stop(S)},triggerRelease:S=>{Z==null||Z.stop(S)}}}function _2(r=1,e=.05,t=220,n=0,i=0,a=.1,s=0,o=1,l=0,c=0,u=0,p=0,m=0,_=0,v=0,I=0,R=0,x=1,$=0,Z=0){let h=Math.PI*2,b=Bt().sampleRate,S=K=>K>0?1:-1,N=l*=500*h/b/b,k=t*=(1+e*2*Math.random()-e)*h/b,L=[],M=0,G=0,te=0,re=1,ne=0,ee=0,B=0,Q,j;for(n=n*b+9,$*=b,i*=b,a*=b,R*=b,c*=500*h/b**3,v*=h/b,u*=h/b,p*=b,m=m*b|0,j=n+$+i+a+R|0;te1?s>2?s>3?Math.sin((M%h)**3):Math.max(Math.min(Math.tan(M),1),-1):1-(2*M/h%2+2)%2:1-4*Math.abs(Math.round(M/h)-M/h):Math.sin(M),B=(m?1-Z+Z*Math.sin(h*te/m):1)*S(B)*Math.abs(B)**o*r*1*(tete?0:(tep&&(t+=u,k+=u,re=0),m&&!(++ne%m)&&(t=k,l=N,re||(re=1));return L}const S2=(r,e)=>{let{s:t,note:n=36,freq:i,zrand:a=0,attack:s=0,decay:o=0,sustain:l=.8,release:c=.1,curve:u=1,slide:p=0,deltaSlide:m=0,pitchJump:_=0,pitchJumpTime:v=0,lfo:I=0,znoise:R=0,zmod:x=0,zcrush:$=0,zdelay:Z=0,tremolo:h=0,duration:b=.2,zzfx:S}=r;const N=Math.max(b-s-o,0);typeof n=="string"&&(n=Hc(n)),!i&&typeof n=="number"&&(i=bT(n)),t=t.replace("z_","");const k=["sine","triangle","sawtooth","tan","noise"].indexOf(t)||0;u=t==="square"?0:u;const L=_2(...S||[.25,a,i,s,N,c,k,u,p,m,_,v,I,R,x,$,Z,l,o,h]),M=Bt(),G=M.createBuffer(1,L.length,M.sampleRate);G.getChannelData(0).set(L);const te=Bt().createBufferSource();return te.buffer=G,te.start(e),{node:te}};function O2(){["zzfx","z_sine","z_sawtooth","z_triangle","z_square","z_tan","z_noise"].forEach(r=>{pg(r,(e,t,n)=>{const{node:i}=S2({s:r,...t},e);return i.onended=()=>{i.disconnect(),n()},{node:i,stop:()=>{}}},{type:"synth",prebake:!0})})}let Tu;const b2=()=>{};typeof window<"u"&&window.addEventListener("message",r=>{var e;r.data==="strudel-stop"?b2():(e=r.data)!=null&&e.dough&&(Tu==null||Tu.node.port.postMessage(r.data))});const vT=(r,e,t,n,i)=>{const s=r.interface.feedback.getContext("2d");s&&(s.beginPath(),s.arc(e,t,n,0,Math.PI*2),s.fillStyle=i,s.fill(),s.closePath())},E2=(r,e,t)=>{if(t!==void 0&&t<1&&t>9)return;const n=r.clock.bpm/60/r.clock.time_signature[1]*200,i=r.interface.feedback.getContext("2d"),a=o=>{vT(r,50+o,r.interface.feedback.clientHeight-15,8,"#fdba74")},s=o=>{const l=50+o,c=r.interface.feedback.clientHeight-15,u=8;i.clearRect(l-u,c-u,u*2,u*2)};if(e==="local"&&t!==void 0){const o=t*25;r.blinkTimeouts[o]&&clearTimeout(r.blinkTimeouts[o]),a(o),r.blinkTimeouts[o]=setTimeout(()=>{s(o),r.interface.feedback.getContext("2d").clearRect(0,0,r.interface.feedback.width,r.interface.feedback.height),TT(r)},n)}},TT=r=>{for(let e=1;e<=9;e++){const t=e*25;vT(r,50+t,r.interface.feedback.clientHeight-15,8,"white")}},v2=(r,e)=>{let t=e.osc,n=zh(t.fftSize),i=new Float32Array(n.frequencyBinCount);const a=r.getContext("2d"),s=r.width,o=r.height;function l(){if(requestAnimationFrame(l),!e.osc.enabled){a.clearRect(0,0,s,o);return}if(n.fftSize!==e.osc.fftSize&&(n=zh(e.osc.fftSize),i=new Float32Array(n.frequencyBinCount)),n.getFloatTimeDomainData(i),a.fillStyle="rgba(0, 0, 0, 0)",a.fillRect(0,0,s,o),a.clearRect(0,0,s,o),a.lineWidth=e.osc.thickness,e.osc.color==="random"?e.clock.time_position.pulse%16===0&&(a.strokeStyle=`hsl(${Math.random()*360}, 100%, 50%)`):a.strokeStyle=e.osc.color,a.beginPath(),e.osc.is3D)for(let c=0;c{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=pn.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}et.closedBy=new et({deserialize:r=>r.split(" ")});et.openedBy=new et({deserialize:r=>r.split(" ")});et.group=new et({deserialize:r=>r.split(" ")});et.contextHash=new et({perNode:!0});et.lookAhead=new et({perNode:!0});et.mounted=new et({perNode:!0});class C2{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}}const y2=Object.create(null);class pn{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):y2,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new pn(e.name||"",t,e.id,n);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[a[0].id]=a[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(et.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return n=>{for(let i=n.prop(et.group),a=-1;a<(i?i.length:0);a++){let s=t[a<0?n.name:i[a]];if(s)return s}}}}pn.none=new pn("",Object.create(null),0,8);class rl{constructor(e){this.types=e;for(let t=0;t0;for(let l=this.cursor(s|xt.IncludeAnonymous);;){let c=!1;if(l.from<=a&&l.to>=i&&(!o&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&n&&(o||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:gg(pn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,i)=>new Et(this.type,t,n,i,this.propValues),e.makeTree||((t,n,i)=>new Et(pn.none,t,n,i)))}static build(e){return I2(e)}}Et.empty=new Et(pn.none,[],[],0);class hg{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new hg(this.buffer,this.index)}}class wa{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return pn.none}toString(){let e=[];for(let t=0;t0));l=s[l+3]);return o}slice(e,t,n){let i=this.buffer,a=new Uint16Array(t-e),s=0;for(let o=e,l=0;o=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function AT(r,e){let t=r.childBefore(e);for(;t;){let n=t.lastChild;if(!n||n.to!=t.to)break;n.type.isError&&n.from==n.to?(r=t,t=n.prevSibling):t=n}return r}function ms(r,e,t,n){for(var i;r.from==r.to||(t<1?r.from>=e:r.from>e)||(t>-1?r.to<=e:r.to0?o.length:-1;e!=c;e+=t){let u=o[e],p=l[e]+s.from;if(yT(i,n,p,p+u.length)){if(u instanceof wa){if(a&xt.ExcludeBuffers)continue;let m=u.findChild(0,u.buffer.length,t,n-p,i);if(m>-1)return new Kr(new A2(s,u,e,p),null,m)}else if(a&xt.IncludeAnonymous||!u.type.isAnonymous||mg(u)){let m;if(!(a&xt.IgnoreMounts)&&u.props&&(m=u.prop(et.mounted))&&!m.overlay)return new Or(m.tree,p,e,s);let _=new Or(u,p,e,s);return a&xt.IncludeAnonymous||!_.type.isAnonymous?_:_.nextChild(t<0?u.children.length-1:0,t,n,i)}}}if(a&xt.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+t:e=t<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let i;if(!(n&xt.IgnoreOverlays)&&(i=this._tree.prop(et.mounted))&&i.overlay){let a=e-this.from;for(let{from:s,to:o}of i.overlay)if((t>0?s<=a:s=a:o>a))return new Or(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new wo(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return ms(this,e,t,!1)}resolveInner(e,t=0){return ms(this,e,t,!0)}enterUnfinishedNodesBefore(e){return AT(this,e)}getChild(e,t=null,n=null){let i=oc(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return oc(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return lc(this,e)}}function oc(r,e,t,n){let i=r.cursor(),a=[];if(!i.firstChild())return a;if(t!=null){for(;!i.type.is(t);)if(!i.nextSibling())return a}for(;;){if(n!=null&&i.type.is(n))return a;if(i.type.is(e)&&a.push(i.node),!i.nextSibling())return n==null?a:[]}}function lc(r,e,t=e.length-1){for(let n=r.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class A2{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class Kr{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return a<0?null:new Kr(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&xt.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return a<0?null:new Kr(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Kr(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Kr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new wo(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,a=n.buffer[this.index+3];if(a>i){let s=n.buffer[this.index+1];e.push(n.slice(i,a,s)),t.push(0)}return new Et(this.type,e,t,this.to-this.from)}resolve(e,t=0){return ms(this,e,t,!1)}resolveInner(e,t=0){return ms(this,e,t,!0)}enterUnfinishedNodesBefore(e){return AT(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let i=oc(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return oc(this,e,t,n)}get node(){return this}matchContext(e){return lc(this,e)}}class wo{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Or)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof Or?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,a=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&xt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let a=t+e,s=e<0?-1:n._tree.children.length;a!=s;a+=e){let o=n._tree.children[a];if(this.mode&xt.IncludeAnonymous||o instanceof wa||!o.type.isAnonymous||mg(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,n=a+1;break e}i=this.stack[--a]}for(let i=n;i=0;a--){if(a<0)return lc(this.node,e,i);let s=n[t.buffer[this.stack[a]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function mg(r){return r.children.some(e=>e instanceof wa||!e.type.isAnonymous||mg(e))}function I2(r){var e;let{buffer:t,nodeSet:n,maxBufferLength:i=CT,reused:a=[],minRepeatType:s=n.types.length}=r,o=Array.isArray(t)?new hg(t,t.length):t,l=n.types,c=0,u=0;function p(h,b,S,N,k){let{id:L,start:M,end:G,size:te}=o,re=u;for(;te<0;)if(o.next(),te==-1){let j=a[L];S.push(j),N.push(M-h);return}else if(te==-3){c=L;return}else if(te==-4){u=L;return}else throw new RangeError(`Unrecognized record size: ${te}`);let ne=l[L],ee,B,Q=M-h;if(G-M<=i&&(B=I(o.pos-b,k))){let j=new Uint16Array(B.size-B.skip),K=o.pos-B.size,ue=j.length;for(;o.pos>K;)ue=R(B.start,j,ue);ee=new wa(j,G-B.start,n),Q=B.start-h}else{let j=o.pos-te;o.next();let K=[],ue=[],le=L>=s?L:-1,be=0,De=G;for(;o.pos>j;)le>=0&&o.id==le&&o.size>=0?(o.end<=De-i&&(_(K,ue,M,be,o.end,De,le,re),be=K.length,De=o.end),o.next()):p(M,j,K,ue,le);if(le>=0&&be>0&&be-1&&be>0){let xe=m(ne);ee=gg(ne,K,ue,0,K.length,0,G-M,xe,xe)}else ee=v(ne,K,ue,G-M,re-G)}S.push(ee),N.push(Q)}function m(h){return(b,S,N)=>{let k=0,L=b.length-1,M,G;if(L>=0&&(M=b[L])instanceof Et){if(!L&&M.type==h&&M.length==N)return M;(G=M.prop(et.lookAhead))&&(k=S[L]+M.length+G)}return v(h,b,S,N,k)}}function _(h,b,S,N,k,L,M,G){let te=[],re=[];for(;h.length>N;)te.push(h.pop()),re.push(b.pop()+S-k);h.push(v(n.types[M],te,re,L-k,G-L)),b.push(k-S)}function v(h,b,S,N,k=0,L){if(c){let M=[et.contextHash,c];L=L?[M].concat(L):[M]}if(k>25){let M=[et.lookAhead,k];L=L?[M].concat(L):[M]}return new Et(h,b,S,N,L)}function I(h,b){let S=o.fork(),N=0,k=0,L=0,M=S.end-i,G={size:0,start:0,skip:0};e:for(let te=S.pos-h;S.pos>te;){let re=S.size;if(S.id==b&&re>=0){G.size=N,G.start=k,G.skip=L,L+=4,N+=4,S.next();continue}let ne=S.pos-re;if(re<0||ne=s?4:0,B=S.start;for(S.next();S.pos>ne;){if(S.size<0)if(S.size==-3)ee+=4;else break e;else S.id>=s&&(ee+=4);S.next()}k=B,N+=re,L+=ee}return(b<0||N==h)&&(G.size=N,G.start=k,G.skip=L),G.size>4?G:void 0}function R(h,b,S){let{id:N,start:k,end:L,size:M}=o;if(o.next(),M>=0&&N4){let te=o.pos-(M-4);for(;o.pos>te;)S=R(h,b,S)}b[--S]=G,b[--S]=L-h,b[--S]=k-h,b[--S]=N}else M==-3?c=N:M==-4&&(u=N);return S}let x=[],$=[];for(;o.pos>0;)p(r.start||0,r.bufferStart||0,x,$,-1);let Z=(e=r.length)!==null&&e!==void 0?e:x.length?$[0]+x[0].length:0;return new Et(l[r.topID],x.reverse(),$.reverse(),Z)}const Y_=new WeakMap;function Gl(r,e){if(!r.isAnonymous||e instanceof wa||e.type!=r)return 1;let t=Y_.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=r||!(n instanceof Et)){t=1;break}t+=Gl(r,n)}Y_.set(e,t)}return t}function gg(r,e,t,n,i,a,s,o,l){let c=0;for(let v=n;v=u)break;S+=N}if(Z==h+1){if(S>u){let N=v[h];_(N.children,N.positions,0,N.children.length,I[h]+$);continue}p.push(v[h])}else{let N=I[Z-1]+v[Z-1].length-b;p.push(gg(r,v,I,h,Z,b,N,null,l))}m.push(b+$-a)}}return _(e,t,n,i,0),(o||l)(p,m,s)}class IT{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof Kr?this.setBuffer(e.context.buffer,e.index,t):e instanceof Or&&this.map.set(e.tree,t)}get(e){return e instanceof Kr?this.getBuffer(e.context.buffer,e.index):e instanceof Or?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Oi{constructor(e,t,n,i,a=!1,s=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(a?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let i=[new Oi(0,e.length,e,0,!1,n)];for(let a of t)a.to>e.length&&i.push(a);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],a=1,s=e.length?e[0]:null;for(let o=0,l=0,c=0;;o++){let u=o=n)for(;s&&s.from=m.from||p<=m.to||c){let _=Math.max(m.from,l)-c,v=Math.min(m.to,p)-c;m=_>=v?null:new Oi(_,v,m.tree,m.offset+c,o>0,!!u)}if(m&&i.push(m),s.to>p)break;s=anew gr(i.from,i.to)):[new gr(0,0)]:[new gr(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let a=i.advance();if(a)return a}}}class R2{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function RT(r){return(e,t,n,i)=>new w2(e,r,t,n,i)}class $_{constructor(e,t,n,i,a){if(this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.ranges=a,!a.length||a.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(a))}}class N2{constructor(e,t,n,i,a,s,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=a,this.target=s,this.prev=o,this.depth=0,this.ranges=[]}}const Hh=new et({perNode:!0});class w2{constructor(e,t,n,i,a){this.nest=t,this.input=n,this.fragments=i,this.ranges=a,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Et(n.type,n.children,n.positions,n.length,n.propValues.concat([[Hh,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[et.mounted.id]=new C2(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tu.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let p=u.from+c.pos,m=u.to+c.pos;p>=i.from&&m<=i.to&&!t.ranges.some(_=>_.fromp)&&t.ranges.push({from:p,to:m})}}o=!1}else if(n&&(s=D2(n.ranges,i.from,i.to)))o=s!=2;else if(!i.type.isAnonymous&&i.fromnew gr(p.from-i.from,p.to-i.from)):null,i.tree,u)),a.overlay?u.length&&(n={ranges:u,depth:0,prev:n}):o=!1}}else t&&(l=t.predicate(i))&&(l===!0&&(l=new gr(i.from,i.to)),l.fromnew gr(u.from-t.start,u.to-t.start)),t.target,c)),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function D2(r,e,t){for(let n of r){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function G_(r,e,t,n,i,a){if(e=e.to);n++);let s=i.children[n],o=s.buffer;function l(c,u,p,m,_){let v=c;for(;o[v+2]+a<=e.from;)v=o[v+3];let I=[],R=[];G_(s,c,v,I,R,m);let x=o[v+1],$=o[v+2],Z=x+a==e.from&&$+a==e.to&&o[v]==e.type.id;return I.push(Z?e.toTree():l(v+4,o[v+3],s.set.types[o[v]],x,$-x)),R.push(x-m),G_(s,o[v+3],u,I,R,m),new Et(p,I,R,_)}i.children[n]=l(0,o.length,pn.none,0,s.length);for(let c=0;c<=t;c++)r.childAfter(e.from)}class Q_{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(xt.IncludeAnonymous|xt.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from=e&&t.enter(n,1,xt.IgnoreOverlays|xt.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Et)t=t.children[0];else break}return!1}}let k2=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Hh))!==null&&t!==void 0?t:n.to,this.inner=new Q_(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Hh))!==null&&e!==void 0?e:t.to,this.inner=new Q_(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let a=this.inner.cursor.node;a;a=a.parent){let s=(n=a.tree)===null||n===void 0?void 0:n.prop(et.mounted);if(s&&s.parser==t)for(let o=this.fragI;o=a.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:a.from-l.offset,mount:s})}}}return i}};function q_(r,e){let t=null,n=e;for(let i=1,a=0;i=o)break;l.to<=s||(t||(n=t=e.slice()),l.fromo&&t.splice(a+1,0,new gr(o,l.to))):l.to>o?t[a--]=new gr(o,l.to):t.splice(a--,1))}}return n}function L2(r,e,t,n){let i=0,a=0,s=!1,o=!1,l=-1e9,c=[];for(;;){let u=i==r.length?1e9:s?r[i].to:r[i].from,p=a==e.length?1e9:o?e[a].to:e[a].from;if(s!=o){let m=Math.max(l,t),_=Math.min(u,p,n);m<_&&c.push(new gr(m,_))}if(l=Math.min(u,p),l==1e9)break;u==l&&(s?(s=!1,i++):s=!0),p==l&&(o?(o=!1,a++):o=!0)}return c}function V_(r,e){let t=[];for(let{pos:n,mount:i,frag:a}of r){let s=n+(i.overlay?i.overlay[0].from:0),o=s+i.tree.length,l=Math.max(a.from,s),c=Math.min(a.to,o);if(i.overlay){let u=i.overlay.map(m=>new gr(m.from+n,m.to+n)),p=L2(e,u,l,c);for(let m=0,_=l;;m++){let v=m==p.length,I=v?c:p[m].from;if(I>_&&t.push(new Oi(_,I,i.tree,-s,a.from>=_||a.openStart,a.to<=I||a.openEnd)),v)break;_=p[m].to}}else t.push(new Oi(l,c,i.tree,-s,a.from>=s||a.openStart,a.to<=o||a.openEnd))}return t}let M2=class Wh{constructor(e,t,n,i,a,s,o,l,c,u=0,p){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=a,this.score=s,this.buffer=o,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=p}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new Wh(e,[],t,n,n,0,[],0,i?new z_(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,i=e&65535,{parser:a}=this.p,s=a.dynamicPrecedence(i);if(s&&(this.score+=s),n==0){this.pushState(a.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((t=this.p.parser.nodeSet.types[i])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,n,i=4,a=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[o-4]==0&&s.buffer[o-1]>-1){if(t==n)return;if(s.buffer[o-2]>=t){s.buffer[o-2]=n;return}}}if(!a||this.pos==n)this.buffer.push(e,t,n,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=n,this.buffer[s+3]=i}}shift(e,t,n){let i=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=n,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,n,4);else{let a=e,{parser:s}=this.p;(n>this.pos||t<=s.maxNode)&&(this.pos=n,s.stateFlag(a,1)||(this.reducePos=n)),this.pushState(a,i),this.shiftContext(t,i),t<=s.maxNode&&this.buffer.push(t,i,n,4)}}apply(e,t,n){e&65536?this.reduce(e):this.shift(e,t,n)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new Wh(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new P2(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let a=0,s;al&1&&o==s)||i.push(t[a],s)}t=i}let n=[];for(let i=0;i>19,i=t&65535,a=this.stack.length-n*3;if(a<0||e.getGoto(this.stack[a],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;t=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(i,a)=>{if(!t.includes(i))return t.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let o=(s>>19)-a;if(o>1){let l=s&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return o<<19|65536|l}}else{let o=n(s,a+1);if(o!=null)return o}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class z_{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class P2{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class cc{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new cc(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new cc(this.stack,this.pos,this.index)}}function ho(r,e=Uint16Array){if(typeof r!="string")return r;let t=null;for(let n=0,i=0;n=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,o=!0),a+=l,o)break;a*=46}t?t[i++]=a:t=new e(a)}return t}class Ql{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const H_=new Ql;class B2{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=H_,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,a=this.pos+e;for(;an.to:a>=n.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];a+=s.from-n.to,n=s}return a}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,i;if(t>=0&&t=this.chunk2Pos&&no.to&&(this.chunk2=this.chunk2.slice(0,o.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=H_,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class ts{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;NT(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}ts.prototype.contextual=ts.prototype.fallback=ts.prototype.extend=!1;class uc{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?ho(e):e}token(e,t){let n=e.pos,i=0;for(;;){let a=e.next<0,s=e.resolveOffset(1,1);if(NT(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(a||i++,s==null)break;e.reset(s,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}uc.prototype.contextual=ts.prototype.fallback=ts.prototype.extend=!1;class ai{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function NT(r,e,t,n,i,a){let s=0,o=1<0){let v=r[_];if(l.allows(v)&&(e.token.value==-1||e.token.value==v||U2(v,e.token.value,i,a))){e.acceptToken(v);break}}let u=e.next,p=0,m=r[s+2];if(e.next<0&&m>p&&r[c+m*3-3]==65535&&r[c+m*3-3]==65535){s=r[c+m*3-1];continue e}for(;p>1,v=c+_+(_<<1),I=r[v],R=r[v+1]||65536;if(u=R)p=_+1;else{s=r[v+2],e.advance();continue e}}break}}function W_(r,e,t){for(let n=e,i;(i=r[n])!=65535;n++)if(i==t)return n-e;return-1}function U2(r,e,t,n){let i=W_(t,n,e);return i<0||W_(t,n,r)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(r.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:r.length}}let F2=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?X_(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?X_(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(a instanceof Et){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+a.length}}};class Y2{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Ql)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:a}=i,s=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,l=0;for(let c=0;cp.end+25&&(l=Math.max(p.lookAhead,l)),p.value!=0)){let m=t;if(p.extended>-1&&(t=this.addActions(e,p.extended,p.end,t)),t=this.addActions(e,p.value,p.end,t),!u.extend&&(n=p,t>m))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new Ql,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ql,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:a}=n.p;for(let s=0;s=0&&n.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let a=0;ae.bufferLength*4?new F2(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],i,a;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;st)n.push(o);else{if(this.advanceStack(o,n,e))continue;{i||(i=[],a=[]),i.push(o);let l=this.tokens.getMainToken(o);a.push(l.value,l.end)}}break}}if(!n.length){let s=i&&Q2(i);if(s)return jn&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw jn&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,a,n);if(s)return jn&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(n.length>s)for(n.sort((o,l)=>l.score-o.score);n.length>s;)n.pop();n.some(o=>o.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)n.splice(l--,1);else{n.splice(s--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let p=this.fragments.nodeAt(i);p;){let m=this.parser.nodeSet.types[p.type.id]==p.type?a.getGoto(e.state,p.type.id):-1;if(m>-1&&p.length&&(!c||(p.prop(et.contextHash)||0)==u))return e.useNode(p,m),jn&&console.log(s+this.stackID(e)+` (via reuse of ${a.getName(p.type.id)})`),!0;if(!(p instanceof Et)||p.children.length==0||p.positions[0]>0)break;let _=p.children[0];if(_ instanceof Et&&p.positions[0]==0)p=_;else break}}let o=a.stateSlot(e.state,4);if(o>0)return e.reduce(o),jn&&console.log(s+this.stackID(e)+` (via always-reduce ${a.getName(o&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?t.push(v):n.push(v)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Z_(e,t),!0}}runRecovery(e,t,n){let i=null,a=!1;for(let s=0;s ":"";if(o.deadEnd&&(a||(a=!0,o.restart(),jn&&console.log(u+this.stackID(o)+" (restarted)"),this.advanceFully(o,n))))continue;let p=o.split(),m=u;for(let _=0;p.forceReduce()&&_<10&&(jn&&console.log(m+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,n));_++)jn&&(m=this.stackID(p)+" -> ");for(let _ of o.recoverByInsert(l))jn&&console.log(u+this.stackID(_)+" (via recover-insert)"),this.advanceFully(_,n);this.stream.end>o.pos?(c==o.pos&&(c++,l=0),o.recoverByDelete(l,c),jn&&console.log(u+this.stackID(o)+` (via recover-delete ${this.parser.getName(l)})`),Z_(o,n)):(!i||i.scorer;class wT{constructor(e){this.start=e.start,this.shift=e.shift||yu,this.reduce=e.reduce||yu,this.reuse=e.reuse||yu,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class gs extends _g{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let o=0;oe.topRules[o][1]),i=[];for(let o=0;o=0)a(u,l,o[c++]);else{let p=o[c+-u];for(let m=-u;m>0;m--)a(o[c++],l,p);c++}}}this.nodeSet=new rl(t.map((o,l)=>pn.define({name:l>=this.minRepeatTerm?void 0:o,id:l,props:i[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=CT;let s=ho(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new ts(s,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new $2(this,e,t,n);for(let a of this.wrappers)i=a(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return-1;for(let a=i[t+1];;){let s=i[a++],o=s&1,l=i[a++];if(o&&n)return l;for(let c=a+(s>>1);a0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let a=this.stateSlot(e,1);i==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=mi(this.data,a+2);else break;i=t(mi(this.data,a+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=mi(this.data,n+2);else break;if(!(this.data[n+2]&1)){let i=this.data[n+1];t.some((a,s)=>s&1&&a==i)||t.push(this.data[n],i)}}return t}configure(e){let t=Object.assign(Object.create(gs.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let i=e.tokenizers.find(a=>a.from==n);return i?i.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let a=e.specializers.find(o=>o.from==n.external);if(!a)return n;let s=Object.assign(Object.assign({},n),{external:a.to});return t.specializers[i]=K_(s),s})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let a of e.split(" ")){let s=t.indexOf(a);s>=0&&(n[s]=!0)}let i=null;for(let a=0;an)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorer.external(t,n)<<1|e}return r.get}let q2=0;class Mr{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=q2++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new Mr([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new dc;return t=>t.modified.indexOf(e)>-1?t:dc.get(t.base||t,t.modified.concat(e).sort((n,i)=>n.id-i.id))}}let V2=0;class dc{constructor(){this.instances=[],this.id=V2++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(o=>o.base==e&&z2(t,o.modified));if(n)return n;let i=[],a=new Mr(i,e,t);for(let o of t)o.instances.push(a);let s=H2(t);for(let o of e.set)if(!o.modified.length)for(let l of s)i.push(dc.get(o,l));return a}}function z2(r,e){return r.length==e.length&&r.every((t,n)=>t==e[n])}function H2(r){let e=[[]];for(let t=0;tn.length-t.length)}function Is(r){let e=Object.create(null);for(let t in r){let n=r[t];Array.isArray(n)||(n=[n]);for(let i of t.split(" "))if(i){let a=[],s=2,o=i;for(let p=0;;){if(o=="..."&&p>0&&p+3==i.length){s=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!m)throw new RangeError("Invalid path: "+i);if(a.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),p+=m[0].length,p==i.length)break;let _=i[p++];if(p==i.length&&_=="!"){s=0;break}if(_!="/")throw new RangeError("Invalid path: "+i);o=i.slice(p)}let l=a.length-1,c=a[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new pc(n,s,l>0?a.slice(0,l):null);e[c]=u.sort(e[c])}}return DT.add(e)}const DT=new et;class pc{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let o of a)for(let l of o.set){let c=t[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:n}}function W2(r,e){let t=null;for(let n of r){let i=n.style(e);i&&(t=t?t+" "+i:i)}return t}function X2(r,e,t,n=0,i=r.length){let a=new Z2(n,Array.isArray(e)?e:[e],t);a.highlightRange(r.cursor(),n,i,"",a.highlighters),a.flush(i)}class Z2{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,a){let{type:s,from:o,to:l}=e;if(o>=n||l<=t)return;s.isTop&&(a=this.highlighters.filter(_=>!_.scope||_.scope(s)));let c=i,u=K2(e)||pc.empty,p=W2(a,u.tags);if(p&&(c&&(c+=" "),c+=p,u.mode==1&&(i+=(i?" ":"")+p)),this.startSpan(Math.max(t,o),c),u.opaque)return;let m=e.tree&&e.tree.prop(et.mounted);if(m&&m.overlay){let _=e.node.enter(m.overlay[0].from+o,1),v=this.highlighters.filter(R=>!R.scope||R.scope(m.tree.type)),I=e.firstChild();for(let R=0,x=o;;R++){let $=R=Z||!e.nextSibling())););if(!$||Z>n)break;x=$.to+o,x>t&&(this.highlightRange(_.cursor(),Math.max(t,$.from+o),Math.min(n,x),"",v),this.startSpan(Math.min(n,x),c))}I&&e.parent()}else if(e.firstChild()){m&&(i="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,a),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function K2(r){let e=r.type.prop(DT);for(;e&&e.context&&!r.matchContext(e.context);)e=e.next;return e||null}const Re=Mr.define,bl=Re(),$i=Re(),j_=Re($i),J_=Re($i),Gi=Re(),El=Re(Gi),Au=Re(Gi),Qr=Re(),ca=Re(Qr),Yr=Re(),$r=Re(),Xh=Re(),js=Re(Xh),vl=Re(),Y={comment:bl,lineComment:Re(bl),blockComment:Re(bl),docComment:Re(bl),name:$i,variableName:Re($i),typeName:j_,tagName:Re(j_),propertyName:J_,attributeName:Re(J_),className:Re($i),labelName:Re($i),namespace:Re($i),macroName:Re($i),literal:Gi,string:El,docString:Re(El),character:Re(El),attributeValue:Re(El),number:Au,integer:Re(Au),float:Re(Au),bool:Re(Gi),regexp:Re(Gi),escape:Re(Gi),color:Re(Gi),url:Re(Gi),keyword:Yr,self:Re(Yr),null:Re(Yr),atom:Re(Yr),unit:Re(Yr),modifier:Re(Yr),operatorKeyword:Re(Yr),controlKeyword:Re(Yr),definitionKeyword:Re(Yr),moduleKeyword:Re(Yr),operator:$r,derefOperator:Re($r),arithmeticOperator:Re($r),logicOperator:Re($r),bitwiseOperator:Re($r),compareOperator:Re($r),updateOperator:Re($r),definitionOperator:Re($r),typeOperator:Re($r),controlOperator:Re($r),punctuation:Xh,separator:Re(Xh),bracket:js,angleBracket:Re(js),squareBracket:Re(js),paren:Re(js),brace:Re(js),content:Qr,heading:ca,heading1:Re(ca),heading2:Re(ca),heading3:Re(ca),heading4:Re(ca),heading5:Re(ca),heading6:Re(ca),contentSeparator:Re(Qr),list:Re(Qr),quote:Re(Qr),emphasis:Re(Qr),strong:Re(Qr),link:Re(Qr),monospace:Re(Qr),strikethrough:Re(Qr),inserted:Re(),deleted:Re(),changed:Re(),invalid:Re(),meta:vl,documentMeta:Re(vl),annotation:Re(vl),processingInstruction:Re(vl),definition:Mr.defineModifier(),constant:Mr.defineModifier(),function:Mr.defineModifier(),standard:Mr.defineModifier(),local:Mr.defineModifier(),special:Mr.defineModifier()};xT([{tag:Y.link,class:"tok-link"},{tag:Y.heading,class:"tok-heading"},{tag:Y.emphasis,class:"tok-emphasis"},{tag:Y.strong,class:"tok-strong"},{tag:Y.keyword,class:"tok-keyword"},{tag:Y.atom,class:"tok-atom"},{tag:Y.bool,class:"tok-bool"},{tag:Y.url,class:"tok-url"},{tag:Y.labelName,class:"tok-labelName"},{tag:Y.inserted,class:"tok-inserted"},{tag:Y.deleted,class:"tok-deleted"},{tag:Y.literal,class:"tok-literal"},{tag:Y.string,class:"tok-string"},{tag:Y.number,class:"tok-number"},{tag:[Y.regexp,Y.escape,Y.special(Y.string)],class:"tok-string2"},{tag:Y.variableName,class:"tok-variableName"},{tag:Y.local(Y.variableName),class:"tok-variableName tok-local"},{tag:Y.definition(Y.variableName),class:"tok-variableName tok-definition"},{tag:Y.special(Y.variableName),class:"tok-variableName2"},{tag:Y.definition(Y.propertyName),class:"tok-propertyName tok-definition"},{tag:Y.typeName,class:"tok-typeName"},{tag:Y.namespace,class:"tok-namespace"},{tag:Y.className,class:"tok-className"},{tag:Y.macroName,class:"tok-macroName"},{tag:Y.propertyName,class:"tok-propertyName"},{tag:Y.operator,class:"tok-operator"},{tag:Y.comment,class:"tok-comment"},{tag:Y.meta,class:"tok-meta"},{tag:Y.invalid,class:"tok-invalid"},{tag:Y.punctuation,class:"tok-punctuation"}]);const j2=303,eS=1,J2=2,e0=304,t0=306,n0=307,r0=3,i0=4,a0=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],kT=125,s0=59,tS=47,o0=42,l0=43,c0=45,u0=new wT({start:!1,shift(r,e){return e==r0||e==i0||e==t0?r:e==n0},strict:!1}),d0=new ai((r,e)=>{let{next:t}=r;(t==kT||t==-1||e.context)&&r.acceptToken(e0)},{contextual:!0,fallback:!0}),p0=new ai((r,e)=>{let{next:t}=r,n;a0.indexOf(t)>-1||t==tS&&((n=r.peek(1))==tS||n==o0)||t!=kT&&t!=s0&&t!=-1&&!e.context&&r.acceptToken(j2)},{contextual:!0}),f0=new ai((r,e)=>{let{next:t}=r;if((t==l0||t==c0)&&(r.advance(),t==r.next)){r.advance();let n=!e.context&&e.canShift(eS);r.acceptToken(n?eS:J2)}},{contextual:!0}),h0=Is({"get set async static":Y.modifier,"for while do if else switch try catch finally return throw break continue default case":Y.controlKeyword,"in of await yield void typeof delete instanceof":Y.operatorKeyword,"let var const function class extends":Y.definitionKeyword,"import export from":Y.moduleKeyword,"with debugger as new":Y.keyword,TemplateString:Y.special(Y.string),super:Y.atom,BooleanLiteral:Y.bool,this:Y.self,null:Y.null,Star:Y.modifier,VariableName:Y.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Y.function(Y.variableName),VariableDefinition:Y.definition(Y.variableName),Label:Y.labelName,PropertyName:Y.propertyName,PrivatePropertyName:Y.special(Y.propertyName),"CallExpression/MemberExpression/PropertyName":Y.function(Y.propertyName),"FunctionDeclaration/VariableDefinition":Y.function(Y.definition(Y.variableName)),"ClassDeclaration/VariableDefinition":Y.definition(Y.className),PropertyDefinition:Y.definition(Y.propertyName),PrivatePropertyDefinition:Y.definition(Y.special(Y.propertyName)),UpdateOp:Y.updateOperator,LineComment:Y.lineComment,BlockComment:Y.blockComment,Number:Y.number,String:Y.string,Escape:Y.escape,ArithOp:Y.arithmeticOperator,LogicOp:Y.logicOperator,BitOp:Y.bitwiseOperator,CompareOp:Y.compareOperator,RegExp:Y.regexp,Equals:Y.definitionOperator,Arrow:Y.function(Y.punctuation),": Spread":Y.punctuation,"( )":Y.paren,"[ ]":Y.squareBracket,"{ }":Y.brace,"InterpolationStart InterpolationEnd":Y.special(Y.brace),".":Y.derefOperator,", ;":Y.separator,"@":Y.meta,TypeName:Y.typeName,TypeDefinition:Y.definition(Y.typeName),"type enum interface implements namespace module declare":Y.definitionKeyword,"abstract global Privacy readonly override":Y.modifier,"is keyof unique infer":Y.operatorKeyword,JSXAttributeValue:Y.attributeValue,JSXText:Y.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Y.angleBracket,"JSXIdentifier JSXNameSpacedName":Y.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Y.attributeName,"JSXBuiltin/JSXIdentifier":Y.standard(Y.tagName)}),m0={__proto__:null,export:14,as:19,from:27,default:30,async:35,function:36,extends:46,this:50,true:58,false:58,null:70,void:74,typeof:78,super:96,new:130,delete:146,yield:155,await:159,class:164,public:221,private:221,protected:221,readonly:223,instanceof:242,satisfies:245,in:246,const:248,import:280,keyof:335,unique:339,infer:345,is:381,abstract:401,implements:403,type:405,let:408,var:410,using:413,interface:419,enum:423,namespace:429,module:431,declare:435,global:439,for:458,of:467,while:470,with:474,do:478,if:482,else:484,switch:488,case:494,try:500,catch:504,finally:508,return:512,throw:516,break:520,continue:524,debugger:528},g0={__proto__:null,async:117,get:119,set:121,declare:181,public:183,private:183,protected:183,static:185,abstract:187,override:189,readonly:195,accessor:197,new:385},_0={__proto__:null,"<":137},S0=gs.deserialize({version:14,states:"$6tO`QUOOO%TQUOOO'WQWOOP(eOSOOO*sQ(CjO'#CfO*zOpO'#CgO+YO!bO'#CgO+hO07`O'#DZO-yQUO'#DaO.ZQUO'#DlO%TQUO'#DvO0_QUO'#EOOOQ(CY'#EW'#EWO0xQSO'#ETOOQO'#Ei'#EiOO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T4oQ7r5kQ7v5tQ8P:oQ8T:tQ8U:uQ8z7xQ9Y8gQ9a8xQ9r#QR;U;bR#YWR'P!dY!sQ'U-R0y4tS&{!d,yQ'a!qS'k!t!wS'm!x4vS,v&|'TS-b'b'cQ-d'dQ2P-PR2_-cR(o#vR(r#wQ!eQT-Q'U-R]!pQ!q'U-R0y4tQ#n]R'_9qT#iZ%]S#hZ%]S%cm,]U([#f#g#jS-v(](^Q-z(_Q0Q*|Q2d-wU2e-x-y-{S5z2f2gR7y5{`#[W#U#X%`'x(R*y-qr#eZm#f#g#j%](](^(_*|-w-x-y-{2f2g5{Q1`,]Q1v,sQ5i1nQ7q5jT:|&}*zT#_W%`S#^W%`S'y#U(RS(O#X*yS,x&}*zT-l'x-qT'S!d%aQ$jfR)n$oT)c$j)dR3_.oT*S$w*UR*[$zQ0U+UQ2i.SQ4w0{Q6P2mQ7]4zQ7|6OQ8i7[Q8{7{Q9[8kQ9d8}Q9i9]R9l9elqOXs!Y#b%e&h&j&k&m,a,f1f1iQ&b!UR,U&_rmOXs!T!U!Y#b%e&_&h&j&k&m,a,f1f1iR,]&eT%dm,]R0u+uR,T&]Q%{{R+m%|R+c%vT&f!V&iT&g!V&iT1h,f1i",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:366,context:u0,nodeProps:[["group",-26,6,14,16,62,199,203,207,208,210,213,216,226,228,234,236,238,240,243,249,255,257,259,261,263,265,266,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,103,104,113,114,131,134,136,137,138,139,141,142,162,163,165,"Expression",-23,24,26,30,34,36,38,166,168,170,171,173,174,175,177,178,179,181,182,183,193,195,197,198,"Type",-3,84,96,102,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",143,"JSXStartTag",155,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",144,"JSXSelfCloseEndTag JSXEndTag",160,"JSXEndTag"]],propSources:[h0],skippedNodes:[0,3,4,269],repeatNodeCount:33,tokenData:"$>y(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tu>PuvBavwDxwxGgxyMvyz! Qz{!![{|!%O|}!&]}!O!%O!O!P!'g!P!Q!1w!Q!R#0t!R![#3T![!]#@T!]!^#Aa!^!_#Bk!_!`#GS!`!a#In!a!b#N{!b!c$$z!c!}>P!}#O$&U#O#P$'`#P#Q$,w#Q#R$.R#R#S>P#S#T$/`#T#o$0j#o#p$4z#p#q$5p#q#r$7Q#r#s$8^#s$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$I|>P$I|$I}$P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(n%d_$d&j'xp'{!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$d&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$d&j'{!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'{!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$d&j'xpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(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m;'S!P;'S;=`#v<%lO!P~!UO!O~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(U~~",141,327),new uc("j~RQYZXz{^~^O'r~~aP!P!Qd~iO's~~",25,309)],topRules:{Script:[0,5],SingleExpression:[1,267],SingleClassItem:[2,268]},dialects:{jsx:12794,ts:12796},dynamicPrecedences:{76:1,78:1,163:1,191:1},specialized:[{term:313,get:r=>m0[r]||-1},{term:329,get:r=>g0[r]||-1},{term:67,get:r=>_0[r]||-1}],tokenPrec:12820});class St{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),Hr.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),Hr.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Eo(this),a=new Eo(e);for(let s=t,o=t;;){if(i.next(s),a.next(s),s=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new Eo(this,e)}iterRange(e,t=this.length){return new LT(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new MT(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?St.empty:e.length<=32?new Jt(e):Hr.from(Jt.split(e,[]))}}class Jt extends St{constructor(e,t=O0(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let a=0;;a++){let s=this.text[a],o=i+s.length;if((t?n:o)>=e)return new b0(i,o,n,s);i=o+1,n++}}decompose(e,t,n,i){let a=e<=0&&t>=this.length?this:new Jt(nS(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),o=ql(a.text,s.text.slice(),0,a.length);if(o.length<=32)n.push(new Jt(o,s.length+a.length));else{let l=o.length>>1;n.push(new Jt(o.slice(0,l)),new Jt(o.slice(l)))}}else n.push(a)}replace(e,t,n){if(!(n instanceof Jt))return super.replace(e,t,n);let i=ql(this.text,ql(n.text,nS(this.text,0,e)),t),a=this.length+n.length-(t-e);return i.length<=32?new Jt(i,a):Hr.from(Jt.split(i,[]),a)}sliceString(e,t=this.length,n=` +var xR=Object.defineProperty;var kR=(r,e,t)=>e in r?xR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var E=(r,e,t)=>(kR(r,typeof e!="symbol"?e+"":e,t),t),mu=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var V=(r,e,t)=>(mu(r,e,"read from private field"),t?t.call(r):e.get(r)),at=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},We=(r,e,t,n)=>(mu(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);var gl=(r,e,t,n)=>({set _(i){We(r,e,i,t)},get _(){return V(r,e,n)}}),ze=(r,e,t)=>(mu(r,e,"access private method"),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=t(i);fetch(i.href,a)}})();let xn=[],LR=(r,e)=>{let t,n=[],i={lc:0,l:e||0,value:r,set(a){i.value=a,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(a){t=n;let s=!xn.length;for(let o=0;o{n===t&&(n=n.slice());let o=n.indexOf(a);~o&&(n.splice(o,2),i.lc--,i.lc||i.off())}},subscribe(a,s){let o=i.listen(a,s);return a(i.value),o},off(){}};return i},MR=(r={})=>{let e=LR(r);return e.setKey=function(t,n){typeof n>"u"?t in e.value&&(e.value={...e.value},delete e.value[t],e.notify(t)):e.value[t]!==n&&(e.value={...e.value,[t]:n},e.notify(t))},e};if(typeof DelayNode<"u"){class r extends DelayNode{constructor(t,n,i,a){super(t),n=Math.abs(n),this.delayTime.value=i;const s=t.createGain();s.gain.value=Math.min(Math.abs(a),.995),this.feedback=s.gain;const o=t.createGain();return o.gain.value=n,this.delayGain=o,this.connect(s),this.connect(o),s.connect(this),this.connect=l=>o.connect(l),this}start(t){this.delayGain.gain.setValueAtTime(this.delayGain.gain.value,t+this.delayTime.value)}}AudioContext.prototype.createFeedbackDelay=function(e,t,n){return new r(this,e,t,n)}}var cg={};cg.generateReverb=function(r,e){for(var t=r.audioContext||new AudioContext,n=t.sampleRate,i=r.numChannels||2,a=r.decayTime*1.5,s=Math.round(r.decayTime*n),o=Math.round(a*n),l=Math.round((r.fadeInTime||0)*n),c=Math.pow(1/1e3,1/s),u=t.createBuffer(i,o,n),p=0;p{cg.generateReverb({audioContext:this,numChannels:2,decayTime:a,fadeInTime:s,lpFreqStart:o,lpFreqEnd:l},c=>{i.buffer=c}),i.duration=a,i.fade=s,i.lp=o,i.dim=l},i.generate(r,e,t,n),i});var k_={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 r extends GainNode{constructor(t,n){if(super(t),!k_[n])throw new Error("vowel: unknown vowel "+n);const{gains:i,qs:a,freqs:s}=k_[n],o=t.createGain();for(let l=0;l<5;l++){const c=t.createGain();c.gain.value=i[l];const u=t.createBiquadFilter();u.type="bandpass",u.Q.value=a[l],u.frequency.value=s[l],this.connect(u),u.connect(c),c.connect(o)}return o.gain.value=8,this.connect=l=>o.connect(l),this}}AudioContext.prototype.createVowelFilter=function(e){return new r(this,e)}}const FR=r=>{var i;if(typeof r!="string")return[];const[e,t="",n]=((i=r.match(/^([a-gA-G])([#bsf]*)([0-9]*)$/))==null?void 0:i.slice(1))||[];return e?[e,t,n?Number(n):void 0]:[]},YR={c:0,d:2,e:4,f:5,g:7,a:9,b:11},$R={"#":1,b:-1,s:1,f:-1},Hc=(r,e=3)=>{const[t,n,i=e]=FR(r);if(!t)throw new Error('not a note: "'+r+'"');const a=YR[t.toLowerCase()],s=(n==null?void 0:n.split("").reduce((o,l)=>o+$R[l],0))||0;return(Number(i)+1)*12+a+s},bT=r=>Math.pow(2,(r-69)/12)*440,Vh=(r,e,t)=>Math.min(Math.max(r,e),t),GR=r=>12*Math.log(r/440)/Math.LN2+69,QR=(r,e)=>{if(typeof r!="object")throw new Error("valueToMidi: expected object value");let{freq:t,note:n}=r;if(typeof t=="number")return GR(t);if(typeof n=="string")return Hc(n);if(typeof n=="number")return n;if(!e)throw new Error("valueToMidi: expected freq or note to be set");return e},qR="data:application/javascript;base64,Ly8gTElDRU5TRSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2My4wIHNlZSBodHRwczovL2dpdGh1Yi5jb20vZGt0cjAvV2ViRGlydC9ibG9iL21haW4vTElDRU5TRQovLyBhbGwgdGhlIGNyZWRpdCBnb2VzIHRvIGRrdHIwJ3Mgd2ViZGlydDogaHR0cHM6Ly9naXRodWIuY29tL2RrdHIwL1dlYkRpcnQvYmxvYi81Y2UzZDY5ODM2MmM1NGQ2ZTFiNjhhY2M0N2ViMjk1NWFjNjJjNzkzL2Rpc3QvQXVkaW9Xb3JrbGV0cy5qcwovLyA8MwoKY2xhc3MgQ29hcnNlUHJvY2Vzc29yIGV4dGVuZHMgQXVkaW9Xb3JrbGV0UHJvY2Vzc29yIHsKICBzdGF0aWMgZ2V0IHBhcmFtZXRlckRlc2NyaXB0b3JzKCkgewogICAgcmV0dXJuIFt7IG5hbWU6ICdjb2Fyc2UnLCBkZWZhdWx0VmFsdWU6IDEgfV07CiAgfQoKICBjb25zdHJ1Y3RvcigpIHsKICAgIHN1cGVyKCk7CiAgICB0aGlzLm5vdFN0YXJ0ZWQgPSB0cnVlOwogIH0KCiAgcHJvY2VzcyhpbnB1dHMsIG91dHB1dHMsIHBhcmFtZXRlcnMpIHsKICAgIGNvbnN0IGlucHV0ID0gaW5wdXRzWzBdOwogICAgY29uc3Qgb3V0cHV0ID0gb3V0cHV0c1swXTsKICAgIGNvbnN0IGNvYXJzZSA9IHBhcmFtZXRlcnMuY29hcnNlOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgK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CiAgY29uc3RydWN0b3IoKSB7CiAgICBzdXBlcigpOwogICAgdGhpcy5ub3RTdGFydGVkID0gdHJ1ZTsKICB9CgogIHByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7CiAgICBjb25zdCBpbnB1dCA9IGlucHV0c1swXTsKICAgIGNvbnN0IG91dHB1dCA9IG91dHB1dHNbMF07CiAgICBjb25zdCBzaGFwZTAgPSBwYXJhbWV0ZXJzLnNoYXBlWzBdOwogICAgY29uc3Qgc2hhcGUxID0gc2hhcGUwIDwgMSA/IHNoYXBlMCA6IDEuMCAtIDRlLTEwOwogICAgY29uc3Qgc2hhcGUgPSAoMi4wICogc2hhcGUxKSAvICgxLjAgLSBzaGFwZTEpOwogICAgY29uc3QgYmxvY2tTaXplID0gMTI4OwogICAgY29uc3QgaGFzSW5wdXQgPSAhKGlucHV0WzBdID09PSB1bmRlZmluZWQpOwogICAgaWYgKGhhc0lucHV0KSB7CiAgICAgIHRoaXMubm90U3RhcnRlZCA9IGZhbHNlOwogICAgICBmb3IgKGxldCBuID0gMDsgbiA8IGJsb2NrU2l6ZTsgbisrKSB7CiAgICAgICAgY29uc3QgdmFsdWUgPSAoKDEgKyBzaGFwZSkgKiBpbnB1dFswXVtuXSkgLyAoMSArIHNoYXBlICogTWF0aC5hYnMoaW5wdXRbMF1bbl0pKTsKICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG91dHB1dC5sZW5ndGg7IG8rKykgewogICAgICAgICAgb3V0cHV0W29dW25dID0gdmFsdWU7CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICByZXR1cm4gdGhpcy5ub3RTdGFydGVkIHx8IGhhc0lucHV0OwogIH0KfQoKcmVnaXN0ZXJQcm9jZXNzb3IoJ3NoYXBlLXByb2Nlc3NvcicsIFNoYXBlUHJvY2Vzc29yKTsK";function sc(r){const e=Bt().createGain();return e.gain.value=r,e}const ug=(r,e,t,n,i,a)=>{const s=Bt().createGain();return s.gain.setValueAtTime(0,a),s.gain.linearRampToValueAtTime(i,a+r),s.gain.linearRampToValueAtTime(t*i,a+r+e),{node:s,stop:o=>{s.gain.setValueAtTime(t*i,o),s.gain.linearRampToValueAtTime(0,o+n)}}},VR=(r,e,t,n,i,a)=>{t=Math.max(.001,t),i=Math.max(.001,i);const s=Bt().createGain();return s.gain.setValueAtTime(1e-4,a),s.gain.exponentialRampToValueAtTime(i,a+r),s.gain.exponentialRampToValueAtTime(t*i,a+r+e),{node:s,stop:o=>{s.gain.exponentialRampToValueAtTime(1e-4,o+n)}}},zR=(r,e,t,n,i,a,s,o,l)=>{const c=s-a,u=a+c,p=a+n*c;r.setValueAtTime(a,o),r.linearRampToValueAtTime(u,o+e),r.linearRampToValueAtTime(p,o+e+t),r.setValueAtTime(p,l),r.linearRampToValueAtTime(a,l+Math.max(i,.1))};function HR(r,e,t,n,i,a){const s={threshold:e??-3,ratio:t??10,knee:n??10,attack:i??.005,release:a??.05};return new DynamicsCompressorNode(r,s)}function gu(r,e,t,n,i,a,s,o,l,c,u,p=.5){const m=r.createBiquadFilter();if(m.type=e,m.Q.value=n,m.frequency.value=t,!isNaN(l)&&l!==0){const _=l*p,v=Vh(2**-_*t,0,2e4),I=Vh(2**(l-_)*t,0,2e4);return zR(m.frequency,i,a,s,o,v,I,c,u),m}return m}let L_=r=>r<.5?1:1-(r-.5)/.5;function WR(r,e,t=0){const n=Bt();if(!t)return r;let i=n.createGain(),a=n.createGain();r.connect(i),e.connect(a),i.gain.value=L_(t),a.gain.value=L_(1-t);let s=n.createGain();return i.connect(s),a.connect(s),s}let XR=r=>console.log(r);const hs=(...r)=>XR(...r),dg=MR();function pg(r,e,t={}){dg.setKey(r,{onTrigger:e,data:t})}function M_(r){return dg.get()[r]}let _u;const Bt=()=>(_u||(_u=new AudioContext),_u);let _l;const fg=()=>{const r=Bt();return _l||(_l=r.createGain(),_l.connect(r.destination)),_l};let Su;function ZR(){return Su||(Su=Bt().audioWorklet.addModule(qR),Su)}function Ou(r,e,t){const n=new AudioWorkletNode(r,e);return Object.entries(t).forEach(([i,a])=>{n.parameters.get(i).value=a}),n}async function KR(r={}){const{disableWorklets:e=!1}=r;typeof window<"u"&&(await Bt().resume(),e?console.log("disableWorklets: AudioWorklet effects coarse, crush and shape are skipped!"):await ZR().catch(t=>{console.warn("could not load AudioWorklet effects coarse, crush and shape",t)}))}async function jR(r){return new Promise(e=>{document.addEventListener("click",async function t(){await KR(r),e(),document.removeEventListener("click",t)})})}let oa={};function JR(r,e,t,n){var i;if(t=Vh(t,0,.98),!oa[r]){const a=Bt().createFeedbackDelay(1,e,t);(i=a.start)==null||i.call(a,n),a.connect(fg()),oa[r]=a}return oa[r].delayTime.value!==e&&oa[r].delayTime.setValueAtTime(e,n),oa[r].feedback.value!==t&&oa[r].feedback.setValueAtTime(t,n),oa[r]}let ki={},Sl=(r,e)=>r!==void 0&&r!==e;function e2(r,e,t,n,i){if(!ki[r]){const a=Bt().createReverb(e,t,n,i);a.connect(fg()),ki[r]=a}return(Sl(e,ki[r].duration)||Sl(t,ki[r].fade)||Sl(n,ki[r].lp)||Sl(i,ki[r].dim))&&ki[r].generate(e,t,n,i),ki[r]}let la;function zh(r=2048){if(!la){const e=Bt().createAnalyser();e.fftSize=r,la=e,new Float32Array(la.frequencyBinCount)}return la.fftSize!==r&&(la.fftSize=r,new Float32Array(la.frequencyBinCount)),la}function bu(r,e,t){const n=sc(t);return r.connect(n),n.connect(e),n}const P_=async(r,e,t)=>{const n=Bt();if(typeof r!="object")throw new Error(`expected hap.value to be an object, but got "${r}". Hint: append .note() or .s() to the end`,"error");r.duration=t;let i=n.currentTime+e,{s:a="triangle",bank:s,source:o,gain:l=.8,postgain:c=1,ftype:u="12db",fanchor:p=.5,cutoff:m,lpenv:_,lpattack:v=.01,lpdecay:I=.01,lpsustain:R=1,lprelease:x=.01,resonance:$=1,hpenv:Z,hcutoff:h,hpattack:b=.01,hpdecay:S=.01,hpsustain:N=1,hprelease:k=.01,hresonance:L=1,bpenv:M,bandf:G,bpattack:te=.01,bpdecay:re=.01,bpsustain:ne=1,bprelease:ee=.01,bandq:B=1,coarse:Q,crush:j,shape:K,pan:ue,vowel:le,delay:be=0,delayfeedback:De=.5,delaytime:xe=.25,orbit:Ee=1,room:Ne,roomfade:ce,roomlp:Le,roomdim:Xe,roomsize:Be,velocity:tt=1,analyze:rt,fft:ht=8,compressor:vt,compressorRatio:mt,compressorKnee:At,compressorAttack:Nt,compressorRelease:Rn}=r;l*=tt;let qe=[];const rn=()=>{qe.forEach(fe=>fe==null?void 0:fe.disconnect())};s&&a&&(a=`${s}_${a}`);let Ze;if(o)Ze=o(i,r,t);else if(M_(a)){const{onTrigger:fe}=M_(a),Ie=await fe(i,r,rn);Ie&&(Ze=Ie.node,Ie.stop(i+t))}else throw new Error(`sound ${a} not found! Is it loaded?`);if(!Ze)return;if(n.currentTime>i){hs("[webaudio] skip hap: still loading",n.currentTime-i);return}const ke=[];if(ke.push(Ze),ke.push(sc(l)),m!==void 0){let fe=()=>gu(n,"lowpass",m,$,v,I,R,x,_,i,i+t,p);ke.push(fe()),u==="24db"&&ke.push(fe())}if(h!==void 0){let fe=()=>gu(n,"highpass",h,L,b,S,N,k,Z,i,i+t,p);ke.push(fe()),u==="24db"&&ke.push(fe())}if(G!==void 0){let fe=()=>gu(n,"bandpass",G,B,te,re,ne,ee,M,i,i+t,p);ke.push(fe()),u==="24db"&&ke.push(fe())}if(le!==void 0){const fe=n.createVowelFilter(le);ke.push(fe)}if(Q!==void 0&&ke.push(Ou(n,"coarse-processor",{coarse:Q})),j!==void 0&&ke.push(Ou(n,"crush-processor",{crush:j})),K!==void 0&&ke.push(Ou(n,"shape-processor",{shape:K})),vt!==void 0&&ke.push(HR(n,vt,mt,At,Nt,Rn)),ue!==void 0){const fe=n.createStereoPanner();fe.pan.value=2*ue-1,ke.push(fe)}const en=sc(c);ke.push(en),en.connect(fg());let Zt;if(be>0&&xe>0&&De>0){const fe=JR(Ee,xe,De,i);Zt=bu(en,fe,be)}let an;if(Ne>0){const fe=e2(Ee,Be,ce,Le,Xe);an=bu(en,fe,Ne)}let H;if(rt){const fe=zh(2**(ht+5));H=bu(en,fe,rt)}ke.slice(1).reduce((fe,Ie)=>fe.connect(Ie),ke[0]),qe=ke.concat([Zt,an,H])},Eu={};function t2(r,e){var t=e?1e3:1024;if(r=t);return r.toFixed(1)+" "+n[i]}const n2=async(r,e,t,n,i,a,s)=>{let o=0;i!==void 0&&t!==void 0&&hs("[sampler] hap has note and freq. ignoring note","warning");let l=QR({freq:i,note:t},36);o=l-36;const c=Bt();let u;if(Array.isArray(a))u=a[e%a.length];else{const v=R=>Hc(R)-l,I=Object.keys(a).filter(R=>!R.startsWith("_")).reduce((R,x,$)=>!R||Math.abs(v(x)){const i=t?`sound "${t}:${n}"`:"sample";if(r=r.replace("#","%23"),!Eu[r]){hs(`[sampler] load ${i}..`,"load-sample",{url:r});const a=Date.now();Eu[r]=fetch(r).then(s=>s.arrayBuffer()).then(async s=>{const o=Date.now()-a,l=t2(s.byteLength);return hs(`[sampler] load ${i}... done! loaded ${l} in ${o}ms`,"loaded-sample",{url:r}),await e.decodeAudioData(s)})}return Eu[r]};function i2(r){const e=Bt(),t=e.createBuffer(r.numberOfChannels,r.length,e.sampleRate);for(let n=0;nObject.entries(r).forEach(([n,i])=>{if(typeof i=="string"&&(i=[i]),typeof i!="object")throw new Error("wrong sample map format for "+n);t=i._base||t;const a=s=>(t+s).replace("github:","https://raw.githubusercontent.com/");Array.isArray(i)?i=i.map(a):i=Object.fromEntries(Object.entries(i).map(([s,o])=>[s,(typeof o=="string"?[o]:o).map(a)])),e(n,i)});let s2={};function o2(r){const e=Object.entries(s2).find(([t])=>r.startsWith(t));if(e)return e[1]}const Yi=async(r,e=r._base||"",t={})=>{if(typeof r=="string"){const a=o2(r);if(a)return a(r);if(r.startsWith("github:")){let[o,l]=r.split("github:");l=l.endsWith("/")?l.slice(0,-1):l,r=`https://raw.githubusercontent.com/${l}/strudel.json`}if(typeof fetch!="function")return;const s=r.split("/").slice(0,-1).join("/");return typeof fetch>"u"?void 0:fetch(r).then(o=>o.json()).then(o=>Yi(o,e||o._base||s,t)).catch(o=>{throw console.error(o),new Error(`error loading "${r}"`)})}const{prebake:n,tag:i}=t;a2(r,(a,s)=>pg(a,(o,l,c)=>l2(o,l,c,s),{type:"sample",samples:s,baseUrl:e,prebake:n,tag:i}),e)},B_=[];async function l2(r,e,t,n,i){let{s:a,freq:s,unit:o,nudge:l=0,cut:c,loop:u,clip:p=void 0,n:m=0,note:_,speed:v=1,loopBegin:I=0,begin:R=0,loopEnd:x=1,end:$=1}=e;if(v===0)return;u=a.startsWith("wt_")?1:e.loop;const Z=Bt(),{attack:h=.001,decay:b=.001,sustain:S=1,release:N=.001}=e,k=r+l,L=await n2(a,m,_,v,s,n,i);if(Z.currentTime>r){hs(`[sampler] still loading sound "${a}:${m}"`,"highlight");return}if(!L){hs(`[sampler] could not load "${a}:${m}"`,"error");return}L.playbackRate.value=Math.abs(v)*L.playbackRate.value,o==="c"&&(L.playbackRate.value=L.playbackRate.value*L.buffer.duration*1);const M=R*L.buffer.duration;u&&(L.loop=!0,L.loopStart=I*L.buffer.duration-M,L.loopEnd=x*L.buffer.duration-M),L.start(k,M);const{node:G,stop:te}=ug(h,b,S,N,1,r);L.connect(G);const re=Z.createGain();G.connect(re),L.onended=function(){L.disconnect(),G.disconnect(),re.disconnect(),t()};const ne={node:re,bufferSource:L,stop:(ee,B=p===void 0&&u===void 0)=>{let Q=ee;if(B){const j=L.buffer.duration/L.playbackRate.value;Q=r+($-R)*j}L.stop(Q+N),te(Q)}};if(c!==void 0){const ee=B_[c];ee&&(ee.node.gain.setValueAtTime(1,k),ee.node.gain.linearRampToValueAtTime(0,k+.01)),B_[c]=ne}return ne}let vu={};function c2(r){const e=Bt();if(vu[r])return vu[r];const t=2*e.sampleRate,n=e.createBuffer(1,t,e.sampleRate),i=n.getChannelData(0);let a=0,s,o,l,c,u,p,m;s=o=l=c=u=p=m=0;for(let _=0;_t.stop(n)}}function u2(r,e,t){const n=ET("pink",t);return{node:WR(r,n.node,e),stop:i=>n==null?void 0:n.stop(i)}}const d2=(r,e=1,t="sine")=>{const n=Bt(),i=n.createOscillator();i.type=t,i.frequency.value=r,i.start();const a=new GainNode(n,{gain:e});return i.connect(a),{node:a,stop:s=>i.stop(s)}},p2=(r,e,t,n="sine")=>{const i=r.frequency.value*e,a=i*t;return d2(i,a,n)},U_=["sine","square","triangle","sawtooth"],f2=["pink","white","brown"];function h2(){[...U_,...f2].forEach(r=>{pg(r,(e,t,n)=>{let{attack:i=.001,decay:a=.05,sustain:s=.6,release:o=.01}=t,l;U_.includes(r)?l=g2(r,e,t):l=ET(r,e);let{node:c,stop:u,triggerRelease:p}=l;const m=sc(.3),{node:_,stop:v}=ug(i,a,s,o,1,e);return c.onended=()=>{c.disconnect(),m.disconnect(),n()},{node:c.connect(m).connect(_),stop:I=>{v(I),p==null||p(I);let R=I+o;u(R)}}},{type:"synth",prebake:!0})})}function m2(r,e){const t=new Float32Array(r+1),n=new Float32Array(r+1),i=Bt(),a=i.createOscillator(),s={sawtooth:c=>1/c,square:c=>c%2===0?0:1/c,triangle:c=>c%2===0?0:1/(c*c)};if(!s[e])throw new Error(`unknown wave type ${e}`);t[0]=0,n[0]=0;let o=1;for(;o<=r;)t[o]=s[e](o),n[o]=0,o++;const l=i.createPeriodicWave(t,n);return a.setPeriodicWave(l),a}function g2(r,e,{n:t,note:n,freq:i,vib:a=0,vibmod:s=.5,noise:o=0,fmh:l=1,fmi:c,fmenv:u="lin",fmattack:p,fmdecay:m,fmsustain:_,fmrelease:v,fmvelocity:I,fmwave:R="sine"}){Bt();let x;!t||r==="sine"?(x=Bt().createOscillator(),x.type=r||"triangle"):x=m2(t,r),n=n||36,typeof n=="string"&&(n=Hc(n)),!i&&typeof n=="number"&&(i=bT(n)),x.frequency.value=Number(i),x.start(e);let $,Z;if(c){const{node:S,stop:N}=p2(x,l,c,R);[p,m,_,v,I].find(k=>k!==void 0)?(p=p??.001,m=m??.001,_=_??1,v=v??.001,I=I??1,Z=ug(p,m,_,v,I,e),u==="exp"&&(Z=VR(p,m,_,v,I,e),Z.node.maxValue=c*2,Z.node.minValue=1e-5),S.connect(Z.node),Z.node.connect(x.frequency)):S.connect(x.frequency),$=N}let h;if(a>0){h=Bt().createOscillator(),h.frequency.value=a;const S=Bt().createGain();S.gain.value=s*100,h.connect(S),S.connect(x.detune),h.start(e)}let b;return o&&(b=u2(x,o,e)),{node:(b==null?void 0:b.node)||x,stop:S=>{h==null||h.stop(S),b==null||b.stop(S),$==null||$(S),x.stop(S)},triggerRelease:S=>{Z==null||Z.stop(S)}}}function _2(r=1,e=.05,t=220,n=0,i=0,a=.1,s=0,o=1,l=0,c=0,u=0,p=0,m=0,_=0,v=0,I=0,R=0,x=1,$=0,Z=0){let h=Math.PI*2,b=Bt().sampleRate,S=K=>K>0?1:-1,N=l*=500*h/b/b,k=t*=(1+e*2*Math.random()-e)*h/b,L=[],M=0,G=0,te=0,re=1,ne=0,ee=0,B=0,Q,j;for(n=n*b+9,$*=b,i*=b,a*=b,R*=b,c*=500*h/b**3,v*=h/b,u*=h/b,p*=b,m=m*b|0,j=n+$+i+a+R|0;te1?s>2?s>3?Math.sin((M%h)**3):Math.max(Math.min(Math.tan(M),1),-1):1-(2*M/h%2+2)%2:1-4*Math.abs(Math.round(M/h)-M/h):Math.sin(M),B=(m?1-Z+Z*Math.sin(h*te/m):1)*S(B)*Math.abs(B)**o*r*1*(tete?0:(tep&&(t+=u,k+=u,re=0),m&&!(++ne%m)&&(t=k,l=N,re||(re=1));return L}const S2=(r,e)=>{let{s:t,note:n=36,freq:i,zrand:a=0,attack:s=0,decay:o=0,sustain:l=.8,release:c=.1,curve:u=1,slide:p=0,deltaSlide:m=0,pitchJump:_=0,pitchJumpTime:v=0,lfo:I=0,znoise:R=0,zmod:x=0,zcrush:$=0,zdelay:Z=0,tremolo:h=0,duration:b=.2,zzfx:S}=r;const N=Math.max(b-s-o,0);typeof n=="string"&&(n=Hc(n)),!i&&typeof n=="number"&&(i=bT(n)),t=t.replace("z_","");const k=["sine","triangle","sawtooth","tan","noise"].indexOf(t)||0;u=t==="square"?0:u;const L=_2(...S||[.25,a,i,s,N,c,k,u,p,m,_,v,I,R,x,$,Z,l,o,h]),M=Bt(),G=M.createBuffer(1,L.length,M.sampleRate);G.getChannelData(0).set(L);const te=Bt().createBufferSource();return te.buffer=G,te.start(e),{node:te}};function O2(){["zzfx","z_sine","z_sawtooth","z_triangle","z_square","z_tan","z_noise"].forEach(r=>{pg(r,(e,t,n)=>{const{node:i}=S2({s:r,...t},e);return i.onended=()=>{i.disconnect(),n()},{node:i,stop:()=>{}}},{type:"synth",prebake:!0})})}let Tu;const b2=()=>{};typeof window<"u"&&window.addEventListener("message",r=>{var e;r.data==="strudel-stop"?b2():(e=r.data)!=null&&e.dough&&(Tu==null||Tu.node.port.postMessage(r.data))});const vT=(r,e,t,n,i)=>{const s=r.interface.feedback.getContext("2d");s&&(s.beginPath(),s.arc(e,t,n,0,Math.PI*2),s.fillStyle=i,s.fill(),s.closePath())},E2=(r,e,t)=>{if(t!==void 0&&t<1&&t>9)return;const n=r.clock.bpm/60/r.clock.time_signature[1]*200,i=r.interface.feedback.getContext("2d"),a=o=>{vT(r,50+o,r.interface.feedback.clientHeight-15,8,"#fdba74")},s=o=>{const l=50+o,c=r.interface.feedback.clientHeight-15,u=8;i.clearRect(l-u,c-u,u*2,u*2)};if(e==="local"&&t!==void 0){const o=t*25;r.blinkTimeouts[o]&&clearTimeout(r.blinkTimeouts[o]),a(o),r.blinkTimeouts[o]=setTimeout(()=>{s(o),r.interface.feedback.getContext("2d").clearRect(0,0,r.interface.feedback.width,r.interface.feedback.height),TT(r)},n)}},TT=r=>{for(let e=1;e<=9;e++){const t=e*25;vT(r,50+t,r.interface.feedback.clientHeight-15,8,"white")}},v2=(r,e)=>{let t=e.osc,n=zh(t.fftSize),i=new Float32Array(n.frequencyBinCount);const a=r.getContext("2d"),s=r.width,o=r.height;let l=0,c=1e3/30;function u(){const p=Date.now();if(requestAnimationFrame(u),!(p-l{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=pn.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}et.closedBy=new et({deserialize:r=>r.split(" ")});et.openedBy=new et({deserialize:r=>r.split(" ")});et.group=new et({deserialize:r=>r.split(" ")});et.contextHash=new et({perNode:!0});et.lookAhead=new et({perNode:!0});et.mounted=new et({perNode:!0});class C2{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}}const y2=Object.create(null);class pn{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):y2,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new pn(e.name||"",t,e.id,n);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[a[0].id]=a[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(et.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return n=>{for(let i=n.prop(et.group),a=-1;a<(i?i.length:0);a++){let s=t[a<0?n.name:i[a]];if(s)return s}}}}pn.none=new pn("",Object.create(null),0,8);class rl{constructor(e){this.types=e;for(let t=0;t0;for(let l=this.cursor(s|xt.IncludeAnonymous);;){let c=!1;if(l.from<=a&&l.to>=i&&(!o&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&n&&(o||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:gg(pn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,i)=>new Et(this.type,t,n,i,this.propValues),e.makeTree||((t,n,i)=>new Et(pn.none,t,n,i)))}static build(e){return I2(e)}}Et.empty=new Et(pn.none,[],[],0);class hg{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new hg(this.buffer,this.index)}}class wa{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return pn.none}toString(){let e=[];for(let t=0;t0));l=s[l+3]);return o}slice(e,t,n){let i=this.buffer,a=new Uint16Array(t-e),s=0;for(let o=e,l=0;o=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function AT(r,e){let t=r.childBefore(e);for(;t;){let n=t.lastChild;if(!n||n.to!=t.to)break;n.type.isError&&n.from==n.to?(r=t,t=n.prevSibling):t=n}return r}function ms(r,e,t,n){for(var i;r.from==r.to||(t<1?r.from>=e:r.from>e)||(t>-1?r.to<=e:r.to0?o.length:-1;e!=c;e+=t){let u=o[e],p=l[e]+s.from;if(yT(i,n,p,p+u.length)){if(u instanceof wa){if(a&xt.ExcludeBuffers)continue;let m=u.findChild(0,u.buffer.length,t,n-p,i);if(m>-1)return new Kr(new A2(s,u,e,p),null,m)}else if(a&xt.IncludeAnonymous||!u.type.isAnonymous||mg(u)){let m;if(!(a&xt.IgnoreMounts)&&u.props&&(m=u.prop(et.mounted))&&!m.overlay)return new Or(m.tree,p,e,s);let _=new Or(u,p,e,s);return a&xt.IncludeAnonymous||!_.type.isAnonymous?_:_.nextChild(t<0?u.children.length-1:0,t,n,i)}}}if(a&xt.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+t:e=t<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let i;if(!(n&xt.IgnoreOverlays)&&(i=this._tree.prop(et.mounted))&&i.overlay){let a=e-this.from;for(let{from:s,to:o}of i.overlay)if((t>0?s<=a:s=a:o>a))return new Or(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new wo(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return ms(this,e,t,!1)}resolveInner(e,t=0){return ms(this,e,t,!0)}enterUnfinishedNodesBefore(e){return AT(this,e)}getChild(e,t=null,n=null){let i=oc(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return oc(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return lc(this,e)}}function oc(r,e,t,n){let i=r.cursor(),a=[];if(!i.firstChild())return a;if(t!=null){for(;!i.type.is(t);)if(!i.nextSibling())return a}for(;;){if(n!=null&&i.type.is(n))return a;if(i.type.is(e)&&a.push(i.node),!i.nextSibling())return n==null?a:[]}}function lc(r,e,t=e.length-1){for(let n=r.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class A2{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class Kr{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return a<0?null:new Kr(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&xt.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return a<0?null:new Kr(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Kr(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Kr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new wo(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,a=n.buffer[this.index+3];if(a>i){let s=n.buffer[this.index+1];e.push(n.slice(i,a,s)),t.push(0)}return new Et(this.type,e,t,this.to-this.from)}resolve(e,t=0){return ms(this,e,t,!1)}resolveInner(e,t=0){return ms(this,e,t,!0)}enterUnfinishedNodesBefore(e){return AT(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let i=oc(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return oc(this,e,t,n)}get node(){return this}matchContext(e){return lc(this,e)}}class wo{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Or)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof Or?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,a=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&xt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let a=t+e,s=e<0?-1:n._tree.children.length;a!=s;a+=e){let o=n._tree.children[a];if(this.mode&xt.IncludeAnonymous||o instanceof wa||!o.type.isAnonymous||mg(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,n=a+1;break e}i=this.stack[--a]}for(let i=n;i=0;a--){if(a<0)return lc(this.node,e,i);let s=n[t.buffer[this.stack[a]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function mg(r){return r.children.some(e=>e instanceof wa||!e.type.isAnonymous||mg(e))}function I2(r){var e;let{buffer:t,nodeSet:n,maxBufferLength:i=CT,reused:a=[],minRepeatType:s=n.types.length}=r,o=Array.isArray(t)?new hg(t,t.length):t,l=n.types,c=0,u=0;function p(h,b,S,N,k){let{id:L,start:M,end:G,size:te}=o,re=u;for(;te<0;)if(o.next(),te==-1){let j=a[L];S.push(j),N.push(M-h);return}else if(te==-3){c=L;return}else if(te==-4){u=L;return}else throw new RangeError(`Unrecognized record size: ${te}`);let ne=l[L],ee,B,Q=M-h;if(G-M<=i&&(B=I(o.pos-b,k))){let j=new Uint16Array(B.size-B.skip),K=o.pos-B.size,ue=j.length;for(;o.pos>K;)ue=R(B.start,j,ue);ee=new wa(j,G-B.start,n),Q=B.start-h}else{let j=o.pos-te;o.next();let K=[],ue=[],le=L>=s?L:-1,be=0,De=G;for(;o.pos>j;)le>=0&&o.id==le&&o.size>=0?(o.end<=De-i&&(_(K,ue,M,be,o.end,De,le,re),be=K.length,De=o.end),o.next()):p(M,j,K,ue,le);if(le>=0&&be>0&&be-1&&be>0){let xe=m(ne);ee=gg(ne,K,ue,0,K.length,0,G-M,xe,xe)}else ee=v(ne,K,ue,G-M,re-G)}S.push(ee),N.push(Q)}function m(h){return(b,S,N)=>{let k=0,L=b.length-1,M,G;if(L>=0&&(M=b[L])instanceof Et){if(!L&&M.type==h&&M.length==N)return M;(G=M.prop(et.lookAhead))&&(k=S[L]+M.length+G)}return v(h,b,S,N,k)}}function _(h,b,S,N,k,L,M,G){let te=[],re=[];for(;h.length>N;)te.push(h.pop()),re.push(b.pop()+S-k);h.push(v(n.types[M],te,re,L-k,G-L)),b.push(k-S)}function v(h,b,S,N,k=0,L){if(c){let M=[et.contextHash,c];L=L?[M].concat(L):[M]}if(k>25){let M=[et.lookAhead,k];L=L?[M].concat(L):[M]}return new Et(h,b,S,N,L)}function I(h,b){let S=o.fork(),N=0,k=0,L=0,M=S.end-i,G={size:0,start:0,skip:0};e:for(let te=S.pos-h;S.pos>te;){let re=S.size;if(S.id==b&&re>=0){G.size=N,G.start=k,G.skip=L,L+=4,N+=4,S.next();continue}let ne=S.pos-re;if(re<0||ne=s?4:0,B=S.start;for(S.next();S.pos>ne;){if(S.size<0)if(S.size==-3)ee+=4;else break e;else S.id>=s&&(ee+=4);S.next()}k=B,N+=re,L+=ee}return(b<0||N==h)&&(G.size=N,G.start=k,G.skip=L),G.size>4?G:void 0}function R(h,b,S){let{id:N,start:k,end:L,size:M}=o;if(o.next(),M>=0&&N4){let te=o.pos-(M-4);for(;o.pos>te;)S=R(h,b,S)}b[--S]=G,b[--S]=L-h,b[--S]=k-h,b[--S]=N}else M==-3?c=N:M==-4&&(u=N);return S}let x=[],$=[];for(;o.pos>0;)p(r.start||0,r.bufferStart||0,x,$,-1);let Z=(e=r.length)!==null&&e!==void 0?e:x.length?$[0]+x[0].length:0;return new Et(l[r.topID],x.reverse(),$.reverse(),Z)}const Y_=new WeakMap;function Gl(r,e){if(!r.isAnonymous||e instanceof wa||e.type!=r)return 1;let t=Y_.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=r||!(n instanceof Et)){t=1;break}t+=Gl(r,n)}Y_.set(e,t)}return t}function gg(r,e,t,n,i,a,s,o,l){let c=0;for(let v=n;v=u)break;S+=N}if(Z==h+1){if(S>u){let N=v[h];_(N.children,N.positions,0,N.children.length,I[h]+$);continue}p.push(v[h])}else{let N=I[Z-1]+v[Z-1].length-b;p.push(gg(r,v,I,h,Z,b,N,null,l))}m.push(b+$-a)}}return _(e,t,n,i,0),(o||l)(p,m,s)}class IT{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof Kr?this.setBuffer(e.context.buffer,e.index,t):e instanceof Or&&this.map.set(e.tree,t)}get(e){return e instanceof Kr?this.getBuffer(e.context.buffer,e.index):e instanceof Or?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Oi{constructor(e,t,n,i,a=!1,s=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(a?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let i=[new Oi(0,e.length,e,0,!1,n)];for(let a of t)a.to>e.length&&i.push(a);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],a=1,s=e.length?e[0]:null;for(let o=0,l=0,c=0;;o++){let u=o=n)for(;s&&s.from=m.from||p<=m.to||c){let _=Math.max(m.from,l)-c,v=Math.min(m.to,p)-c;m=_>=v?null:new Oi(_,v,m.tree,m.offset+c,o>0,!!u)}if(m&&i.push(m),s.to>p)break;s=anew gr(i.from,i.to)):[new gr(0,0)]:[new gr(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let a=i.advance();if(a)return a}}}class R2{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function RT(r){return(e,t,n,i)=>new w2(e,r,t,n,i)}class $_{constructor(e,t,n,i,a){if(this.parser=e,this.parse=t,this.overlay=n,this.target=i,this.ranges=a,!a.length||a.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(a))}}class N2{constructor(e,t,n,i,a,s,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=i,this.start=a,this.target=s,this.prev=o,this.depth=0,this.ranges=[]}}const Hh=new et({perNode:!0});class w2{constructor(e,t,n,i,a){this.nest=t,this.input=n,this.fragments=i,this.ranges=a,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Et(n.type,n.children,n.positions,n.length,n.propValues.concat([[Hh,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[et.mounted.id]=new C2(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tu.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let p=u.from+c.pos,m=u.to+c.pos;p>=i.from&&m<=i.to&&!t.ranges.some(_=>_.fromp)&&t.ranges.push({from:p,to:m})}}o=!1}else if(n&&(s=D2(n.ranges,i.from,i.to)))o=s!=2;else if(!i.type.isAnonymous&&i.fromnew gr(p.from-i.from,p.to-i.from)):null,i.tree,u)),a.overlay?u.length&&(n={ranges:u,depth:0,prev:n}):o=!1}}else t&&(l=t.predicate(i))&&(l===!0&&(l=new gr(i.from,i.to)),l.fromnew gr(u.from-t.start,u.to-t.start)),t.target,c)),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function D2(r,e,t){for(let n of r){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function G_(r,e,t,n,i,a){if(e=e.to);n++);let s=i.children[n],o=s.buffer;function l(c,u,p,m,_){let v=c;for(;o[v+2]+a<=e.from;)v=o[v+3];let I=[],R=[];G_(s,c,v,I,R,m);let x=o[v+1],$=o[v+2],Z=x+a==e.from&&$+a==e.to&&o[v]==e.type.id;return I.push(Z?e.toTree():l(v+4,o[v+3],s.set.types[o[v]],x,$-x)),R.push(x-m),G_(s,o[v+3],u,I,R,m),new Et(p,I,R,_)}i.children[n]=l(0,o.length,pn.none,0,s.length);for(let c=0;c<=t;c++)r.childAfter(e.from)}class Q_{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(xt.IncludeAnonymous|xt.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from=e&&t.enter(n,1,xt.IgnoreOverlays|xt.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Et)t=t.children[0];else break}return!1}}let k2=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Hh))!==null&&t!==void 0?t:n.to,this.inner=new Q_(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Hh))!==null&&e!==void 0?e:t.to,this.inner=new Q_(t.tree,-t.offset)}}findMounts(e,t){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let a=this.inner.cursor.node;a;a=a.parent){let s=(n=a.tree)===null||n===void 0?void 0:n.prop(et.mounted);if(s&&s.parser==t)for(let o=this.fragI;o=a.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:a.from-l.offset,mount:s})}}}return i}};function q_(r,e){let t=null,n=e;for(let i=1,a=0;i=o)break;l.to<=s||(t||(n=t=e.slice()),l.fromo&&t.splice(a+1,0,new gr(o,l.to))):l.to>o?t[a--]=new gr(o,l.to):t.splice(a--,1))}}return n}function L2(r,e,t,n){let i=0,a=0,s=!1,o=!1,l=-1e9,c=[];for(;;){let u=i==r.length?1e9:s?r[i].to:r[i].from,p=a==e.length?1e9:o?e[a].to:e[a].from;if(s!=o){let m=Math.max(l,t),_=Math.min(u,p,n);m<_&&c.push(new gr(m,_))}if(l=Math.min(u,p),l==1e9)break;u==l&&(s?(s=!1,i++):s=!0),p==l&&(o?(o=!1,a++):o=!0)}return c}function V_(r,e){let t=[];for(let{pos:n,mount:i,frag:a}of r){let s=n+(i.overlay?i.overlay[0].from:0),o=s+i.tree.length,l=Math.max(a.from,s),c=Math.min(a.to,o);if(i.overlay){let u=i.overlay.map(m=>new gr(m.from+n,m.to+n)),p=L2(e,u,l,c);for(let m=0,_=l;;m++){let v=m==p.length,I=v?c:p[m].from;if(I>_&&t.push(new Oi(_,I,i.tree,-s,a.from>=_||a.openStart,a.to<=I||a.openEnd)),v)break;_=p[m].to}}else t.push(new Oi(l,c,i.tree,-s,a.from>=s||a.openStart,a.to<=o||a.openEnd))}return t}let M2=class Wh{constructor(e,t,n,i,a,s,o,l,c,u=0,p){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=a,this.score=s,this.buffer=o,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=p}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new Wh(e,[],t,n,n,0,[],0,i?new z_(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,i=e&65535,{parser:a}=this.p,s=a.dynamicPrecedence(i);if(s&&(this.score+=s),n==0){this.pushState(a.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((t=this.p.parser.nodeSet.types[i])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,n,i=4,a=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[o-4]==0&&s.buffer[o-1]>-1){if(t==n)return;if(s.buffer[o-2]>=t){s.buffer[o-2]=n;return}}}if(!a||this.pos==n)this.buffer.push(e,t,n,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=n,this.buffer[s+3]=i}}shift(e,t,n){let i=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=n,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,n,4);else{let a=e,{parser:s}=this.p;(n>this.pos||t<=s.maxNode)&&(this.pos=n,s.stateFlag(a,1)||(this.reducePos=n)),this.pushState(a,i),this.shiftContext(t,i),t<=s.maxNode&&this.buffer.push(t,i,n,4)}}apply(e,t,n){e&65536?this.reduce(e):this.shift(e,t,n)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new Wh(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new P2(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let a=0,s;al&1&&o==s)||i.push(t[a],s)}t=i}let n=[];for(let i=0;i>19,i=t&65535,a=this.stack.length-n*3;if(a<0||e.getGoto(this.stack[a],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;t=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(i,a)=>{if(!t.includes(i))return t.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let o=(s>>19)-a;if(o>1){let l=s&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return o<<19|65536|l}}else{let o=n(s,a+1);if(o!=null)return o}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class z_{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class P2{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class cc{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new cc(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new cc(this.stack,this.pos,this.index)}}function ho(r,e=Uint16Array){if(typeof r!="string")return r;let t=null;for(let n=0,i=0;n=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,o=!0),a+=l,o)break;a*=46}t?t[i++]=a:t=new e(a)}return t}class Ql{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const H_=new Ql;class B2{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=H_,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,a=this.pos+e;for(;an.to:a>=n.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];a+=s.from-n.to,n=s}return a}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,i;if(t>=0&&t=this.chunk2Pos&&no.to&&(this.chunk2=this.chunk2.slice(0,o.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=H_,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class ts{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;NT(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}ts.prototype.contextual=ts.prototype.fallback=ts.prototype.extend=!1;class uc{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?ho(e):e}token(e,t){let n=e.pos,i=0;for(;;){let a=e.next<0,s=e.resolveOffset(1,1);if(NT(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(a||i++,s==null)break;e.reset(s,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}uc.prototype.contextual=ts.prototype.fallback=ts.prototype.extend=!1;class ai{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function NT(r,e,t,n,i,a){let s=0,o=1<0){let v=r[_];if(l.allows(v)&&(e.token.value==-1||e.token.value==v||U2(v,e.token.value,i,a))){e.acceptToken(v);break}}let u=e.next,p=0,m=r[s+2];if(e.next<0&&m>p&&r[c+m*3-3]==65535&&r[c+m*3-3]==65535){s=r[c+m*3-1];continue e}for(;p>1,v=c+_+(_<<1),I=r[v],R=r[v+1]||65536;if(u=R)p=_+1;else{s=r[v+2],e.advance();continue e}}break}}function W_(r,e,t){for(let n=e,i;(i=r[n])!=65535;n++)if(i==t)return n-e;return-1}function U2(r,e,t,n){let i=W_(t,n,e);return i<0||W_(t,n,r)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(r.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:r.length}}let F2=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?X_(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?X_(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(a instanceof Et){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+a.length}}};class Y2{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Ql)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:a}=i,s=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,l=0;for(let c=0;cp.end+25&&(l=Math.max(p.lookAhead,l)),p.value!=0)){let m=t;if(p.extended>-1&&(t=this.addActions(e,p.extended,p.end,t)),t=this.addActions(e,p.value,p.end,t),!u.extend&&(n=p,t>m))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!n&&e.pos==this.stream.end&&(n=new Ql,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ql,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:a}=n.p;for(let s=0;s=0&&n.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let a=0;ae.bufferLength*4?new F2(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],i,a;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;st)n.push(o);else{if(this.advanceStack(o,n,e))continue;{i||(i=[],a=[]),i.push(o);let l=this.tokens.getMainToken(o);a.push(l.value,l.end)}}break}}if(!n.length){let s=i&&Q2(i);if(s)return jn&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw jn&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,a,n);if(s)return jn&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(n.length>s)for(n.sort((o,l)=>l.score-o.score);n.length>s;)n.pop();n.some(o=>o.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)n.splice(l--,1);else{n.splice(s--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let p=this.fragments.nodeAt(i);p;){let m=this.parser.nodeSet.types[p.type.id]==p.type?a.getGoto(e.state,p.type.id):-1;if(m>-1&&p.length&&(!c||(p.prop(et.contextHash)||0)==u))return e.useNode(p,m),jn&&console.log(s+this.stackID(e)+` (via reuse of ${a.getName(p.type.id)})`),!0;if(!(p instanceof Et)||p.children.length==0||p.positions[0]>0)break;let _=p.children[0];if(_ instanceof Et&&p.positions[0]==0)p=_;else break}}let o=a.stateSlot(e.state,4);if(o>0)return e.reduce(o),jn&&console.log(s+this.stackID(e)+` (via always-reduce ${a.getName(o&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?t.push(v):n.push(v)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Z_(e,t),!0}}runRecovery(e,t,n){let i=null,a=!1;for(let s=0;s ":"";if(o.deadEnd&&(a||(a=!0,o.restart(),jn&&console.log(u+this.stackID(o)+" (restarted)"),this.advanceFully(o,n))))continue;let p=o.split(),m=u;for(let _=0;p.forceReduce()&&_<10&&(jn&&console.log(m+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,n));_++)jn&&(m=this.stackID(p)+" -> ");for(let _ of o.recoverByInsert(l))jn&&console.log(u+this.stackID(_)+" (via recover-insert)"),this.advanceFully(_,n);this.stream.end>o.pos?(c==o.pos&&(c++,l=0),o.recoverByDelete(l,c),jn&&console.log(u+this.stackID(o)+` (via recover-delete ${this.parser.getName(l)})`),Z_(o,n)):(!i||i.scorer;class wT{constructor(e){this.start=e.start,this.shift=e.shift||yu,this.reduce=e.reduce||yu,this.reuse=e.reuse||yu,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class gs extends _g{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let o=0;oe.topRules[o][1]),i=[];for(let o=0;o=0)a(u,l,o[c++]);else{let p=o[c+-u];for(let m=-u;m>0;m--)a(o[c++],l,p);c++}}}this.nodeSet=new rl(t.map((o,l)=>pn.define({name:l>=this.minRepeatTerm?void 0:o,id:l,props:i[l],top:n.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=CT;let s=ho(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new ts(s,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new $2(this,e,t,n);for(let a of this.wrappers)i=a(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return-1;for(let a=i[t+1];;){let s=i[a++],o=s&1,l=i[a++];if(o&&n)return l;for(let c=a+(s>>1);a0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let a=this.stateSlot(e,1);i==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=mi(this.data,a+2);else break;i=t(mi(this.data,a+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=mi(this.data,n+2);else break;if(!(this.data[n+2]&1)){let i=this.data[n+1];t.some((a,s)=>s&1&&a==i)||t.push(this.data[n],i)}}return t}configure(e){let t=Object.assign(Object.create(gs.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let i=e.tokenizers.find(a=>a.from==n);return i?i.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let a=e.specializers.find(o=>o.from==n.external);if(!a)return n;let s=Object.assign(Object.assign({},n),{external:a.to});return t.specializers[i]=K_(s),s})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let a of e.split(" ")){let s=t.indexOf(a);s>=0&&(n[s]=!0)}let i=null;for(let a=0;an)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorer.external(t,n)<<1|e}return r.get}let q2=0;class Mr{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=q2++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new Mr([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new dc;return t=>t.modified.indexOf(e)>-1?t:dc.get(t.base||t,t.modified.concat(e).sort((n,i)=>n.id-i.id))}}let V2=0;class dc{constructor(){this.instances=[],this.id=V2++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(o=>o.base==e&&z2(t,o.modified));if(n)return n;let i=[],a=new Mr(i,e,t);for(let o of t)o.instances.push(a);let s=H2(t);for(let o of e.set)if(!o.modified.length)for(let l of s)i.push(dc.get(o,l));return a}}function z2(r,e){return r.length==e.length&&r.every((t,n)=>t==e[n])}function H2(r){let e=[[]];for(let t=0;tn.length-t.length)}function Is(r){let e=Object.create(null);for(let t in r){let n=r[t];Array.isArray(n)||(n=[n]);for(let i of t.split(" "))if(i){let a=[],s=2,o=i;for(let p=0;;){if(o=="..."&&p>0&&p+3==i.length){s=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!m)throw new RangeError("Invalid path: "+i);if(a.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),p+=m[0].length,p==i.length)break;let _=i[p++];if(p==i.length&&_=="!"){s=0;break}if(_!="/")throw new RangeError("Invalid path: "+i);o=i.slice(p)}let l=a.length-1,c=a[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new pc(n,s,l>0?a.slice(0,l):null);e[c]=u.sort(e[c])}}return DT.add(e)}const DT=new et;class pc{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let o of a)for(let l of o.set){let c=t[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:n}}function W2(r,e){let t=null;for(let n of r){let i=n.style(e);i&&(t=t?t+" "+i:i)}return t}function X2(r,e,t,n=0,i=r.length){let a=new Z2(n,Array.isArray(e)?e:[e],t);a.highlightRange(r.cursor(),n,i,"",a.highlighters),a.flush(i)}class Z2{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,a){let{type:s,from:o,to:l}=e;if(o>=n||l<=t)return;s.isTop&&(a=this.highlighters.filter(_=>!_.scope||_.scope(s)));let c=i,u=K2(e)||pc.empty,p=W2(a,u.tags);if(p&&(c&&(c+=" "),c+=p,u.mode==1&&(i+=(i?" ":"")+p)),this.startSpan(Math.max(t,o),c),u.opaque)return;let m=e.tree&&e.tree.prop(et.mounted);if(m&&m.overlay){let _=e.node.enter(m.overlay[0].from+o,1),v=this.highlighters.filter(R=>!R.scope||R.scope(m.tree.type)),I=e.firstChild();for(let R=0,x=o;;R++){let $=R=Z||!e.nextSibling())););if(!$||Z>n)break;x=$.to+o,x>t&&(this.highlightRange(_.cursor(),Math.max(t,$.from+o),Math.min(n,x),"",v),this.startSpan(Math.min(n,x),c))}I&&e.parent()}else if(e.firstChild()){m&&(i="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,a),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function K2(r){let e=r.type.prop(DT);for(;e&&e.context&&!r.matchContext(e.context);)e=e.next;return e||null}const Re=Mr.define,bl=Re(),$i=Re(),j_=Re($i),J_=Re($i),Gi=Re(),El=Re(Gi),Au=Re(Gi),Qr=Re(),ca=Re(Qr),Yr=Re(),$r=Re(),Xh=Re(),js=Re(Xh),vl=Re(),Y={comment:bl,lineComment:Re(bl),blockComment:Re(bl),docComment:Re(bl),name:$i,variableName:Re($i),typeName:j_,tagName:Re(j_),propertyName:J_,attributeName:Re(J_),className:Re($i),labelName:Re($i),namespace:Re($i),macroName:Re($i),literal:Gi,string:El,docString:Re(El),character:Re(El),attributeValue:Re(El),number:Au,integer:Re(Au),float:Re(Au),bool:Re(Gi),regexp:Re(Gi),escape:Re(Gi),color:Re(Gi),url:Re(Gi),keyword:Yr,self:Re(Yr),null:Re(Yr),atom:Re(Yr),unit:Re(Yr),modifier:Re(Yr),operatorKeyword:Re(Yr),controlKeyword:Re(Yr),definitionKeyword:Re(Yr),moduleKeyword:Re(Yr),operator:$r,derefOperator:Re($r),arithmeticOperator:Re($r),logicOperator:Re($r),bitwiseOperator:Re($r),compareOperator:Re($r),updateOperator:Re($r),definitionOperator:Re($r),typeOperator:Re($r),controlOperator:Re($r),punctuation:Xh,separator:Re(Xh),bracket:js,angleBracket:Re(js),squareBracket:Re(js),paren:Re(js),brace:Re(js),content:Qr,heading:ca,heading1:Re(ca),heading2:Re(ca),heading3:Re(ca),heading4:Re(ca),heading5:Re(ca),heading6:Re(ca),contentSeparator:Re(Qr),list:Re(Qr),quote:Re(Qr),emphasis:Re(Qr),strong:Re(Qr),link:Re(Qr),monospace:Re(Qr),strikethrough:Re(Qr),inserted:Re(),deleted:Re(),changed:Re(),invalid:Re(),meta:vl,documentMeta:Re(vl),annotation:Re(vl),processingInstruction:Re(vl),definition:Mr.defineModifier(),constant:Mr.defineModifier(),function:Mr.defineModifier(),standard:Mr.defineModifier(),local:Mr.defineModifier(),special:Mr.defineModifier()};xT([{tag:Y.link,class:"tok-link"},{tag:Y.heading,class:"tok-heading"},{tag:Y.emphasis,class:"tok-emphasis"},{tag:Y.strong,class:"tok-strong"},{tag:Y.keyword,class:"tok-keyword"},{tag:Y.atom,class:"tok-atom"},{tag:Y.bool,class:"tok-bool"},{tag:Y.url,class:"tok-url"},{tag:Y.labelName,class:"tok-labelName"},{tag:Y.inserted,class:"tok-inserted"},{tag:Y.deleted,class:"tok-deleted"},{tag:Y.literal,class:"tok-literal"},{tag:Y.string,class:"tok-string"},{tag:Y.number,class:"tok-number"},{tag:[Y.regexp,Y.escape,Y.special(Y.string)],class:"tok-string2"},{tag:Y.variableName,class:"tok-variableName"},{tag:Y.local(Y.variableName),class:"tok-variableName tok-local"},{tag:Y.definition(Y.variableName),class:"tok-variableName tok-definition"},{tag:Y.special(Y.variableName),class:"tok-variableName2"},{tag:Y.definition(Y.propertyName),class:"tok-propertyName tok-definition"},{tag:Y.typeName,class:"tok-typeName"},{tag:Y.namespace,class:"tok-namespace"},{tag:Y.className,class:"tok-className"},{tag:Y.macroName,class:"tok-macroName"},{tag:Y.propertyName,class:"tok-propertyName"},{tag:Y.operator,class:"tok-operator"},{tag:Y.comment,class:"tok-comment"},{tag:Y.meta,class:"tok-meta"},{tag:Y.invalid,class:"tok-invalid"},{tag:Y.punctuation,class:"tok-punctuation"}]);const j2=303,eS=1,J2=2,e0=304,t0=306,n0=307,r0=3,i0=4,a0=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],kT=125,s0=59,tS=47,o0=42,l0=43,c0=45,u0=new wT({start:!1,shift(r,e){return e==r0||e==i0||e==t0?r:e==n0},strict:!1}),d0=new ai((r,e)=>{let{next:t}=r;(t==kT||t==-1||e.context)&&r.acceptToken(e0)},{contextual:!0,fallback:!0}),p0=new ai((r,e)=>{let{next:t}=r,n;a0.indexOf(t)>-1||t==tS&&((n=r.peek(1))==tS||n==o0)||t!=kT&&t!=s0&&t!=-1&&!e.context&&r.acceptToken(j2)},{contextual:!0}),f0=new ai((r,e)=>{let{next:t}=r;if((t==l0||t==c0)&&(r.advance(),t==r.next)){r.advance();let n=!e.context&&e.canShift(eS);r.acceptToken(n?eS:J2)}},{contextual:!0}),h0=Is({"get set async static":Y.modifier,"for while do if else switch try catch finally return throw break continue default case":Y.controlKeyword,"in of await yield void typeof delete instanceof":Y.operatorKeyword,"let var const function class extends":Y.definitionKeyword,"import export from":Y.moduleKeyword,"with debugger as new":Y.keyword,TemplateString:Y.special(Y.string),super:Y.atom,BooleanLiteral:Y.bool,this:Y.self,null:Y.null,Star:Y.modifier,VariableName:Y.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Y.function(Y.variableName),VariableDefinition:Y.definition(Y.variableName),Label:Y.labelName,PropertyName:Y.propertyName,PrivatePropertyName:Y.special(Y.propertyName),"CallExpression/MemberExpression/PropertyName":Y.function(Y.propertyName),"FunctionDeclaration/VariableDefinition":Y.function(Y.definition(Y.variableName)),"ClassDeclaration/VariableDefinition":Y.definition(Y.className),PropertyDefinition:Y.definition(Y.propertyName),PrivatePropertyDefinition:Y.definition(Y.special(Y.propertyName)),UpdateOp:Y.updateOperator,LineComment:Y.lineComment,BlockComment:Y.blockComment,Number:Y.number,String:Y.string,Escape:Y.escape,ArithOp:Y.arithmeticOperator,LogicOp:Y.logicOperator,BitOp:Y.bitwiseOperator,CompareOp:Y.compareOperator,RegExp:Y.regexp,Equals:Y.definitionOperator,Arrow:Y.function(Y.punctuation),": Spread":Y.punctuation,"( )":Y.paren,"[ ]":Y.squareBracket,"{ }":Y.brace,"InterpolationStart InterpolationEnd":Y.special(Y.brace),".":Y.derefOperator,", ;":Y.separator,"@":Y.meta,TypeName:Y.typeName,TypeDefinition:Y.definition(Y.typeName),"type enum interface implements namespace module declare":Y.definitionKeyword,"abstract global Privacy readonly override":Y.modifier,"is keyof unique infer":Y.operatorKeyword,JSXAttributeValue:Y.attributeValue,JSXText:Y.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Y.angleBracket,"JSXIdentifier JSXNameSpacedName":Y.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Y.attributeName,"JSXBuiltin/JSXIdentifier":Y.standard(Y.tagName)}),m0={__proto__:null,export:14,as:19,from:27,default:30,async:35,function:36,extends:46,this:50,true:58,false:58,null:70,void:74,typeof:78,super:96,new:130,delete:146,yield:155,await:159,class:164,public:221,private:221,protected:221,readonly:223,instanceof:242,satisfies:245,in:246,const:248,import:280,keyof:335,unique:339,infer:345,is:381,abstract:401,implements:403,type:405,let:408,var:410,using:413,interface:419,enum:423,namespace:429,module:431,declare:435,global:439,for:458,of:467,while:470,with:474,do:478,if:482,else:484,switch:488,case:494,try:500,catch:504,finally:508,return:512,throw:516,break:520,continue:524,debugger:528},g0={__proto__:null,async:117,get:119,set:121,declare:181,public:183,private:183,protected:183,static:185,abstract:187,override:189,readonly:195,accessor:197,new:385},_0={__proto__:null,"<":137},S0=gs.deserialize({version:14,states:"$6tO`QUOOO%TQUOOO'WQWOOP(eOSOOO*sQ(CjO'#CfO*zOpO'#CgO+YO!bO'#CgO+hO07`O'#DZO-yQUO'#DaO.ZQUO'#DlO%TQUO'#DvO0_QUO'#EOOOQ(CY'#EW'#EWO0xQSO'#ETOOQO'#Ei'#EiOOQO'#Ic'#IcO1QQSO'#GkO1]QSO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Q8U:uQ8z7xQ9Y8gQ9a8xQ9r#QR;U;bR#YWR'P!dY!sQ'U-R0y4tS&{!d,yQ'a!qS'k!t!wS'm!x4vS,v&|'TS-b'b'cQ-d'dQ2P-PR2_-cR(o#vR(r#wQ!eQT-Q'U-R]!pQ!q'U-R0y4tQ#n]R'_9qT#iZ%]S#hZ%]S%cm,]U([#f#g#jS-v(](^Q-z(_Q0Q*|Q2d-wU2e-x-y-{S5z2f2gR7y5{`#[W#U#X%`'x(R*y-qr#eZm#f#g#j%](](^(_*|-w-x-y-{2f2g5{Q1`,]Q1v,sQ5i1nQ7q5jT:|&}*zT#_W%`S#^W%`S'y#U(RS(O#X*yS,x&}*zT-l'x-qT'S!d%aQ$jfR)n$oT)c$j)dR3_.oT*S$w*UR*[$zQ0U+UQ2i.SQ4w0{Q6P2mQ7]4zQ7|6OQ8i7[Q8{7{Q9[8kQ9d8}Q9i9]R9l9elqOXs!Y#b%e&h&j&k&m,a,f1f1iQ&b!UR,U&_rmOXs!T!U!Y#b%e&_&h&j&k&m,a,f1f1iR,]&eT%dm,]R0u+uR,T&]Q%{{R+m%|R+c%vT&f!V&iT&g!V&iT1h,f1i",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:366,context:u0,nodeProps:[["group",-26,6,14,16,62,199,203,207,208,210,213,216,226,228,234,236,238,240,243,249,255,257,259,261,263,265,266,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,103,104,113,114,131,134,136,137,138,139,141,142,162,163,165,"Expression",-23,24,26,30,34,36,38,166,168,170,171,173,174,175,177,178,179,181,182,183,193,195,197,198,"Type",-3,84,96,102,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",143,"JSXStartTag",155,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",144,"JSXSelfCloseEndTag JSXEndTag",160,"JSXEndTag"]],propSources:[h0],skippedNodes:[0,3,4,269],repeatNodeCount:33,tokenData:"$>y(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tu>PuvBavwDxwxGgxyMvyz! Qz{!![{|!%O|}!&]}!O!%O!O!P!'g!P!Q!1w!Q!R#0t!R![#3T![!]#@T!]!^#Aa!^!_#Bk!_!`#GS!`!a#In!a!b#N{!b!c$$z!c!}>P!}#O$&U#O#P$'`#P#Q$,w#Q#R$.R#R#S>P#S#T$/`#T#o$0j#o#p$4z#p#q$5p#q#r$7Q#r#s$8^#s$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$I|>P$I|$I}$P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(n%d_$d&j'xp'{!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$d&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$d&j'{!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'{!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$d&j'xpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;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~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(U~~",141,327),new uc("j~RQYZXz{^~^O'r~~aP!P!Qd~iO's~~",25,309)],topRules:{Script:[0,5],SingleExpression:[1,267],SingleClassItem:[2,268]},dialects:{jsx:12794,ts:12796},dynamicPrecedences:{76:1,78:1,163:1,191:1},specialized:[{term:313,get:r=>m0[r]||-1},{term:329,get:r=>g0[r]||-1},{term:67,get:r=>_0[r]||-1}],tokenPrec:12820});class St{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),Hr.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),Hr.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Eo(this),a=new Eo(e);for(let s=t,o=t;;){if(i.next(s),a.next(s),s=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new Eo(this,e)}iterRange(e,t=this.length){return new LT(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new MT(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?St.empty:e.length<=32?new Jt(e):Hr.from(Jt.split(e,[]))}}class Jt extends St{constructor(e,t=O0(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let a=0;;a++){let s=this.text[a],o=i+s.length;if((t?n:o)>=e)return new b0(i,o,n,s);i=o+1,n++}}decompose(e,t,n,i){let a=e<=0&&t>=this.length?this:new Jt(nS(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),o=ql(a.text,s.text.slice(),0,a.length);if(o.length<=32)n.push(new Jt(o,s.length+a.length));else{let l=o.length>>1;n.push(new Jt(o.slice(0,l)),new Jt(o.slice(l)))}}else n.push(a)}replace(e,t,n){if(!(n instanceof Jt))return super.replace(e,t,n);let i=ql(this.text,ql(n.text,nS(this.text,0,e)),t),a=this.length+n.length-(t-e);return i.length<=32?new Jt(i,a):Hr.from(Jt.split(i,[]),a)}sliceString(e,t=this.length,n=` `){let i="";for(let a=0,s=0;a<=t&&se&&s&&(i+=n),ea&&(i+=o.slice(Math.max(0,e-a),t-a)),a=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let a of e)n.push(a),i+=a.length+1,n.length==32&&(t.push(new Jt(n,i)),n=[],i=-1);return i>-1&&t.push(new Jt(n,i)),t}}class Hr extends St{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let a=0;;a++){let s=this.children[a],o=i+s.length,l=n+s.lines-1;if((t?l:o)>=e)return s.lineInner(e,t,n,i);i=o+1,n=l+1}}decompose(e,t,n,i){for(let a=0,s=0;s<=t&&a=s){let c=i&((s<=e?1:0)|(l>=t?2:0));s>=e&&l<=t&&!c?n.push(o):o.decompose(e-s,t-s,n,c)}s=l+1}}replace(e,t,n){if(n.lines=a&&t<=o){let l=s.replace(e-a,t-a,n),c=this.lines-s.lines+l.lines;if(l.lines>5-1&&l.lines>c>>5+1){let u=this.children.slice();return u[i]=l,new Hr(u,this.length-(t-e)+n.length)}return super.replace(a,o,l)}a=o+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){let i="";for(let a=0,s=0;ae&&a&&(i+=n),es&&(i+=o.sliceString(e-s,t-s,n)),s=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Hr))return 0;let n=0,[i,a,s,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,a+=t){if(i==s||a==o)return n;let l=this.children[i],c=e.children[a];if(l!=c)return n+l.scanIdentical(c,t);n+=l.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let _ of e)n+=_.lines;if(n<32){let _=[];for(let v of e)v.flatten(_);return new Jt(_,t)}let i=Math.max(32,n>>5),a=i<<1,s=i>>1,o=[],l=0,c=-1,u=[];function p(_){let v;if(_.lines>a&&_ instanceof Hr)for(let I of _.children)p(I);else _.lines>s&&(l>s||!l)?(m(),o.push(_)):_ instanceof Jt&&l&&(v=u[u.length-1])instanceof Jt&&_.lines+v.lines<=32?(l+=_.lines,c+=_.length+1,u[u.length-1]=new Jt(v.text.concat(_.text),v.length+1+_.length)):(l+_.lines>i&&m(),l+=_.lines,c+=_.length+1,u.push(_))}function m(){l!=0&&(o.push(u.length==1?u[0]:Hr.from(u,c)),c=-1,l=u.length=0)}for(let _ of e)p(_);return m(),o.length==1?o[0]:new Hr(o,t)}}St.empty=new Jt([""],0);function O0(r){let e=-1;for(let t of r)e+=t.length+1;return e}function ql(r,e,t=0,n=1e9){for(let i=0,a=0,s=!0;a=t&&(l>n&&(o=o.slice(0,n-i)),i0?1:(e instanceof Jt?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],a=this.offsets[n],s=a>>1,o=i instanceof Jt?i.text.length:i.children.length;if(s==(t>0?o:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(i instanceof Jt){let l=i.text[s+(t<0?-1:0)];if(this.offsets[n]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof Jt?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class LT{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Eo(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class MT{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(St.prototype[Symbol.iterator]=function(){return this.iter()},Eo.prototype[Symbol.iterator]=LT.prototype[Symbol.iterator]=MT.prototype[Symbol.iterator]=function(){return this});let b0=class{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}},ns="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(r=>r?parseInt(r,36):1);for(let r=1;rr)return ns[e-1]<=r;return!1}function rS(r){return r>=127462&&r<=127487}const iS=8205;function An(r,e,t=!0,n=!0){return(t?PT:v0)(r,e,n)}function PT(r,e,t){if(e==r.length)return e;e&&BT(r.charCodeAt(e))&&UT(r.charCodeAt(e-1))&&e--;let n=On(r,e);for(e+=mr(n);e=0&&rS(On(r,s));)a++,s-=2;if(a%2==0)break;e+=2}else break}return e}function v0(r,e,t){for(;e>0;){let n=PT(r,e-2,t);if(n=56320&&r<57344}function UT(r){return r>=55296&&r<56320}function On(r,e){let t=r.charCodeAt(e);if(!UT(t)||e+1==r.length)return t;let n=r.charCodeAt(e+1);return BT(n)?(t-55296<<10)+(n-56320)+65536:t}function Sg(r){return r<=65535?String.fromCharCode(r):(r-=65536,String.fromCharCode((r>>10)+55296,(r&1023)+56320))}function mr(r){return r<65536?1:2}const Zh=/\r\n?|\n/;var un=function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r}(un||(un={}));class Jr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return a+(e-i);a+=o}else{if(n!=un.Simple&&c>=e&&(n==un.TrackDel&&ie||n==un.TrackBefore&&ie))return null;if(c>e||c==e&&t<0&&!o)return e==i||t<0?a:a+l;a+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return a}touchesRange(e,t=e){for(let n=0,i=0;n=0&&i<=t&&o>=e)return it?"cover":!0;i=o}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Jr(e)}static create(e){return new Jr(e)}}class cn extends Jr{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Kh(this,(t,n,i,a,s)=>e=e.replace(i,i+(n-t),s),!1),e}mapDesc(e,t=!1){return jh(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,a=0;i=0){t[i]=o,t[i+1]=s;let l=i>>1;for(;n.length0&&Vi(n,t,a.text),a.forward(u),o+=u}let c=e[s++];for(;o>1].toJSON()))}return e}static of(e,t,n){let i=[],a=[],s=0,o=null;function l(u=!1){if(!u&&!i.length)return;sm||p<0||m>t)throw new RangeError(`Invalid change range ${p} to ${m} (in doc of length ${t})`);let v=_?typeof _=="string"?St.of(_.split(n||Zh)):_:St.empty,I=v.length;if(p==m&&I==0)return;ps&&yn(i,p-s,-1),yn(i,m-p,I),Vi(a,i,v),s=m}}return c(e),l(!o),o}static empty(e){return new cn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;io&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)t.push(a[0],0);else{for(;n.length=0&&t<=0&&t==r[i+1]?r[i]+=e:e==0&&r[i]==0?r[i+1]+=t:n?(r[i]+=e,r[i+1]+=t):r.push(e,t)}function Vi(r,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||s==r.sections.length||r.sections[s+1]<0);)o=r.sections[s++],l=r.sections[s++];e(i,c,a,u,p),i=c,a=u}}}function jh(r,e,t,n=!1){let i=[],a=n?[]:null,s=new Do(r),o=new Do(e);for(let l=-1;;)if(s.ins==-1&&o.ins==-1){let c=Math.min(s.len,o.len);yn(i,c,-1),s.forward(c),o.forward(c)}else if(o.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(o.len=0&&l=0){let c=0,u=s.len;for(;u;)if(o.ins==-1){let p=Math.min(u,o.len);c+=p,u-=p,o.forward(p)}else if(o.ins==0&&o.lenl||s.ins>=0&&s.len>l)&&(o||n.length>c),a.forward2(l),s.forward(l)}}}}class Do{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?St.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?St.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ha{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new ha(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return me.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return me.range(this.anchor,n)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return me.range(e.anchor,e.head)}static create(e,t,n){return new ha(e,t,n)}}class me{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:me.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new me(e.ranges.map(t=>ha.fromJSON(t)),e.main)}static single(e,t=e){return new me([me.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;ie?4:0)|a)}static normalized(e,t=0){let n=e[t];e.sort((i,a)=>i.from-a.from),t=e.indexOf(n);for(let i=1;ia.head?me.range(l,o):me.range(o,l))}}return new me(e,t)}}function YT(r,e){for(let t of r.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Og=0;class $e{constructor(e,t,n,i,a){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=Og++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}static define(e={}){return new $e(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:bg),!!e.static,e.enables)}of(e){return new Vl([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vl(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vl(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function bg(r,e){return r==e||r.length==e.length&&r.every((t,n)=>t===e[n])}class Vl{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=Og++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,a=this.id,s=e[a]>>1,o=this.type==2,l=!1,c=!1,u=[];for(let p of this.dependencies)p=="doc"?l=!0:p=="selection"?c=!0:((t=e[p.id])!==null&&t!==void 0?t:1)&1||u.push(e[p.id]);return{create(p){return p.values[s]=n(p),1},update(p,m){if(l&&m.docChanged||c&&(m.docChanged||m.selection)||Jh(p,u)){let _=n(p);if(o?!aS(_,p.values[s],i):!i(_,p.values[s]))return p.values[s]=_,1}return 0},reconfigure:(p,m)=>{let _,v=m.config.address[a];if(v!=null){let I=hc(m,v);if(this.dependencies.every(R=>R instanceof $e?m.facet(R)===p.facet(R):R instanceof Tn?m.field(R,!1)==p.field(R,!1):!0)||(o?aS(_=n(p),I,i):i(_=n(p),I)))return p.values[s]=I,0}else _=n(p);return p.values[s]=_,1}}}}function aS(r,e,t){if(r.length!=e.length)return!1;for(let n=0;nr[l.id]),i=t.map(l=>l.type),a=n.filter(l=>!(l&1)),s=r[e.id]>>1;function o(l){let c=[];for(let u=0;un===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(sS).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,i)=>{let a=n.values[t],s=this.updateF(a,i);return this.compareF(a,s)?0:(n.values[t]=s,1)},reconfigure:(n,i)=>i.config.address[this.id]!=null?(n.values[t]=i.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,sS.of({field:this,create:e})]}get extension(){return this}}const da={lowest:4,low:3,default:2,high:1,highest:0};function Js(r){return e=>new $T(e,r)}const Ti={highest:Js(da.highest),high:Js(da.high),default:Js(da.default),low:Js(da.low),lowest:Js(da.lowest)};class $T{constructor(e,t){this.inner=e,this.prec=t}}class zr{of(e){return new em(this,e)}reconfigure(e){return zr.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class em{constructor(e,t){this.compartment=e,this.inner=t}}class fc{constructor(e,t,n,i,a,s){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=a,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let i=[],a=Object.create(null),s=new Map;for(let m of C0(e,t,s))m instanceof Tn?i.push(m):(a[m.facet.id]||(a[m.facet.id]=[])).push(m);let o=Object.create(null),l=[],c=[];for(let m of i)o[m.id]=c.length<<1,c.push(_=>m.slot(_));let u=n==null?void 0:n.config.facets;for(let m in a){let _=a[m],v=_[0].facet,I=u&&u[m]||[];if(_.every(R=>R.type==0))if(o[v.id]=l.length<<1|1,bg(I,_))l.push(n.facet(v));else{let R=v.combine(_.map(x=>x.value));l.push(n&&v.compare(R,n.facet(v))?n.facet(v):R)}else{for(let R of _)R.type==0?(o[R.id]=l.length<<1|1,l.push(R.value)):(o[R.id]=c.length<<1,c.push(x=>R.dynamicSlot(x)));o[v.id]=c.length<<1,c.push(R=>T0(R,v,_))}}let p=c.map(m=>m(o));return new fc(e,s,p,o,l,a)}}function C0(r,e,t){let n=[[],[],[],[],[]],i=new Map;function a(s,o){let l=i.get(s);if(l!=null){if(l<=o)return;let c=n[l].indexOf(s);c>-1&&n[l].splice(c,1),s instanceof em&&t.delete(s.compartment)}if(i.set(s,o),Array.isArray(s))for(let c of s)a(c,o);else if(s instanceof em){if(t.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;t.set(s.compartment,c),a(c,o)}else if(s instanceof $T)a(s.inner,s.prec);else if(s instanceof Tn)n[o].push(s),s.provides&&a(s.provides,o);else if(s instanceof Vl)n[o].push(s),s.facet.extensions&&a(s.facet.extensions,da.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(c,o)}}return a(r,da.default),n.reduce((s,o)=>s.concat(o))}function vo(r,e){if(e&1)return 2;let t=e>>1,n=r.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;r.status[t]=4;let i=r.computeSlot(r,r.config.dynamicSlots[t]);return r.status[t]=2|i}function hc(r,e){return e&1?r.config.staticValues[e>>1]:r.values[e>>1]}const GT=$e.define(),QT=$e.define({combine:r=>r.some(e=>e),static:!0}),qT=$e.define({combine:r=>r.length?r[0]:void 0,static:!0}),VT=$e.define(),zT=$e.define(),HT=$e.define(),WT=$e.define({combine:r=>r.length?r[0]:!1});class Ci{constructor(e,t){this.type=e,this.value=t}static define(){return new y0}}class y0{of(e){return new Ci(this,e)}}class A0{constructor(e){this.map=e}of(e){return new ot(this,e)}}class ot{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new ot(this.type,t)}is(e){return this.type==e}static define(e={}){return new A0(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let a=i.map(t);a&&n.push(a)}return n}}ot.reconfigure=ot.define();ot.appendConfig=ot.define();class dn{constructor(e,t,n,i,a,s){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=a,this.scrollIntoView=s,this._doc=null,this._state=null,n&&YT(n,t.newLength),a.some(o=>o.type==dn.time)||(this.annotations=a.concat(dn.time.of(Date.now())))}static create(e,t,n,i,a,s){return new dn(e,t,n,i,a,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(dn.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}dn.time=Ci.define();dn.userEvent=Ci.define();dn.addToHistory=Ci.define();dn.remote=Ci.define();function I0(r,e){let t=[];for(let n=0,i=0;;){let a,s;if(n=r[n]))a=r[n++],s=r[n++];else if(i=0;i--){let a=n[i](r);a instanceof dn?r=a:Array.isArray(a)&&a.length==1&&a[0]instanceof dn?r=a[0]:r=ZT(e,rs(a),!1)}return r}function N0(r){let e=r.startState,t=e.facet(HT),n=r;for(let i=t.length-1;i>=0;i--){let a=t[i](r);a&&Object.keys(a).length&&(n=XT(n,tm(e,a,r.changes.newLength),!0))}return n==r?r:dn.create(e,r.changes,r.selection,n.effects,n.annotations,n.scrollIntoView)}const w0=[];function rs(r){return r==null?w0:Array.isArray(r)?r:[r]}var Yt=function(r){return r[r.Word=0]="Word",r[r.Space=1]="Space",r[r.Other=2]="Other",r}(Yt||(Yt={}));const D0=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let nm;try{nm=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function x0(r){if(nm)return nm.test(r);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||D0.test(t)))return!0}return!1}function k0(r){return e=>{if(!/\S/.test(e))return Yt.Space;if(x0(e))return Yt.Word;for(let t=0;t-1)return Yt.Word;return Yt.Other}}class _t{constructor(e,t,n,i,a,s){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=a,s&&(s._state=this);for(let o=0;oi.set(l,o)),t=null),i.set(s.value.compartment,s.value.extension)):s.is(ot.reconfigure)?(t=null,n=s.value):s.is(ot.appendConfig)&&(t=null,n=rs(n).concat(s.value));let a;t?a=e.startState.values.slice():(t=fc.resolve(n,i,this),a=new _t(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(o,l)=>l.reconfigure(o,this),null).values),new _t(t,e.newDoc,e.newSelection,a,(s,o)=>o.update(s,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:me.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),a=[n.range],s=rs(n.effects);for(let o=1;os.spec.fromJSON(o,l)))}}return _t.create({doc:e.doc,selection:me.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=fc.resolve(e.extensions||[],new Map),n=e.doc instanceof St?e.doc:St.of((e.doc||"").split(t.staticFacet(_t.lineSeparator)||Zh)),i=e.selection?e.selection instanceof me?e.selection:me.single(e.selection.anchor,e.selection.head):me.single(0);return YT(i,n.length),t.staticFacet(QT)||(i=i.asSingle()),new _t(t,n,i,t.dynamicSlots.map(()=>null),(a,s)=>s.create(a),null)}get tabSize(){return this.facet(_t.tabSize)}get lineBreak(){return this.facet(_t.lineSeparator)||` @@ -366,6 +366,7 @@ scope({ orientation: "horizontal", // "vertical" or "horizontal" is3D: false, // 3D oscilloscope size: 1, // size of the oscilloscope + refresh: 1 // refresh rate (in pulses) }) `,!0)} @@ -2900,4 +2901,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),le=Q,ue=j),K===void 0& `+c.line+" | "+_+` `+m+" | "+t("",l.column-1," ")+t("",I,"^")}else a+=` at `+u}return a},e.buildMessage=function(i,a){var s={literal:function(_){return'"'+l(_.text)+'"'},class:function(_){var v=_.parts.map(function(I){return Array.isArray(I)?c(I[0])+"-"+c(I[1]):c(I)});return"["+(_.inverted?"^":"")+v.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(_){return _.description}};function o(_){return _.charCodeAt(0).toString(16).toUpperCase()}function l(_){return _.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(v){return"\\x0"+o(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+o(v)})}function c(_){return _.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(v){return"\\x0"+o(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+o(v)})}function u(_){return s[_.type](_)}function p(_){var v=_.map(u),I,R;if(v.sort(),v.length>0){for(I=1,R=1;I",R="@",x=":",$="/",Z="(",h=")",b="[:",S="]",N="[",k="{",L="}",M="+",G="*",te="%",re="^",ne="&",ee=">>",B="<<",Q="_",j="?",K="!",ue="r",le="#",be="b",De="iii",xe="ii",Ee="iv",Ne="i",ce="vii",Le="vi",Xe="v",Be=/^[0-9]/,tt=/^[ \n\r\t]/,rt=/^[a-z]/,ht=/^[a-z_]/,vt=/^[a-z_0-9]/,mt=/^[mklpdcwyhnqaefsxtgujzo]/,At=/^[a-zA-Z0-9]/,Nt=/^[a-zA-Z0-9\-*+]/,Rn=/^[A-G]/,qe=/^[bs]/,rn=st("-",!1),Ze=Kn([["0","9"]],!1,!1),ke=st(".",!1),en=Hs("whitespace"),Zt=Kn([" ",` -`,"\r"," "],!1,!1),an=st(",",!1),H=st("|",!1),fe=Kn([["a","z"]],!1,!1),Ie=Kn([["a","z"],"_"],!1,!1),we=Kn([["a","z"],"_",["0","9"]],!1,!1),Je=st("<",!1),ye=st(">",!1),Ht=st("@",!1),lt=st(":",!1),yt=Kn(["m","k","l","p","d","c","w","y","h","n","q","a","e","f","s","x","t","g","u","j","z","o"],!1,!1),zn=st("/",!1),dt=st("(",!1),Kt=st(")",!1),Tt=st("[:",!1),Ue=st("]",!1),Fn=st("[",!1),Fr=st("{",!1),ct=st("}",!1),Hn=st("+",!1),Nn=st("*",!1),Ii=st("%",!1),wn=st("^",!1),Wt=st("&",!1),Cr=st(">>",!1),ta=st("<<",!1),oi=st("_",!1),na=st("?",!1),cr=st("!",!1),li=st("r",!1),yr=Kn([["a","z"],["A","Z"],["0","9"]],!1,!1),jt=st("#",!1),ci=st("b",!1),ui=Kn([["a","z"],["A","Z"],["0","9"],"-","*","+"],!1,!1),q=Kn([["A","G"]],!1,!1),ie=Kn(["b","s"],!1,!1),de=st("iii",!1),_e=st("ii",!1),Ae=st("iv",!1),Qe=st("i",!1),Pe=st("vii",!1),Ct=st("vi",!1),Dn=st("v",!1),Wn=function(T){return T.filter(w=>w)},xa=function(){return parseFloat($n())},ra=function(){return parseInt($n())},xs=function(){return parseInt($n())},Xn=function(){},ks=function(T){return Ut(pG,{sound:T})},ka=function(){return $n()},La=function(T){return Ut(Io,{items:T})},Ls=function(T){return T},Ma=function(T,w){return Ut(fG,{item:T,sound:w})},Ms=function(T,w){return Ut(hG,{item:T,soundIndex:w})},Pa=function(T){return T},Yn=function(){return tG[$n()]},Ps=function(T,w){return T/w},Bs=function(T){return T.filter(w=>w)},Ba=function(T){return Ut(Io,{items:T})},Ua=function(T,w){return w?Ut(mT,{item:T,times:w}):Ut(gT,{items:T})},Us=function(T){return T},Fa=function(T,w,P){return Ut(OG,{left:T,operation:w,right:P})},Fs=function(T,w){return Ut(SG,{items:T,times:w})},Ya=function(T){return Ut(sR,{items:T})},Ys=function(T){return T.map(w=>typeof w=="number"?w:void 0)},$s=function(){return Math.ceil(iR($n()))},ur=function(T){var w=T.filter(P=>P).map(P=>Ut(ni,{pitch:P[0]},P.toString()));return Ut(gT,{items:w})},Ot=function(T){return T},Gs=function(T){return T},Ri=function(){},Qs=function(T){return Ut(Io,{items:T})},di=function(T){return Ut(gG,{octave:T})},qs=function(){return $n().split("").reduce((T,w)=>T+(w==="^"?1:-1),0)},Ni=function(){return Ut(Gc,{seededRandom:a.seededRandom})},$a=function(T,w){return Ut(Gc,{min:T,max:w,seededRandom:a.seededRandom})},Ga=function(T,w){return Ut(mT,{item:T,times:w})},Vs=function(T){return Ut(_G,{duration:T})},wi=function(T){return T},Qa=function(T){return Ut(Jm,{duration:T})},Di=function(T,w,P,X){const oe=T?a.nodeOptions.octave+T:a.nodeOptions.octave;return Ut(ni,{duration:w,pitch:X,pitchOctave:oe,add:P})},xi=function(T){return T.reduce((w,P)=>w+(P==="#"?1:-1),0)},qa=function(T,w,P){return Ut(Na,{pitches:[T].concat(w),inversion:P})},ia=function(){return $n()},pi=function(T){return T},_n=function(){return $n()},Va=function(T,w,P,X,oe){const ve=a.nodeOptions.scaleName?a.nodeOptions.scaleName:"MAJOR",ft=a.nodeOptions.key?a.nodeOptions.key:"C",fr=RG(X,P,ve,T,w),Ks=w||a.nodeOptions.duration,DR=T?a.nodeOptions.octave+T:a.nodeOptions.octave;return Ut(Na,{duration:Ks,chordOctave:DR,pitches:fr,chordName:X,inversion:oe,scaleName:ve,key:ft})},Zn=function(T,w,P){const X=a.nodeOptions.scaleName?a.nodeOptions.scaleName:"MAJOR",oe=a.nodeOptions.key?a.nodeOptions.key:"C";return Ut(mG,{roman:T,chordName:w,inversion:P,scaleName:X,key:oe})},aa=function(T){const w=a.nodeOptions.scaleName?a.nodeOptions.scaleName:"MAJOR",P=a.nodeOptions.key?a.nodeOptions.key:"C",X=BG(T,P,w);return Ut(ni,{pitch:X.pc,add:X.add,scaleName:w,key:P})},A=0,He=0,za=[{line:1,column:1}],dr=0,zs=[],Oe=0,ge={},sa;if("startRule"in a){if(!(a.startRule in l))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');c=l[a.startRule]}function $n(){return i.substring(He,A)}function dl(){return d(He,A)}function st(T,w){return{type:"literal",text:T,ignoreCase:w}}function Kn(T,w,P){return{type:"class",parts:T,inverted:w,ignoreCase:P}}function pl(){return{type:"end"}}function Hs(T){return{type:"other",description:T}}function fl(T){var w=za[T],P;if(w)return w;for(P=T-1;!za[P];)P--;for(w=za[P],w={line:w.line,column:w.column};Pdr&&(dr=A,zs=[]),zs.push(T))}function g(T,w,P){return new e(e.buildMessage(T,w),T,w,P)}function O(){var T,w,P=A*56+0,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=Xt(),w!==s&&(He=T,w=Wn(w)),T=w,ge[P]={nextPos:A,result:T},T)}function C(){var T,w,P,X,oe,ve,ft,fr=A*56+1,Ks=ge[fr];if(Ks)return A=Ks.nextPos,Ks.result;for(T=A,w=A,i.charCodeAt(A)===45?(P=u,A++):(P=s,Oe===0&&f(rn)),P===s&&(P=null),X=[],Be.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(Ze));oe!==s;)X.push(oe),Be.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(Ze));if(i.charCodeAt(A)===46?(oe=p,A++):(oe=s,Oe===0&&f(ke)),oe!==s){if(ve=[],Be.test(i.charAt(A))?(ft=i.charAt(A),A++):(ft=s,Oe===0&&f(Ze)),ft!==s)for(;ft!==s;)ve.push(ft),Be.test(i.charAt(A))?(ft=i.charAt(A),A++):(ft=s,Oe===0&&f(Ze));else ve=s;ve!==s?(P=[P,X,oe,ve],w=P):(A=w,w=s)}else A=w,w=s;if(w===s)if(w=A,i.charCodeAt(A)===46?(P=p,A++):(P=s,Oe===0&&f(ke)),P!==s){if(X=[],Be.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(Ze)),oe!==s)for(;oe!==s;)X.push(oe),Be.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(Ze));else X=s;X!==s?(P=[P,X],w=P):(A=w,w=s)}else A=w,w=s;return w!==s&&(He=T,w=xa()),T=w,ge[fr]={nextPos:A,result:T},T}function y(){var T,w,P=A*56+2,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,i.charCodeAt(A)===45?A++:Oe===0&&f(rn),Be.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(Ze)),w!==s?(He=T,T=ra()):(A=T,T=s),ge[P]={nextPos:A,result:T},T)}function D(){var T,w,P,X=A*56+3,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,i.charCodeAt(A)===45?A++:Oe===0&&f(rn),w=[],Be.test(i.charAt(A))?(P=i.charAt(A),A++):(P=s,Oe===0&&f(Ze)),P!==s)for(;P!==s;)w.push(P),Be.test(i.charAt(A))?(P=i.charAt(A),A++):(P=s,Oe===0&&f(Ze));else w=s;return w!==s?(He=T,T=xs()):(A=T,T=s),ge[X]={nextPos:A,result:T},T}function F(){var T,w,P=A*56+4,X=ge[P];return X?(A=X.nextPos,X.result):(Oe++,T=A,tt.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(Zt)),w!==s&&(He=T,w=Xn()),T=w,Oe--,T===s&&(w=s,Oe===0&&f(en)),ge[P]={nextPos:A,result:T},T)}function U(){var T,w,P=A*56+8,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=W(),w!==s&&(He=T,w=ks(w)),T=w,ge[P]={nextPos:A,result:T},T)}function W(){var T,w,P,X,oe,ve=A*56+10,ft=ge[ve];if(ft)return A=ft.nextPos,ft.result;if(T=A,rt.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(fe)),w!==s){if(P=[],ht.test(i.charAt(A))?(X=i.charAt(A),A++):(X=s,Oe===0&&f(Ie)),X!==s)for(;X!==s;)P.push(X),ht.test(i.charAt(A))?(X=i.charAt(A),A++):(X=s,Oe===0&&f(Ie));else P=s;if(P!==s){for(X=[],vt.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(we));oe!==s;)X.push(oe),vt.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(we));He=T,T=ka()}else A=T,T=s}else A=T,T=s;return ge[ve]={nextPos:A,result:T},T}function z(){var T,w=A*56+11,P=ge[w];return P?(A=P.nextPos,P.result):(T=pe(),T===s&&(T=he()),ge[w]={nextPos:A,result:T},T)}function pe(){var T,w,P,X,oe=A*56+12,ve=ge[oe];if(ve)return A=ve.nextPos,ve.result;if(T=A,i.charCodeAt(A)===60?(w=v,A++):(w=s,Oe===0&&f(Je)),w!==s){if(P=[],X=z(),X!==s)for(;X!==s;)P.push(X),X=z();else P=s;P!==s?(i.charCodeAt(A)===62?(X=I,A++):(X=s,Oe===0&&f(ye)),X!==s?(He=T,T=La(P)):(A=T,T=s)):(A=T,T=s)}else A=T,T=s;return ge[oe]={nextPos:A,result:T},T}function he(){var T,w=A*56+13,P=ge[w];return P?(A=P.nextPos,P.result):(T=W(),T===s&&(T=pe(),T===s&&(T=F())),ge[w]={nextPos:A,result:T},T)}function se(){var T,w,P,X=A*56+14,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,i.charCodeAt(A)===64?(w=R,A++):(w=s,Oe===0&&f(Ht)),w!==s?(P=z(),P!==s?(He=T,T=Ls(P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function ae(){var T,w=A*56+15,P=ge[w];return P?(A=P.nextPos,P.result):(T=sn(),T===s&&(T=it(),T===s&&(T=qt(),T===s&&(T=du(),T===s&&(T=Qt())))),ge[w]={nextPos:A,result:T},T)}function Ce(){var T,w,P,X=A*56+16,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,w=ae(),w===s&&(w=Zs()),w!==s?(P=se(),P!==s?(He=T,T=Ma(w,P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function Se(){var T,w,P,X=A*56+17,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,w=Ce(),w===s&&(w=ae(),w===s&&(w=Zs())),w!==s?(P=Ve(),P!==s?(He=T,T=Ms(w,P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function Ve(){var T,w,P,X=A*56+18,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,i.charCodeAt(A)===58?(w=x,A++):(w=s,Oe===0&&f(lt)),w!==s?(P=wt(),P!==s?(He=T,T=Pa(P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function je(){var T,w,P=A*56+19,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,mt.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(yt)),w!==s&&(He=T,w=Yn()),T=w,ge[P]={nextPos:A,result:T},T)}function Fe(){var T,w=A*56+20,P=ge[w];return P?(A=P.nextPos,P.result):(T=It(),T===s&&(T=C(),T===s&&(T=je())),ge[w]={nextPos:A,result:T},T)}function It(){var T,w,P,X,oe=A*56+21,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,w=D(),w!==s?(i.charCodeAt(A)===47?(P=$,A++):(P=s,Oe===0&&f(zn)),P!==s?(X=D(),X!==s?(He=T,T=Ps(w,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function Xt(){var T,w,P,X=A*56+22,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],P=N_(),P===s&&(P=Se(),P===s&&(P=Ce(),P===s&&(P=sn(),P===s&&(P=qt(),P===s&&(P=it(),P===s&&(P=Qt(),P===s&&(P=Zs(),P===s&&(P=du())))))))),P!==s)for(;P!==s;)w.push(P),P=N_(),P===s&&(P=Se(),P===s&&(P=Ce(),P===s&&(P=sn(),P===s&&(P=qt(),P===s&&(P=it(),P===s&&(P=Qt(),P===s&&(P=Zs(),P===s&&(P=du()))))))));else w=s;return w!==s&&(He=T,w=Bs(w)),T=w,ge[X]={nextPos:A,result:T},T}function wt(){var T,w=A*56+23,P=ge[w];return P?(A=P.nextPos,P.result):(T=F(),T===s&&(T=D(),T===s&&(T=R_(),T===s&&(T=fu(),T===s&&(T=tn(),T===s&&(T=A_()))))),ge[w]={nextPos:A,result:T},T)}function tn(){var T,w,P,X,oe=A*56+24,ve=ge[oe];if(ve)return A=ve.nextPos,ve.result;if(T=A,i.charCodeAt(A)===60?(w=v,A++):(w=s,Oe===0&&f(Je)),w!==s){if(P=[],X=wt(),X!==s)for(;X!==s;)P.push(X),X=wt();else P=s;P!==s?(i.charCodeAt(A)===62?(X=I,A++):(X=s,Oe===0&&f(ye)),X!==s?(He=T,T=Ba(P)):(A=T,T=s)):(A=T,T=s)}else A=T,T=s;return ge[oe]={nextPos:A,result:T},T}function it(){var T,w,P,X,oe,ve=A*56+25,ft=ge[ve];return ft?(A=ft.nextPos,ft.result):(T=A,i.charCodeAt(A)===40?(w=Z,A++):(w=s,Oe===0&&f(dt)),w!==s?(i.charCodeAt(A)===58?A++:Oe===0&&f(lt),P=Xt(),P!==s?(X=pt(),X===s&&(X=null),i.charCodeAt(A)===41?(oe=h,A++):(oe=s,Oe===0&&f(Kt)),oe!==s?(He=T,T=Ua(P,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[ve]={nextPos:A,result:T},T)}function pt(){var T,w,P,X=A*56+26,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,i.charCodeAt(A)===58?(w=x,A++):(w=s,Oe===0&&f(lt)),w!==s?(P=D(),P!==s?(He=T,T=Us(P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function sn(){var T,w,P,X,oe=A*56+27,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,w=it(),w!==s?(P=I_(),P!==s?(X=it(),X!==s?(He=T,T=Fa(w,P,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function Qt(){var T,w,P,X,oe,ve=A*56+28,ft=ge[ve];return ft?(A=ft.nextPos,ft.result):(T=A,i.substr(A,2)===b?(w=b,A+=2):(w=s,Oe===0&&f(Tt)),w!==s?(P=Xt(),P!==s?(X=pt(),X===s&&(X=null),i.charCodeAt(A)===93?(oe=S,A++):(oe=s,Oe===0&&f(Ue)),oe!==s?(He=T,T=Fs(P,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[ve]={nextPos:A,result:T},T)}function qt(){var T,w,P,X,oe=A*56+29,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.charCodeAt(A)===91?(w=N,A++):(w=s,Oe===0&&f(Fn)),w!==s?(P=Xt(),P!==s?(i.charCodeAt(A)===93?(X=S,A++):(X=s,Oe===0&&f(Ue)),X!==s?(He=T,T=Ya(P)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function pr(){var T,w=A*56+30,P=ge[w];return P?(A=P.nextPos,P.result):(T=D(),T===s&&(T=y()),ge[w]={nextPos:A,result:T},T)}function Ws(){var T,w,P,X=A*56+31,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],P=hl(),P===s&&(P=pr()),P!==s)for(;P!==s;)w.push(P),P=hl(),P===s&&(P=pr());else w=s;return w!==s&&(He=T,w=Ys(w)),T=w,ge[X]={nextPos:A,result:T},T}function hl(){var T,w,P,X,oe=A*56+32,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.charCodeAt(A)===40?A++:Oe===0&&f(dt),w=pr(),w!==s?(P=I_(),P!==s?(X=Ws(),X!==s?(i.charCodeAt(A)===41?A++:Oe===0&&f(Kt),He=T,T=$s()):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function Xs(){var T,w,P,X,oe=A*56+33,ve=ge[oe];if(ve)return A=ve.nextPos,ve.result;if(T=A,i.charCodeAt(A)===123?(w=k,A++):(w=s,Oe===0&&f(Fr)),w!==s){if(P=[],X=Ws(),X===s&&(X=F()),X!==s)for(;X!==s;)P.push(X),X=Ws(),X===s&&(X=F());else P=s;P!==s?(i.charCodeAt(A)===125?(X=L,A++):(X=s,Oe===0&&f(ct)),X!==s?(He=T,T=ur(P)):(A=T,T=s)):(A=T,T=s)}else A=T,T=s;return ge[oe]={nextPos:A,result:T},T}function A_(){var T,w,P,X,oe=A*56+34,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.charCodeAt(A)===123?(w=k,A++):(w=s,Oe===0&&f(Fr)),w!==s?(P=D(),P===s&&(P=fu()),P!==s?(i.charCodeAt(A)===125?(X=L,A++):(X=s,Oe===0&&f(ct)),X!==s?(He=T,T=Ot(P)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function I_(){var T,w=A*56+35,P=ge[w];return P?(A=P.nextPos,P.result):(i.charCodeAt(A)===43?(T=M,A++):(T=s,Oe===0&&f(Hn)),T===s&&(i.charCodeAt(A)===45?(T=u,A++):(T=s,Oe===0&&f(rn)),T===s&&(i.charCodeAt(A)===42?(T=G,A++):(T=s,Oe===0&&f(Nn)),T===s&&(i.charCodeAt(A)===47?(T=$,A++):(T=s,Oe===0&&f(zn)),T===s&&(i.charCodeAt(A)===37?(T=te,A++):(T=s,Oe===0&&f(Ii)),T===s&&(i.charCodeAt(A)===94?(T=re,A++):(T=s,Oe===0&&f(wn)),T===s&&(i.charCodeAt(A)===124?(T=_,A++):(T=s,Oe===0&&f(H)),T===s&&(i.charCodeAt(A)===38?(T=ne,A++):(T=s,Oe===0&&f(Wt)),T===s&&(i.substr(A,2)===ee?(T=ee,A+=2):(T=s,Oe===0&&f(Cr)),T===s&&(i.substr(A,2)===B?(T=B,A+=2):(T=s,Oe===0&&f(ta))))))))))),ge[w]={nextPos:A,result:T},T)}function Zs(){var T,w,P=A*56+36,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=yR(),w===s&&(w=NR(),w===s&&(w=RR(),w===s&&(w=wR(),w===s&&(w=U(),w===s&&(w=IR(),w===s&&(w=ml(),w===s&&(w=vR(),w===s&&(w=F(),w===s&&(w=TR(),w===s&&(w=it(),w===s&&(w=Xs(),w===s&&(w=ER())))))))))))),w!==s&&(He=T,w=Gs(w)),T=w,ge[P]={nextPos:A,result:T},T)}function ER(){var T,w,P=A*56+37,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,i.charCodeAt(A)===124?(w=_,A++):(w=s,Oe===0&&f(H)),w!==s&&(He=T,w=Ri()),T=w,ge[P]={nextPos:A,result:T},T)}function du(){var T,w,P,X,oe=A*56+38,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.charCodeAt(A)===60?(w=v,A++):(w=s,Oe===0&&f(Je)),w!==s?(P=Xt(),P!==s?(i.charCodeAt(A)===62?(X=I,A++):(X=s,Oe===0&&f(ye)),X!==s?(He=T,T=Qs(P)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function vR(){var T,w,P=A*56+39,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=pu(),w!==s&&(He=T,w=di(w)),T=w,ge[P]={nextPos:A,result:T},T)}function pu(){var T,w,P,X=A*56+40,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],i.charCodeAt(A)===94?(P=re,A++):(P=s,Oe===0&&f(wn)),P===s&&(i.charCodeAt(A)===95?(P=Q,A++):(P=s,Oe===0&&f(oi))),P!==s)for(;P!==s;)w.push(P),i.charCodeAt(A)===94?(P=re,A++):(P=s,Oe===0&&f(wn)),P===s&&(i.charCodeAt(A)===95?(P=Q,A++):(P=s,Oe===0&&f(oi)));else w=s;return w!==s&&(He=T,w=qs()),T=w,ge[X]={nextPos:A,result:T},T}function R_(){var T,w,P=A*56+41,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,i.charCodeAt(A)===63?(w=j,A++):(w=s,Oe===0&&f(na)),w!==s&&(He=T,w=Ni()),T=w,ge[P]={nextPos:A,result:T},T)}function fu(){var T,w,P,X,oe,ve,ft=A*56+42,fr=ge[ft];return fr?(A=fr.nextPos,fr.result):(T=A,i.charCodeAt(A)===40?(w=Z,A++):(w=s,Oe===0&&f(dt)),w!==s?(P=D(),P!==s?(i.charCodeAt(A)===44?(X=m,A++):(X=s,Oe===0&&f(an)),X!==s?(oe=D(),oe!==s?(i.charCodeAt(A)===41?(ve=h,A++):(ve=s,Oe===0&&f(Kt)),ve!==s?(He=T,T=$a(P,oe)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[ft]={nextPos:A,result:T},T)}function N_(){var T,w,P,X,oe=A*56+43,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,w=Se(),w===s&&(w=Ce(),w===s&&(w=ae(),w===s&&(w=Zs()))),w!==s?(i.charCodeAt(A)===33?(P=K,A++):(P=s,Oe===0&&f(cr)),P!==s?(X=D(),X!==s?(He=T,T=Ga(w,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function TR(){var T,w,P=A*56+44,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=Fe(),w!==s&&(He=T,w=Vs(w)),T=w,ge[P]={nextPos:A,result:T},T)}function CR(){var T,w,P,X=A*56+45,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,w=Fe(),w!==s?(i.charCodeAt(A)===94?(P=re,A++):(P=s,Oe===0&&f(wn)),P!==s?(He=T,T=wi(w)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function yR(){var T,w,P,X,oe,ve=A*56+46,ft=ge[ve];return ft?(A=ft.nextPos,ft.result):(T=A,w=CR(),w===s&&(w=null),i.charCodeAt(A)===114?(P=ue,A++):(P=s,Oe===0&&f(li)),P!==s?(X=A,Oe++,At.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(yr)),Oe--,oe===s?X=void 0:(A=X,X=s),X!==s?(He=T,T=Qa(w)):(A=T,T=s)):(A=T,T=s),ge[ve]={nextPos:A,result:T},T)}function ml(){var T,w,P,X,oe,ve=A*56+47,ft=ge[ve];return ft?(A=ft.nextPos,ft.result):(T=A,w=pu(),w===s&&(w=null),P=Fe(),P===s&&(P=null),X=AR(),X===s&&(X=null),oe=y(),oe===s&&(oe=R_(),oe===s&&(oe=fu(),oe===s&&(oe=A_()))),oe!==s?(He=T,T=Di(w,P,X,oe)):(A=T,T=s),ge[ve]={nextPos:A,result:T},T)}function AR(){var T,w,P,X=A*56+48,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],i.charCodeAt(A)===35?(P=le,A++):(P=s,Oe===0&&f(jt)),P===s&&(i.charCodeAt(A)===98?(P=be,A++):(P=s,Oe===0&&f(ci))),P!==s)for(;P!==s;)w.push(P),i.charCodeAt(A)===35?(P=le,A++):(P=s,Oe===0&&f(jt)),P===s&&(i.charCodeAt(A)===98?(P=be,A++):(P=s,Oe===0&&f(ci)));else w=s;return w!==s&&(He=T,w=xi(w)),T=w,ge[X]={nextPos:A,result:T},T}function IR(){var T,w,P,X,oe=A*56+49,ve=ge[oe];if(ve)return A=ve.nextPos,ve.result;if(T=A,w=ml(),w!==s){if(P=[],X=ml(),X!==s)for(;X!==s;)P.push(X),X=ml();else P=s;P!==s?(X=hu(),X===s&&(X=null),He=T,T=qa(w,P,X)):(A=T,T=s)}else A=T,T=s;return ge[oe]={nextPos:A,result:T},T}function w_(){var T,w,P,X=A*56+50,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],Nt.test(i.charAt(A))?(P=i.charAt(A),A++):(P=s,Oe===0&&f(ui)),P!==s)for(;P!==s;)w.push(P),Nt.test(i.charAt(A))?(P=i.charAt(A),A++):(P=s,Oe===0&&f(ui));else w=s;return w!==s&&(He=T,w=ia()),T=w,ge[X]={nextPos:A,result:T},T}function hu(){var T,w,P,X=A*56+51,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,i.charCodeAt(A)===37?(w=te,A++):(w=s,Oe===0&&f(Ii)),w!==s?(P=D(),P!==s?(He=T,T=pi(P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function D_(){var T,w,P=A*56+52,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,Rn.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(q)),w!==s?(qe.test(i.charAt(A))?(i.charAt(A),A++):Oe===0&&f(ie),He=T,T=_n()):(A=T,T=s),ge[P]={nextPos:A,result:T},T)}function RR(){var T,w,P,X,oe,ve,ft=A*56+53,fr=ge[ft];return fr?(A=fr.nextPos,fr.result):(T=A,w=pu(),w===s&&(w=null),P=Fe(),P===s&&(P=null),X=D_(),X!==s?(i.charCodeAt(A)===94?A++:Oe===0&&f(wn),oe=w_(),oe!==s?(ve=hu(),ve===s&&(ve=null),He=T,T=Va(w,P,X,oe,ve)):(A=T,T=s)):(A=T,T=s),ge[ft]={nextPos:A,result:T},T)}function NR(){var T,w,P,X,oe=A*56+54,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.substr(A,3)===De?(w=De,A+=3):(w=s,Oe===0&&f(de)),w===s&&(i.substr(A,2)===xe?(w=xe,A+=2):(w=s,Oe===0&&f(_e)),w===s&&(i.substr(A,2)===Ee?(w=Ee,A+=2):(w=s,Oe===0&&f(Ae)),w===s&&(i.charCodeAt(A)===105?(w=Ne,A++):(w=s,Oe===0&&f(Qe)),w===s&&(i.substr(A,3)===ce?(w=ce,A+=3):(w=s,Oe===0&&f(Pe)),w===s&&(i.substr(A,2)===Le?(w=Le,A+=2):(w=s,Oe===0&&f(Ct)),w===s&&(i.charCodeAt(A)===118?(w=Xe,A++):(w=s,Oe===0&&f(Dn)))))))),w!==s?(i.charCodeAt(A)===94?A++:Oe===0&&f(wn),P=w_(),P===s&&(P=null),X=hu(),X===s&&(X=null),He=T,T=Zn(w,P,X)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function wR(){var T,w,P=A*56+55,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=D_(),w!==s&&(He=T,w=aa(w)),T=w,ge[P]={nextPos:A,result:T},T)}var x_=a.nodeOptions||{};function Ut(T,w,P=void 0){w.text=P||$n(),w.location=dl();for(var X in x_)(w[X]===void 0||w[X]===null)&&(w[X]=x_[X]);return new T(w)}if(sa=c(),sa!==s&&A===i.length)return sa;throw sa!==s&&Ae.collect("pitch"))}notes(){return this.evaluated.map(e=>e.collect("note"))}sounds(){return this.evaluated.map(e=>e.collect("sound"))}indices(){return this.evaluated.map(e=>e.collect("soundIndex"))}freqs(){return this.evaluated.map(e=>e.collect("freq"))}durations(){return this.evaluated.map(e=>e.collect("duration"))}octaves(){return this.evaluated.map(e=>e.collect("octave"))}retrograde(){return this.evaluated=this.evaluated.reverse(),this}scale(e){return this.applyOptions({scale:e}),this}key(e){return this.applyOptions({key:e}),this}octave(e){return this.applyOptions({octave:e}),this}invert(e){return this.applyOptions({inversion:e}),this}isInOptions(e,t){return this.options.nodeOptions&&this.options.nodeOptions[e]===t}atLast(){return this.index+1>=this.evaluated.length*this.redo}clone(){return ti(this)}notStarted(){return this.index<0}peek(){return this.evaluated[this.index-1||0]}hasStarted(){return this.index>=0}next(){this.index<0&&(this.index=0);const e=this.evaluated[this.index%this.evaluated.length];return this.index++,this.counter++,this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.index=0,this.evaluated=this.evaluate(this.values)),e}applyOptions(e={}){this.evaluated=this.evaluate(this.evaluated,e),this.applyTransformations()}applyTransformations(){var e;(e=this.globalOptions)!=null&&e.retrograde&&(this.evaluated=this.evaluated.reverse())}update(){return this.evaluated=this.evaluate(this.values),this.applyTransformations(),this}evaluate(e,t={}){let n=e.map(i=>i.evaluate(t)).flat(1/0).filter(i=>i!==void 0);return t.subdivisions&&(n=fR(n)),n}totalDuration(){return this.evaluated.reduce((t,n)=>t+n.collect("duration"),0)}lead(){let e=this.evaluated.findIndex(t=>t instanceof Na);if(e>=0){for(let t=e+1;t<=this.evaluated.length;t++)if(this.evaluated[t]instanceof Na){const n=this.evaluated[e],i=this.evaluated[t],a=FG(n.notes(),i.notes()),s=ti(i);s.voiceLeadFromNotes(a,this.options.nodeOptions),this.evaluated[t]=s,e=t}}return this}}const fR=(r,e=void 0)=>r.map(n=>{if(n instanceof sR){const i=n.evaluated.length,a=(e||n.duration)/i;return fR(n.evaluated,a)}else return n.duration=e||n.duration,n}).flat(1/0),GG=r=>{let e={};return dG.forEach(t=>{if(r[t]!==void 0){const n=r[t];e[t]=n,delete r[t]}}),e};class QG{constructor(e,t){E(this,"api");E(this,"settings");E(this,"midiAccess",null);E(this,"midiOutputs",[]);E(this,"currentOutputIndex",0);E(this,"scheduledNotes",{});E(this,"midiInputs",[]);E(this,"currentInputIndex");E(this,"bufferLength",512);E(this,"noteInputBuffer",[]);E(this,"ccInputBuffer",[]);E(this,"activeNotes",[]);E(this,"stickyNotes",[]);E(this,"lastNote");E(this,"lastCC",{});E(this,"lastNoteInChannel",{});E(this,"lastCCInChannel",{});E(this,"midiClockInputIndex");E(this,"midiClockInput");E(this,"lastTimestamp",0);E(this,"midiClockDelta",0);E(this,"lastBPM");E(this,"roundedBPM",0);E(this,"clockBuffer",[]);E(this,"clockBufferLength",24);E(this,"clockTicks",0);E(this,"clockErrorCount",0);E(this,"skipOnError",0);this.api=e,this.settings=t,this.lastBPM=e.bpm(),this.roundedBPM=this.lastBPM,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."),this.currentOutputIndex=-1),this.midiInputs=Array.from(this.midiAccess.inputs.values()),this.midiInputs.length===0?console.warn("No MIDI inputs available."):this.updateInputSelects()}catch(e){console.error("Failed to initialize MIDI:",e)}}getCurrentMidiPort(){return this.midiOutputs.length>0&&this.currentOutputIndex>=0&&this.currentOutputIndex0&&this.currentOutputIndex>=0&&this.currentOutputIndex0){const e=document.getElementById("midi-clock-input"),t=document.getElementById("default-midi-input");e.innerHTML="",t.innerHTML="";const n=document.createElement("option");n.value="-1",n.text="Internal",e.appendChild(n);const i=document.createElement("option");if(i.value="-1",i.text="None",t.appendChild(i),this.midiInputs.forEach((a,s)=>{const o=document.createElement("option");o.value=s.toString(),o.text=a.name||s.toString(),e.appendChild(o),t.appendChild(o.cloneNode(!0))}),this.settings.midi_clock_input){const a=this.getMidiInputIndex(this.settings.midi_clock_input);e.value=a.toString(),a>0&&(this.midiClockInput=this.midiInputs[a],this.registerMidiInputListener(a))}else e.value="-1";if(this.settings.default_midi_input){const a=this.getMidiInputIndex(this.settings.default_midi_input);t.value=a.toString(),a>0&&(this.currentInputIndex=a,this.registerMidiInputListener(a))}else t.value="-1";e.addEventListener("change",a=>{const s=a.target.value;if(s==="-1")this.midiClockInput&&this.midiClockInputIndex!=this.currentInputIndex&&(this.midiClockInput.onmidimessage=null),this.midiClockInput=void 0,this.settings.midi_clock_input=void 0;else{const o=parseInt(s);this.midiClockInputIndex=o,this.midiClockInput&&this.midiClockInputIndex!=this.currentInputIndex&&(this.midiClockInput.onmidimessage=null),this.midiClockInput=this.midiInputs[o],this.registerMidiInputListener(o),this.settings.midi_clock_input=this.midiClockInput.name||void 0}}),t.addEventListener("change",a=>{const s=a.target.value;s==="-1"?(this.currentInputIndex&&this.currentInputIndex!=this.midiClockInputIndex&&this.unregisterMidiInputListener(this.currentInputIndex),this.currentInputIndex=void 0,this.settings.default_midi_input=void 0):(this.currentInputIndex&&this.currentInputIndex!=this.midiClockInputIndex&&this.unregisterMidiInputListener(this.currentInputIndex),this.currentInputIndex=parseInt(s),this.registerMidiInputListener(this.currentInputIndex),this.settings.default_midi_input=this.midiInputs[this.currentInputIndex].name||void 0)})}}registerMidiInputListener(e){if(e!==void 0){const t=this.midiInputs[e];t&&!t.onmidimessage&&(t.onmidimessage=n=>{const i=n;if(t.name===this.settings.midi_clock_input&&(i.data[0]===248?this.skipOnError>0?this.skipOnError-=1:this.onMidiClock(n.timeStamp):i.data[0]===250?(console.log("MIDI start received"),this.api.stop(),this.api.play()):i.data[0]===252?(console.log("MIDI stop received"),this.api.pause()):i.data[0]===251?(console.log("MIDI continue received"),this.api.play()):i.data[0]===254&&console.log("MIDI active sensing received")),t.name===this.settings.default_midi_input){if(i.data[0]>=144&&i.data[0]<=159){const a=i.data[0]-144+1,s=i.data[1],o=i.data[2];this.lastNote={note:s,velocity:o,channel:a,timestamp:n.timeStamp},this.lastNoteInChannel[a]={note:s,velocity:o,channel:a,timestamp:n.timeStamp},this.settings.midi_channels_scripts&&this.api.script(a),this.pushToMidiInputBuffer({note:s,velocity:o,channel:a,timestamp:n.timeStamp}),this.activeNotes.push({note:s,velocity:o,channel:a,timestamp:n.timeStamp}),this.removeFromStickyNotes(s,a)||this.stickyNotes.push({note:s,velocity:o,channel:a,timestamp:n.timeStamp})}if(i.data[0]>=128&&i.data[0]<=143){const a=i.data[0]-128+1,s=i.data[1];this.removeFromActiveNotes(s,a)}if(i.data[0]>=176&&i.data[0]<=191){const a=i.data[0]-176+1,s=i.data[1],o=i.data[2];this.lastCC[s]=o,this.lastCCInChannel[a]?this.lastCCInChannel[a][s]=o:(this.lastCCInChannel[a]={},this.lastCCInChannel[a][s]=o),this.pushToMidiCCBuffer({control:s,value:o,channel:a,timestamp:n.timeStamp})}}})}}removeFromActiveNotes(e,t){const n=this.activeNotes.findIndex(i=>i.note===e&&i.channel===t);n>=0&&this.activeNotes.splice(n,1)}removeFromStickyNotes(e,t){const n=this.stickyNotes.findIndex(i=>i.note===e&&i.channel===t);return n>=0?(this.stickyNotes.splice(n,1),!0):!1}stickyNotesFromChannel(e){return this.stickyNotes.filter(t=>t.channel===e)}activeNotesFromChannel(e){return this.activeNotes.filter(t=>t.channel===e)}killActiveNotes(){this.activeNotes=[]}killActiveNotesFromChannel(e){this.activeNotes=this.activeNotes.filter(t=>t.channel!==e)}pushToMidiInputBuffer(e){this.noteInputBuffer.push(e),this.noteInputBuffer.length>this.bufferLength&&this.noteInputBuffer.shift()}pushToMidiCCBuffer(e){this.ccInputBuffer.push(e),this.ccInputBuffer.length>this.bufferLength&&this.ccInputBuffer.shift()}findNoteFromBufferInChannel(e){const t=this.noteInputBuffer.findIndex(n=>n.channel===e);if(t>=0){const n=this.noteInputBuffer[t];return this.noteInputBuffer.splice(t,1),n}else return}findCCFromBufferInChannel(e){const t=this.ccInputBuffer.findIndex(n=>n.channel===e);if(t>=0){const n=this.ccInputBuffer[t];return this.ccInputBuffer.splice(t,1),n}else return}unregisterMidiInputListener(e){if(e!==void 0){const t=this.midiInputs[e];t&&(t.onmidimessage=null)}}onMidiClock(e){if(this.clockTicks+=1,this.lastTimestamp>0)if(this.lastTimestamp===e)this.clockErrorCount+=1;else if(this.clockErrorCount>0)console.log("Timestamp error count: ",this.clockErrorCount),console.log("Current timestamp: ",e),console.log("Last timestamp: ",this.lastTimestamp),console.log("Last delta: ",this.midiClockDelta),console.log("Current delta: ",e-this.lastTimestamp),console.log("BPMs",this.clockBuffer),this.clockErrorCount=0,this.skipOnError=this.settings.midi_clock_ppqn/4,e=0;else{this.midiClockDelta=e-this.lastTimestamp,this.lastBPM=60*(1e3/this.midiClockDelta/this.settings.midi_clock_ppqn),this.clockBuffer.push(this.lastBPM),this.clockBuffer.length>this.clockBufferLength&&this.clockBuffer.shift();const t=this.estimatedBPM();t!==this.roundedBPM&&(console.log("Estimated BPM: ",t),this.api.bpm(t),this.roundedBPM=t)}this.lastTimestamp=e}estimatedBPM(){const e=this.clockBuffer.reduce((t,n)=>t+n);return Math.round(e/this.clockBuffer.length)}sendMidiClock(){if(!this.midiClockInput){const e=this.midiOutputs[this.currentOutputIndex];e&&e.send([248])}}switchMidiOutput(e){const t=this.getMidiOutputIndex(e);return t!==-1?(this.currentOutputIndex=t,!0):!1}getMidiOutputIndex(e){if(typeof e=="number")return e<0||e>=this.midiOutputs.length?(console.error(`Invalid MIDI output index. Index must be in the range 0-${this.midiOutputs.length-1}.`),this.currentOutputIndex):e;{const t=this.midiOutputs.findIndex(n=>n.name===e);return t!==-1?t:(console.error(`MIDI output "${e}" not found.`),this.currentOutputIndex)}}getMidiInputIndex(e){if(typeof e=="number")return e<0||e>=this.midiInputs.length?(console.error(`Invalid MIDI input index. Index must be in the range 0-${this.midiInputs.length-1}.`),-1):e;{const t=this.midiInputs.findIndex(n=>n.name===e);return t!==-1?t:(console.error(`MIDI input "${e}" not found.`),-1)}}listMidiOutputs(){let e="Available MIDI Outputs: ";return this.midiOutputs.forEach((t,n)=>{e+=`(${n+1}) ${t.name} `}),e}sendMidiNote(e,t,n,i,a=this.currentOutputIndex,s=void 0){typeof a=="string"&&(a=this.getMidiOutputIndex(a));const o=this.midiOutputs[a];if(e=Math.min(Math.max(e,0),127),o){const l=[144+t,e,n],c=[128+t,e,0];o.send(l),s&&this.sendPitchBend(s,t,a);const u=setTimeout(()=>{o.send(c),s&&this.sendPitchBend(8192,t,a),delete this.scheduledNotes[e]},(i-.02)*1e3);this.scheduledNotes[e]=u}else console.error("MIDI output not available.")}sendMidiOn(e,t,n,i=this.currentOutputIndex){typeof i=="string"&&(i=this.getMidiOutputIndex(i));const a=this.midiOutputs[i];if(e=Math.min(Math.max(e,0),127),a){const s=[144+t,e,n];a.send(s)}else console.error("MIDI output not available.")}sendMidiOff(e,t,n=this.currentOutputIndex){typeof n=="string"&&(n=this.getMidiOutputIndex(n));const i=this.midiOutputs[n];if(e=Math.min(Math.max(e,0),127),i){const a=[128+t,e,0];i.send(a)}else console.error("MIDI output not available.")}sendAllNotesOff(e,t=this.currentOutputIndex){typeof t=="string"&&(t=this.getMidiOutputIndex(t));const n=this.midiOutputs[t];if(n){const i=[176+e,123,0];n.send(i)}else console.error("MIDI output not available.")}sendAllSoundOff(e,t=this.currentOutputIndex){typeof t=="string"&&(t=this.getMidiOutputIndex(t));const n=this.midiOutputs[t];if(n){const i=[176+e,120,0];n.send(i)}else console.error("MIDI output not available.")}sendSysExMessage(e){const t=this.midiOutputs[this.currentOutputIndex];t?t.send(e):console.error("MIDI output not available.")}sendPitchBend(e,t,n=this.currentOutputIndex){(e<0||e>16383)&&console.error("Invalid pitch bend value. Value must be in the range 0-16383."),(t<0||t>15)&&console.error("Invalid MIDI channel. Channel must be in the range 0-15."),typeof n=="string"&&(n=this.getMidiOutputIndex(n));const i=this.midiOutputs[n];if(i){const a=e&127,s=e>>7&127;i.send([224|t,a,s])}else console.error("MIDI output not available.")}sendProgramChange(e,t){const n=this.midiOutputs[this.currentOutputIndex];n?n.send([192+t,e]):console.error("MIDI output not available.")}sendMidiControlChange(e,t,n){const i=this.midiOutputs[this.currentOutputIndex];i?i.send([176+n,e,t]):console.error("MIDI output not available.")}panic(){const e=this.midiOutputs[this.currentOutputIndex];if(e){for(const t in this.scheduledNotes){const n=this.scheduledNotes[t];clearTimeout(n),e.send([128,parseInt(t),0])}this.scheduledNotes={}}else console.error("MIDI output not available.")}}class qG{constructor(e,t,n){E(this,"min");E(this,"max");E(this,"wrap");E(this,"position");this.min=e,this.max=t,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}}class C_{constructor(e){E(this,"seedValue");E(this,"randomGen",Math.random);E(this,"app");E(this,"values",{});E(this,"evenbar",e=>this.app.clock.time_position.bar%2===0?this.modify(e):this);E(this,"even",e=>this.app.clock.time_position.beat%2===0?this.modify(e):this);E(this,"odd",e=>this.app.clock.time_position.beat%2!==0?this.modify(e):this);E(this,"odds",(e,t)=>this.randomGen()this);E(this,"almostNever",e=>this.odds(.025,e));E(this,"rarely",e=>this.odds(.1,e));E(this,"scarcely",e=>this.odds(.25,e));E(this,"sometimes",e=>this.odds(.5,e));E(this,"often",e=>this.odds(.75,e));E(this,"frequently",e=>this.odds(.9,e));E(this,"almostAlways",e=>this.odds(.985,e));E(this,"always",e=>this.modify(e));E(this,"modify",e=>e(this));E(this,"seed",e=>(this.seedValue=e.toString(),this.randomGen=this.app.api.localSeededRandom(this.seedValue),this));E(this,"clear",()=>(this.app.api.clearLocalSeed(this.seedValue),this));E(this,"apply",e=>this.modify(e));E(this,"length",e=>(this.values.length=e,this));this.app=e,this.app.api.currentSeed&&(this.randomGen=this.app.api.randomGen)}}class hR extends C_{constructor(t){super(t);E(this,"octave",t=>(this.values.octave=t,this.update(),this));E(this,"key",t=>(this.values.key=t,this.update(),this));E(this,"scale",t=>(b_(t)?(this.values.scaleName=t,this.values.parsedScale=vi(t)):this.values.parsedScale=E_(t),this.update(),this));E(this,"freq",t=>{this.values.freq=t;const n=bG(t);return n%1!==0?(this.values.note=Math.floor(n),this.values.bend=oR(n)[1]):this.values.note=n,this});E(this,"update",()=>{})}}class tg extends hR{constructor(t,n){super(n);E(this,"nudge");E(this,"volume",t=>this.updateValue("volume",t));E(this,"vol",this.volume);E(this,"zrand",t=>this.updateValue("zrand",t));E(this,"curve",t=>this.updateValue("curve",t));E(this,"slide",t=>this.updateValue("slide",t));E(this,"sld",this.slide);E(this,"deltaSlide",t=>this.updateValue("deltaSlide",t));E(this,"dslide",this.deltaSlide);E(this,"pitchJump",t=>this.updateValue("pitchJump",t));E(this,"pj",this.pitchJump);E(this,"pitchJumpTime",t=>this.updateValue("pitchJumpTime",t));E(this,"pjt",this.pitchJumpTime);E(this,"lfo",t=>this.updateValue("lfo",t));E(this,"znoise",t=>this.updateValue("znoise",t));E(this,"noise",t=>this.updateValue("noise",t));E(this,"zmod",t=>this.updateValue("zmod",t));E(this,"zcrush",t=>this.updateValue("zcrush",t));E(this,"zdelay",t=>this.updateValue("zdelay",t));E(this,"sustainVolume",t=>this.updateValue("sustainVolume",t));E(this,"tremolo",t=>this.updateValue("tremolo",t));E(this,"dur",t=>this.updateValue("dur",t));E(this,"zzfx",t=>this.updateValue("zzfx",t));E(this,"fmi",t=>this.updateValue("fmi",t));E(this,"fmh",t=>this.updateValue("fmh",t));E(this,"fmenv",t=>this.updateValue("fmenv",t));E(this,"fmattack",t=>this.updateValue("fmattack",t));E(this,"fmatk",this.fmattack);E(this,"fmdecay",t=>this.updateValue("fmdecay",t));E(this,"fmdec",this.fmdecay);E(this,"fmsustain",t=>this.updateValue("fmsustain",t));E(this,"fmsus",this.fmsustain);E(this,"fmrelease",t=>this.updateValue("fmrelease",t));E(this,"fmrel",this.fmrelease);E(this,"fmvelocity",t=>this.updateValue("fmvelocity",t));E(this,"fmvel",this.fmvelocity);E(this,"fmwave",t=>this.updateValue("fmwave",t));E(this,"fmw",this.fmwave);E(this,"ftype",t=>this.updateValue("ftype",t));E(this,"fanchor",t=>this.updateValue("fanchor",t));E(this,"attack",t=>this.updateValue("attack",t));E(this,"atk",this.attack);E(this,"decay",t=>this.updateValue("decay",t));E(this,"dec",this.decay);E(this,"sustain",t=>this.updateValue("sustain",t));E(this,"sus",this.sustain);E(this,"release",t=>this.updateValue("release",t));E(this,"rel",this.release);E(this,"adsr",(t,n,i,a)=>(this.attack(t),this.decay(n),this.sustain(i),this.release(a),this));E(this,"ad",(t,n)=>(this.attack(t),this.decay(n),this.sustain(0),this.release(0),this));E(this,"lpenv",t=>this.updateValue("lpenv",t));E(this,"lpe",t=>this.updateValue("lpenv",t));E(this,"lpattack",t=>this.updateValue("lpattack",t));E(this,"lpa",this.lpattack);E(this,"lpdecay",t=>this.updateValue("lpdecay",t));E(this,"lpd",this.lpdecay);E(this,"lpsustain",t=>this.updateValue("lpsustain",t));E(this,"lps",this.lpsustain);E(this,"lprelease",t=>this.updateValue("lprelease",t));E(this,"lpr",this.lprelease);E(this,"cutoff",t=>this.updateValue("cutoff",t));E(this,"lpf",this.cutoff);E(this,"resonance",t=>this.updateValue("resonance",Math.min(Math.max(t,0),50)));E(this,"lpq",this.resonance);E(this,"lpadsr",(t,n,i,a,s)=>(this.lpenv(t),this.lpattack(n),this.lpdecay(i),this.lpsustain(a),this.lprelease(s),this));E(this,"hpenv",t=>this.updateValue("hpenv",t));E(this,"hpe",t=>this.updateValue("hpe",t));E(this,"hpattack",t=>this.updateValue("hpattack",t));E(this,"hpa",this.hpattack);E(this,"hpdecay",t=>this.updateValue("hpdecay",t));E(this,"hpd",this.hpdecay);E(this,"hpsustain",t=>this.updateValue("hpsustain",t));E(this,"hpsus",this.hpsustain);E(this,"hprelease",t=>this.updateValue("hprelease",t));E(this,"hpr",this.hprelease);E(this,"hcutoff",t=>this.updateValue("hcutoff",t));E(this,"hpf",this.hcutoff);E(this,"hresonance",t=>this.updateValue("hresonance",t));E(this,"hpq",this.hresonance);E(this,"hpadsr",(t,n,i,a,s)=>(this.hpenv(t),this.hpattack(n),this.hpdecay(i),this.hpsustain(a),this.hprelease(s),this));E(this,"bpenv",t=>this.updateValue("bpenv",t));E(this,"bpe",t=>this.updateValue("bpe",t));E(this,"bpattack",t=>this.updateValue("bpattack",t));E(this,"bpa",this.bpattack);E(this,"bpdecay",t=>this.updateValue("bpdecay",t));E(this,"bpd",this.bpdecay);E(this,"bpsustain",t=>this.updateValue("bpsustain",t));E(this,"bps",this.bpsustain);E(this,"bprelease",t=>this.updateValue("bprelease",t));E(this,"bpr",this.bprelease);E(this,"bandf",t=>this.updateValue("bandf",t));E(this,"bpf",this.bandf);E(this,"bandq",t=>this.updateValue("bandq",t));E(this,"bpq",this.bandq);E(this,"bpadsr",(t,n,i,a,s)=>(this.bpenv(t),this.bpattack(n),this.bpdecay(i),this.bpsustain(a),this.bprelease(s),this));E(this,"freq",t=>this.updateValue("freq",t));E(this,"f",this.freq);E(this,"vib",t=>this.updateValue("vib",t));E(this,"vibmod",t=>this.updateValue("vibmod",t));E(this,"fm",t=>{if(typeof t=="number")this.values.fmi=t;else{let n=t.split(":");this.values.fmi=parseFloat(n[0]),n.length>1&&(this.values.fmh=parseFloat(n[1]))}return this});E(this,"loop",t=>this.updateValue("loop",t));E(this,"loopBegin",t=>this.updateValue("loopBegin",t));E(this,"loopEnd",t=>this.updateValue("loopEnd",t));E(this,"begin",t=>this.updateValue("begin",t));E(this,"end",t=>this.updateValue("end",t));E(this,"gain",t=>this.updateValue("gain",t));E(this,"dbgain",t=>this.updateValue("gain",Math.min(Math.pow(10,t/20),10)));E(this,"db",this.dbgain);E(this,"velocity",t=>this.updateValue("velocity",t));E(this,"vel",this.velocity);E(this,"pan",t=>this.updateValue("pan",t));E(this,"sound",t=>this.updateValue("s",t));E(this,"chord",(t,...n)=>(typeof t=="string"?t=xG(t).map(a=>({note:a,freq:Zr(a)})):t instanceof Array&&typeof t[0]=="number"?t=t.map(i=>({note:i,freq:Zr(i)})):typeof t=="number"&&n.length>0&&(t=[t,...n].map(i=>({note:i,freq:Zr(i)}))),this.updateValue("chord",t)));E(this,"invert",(t=0)=>{if(this.values.chord){let n=this.values.chord.map(a=>a.note);n=t<0?[...n].reverse():n;for(let a=0;a({note:a,freq:Zr(a)}));return this.updateValue("chord",i)}else return this});E(this,"snd",this.sound);E(this,"cut",t=>this.updateValue("cut",t));E(this,"clip",t=>this.updateValue("clip",t));E(this,"n",t=>this.updateValue("n",t));E(this,"note",t=>typeof t=="string"?this.updateValue("note",Ur(t)):typeof t==null||t==null?this.updateValue("note",0).updateValue("gain",0):this.updateValue("note",t));E(this,"speed",t=>this.updateValue("speed",t));E(this,"spd",this.speed);E(this,"coarse",t=>this.updateValue("coarse",t));E(this,"crush",t=>this.updateValue("crush",t));E(this,"shape",t=>this.updateValue("shape",t));E(this,"vowel",t=>this.updateValue("vowel",t));E(this,"vow",this.vowel);E(this,"delay",t=>this.updateValue("delay",t));E(this,"del",this.delay);E(this,"delayfeedback",t=>this.updateValue("delayfeedback",t));E(this,"delayfb",this.delayfeedback);E(this,"delaytime",t=>this.updateValue("delaytime",t));E(this,"delayt",this.delaytime);E(this,"orbit",t=>this.updateValue("orbit",t));E(this,"o",this.orbit);E(this,"room",t=>this.updateValue("room",t));E(this,"rm",this.room);E(this,"roomfade",t=>this.updateValue("roomfade",t));E(this,"rfade",this.roomfade);E(this,"roomlp",t=>this.updateValue("roomlp",t));E(this,"rlp",this.roomlp);E(this,"roomdim",t=>this.updateValue("roomdim",t));E(this,"rdim",this.roomdim);E(this,"size",t=>this.updateValue("roomsize",t));E(this,"sz",this.size);E(this,"comp",t=>this.updateValue("compressor",t));E(this,"cmp",this.comp);E(this,"ratio",t=>this.updateValue("compressorRatio",t));E(this,"rt",this.ratio);E(this,"knee",t=>this.updateValue("compressorKnee",t));E(this,"kn",this.knee);E(this,"compAttack",t=>this.updateValue("compressorAttack",t));E(this,"cmpa",this.compAttack);E(this,"compRelease",t=>this.updateValue("compressorRelease",t));E(this,"cmpr",this.compRelease);E(this,"stretch",t=>(this.updateValue("unit","c"),this.updateValue("speed",1/t),this.updateValue("cut",t),this));E(this,"modify",t=>{const n=t(this);return n instanceof Object?n:(t(this.values),this.update(),this)});E(this,"update",()=>{const[t,n]=v_(this.values.key||"C4",this.values.pitch||0,this.values.parsedScale||"MAJOR",this.values.octave||0);this.values.freq=Zr(t)});E(this,"out",()=>{this.values.chord?this.values.chord.forEach(t=>{const n={...this.values};n.freq=t.freq,P_(n,this.nudge,this.values.dur)}):P_(this.values,this.nudge,this.values.dur)});this.app=n,this.nudge=n.dough_nudge/100,typeof t=="string"?t.includes(":")?this.values={s:t.split(":")[0],n:t.split(":")[1],dur:n.clock.convertPulseToSecond(n.clock.ppqn),analyze:!0}:this.values={s:t,dur:.5,analyze:!0}:this.values=t}updateValue(t,n){return this.values[t]=n,this}}class ng extends hR{constructor(t,n){super(n);E(this,"midiConnection");E(this,"chord",t=>(this.values.chord=t,this));E(this,"note",t=>(this.values.note=t,this));E(this,"sustain",t=>(this.values.sustain=t,this));E(this,"channel",t=>(this.values.channel=t,this));E(this,"port",t=>(this.values.port=this.midiConnection.getMidiOutputIndex(t),this));E(this,"add",t=>(this.values.note+=t,this));E(this,"modify",t=>{const n=t(this);return n instanceof Object?n:(t(this.values),this.update(),this)});E(this,"bend",t=>(this.values.bend=t,this));E(this,"random",(t=0,n=127)=>(t=Math.min(Math.max(t,0),127),n=Math.min(Math.max(n,0),127),this.values.note=Math.floor(this.randomGen()*(n-t+1))+t,this));E(this,"update",()=>{const[t,n]=v_(this.values.key||"C4",this.values.pitch||0,this.values.parsedScale||"MAJOR",this.values.octave||0);this.values.note=t,this.values.freq=Zr(t),n&&(this.values.bend=n)});E(this,"out",()=>{function t(n,i){const a=i&&i.channel?i.channel:0,s=n.values.channel?n.values.channel:a,o=n.values.velocity?n.values.velocity:100,l=i&&i.note?i.note:60,c=n.values.note?n.values.note:l,u=n.values.sustain?n.values.sustain*n.app.clock.pulse_duration*n.app.api.ppqn():n.app.clock.pulse_duration*n.app.api.ppqn(),p=n.values.bend?n.values.bend:void 0,m=n.values.port?n.midiConnection.getMidiOutputIndex(n.values.port):n.midiConnection.getCurrentMidiPortIndex();n.midiConnection.sendMidiNote(c,s,o,u,m,p)}this.values.chord?this.values.chord.forEach(n=>{t(this,n)}):t(this)});this.app=n,typeof t=="number"?this.values.note=t:this.values=t,this.midiConnection=n.api.MidiConnection}}const po=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,mR=new Set,rg=typeof process=="object"&&process?process:{},gR=(r,e,t,n)=>{typeof rg.emitWarning=="function"?rg.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)};let Qc=globalThis.AbortController,_T=globalThis.AbortSignal;var OT;if(typeof Qc>"u"){_T=class{constructor(){E(this,"onabort");E(this,"_onabort",[]);E(this,"reason");E(this,"aborted",!1)}addEventListener(n,i){this._onabort.push(i)}},Qc=class{constructor(){E(this,"signal",new _T);e()}abort(n){var i,a;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const s of this.signal._onabort)s(n);(a=(i=this.signal).onabort)==null||a.call(i,n)}}};let r=((OT=rg.env)==null?void 0:OT.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{r&&(r=!1,gR("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 VG=r=>!mR.has(r),Bi=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),_R=r=>Bi(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?rc:null:null;class rc extends Array{constructor(e){super(e),this.fill(0)}}var cs;const fa=class fa{constructor(e,t){E(this,"heap");E(this,"length");if(!V(fa,cs))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}static create(e){const t=_R(e);if(!t)return[];We(fa,cs,!0);const n=new fa(e,t);return We(fa,cs,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};cs=new WeakMap,at(fa,cs,!1);let ig=fa;var Rr,er,Nr,wr,us,on,Dr,ln,Lt,nt,Ln,tr,Cn,hn,xr,mn,gi,_i,kr,Lr,qi,Mn,jo,sg,Oa,Si,Jo,nr,zc,SR,ba,ds,el,qr,Ui,Vr,Fi,tl,og,ps,ic,fs,ac,Dt,Ft,nl,lg,Ea,bo;const y_=class y_{constructor(e){at(this,jo);at(this,zc);at(this,qr);at(this,Vr);at(this,tl);at(this,ps);at(this,fs);at(this,Dt);at(this,nl);at(this,Ea);at(this,Rr,void 0);at(this,er,void 0);at(this,Nr,void 0);at(this,wr,void 0);at(this,us,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");at(this,on,void 0);at(this,Dr,void 0);at(this,ln,void 0);at(this,Lt,void 0);at(this,nt,void 0);at(this,Ln,void 0);at(this,tr,void 0);at(this,Cn,void 0);at(this,hn,void 0);at(this,xr,void 0);at(this,mn,void 0);at(this,gi,void 0);at(this,_i,void 0);at(this,kr,void 0);at(this,Lr,void 0);at(this,qi,void 0);at(this,Mn,void 0);at(this,Oa,()=>{});at(this,Si,()=>{});at(this,Jo,()=>{});at(this,nr,()=>!1);at(this,ba,e=>{});at(this,ds,(e,t,n)=>{});at(this,el,(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:l,dispose:c,disposeAfter:u,noDisposeOnSet:p,noUpdateTTL:m,maxSize:_=0,maxEntrySize:v=0,sizeCalculation:I,fetchMethod:R,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:$,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:h,ignoreFetchAbort:b}=e;if(t!==0&&!Bi(t))throw new TypeError("max option must be a nonnegative integer");const S=t?_R(t):Array;if(!S)throw new Error("invalid max value: "+t);if(We(this,Rr,t),We(this,er,_),this.maxEntrySize=v||V(this,er),this.sizeCalculation=I,this.sizeCalculation){if(!V(this,er)&&!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(R!==void 0&&typeof R!="function")throw new TypeError("fetchMethod must be a function if specified");if(We(this,us,R),We(this,qi,!!R),We(this,ln,new Map),We(this,Lt,new Array(t).fill(void 0)),We(this,nt,new Array(t).fill(void 0)),We(this,Ln,new S(t)),We(this,tr,new S(t)),We(this,Cn,0),We(this,hn,0),We(this,xr,ig.create(t)),We(this,on,0),We(this,Dr,0),typeof c=="function"&&We(this,Nr,c),typeof u=="function"?(We(this,wr,u),We(this,mn,[])):(We(this,wr,void 0),We(this,mn,void 0)),We(this,Lr,!!V(this,Nr)),We(this,Mn,!!V(this,wr)),this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!Z,this.allowStaleOnFetchAbort=!!h,this.ignoreFetchAbort=!!b,this.maxEntrySize!==0){if(V(this,er)!==0&&!Bi(V(this,er)))throw new TypeError("maxSize must be a positive integer if specified");if(!Bi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ze(this,zc,SR).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!$,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=Bi(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!Bi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ze(this,jo,sg).call(this)}if(V(this,Rr)===0&&this.ttl===0&&V(this,er)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!V(this,Rr)&&!V(this,er)){const N="LRU_CACHE_UNBOUNDED";VG(N)&&(mR.add(N),gR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",N,y_))}}static unsafeExposeInternals(e){return{starts:V(e,_i),ttls:V(e,kr),sizes:V(e,gi),keyMap:V(e,ln),keyList:V(e,Lt),valList:V(e,nt),next:V(e,Ln),prev:V(e,tr),get head(){return V(e,Cn)},get tail(){return V(e,hn)},free:V(e,xr),isBackgroundFetch:t=>{var n;return ze(n=e,Dt,Ft).call(n,t)},backgroundFetch:(t,n,i,a)=>{var s;return ze(s=e,fs,ac).call(s,t,n,i,a)},moveToTail:t=>{var n;return ze(n=e,Ea,bo).call(n,t)},indexes:t=>{var n;return ze(n=e,qr,Ui).call(n,t)},rindexes:t=>{var n;return ze(n=e,Vr,Fi).call(n,t)},isStale:t=>{var n;return V(n=e,nr).call(n,t)}}}get max(){return V(this,Rr)}get maxSize(){return V(this,er)}get calculatedSize(){return V(this,Dr)}get size(){return V(this,on)}get fetchMethod(){return V(this,us)}get dispose(){return V(this,Nr)}get disposeAfter(){return V(this,wr)}getRemainingTTL(e){return V(this,ln).has(e)?1/0:0}*entries(){for(const e of ze(this,qr,Ui).call(this))V(this,nt)[e]!==void 0&&V(this,Lt)[e]!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield[V(this,Lt)[e],V(this,nt)[e]])}*rentries(){for(const e of ze(this,Vr,Fi).call(this))V(this,nt)[e]!==void 0&&V(this,Lt)[e]!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield[V(this,Lt)[e],V(this,nt)[e]])}*keys(){for(const e of ze(this,qr,Ui).call(this)){const t=V(this,Lt)[e];t!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield t)}}*rkeys(){for(const e of ze(this,Vr,Fi).call(this)){const t=V(this,Lt)[e];t!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield t)}}*values(){for(const e of ze(this,qr,Ui).call(this))V(this,nt)[e]!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield V(this,nt)[e])}*rvalues(){for(const e of ze(this,Vr,Fi).call(this))V(this,nt)[e]!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield V(this,nt)[e])}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const n of ze(this,qr,Ui).call(this)){const i=V(this,nt)[n],a=ze(this,Dt,Ft).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,V(this,Lt)[n],this))return this.get(V(this,Lt)[n],t)}}forEach(e,t=this){for(const n of ze(this,qr,Ui).call(this)){const i=V(this,nt)[n],a=ze(this,Dt,Ft).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,V(this,Lt)[n],this)}}rforEach(e,t=this){for(const n of ze(this,Vr,Fi).call(this)){const i=V(this,nt)[n],a=ze(this,Dt,Ft).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,V(this,Lt)[n],this)}}purgeStale(){let e=!1;for(const t of ze(this,Vr,Fi).call(this,{allowStale:!0}))V(this,nr).call(this,t)&&(this.delete(V(this,Lt)[t]),e=!0);return e}dump(){const e=[];for(const t of ze(this,qr,Ui).call(this,{allowStale:!0})){const n=V(this,Lt)[t],i=V(this,nt)[t],a=ze(this,Dt,Ft).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||n===void 0)continue;const s={value:a};if(V(this,kr)&&V(this,_i)){s.ttl=V(this,kr)[t];const o=po.now()-V(this,_i)[t];s.start=Math.floor(Date.now()-o)}V(this,gi)&&(s.size=V(this,gi)[t]),e.unshift([n,s])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const i=Date.now()-n.start;n.start=po.now()-i}this.set(t,n.value,n)}}set(e,t,n={}){var m,_,v,I,R;if(t===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const u=V(this,el).call(this,e,t,n.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let p=V(this,on)===0?void 0:V(this,ln).get(e);if(p===void 0)p=V(this,on)===0?V(this,hn):V(this,xr).length!==0?V(this,xr).pop():V(this,on)===V(this,Rr)?ze(this,ps,ic).call(this,!1):V(this,on),V(this,Lt)[p]=e,V(this,nt)[p]=t,V(this,ln).set(e,p),V(this,Ln)[V(this,hn)]=p,V(this,tr)[p]=V(this,hn),We(this,hn,p),gl(this,on)._++,V(this,ds).call(this,p,u,l),l&&(l.set="add"),c=!1;else{ze(this,Ea,bo).call(this,p);const x=V(this,nt)[p];if(t!==x){if(V(this,qi)&&ze(this,Dt,Ft).call(this,x)){x.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:$}=x;$!==void 0&&!s&&(V(this,Lr)&&((m=V(this,Nr))==null||m.call(this,$,e,"set")),V(this,Mn)&&((_=V(this,mn))==null||_.push([$,e,"set"])))}else s||(V(this,Lr)&&((v=V(this,Nr))==null||v.call(this,x,e,"set")),V(this,Mn)&&((I=V(this,mn))==null||I.push([x,e,"set"])));if(V(this,ba).call(this,p),V(this,ds).call(this,p,u,l),V(this,nt)[p]=t,l){l.set="replace";const $=x&&ze(this,Dt,Ft).call(this,x)?x.__staleWhileFetching:x;$!==void 0&&(l.oldValue=$)}}else l&&(l.set="update")}if(i!==0&&!V(this,kr)&&ze(this,jo,sg).call(this),V(this,kr)&&(c||V(this,Jo).call(this,p,i,a),l&&V(this,Si).call(this,l,p)),!s&&V(this,Mn)&&V(this,mn)){const x=V(this,mn);let $;for(;$=x==null?void 0:x.shift();)(R=V(this,wr))==null||R.call(this,...$)}return this}pop(){var e;try{for(;V(this,on);){const t=V(this,nt)[V(this,Cn)];if(ze(this,ps,ic).call(this,!0),ze(this,Dt,Ft).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(V(this,Mn)&&V(this,mn)){const t=V(this,mn);let n;for(;n=t==null?void 0:t.shift();)(e=V(this,wr))==null||e.call(this,...n)}}}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,a=V(this,ln).get(e);if(a!==void 0){const s=V(this,nt)[a];if(ze(this,Dt,Ft).call(this,s)&&s.__staleWhileFetching===void 0)return!1;if(V(this,nr).call(this,a))i&&(i.has="stale",V(this,Si).call(this,i,a));else return n&&V(this,Oa).call(this,a),i&&(i.has="hit",V(this,Si).call(this,i,a)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,i=V(this,ln).get(e);if(i!==void 0&&(n||!V(this,nr).call(this,i))){const a=V(this,nt)[i];return ze(this,Dt,Ft).call(this,a)?a.__staleWhileFetching:a}}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:I,forceRefresh:R=!1,status:x,signal:$}=t;if(!V(this,qi))return x&&(x.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:x});const Z={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:s,noDisposeOnSet:o,size:l,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:v,ignoreFetchAbort:_,status:x,signal:$};let h=V(this,ln).get(e);if(h===void 0){x&&(x.fetch="miss");const b=ze(this,fs,ac).call(this,e,h,Z,I);return b.__returned=b}else{const b=V(this,nt)[h];if(ze(this,Dt,Ft).call(this,b)){const M=n&&b.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",M&&(x.returnedStale=!0)),M?b.__staleWhileFetching:b.__returned=b}const S=V(this,nr).call(this,h);if(!R&&!S)return x&&(x.fetch="hit"),ze(this,Ea,bo).call(this,h),i&&V(this,Oa).call(this,h),x&&V(this,Si).call(this,x,h),b;const N=ze(this,fs,ac).call(this,e,h,Z,I),L=N.__staleWhileFetching!==void 0&&n;return x&&(x.fetch=S?"stale":"refresh",L&&S&&(x.returnedStale=!0)),L?N.__staleWhileFetching:N.__returned=N}}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:s}=t,o=V(this,ln).get(e);if(o!==void 0){const l=V(this,nt)[o],c=ze(this,Dt,Ft).call(this,l);return s&&V(this,Si).call(this,s,o),V(this,nr).call(this,o)?(s&&(s.get="stale"),c?(s&&n&&l.__staleWhileFetching!==void 0&&(s.returnedStale=!0),n?l.__staleWhileFetching:void 0):(a||this.delete(e),s&&n&&(s.returnedStale=!0),n?l:void 0)):(s&&(s.get="hit"),c?l.__staleWhileFetching:(ze(this,Ea,bo).call(this,o),i&&V(this,Oa).call(this,o),l))}else s&&(s.get="miss")}delete(e){var n,i,a,s;let t=!1;if(V(this,on)!==0){const o=V(this,ln).get(e);if(o!==void 0)if(t=!0,V(this,on)===1)this.clear();else{V(this,ba).call(this,o);const l=V(this,nt)[o];ze(this,Dt,Ft).call(this,l)?l.__abortController.abort(new Error("deleted")):(V(this,Lr)||V(this,Mn))&&(V(this,Lr)&&((n=V(this,Nr))==null||n.call(this,l,e,"delete")),V(this,Mn)&&((i=V(this,mn))==null||i.push([l,e,"delete"]))),V(this,ln).delete(e),V(this,Lt)[o]=void 0,V(this,nt)[o]=void 0,o===V(this,hn)?We(this,hn,V(this,tr)[o]):o===V(this,Cn)?We(this,Cn,V(this,Ln)[o]):(V(this,Ln)[V(this,tr)[o]]=V(this,Ln)[o],V(this,tr)[V(this,Ln)[o]]=V(this,tr)[o]),gl(this,on)._--,V(this,xr).push(o)}}if(V(this,Mn)&&((a=V(this,mn))!=null&&a.length)){const o=V(this,mn);let l;for(;l=o==null?void 0:o.shift();)(s=V(this,wr))==null||s.call(this,...l)}return t}clear(){var e,t,n;for(const i of ze(this,Vr,Fi).call(this,{allowStale:!0})){const a=V(this,nt)[i];if(ze(this,Dt,Ft).call(this,a))a.__abortController.abort(new Error("deleted"));else{const s=V(this,Lt)[i];V(this,Lr)&&((e=V(this,Nr))==null||e.call(this,a,s,"delete")),V(this,Mn)&&((t=V(this,mn))==null||t.push([a,s,"delete"]))}}if(V(this,ln).clear(),V(this,nt).fill(void 0),V(this,Lt).fill(void 0),V(this,kr)&&V(this,_i)&&(V(this,kr).fill(0),V(this,_i).fill(0)),V(this,gi)&&V(this,gi).fill(0),We(this,Cn,0),We(this,hn,0),V(this,xr).length=0,We(this,Dr,0),We(this,on,0),V(this,Mn)&&V(this,mn)){const i=V(this,mn);let a;for(;a=i==null?void 0:i.shift();)(n=V(this,wr))==null||n.call(this,...a)}}};Rr=new WeakMap,er=new WeakMap,Nr=new WeakMap,wr=new WeakMap,us=new WeakMap,on=new WeakMap,Dr=new WeakMap,ln=new WeakMap,Lt=new WeakMap,nt=new WeakMap,Ln=new WeakMap,tr=new WeakMap,Cn=new WeakMap,hn=new WeakMap,xr=new WeakMap,mn=new WeakMap,gi=new WeakMap,_i=new WeakMap,kr=new WeakMap,Lr=new WeakMap,qi=new WeakMap,Mn=new WeakMap,jo=new WeakSet,sg=function(){const e=new rc(V(this,Rr)),t=new rc(V(this,Rr));We(this,kr,e),We(this,_i,t),We(this,Jo,(a,s,o=po.now())=>{if(t[a]=s!==0?o:0,e[a]=s,s!==0&&this.ttlAutopurge){const l=setTimeout(()=>{V(this,nr).call(this,a)&&this.delete(V(this,Lt)[a])},s+1);l.unref&&l.unref()}}),We(this,Oa,a=>{t[a]=e[a]!==0?po.now():0}),We(this,Si,(a,s)=>{if(e[s]){const o=e[s],l=t[s];a.ttl=o,a.start=l,a.now=n||i();const c=a.now-l;a.remainingTTL=o-c}});let n=0;const i=()=>{const a=po.now();if(this.ttlResolution>0){n=a;const s=setTimeout(()=>n=0,this.ttlResolution);s.unref&&s.unref()}return a};this.getRemainingTTL=a=>{const s=V(this,ln).get(a);if(s===void 0)return 0;const o=e[s],l=t[s];if(o===0||l===0)return 1/0;const c=(n||i())-l;return o-c},We(this,nr,a=>e[a]!==0&&t[a]!==0&&(n||i())-t[a]>e[a])},Oa=new WeakMap,Si=new WeakMap,Jo=new WeakMap,nr=new WeakMap,zc=new WeakSet,SR=function(){const e=new rc(V(this,Rr));We(this,Dr,0),We(this,gi,e),We(this,ba,t=>{We(this,Dr,V(this,Dr)-e[t]),e[t]=0}),We(this,el,(t,n,i,a)=>{if(ze(this,Dt,Ft).call(this,n))return 0;if(!Bi(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,t),!Bi(i))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 i}),We(this,ds,(t,n,i)=>{if(e[t]=n,V(this,er)){const a=V(this,er)-e[t];for(;V(this,Dr)>a;)ze(this,ps,ic).call(this,!0)}We(this,Dr,V(this,Dr)+e[t]),i&&(i.entrySize=n,i.totalCalculatedSize=V(this,Dr))})},ba=new WeakMap,ds=new WeakMap,el=new WeakMap,qr=new WeakSet,Ui=function*({allowStale:e=this.allowStale}={}){if(V(this,on))for(let t=V(this,hn);!(!ze(this,tl,og).call(this,t)||((e||!V(this,nr).call(this,t))&&(yield t),t===V(this,Cn)));)t=V(this,tr)[t]},Vr=new WeakSet,Fi=function*({allowStale:e=this.allowStale}={}){if(V(this,on))for(let t=V(this,Cn);!(!ze(this,tl,og).call(this,t)||((e||!V(this,nr).call(this,t))&&(yield t),t===V(this,hn)));)t=V(this,Ln)[t]},tl=new WeakSet,og=function(e){return e!==void 0&&V(this,ln).get(V(this,Lt)[e])===e},ps=new WeakSet,ic=function(e){var a,s;const t=V(this,Cn),n=V(this,Lt)[t],i=V(this,nt)[t];return V(this,qi)&&ze(this,Dt,Ft).call(this,i)?i.__abortController.abort(new Error("evicted")):(V(this,Lr)||V(this,Mn))&&(V(this,Lr)&&((a=V(this,Nr))==null||a.call(this,i,n,"evict")),V(this,Mn)&&((s=V(this,mn))==null||s.push([i,n,"evict"]))),V(this,ba).call(this,t),e&&(V(this,Lt)[t]=void 0,V(this,nt)[t]=void 0,V(this,xr).push(t)),V(this,on)===1?(We(this,Cn,We(this,hn,0)),V(this,xr).length=0):We(this,Cn,V(this,Ln)[t]),V(this,ln).delete(n),gl(this,on)._--,t},fs=new WeakSet,ac=function(e,t,n,i){const a=t===void 0?void 0:V(this,nt)[t];if(ze(this,Dt,Ft).call(this,a))return a;const s=new Qc,{signal:o}=n;o==null||o.addEventListener("abort",()=>s.abort(o.reason),{signal:s.signal});const l={signal:s.signal,options:n,context:i},c=(I,R=!1)=>{const{aborted:x}=s.signal,$=n.ignoreFetchAbort&&I!==void 0;if(n.status&&(x&&!R?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,$&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),x&&!$&&!R)return p(s.signal.reason);const Z=_;return V(this,nt)[t]===_&&(I===void 0?Z.__staleWhileFetching?V(this,nt)[t]=Z.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,I,l.options))),I},u=I=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=I),p(I)),p=I=>{const{aborted:R}=s.signal,x=R&&n.allowStaleOnFetchAbort,$=x||n.allowStaleOnFetchRejection,Z=$||n.noDeleteOnFetchRejection,h=_;if(V(this,nt)[t]===_&&(!Z||h.__staleWhileFetching===void 0?this.delete(e):x||(V(this,nt)[t]=h.__staleWhileFetching)),$)return n.status&&h.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw I},m=(I,R)=>{var $;const x=($=V(this,us))==null?void 0:$.call(this,e,a,l);x&&x instanceof Promise&&x.then(Z=>I(Z===void 0?void 0:Z),R),s.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(I(void 0),n.allowStaleOnFetchAbort&&(I=Z=>c(Z,!0)))})};n.status&&(n.status.fetchDispatched=!0);const _=new Promise(m).then(c,u),v=Object.assign(_,{__abortController:s,__staleWhileFetching:a,__returned:void 0});return t===void 0?(this.set(e,v,{...l.options,status:void 0}),t=V(this,ln).get(e)):V(this,nt)[t]=v,v},Dt=new WeakSet,Ft=function(e){if(!V(this,qi))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Qc},nl=new WeakSet,lg=function(e,t){V(this,tr)[t]=e,V(this,Ln)[e]=t},Ea=new WeakSet,bo=function(e){e!==V(this,hn)&&(e===V(this,Cn)?We(this,Cn,V(this,Ln)[e]):ze(this,nl,lg).call(this,V(this,tr)[e],V(this,Ln)[e]),ze(this,nl,lg).call(this,V(this,hn),e),We(this,hn,e))};let ag=y_;const Ro=class Ro{constructor(){E(this,"_fallbackMethod",()=>Ro.createSkipProxy());E(this,"out",()=>{})}};E(Ro,"createSkipProxy",()=>{const e=new Ro;return new Proxy(e,{get(t,n,i){return typeof t[n]>"u"?t._fallbackMethod:t[n]},set(t,n,i,a){return!1}})});let qc=Ro;const No=class No extends C_{constructor(t,n){super(n);E(this,"_fallbackMethod",()=>No.createRestProxy(this.values.length,this.app));E(this,"out",()=>{});this.values.length=t}};E(No,"createRestProxy",(t,n)=>{const i=new No(t,n);return new Proxy(i,{get(a,s,o){return typeof a[s]>"u"?a._fallbackMethod:a[s]},set(a,s,o,l){return!1}})});let Vc=No;class zG extends C_{constructor(t,n,i){super(i);E(this,"input");E(this,"ziffers");E(this,"initCallTime",0);E(this,"startCallTime",0);E(this,"lastCallTime",0);E(this,"waitTime",0);E(this,"startBeat",0);E(this,"played",!1);E(this,"current");E(this,"retro",!1);E(this,"index",-1);E(this,"zid","");E(this,"options",{});E(this,"skipIndex",0);E(this,"endTime",0);E(this,"next",()=>(this.current=this.ziffers.next(),this.played=!0,this.current));E(this,"pulseToSecond",t=>this.app.clock.convertPulseToSecond(t));E(this,"firstRun",()=>this.notStarted());E(this,"atTheBeginning",()=>this.skipIndex===0&&this.ziffers.index<=0);E(this,"origin",()=>this.app.clock.pulses_since_origin+1);E(this,"pulse",()=>this.app.clock.time_position.pulse);E(this,"beat",()=>this.app.clock.time_position.beat);E(this,"nextBeat",()=>this.app.clock.next_beat_in_ticks);E(this,"nextBeatInTicks",()=>this.app.clock.next_beat_in_ticks);E(this,"areWeThereYet",()=>{this.app.clock.pulses_since_origin=this.nextBeatInTicks())&&this.origin()>=this.waitTime,n=this.current&&this.pulseToSecond(this.origin())>=this.pulseToSecond(this.lastCallTime)+this.pulseToSecond(this.current.duration*4*this.app.clock.ppqn)&&this.origin()>=this.waitTime,i=t||n;return this.skipIndex=i?0:this.skipIndex+1,this.index=i?this.index+1:this.index,i&&this.notStarted()&&(this.initCallTime=this.app.clock.pulses_since_origin),this.atTheBeginning()&&(this.startCallTime=this.app.clock.pulses_since_origin),i});E(this,"lead",()=>this.voiceleading());E(this,"invert",t=>(this.atTheBeginning()&&this.ziffers.invert(t),this));E(this,"out",()=>{});this.app=i,this.input=t,this.options=n,this.ziffers=new $G(t,n)}get ticks(){return this.ziffers.duration*4*this.app.clock.ppqn}nextEndTime(){return this.startCallTime+this.ticks}updateLastCallTime(){(this.notStarted()||this.played)&&(this.lastCallTime=this.app.clock.pulses_since_origin,this.played=!1)}notStarted(){return this.ziffers.notStarted()}sound(t){if(this.areWeThereYet()){const n=this.next(),i=this.app.clock.convertPulseToSecond(n.duration*4*this.app.clock.ppqn);if(n instanceof ni){const a=n.getExisting("freq","pitch","key","scale","octave","parsedScale");return n.sound&&(t=n.sound),n.soundIndex&&(a.n=n.soundIndex),a.dur=i,new tg(a,this.app).sound(t||"sine")}else if(n instanceof Na){const a=n.pitches.map(o=>o.getExisting("freq","pitch","key","scale","octave","parsedScale")),s={dur:i};return t&&(s.s=t),new tg(s,this.app).chord(a)}else if(n instanceof Jm)return Vc.createRestProxy(n.duration,this.app)}else return qc.createSkipProxy()}midi(t=void 0){if(this.areWeThereYet()){const n=this.next(),i=n.getExisting("note","pitch","bend","key","scale","octave","parsedScale");if(n instanceof ni){n.soundIndex&&(i.channel=n.soundIndex);const a=new ng(i,this.app);return t?a.note(t):a}else{if(n instanceof Jm)return Vc.createRestProxy(n.duration,this.app);if(n instanceof Na){const a=n.midiChord();return new ng(i,this.app).chord(a)}}}else return qc.createSkipProxy()}scale(t){return this.atTheBeginning()&&this.ziffers.scale(t),this}key(t){return this.atTheBeginning()&&this.ziffers.key(t),this}octave(t){return this.atTheBeginning()&&this.ziffers.octave(t),this}voiceleading(){return this.atTheBeginning()&&this.ziffers.lead(),this}retrograde(){return this.atTheBeginning()&&this.ziffers.retrograde(),this}wait(t){if(this.atTheBeginning()){if(typeof t=="function"){const n=this.app.api.patternCache.get(t.name);return n&&(this.waitTime=n.nextEndTime()),this}this.waitTime=this.origin()+Math.ceil(t*4*this.app.clock.ppqn)}return this}sync(t){if(this.atTheBeginning()&&this.notStarted()){const n=this.app.clock.pulses_since_origin,i=typeof t=="function"?t.name:t;if(n>0){const a=this.app.api.patternCache.get(i);if(a){const s=a.ziffers.duration,o=a.startCallTime,l=s*4*this.app.clock.ppqn;this.waitTime=o+l}}}return this}}const HG=r=>r[0]==="{"&&r[r.length-1]==="}",fo=(r,e)=>{if(HG(r)){const t=JSON.parse(r);return JSON.stringify({...t,...e})}else return JSON.stringify({...e,text:r})},WG=r=>{String.prototype.speak=function(){const e=JSON.parse(this.valueOf());new OR({...e,text:e.text}).speak().then(()=>{}).catch(t=>{console.log("Error speaking:",t)})},String.prototype.rate=function(e){return fo(this.valueOf(),{rate:e})},String.prototype.pitch=function(e){return fo(this.valueOf(),{pitch:e})},String.prototype.lang=function(e){return fo(this.valueOf(),{lang:e})},String.prototype.volume=function(e){return fo(this.valueOf(),{volume:e})},String.prototype.voice=function(e){return fo(this.valueOf(),{voice:e})},String.prototype.z=function(e={}){return r.z(this.valueOf(),e)},String.prototype.z0=function(e={}){return r.z0(this.valueOf(),e)},String.prototype.z1=function(e={}){return r.z1(this.valueOf(),e)},String.prototype.z2=function(e={}){return r.z2(this.valueOf(),e)},String.prototype.z3=function(e={}){return r.z3(this.valueOf(),e)},String.prototype.z4=function(e={}){return r.z4(this.valueOf(),e)},String.prototype.z5=function(e={}){return r.z5(this.valueOf(),e)},String.prototype.z6=function(e={}){return r.z6(this.valueOf(),e)},String.prototype.z7=function(e={}){return r.z7(this.valueOf(),e)},String.prototype.z8=function(e={}){return r.z8(this.valueOf(),e)},String.prototype.z9=function(e={}){return r.z9(this.valueOf(),e)},String.prototype.z10=function(e={}){return r.z10(this.valueOf(),e)},String.prototype.z11=function(e={}){return r.z11(this.valueOf(),e)},String.prototype.z12=function(e={}){return r.z12(this.valueOf(),e)},String.prototype.z13=function(e={}){return r.z13(this.valueOf(),e)},String.prototype.z14=function(e={}){return r.z14(this.valueOf(),e)},String.prototype.z15=function(e={}){return r.z15(this.valueOf(),e)},String.prototype.z16=function(e={}){return r.z16(this.valueOf(),e)},String.prototype.note=function(){try{return parseInt(this.valueOf())}catch{return Ur(this.valueOf())}}};let qh;class OR{constructor(e){E(this,"speak",()=>new Promise((e,t)=>{if(this.options.text){const n=window.speechSynthesis;n.speaking&&n.cancel();const i=new SpeechSynthesisUtterance(this.options.text);i.rate=this.options.rate||1,i.pitch=this.options.pitch||1,i.volume=this.options.volume||1,this.options.voice&&(i.voice=n.getVoices()[this.options.voice]),this.options.lang&&(this.options.lang.length===2?i.lang=`${this.options.lang}-${this.options.lang.toUpperCase()}`:this.options.lang.length===5?i.lang=this.options.lang:i.lang="en-US"),i.onend=()=>{e()},i.onerror=a=>{t(a)},n.speaking?(n.cancel(),qh&&clearTimeout(qh),qh=setTimeout(()=>{n.speak(i)},200)):n.speak(i)}else t("No text provided")}));this.options=e}}async function bR(){return Promise.all([jR(),Yi("github:tidalcycles/Dirt-Samples/master").then(()=>h2()),O2(),Yi("github:Bubobubobubobubo/Dough-Fox/main"),Yi("github:Bubobubobubobubo/Dough-Samples/main"),Yi("github:Bubobubobubobubo/Dough-Amiga/main"),Yi("github:Bubobubobubobubo/Dough-Amen/main"),Yi("github:Bubobubobubobubo/Dough-Waveforms/main")])}class XG{constructor(e){E(this,"variables",{});E(this,"codeExamples",{});E(this,"counters",{});E(this,"_drunk",new qG(-100,100,!1));E(this,"randomGen",Math.random);E(this,"currentSeed");E(this,"localSeeds",new Map);E(this,"patternCache",new ag({max:1e3,ttl:1e3*60*5}));E(this,"errorTimeoutID",0);E(this,"printTimeoutID",0);E(this,"MidiConnection");E(this,"scale_aid");E(this,"load");E(this,"_loadUniverseFromInterface",e=>{Dc(this.app,e),xc()});E(this,"_deleteUniverseFromInterface",e=>{delete this.app.universes[e],this.app.settings.saveApplicationToLocalStorage(this.app.universes,this.app.settings),this.app.updateKnownUniversesView()});E(this,"_playDocExample",e=>{let t=this.app.universes[this.app.selected_universe];this.app.exampleIsPlaying=!0,t.example?t.example.candidate=e||this.app.selectedExample:(t.example={candidate:"",committed:"",evaluations:0},t.example.candidate=e||this.app.selectedExample),this.play()});E(this,"_stopDocExample",()=>{let e=this.app.universes[this.app.selected_universe];(e==null?void 0:e.example)!==void 0&&(this.app.exampleIsPlaying=!1,e.example.candidate="",e.example.committed=""),this.pause()});E(this,"_playDocExampleOnce",e=>{let t=this.app.universes[this.app.selected_universe];(t==null?void 0:t.example)!==void 0&&(t.example.candidate="",t.example.committed=""),this.play(),this.app.exampleIsPlaying=!0,OM(this.app,e)});E(this,"_all_samples",()=>dg.get());E(this,"_reportError",e=>{console.log(e),clearTimeout(this.errorTimeoutID),clearTimeout(this.printTimeoutID),this.app.interface.error_line.innerHTML=e,this.app.interface.error_line.style.color="color-red-800",this.app.interface.error_line.classList.remove("hidden"),this.errorTimeoutID=setTimeout(()=>this.app.interface.error_line.classList.add("hidden"),2e3)});E(this,"_logMessage",e=>{console.log(e),clearTimeout(this.printTimeoutID),clearTimeout(this.errorTimeoutID),this.app.interface.error_line.innerHTML=e,this.app.interface.error_line.style.color="white",this.app.interface.error_line.classList.remove("hidden"),this.printTimeoutID=setTimeout(()=>this.app.interface.error_line.classList.add("hidden"),4e3)});E(this,"time",()=>this.app.audioContext.currentTime);E(this,"play",()=>{this.app.setButtonHighlighting("play",!0),this.MidiConnection.sendStartMessage(),this.app.clock.start()});E(this,"pause",()=>{this.app.setButtonHighlighting("pause",!0),this.MidiConnection.sendStopMessage(),this.app.clock.pause()});E(this,"stop",()=>{this.app.setButtonHighlighting("stop",!0),this.MidiConnection.sendStopMessage(),this.app.clock.stop()});E(this,"silence",this.stop);E(this,"hush",this.stop);E(this,"warp",e=>{this.app.clock.tick=e,this.app.clock.time_position=this.app.clock.convertTicksToTimeposition(e)});E(this,"beat_warp",e=>{this.app.clock.tick=e*this.app.clock.ppqn,this.app.clock.time_position=this.app.clock.convertTicksToTimeposition(e*this.app.clock.ppqn)});E(this,"onmousemove",e=>{this.app._mouseX=e.pageX,this.app._mouseY=e.pageY});E(this,"mouseX",()=>this.app._mouseX);E(this,"mouseY",()=>this.app._mouseY);E(this,"noteX",()=>Math.floor(this.app._mouseX/document.body.clientWidth*127));E(this,"noteY",()=>Math.floor(this.app._mouseY/document.body.clientHeight*127));E(this,"script",(...e)=>{e.forEach(t=>{t>=1&&t<=9&&(E2(this.app,"local",t),Ra(this.app,this.app.universes[this.app.selected_universe].locals[t]))})});E(this,"s",this.script);E(this,"delete_script",e=>{this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}});E(this,"cs",this.delete_script);E(this,"copy_script",(e,t)=>{this.app.universes[this.app.selected_universe].locals[t]={...this.app.universes[this.app.selected_universe].locals[e]}});E(this,"cps",this.copy_script);E(this,"copy_universe",(e,t)=>{this.app.universes[t]={...this.app.universes[e]}});E(this,"delete_universe",e=>{this.app.selected_universe===e&&(this.app.selected_universe="Default"),delete this.app.universes[e],this.app.settings.saveApplicationToLocalStorage(this.app.universes,this.app.settings),this.app.updateKnownUniversesView()});E(this,"big_bang",()=>{confirm("Are you sure you want to delete all universes?")&&(this.app.universes={...Xo},this.app.settings.saveApplicationToLocalStorage(this.app.universes,this.app.settings)),this.app.selected_universe="Default",this.app.updateKnownUniversesView()});E(this,"midi_outputs",()=>{this._logMessage(this.MidiConnection.listMidiOutputs())});E(this,"midi_output",e=>{e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())});E(this,"midi",(e=60,t,n)=>(t!==void 0&&(typeof e=="number"&&(e={note:e}),e.velocity=t),n!==void 0&&(typeof e=="number"&&(e={note:e}),e.channel=n),new ng(e,this.app)));E(this,"sysex",e=>{this.MidiConnection.sendSysExMessage(e)});E(this,"pitch_bend",(e,t)=>{this.MidiConnection.sendPitchBend(e,t)});E(this,"program_change",(e,t)=>{this.MidiConnection.sendProgramChange(e,t)});E(this,"midi_clock",()=>{this.MidiConnection.sendMidiClock()});E(this,"control_change",({control:e=20,value:t=0,channel:n=0})=>{this.MidiConnection.sendMidiControlChange(e,t,n)});E(this,"midi_panic",()=>{this.MidiConnection.panic()});E(this,"active_note_events",e=>{let t;if(e?t=this.MidiConnection.activeNotesFromChannel(e):t=this.MidiConnection.activeNotes,t.length>0)return t});E(this,"active_notes",e=>{const t=this.active_note_events(e);if(t&&t.length>0)return t.map(n=>n.note)});E(this,"kill_active_notes",()=>{this.MidiConnection.activeNotes=[]});E(this,"sticky_notes",e=>{let t;if(e?t=this.MidiConnection.stickyNotesFromChannel(e):t=this.MidiConnection.stickyNotes,t.length>0)return t.map(n=>n.note)});E(this,"kill_sticky_notes",()=>{this.MidiConnection.stickyNotes=[]});E(this,"buffer",e=>e?this.MidiConnection.findNoteFromBufferInChannel(e)!==void 0:this.MidiConnection.noteInputBuffer.length>0);E(this,"buffer_event",e=>e?this.MidiConnection.findNoteFromBufferInChannel(e):this.MidiConnection.noteInputBuffer.shift());E(this,"buffer_note",e=>{const t=this.buffer_event(e);return t?t.note:void 0});E(this,"last_note_event",e=>e?this.MidiConnection.lastNoteInChannel[e]:this.MidiConnection.lastNote);E(this,"last_note",e=>{const t=this.last_note_event(e);return t?t.note:60});E(this,"last_cc",(e,t)=>t?this.MidiConnection.lastCCInChannel[t]?this.MidiConnection.lastCCInChannel[t][e]:0:this.MidiConnection.lastCC[e]||0);E(this,"has_cc",e=>e?this.MidiConnection.findCCFromBufferInChannel(e)!==void 0:this.MidiConnection.ccInputBuffer.length>0);E(this,"buffer_cc",e=>e?this.MidiConnection.findCCFromBufferInChannel(e):this.MidiConnection.ccInputBuffer.shift());E(this,"show_scale",(e,t,n=0,i=this.MidiConnection.currentOutputIndex||0,a=!1)=>{(!this.scale_aid||t!==this.scale_aid)&&(this.hide_scale(e,t,n,i),NG(t,e).forEach(o=>{this.MidiConnection.sendMidiOn(o,n,1,i),a&&this.MidiConnection.sendAllSoundOff(n,i)}),this.scale_aid=t)});E(this,"hide_scale",(e=0,t=0,n=0,i=this.MidiConnection.currentOutputIndex||0)=>{Array.from(Array(128).keys()).forEach(s=>{this.MidiConnection.sendMidiOff(s,n,i)}),this.scale_aid=void 0});E(this,"midi_notes_off",(e=0,t=this.MidiConnection.currentOutputIndex||0)=>{this.MidiConnection.sendAllNotesOff(e,t)});E(this,"midi_sound_off",(e=0,t=this.MidiConnection.currentOutputIndex||0)=>{this.MidiConnection.sendAllSoundOff(e,t)});E(this,"generateCacheKey",(...e)=>e.map(t=>JSON.stringify(t)).join(","));E(this,"z",(e,t={},n="")=>{const i="z"+n.toString(),a=n===""?this.generateCacheKey(e,t):i;let s;return this.app.api.patternCache.has(a)&&(s=this.app.api.patternCache.get(a),s.input!==e&&(s=void 0)),s||(s=new zG(e,t,this.app),this.app.api.patternCache.set(a,s)),typeof n=="number"&&(s.zid=i),s.updateLastCallTime(),n!==""&&s.sync("z0"),s});E(this,"z0",(e,t={})=>this.z(e,t,0));E(this,"z1",(e,t={})=>this.z(e,t,1));E(this,"z2",(e,t={})=>this.z(e,t,2));E(this,"z3",(e,t={})=>this.z(e,t,3));E(this,"z4",(e,t={})=>this.z(e,t,4));E(this,"z5",(e,t={})=>this.z(e,t,5));E(this,"z6",(e,t={})=>this.z(e,t,6));E(this,"z7",(e,t={})=>this.z(e,t,7));E(this,"z8",(e,t={})=>this.z(e,t,8));E(this,"z9",(e,t={})=>this.z(e,t,9));E(this,"z10",(e,t={})=>this.z(e,t,10));E(this,"z11",(e,t={})=>this.z(e,t,11));E(this,"z12",(e,t={})=>this.z(e,t,12));E(this,"z13",(e,t={})=>this.z(e,t,13));E(this,"z14",(e,t={})=>this.z(e,t,14));E(this,"z15",(e,t={})=>this.z(e,t,15));E(this,"z16",(e,t={})=>this.z(e,t,16));E(this,"counter",(e,t,n)=>(e in this.counters?(this.counters[e].limit!==t&&(this.counters[e].value=0,this.counters[e].limit=t),this.counters[e].step!==n&&(this.counters[e].step=n??this.counters[e].step),this.counters[e].value+=this.counters[e].step,this.counters[e].limit!==void 0&&this.counters[e].value>this.counters[e].limit&&(this.counters[e].value=0)):this.counters[e]={value:0,step:n??1,limit:t},this.counters[e].value));E(this,"$",this.counter);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,"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,t)=>typeof e=="string"&&t===void 0?this.variables[e]:(this.variables[e]=t,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,"randI",(e,t)=>Math.floor(this.randomGen()*(t-e+1))+e);E(this,"rand",(e,t)=>this.randomGen()*(t-e)+e);E(this,"irand",this.randI);E(this,"rI",this.randI);E(this,"r",this.rand);E(this,"ir",this.randI);E(this,"seed",e=>{typeof e=="number"&&(e=e.toString()),this.currentSeed!==e&&(this.currentSeed=e,this.randomGen=jm(e))});E(this,"localSeededRandom",e=>{if(typeof e=="number"&&(e=e.toString()),this.localSeeds.has(e))return this.localSeeds.get(e);const t=jm(e);return this.localSeeds.set(e,t),t});E(this,"clearLocalSeed",(e=void 0)=>{e&&this.localSeeds.delete(e.toString()),this.localSeeds.clear()});E(this,"quantize",(e,t)=>{if(t.length===0)return e;let n=t[0];return t.forEach(i=>{Math.abs(i-e)Math.min(Math.max(e,t),n));E(this,"cmp",this.clamp);E(this,"nudge",e=>(e&&(this.app.clock.nudge=e),this.app.clock.nudge));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,t)=>{this.app.clock.time_signature=[e,t]});E(this,"prob",e=>this.randomGen()*100this.randomGen()>.5);E(this,"odds",(e,t=1)=>this.randomGen()!1);E(this,"almostNever",(e=1)=>this.randomGen()<.025*this.ppqn()/(this.ppqn()*e));E(this,"rarely",(e=1)=>this.randomGen()<.1*this.ppqn()/(this.ppqn()*e));E(this,"scarcely",(e=1)=>this.randomGen()<.25*this.ppqn()/(this.ppqn()*e));E(this,"sometimes",(e=1)=>this.randomGen()<.5*this.ppqn()/(this.ppqn()*e));E(this,"often",(e=1)=>this.randomGen()<.75*this.ppqn()/(this.ppqn()*e));E(this,"frequently",(e=1)=>this.randomGen()<.9*this.ppqn()/(this.ppqn()*e));E(this,"almostAlways",(e=1)=>this.randomGen()<.985*this.ppqn()/(this.ppqn()*e));E(this,"always",(e=1)=>!0);E(this,"dice",e=>Math.floor(this.randomGen()*e)+1);E(this,"cbar",()=>this.app.clock.time_position.bar+1);E(this,"ctick",()=>this.app.clock.tick+1);E(this,"cpulse",()=>this.app.clock.time_position.pulse+1);E(this,"cbeat",()=>this.app.clock.time_position.beat+1);E(this,"ebeat",()=>this.app.clock.beats_since_origin+1);E(this,"epulse",()=>this.app.clock.pulses_since_origin+1);E(this,"nominator",()=>this.app.clock.time_signature[0]);E(this,"meter",()=>this.app.clock.time_signature[1]);E(this,"denominator",this.meter);E(this,"fill",()=>this.app.fill);E(this,"beat",(e=1,t=0)=>(Array.isArray(e)?e:[e]).map(a=>(this.app.clock.pulses_since_origin-Math.floor(t*this.ppqn()))%Math.floor(a*this.ppqn())===0).some(a=>a===!0));E(this,"b",this.beat);E(this,"bar",(e=1,t=0)=>{const n=Array.isArray(e)?e:[e],i=this.app.clock.time_signature[1]*this.ppqn(),a=Math.floor(t*i);return n.map(o=>(this.app.clock.pulses_since_origin-a)%Math.floor(o*i)===0).some(o=>o===!0)});E(this,"B",this.bar);E(this,"pulse",(e=1,t=0)=>(Array.isArray(e)?e:[e]).map(a=>(this.app.clock.pulses_since_origin-t)%a===0).some(a=>a===!0));E(this,"p",this.pulse);E(this,"tick",(e,t=0)=>(Array.isArray(e)?e:[e]).map(a=>this.app.clock.time_position.pulse===a+t).some(a=>a===!0));E(this,"flip",(e,t=50)=>{let n=e*2;const i=this.app.clock.pulses_since_origin,a=Math.floor(n*this.ppqn()),s=Math.floor(t/100*a);return i%a{let t=e*2;const n=this.app.clock.time_position.bar;return Math.floor(n/t)%2===0});E(this,"onbar",(e,t=this.app.clock.time_signature[0])=>{let n=this.app.clock.time_position.bar%t+1;return typeof e=="number"?e===n:e.some(i=>i==n)});E(this,"onbeat",(...e)=>{let t=[];return e.forEach(n=>{let i=n%this.nominator()||this.nominator(),a=Math.floor(i);a=a==0?this.nominator():a;let s=Math.floor((i-a)*this.ppqn()+1);s<=0&&(s=s+this.ppqn()*this.nominator()),t.push(a===this.cbeat()&&this.cpulse()===s)}),t.some(n=>n==!0)});E(this,"oncount",(e,t)=>{typeof e=="number"&&(e=[e]);const n=this.app.clock.pulses_since_origin;let i=[];return e.forEach(a=>{a=a<1?0:a-1;const s=Math.ceil(a*this.ppqn()),o=n%(this.ppqn()*t);return i.push(o===s)}),i.some(a=>a==!0)});E(this,"oneuclid",(e,t,n=0)=>{const a=this._euclidean_cycle(e,t,n).reduce((s,o,l)=>(o&&s.push(l+1),s),[]);return this.oncount(a,t)});E(this,"delay",(e,t)=>{setTimeout(t,e)});E(this,"delayr",(e,t,n)=>{[...Array(t).keys()].map(a=>e*a).forEach((a,s)=>{setTimeout(n,a)})});E(this,"euclid",(e,t,n,i=0)=>this._euclidean_cycle(t,n,i)[e%n]);E(this,"ec",this.euclid);E(this,"rhythm",(e,t,n,i=0)=>this.beat(e)&&this._euclidean_cycle(t,n,i).beat(e));E(this,"bin",(e,t)=>{let i=t.toString(2).split("").map(a=>a==="1");return i[e%i.length]});E(this,"binrhythm",(e,t)=>{let i=t.toString(2).split("").map(a=>a==="1");return this.beat(e)&&i.beat(e)});E(this,"line",(e,t,n=1)=>{const i=[];if(t>e&&n>0||t(Math.sin(this.app.clock.ctx.currentTime*Math.PI*2*e)+n)*t);E(this,"usine",(e=1,t=1,n=0)=>(this.sine(e,n)+1)/2*t);E(this,"saw",(e=1,t=1,n=0)=>(this.app.clock.ctx.currentTime*e%1*2-1+n)*t);E(this,"usaw",(e=1,t=1,n=0)=>(this.saw(e,n)+1)/2*t);E(this,"triangle",(e=1,t=1,n=0)=>(Math.abs(this.saw(e,n))*2-1)*t);E(this,"utriangle",(e=1,t=1,n=0)=>(this.triangle(e,n)+1)/2*t);E(this,"square",(e=1,t=1,n=0,i=.5)=>{const a=1/e;return((Date.now()/1e3+n)%a/a(this.square(e,n,i)+1)/2*t);E(this,"noise",(e=1)=>(this.randomGen()*2-1)*e);E(this,"min",(...e)=>Math.min(...e));E(this,"max",(...e)=>Math.max(...e));E(this,"mean",(...e)=>e.reduce((n,i)=>n+i,0)/e.length);E(this,"range",(e,t,n,i,a)=>(e-t)/(n-t)*(a-i)+i);E(this,"limit",(e,t,n)=>Math.min(Math.max(e,t),n));E(this,"abs",Math.abs);E(this,"speak",(e,t="en-US",n=0,i=1,a=1)=>{new OR({text:e,lang:t,voice:n,rate:i,pitch:a}).speak().then(()=>{}).catch(o=>{console.log(o)})});E(this,"stop_hydra",()=>{this.app.hydra.hush()});E(this,"sound",e=>new tg(e,this.app));E(this,"snd",this.sound);E(this,"samples",Yi);E(this,"log",e=>{console.log(e),this._logMessage(e)});E(this,"scale",T_);E(this,"rate",e=>{});E(this,"divseq",(...e)=>{const t=e[0],n=e.slice(1),i=this.app.clock.pulses_since_origin,a=Math.floor(i/Math.floor(t*this.ppqn()));return n[a%n.length]});E(this,"seqbeat",(...e)=>e[this.app.clock.time_position.beat%e.length]);E(this,"seqbar",(...e)=>e[(this.app.clock.time_position.bar+1)%e.length]);E(this,"shuffle",e=>e.sort(()=>this.randomGen()-.5));E(this,"reverse",e=>e.reverse());E(this,"rotate",e=>t=>t.slice(e,t.length).concat(t.slice(0,e)));E(this,"repeat",e=>t=>t.flatMap(n=>Array(e).fill(n)));E(this,"repeatOdd",e=>t=>t.flatMap((n,i)=>i%2===0?Array(e).fill(n):n));E(this,"repeatEven",e=>t=>t.flatMap((n,i)=>i%2!==0?Array(e).fill(n):n));E(this,"palindrome",e=>e.concat(e.slice(0,e.length-1).reverse()));E(this,"scope",e=>{this.app.osc={...this.app.osc,...e}});this.app=e,this.MidiConnection=new QG(this,e.settings)}transmission(){return this.MidiConnection.activeNotes.length>0}_euclidean_cycle(e,t,n=0){if(e==t)return Array.from({length:t},()=>!0);function i(o,l){const c=o.length,u=(l+1)%c;return o[l]>o[u]}if(e>=t)return[!0];const a=Array.from({length:t},(o,l)=>(e*(l-1)%t+t)%t);let s=a.map((o,l)=>i(a,l));return n!=0&&(s=s.slice(n).concat(s.slice(0,n))),s}}const ZG=r=>{Array.prototype.square=function(){return this.map(e=>e*e)},Array.prototype.sometimes=function(e){return r.randomGen()<.5?e(this):this},Array.prototype.apply=function(e){return e(this)},Array.prototype.sqrt=function(){if(this.some(e=>e<0))throw new Error("Cannot take square root of negative number");return this.map(e=>Math.sqrt(e))},Array.prototype.add=function(e){return this.map(t=>t+e)},Array.prototype.sub=function(e){return this.map(t=>t-e)},Array.prototype.mult=function(e){return this.map(t=>t*e)},Array.prototype.div=function(e){if(e===0)throw new Error("Division by zero");return this.map(t=>t/e)},Array.prototype.pick=function(){return this[Math.floor(r.randomGen()*this.length)]},Array.prototype.gen=function(e,t,n){return n<1?[]:Array.from({length:n},()=>Math.floor(r.randomGen()*(t-e+1))+e)},Array.prototype.bar=function(e=1){return e===1?this[r.app.clock.time_position.bar%this.length]:this[Math.floor(r.app.clock.time_position.bar/e)%this.length]},Array.prototype.beat=function(e=1){const t=e,n=r.app.clock.pulses_since_origin,i=Math.floor(n/Math.floor(t*r.ppqn()));return this[i%this.length]},Array.prototype.b=Array.prototype.beat,Array.prototype.shuffle=function(){let e=this.length,t;for(;e!==0;)t=Math.floor(r.randomGen()*e),e--,[this[e],this[t]]=[this[t],this[e]];return this},Array.prototype.rotate=function(e){const t=this.length;if(e<0)e=t+e%t;else if(e>0)e=e%t;else return this;const n=this.splice(-e,e);return this.unshift(...n),this},Array.prototype.unique=function(){const e=new Set;let t=0;for(let n=0;n100)throw new Error("Amount should be between 0 and 100");if(this.length<=1)return this;for(let t=0;t1)this.splice(t,1);else return this;else t++;return this},Array.prototype.repeat=function(e=1){if(e<1)throw new Error("Amount should be at least 1");let t=[];for(let n=0;n(i%a+a)%a,n=cR(Ds(r));return this.map(i=>{const a=Math.floor(i/n.length)*12;return n[t(i,n.length)]+e+a})};Array.prototype.scaleArp=function(r="major",e=0){const t=cR(Ds(r));let n=[];e=e>t.length?t.length:e,e=e==0?t.length:e;for(let i=0;i{r.interface.line_numbers_checkbox.checked=r.settings.line_numbers,r.interface.time_position_checkbox.checked=r.settings.time_position,r.interface.tips_checkbox.checked=r.settings.tips,r.interface.midi_clock_checkbox.checked=r.settings.send_clock,r.interface.midi_channels_scripts.checked=r.settings.midi_channels_scripts,r.interface.midi_clock_ppqn.value=r.settings.midi_clock_ppqn.toString(),r.settings.time_position||r.interface.timeviewer.classList.add("hidden"),r.interface.load_demo_songs.checked=r.settings.load_demo_songs;const e=document.querySelectorAll('[id^="tab-"]');for(let t=0;t{e[t].classList.add("bg-orange-300");for(let s=0;s{hi(),r.updateKnownUniversesView(),xc()}),r.buttonElements.play_buttons.forEach(t=>{t.addEventListener("click",()=>{r.isPlaying?(r.setButtonHighlighting("pause",!0),r.isPlaying=!r.isPlaying,r.clock.pause(),r.api.MidiConnection.sendStopMessage()):(r.setButtonHighlighting("play",!0),r.isPlaying=!r.isPlaying,r.clock.start(),r.api.MidiConnection.sendStartMessage())})}),r.buttonElements.clear_buttons.forEach(t=>{t.addEventListener("click",()=>{r.setButtonHighlighting("clear",!0),confirm("Do you want to reset the current universe?")&&(r.universes[r.selected_universe]=structuredClone(t_),r.updateEditorView())})}),r.interface.documentation_button.addEventListener("click",()=>{XI(r)}),r.interface.destroy_universes_button.addEventListener("click",()=>{confirm("Do you want to destroy all universes?")&&(r.universes={...Xo},r.updateKnownUniversesView())}),r.interface.audio_nudge_range.addEventListener("input",()=>{r.clock.nudge=parseInt(r.interface.audio_nudge_range.value)}),r.interface.dough_nudge_range.addEventListener("input",()=>{r.dough_nudge=parseInt(r.interface.dough_nudge_range.value)}),r.interface.upload_universe_button.addEventListener("click",()=>{const t=document.createElement("input");t.type="file",t.accept=".json",t.addEventListener("change",n=>{var s;const a=(s=n.target.files)==null?void 0:s[0];if(a){const o=new FileReader;o.readAsText(a,"UTF-8"),o.onload=l=>{const c=JSON.parse(l.target.result);for(const[u,p]of Object.entries(c))r.universes[u]=p},o.onerror=l=>{console.error("An error occurred reading the file:",l)}}}),document.body.appendChild(t),t.click(),document.body.removeChild(t)}),r.interface.download_universe_button.addEventListener("click",()=>{r.settings.saveApplicationToLocalStorage(r.universes,r.settings);let t=`topos-universes-${Date.now()}.json`;const n=new Blob([JSON.stringify(r.settings.universes)],{type:"application/json"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}),r.interface.load_universe_button.addEventListener("click",()=>{let t=r.interface.buffer_search.value;t.length>2&&t.length<20&&!t.includes(" ")&&(Dc(r,t),r.settings.selected_universe=t,r.interface.buffer_search.value="",Vm(),r.view.focus(),FA())}),r.interface.eval_button.addEventListener("click",()=>{r.currentFile().candidate=r.view.state.doc.toString(),r.flashBackground("#404040",200)}),r.buttonElements.stop_buttons.forEach(t=>{t.addEventListener("click",()=>{r.setButtonHighlighting("stop",!0),r.isPlaying=!1,r.clock.stop()})}),r.interface.local_button.addEventListener("click",()=>r.changeModeFromInterface("local")),r.interface.global_button.addEventListener("click",()=>r.changeModeFromInterface("global")),r.interface.init_button.addEventListener("click",()=>r.changeModeFromInterface("init")),r.interface.note_button.addEventListener("click",()=>r.changeModeFromInterface("notes")),r.interface.font_family_selector.addEventListener("change",()=>{let t=r.interface.font_family_selector.value;console.log("Picking new font : "+t),r.settings.font=t,r.view.dispatch({effects:r.fontSize.reconfigure(Me.theme({"&":{fontSize:r.settings.font_size+"px"},".cm-content":{fontFamily:t,fontSize:r.settings.font_size+"px"},".cm-gutters":{fontSize:r.settings.font_size+"px"}}))})}),r.interface.font_size_input.addEventListener("input",()=>{let t=r.interface.font_size_input.value;r.settings.font_size=parseInt(t),r.view.dispatch({effects:r.fontSize.reconfigure(Me.theme({"&":{fontSize:r.settings.font_size+"px"},".cm-content":{fontFamily:r.settings.font,fontSize:r.settings.font_size+"px"},".cm-gutters":{fontSize:r.settings.font_size+"px"}}))})}),r.interface.settings_button.addEventListener("click",()=>{const t=document.getElementById("font-family");t&&(t.value=r.settings.font);const n=r.interface.dough_nudge_range;n.value=r.dough_nudge.toString();const i=document.getElementById("doughnumber");i.value=r.dough_nudge.toString(),r.settings.font_size===null&&(r.settings.font_size=12);const a=r.interface.font_size_input;a.value=r.settings.font_size.toString();const s=r.interface.line_numbers_checkbox;s.checked=r.settings.line_numbers;const o=r.interface.time_position_checkbox;o.checked=r.settings.time_position;const l=r.interface.tips_checkbox;l.checked=r.settings.tips;const c=r.interface.midi_clock_checkbox;c.checked=r.settings.send_clock;const u=r.interface.midi_channels_scripts;u.checked=r.settings.midi_channels_scripts;const p=r.interface.midi_clock_ppqn;p.value=r.settings.midi_clock_ppqn.toString();const m=r.interface.load_demo_songs;m.checked=r.settings.load_demo_songs;const _=r.interface.vim_mode_checkbox;_.checked=r.settings.vimMode;let v=document.getElementById("modal-settings"),I=document.getElementById("editor");v==null||v.classList.remove("invisible"),I==null||I.classList.add("invisible")}),r.interface.close_settings_button.addEventListener("click",()=>{let t=document.getElementById("modal-settings"),n=document.getElementById("editor");t==null||t.classList.add("invisible"),n==null||n.classList.remove("invisible");let i=r.interface.font_size_input.value;r.settings.font_size=parseInt(i),r.view.dispatch({effects:r.fontSize.reconfigure(Me.theme({"&":{fontSize:r.settings.font_size+"px"},".cm-content":{fontFamily:r.settings.font,fontSize:r.settings.font_size+"px"},".cm-gutters":{fontSize:r.settings.font_size+"px"}}))})}),r.interface.close_universes_button.addEventListener("click",()=>{xc()}),r.interface.share_button.addEventListener("click",async()=>{r.currentFile().candidate=r.view.state.doc.toString(),r.currentFile().committed=r.view.state.doc.toString(),r.settings.saveApplicationToLocalStorage(r.universes,r.settings),await vM(r)}),r.interface.vim_mode_checkbox.addEventListener("change",()=>{let t=!!r.interface.vim_mode_checkbox.checked;r.settings.vimMode=t,r.view.dispatch({effects:r.vimModeCompartment.reconfigure(t?f_():[])})}),r.interface.line_numbers_checkbox.addEventListener("change",()=>{let n=!!r.interface.line_numbers_checkbox.checked;r.settings.line_numbers=n,r.view.dispatch({effects:r.withLineNumbers.reconfigure(n?[ey()]:[])})}),r.interface.time_position_checkbox.addEventListener("change",()=>{let t=document.getElementById("timeviewer"),n=!!r.interface.time_position_checkbox.checked;r.settings.time_position=n,n?t.classList.remove("hidden"):t.classList.add("hidden")}),r.interface.tips_checkbox.addEventListener("change",()=>{let t=!!r.interface.tips_checkbox.checked;r.settings.tips=t,r.view.dispatch({effects:r.hoveringCompartment.reconfigure(t?rR:[])})}),r.interface.midi_clock_checkbox.addEventListener("change",()=>{let t=!!r.interface.midi_clock_checkbox.checked;r.settings.send_clock=t}),r.interface.midi_channels_scripts.addEventListener("change",()=>{let t=!!r.interface.midi_channels_scripts.checked;r.settings.midi_channels_scripts=t}),r.interface.midi_clock_ppqn.addEventListener("change",()=>{let t=parseInt(r.interface.midi_clock_ppqn.value);r.settings.midi_clock_ppqn=t}),r.interface.load_demo_songs.addEventListener("change",()=>{let t=!!r.interface.load_demo_songs.checked;r.settings.load_demo_songs=t}),r.interface.universe_creator.addEventListener("submit",t=>{t.preventDefault();let i=new FormData(r.interface.universe_creator).get("universe");i&&i.length>2&&i.length<20&&(Dc(r,i),r.settings.selected_universe=i,r.interface.buffer_search.value="",Vm(),r.view.focus())}),Ra(r,r.universes[r.selected_universe.toString()].init),["introduction","interface","interaction","code","time","sound","samples","synths","chaining","patterns","ziffers","midi","functions","lfos","probabilities","variables","shortcuts","about","bonus","oscilloscope"].forEach(t=>{let n="docs_"+t;document.getElementById(n).addEventListener("click",async()=>{n!=="docs_samples"?(r.currentDocumentationPane=t,Km(r)):(console.log("Loading samples!"),await bR().then(()=>{r.docs=WI(r),r.currentDocumentationPane=t,Km(r)}))})})},ST=r=>{if(!r)return;r.width=window.innerWidth,r.height=window.innerHeight;const e=r.getContext("2d"),t=window.devicePixelRatio||1;r.width=window.innerWidth*t,r.height=window.innerHeight*t,e&&e.scale(t,t)},jG=(r,e,t=!1)=>{e.addEventListener("resize",()=>ST(r.interface.scope)),e.addEventListener("resize",()=>ST(r.interface.feedback)),e.addEventListener("beforeunload",()=>(event.preventDefault(),r.currentFile().candidate=r.view.state.doc.toString(),r.currentFile().committed=r.view.state.doc.toString(),r.settings.saveApplicationToLocalStorage(r.universes,r.settings),r.clock.stop(),null)),t&&(localStorage.openpages=Date.now(),e.addEventListener("storage",function(n){n.key=="openpages"&&(localStorage.page_available=Date.now()),n.key=="page_available"&&(document.getElementById("all").classList.add("invisible"),alert("Topos is already opened in another tab. Close this tab now to prevent data loss."))},!1))};class JG{constructor(){E(this,"settings",new bM);E(this,"universes",Xo);E(this,"selected_universe","Welcome");E(this,"fill",!1);E(this,"local_index",1);E(this,"editor_mode","global");E(this,"fontSize");E(this,"withLineNumbers");E(this,"vimModeCompartment");E(this,"hoveringCompartment");E(this,"chosenLanguage");E(this,"dynamicPlugins");E(this,"currentDocumentationPane","introduction");E(this,"exampleCounter",0);E(this,"exampleIsPlaying",!1);E(this,"editorExtensions",[]);E(this,"userPlugins",[]);E(this,"state");E(this,"view");E(this,"selectedExample","");E(this,"docs",{});E(this,"_mouseX",0);E(this,"_mouseY",0);E(this,"show_error",!1);E(this,"buttonElements",{});E(this,"interface",{});E(this,"blinkTimeouts",{});E(this,"osc",{enabled:!1,color:"#fdba74",thickness:4,fftSize:256,orientation:"horizontal",is3D:!1,size:1});E(this,"api");E(this,"audioContext");E(this,"clock");E(this,"dough_nudge",20);E(this,"manualPlay",!1);E(this,"isPlaying",!1);E(this,"hydra_backend");E(this,"hydra");E(this,"updateKnownUniversesView",()=>{let e=document.getElementById("ui-known-universe-item-template");if(!e){console.warn("Missing template #ui-known-universe-item-template");return}let t=document.getElementById("existing-universes");if(!t){console.warn("Missing element #existing-universes");return}let n=document.createElement("ul");n.className="lg:h-80 lg:text-normal text-sm h-auto lg:w-80 w-auto lg:pb-2 lg:pt-2 overflow-y-scroll text-white lg:mb-4 border rounded-lg bg-neutral-800",n.append(...Object.keys(this.universes).map(i=>{var o,l;let a=e.content.cloneNode(!0),s=window;return a.querySelector(".universe-name").textContent=i,(o=a.querySelector(".load-universe"))==null||o.addEventListener("click",()=>s._loadUniverseFromInterface(i)),(l=a.querySelector(".delete-universe"))==null||l.addEventListener("click",()=>s._deleteUniverseFromInterface(i)),a})),t.innerHTML="",t.append(n)});this.initializeElements(),this.initializeButtonGroups(),this.initializeHydra(),this.setCanvas(this.interface.feedback),this.setCanvas(this.interface.scope),this.universes={...this.settings.universes,...Xo},EM(this),this.audioContext=new AudioContext({latencyHint:"playback"}),this.clock=new j$(this,this.audioContext),this.api=new XG(this),ZG(this.api),WG(this.api),Object.entries(this.api).forEach(([t,n])=>{globalThis[t]=n}),(async()=>{await bR()})(),this.docs=WI(this),T$(this),C$(this),KG(this),TT(this),X$(this),v2(this.interface.scope,this),Ra(this,this.universes[this.selected_universe.toString()].init),this.changeModeFromInterface("global"),TM(this)}getBuffer(e){const t=this.universes[this.selected_universe.toString()];return e==="locals"?t[e][this.local_index]:t[e]}get note_buffer(){return this.getBuffer("notes")}get example_buffer(){return this.getBuffer("example")}get global_buffer(){return this.getBuffer("global")}get init_buffer(){return this.getBuffer("init")}get local_buffer(){return this.getBuffer("locals")}changeToLocalBuffer(e){const t=document.querySelectorAll('[id^="tab-"]'),n=t[e];n.classList.add("bg-orange-300");for(let a=0;a{t.forEach(a=>{let s=a.children[0];s.classList.contains("text-orange-300")&&(s.classList.remove("text-orange-300"),a.classList.remove("text-orange-300"))}),i.children[0].classList.remove("text-white"),i.children[0].classList.add("text-orange-300"),i.classList.add("text-orange-300"),i.classList.add("fill-orange-300")};switch(e){case"local":this.interface.local_script_tabs.classList.contains("hidden")&&this.interface.local_script_tabs.classList.remove("hidden"),this.editor_mode="local",this.local_index=0,document.getElementById("editor").style.height="calc(100% - 100px)",this.changeToLocalBuffer(this.local_index),n(this.interface.local_button);break;case"global":this.interface.local_script_tabs.classList.contains("hidden")||this.interface.local_script_tabs.classList.add("hidden"),this.editor_mode="global",document.getElementById("editor").style.height="100%",n(this.interface.global_button);break;case"init":this.interface.local_script_tabs.classList.contains("hidden")||this.interface.local_script_tabs.classList.add("hidden"),this.editor_mode="init",n(this.interface.init_button);break;case"notes":this.interface.local_script_tabs.classList.contains("hidden")||this.interface.local_script_tabs.classList.add("hidden"),this.editor_mode="notes",n(this.interface.note_button);break}this.view.dispatch({effects:this.chosenLanguage.reconfigure(this.editor_mode=="notes"?[BL()]:[Gg()])}),this.updateEditorView()}setButtonHighlighting(e,t){document.getElementById("play-label").textContent=e!=="pause"?"Pause":"Play",e!=="pause"?(document.getElementById("pause-icon").classList.remove("hidden"),document.getElementById("play-icon").classList.add("hidden")):(document.getElementById("pause-icon").classList.add("hidden"),document.getElementById("play-icon").classList.remove("hidden")),e==="stop"&&(this.isPlaying==!1,document.getElementById("play-label").textContent="Play",document.getElementById("pause-icon").classList.add("hidden"),document.getElementById("play-icon").classList.remove("hidden")),this.flashBackground("#404040",200);const n=['[id^="play-button-"]','[id^="clear-button-"]','[id^="stop-button-"]'];let i;switch(e){case"play":i=0;break;case"pause":i=1;break;case"clear":i=2;break;case"stop":i=3;break}document.querySelectorAll(n[i]).forEach(a=>{t&&a.children[0].classList.add("animate-pulse")}),document.querySelectorAll(n.filter((a,s)=>s!=i).join(",")).forEach(a=>{a.children[0].classList.remove("animate-pulse"),a.children[1].classList.remove("animate-pulse")})}unfocusPlayButtons(){document.querySelectorAll('[id^="play-button-"]').forEach(e=>{e.children[0].classList.remove("fill-orange-300"),e.children[0].classList.remove("animate-pulse")})}updateEditorView(){this.view.dispatch({changes:{from:0,to:this.view.state.doc.toString().length,insert:this.currentFile().candidate}})}currentFile(){switch(this.editor_mode){case"global":return this.global_buffer;case"local":return this.local_buffer;case"init":return this.init_buffer;case"notes":return this.note_buffer}}flashBackground(e,t){const n=this.view.dom,i=n.getElementsByClassName("cm-gutter");n.classList.add("fluid-bg-transition"),Array.from(i).forEach(a=>a.classList.add("fluid-bg-transition")),n.style.backgroundColor=e,Array.from(i).forEach(a=>a.style.backgroundColor=e),setTimeout(()=>{n.style.backgroundColor="",Array.from(i).forEach(a=>a.style.backgroundColor=""),n.classList.remove("fluid-bg-transition"),Array.from(i).forEach(a=>a.classList.remove("fluid-bg-transition"))},t)}initializeElements(){for(const[e,t]of Object.entries(AM))this.interface[e]=document.getElementById(t)}initializeButtonGroups(){for(const[e,t]of Object.entries(IM))this.buttonElements[e]=t.map(n=>document.getElementById(n))}initializeHydra(){this.hydra_backend=new Hydra({canvas:this.interface.hydra_canvas,detectAudio:!1,enableStreamCapture:!1}),this.hydra=this.hydra_backend.synth}setCanvas(e){if(!e)return;const t=e.getContext("2d"),n=window.devicePixelRatio||1;e.width=window.innerWidth*n,e.height=window.innerHeight*n,t&&t.scale(n,n)}}let e5=new JG;jG(e5,window,!1); +`,"\r"," "],!1,!1),an=st(",",!1),H=st("|",!1),fe=Kn([["a","z"]],!1,!1),Ie=Kn([["a","z"],"_"],!1,!1),we=Kn([["a","z"],"_",["0","9"]],!1,!1),Je=st("<",!1),ye=st(">",!1),Ht=st("@",!1),lt=st(":",!1),yt=Kn(["m","k","l","p","d","c","w","y","h","n","q","a","e","f","s","x","t","g","u","j","z","o"],!1,!1),zn=st("/",!1),dt=st("(",!1),Kt=st(")",!1),Tt=st("[:",!1),Ue=st("]",!1),Fn=st("[",!1),Fr=st("{",!1),ct=st("}",!1),Hn=st("+",!1),Nn=st("*",!1),Ii=st("%",!1),wn=st("^",!1),Wt=st("&",!1),Cr=st(">>",!1),ta=st("<<",!1),oi=st("_",!1),na=st("?",!1),cr=st("!",!1),li=st("r",!1),yr=Kn([["a","z"],["A","Z"],["0","9"]],!1,!1),jt=st("#",!1),ci=st("b",!1),ui=Kn([["a","z"],["A","Z"],["0","9"],"-","*","+"],!1,!1),q=Kn([["A","G"]],!1,!1),ie=Kn(["b","s"],!1,!1),de=st("iii",!1),_e=st("ii",!1),Ae=st("iv",!1),Qe=st("i",!1),Pe=st("vii",!1),Ct=st("vi",!1),Dn=st("v",!1),Wn=function(T){return T.filter(w=>w)},xa=function(){return parseFloat($n())},ra=function(){return parseInt($n())},xs=function(){return parseInt($n())},Xn=function(){},ks=function(T){return Ut(pG,{sound:T})},ka=function(){return $n()},La=function(T){return Ut(Io,{items:T})},Ls=function(T){return T},Ma=function(T,w){return Ut(fG,{item:T,sound:w})},Ms=function(T,w){return Ut(hG,{item:T,soundIndex:w})},Pa=function(T){return T},Yn=function(){return tG[$n()]},Ps=function(T,w){return T/w},Bs=function(T){return T.filter(w=>w)},Ba=function(T){return Ut(Io,{items:T})},Ua=function(T,w){return w?Ut(mT,{item:T,times:w}):Ut(gT,{items:T})},Us=function(T){return T},Fa=function(T,w,P){return Ut(OG,{left:T,operation:w,right:P})},Fs=function(T,w){return Ut(SG,{items:T,times:w})},Ya=function(T){return Ut(sR,{items:T})},Ys=function(T){return T.map(w=>typeof w=="number"?w:void 0)},$s=function(){return Math.ceil(iR($n()))},ur=function(T){var w=T.filter(P=>P).map(P=>Ut(ni,{pitch:P[0]},P.toString()));return Ut(gT,{items:w})},Ot=function(T){return T},Gs=function(T){return T},Ri=function(){},Qs=function(T){return Ut(Io,{items:T})},di=function(T){return Ut(gG,{octave:T})},qs=function(){return $n().split("").reduce((T,w)=>T+(w==="^"?1:-1),0)},Ni=function(){return Ut(Gc,{seededRandom:a.seededRandom})},$a=function(T,w){return Ut(Gc,{min:T,max:w,seededRandom:a.seededRandom})},Ga=function(T,w){return Ut(mT,{item:T,times:w})},Vs=function(T){return Ut(_G,{duration:T})},wi=function(T){return T},Qa=function(T){return Ut(Jm,{duration:T})},Di=function(T,w,P,X){const oe=T?a.nodeOptions.octave+T:a.nodeOptions.octave;return Ut(ni,{duration:w,pitch:X,pitchOctave:oe,add:P})},xi=function(T){return T.reduce((w,P)=>w+(P==="#"?1:-1),0)},qa=function(T,w,P){return Ut(Na,{pitches:[T].concat(w),inversion:P})},ia=function(){return $n()},pi=function(T){return T},_n=function(){return $n()},Va=function(T,w,P,X,oe){const ve=a.nodeOptions.scaleName?a.nodeOptions.scaleName:"MAJOR",ft=a.nodeOptions.key?a.nodeOptions.key:"C",fr=RG(X,P,ve,T,w),Ks=w||a.nodeOptions.duration,DR=T?a.nodeOptions.octave+T:a.nodeOptions.octave;return Ut(Na,{duration:Ks,chordOctave:DR,pitches:fr,chordName:X,inversion:oe,scaleName:ve,key:ft})},Zn=function(T,w,P){const X=a.nodeOptions.scaleName?a.nodeOptions.scaleName:"MAJOR",oe=a.nodeOptions.key?a.nodeOptions.key:"C";return Ut(mG,{roman:T,chordName:w,inversion:P,scaleName:X,key:oe})},aa=function(T){const w=a.nodeOptions.scaleName?a.nodeOptions.scaleName:"MAJOR",P=a.nodeOptions.key?a.nodeOptions.key:"C",X=BG(T,P,w);return Ut(ni,{pitch:X.pc,add:X.add,scaleName:w,key:P})},A=0,He=0,za=[{line:1,column:1}],dr=0,zs=[],Oe=0,ge={},sa;if("startRule"in a){if(!(a.startRule in l))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');c=l[a.startRule]}function $n(){return i.substring(He,A)}function dl(){return d(He,A)}function st(T,w){return{type:"literal",text:T,ignoreCase:w}}function Kn(T,w,P){return{type:"class",parts:T,inverted:w,ignoreCase:P}}function pl(){return{type:"end"}}function Hs(T){return{type:"other",description:T}}function fl(T){var w=za[T],P;if(w)return w;for(P=T-1;!za[P];)P--;for(w=za[P],w={line:w.line,column:w.column};Pdr&&(dr=A,zs=[]),zs.push(T))}function g(T,w,P){return new e(e.buildMessage(T,w),T,w,P)}function O(){var T,w,P=A*56+0,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=Xt(),w!==s&&(He=T,w=Wn(w)),T=w,ge[P]={nextPos:A,result:T},T)}function C(){var T,w,P,X,oe,ve,ft,fr=A*56+1,Ks=ge[fr];if(Ks)return A=Ks.nextPos,Ks.result;for(T=A,w=A,i.charCodeAt(A)===45?(P=u,A++):(P=s,Oe===0&&f(rn)),P===s&&(P=null),X=[],Be.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(Ze));oe!==s;)X.push(oe),Be.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(Ze));if(i.charCodeAt(A)===46?(oe=p,A++):(oe=s,Oe===0&&f(ke)),oe!==s){if(ve=[],Be.test(i.charAt(A))?(ft=i.charAt(A),A++):(ft=s,Oe===0&&f(Ze)),ft!==s)for(;ft!==s;)ve.push(ft),Be.test(i.charAt(A))?(ft=i.charAt(A),A++):(ft=s,Oe===0&&f(Ze));else ve=s;ve!==s?(P=[P,X,oe,ve],w=P):(A=w,w=s)}else A=w,w=s;if(w===s)if(w=A,i.charCodeAt(A)===46?(P=p,A++):(P=s,Oe===0&&f(ke)),P!==s){if(X=[],Be.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(Ze)),oe!==s)for(;oe!==s;)X.push(oe),Be.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(Ze));else X=s;X!==s?(P=[P,X],w=P):(A=w,w=s)}else A=w,w=s;return w!==s&&(He=T,w=xa()),T=w,ge[fr]={nextPos:A,result:T},T}function y(){var T,w,P=A*56+2,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,i.charCodeAt(A)===45?A++:Oe===0&&f(rn),Be.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(Ze)),w!==s?(He=T,T=ra()):(A=T,T=s),ge[P]={nextPos:A,result:T},T)}function D(){var T,w,P,X=A*56+3,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,i.charCodeAt(A)===45?A++:Oe===0&&f(rn),w=[],Be.test(i.charAt(A))?(P=i.charAt(A),A++):(P=s,Oe===0&&f(Ze)),P!==s)for(;P!==s;)w.push(P),Be.test(i.charAt(A))?(P=i.charAt(A),A++):(P=s,Oe===0&&f(Ze));else w=s;return w!==s?(He=T,T=xs()):(A=T,T=s),ge[X]={nextPos:A,result:T},T}function F(){var T,w,P=A*56+4,X=ge[P];return X?(A=X.nextPos,X.result):(Oe++,T=A,tt.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(Zt)),w!==s&&(He=T,w=Xn()),T=w,Oe--,T===s&&(w=s,Oe===0&&f(en)),ge[P]={nextPos:A,result:T},T)}function U(){var T,w,P=A*56+8,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=W(),w!==s&&(He=T,w=ks(w)),T=w,ge[P]={nextPos:A,result:T},T)}function W(){var T,w,P,X,oe,ve=A*56+10,ft=ge[ve];if(ft)return A=ft.nextPos,ft.result;if(T=A,rt.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(fe)),w!==s){if(P=[],ht.test(i.charAt(A))?(X=i.charAt(A),A++):(X=s,Oe===0&&f(Ie)),X!==s)for(;X!==s;)P.push(X),ht.test(i.charAt(A))?(X=i.charAt(A),A++):(X=s,Oe===0&&f(Ie));else P=s;if(P!==s){for(X=[],vt.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(we));oe!==s;)X.push(oe),vt.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(we));He=T,T=ka()}else A=T,T=s}else A=T,T=s;return ge[ve]={nextPos:A,result:T},T}function z(){var T,w=A*56+11,P=ge[w];return P?(A=P.nextPos,P.result):(T=pe(),T===s&&(T=he()),ge[w]={nextPos:A,result:T},T)}function pe(){var T,w,P,X,oe=A*56+12,ve=ge[oe];if(ve)return A=ve.nextPos,ve.result;if(T=A,i.charCodeAt(A)===60?(w=v,A++):(w=s,Oe===0&&f(Je)),w!==s){if(P=[],X=z(),X!==s)for(;X!==s;)P.push(X),X=z();else P=s;P!==s?(i.charCodeAt(A)===62?(X=I,A++):(X=s,Oe===0&&f(ye)),X!==s?(He=T,T=La(P)):(A=T,T=s)):(A=T,T=s)}else A=T,T=s;return ge[oe]={nextPos:A,result:T},T}function he(){var T,w=A*56+13,P=ge[w];return P?(A=P.nextPos,P.result):(T=W(),T===s&&(T=pe(),T===s&&(T=F())),ge[w]={nextPos:A,result:T},T)}function se(){var T,w,P,X=A*56+14,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,i.charCodeAt(A)===64?(w=R,A++):(w=s,Oe===0&&f(Ht)),w!==s?(P=z(),P!==s?(He=T,T=Ls(P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function ae(){var T,w=A*56+15,P=ge[w];return P?(A=P.nextPos,P.result):(T=sn(),T===s&&(T=it(),T===s&&(T=qt(),T===s&&(T=du(),T===s&&(T=Qt())))),ge[w]={nextPos:A,result:T},T)}function Ce(){var T,w,P,X=A*56+16,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,w=ae(),w===s&&(w=Zs()),w!==s?(P=se(),P!==s?(He=T,T=Ma(w,P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function Se(){var T,w,P,X=A*56+17,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,w=Ce(),w===s&&(w=ae(),w===s&&(w=Zs())),w!==s?(P=Ve(),P!==s?(He=T,T=Ms(w,P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function Ve(){var T,w,P,X=A*56+18,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,i.charCodeAt(A)===58?(w=x,A++):(w=s,Oe===0&&f(lt)),w!==s?(P=wt(),P!==s?(He=T,T=Pa(P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function je(){var T,w,P=A*56+19,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,mt.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(yt)),w!==s&&(He=T,w=Yn()),T=w,ge[P]={nextPos:A,result:T},T)}function Fe(){var T,w=A*56+20,P=ge[w];return P?(A=P.nextPos,P.result):(T=It(),T===s&&(T=C(),T===s&&(T=je())),ge[w]={nextPos:A,result:T},T)}function It(){var T,w,P,X,oe=A*56+21,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,w=D(),w!==s?(i.charCodeAt(A)===47?(P=$,A++):(P=s,Oe===0&&f(zn)),P!==s?(X=D(),X!==s?(He=T,T=Ps(w,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function Xt(){var T,w,P,X=A*56+22,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],P=N_(),P===s&&(P=Se(),P===s&&(P=Ce(),P===s&&(P=sn(),P===s&&(P=qt(),P===s&&(P=it(),P===s&&(P=Qt(),P===s&&(P=Zs(),P===s&&(P=du())))))))),P!==s)for(;P!==s;)w.push(P),P=N_(),P===s&&(P=Se(),P===s&&(P=Ce(),P===s&&(P=sn(),P===s&&(P=qt(),P===s&&(P=it(),P===s&&(P=Qt(),P===s&&(P=Zs(),P===s&&(P=du()))))))));else w=s;return w!==s&&(He=T,w=Bs(w)),T=w,ge[X]={nextPos:A,result:T},T}function wt(){var T,w=A*56+23,P=ge[w];return P?(A=P.nextPos,P.result):(T=F(),T===s&&(T=D(),T===s&&(T=R_(),T===s&&(T=fu(),T===s&&(T=tn(),T===s&&(T=A_()))))),ge[w]={nextPos:A,result:T},T)}function tn(){var T,w,P,X,oe=A*56+24,ve=ge[oe];if(ve)return A=ve.nextPos,ve.result;if(T=A,i.charCodeAt(A)===60?(w=v,A++):(w=s,Oe===0&&f(Je)),w!==s){if(P=[],X=wt(),X!==s)for(;X!==s;)P.push(X),X=wt();else P=s;P!==s?(i.charCodeAt(A)===62?(X=I,A++):(X=s,Oe===0&&f(ye)),X!==s?(He=T,T=Ba(P)):(A=T,T=s)):(A=T,T=s)}else A=T,T=s;return ge[oe]={nextPos:A,result:T},T}function it(){var T,w,P,X,oe,ve=A*56+25,ft=ge[ve];return ft?(A=ft.nextPos,ft.result):(T=A,i.charCodeAt(A)===40?(w=Z,A++):(w=s,Oe===0&&f(dt)),w!==s?(i.charCodeAt(A)===58?A++:Oe===0&&f(lt),P=Xt(),P!==s?(X=pt(),X===s&&(X=null),i.charCodeAt(A)===41?(oe=h,A++):(oe=s,Oe===0&&f(Kt)),oe!==s?(He=T,T=Ua(P,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[ve]={nextPos:A,result:T},T)}function pt(){var T,w,P,X=A*56+26,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,i.charCodeAt(A)===58?(w=x,A++):(w=s,Oe===0&&f(lt)),w!==s?(P=D(),P!==s?(He=T,T=Us(P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function sn(){var T,w,P,X,oe=A*56+27,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,w=it(),w!==s?(P=I_(),P!==s?(X=it(),X!==s?(He=T,T=Fa(w,P,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function Qt(){var T,w,P,X,oe,ve=A*56+28,ft=ge[ve];return ft?(A=ft.nextPos,ft.result):(T=A,i.substr(A,2)===b?(w=b,A+=2):(w=s,Oe===0&&f(Tt)),w!==s?(P=Xt(),P!==s?(X=pt(),X===s&&(X=null),i.charCodeAt(A)===93?(oe=S,A++):(oe=s,Oe===0&&f(Ue)),oe!==s?(He=T,T=Fs(P,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[ve]={nextPos:A,result:T},T)}function qt(){var T,w,P,X,oe=A*56+29,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.charCodeAt(A)===91?(w=N,A++):(w=s,Oe===0&&f(Fn)),w!==s?(P=Xt(),P!==s?(i.charCodeAt(A)===93?(X=S,A++):(X=s,Oe===0&&f(Ue)),X!==s?(He=T,T=Ya(P)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function pr(){var T,w=A*56+30,P=ge[w];return P?(A=P.nextPos,P.result):(T=D(),T===s&&(T=y()),ge[w]={nextPos:A,result:T},T)}function Ws(){var T,w,P,X=A*56+31,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],P=hl(),P===s&&(P=pr()),P!==s)for(;P!==s;)w.push(P),P=hl(),P===s&&(P=pr());else w=s;return w!==s&&(He=T,w=Ys(w)),T=w,ge[X]={nextPos:A,result:T},T}function hl(){var T,w,P,X,oe=A*56+32,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.charCodeAt(A)===40?A++:Oe===0&&f(dt),w=pr(),w!==s?(P=I_(),P!==s?(X=Ws(),X!==s?(i.charCodeAt(A)===41?A++:Oe===0&&f(Kt),He=T,T=$s()):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function Xs(){var T,w,P,X,oe=A*56+33,ve=ge[oe];if(ve)return A=ve.nextPos,ve.result;if(T=A,i.charCodeAt(A)===123?(w=k,A++):(w=s,Oe===0&&f(Fr)),w!==s){if(P=[],X=Ws(),X===s&&(X=F()),X!==s)for(;X!==s;)P.push(X),X=Ws(),X===s&&(X=F());else P=s;P!==s?(i.charCodeAt(A)===125?(X=L,A++):(X=s,Oe===0&&f(ct)),X!==s?(He=T,T=ur(P)):(A=T,T=s)):(A=T,T=s)}else A=T,T=s;return ge[oe]={nextPos:A,result:T},T}function A_(){var T,w,P,X,oe=A*56+34,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.charCodeAt(A)===123?(w=k,A++):(w=s,Oe===0&&f(Fr)),w!==s?(P=D(),P===s&&(P=fu()),P!==s?(i.charCodeAt(A)===125?(X=L,A++):(X=s,Oe===0&&f(ct)),X!==s?(He=T,T=Ot(P)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function I_(){var T,w=A*56+35,P=ge[w];return P?(A=P.nextPos,P.result):(i.charCodeAt(A)===43?(T=M,A++):(T=s,Oe===0&&f(Hn)),T===s&&(i.charCodeAt(A)===45?(T=u,A++):(T=s,Oe===0&&f(rn)),T===s&&(i.charCodeAt(A)===42?(T=G,A++):(T=s,Oe===0&&f(Nn)),T===s&&(i.charCodeAt(A)===47?(T=$,A++):(T=s,Oe===0&&f(zn)),T===s&&(i.charCodeAt(A)===37?(T=te,A++):(T=s,Oe===0&&f(Ii)),T===s&&(i.charCodeAt(A)===94?(T=re,A++):(T=s,Oe===0&&f(wn)),T===s&&(i.charCodeAt(A)===124?(T=_,A++):(T=s,Oe===0&&f(H)),T===s&&(i.charCodeAt(A)===38?(T=ne,A++):(T=s,Oe===0&&f(Wt)),T===s&&(i.substr(A,2)===ee?(T=ee,A+=2):(T=s,Oe===0&&f(Cr)),T===s&&(i.substr(A,2)===B?(T=B,A+=2):(T=s,Oe===0&&f(ta))))))))))),ge[w]={nextPos:A,result:T},T)}function Zs(){var T,w,P=A*56+36,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=yR(),w===s&&(w=NR(),w===s&&(w=RR(),w===s&&(w=wR(),w===s&&(w=U(),w===s&&(w=IR(),w===s&&(w=ml(),w===s&&(w=vR(),w===s&&(w=F(),w===s&&(w=TR(),w===s&&(w=it(),w===s&&(w=Xs(),w===s&&(w=ER())))))))))))),w!==s&&(He=T,w=Gs(w)),T=w,ge[P]={nextPos:A,result:T},T)}function ER(){var T,w,P=A*56+37,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,i.charCodeAt(A)===124?(w=_,A++):(w=s,Oe===0&&f(H)),w!==s&&(He=T,w=Ri()),T=w,ge[P]={nextPos:A,result:T},T)}function du(){var T,w,P,X,oe=A*56+38,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.charCodeAt(A)===60?(w=v,A++):(w=s,Oe===0&&f(Je)),w!==s?(P=Xt(),P!==s?(i.charCodeAt(A)===62?(X=I,A++):(X=s,Oe===0&&f(ye)),X!==s?(He=T,T=Qs(P)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function vR(){var T,w,P=A*56+39,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=pu(),w!==s&&(He=T,w=di(w)),T=w,ge[P]={nextPos:A,result:T},T)}function pu(){var T,w,P,X=A*56+40,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],i.charCodeAt(A)===94?(P=re,A++):(P=s,Oe===0&&f(wn)),P===s&&(i.charCodeAt(A)===95?(P=Q,A++):(P=s,Oe===0&&f(oi))),P!==s)for(;P!==s;)w.push(P),i.charCodeAt(A)===94?(P=re,A++):(P=s,Oe===0&&f(wn)),P===s&&(i.charCodeAt(A)===95?(P=Q,A++):(P=s,Oe===0&&f(oi)));else w=s;return w!==s&&(He=T,w=qs()),T=w,ge[X]={nextPos:A,result:T},T}function R_(){var T,w,P=A*56+41,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,i.charCodeAt(A)===63?(w=j,A++):(w=s,Oe===0&&f(na)),w!==s&&(He=T,w=Ni()),T=w,ge[P]={nextPos:A,result:T},T)}function fu(){var T,w,P,X,oe,ve,ft=A*56+42,fr=ge[ft];return fr?(A=fr.nextPos,fr.result):(T=A,i.charCodeAt(A)===40?(w=Z,A++):(w=s,Oe===0&&f(dt)),w!==s?(P=D(),P!==s?(i.charCodeAt(A)===44?(X=m,A++):(X=s,Oe===0&&f(an)),X!==s?(oe=D(),oe!==s?(i.charCodeAt(A)===41?(ve=h,A++):(ve=s,Oe===0&&f(Kt)),ve!==s?(He=T,T=$a(P,oe)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[ft]={nextPos:A,result:T},T)}function N_(){var T,w,P,X,oe=A*56+43,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,w=Se(),w===s&&(w=Ce(),w===s&&(w=ae(),w===s&&(w=Zs()))),w!==s?(i.charCodeAt(A)===33?(P=K,A++):(P=s,Oe===0&&f(cr)),P!==s?(X=D(),X!==s?(He=T,T=Ga(w,X)):(A=T,T=s)):(A=T,T=s)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function TR(){var T,w,P=A*56+44,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=Fe(),w!==s&&(He=T,w=Vs(w)),T=w,ge[P]={nextPos:A,result:T},T)}function CR(){var T,w,P,X=A*56+45,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,w=Fe(),w!==s?(i.charCodeAt(A)===94?(P=re,A++):(P=s,Oe===0&&f(wn)),P!==s?(He=T,T=wi(w)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function yR(){var T,w,P,X,oe,ve=A*56+46,ft=ge[ve];return ft?(A=ft.nextPos,ft.result):(T=A,w=CR(),w===s&&(w=null),i.charCodeAt(A)===114?(P=ue,A++):(P=s,Oe===0&&f(li)),P!==s?(X=A,Oe++,At.test(i.charAt(A))?(oe=i.charAt(A),A++):(oe=s,Oe===0&&f(yr)),Oe--,oe===s?X=void 0:(A=X,X=s),X!==s?(He=T,T=Qa(w)):(A=T,T=s)):(A=T,T=s),ge[ve]={nextPos:A,result:T},T)}function ml(){var T,w,P,X,oe,ve=A*56+47,ft=ge[ve];return ft?(A=ft.nextPos,ft.result):(T=A,w=pu(),w===s&&(w=null),P=Fe(),P===s&&(P=null),X=AR(),X===s&&(X=null),oe=y(),oe===s&&(oe=R_(),oe===s&&(oe=fu(),oe===s&&(oe=A_()))),oe!==s?(He=T,T=Di(w,P,X,oe)):(A=T,T=s),ge[ve]={nextPos:A,result:T},T)}function AR(){var T,w,P,X=A*56+48,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],i.charCodeAt(A)===35?(P=le,A++):(P=s,Oe===0&&f(jt)),P===s&&(i.charCodeAt(A)===98?(P=be,A++):(P=s,Oe===0&&f(ci))),P!==s)for(;P!==s;)w.push(P),i.charCodeAt(A)===35?(P=le,A++):(P=s,Oe===0&&f(jt)),P===s&&(i.charCodeAt(A)===98?(P=be,A++):(P=s,Oe===0&&f(ci)));else w=s;return w!==s&&(He=T,w=xi(w)),T=w,ge[X]={nextPos:A,result:T},T}function IR(){var T,w,P,X,oe=A*56+49,ve=ge[oe];if(ve)return A=ve.nextPos,ve.result;if(T=A,w=ml(),w!==s){if(P=[],X=ml(),X!==s)for(;X!==s;)P.push(X),X=ml();else P=s;P!==s?(X=hu(),X===s&&(X=null),He=T,T=qa(w,P,X)):(A=T,T=s)}else A=T,T=s;return ge[oe]={nextPos:A,result:T},T}function w_(){var T,w,P,X=A*56+50,oe=ge[X];if(oe)return A=oe.nextPos,oe.result;if(T=A,w=[],Nt.test(i.charAt(A))?(P=i.charAt(A),A++):(P=s,Oe===0&&f(ui)),P!==s)for(;P!==s;)w.push(P),Nt.test(i.charAt(A))?(P=i.charAt(A),A++):(P=s,Oe===0&&f(ui));else w=s;return w!==s&&(He=T,w=ia()),T=w,ge[X]={nextPos:A,result:T},T}function hu(){var T,w,P,X=A*56+51,oe=ge[X];return oe?(A=oe.nextPos,oe.result):(T=A,i.charCodeAt(A)===37?(w=te,A++):(w=s,Oe===0&&f(Ii)),w!==s?(P=D(),P!==s?(He=T,T=pi(P)):(A=T,T=s)):(A=T,T=s),ge[X]={nextPos:A,result:T},T)}function D_(){var T,w,P=A*56+52,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,Rn.test(i.charAt(A))?(w=i.charAt(A),A++):(w=s,Oe===0&&f(q)),w!==s?(qe.test(i.charAt(A))?(i.charAt(A),A++):Oe===0&&f(ie),He=T,T=_n()):(A=T,T=s),ge[P]={nextPos:A,result:T},T)}function RR(){var T,w,P,X,oe,ve,ft=A*56+53,fr=ge[ft];return fr?(A=fr.nextPos,fr.result):(T=A,w=pu(),w===s&&(w=null),P=Fe(),P===s&&(P=null),X=D_(),X!==s?(i.charCodeAt(A)===94?A++:Oe===0&&f(wn),oe=w_(),oe!==s?(ve=hu(),ve===s&&(ve=null),He=T,T=Va(w,P,X,oe,ve)):(A=T,T=s)):(A=T,T=s),ge[ft]={nextPos:A,result:T},T)}function NR(){var T,w,P,X,oe=A*56+54,ve=ge[oe];return ve?(A=ve.nextPos,ve.result):(T=A,i.substr(A,3)===De?(w=De,A+=3):(w=s,Oe===0&&f(de)),w===s&&(i.substr(A,2)===xe?(w=xe,A+=2):(w=s,Oe===0&&f(_e)),w===s&&(i.substr(A,2)===Ee?(w=Ee,A+=2):(w=s,Oe===0&&f(Ae)),w===s&&(i.charCodeAt(A)===105?(w=Ne,A++):(w=s,Oe===0&&f(Qe)),w===s&&(i.substr(A,3)===ce?(w=ce,A+=3):(w=s,Oe===0&&f(Pe)),w===s&&(i.substr(A,2)===Le?(w=Le,A+=2):(w=s,Oe===0&&f(Ct)),w===s&&(i.charCodeAt(A)===118?(w=Xe,A++):(w=s,Oe===0&&f(Dn)))))))),w!==s?(i.charCodeAt(A)===94?A++:Oe===0&&f(wn),P=w_(),P===s&&(P=null),X=hu(),X===s&&(X=null),He=T,T=Zn(w,P,X)):(A=T,T=s),ge[oe]={nextPos:A,result:T},T)}function wR(){var T,w,P=A*56+55,X=ge[P];return X?(A=X.nextPos,X.result):(T=A,w=D_(),w!==s&&(He=T,w=aa(w)),T=w,ge[P]={nextPos:A,result:T},T)}var x_=a.nodeOptions||{};function Ut(T,w,P=void 0){w.text=P||$n(),w.location=dl();for(var X in x_)(w[X]===void 0||w[X]===null)&&(w[X]=x_[X]);return new T(w)}if(sa=c(),sa!==s&&A===i.length)return sa;throw sa!==s&&Ae.collect("pitch"))}notes(){return this.evaluated.map(e=>e.collect("note"))}sounds(){return this.evaluated.map(e=>e.collect("sound"))}indices(){return this.evaluated.map(e=>e.collect("soundIndex"))}freqs(){return this.evaluated.map(e=>e.collect("freq"))}durations(){return this.evaluated.map(e=>e.collect("duration"))}octaves(){return this.evaluated.map(e=>e.collect("octave"))}retrograde(){return this.evaluated=this.evaluated.reverse(),this}scale(e){return this.applyOptions({scale:e}),this}key(e){return this.applyOptions({key:e}),this}octave(e){return this.applyOptions({octave:e}),this}invert(e){return this.applyOptions({inversion:e}),this}isInOptions(e,t){return this.options.nodeOptions&&this.options.nodeOptions[e]===t}atLast(){return this.index+1>=this.evaluated.length*this.redo}clone(){return ti(this)}notStarted(){return this.index<0}peek(){return this.evaluated[this.index-1||0]}hasStarted(){return this.index>=0}next(){this.index<0&&(this.index=0);const e=this.evaluated[this.index%this.evaluated.length];return this.index++,this.counter++,this.redo>0&&this.index>=this.evaluated.length*this.redo&&(this.index=0,this.evaluated=this.evaluate(this.values)),e}applyOptions(e={}){this.evaluated=this.evaluate(this.evaluated,e),this.applyTransformations()}applyTransformations(){var e;(e=this.globalOptions)!=null&&e.retrograde&&(this.evaluated=this.evaluated.reverse())}update(){return this.evaluated=this.evaluate(this.values),this.applyTransformations(),this}evaluate(e,t={}){let n=e.map(i=>i.evaluate(t)).flat(1/0).filter(i=>i!==void 0);return t.subdivisions&&(n=fR(n)),n}totalDuration(){return this.evaluated.reduce((t,n)=>t+n.collect("duration"),0)}lead(){let e=this.evaluated.findIndex(t=>t instanceof Na);if(e>=0){for(let t=e+1;t<=this.evaluated.length;t++)if(this.evaluated[t]instanceof Na){const n=this.evaluated[e],i=this.evaluated[t],a=FG(n.notes(),i.notes()),s=ti(i);s.voiceLeadFromNotes(a,this.options.nodeOptions),this.evaluated[t]=s,e=t}}return this}}const fR=(r,e=void 0)=>r.map(n=>{if(n instanceof sR){const i=n.evaluated.length,a=(e||n.duration)/i;return fR(n.evaluated,a)}else return n.duration=e||n.duration,n}).flat(1/0),GG=r=>{let e={};return dG.forEach(t=>{if(r[t]!==void 0){const n=r[t];e[t]=n,delete r[t]}}),e};class QG{constructor(e,t){E(this,"api");E(this,"settings");E(this,"midiAccess",null);E(this,"midiOutputs",[]);E(this,"currentOutputIndex",0);E(this,"scheduledNotes",{});E(this,"midiInputs",[]);E(this,"currentInputIndex");E(this,"bufferLength",512);E(this,"noteInputBuffer",[]);E(this,"ccInputBuffer",[]);E(this,"activeNotes",[]);E(this,"stickyNotes",[]);E(this,"lastNote");E(this,"lastCC",{});E(this,"lastNoteInChannel",{});E(this,"lastCCInChannel",{});E(this,"midiClockInputIndex");E(this,"midiClockInput");E(this,"lastTimestamp",0);E(this,"midiClockDelta",0);E(this,"lastBPM");E(this,"roundedBPM",0);E(this,"clockBuffer",[]);E(this,"clockBufferLength",24);E(this,"clockTicks",0);E(this,"clockErrorCount",0);E(this,"skipOnError",0);this.api=e,this.settings=t,this.lastBPM=e.bpm(),this.roundedBPM=this.lastBPM,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."),this.currentOutputIndex=-1),this.midiInputs=Array.from(this.midiAccess.inputs.values()),this.midiInputs.length===0?console.warn("No MIDI inputs available."):this.updateInputSelects()}catch(e){console.error("Failed to initialize MIDI:",e)}}getCurrentMidiPort(){return this.midiOutputs.length>0&&this.currentOutputIndex>=0&&this.currentOutputIndex0&&this.currentOutputIndex>=0&&this.currentOutputIndex0){const e=document.getElementById("midi-clock-input"),t=document.getElementById("default-midi-input");e.innerHTML="",t.innerHTML="";const n=document.createElement("option");n.value="-1",n.text="Internal",e.appendChild(n);const i=document.createElement("option");if(i.value="-1",i.text="None",t.appendChild(i),this.midiInputs.forEach((a,s)=>{const o=document.createElement("option");o.value=s.toString(),o.text=a.name||s.toString(),e.appendChild(o),t.appendChild(o.cloneNode(!0))}),this.settings.midi_clock_input){const a=this.getMidiInputIndex(this.settings.midi_clock_input);e.value=a.toString(),a>0&&(this.midiClockInput=this.midiInputs[a],this.registerMidiInputListener(a))}else e.value="-1";if(this.settings.default_midi_input){const a=this.getMidiInputIndex(this.settings.default_midi_input);t.value=a.toString(),a>0&&(this.currentInputIndex=a,this.registerMidiInputListener(a))}else t.value="-1";e.addEventListener("change",a=>{const s=a.target.value;if(s==="-1")this.midiClockInput&&this.midiClockInputIndex!=this.currentInputIndex&&(this.midiClockInput.onmidimessage=null),this.midiClockInput=void 0,this.settings.midi_clock_input=void 0;else{const o=parseInt(s);this.midiClockInputIndex=o,this.midiClockInput&&this.midiClockInputIndex!=this.currentInputIndex&&(this.midiClockInput.onmidimessage=null),this.midiClockInput=this.midiInputs[o],this.registerMidiInputListener(o),this.settings.midi_clock_input=this.midiClockInput.name||void 0}}),t.addEventListener("change",a=>{const s=a.target.value;s==="-1"?(this.currentInputIndex&&this.currentInputIndex!=this.midiClockInputIndex&&this.unregisterMidiInputListener(this.currentInputIndex),this.currentInputIndex=void 0,this.settings.default_midi_input=void 0):(this.currentInputIndex&&this.currentInputIndex!=this.midiClockInputIndex&&this.unregisterMidiInputListener(this.currentInputIndex),this.currentInputIndex=parseInt(s),this.registerMidiInputListener(this.currentInputIndex),this.settings.default_midi_input=this.midiInputs[this.currentInputIndex].name||void 0)})}}registerMidiInputListener(e){if(e!==void 0){const t=this.midiInputs[e];t&&!t.onmidimessage&&(t.onmidimessage=n=>{const i=n;if(t.name===this.settings.midi_clock_input&&(i.data[0]===248?this.skipOnError>0?this.skipOnError-=1:this.onMidiClock(n.timeStamp):i.data[0]===250?(console.log("MIDI start received"),this.api.stop(),this.api.play()):i.data[0]===252?(console.log("MIDI stop received"),this.api.pause()):i.data[0]===251?(console.log("MIDI continue received"),this.api.play()):i.data[0]===254&&console.log("MIDI active sensing received")),t.name===this.settings.default_midi_input){if(i.data[0]>=144&&i.data[0]<=159){const a=i.data[0]-144+1,s=i.data[1],o=i.data[2];this.lastNote={note:s,velocity:o,channel:a,timestamp:n.timeStamp},this.lastNoteInChannel[a]={note:s,velocity:o,channel:a,timestamp:n.timeStamp},this.settings.midi_channels_scripts&&this.api.script(a),this.pushToMidiInputBuffer({note:s,velocity:o,channel:a,timestamp:n.timeStamp}),this.activeNotes.push({note:s,velocity:o,channel:a,timestamp:n.timeStamp}),this.removeFromStickyNotes(s,a)||this.stickyNotes.push({note:s,velocity:o,channel:a,timestamp:n.timeStamp})}if(i.data[0]>=128&&i.data[0]<=143){const a=i.data[0]-128+1,s=i.data[1];this.removeFromActiveNotes(s,a)}if(i.data[0]>=176&&i.data[0]<=191){const a=i.data[0]-176+1,s=i.data[1],o=i.data[2];this.lastCC[s]=o,this.lastCCInChannel[a]?this.lastCCInChannel[a][s]=o:(this.lastCCInChannel[a]={},this.lastCCInChannel[a][s]=o),this.pushToMidiCCBuffer({control:s,value:o,channel:a,timestamp:n.timeStamp})}}})}}removeFromActiveNotes(e,t){const n=this.activeNotes.findIndex(i=>i.note===e&&i.channel===t);n>=0&&this.activeNotes.splice(n,1)}removeFromStickyNotes(e,t){const n=this.stickyNotes.findIndex(i=>i.note===e&&i.channel===t);return n>=0?(this.stickyNotes.splice(n,1),!0):!1}stickyNotesFromChannel(e){return this.stickyNotes.filter(t=>t.channel===e)}activeNotesFromChannel(e){return this.activeNotes.filter(t=>t.channel===e)}killActiveNotes(){this.activeNotes=[]}killActiveNotesFromChannel(e){this.activeNotes=this.activeNotes.filter(t=>t.channel!==e)}pushToMidiInputBuffer(e){this.noteInputBuffer.push(e),this.noteInputBuffer.length>this.bufferLength&&this.noteInputBuffer.shift()}pushToMidiCCBuffer(e){this.ccInputBuffer.push(e),this.ccInputBuffer.length>this.bufferLength&&this.ccInputBuffer.shift()}findNoteFromBufferInChannel(e){const t=this.noteInputBuffer.findIndex(n=>n.channel===e);if(t>=0){const n=this.noteInputBuffer[t];return this.noteInputBuffer.splice(t,1),n}else return}findCCFromBufferInChannel(e){const t=this.ccInputBuffer.findIndex(n=>n.channel===e);if(t>=0){const n=this.ccInputBuffer[t];return this.ccInputBuffer.splice(t,1),n}else return}unregisterMidiInputListener(e){if(e!==void 0){const t=this.midiInputs[e];t&&(t.onmidimessage=null)}}onMidiClock(e){if(this.clockTicks+=1,this.lastTimestamp>0)if(this.lastTimestamp===e)this.clockErrorCount+=1;else if(this.clockErrorCount>0)console.log("Timestamp error count: ",this.clockErrorCount),console.log("Current timestamp: ",e),console.log("Last timestamp: ",this.lastTimestamp),console.log("Last delta: ",this.midiClockDelta),console.log("Current delta: ",e-this.lastTimestamp),console.log("BPMs",this.clockBuffer),this.clockErrorCount=0,this.skipOnError=this.settings.midi_clock_ppqn/4,e=0;else{this.midiClockDelta=e-this.lastTimestamp,this.lastBPM=60*(1e3/this.midiClockDelta/this.settings.midi_clock_ppqn),this.clockBuffer.push(this.lastBPM),this.clockBuffer.length>this.clockBufferLength&&this.clockBuffer.shift();const t=this.estimatedBPM();t!==this.roundedBPM&&(console.log("Estimated BPM: ",t),this.api.bpm(t),this.roundedBPM=t)}this.lastTimestamp=e}estimatedBPM(){const e=this.clockBuffer.reduce((t,n)=>t+n);return Math.round(e/this.clockBuffer.length)}sendMidiClock(){if(!this.midiClockInput){const e=this.midiOutputs[this.currentOutputIndex];e&&e.send([248])}}switchMidiOutput(e){const t=this.getMidiOutputIndex(e);return t!==-1?(this.currentOutputIndex=t,!0):!1}getMidiOutputIndex(e){if(typeof e=="number")return e<0||e>=this.midiOutputs.length?(console.error(`Invalid MIDI output index. Index must be in the range 0-${this.midiOutputs.length-1}.`),this.currentOutputIndex):e;{const t=this.midiOutputs.findIndex(n=>n.name===e);return t!==-1?t:(console.error(`MIDI output "${e}" not found.`),this.currentOutputIndex)}}getMidiInputIndex(e){if(typeof e=="number")return e<0||e>=this.midiInputs.length?(console.error(`Invalid MIDI input index. Index must be in the range 0-${this.midiInputs.length-1}.`),-1):e;{const t=this.midiInputs.findIndex(n=>n.name===e);return t!==-1?t:(console.error(`MIDI input "${e}" not found.`),-1)}}listMidiOutputs(){let e="Available MIDI Outputs: ";return this.midiOutputs.forEach((t,n)=>{e+=`(${n+1}) ${t.name} `}),e}sendMidiNote(e,t,n,i,a=this.currentOutputIndex,s=void 0){typeof a=="string"&&(a=this.getMidiOutputIndex(a));const o=this.midiOutputs[a];if(e=Math.min(Math.max(e,0),127),o){const l=[144+t,e,n],c=[128+t,e,0];o.send(l),s&&this.sendPitchBend(s,t,a);const u=setTimeout(()=>{o.send(c),s&&this.sendPitchBend(8192,t,a),delete this.scheduledNotes[e]},(i-.02)*1e3);this.scheduledNotes[e]=u}else console.error("MIDI output not available.")}sendMidiOn(e,t,n,i=this.currentOutputIndex){typeof i=="string"&&(i=this.getMidiOutputIndex(i));const a=this.midiOutputs[i];if(e=Math.min(Math.max(e,0),127),a){const s=[144+t,e,n];a.send(s)}else console.error("MIDI output not available.")}sendMidiOff(e,t,n=this.currentOutputIndex){typeof n=="string"&&(n=this.getMidiOutputIndex(n));const i=this.midiOutputs[n];if(e=Math.min(Math.max(e,0),127),i){const a=[128+t,e,0];i.send(a)}else console.error("MIDI output not available.")}sendAllNotesOff(e,t=this.currentOutputIndex){typeof t=="string"&&(t=this.getMidiOutputIndex(t));const n=this.midiOutputs[t];if(n){const i=[176+e,123,0];n.send(i)}else console.error("MIDI output not available.")}sendAllSoundOff(e,t=this.currentOutputIndex){typeof t=="string"&&(t=this.getMidiOutputIndex(t));const n=this.midiOutputs[t];if(n){const i=[176+e,120,0];n.send(i)}else console.error("MIDI output not available.")}sendSysExMessage(e){const t=this.midiOutputs[this.currentOutputIndex];t?t.send(e):console.error("MIDI output not available.")}sendPitchBend(e,t,n=this.currentOutputIndex){(e<0||e>16383)&&console.error("Invalid pitch bend value. Value must be in the range 0-16383."),(t<0||t>15)&&console.error("Invalid MIDI channel. Channel must be in the range 0-15."),typeof n=="string"&&(n=this.getMidiOutputIndex(n));const i=this.midiOutputs[n];if(i){const a=e&127,s=e>>7&127;i.send([224|t,a,s])}else console.error("MIDI output not available.")}sendProgramChange(e,t){const n=this.midiOutputs[this.currentOutputIndex];n?n.send([192+t,e]):console.error("MIDI output not available.")}sendMidiControlChange(e,t,n){const i=this.midiOutputs[this.currentOutputIndex];i?i.send([176+n,e,t]):console.error("MIDI output not available.")}panic(){const e=this.midiOutputs[this.currentOutputIndex];if(e){for(const t in this.scheduledNotes){const n=this.scheduledNotes[t];clearTimeout(n),e.send([128,parseInt(t),0])}this.scheduledNotes={}}else console.error("MIDI output not available.")}}class qG{constructor(e,t,n){E(this,"min");E(this,"max");E(this,"wrap");E(this,"position");this.min=e,this.max=t,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}}class C_{constructor(e){E(this,"seedValue");E(this,"randomGen",Math.random);E(this,"app");E(this,"values",{});E(this,"evenbar",e=>this.app.clock.time_position.bar%2===0?this.modify(e):this);E(this,"even",e=>this.app.clock.time_position.beat%2===0?this.modify(e):this);E(this,"odd",e=>this.app.clock.time_position.beat%2!==0?this.modify(e):this);E(this,"odds",(e,t)=>this.randomGen()this);E(this,"almostNever",e=>this.odds(.025,e));E(this,"rarely",e=>this.odds(.1,e));E(this,"scarcely",e=>this.odds(.25,e));E(this,"sometimes",e=>this.odds(.5,e));E(this,"often",e=>this.odds(.75,e));E(this,"frequently",e=>this.odds(.9,e));E(this,"almostAlways",e=>this.odds(.985,e));E(this,"always",e=>this.modify(e));E(this,"modify",e=>e(this));E(this,"seed",e=>(this.seedValue=e.toString(),this.randomGen=this.app.api.localSeededRandom(this.seedValue),this));E(this,"clear",()=>(this.app.api.clearLocalSeed(this.seedValue),this));E(this,"apply",e=>this.modify(e));E(this,"length",e=>(this.values.length=e,this));this.app=e,this.app.api.currentSeed&&(this.randomGen=this.app.api.randomGen)}}class hR extends C_{constructor(t){super(t);E(this,"octave",t=>(this.values.octave=t,this.update(),this));E(this,"key",t=>(this.values.key=t,this.update(),this));E(this,"scale",t=>(b_(t)?(this.values.scaleName=t,this.values.parsedScale=vi(t)):this.values.parsedScale=E_(t),this.update(),this));E(this,"freq",t=>{this.values.freq=t;const n=bG(t);return n%1!==0?(this.values.note=Math.floor(n),this.values.bend=oR(n)[1]):this.values.note=n,this});E(this,"update",()=>{})}}class tg extends hR{constructor(t,n){super(n);E(this,"nudge");E(this,"volume",t=>this.updateValue("volume",t));E(this,"vol",this.volume);E(this,"zrand",t=>this.updateValue("zrand",t));E(this,"curve",t=>this.updateValue("curve",t));E(this,"slide",t=>this.updateValue("slide",t));E(this,"sld",this.slide);E(this,"deltaSlide",t=>this.updateValue("deltaSlide",t));E(this,"dslide",this.deltaSlide);E(this,"pitchJump",t=>this.updateValue("pitchJump",t));E(this,"pj",this.pitchJump);E(this,"pitchJumpTime",t=>this.updateValue("pitchJumpTime",t));E(this,"pjt",this.pitchJumpTime);E(this,"lfo",t=>this.updateValue("lfo",t));E(this,"znoise",t=>this.updateValue("znoise",t));E(this,"noise",t=>this.updateValue("noise",t));E(this,"zmod",t=>this.updateValue("zmod",t));E(this,"zcrush",t=>this.updateValue("zcrush",t));E(this,"zdelay",t=>this.updateValue("zdelay",t));E(this,"sustainVolume",t=>this.updateValue("sustainVolume",t));E(this,"tremolo",t=>this.updateValue("tremolo",t));E(this,"dur",t=>this.updateValue("dur",t));E(this,"zzfx",t=>this.updateValue("zzfx",t));E(this,"fmi",t=>this.updateValue("fmi",t));E(this,"fmh",t=>this.updateValue("fmh",t));E(this,"fmenv",t=>this.updateValue("fmenv",t));E(this,"fmattack",t=>this.updateValue("fmattack",t));E(this,"fmatk",this.fmattack);E(this,"fmdecay",t=>this.updateValue("fmdecay",t));E(this,"fmdec",this.fmdecay);E(this,"fmsustain",t=>this.updateValue("fmsustain",t));E(this,"fmsus",this.fmsustain);E(this,"fmrelease",t=>this.updateValue("fmrelease",t));E(this,"fmrel",this.fmrelease);E(this,"fmvelocity",t=>this.updateValue("fmvelocity",t));E(this,"fmvel",this.fmvelocity);E(this,"fmwave",t=>this.updateValue("fmwave",t));E(this,"fmw",this.fmwave);E(this,"ftype",t=>this.updateValue("ftype",t));E(this,"fanchor",t=>this.updateValue("fanchor",t));E(this,"attack",t=>this.updateValue("attack",t));E(this,"atk",this.attack);E(this,"decay",t=>this.updateValue("decay",t));E(this,"dec",this.decay);E(this,"sustain",t=>this.updateValue("sustain",t));E(this,"sus",this.sustain);E(this,"release",t=>this.updateValue("release",t));E(this,"rel",this.release);E(this,"adsr",(t,n,i,a)=>(this.attack(t),this.decay(n),this.sustain(i),this.release(a),this));E(this,"ad",(t,n)=>(this.attack(t),this.decay(n),this.sustain(0),this.release(0),this));E(this,"lpenv",t=>this.updateValue("lpenv",t));E(this,"lpe",t=>this.updateValue("lpenv",t));E(this,"lpattack",t=>this.updateValue("lpattack",t));E(this,"lpa",this.lpattack);E(this,"lpdecay",t=>this.updateValue("lpdecay",t));E(this,"lpd",this.lpdecay);E(this,"lpsustain",t=>this.updateValue("lpsustain",t));E(this,"lps",this.lpsustain);E(this,"lprelease",t=>this.updateValue("lprelease",t));E(this,"lpr",this.lprelease);E(this,"cutoff",t=>this.updateValue("cutoff",t));E(this,"lpf",this.cutoff);E(this,"resonance",t=>this.updateValue("resonance",Math.min(Math.max(t,0),50)));E(this,"lpq",this.resonance);E(this,"lpadsr",(t,n,i,a,s)=>(this.lpenv(t),this.lpattack(n),this.lpdecay(i),this.lpsustain(a),this.lprelease(s),this));E(this,"hpenv",t=>this.updateValue("hpenv",t));E(this,"hpe",t=>this.updateValue("hpe",t));E(this,"hpattack",t=>this.updateValue("hpattack",t));E(this,"hpa",this.hpattack);E(this,"hpdecay",t=>this.updateValue("hpdecay",t));E(this,"hpd",this.hpdecay);E(this,"hpsustain",t=>this.updateValue("hpsustain",t));E(this,"hpsus",this.hpsustain);E(this,"hprelease",t=>this.updateValue("hprelease",t));E(this,"hpr",this.hprelease);E(this,"hcutoff",t=>this.updateValue("hcutoff",t));E(this,"hpf",this.hcutoff);E(this,"hresonance",t=>this.updateValue("hresonance",t));E(this,"hpq",this.hresonance);E(this,"hpadsr",(t,n,i,a,s)=>(this.hpenv(t),this.hpattack(n),this.hpdecay(i),this.hpsustain(a),this.hprelease(s),this));E(this,"bpenv",t=>this.updateValue("bpenv",t));E(this,"bpe",t=>this.updateValue("bpe",t));E(this,"bpattack",t=>this.updateValue("bpattack",t));E(this,"bpa",this.bpattack);E(this,"bpdecay",t=>this.updateValue("bpdecay",t));E(this,"bpd",this.bpdecay);E(this,"bpsustain",t=>this.updateValue("bpsustain",t));E(this,"bps",this.bpsustain);E(this,"bprelease",t=>this.updateValue("bprelease",t));E(this,"bpr",this.bprelease);E(this,"bandf",t=>this.updateValue("bandf",t));E(this,"bpf",this.bandf);E(this,"bandq",t=>this.updateValue("bandq",t));E(this,"bpq",this.bandq);E(this,"bpadsr",(t,n,i,a,s)=>(this.bpenv(t),this.bpattack(n),this.bpdecay(i),this.bpsustain(a),this.bprelease(s),this));E(this,"freq",t=>this.updateValue("freq",t));E(this,"f",this.freq);E(this,"vib",t=>this.updateValue("vib",t));E(this,"vibmod",t=>this.updateValue("vibmod",t));E(this,"fm",t=>{if(typeof t=="number")this.values.fmi=t;else{let n=t.split(":");this.values.fmi=parseFloat(n[0]),n.length>1&&(this.values.fmh=parseFloat(n[1]))}return this});E(this,"loop",t=>this.updateValue("loop",t));E(this,"loopBegin",t=>this.updateValue("loopBegin",t));E(this,"loopEnd",t=>this.updateValue("loopEnd",t));E(this,"begin",t=>this.updateValue("begin",t));E(this,"end",t=>this.updateValue("end",t));E(this,"gain",t=>this.updateValue("gain",t));E(this,"dbgain",t=>this.updateValue("gain",Math.min(Math.pow(10,t/20),10)));E(this,"db",this.dbgain);E(this,"velocity",t=>this.updateValue("velocity",t));E(this,"vel",this.velocity);E(this,"pan",t=>this.updateValue("pan",t));E(this,"sound",t=>this.updateValue("s",t));E(this,"chord",(t,...n)=>(typeof t=="string"?t=xG(t).map(a=>({note:a,freq:Zr(a)})):t instanceof Array&&typeof t[0]=="number"?t=t.map(i=>({note:i,freq:Zr(i)})):typeof t=="number"&&n.length>0&&(t=[t,...n].map(i=>({note:i,freq:Zr(i)}))),this.updateValue("chord",t)));E(this,"invert",(t=0)=>{if(this.values.chord){let n=this.values.chord.map(a=>a.note);n=t<0?[...n].reverse():n;for(let a=0;a({note:a,freq:Zr(a)}));return this.updateValue("chord",i)}else return this});E(this,"snd",this.sound);E(this,"cut",t=>this.updateValue("cut",t));E(this,"clip",t=>this.updateValue("clip",t));E(this,"n",t=>this.updateValue("n",t));E(this,"note",t=>typeof t=="string"?this.updateValue("note",Ur(t)):typeof t==null||t==null?this.updateValue("note",0).updateValue("gain",0):this.updateValue("note",t));E(this,"speed",t=>this.updateValue("speed",t));E(this,"spd",this.speed);E(this,"coarse",t=>this.updateValue("coarse",t));E(this,"crush",t=>this.updateValue("crush",t));E(this,"shape",t=>this.updateValue("shape",t));E(this,"vowel",t=>this.updateValue("vowel",t));E(this,"vow",this.vowel);E(this,"delay",t=>this.updateValue("delay",t));E(this,"del",this.delay);E(this,"delayfeedback",t=>this.updateValue("delayfeedback",t));E(this,"delayfb",this.delayfeedback);E(this,"delaytime",t=>this.updateValue("delaytime",t));E(this,"delayt",this.delaytime);E(this,"orbit",t=>this.updateValue("orbit",t));E(this,"o",this.orbit);E(this,"room",t=>this.updateValue("room",t));E(this,"rm",this.room);E(this,"roomfade",t=>this.updateValue("roomfade",t));E(this,"rfade",this.roomfade);E(this,"roomlp",t=>this.updateValue("roomlp",t));E(this,"rlp",this.roomlp);E(this,"roomdim",t=>this.updateValue("roomdim",t));E(this,"rdim",this.roomdim);E(this,"size",t=>this.updateValue("roomsize",t));E(this,"sz",this.size);E(this,"comp",t=>this.updateValue("compressor",t));E(this,"cmp",this.comp);E(this,"ratio",t=>this.updateValue("compressorRatio",t));E(this,"rt",this.ratio);E(this,"knee",t=>this.updateValue("compressorKnee",t));E(this,"kn",this.knee);E(this,"compAttack",t=>this.updateValue("compressorAttack",t));E(this,"cmpa",this.compAttack);E(this,"compRelease",t=>this.updateValue("compressorRelease",t));E(this,"cmpr",this.compRelease);E(this,"stretch",t=>(this.updateValue("unit","c"),this.updateValue("speed",1/t),this.updateValue("cut",t),this));E(this,"modify",t=>{const n=t(this);return n instanceof Object?n:(t(this.values),this.update(),this)});E(this,"update",()=>{const[t,n]=v_(this.values.key||"C4",this.values.pitch||0,this.values.parsedScale||"MAJOR",this.values.octave||0);this.values.freq=Zr(t)});E(this,"out",()=>{this.values.chord?this.values.chord.forEach(t=>{const n={...this.values};n.freq=t.freq,P_(n,this.nudge,this.values.dur)}):P_(this.values,this.nudge,this.values.dur)});this.app=n,this.nudge=n.dough_nudge/100,typeof t=="string"?t.includes(":")?this.values={s:t.split(":")[0],n:t.split(":")[1],dur:n.clock.convertPulseToSecond(n.clock.ppqn),analyze:!0}:this.values={s:t,dur:.5,analyze:!0}:this.values=t}updateValue(t,n){return this.values[t]=n,this}}class ng extends hR{constructor(t,n){super(n);E(this,"midiConnection");E(this,"chord",t=>(this.values.chord=t,this));E(this,"note",t=>(this.values.note=t,this));E(this,"sustain",t=>(this.values.sustain=t,this));E(this,"channel",t=>(this.values.channel=t,this));E(this,"port",t=>(this.values.port=this.midiConnection.getMidiOutputIndex(t),this));E(this,"add",t=>(this.values.note+=t,this));E(this,"modify",t=>{const n=t(this);return n instanceof Object?n:(t(this.values),this.update(),this)});E(this,"bend",t=>(this.values.bend=t,this));E(this,"random",(t=0,n=127)=>(t=Math.min(Math.max(t,0),127),n=Math.min(Math.max(n,0),127),this.values.note=Math.floor(this.randomGen()*(n-t+1))+t,this));E(this,"update",()=>{const[t,n]=v_(this.values.key||"C4",this.values.pitch||0,this.values.parsedScale||"MAJOR",this.values.octave||0);this.values.note=t,this.values.freq=Zr(t),n&&(this.values.bend=n)});E(this,"out",()=>{function t(n,i){const a=i&&i.channel?i.channel:0,s=n.values.channel?n.values.channel:a,o=n.values.velocity?n.values.velocity:100,l=i&&i.note?i.note:60,c=n.values.note?n.values.note:l,u=n.values.sustain?n.values.sustain*n.app.clock.pulse_duration*n.app.api.ppqn():n.app.clock.pulse_duration*n.app.api.ppqn(),p=n.values.bend?n.values.bend:void 0,m=n.values.port?n.midiConnection.getMidiOutputIndex(n.values.port):n.midiConnection.getCurrentMidiPortIndex();n.midiConnection.sendMidiNote(c,s,o,u,m,p)}this.values.chord?this.values.chord.forEach(n=>{t(this,n)}):t(this)});this.app=n,typeof t=="number"?this.values.note=t:this.values=t,this.midiConnection=n.api.MidiConnection}}const po=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,mR=new Set,rg=typeof process=="object"&&process?process:{},gR=(r,e,t,n)=>{typeof rg.emitWarning=="function"?rg.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)};let Qc=globalThis.AbortController,_T=globalThis.AbortSignal;var OT;if(typeof Qc>"u"){_T=class{constructor(){E(this,"onabort");E(this,"_onabort",[]);E(this,"reason");E(this,"aborted",!1)}addEventListener(n,i){this._onabort.push(i)}},Qc=class{constructor(){E(this,"signal",new _T);e()}abort(n){var i,a;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const s of this.signal._onabort)s(n);(a=(i=this.signal).onabort)==null||a.call(i,n)}}};let r=((OT=rg.env)==null?void 0:OT.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{r&&(r=!1,gR("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 VG=r=>!mR.has(r),Bi=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),_R=r=>Bi(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?rc:null:null;class rc extends Array{constructor(e){super(e),this.fill(0)}}var cs;const fa=class fa{constructor(e,t){E(this,"heap");E(this,"length");if(!V(fa,cs))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}static create(e){const t=_R(e);if(!t)return[];We(fa,cs,!0);const n=new fa(e,t);return We(fa,cs,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};cs=new WeakMap,at(fa,cs,!1);let ig=fa;var Rr,er,Nr,wr,us,on,Dr,ln,Lt,nt,Ln,tr,Cn,hn,xr,mn,gi,_i,kr,Lr,qi,Mn,jo,sg,Oa,Si,Jo,nr,zc,SR,ba,ds,el,qr,Ui,Vr,Fi,tl,og,ps,ic,fs,ac,Dt,Ft,nl,lg,Ea,bo;const y_=class y_{constructor(e){at(this,jo);at(this,zc);at(this,qr);at(this,Vr);at(this,tl);at(this,ps);at(this,fs);at(this,Dt);at(this,nl);at(this,Ea);at(this,Rr,void 0);at(this,er,void 0);at(this,Nr,void 0);at(this,wr,void 0);at(this,us,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");at(this,on,void 0);at(this,Dr,void 0);at(this,ln,void 0);at(this,Lt,void 0);at(this,nt,void 0);at(this,Ln,void 0);at(this,tr,void 0);at(this,Cn,void 0);at(this,hn,void 0);at(this,xr,void 0);at(this,mn,void 0);at(this,gi,void 0);at(this,_i,void 0);at(this,kr,void 0);at(this,Lr,void 0);at(this,qi,void 0);at(this,Mn,void 0);at(this,Oa,()=>{});at(this,Si,()=>{});at(this,Jo,()=>{});at(this,nr,()=>!1);at(this,ba,e=>{});at(this,ds,(e,t,n)=>{});at(this,el,(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:l,dispose:c,disposeAfter:u,noDisposeOnSet:p,noUpdateTTL:m,maxSize:_=0,maxEntrySize:v=0,sizeCalculation:I,fetchMethod:R,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:$,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:h,ignoreFetchAbort:b}=e;if(t!==0&&!Bi(t))throw new TypeError("max option must be a nonnegative integer");const S=t?_R(t):Array;if(!S)throw new Error("invalid max value: "+t);if(We(this,Rr,t),We(this,er,_),this.maxEntrySize=v||V(this,er),this.sizeCalculation=I,this.sizeCalculation){if(!V(this,er)&&!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(R!==void 0&&typeof R!="function")throw new TypeError("fetchMethod must be a function if specified");if(We(this,us,R),We(this,qi,!!R),We(this,ln,new Map),We(this,Lt,new Array(t).fill(void 0)),We(this,nt,new Array(t).fill(void 0)),We(this,Ln,new S(t)),We(this,tr,new S(t)),We(this,Cn,0),We(this,hn,0),We(this,xr,ig.create(t)),We(this,on,0),We(this,Dr,0),typeof c=="function"&&We(this,Nr,c),typeof u=="function"?(We(this,wr,u),We(this,mn,[])):(We(this,wr,void 0),We(this,mn,void 0)),We(this,Lr,!!V(this,Nr)),We(this,Mn,!!V(this,wr)),this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!Z,this.allowStaleOnFetchAbort=!!h,this.ignoreFetchAbort=!!b,this.maxEntrySize!==0){if(V(this,er)!==0&&!Bi(V(this,er)))throw new TypeError("maxSize must be a positive integer if specified");if(!Bi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ze(this,zc,SR).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!$,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=Bi(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!Bi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ze(this,jo,sg).call(this)}if(V(this,Rr)===0&&this.ttl===0&&V(this,er)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!V(this,Rr)&&!V(this,er)){const N="LRU_CACHE_UNBOUNDED";VG(N)&&(mR.add(N),gR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",N,y_))}}static unsafeExposeInternals(e){return{starts:V(e,_i),ttls:V(e,kr),sizes:V(e,gi),keyMap:V(e,ln),keyList:V(e,Lt),valList:V(e,nt),next:V(e,Ln),prev:V(e,tr),get head(){return V(e,Cn)},get tail(){return V(e,hn)},free:V(e,xr),isBackgroundFetch:t=>{var n;return ze(n=e,Dt,Ft).call(n,t)},backgroundFetch:(t,n,i,a)=>{var s;return ze(s=e,fs,ac).call(s,t,n,i,a)},moveToTail:t=>{var n;return ze(n=e,Ea,bo).call(n,t)},indexes:t=>{var n;return ze(n=e,qr,Ui).call(n,t)},rindexes:t=>{var n;return ze(n=e,Vr,Fi).call(n,t)},isStale:t=>{var n;return V(n=e,nr).call(n,t)}}}get max(){return V(this,Rr)}get maxSize(){return V(this,er)}get calculatedSize(){return V(this,Dr)}get size(){return V(this,on)}get fetchMethod(){return V(this,us)}get dispose(){return V(this,Nr)}get disposeAfter(){return V(this,wr)}getRemainingTTL(e){return V(this,ln).has(e)?1/0:0}*entries(){for(const e of ze(this,qr,Ui).call(this))V(this,nt)[e]!==void 0&&V(this,Lt)[e]!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield[V(this,Lt)[e],V(this,nt)[e]])}*rentries(){for(const e of ze(this,Vr,Fi).call(this))V(this,nt)[e]!==void 0&&V(this,Lt)[e]!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield[V(this,Lt)[e],V(this,nt)[e]])}*keys(){for(const e of ze(this,qr,Ui).call(this)){const t=V(this,Lt)[e];t!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield t)}}*rkeys(){for(const e of ze(this,Vr,Fi).call(this)){const t=V(this,Lt)[e];t!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield t)}}*values(){for(const e of ze(this,qr,Ui).call(this))V(this,nt)[e]!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield V(this,nt)[e])}*rvalues(){for(const e of ze(this,Vr,Fi).call(this))V(this,nt)[e]!==void 0&&!ze(this,Dt,Ft).call(this,V(this,nt)[e])&&(yield V(this,nt)[e])}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const n of ze(this,qr,Ui).call(this)){const i=V(this,nt)[n],a=ze(this,Dt,Ft).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,V(this,Lt)[n],this))return this.get(V(this,Lt)[n],t)}}forEach(e,t=this){for(const n of ze(this,qr,Ui).call(this)){const i=V(this,nt)[n],a=ze(this,Dt,Ft).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,V(this,Lt)[n],this)}}rforEach(e,t=this){for(const n of ze(this,Vr,Fi).call(this)){const i=V(this,nt)[n],a=ze(this,Dt,Ft).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,V(this,Lt)[n],this)}}purgeStale(){let e=!1;for(const t of ze(this,Vr,Fi).call(this,{allowStale:!0}))V(this,nr).call(this,t)&&(this.delete(V(this,Lt)[t]),e=!0);return e}dump(){const e=[];for(const t of ze(this,qr,Ui).call(this,{allowStale:!0})){const n=V(this,Lt)[t],i=V(this,nt)[t],a=ze(this,Dt,Ft).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||n===void 0)continue;const s={value:a};if(V(this,kr)&&V(this,_i)){s.ttl=V(this,kr)[t];const o=po.now()-V(this,_i)[t];s.start=Math.floor(Date.now()-o)}V(this,gi)&&(s.size=V(this,gi)[t]),e.unshift([n,s])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const i=Date.now()-n.start;n.start=po.now()-i}this.set(t,n.value,n)}}set(e,t,n={}){var m,_,v,I,R;if(t===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const u=V(this,el).call(this,e,t,n.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let p=V(this,on)===0?void 0:V(this,ln).get(e);if(p===void 0)p=V(this,on)===0?V(this,hn):V(this,xr).length!==0?V(this,xr).pop():V(this,on)===V(this,Rr)?ze(this,ps,ic).call(this,!1):V(this,on),V(this,Lt)[p]=e,V(this,nt)[p]=t,V(this,ln).set(e,p),V(this,Ln)[V(this,hn)]=p,V(this,tr)[p]=V(this,hn),We(this,hn,p),gl(this,on)._++,V(this,ds).call(this,p,u,l),l&&(l.set="add"),c=!1;else{ze(this,Ea,bo).call(this,p);const x=V(this,nt)[p];if(t!==x){if(V(this,qi)&&ze(this,Dt,Ft).call(this,x)){x.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:$}=x;$!==void 0&&!s&&(V(this,Lr)&&((m=V(this,Nr))==null||m.call(this,$,e,"set")),V(this,Mn)&&((_=V(this,mn))==null||_.push([$,e,"set"])))}else s||(V(this,Lr)&&((v=V(this,Nr))==null||v.call(this,x,e,"set")),V(this,Mn)&&((I=V(this,mn))==null||I.push([x,e,"set"])));if(V(this,ba).call(this,p),V(this,ds).call(this,p,u,l),V(this,nt)[p]=t,l){l.set="replace";const $=x&&ze(this,Dt,Ft).call(this,x)?x.__staleWhileFetching:x;$!==void 0&&(l.oldValue=$)}}else l&&(l.set="update")}if(i!==0&&!V(this,kr)&&ze(this,jo,sg).call(this),V(this,kr)&&(c||V(this,Jo).call(this,p,i,a),l&&V(this,Si).call(this,l,p)),!s&&V(this,Mn)&&V(this,mn)){const x=V(this,mn);let $;for(;$=x==null?void 0:x.shift();)(R=V(this,wr))==null||R.call(this,...$)}return this}pop(){var e;try{for(;V(this,on);){const t=V(this,nt)[V(this,Cn)];if(ze(this,ps,ic).call(this,!0),ze(this,Dt,Ft).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(V(this,Mn)&&V(this,mn)){const t=V(this,mn);let n;for(;n=t==null?void 0:t.shift();)(e=V(this,wr))==null||e.call(this,...n)}}}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,a=V(this,ln).get(e);if(a!==void 0){const s=V(this,nt)[a];if(ze(this,Dt,Ft).call(this,s)&&s.__staleWhileFetching===void 0)return!1;if(V(this,nr).call(this,a))i&&(i.has="stale",V(this,Si).call(this,i,a));else return n&&V(this,Oa).call(this,a),i&&(i.has="hit",V(this,Si).call(this,i,a)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,i=V(this,ln).get(e);if(i!==void 0&&(n||!V(this,nr).call(this,i))){const a=V(this,nt)[i];return ze(this,Dt,Ft).call(this,a)?a.__staleWhileFetching:a}}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:I,forceRefresh:R=!1,status:x,signal:$}=t;if(!V(this,qi))return x&&(x.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:x});const Z={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:s,noDisposeOnSet:o,size:l,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:v,ignoreFetchAbort:_,status:x,signal:$};let h=V(this,ln).get(e);if(h===void 0){x&&(x.fetch="miss");const b=ze(this,fs,ac).call(this,e,h,Z,I);return b.__returned=b}else{const b=V(this,nt)[h];if(ze(this,Dt,Ft).call(this,b)){const M=n&&b.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",M&&(x.returnedStale=!0)),M?b.__staleWhileFetching:b.__returned=b}const S=V(this,nr).call(this,h);if(!R&&!S)return x&&(x.fetch="hit"),ze(this,Ea,bo).call(this,h),i&&V(this,Oa).call(this,h),x&&V(this,Si).call(this,x,h),b;const N=ze(this,fs,ac).call(this,e,h,Z,I),L=N.__staleWhileFetching!==void 0&&n;return x&&(x.fetch=S?"stale":"refresh",L&&S&&(x.returnedStale=!0)),L?N.__staleWhileFetching:N.__returned=N}}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:s}=t,o=V(this,ln).get(e);if(o!==void 0){const l=V(this,nt)[o],c=ze(this,Dt,Ft).call(this,l);return s&&V(this,Si).call(this,s,o),V(this,nr).call(this,o)?(s&&(s.get="stale"),c?(s&&n&&l.__staleWhileFetching!==void 0&&(s.returnedStale=!0),n?l.__staleWhileFetching:void 0):(a||this.delete(e),s&&n&&(s.returnedStale=!0),n?l:void 0)):(s&&(s.get="hit"),c?l.__staleWhileFetching:(ze(this,Ea,bo).call(this,o),i&&V(this,Oa).call(this,o),l))}else s&&(s.get="miss")}delete(e){var n,i,a,s;let t=!1;if(V(this,on)!==0){const o=V(this,ln).get(e);if(o!==void 0)if(t=!0,V(this,on)===1)this.clear();else{V(this,ba).call(this,o);const l=V(this,nt)[o];ze(this,Dt,Ft).call(this,l)?l.__abortController.abort(new Error("deleted")):(V(this,Lr)||V(this,Mn))&&(V(this,Lr)&&((n=V(this,Nr))==null||n.call(this,l,e,"delete")),V(this,Mn)&&((i=V(this,mn))==null||i.push([l,e,"delete"]))),V(this,ln).delete(e),V(this,Lt)[o]=void 0,V(this,nt)[o]=void 0,o===V(this,hn)?We(this,hn,V(this,tr)[o]):o===V(this,Cn)?We(this,Cn,V(this,Ln)[o]):(V(this,Ln)[V(this,tr)[o]]=V(this,Ln)[o],V(this,tr)[V(this,Ln)[o]]=V(this,tr)[o]),gl(this,on)._--,V(this,xr).push(o)}}if(V(this,Mn)&&((a=V(this,mn))!=null&&a.length)){const o=V(this,mn);let l;for(;l=o==null?void 0:o.shift();)(s=V(this,wr))==null||s.call(this,...l)}return t}clear(){var e,t,n;for(const i of ze(this,Vr,Fi).call(this,{allowStale:!0})){const a=V(this,nt)[i];if(ze(this,Dt,Ft).call(this,a))a.__abortController.abort(new Error("deleted"));else{const s=V(this,Lt)[i];V(this,Lr)&&((e=V(this,Nr))==null||e.call(this,a,s,"delete")),V(this,Mn)&&((t=V(this,mn))==null||t.push([a,s,"delete"]))}}if(V(this,ln).clear(),V(this,nt).fill(void 0),V(this,Lt).fill(void 0),V(this,kr)&&V(this,_i)&&(V(this,kr).fill(0),V(this,_i).fill(0)),V(this,gi)&&V(this,gi).fill(0),We(this,Cn,0),We(this,hn,0),V(this,xr).length=0,We(this,Dr,0),We(this,on,0),V(this,Mn)&&V(this,mn)){const i=V(this,mn);let a;for(;a=i==null?void 0:i.shift();)(n=V(this,wr))==null||n.call(this,...a)}}};Rr=new WeakMap,er=new WeakMap,Nr=new WeakMap,wr=new WeakMap,us=new WeakMap,on=new WeakMap,Dr=new WeakMap,ln=new WeakMap,Lt=new WeakMap,nt=new WeakMap,Ln=new WeakMap,tr=new WeakMap,Cn=new WeakMap,hn=new WeakMap,xr=new WeakMap,mn=new WeakMap,gi=new WeakMap,_i=new WeakMap,kr=new WeakMap,Lr=new WeakMap,qi=new WeakMap,Mn=new WeakMap,jo=new WeakSet,sg=function(){const e=new rc(V(this,Rr)),t=new rc(V(this,Rr));We(this,kr,e),We(this,_i,t),We(this,Jo,(a,s,o=po.now())=>{if(t[a]=s!==0?o:0,e[a]=s,s!==0&&this.ttlAutopurge){const l=setTimeout(()=>{V(this,nr).call(this,a)&&this.delete(V(this,Lt)[a])},s+1);l.unref&&l.unref()}}),We(this,Oa,a=>{t[a]=e[a]!==0?po.now():0}),We(this,Si,(a,s)=>{if(e[s]){const o=e[s],l=t[s];a.ttl=o,a.start=l,a.now=n||i();const c=a.now-l;a.remainingTTL=o-c}});let n=0;const i=()=>{const a=po.now();if(this.ttlResolution>0){n=a;const s=setTimeout(()=>n=0,this.ttlResolution);s.unref&&s.unref()}return a};this.getRemainingTTL=a=>{const s=V(this,ln).get(a);if(s===void 0)return 0;const o=e[s],l=t[s];if(o===0||l===0)return 1/0;const c=(n||i())-l;return o-c},We(this,nr,a=>e[a]!==0&&t[a]!==0&&(n||i())-t[a]>e[a])},Oa=new WeakMap,Si=new WeakMap,Jo=new WeakMap,nr=new WeakMap,zc=new WeakSet,SR=function(){const e=new rc(V(this,Rr));We(this,Dr,0),We(this,gi,e),We(this,ba,t=>{We(this,Dr,V(this,Dr)-e[t]),e[t]=0}),We(this,el,(t,n,i,a)=>{if(ze(this,Dt,Ft).call(this,n))return 0;if(!Bi(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,t),!Bi(i))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 i}),We(this,ds,(t,n,i)=>{if(e[t]=n,V(this,er)){const a=V(this,er)-e[t];for(;V(this,Dr)>a;)ze(this,ps,ic).call(this,!0)}We(this,Dr,V(this,Dr)+e[t]),i&&(i.entrySize=n,i.totalCalculatedSize=V(this,Dr))})},ba=new WeakMap,ds=new WeakMap,el=new WeakMap,qr=new WeakSet,Ui=function*({allowStale:e=this.allowStale}={}){if(V(this,on))for(let t=V(this,hn);!(!ze(this,tl,og).call(this,t)||((e||!V(this,nr).call(this,t))&&(yield t),t===V(this,Cn)));)t=V(this,tr)[t]},Vr=new WeakSet,Fi=function*({allowStale:e=this.allowStale}={}){if(V(this,on))for(let t=V(this,Cn);!(!ze(this,tl,og).call(this,t)||((e||!V(this,nr).call(this,t))&&(yield t),t===V(this,hn)));)t=V(this,Ln)[t]},tl=new WeakSet,og=function(e){return e!==void 0&&V(this,ln).get(V(this,Lt)[e])===e},ps=new WeakSet,ic=function(e){var a,s;const t=V(this,Cn),n=V(this,Lt)[t],i=V(this,nt)[t];return V(this,qi)&&ze(this,Dt,Ft).call(this,i)?i.__abortController.abort(new Error("evicted")):(V(this,Lr)||V(this,Mn))&&(V(this,Lr)&&((a=V(this,Nr))==null||a.call(this,i,n,"evict")),V(this,Mn)&&((s=V(this,mn))==null||s.push([i,n,"evict"]))),V(this,ba).call(this,t),e&&(V(this,Lt)[t]=void 0,V(this,nt)[t]=void 0,V(this,xr).push(t)),V(this,on)===1?(We(this,Cn,We(this,hn,0)),V(this,xr).length=0):We(this,Cn,V(this,Ln)[t]),V(this,ln).delete(n),gl(this,on)._--,t},fs=new WeakSet,ac=function(e,t,n,i){const a=t===void 0?void 0:V(this,nt)[t];if(ze(this,Dt,Ft).call(this,a))return a;const s=new Qc,{signal:o}=n;o==null||o.addEventListener("abort",()=>s.abort(o.reason),{signal:s.signal});const l={signal:s.signal,options:n,context:i},c=(I,R=!1)=>{const{aborted:x}=s.signal,$=n.ignoreFetchAbort&&I!==void 0;if(n.status&&(x&&!R?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,$&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),x&&!$&&!R)return p(s.signal.reason);const Z=_;return V(this,nt)[t]===_&&(I===void 0?Z.__staleWhileFetching?V(this,nt)[t]=Z.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,I,l.options))),I},u=I=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=I),p(I)),p=I=>{const{aborted:R}=s.signal,x=R&&n.allowStaleOnFetchAbort,$=x||n.allowStaleOnFetchRejection,Z=$||n.noDeleteOnFetchRejection,h=_;if(V(this,nt)[t]===_&&(!Z||h.__staleWhileFetching===void 0?this.delete(e):x||(V(this,nt)[t]=h.__staleWhileFetching)),$)return n.status&&h.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw I},m=(I,R)=>{var $;const x=($=V(this,us))==null?void 0:$.call(this,e,a,l);x&&x instanceof Promise&&x.then(Z=>I(Z===void 0?void 0:Z),R),s.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(I(void 0),n.allowStaleOnFetchAbort&&(I=Z=>c(Z,!0)))})};n.status&&(n.status.fetchDispatched=!0);const _=new Promise(m).then(c,u),v=Object.assign(_,{__abortController:s,__staleWhileFetching:a,__returned:void 0});return t===void 0?(this.set(e,v,{...l.options,status:void 0}),t=V(this,ln).get(e)):V(this,nt)[t]=v,v},Dt=new WeakSet,Ft=function(e){if(!V(this,qi))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Qc},nl=new WeakSet,lg=function(e,t){V(this,tr)[t]=e,V(this,Ln)[e]=t},Ea=new WeakSet,bo=function(e){e!==V(this,hn)&&(e===V(this,Cn)?We(this,Cn,V(this,Ln)[e]):ze(this,nl,lg).call(this,V(this,tr)[e],V(this,Ln)[e]),ze(this,nl,lg).call(this,V(this,hn),e),We(this,hn,e))};let ag=y_;const Ro=class Ro{constructor(){E(this,"_fallbackMethod",()=>Ro.createSkipProxy());E(this,"out",()=>{})}};E(Ro,"createSkipProxy",()=>{const e=new Ro;return new Proxy(e,{get(t,n,i){return typeof t[n]>"u"?t._fallbackMethod:t[n]},set(t,n,i,a){return!1}})});let qc=Ro;const No=class No extends C_{constructor(t,n){super(n);E(this,"_fallbackMethod",()=>No.createRestProxy(this.values.length,this.app));E(this,"out",()=>{});this.values.length=t}};E(No,"createRestProxy",(t,n)=>{const i=new No(t,n);return new Proxy(i,{get(a,s,o){return typeof a[s]>"u"?a._fallbackMethod:a[s]},set(a,s,o,l){return!1}})});let Vc=No;class zG extends C_{constructor(t,n,i){super(i);E(this,"input");E(this,"ziffers");E(this,"initCallTime",0);E(this,"startCallTime",0);E(this,"lastCallTime",0);E(this,"waitTime",0);E(this,"startBeat",0);E(this,"played",!1);E(this,"current");E(this,"retro",!1);E(this,"index",-1);E(this,"zid","");E(this,"options",{});E(this,"skipIndex",0);E(this,"endTime",0);E(this,"next",()=>(this.current=this.ziffers.next(),this.played=!0,this.current));E(this,"pulseToSecond",t=>this.app.clock.convertPulseToSecond(t));E(this,"firstRun",()=>this.notStarted());E(this,"atTheBeginning",()=>this.skipIndex===0&&this.ziffers.index<=0);E(this,"origin",()=>this.app.clock.pulses_since_origin+1);E(this,"pulse",()=>this.app.clock.time_position.pulse);E(this,"beat",()=>this.app.clock.time_position.beat);E(this,"nextBeat",()=>this.app.clock.next_beat_in_ticks);E(this,"nextBeatInTicks",()=>this.app.clock.next_beat_in_ticks);E(this,"areWeThereYet",()=>{this.app.clock.pulses_since_origin=this.nextBeatInTicks())&&this.origin()>=this.waitTime,n=this.current&&this.pulseToSecond(this.origin())>=this.pulseToSecond(this.lastCallTime)+this.pulseToSecond(this.current.duration*4*this.app.clock.ppqn)&&this.origin()>=this.waitTime,i=t||n;return this.skipIndex=i?0:this.skipIndex+1,this.index=i?this.index+1:this.index,i&&this.notStarted()&&(this.initCallTime=this.app.clock.pulses_since_origin),this.atTheBeginning()&&(this.startCallTime=this.app.clock.pulses_since_origin),i});E(this,"lead",()=>this.voiceleading());E(this,"invert",t=>(this.atTheBeginning()&&this.ziffers.invert(t),this));E(this,"out",()=>{});this.app=i,this.input=t,this.options=n,this.ziffers=new $G(t,n)}get ticks(){return this.ziffers.duration*4*this.app.clock.ppqn}nextEndTime(){return this.startCallTime+this.ticks}updateLastCallTime(){(this.notStarted()||this.played)&&(this.lastCallTime=this.app.clock.pulses_since_origin,this.played=!1)}notStarted(){return this.ziffers.notStarted()}sound(t){if(this.areWeThereYet()){const n=this.next(),i=this.app.clock.convertPulseToSecond(n.duration*4*this.app.clock.ppqn);if(n instanceof ni){const a=n.getExisting("freq","pitch","key","scale","octave","parsedScale");return n.sound&&(t=n.sound),n.soundIndex&&(a.n=n.soundIndex),a.dur=i,new tg(a,this.app).sound(t||"sine")}else if(n instanceof Na){const a=n.pitches.map(o=>o.getExisting("freq","pitch","key","scale","octave","parsedScale")),s={dur:i};return t&&(s.s=t),new tg(s,this.app).chord(a)}else if(n instanceof Jm)return Vc.createRestProxy(n.duration,this.app)}else return qc.createSkipProxy()}midi(t=void 0){if(this.areWeThereYet()){const n=this.next(),i=n.getExisting("note","pitch","bend","key","scale","octave","parsedScale");if(n instanceof ni){n.soundIndex&&(i.channel=n.soundIndex);const a=new ng(i,this.app);return t?a.note(t):a}else{if(n instanceof Jm)return Vc.createRestProxy(n.duration,this.app);if(n instanceof Na){const a=n.midiChord();return new ng(i,this.app).chord(a)}}}else return qc.createSkipProxy()}scale(t){return this.atTheBeginning()&&this.ziffers.scale(t),this}key(t){return this.atTheBeginning()&&this.ziffers.key(t),this}octave(t){return this.atTheBeginning()&&this.ziffers.octave(t),this}voiceleading(){return this.atTheBeginning()&&this.ziffers.lead(),this}retrograde(){return this.atTheBeginning()&&this.ziffers.retrograde(),this}wait(t){if(this.atTheBeginning()){if(typeof t=="function"){const n=this.app.api.patternCache.get(t.name);return n&&(this.waitTime=n.nextEndTime()),this}this.waitTime=this.origin()+Math.ceil(t*4*this.app.clock.ppqn)}return this}sync(t){if(this.atTheBeginning()&&this.notStarted()){const n=this.app.clock.pulses_since_origin,i=typeof t=="function"?t.name:t;if(n>0){const a=this.app.api.patternCache.get(i);if(a){const s=a.ziffers.duration,o=a.startCallTime,l=s*4*this.app.clock.ppqn;this.waitTime=o+l}}}return this}}const HG=r=>r[0]==="{"&&r[r.length-1]==="}",fo=(r,e)=>{if(HG(r)){const t=JSON.parse(r);return JSON.stringify({...t,...e})}else return JSON.stringify({...e,text:r})},WG=r=>{String.prototype.speak=function(){const e=JSON.parse(this.valueOf());new OR({...e,text:e.text}).speak().then(()=>{}).catch(t=>{console.log("Error speaking:",t)})},String.prototype.rate=function(e){return fo(this.valueOf(),{rate:e})},String.prototype.pitch=function(e){return fo(this.valueOf(),{pitch:e})},String.prototype.lang=function(e){return fo(this.valueOf(),{lang:e})},String.prototype.volume=function(e){return fo(this.valueOf(),{volume:e})},String.prototype.voice=function(e){return fo(this.valueOf(),{voice:e})},String.prototype.z=function(e={}){return r.z(this.valueOf(),e)},String.prototype.z0=function(e={}){return r.z0(this.valueOf(),e)},String.prototype.z1=function(e={}){return r.z1(this.valueOf(),e)},String.prototype.z2=function(e={}){return r.z2(this.valueOf(),e)},String.prototype.z3=function(e={}){return r.z3(this.valueOf(),e)},String.prototype.z4=function(e={}){return r.z4(this.valueOf(),e)},String.prototype.z5=function(e={}){return r.z5(this.valueOf(),e)},String.prototype.z6=function(e={}){return r.z6(this.valueOf(),e)},String.prototype.z7=function(e={}){return r.z7(this.valueOf(),e)},String.prototype.z8=function(e={}){return r.z8(this.valueOf(),e)},String.prototype.z9=function(e={}){return r.z9(this.valueOf(),e)},String.prototype.z10=function(e={}){return r.z10(this.valueOf(),e)},String.prototype.z11=function(e={}){return r.z11(this.valueOf(),e)},String.prototype.z12=function(e={}){return r.z12(this.valueOf(),e)},String.prototype.z13=function(e={}){return r.z13(this.valueOf(),e)},String.prototype.z14=function(e={}){return r.z14(this.valueOf(),e)},String.prototype.z15=function(e={}){return r.z15(this.valueOf(),e)},String.prototype.z16=function(e={}){return r.z16(this.valueOf(),e)},String.prototype.note=function(){try{return parseInt(this.valueOf())}catch{return Ur(this.valueOf())}}};let qh;class OR{constructor(e){E(this,"speak",()=>new Promise((e,t)=>{if(this.options.text){const n=window.speechSynthesis;n.speaking&&n.cancel();const i=new SpeechSynthesisUtterance(this.options.text);i.rate=this.options.rate||1,i.pitch=this.options.pitch||1,i.volume=this.options.volume||1,this.options.voice&&(i.voice=n.getVoices()[this.options.voice]),this.options.lang&&(this.options.lang.length===2?i.lang=`${this.options.lang}-${this.options.lang.toUpperCase()}`:this.options.lang.length===5?i.lang=this.options.lang:i.lang="en-US"),i.onend=()=>{e()},i.onerror=a=>{t(a)},n.speaking?(n.cancel(),qh&&clearTimeout(qh),qh=setTimeout(()=>{n.speak(i)},200)):n.speak(i)}else t("No text provided")}));this.options=e}}async function bR(){return Promise.all([jR(),Yi("github:tidalcycles/Dirt-Samples/master").then(()=>h2()),O2(),Yi("github:Bubobubobubobubo/Dough-Fox/main"),Yi("github:Bubobubobubobubo/Dough-Samples/main"),Yi("github:Bubobubobubobubo/Dough-Amiga/main"),Yi("github:Bubobubobubobubo/Dough-Amen/main"),Yi("github:Bubobubobubobubo/Dough-Waveforms/main")])}class XG{constructor(e){E(this,"variables",{});E(this,"codeExamples",{});E(this,"counters",{});E(this,"_drunk",new qG(-100,100,!1));E(this,"randomGen",Math.random);E(this,"currentSeed");E(this,"localSeeds",new Map);E(this,"patternCache",new ag({max:1e3,ttl:1e3*60*5}));E(this,"errorTimeoutID",0);E(this,"printTimeoutID",0);E(this,"MidiConnection");E(this,"scale_aid");E(this,"load");E(this,"_loadUniverseFromInterface",e=>{Dc(this.app,e),xc()});E(this,"_deleteUniverseFromInterface",e=>{delete this.app.universes[e],this.app.settings.saveApplicationToLocalStorage(this.app.universes,this.app.settings),this.app.updateKnownUniversesView()});E(this,"_playDocExample",e=>{let t=this.app.universes[this.app.selected_universe];this.app.exampleIsPlaying=!0,t.example?t.example.candidate=e||this.app.selectedExample:(t.example={candidate:"",committed:"",evaluations:0},t.example.candidate=e||this.app.selectedExample),this.play()});E(this,"_stopDocExample",()=>{let e=this.app.universes[this.app.selected_universe];(e==null?void 0:e.example)!==void 0&&(this.app.exampleIsPlaying=!1,e.example.candidate="",e.example.committed=""),this.pause()});E(this,"_playDocExampleOnce",e=>{let t=this.app.universes[this.app.selected_universe];(t==null?void 0:t.example)!==void 0&&(t.example.candidate="",t.example.committed=""),this.play(),this.app.exampleIsPlaying=!0,OM(this.app,e)});E(this,"_all_samples",()=>dg.get());E(this,"_reportError",e=>{console.log(e),clearTimeout(this.errorTimeoutID),clearTimeout(this.printTimeoutID),this.app.interface.error_line.innerHTML=e,this.app.interface.error_line.style.color="color-red-800",this.app.interface.error_line.classList.remove("hidden"),this.errorTimeoutID=setTimeout(()=>this.app.interface.error_line.classList.add("hidden"),2e3)});E(this,"_logMessage",e=>{console.log(e),clearTimeout(this.printTimeoutID),clearTimeout(this.errorTimeoutID),this.app.interface.error_line.innerHTML=e,this.app.interface.error_line.style.color="white",this.app.interface.error_line.classList.remove("hidden"),this.printTimeoutID=setTimeout(()=>this.app.interface.error_line.classList.add("hidden"),4e3)});E(this,"time",()=>this.app.audioContext.currentTime);E(this,"play",()=>{this.app.setButtonHighlighting("play",!0),this.MidiConnection.sendStartMessage(),this.app.clock.start()});E(this,"pause",()=>{this.app.setButtonHighlighting("pause",!0),this.MidiConnection.sendStopMessage(),this.app.clock.pause()});E(this,"stop",()=>{this.app.setButtonHighlighting("stop",!0),this.MidiConnection.sendStopMessage(),this.app.clock.stop()});E(this,"silence",this.stop);E(this,"hush",this.stop);E(this,"warp",e=>{this.app.clock.tick=e,this.app.clock.time_position=this.app.clock.convertTicksToTimeposition(e)});E(this,"beat_warp",e=>{this.app.clock.tick=e*this.app.clock.ppqn,this.app.clock.time_position=this.app.clock.convertTicksToTimeposition(e*this.app.clock.ppqn)});E(this,"onmousemove",e=>{this.app._mouseX=e.pageX,this.app._mouseY=e.pageY});E(this,"mouseX",()=>this.app._mouseX);E(this,"mouseY",()=>this.app._mouseY);E(this,"noteX",()=>Math.floor(this.app._mouseX/document.body.clientWidth*127));E(this,"noteY",()=>Math.floor(this.app._mouseY/document.body.clientHeight*127));E(this,"script",(...e)=>{e.forEach(t=>{t>=1&&t<=9&&(E2(this.app,"local",t),Ra(this.app,this.app.universes[this.app.selected_universe].locals[t]))})});E(this,"s",this.script);E(this,"delete_script",e=>{this.app.universes[this.app.selected_universe].locals[e]={candidate:"",committed:"",evaluations:0}});E(this,"cs",this.delete_script);E(this,"copy_script",(e,t)=>{this.app.universes[this.app.selected_universe].locals[t]={...this.app.universes[this.app.selected_universe].locals[e]}});E(this,"cps",this.copy_script);E(this,"copy_universe",(e,t)=>{this.app.universes[t]={...this.app.universes[e]}});E(this,"delete_universe",e=>{this.app.selected_universe===e&&(this.app.selected_universe="Default"),delete this.app.universes[e],this.app.settings.saveApplicationToLocalStorage(this.app.universes,this.app.settings),this.app.updateKnownUniversesView()});E(this,"big_bang",()=>{confirm("Are you sure you want to delete all universes?")&&(this.app.universes={...Xo},this.app.settings.saveApplicationToLocalStorage(this.app.universes,this.app.settings)),this.app.selected_universe="Default",this.app.updateKnownUniversesView()});E(this,"midi_outputs",()=>{this._logMessage(this.MidiConnection.listMidiOutputs())});E(this,"midi_output",e=>{e?this.MidiConnection.switchMidiOutput(e):console.log(this.MidiConnection.getCurrentMidiPort())});E(this,"midi",(e=60,t,n)=>(t!==void 0&&(typeof e=="number"&&(e={note:e}),e.velocity=t),n!==void 0&&(typeof e=="number"&&(e={note:e}),e.channel=n),new ng(e,this.app)));E(this,"sysex",e=>{this.MidiConnection.sendSysExMessage(e)});E(this,"pitch_bend",(e,t)=>{this.MidiConnection.sendPitchBend(e,t)});E(this,"program_change",(e,t)=>{this.MidiConnection.sendProgramChange(e,t)});E(this,"midi_clock",()=>{this.MidiConnection.sendMidiClock()});E(this,"control_change",({control:e=20,value:t=0,channel:n=0})=>{this.MidiConnection.sendMidiControlChange(e,t,n)});E(this,"midi_panic",()=>{this.MidiConnection.panic()});E(this,"active_note_events",e=>{let t;if(e?t=this.MidiConnection.activeNotesFromChannel(e):t=this.MidiConnection.activeNotes,t.length>0)return t});E(this,"active_notes",e=>{const t=this.active_note_events(e);if(t&&t.length>0)return t.map(n=>n.note)});E(this,"kill_active_notes",()=>{this.MidiConnection.activeNotes=[]});E(this,"sticky_notes",e=>{let t;if(e?t=this.MidiConnection.stickyNotesFromChannel(e):t=this.MidiConnection.stickyNotes,t.length>0)return t.map(n=>n.note)});E(this,"kill_sticky_notes",()=>{this.MidiConnection.stickyNotes=[]});E(this,"buffer",e=>e?this.MidiConnection.findNoteFromBufferInChannel(e)!==void 0:this.MidiConnection.noteInputBuffer.length>0);E(this,"buffer_event",e=>e?this.MidiConnection.findNoteFromBufferInChannel(e):this.MidiConnection.noteInputBuffer.shift());E(this,"buffer_note",e=>{const t=this.buffer_event(e);return t?t.note:void 0});E(this,"last_note_event",e=>e?this.MidiConnection.lastNoteInChannel[e]:this.MidiConnection.lastNote);E(this,"last_note",e=>{const t=this.last_note_event(e);return t?t.note:60});E(this,"last_cc",(e,t)=>t?this.MidiConnection.lastCCInChannel[t]?this.MidiConnection.lastCCInChannel[t][e]:0:this.MidiConnection.lastCC[e]||0);E(this,"has_cc",e=>e?this.MidiConnection.findCCFromBufferInChannel(e)!==void 0:this.MidiConnection.ccInputBuffer.length>0);E(this,"buffer_cc",e=>e?this.MidiConnection.findCCFromBufferInChannel(e):this.MidiConnection.ccInputBuffer.shift());E(this,"show_scale",(e,t,n=0,i=this.MidiConnection.currentOutputIndex||0,a=!1)=>{(!this.scale_aid||t!==this.scale_aid)&&(this.hide_scale(e,t,n,i),NG(t,e).forEach(o=>{this.MidiConnection.sendMidiOn(o,n,1,i),a&&this.MidiConnection.sendAllSoundOff(n,i)}),this.scale_aid=t)});E(this,"hide_scale",(e=0,t=0,n=0,i=this.MidiConnection.currentOutputIndex||0)=>{Array.from(Array(128).keys()).forEach(s=>{this.MidiConnection.sendMidiOff(s,n,i)}),this.scale_aid=void 0});E(this,"midi_notes_off",(e=0,t=this.MidiConnection.currentOutputIndex||0)=>{this.MidiConnection.sendAllNotesOff(e,t)});E(this,"midi_sound_off",(e=0,t=this.MidiConnection.currentOutputIndex||0)=>{this.MidiConnection.sendAllSoundOff(e,t)});E(this,"generateCacheKey",(...e)=>e.map(t=>JSON.stringify(t)).join(","));E(this,"z",(e,t={},n="")=>{const i="z"+n.toString(),a=n===""?this.generateCacheKey(e,t):i;let s;return this.app.api.patternCache.has(a)&&(s=this.app.api.patternCache.get(a),s.input!==e&&(s=void 0)),s||(s=new zG(e,t,this.app),this.app.api.patternCache.set(a,s)),typeof n=="number"&&(s.zid=i),s.updateLastCallTime(),n!==""&&s.sync("z0"),s});E(this,"z0",(e,t={})=>this.z(e,t,0));E(this,"z1",(e,t={})=>this.z(e,t,1));E(this,"z2",(e,t={})=>this.z(e,t,2));E(this,"z3",(e,t={})=>this.z(e,t,3));E(this,"z4",(e,t={})=>this.z(e,t,4));E(this,"z5",(e,t={})=>this.z(e,t,5));E(this,"z6",(e,t={})=>this.z(e,t,6));E(this,"z7",(e,t={})=>this.z(e,t,7));E(this,"z8",(e,t={})=>this.z(e,t,8));E(this,"z9",(e,t={})=>this.z(e,t,9));E(this,"z10",(e,t={})=>this.z(e,t,10));E(this,"z11",(e,t={})=>this.z(e,t,11));E(this,"z12",(e,t={})=>this.z(e,t,12));E(this,"z13",(e,t={})=>this.z(e,t,13));E(this,"z14",(e,t={})=>this.z(e,t,14));E(this,"z15",(e,t={})=>this.z(e,t,15));E(this,"z16",(e,t={})=>this.z(e,t,16));E(this,"counter",(e,t,n)=>(e in this.counters?(this.counters[e].limit!==t&&(this.counters[e].value=0,this.counters[e].limit=t),this.counters[e].step!==n&&(this.counters[e].step=n??this.counters[e].step),this.counters[e].value+=this.counters[e].step,this.counters[e].limit!==void 0&&this.counters[e].value>this.counters[e].limit&&(this.counters[e].value=0)):this.counters[e]={value:0,step:n??1,limit:t},this.counters[e].value));E(this,"$",this.counter);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,"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,t)=>typeof e=="string"&&t===void 0?this.variables[e]:(this.variables[e]=t,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,"randI",(e,t)=>Math.floor(this.randomGen()*(t-e+1))+e);E(this,"rand",(e,t)=>this.randomGen()*(t-e)+e);E(this,"irand",this.randI);E(this,"rI",this.randI);E(this,"r",this.rand);E(this,"ir",this.randI);E(this,"seed",e=>{typeof e=="number"&&(e=e.toString()),this.currentSeed!==e&&(this.currentSeed=e,this.randomGen=jm(e))});E(this,"localSeededRandom",e=>{if(typeof e=="number"&&(e=e.toString()),this.localSeeds.has(e))return this.localSeeds.get(e);const t=jm(e);return this.localSeeds.set(e,t),t});E(this,"clearLocalSeed",(e=void 0)=>{e&&this.localSeeds.delete(e.toString()),this.localSeeds.clear()});E(this,"quantize",(e,t)=>{if(t.length===0)return e;let n=t[0];return t.forEach(i=>{Math.abs(i-e)Math.min(Math.max(e,t),n));E(this,"cmp",this.clamp);E(this,"nudge",e=>(e&&(this.app.clock.nudge=e),this.app.clock.nudge));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,t)=>{this.app.clock.time_signature=[e,t]});E(this,"prob",e=>this.randomGen()*100this.randomGen()>.5);E(this,"odds",(e,t=1)=>this.randomGen()!1);E(this,"almostNever",(e=1)=>this.randomGen()<.025*this.ppqn()/(this.ppqn()*e));E(this,"rarely",(e=1)=>this.randomGen()<.1*this.ppqn()/(this.ppqn()*e));E(this,"scarcely",(e=1)=>this.randomGen()<.25*this.ppqn()/(this.ppqn()*e));E(this,"sometimes",(e=1)=>this.randomGen()<.5*this.ppqn()/(this.ppqn()*e));E(this,"often",(e=1)=>this.randomGen()<.75*this.ppqn()/(this.ppqn()*e));E(this,"frequently",(e=1)=>this.randomGen()<.9*this.ppqn()/(this.ppqn()*e));E(this,"almostAlways",(e=1)=>this.randomGen()<.985*this.ppqn()/(this.ppqn()*e));E(this,"always",(e=1)=>!0);E(this,"dice",e=>Math.floor(this.randomGen()*e)+1);E(this,"cbar",()=>this.app.clock.time_position.bar+1);E(this,"ctick",()=>this.app.clock.tick+1);E(this,"cpulse",()=>this.app.clock.time_position.pulse+1);E(this,"cbeat",()=>this.app.clock.time_position.beat+1);E(this,"ebeat",()=>this.app.clock.beats_since_origin+1);E(this,"epulse",()=>this.app.clock.pulses_since_origin+1);E(this,"nominator",()=>this.app.clock.time_signature[0]);E(this,"meter",()=>this.app.clock.time_signature[1]);E(this,"denominator",this.meter);E(this,"fill",()=>this.app.fill);E(this,"beat",(e=1,t=0)=>(Array.isArray(e)?e:[e]).map(a=>(this.app.clock.pulses_since_origin-Math.floor(t*this.ppqn()))%Math.floor(a*this.ppqn())===0).some(a=>a===!0));E(this,"b",this.beat);E(this,"bar",(e=1,t=0)=>{const n=Array.isArray(e)?e:[e],i=this.app.clock.time_signature[1]*this.ppqn(),a=Math.floor(t*i);return n.map(o=>(this.app.clock.pulses_since_origin-a)%Math.floor(o*i)===0).some(o=>o===!0)});E(this,"B",this.bar);E(this,"pulse",(e=1,t=0)=>(Array.isArray(e)?e:[e]).map(a=>(this.app.clock.pulses_since_origin-t)%a===0).some(a=>a===!0));E(this,"p",this.pulse);E(this,"tick",(e,t=0)=>(Array.isArray(e)?e:[e]).map(a=>this.app.clock.time_position.pulse===a+t).some(a=>a===!0));E(this,"flip",(e,t=50)=>{let n=e*2;const i=this.app.clock.pulses_since_origin,a=Math.floor(n*this.ppqn()),s=Math.floor(t/100*a);return i%a{let t=e*2;const n=this.app.clock.time_position.bar;return Math.floor(n/t)%2===0});E(this,"onbar",(e,t=this.app.clock.time_signature[0])=>{let n=this.app.clock.time_position.bar%t+1;return typeof e=="number"?e===n:e.some(i=>i==n)});E(this,"onbeat",(...e)=>{let t=[];return e.forEach(n=>{let i=n%this.nominator()||this.nominator(),a=Math.floor(i);a=a==0?this.nominator():a;let s=Math.floor((i-a)*this.ppqn()+1);s<=0&&(s=s+this.ppqn()*this.nominator()),t.push(a===this.cbeat()&&this.cpulse()===s)}),t.some(n=>n==!0)});E(this,"oncount",(e,t)=>{typeof e=="number"&&(e=[e]);const n=this.app.clock.pulses_since_origin;let i=[];return e.forEach(a=>{a=a<1?0:a-1;const s=Math.ceil(a*this.ppqn()),o=n%(this.ppqn()*t);return i.push(o===s)}),i.some(a=>a==!0)});E(this,"oneuclid",(e,t,n=0)=>{const a=this._euclidean_cycle(e,t,n).reduce((s,o,l)=>(o&&s.push(l+1),s),[]);return this.oncount(a,t)});E(this,"delay",(e,t)=>{setTimeout(t,e)});E(this,"delayr",(e,t,n)=>{[...Array(t).keys()].map(a=>e*a).forEach((a,s)=>{setTimeout(n,a)})});E(this,"euclid",(e,t,n,i=0)=>this._euclidean_cycle(t,n,i)[e%n]);E(this,"ec",this.euclid);E(this,"rhythm",(e,t,n,i=0)=>this.beat(e)&&this._euclidean_cycle(t,n,i).beat(e));E(this,"bin",(e,t)=>{let i=t.toString(2).split("").map(a=>a==="1");return i[e%i.length]});E(this,"binrhythm",(e,t)=>{let i=t.toString(2).split("").map(a=>a==="1");return this.beat(e)&&i.beat(e)});E(this,"line",(e,t,n=1)=>{const i=[];if(t>e&&n>0||t(Math.sin(this.app.clock.ctx.currentTime*Math.PI*2*e)+n)*t);E(this,"usine",(e=1,t=1,n=0)=>(this.sine(e,n)+1)/2*t);E(this,"saw",(e=1,t=1,n=0)=>(this.app.clock.ctx.currentTime*e%1*2-1+n)*t);E(this,"usaw",(e=1,t=1,n=0)=>(this.saw(e,n)+1)/2*t);E(this,"triangle",(e=1,t=1,n=0)=>(Math.abs(this.saw(e,n))*2-1)*t);E(this,"utriangle",(e=1,t=1,n=0)=>(this.triangle(e,n)+1)/2*t);E(this,"square",(e=1,t=1,n=0,i=.5)=>{const a=1/e;return((Date.now()/1e3+n)%a/a(this.square(e,n,i)+1)/2*t);E(this,"noise",(e=1)=>(this.randomGen()*2-1)*e);E(this,"min",(...e)=>Math.min(...e));E(this,"max",(...e)=>Math.max(...e));E(this,"mean",(...e)=>e.reduce((n,i)=>n+i,0)/e.length);E(this,"range",(e,t,n,i,a)=>(e-t)/(n-t)*(a-i)+i);E(this,"limit",(e,t,n)=>Math.min(Math.max(e,t),n));E(this,"abs",Math.abs);E(this,"speak",(e,t="en-US",n=0,i=1,a=1)=>{new OR({text:e,lang:t,voice:n,rate:i,pitch:a}).speak().then(()=>{}).catch(o=>{console.log(o)})});E(this,"stop_hydra",()=>{this.app.hydra.hush()});E(this,"sound",e=>new tg(e,this.app));E(this,"snd",this.sound);E(this,"samples",Yi);E(this,"log",e=>{console.log(e),this._logMessage(e)});E(this,"scale",T_);E(this,"rate",e=>{});E(this,"divseq",(...e)=>{const t=e[0],n=e.slice(1),i=this.app.clock.pulses_since_origin,a=Math.floor(i/Math.floor(t*this.ppqn()));return n[a%n.length]});E(this,"seqbeat",(...e)=>e[this.app.clock.time_position.beat%e.length]);E(this,"seqbar",(...e)=>e[(this.app.clock.time_position.bar+1)%e.length]);E(this,"shuffle",e=>e.sort(()=>this.randomGen()-.5));E(this,"reverse",e=>e.reverse());E(this,"rotate",e=>t=>t.slice(e,t.length).concat(t.slice(0,e)));E(this,"repeat",e=>t=>t.flatMap(n=>Array(e).fill(n)));E(this,"repeatOdd",e=>t=>t.flatMap((n,i)=>i%2===0?Array(e).fill(n):n));E(this,"repeatEven",e=>t=>t.flatMap((n,i)=>i%2!==0?Array(e).fill(n):n));E(this,"palindrome",e=>e.concat(e.slice(0,e.length-1).reverse()));E(this,"scope",e=>{this.app.osc={...this.app.osc,...e}});this.app=e,this.MidiConnection=new QG(this,e.settings)}transmission(){return this.MidiConnection.activeNotes.length>0}_euclidean_cycle(e,t,n=0){if(e==t)return Array.from({length:t},()=>!0);function i(o,l){const c=o.length,u=(l+1)%c;return o[l]>o[u]}if(e>=t)return[!0];const a=Array.from({length:t},(o,l)=>(e*(l-1)%t+t)%t);let s=a.map((o,l)=>i(a,l));return n!=0&&(s=s.slice(n).concat(s.slice(0,n))),s}}const ZG=r=>{Array.prototype.square=function(){return this.map(e=>e*e)},Array.prototype.sometimes=function(e){return r.randomGen()<.5?e(this):this},Array.prototype.apply=function(e){return e(this)},Array.prototype.sqrt=function(){if(this.some(e=>e<0))throw new Error("Cannot take square root of negative number");return this.map(e=>Math.sqrt(e))},Array.prototype.add=function(e){return this.map(t=>t+e)},Array.prototype.sub=function(e){return this.map(t=>t-e)},Array.prototype.mult=function(e){return this.map(t=>t*e)},Array.prototype.div=function(e){if(e===0)throw new Error("Division by zero");return this.map(t=>t/e)},Array.prototype.pick=function(){return this[Math.floor(r.randomGen()*this.length)]},Array.prototype.gen=function(e,t,n){return n<1?[]:Array.from({length:n},()=>Math.floor(r.randomGen()*(t-e+1))+e)},Array.prototype.bar=function(e=1){return e===1?this[r.app.clock.time_position.bar%this.length]:this[Math.floor(r.app.clock.time_position.bar/e)%this.length]},Array.prototype.beat=function(e=1){const t=e,n=r.app.clock.pulses_since_origin,i=Math.floor(n/Math.floor(t*r.ppqn()));return this[i%this.length]},Array.prototype.b=Array.prototype.beat,Array.prototype.shuffle=function(){let e=this.length,t;for(;e!==0;)t=Math.floor(r.randomGen()*e),e--,[this[e],this[t]]=[this[t],this[e]];return this},Array.prototype.rotate=function(e){const t=this.length;if(e<0)e=t+e%t;else if(e>0)e=e%t;else return this;const n=this.splice(-e,e);return this.unshift(...n),this},Array.prototype.unique=function(){const e=new Set;let t=0;for(let n=0;n100)throw new Error("Amount should be between 0 and 100");if(this.length<=1)return this;for(let t=0;t1)this.splice(t,1);else return this;else t++;return this},Array.prototype.repeat=function(e=1){if(e<1)throw new Error("Amount should be at least 1");let t=[];for(let n=0;n(i%a+a)%a,n=cR(Ds(r));return this.map(i=>{const a=Math.floor(i/n.length)*12;return n[t(i,n.length)]+e+a})};Array.prototype.scaleArp=function(r="major",e=0){const t=cR(Ds(r));let n=[];e=e>t.length?t.length:e,e=e==0?t.length:e;for(let i=0;i{r.interface.line_numbers_checkbox.checked=r.settings.line_numbers,r.interface.time_position_checkbox.checked=r.settings.time_position,r.interface.tips_checkbox.checked=r.settings.tips,r.interface.midi_clock_checkbox.checked=r.settings.send_clock,r.interface.midi_channels_scripts.checked=r.settings.midi_channels_scripts,r.interface.midi_clock_ppqn.value=r.settings.midi_clock_ppqn.toString(),r.settings.time_position||r.interface.timeviewer.classList.add("hidden"),r.interface.load_demo_songs.checked=r.settings.load_demo_songs;const e=document.querySelectorAll('[id^="tab-"]');for(let t=0;t{e[t].classList.add("bg-orange-300");for(let s=0;s{hi(),r.updateKnownUniversesView(),xc()}),r.buttonElements.play_buttons.forEach(t=>{t.addEventListener("click",()=>{r.isPlaying?(r.setButtonHighlighting("pause",!0),r.isPlaying=!r.isPlaying,r.clock.pause(),r.api.MidiConnection.sendStopMessage()):(r.setButtonHighlighting("play",!0),r.isPlaying=!r.isPlaying,r.clock.start(),r.api.MidiConnection.sendStartMessage())})}),r.buttonElements.clear_buttons.forEach(t=>{t.addEventListener("click",()=>{r.setButtonHighlighting("clear",!0),confirm("Do you want to reset the current universe?")&&(r.universes[r.selected_universe]=structuredClone(t_),r.updateEditorView())})}),r.interface.documentation_button.addEventListener("click",()=>{XI(r)}),r.interface.destroy_universes_button.addEventListener("click",()=>{confirm("Do you want to destroy all universes?")&&(r.universes={...Xo},r.updateKnownUniversesView())}),r.interface.audio_nudge_range.addEventListener("input",()=>{r.clock.nudge=parseInt(r.interface.audio_nudge_range.value)}),r.interface.dough_nudge_range.addEventListener("input",()=>{r.dough_nudge=parseInt(r.interface.dough_nudge_range.value)}),r.interface.upload_universe_button.addEventListener("click",()=>{const t=document.createElement("input");t.type="file",t.accept=".json",t.addEventListener("change",n=>{var s;const a=(s=n.target.files)==null?void 0:s[0];if(a){const o=new FileReader;o.readAsText(a,"UTF-8"),o.onload=l=>{const c=JSON.parse(l.target.result);for(const[u,p]of Object.entries(c))r.universes[u]=p},o.onerror=l=>{console.error("An error occurred reading the file:",l)}}}),document.body.appendChild(t),t.click(),document.body.removeChild(t)}),r.interface.download_universe_button.addEventListener("click",()=>{r.settings.saveApplicationToLocalStorage(r.universes,r.settings);let t=`topos-universes-${Date.now()}.json`;const n=new Blob([JSON.stringify(r.settings.universes)],{type:"application/json"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}),r.interface.load_universe_button.addEventListener("click",()=>{let t=r.interface.buffer_search.value;t.length>2&&t.length<20&&!t.includes(" ")&&(Dc(r,t),r.settings.selected_universe=t,r.interface.buffer_search.value="",Vm(),r.view.focus(),FA())}),r.interface.eval_button.addEventListener("click",()=>{r.currentFile().candidate=r.view.state.doc.toString(),r.flashBackground("#404040",200)}),r.buttonElements.stop_buttons.forEach(t=>{t.addEventListener("click",()=>{r.setButtonHighlighting("stop",!0),r.isPlaying=!1,r.clock.stop()})}),r.interface.local_button.addEventListener("click",()=>r.changeModeFromInterface("local")),r.interface.global_button.addEventListener("click",()=>r.changeModeFromInterface("global")),r.interface.init_button.addEventListener("click",()=>r.changeModeFromInterface("init")),r.interface.note_button.addEventListener("click",()=>r.changeModeFromInterface("notes")),r.interface.font_family_selector.addEventListener("change",()=>{let t=r.interface.font_family_selector.value;console.log("Picking new font : "+t),r.settings.font=t,r.view.dispatch({effects:r.fontSize.reconfigure(Me.theme({"&":{fontSize:r.settings.font_size+"px"},".cm-content":{fontFamily:t,fontSize:r.settings.font_size+"px"},".cm-gutters":{fontSize:r.settings.font_size+"px"}}))})}),r.interface.font_size_input.addEventListener("input",()=>{let t=r.interface.font_size_input.value;r.settings.font_size=parseInt(t),r.view.dispatch({effects:r.fontSize.reconfigure(Me.theme({"&":{fontSize:r.settings.font_size+"px"},".cm-content":{fontFamily:r.settings.font,fontSize:r.settings.font_size+"px"},".cm-gutters":{fontSize:r.settings.font_size+"px"}}))})}),r.interface.settings_button.addEventListener("click",()=>{const t=document.getElementById("font-family");t&&(t.value=r.settings.font);const n=r.interface.dough_nudge_range;n.value=r.dough_nudge.toString();const i=document.getElementById("doughnumber");i.value=r.dough_nudge.toString(),r.settings.font_size===null&&(r.settings.font_size=12);const a=r.interface.font_size_input;a.value=r.settings.font_size.toString();const s=r.interface.line_numbers_checkbox;s.checked=r.settings.line_numbers;const o=r.interface.time_position_checkbox;o.checked=r.settings.time_position;const l=r.interface.tips_checkbox;l.checked=r.settings.tips;const c=r.interface.midi_clock_checkbox;c.checked=r.settings.send_clock;const u=r.interface.midi_channels_scripts;u.checked=r.settings.midi_channels_scripts;const p=r.interface.midi_clock_ppqn;p.value=r.settings.midi_clock_ppqn.toString();const m=r.interface.load_demo_songs;m.checked=r.settings.load_demo_songs;const _=r.interface.vim_mode_checkbox;_.checked=r.settings.vimMode;let v=document.getElementById("modal-settings"),I=document.getElementById("editor");v==null||v.classList.remove("invisible"),I==null||I.classList.add("invisible")}),r.interface.close_settings_button.addEventListener("click",()=>{let t=document.getElementById("modal-settings"),n=document.getElementById("editor");t==null||t.classList.add("invisible"),n==null||n.classList.remove("invisible");let i=r.interface.font_size_input.value;r.settings.font_size=parseInt(i),r.view.dispatch({effects:r.fontSize.reconfigure(Me.theme({"&":{fontSize:r.settings.font_size+"px"},".cm-content":{fontFamily:r.settings.font,fontSize:r.settings.font_size+"px"},".cm-gutters":{fontSize:r.settings.font_size+"px"}}))})}),r.interface.close_universes_button.addEventListener("click",()=>{xc()}),r.interface.share_button.addEventListener("click",async()=>{r.currentFile().candidate=r.view.state.doc.toString(),r.currentFile().committed=r.view.state.doc.toString(),r.settings.saveApplicationToLocalStorage(r.universes,r.settings),await vM(r)}),r.interface.vim_mode_checkbox.addEventListener("change",()=>{let t=!!r.interface.vim_mode_checkbox.checked;r.settings.vimMode=t,r.view.dispatch({effects:r.vimModeCompartment.reconfigure(t?f_():[])})}),r.interface.line_numbers_checkbox.addEventListener("change",()=>{let n=!!r.interface.line_numbers_checkbox.checked;r.settings.line_numbers=n,r.view.dispatch({effects:r.withLineNumbers.reconfigure(n?[ey()]:[])})}),r.interface.time_position_checkbox.addEventListener("change",()=>{let t=document.getElementById("timeviewer"),n=!!r.interface.time_position_checkbox.checked;r.settings.time_position=n,n?t.classList.remove("hidden"):t.classList.add("hidden")}),r.interface.tips_checkbox.addEventListener("change",()=>{let t=!!r.interface.tips_checkbox.checked;r.settings.tips=t,r.view.dispatch({effects:r.hoveringCompartment.reconfigure(t?rR:[])})}),r.interface.midi_clock_checkbox.addEventListener("change",()=>{let t=!!r.interface.midi_clock_checkbox.checked;r.settings.send_clock=t}),r.interface.midi_channels_scripts.addEventListener("change",()=>{let t=!!r.interface.midi_channels_scripts.checked;r.settings.midi_channels_scripts=t}),r.interface.midi_clock_ppqn.addEventListener("change",()=>{let t=parseInt(r.interface.midi_clock_ppqn.value);r.settings.midi_clock_ppqn=t}),r.interface.load_demo_songs.addEventListener("change",()=>{let t=!!r.interface.load_demo_songs.checked;r.settings.load_demo_songs=t}),r.interface.universe_creator.addEventListener("submit",t=>{t.preventDefault();let i=new FormData(r.interface.universe_creator).get("universe");i&&i.length>2&&i.length<20&&(Dc(r,i),r.settings.selected_universe=i,r.interface.buffer_search.value="",Vm(),r.view.focus())}),Ra(r,r.universes[r.selected_universe.toString()].init),["introduction","interface","interaction","code","time","sound","samples","synths","chaining","patterns","ziffers","midi","functions","lfos","probabilities","variables","shortcuts","about","bonus","oscilloscope"].forEach(t=>{let n="docs_"+t;document.getElementById(n).addEventListener("click",async()=>{n!=="docs_samples"?(r.currentDocumentationPane=t,Km(r)):(console.log("Loading samples!"),await bR().then(()=>{r.docs=WI(r),r.currentDocumentationPane=t,Km(r)}))})})},ST=r=>{if(!r)return;r.width=window.innerWidth,r.height=window.innerHeight;const e=r.getContext("2d"),t=window.devicePixelRatio||1;r.width=window.innerWidth*t,r.height=window.innerHeight*t,e&&e.scale(t,t)},jG=(r,e,t=!1)=>{e.addEventListener("resize",()=>ST(r.interface.scope)),e.addEventListener("resize",()=>ST(r.interface.feedback)),e.addEventListener("beforeunload",()=>(event.preventDefault(),r.currentFile().candidate=r.view.state.doc.toString(),r.currentFile().committed=r.view.state.doc.toString(),r.settings.saveApplicationToLocalStorage(r.universes,r.settings),r.clock.stop(),null)),t&&(localStorage.openpages=Date.now(),e.addEventListener("storage",function(n){n.key=="openpages"&&(localStorage.page_available=Date.now()),n.key=="page_available"&&(document.getElementById("all").classList.add("invisible"),alert("Topos is already opened in another tab. Close this tab now to prevent data loss."))},!1))};class JG{constructor(){E(this,"settings",new bM);E(this,"universes",Xo);E(this,"selected_universe","Welcome");E(this,"fill",!1);E(this,"local_index",1);E(this,"editor_mode","global");E(this,"fontSize");E(this,"withLineNumbers");E(this,"vimModeCompartment");E(this,"hoveringCompartment");E(this,"chosenLanguage");E(this,"dynamicPlugins");E(this,"currentDocumentationPane","introduction");E(this,"exampleCounter",0);E(this,"exampleIsPlaying",!1);E(this,"editorExtensions",[]);E(this,"userPlugins",[]);E(this,"state");E(this,"view");E(this,"selectedExample","");E(this,"docs",{});E(this,"_mouseX",0);E(this,"_mouseY",0);E(this,"show_error",!1);E(this,"buttonElements",{});E(this,"interface",{});E(this,"blinkTimeouts",{});E(this,"osc",{enabled:!1,color:"#fdba74",thickness:4,refresh:1,fftSize:256,orientation:"horizontal",is3D:!1,size:1});E(this,"api");E(this,"audioContext");E(this,"clock");E(this,"dough_nudge",20);E(this,"manualPlay",!1);E(this,"isPlaying",!1);E(this,"hydra_backend");E(this,"hydra");E(this,"updateKnownUniversesView",()=>{let e=document.getElementById("ui-known-universe-item-template");if(!e){console.warn("Missing template #ui-known-universe-item-template");return}let t=document.getElementById("existing-universes");if(!t){console.warn("Missing element #existing-universes");return}let n=document.createElement("ul");n.className="lg:h-80 lg:text-normal text-sm h-auto lg:w-80 w-auto lg:pb-2 lg:pt-2 overflow-y-scroll text-white lg:mb-4 border rounded-lg bg-neutral-800",n.append(...Object.keys(this.universes).map(i=>{var o,l;let a=e.content.cloneNode(!0),s=window;return a.querySelector(".universe-name").textContent=i,(o=a.querySelector(".load-universe"))==null||o.addEventListener("click",()=>s._loadUniverseFromInterface(i)),(l=a.querySelector(".delete-universe"))==null||l.addEventListener("click",()=>s._deleteUniverseFromInterface(i)),a})),t.innerHTML="",t.append(n)});this.initializeElements(),this.initializeButtonGroups(),this.initializeHydra(),this.setCanvas(this.interface.feedback),this.setCanvas(this.interface.scope),this.universes={...this.settings.universes,...Xo},EM(this),this.audioContext=new AudioContext({latencyHint:"playback"}),this.clock=new j$(this,this.audioContext),this.api=new XG(this),ZG(this.api),WG(this.api),Object.entries(this.api).forEach(([t,n])=>{globalThis[t]=n}),(async()=>{await bR()})(),this.docs=WI(this),T$(this),C$(this),KG(this),TT(this),X$(this),v2(this.interface.scope,this),Ra(this,this.universes[this.selected_universe.toString()].init),this.changeModeFromInterface("global"),TM(this)}getBuffer(e){const t=this.universes[this.selected_universe.toString()];return e==="locals"?t[e][this.local_index]:t[e]}get note_buffer(){return this.getBuffer("notes")}get example_buffer(){return this.getBuffer("example")}get global_buffer(){return this.getBuffer("global")}get init_buffer(){return this.getBuffer("init")}get local_buffer(){return this.getBuffer("locals")}changeToLocalBuffer(e){const t=document.querySelectorAll('[id^="tab-"]'),n=t[e];n.classList.add("bg-orange-300");for(let a=0;a{t.forEach(a=>{let s=a.children[0];s.classList.contains("text-orange-300")&&(s.classList.remove("text-orange-300"),a.classList.remove("text-orange-300"))}),i.children[0].classList.remove("text-white"),i.children[0].classList.add("text-orange-300"),i.classList.add("text-orange-300"),i.classList.add("fill-orange-300")};switch(e){case"local":this.interface.local_script_tabs.classList.contains("hidden")&&this.interface.local_script_tabs.classList.remove("hidden"),this.editor_mode="local",this.local_index=0,document.getElementById("editor").style.height="calc(100% - 100px)",this.changeToLocalBuffer(this.local_index),n(this.interface.local_button);break;case"global":this.interface.local_script_tabs.classList.contains("hidden")||this.interface.local_script_tabs.classList.add("hidden"),this.editor_mode="global",document.getElementById("editor").style.height="100%",n(this.interface.global_button);break;case"init":this.interface.local_script_tabs.classList.contains("hidden")||this.interface.local_script_tabs.classList.add("hidden"),this.editor_mode="init",n(this.interface.init_button);break;case"notes":this.interface.local_script_tabs.classList.contains("hidden")||this.interface.local_script_tabs.classList.add("hidden"),this.editor_mode="notes",n(this.interface.note_button);break}this.view.dispatch({effects:this.chosenLanguage.reconfigure(this.editor_mode=="notes"?[BL()]:[Gg()])}),this.updateEditorView()}setButtonHighlighting(e,t){document.getElementById("play-label").textContent=e!=="pause"?"Pause":"Play",e!=="pause"?(document.getElementById("pause-icon").classList.remove("hidden"),document.getElementById("play-icon").classList.add("hidden")):(document.getElementById("pause-icon").classList.add("hidden"),document.getElementById("play-icon").classList.remove("hidden")),e==="stop"&&(this.isPlaying==!1,document.getElementById("play-label").textContent="Play",document.getElementById("pause-icon").classList.add("hidden"),document.getElementById("play-icon").classList.remove("hidden")),this.flashBackground("#404040",200);const n=['[id^="play-button-"]','[id^="clear-button-"]','[id^="stop-button-"]'];let i;switch(e){case"play":i=0;break;case"pause":i=1;break;case"clear":i=2;break;case"stop":i=3;break}document.querySelectorAll(n[i]).forEach(a=>{t&&a.children[0].classList.add("animate-pulse")}),document.querySelectorAll(n.filter((a,s)=>s!=i).join(",")).forEach(a=>{a.children[0].classList.remove("animate-pulse"),a.children[1].classList.remove("animate-pulse")})}unfocusPlayButtons(){document.querySelectorAll('[id^="play-button-"]').forEach(e=>{e.children[0].classList.remove("fill-orange-300"),e.children[0].classList.remove("animate-pulse")})}updateEditorView(){this.view.dispatch({changes:{from:0,to:this.view.state.doc.toString().length,insert:this.currentFile().candidate}})}currentFile(){switch(this.editor_mode){case"global":return this.global_buffer;case"local":return this.local_buffer;case"init":return this.init_buffer;case"notes":return this.note_buffer}}flashBackground(e,t){const n=this.view.dom,i=n.getElementsByClassName("cm-gutter");n.classList.add("fluid-bg-transition"),Array.from(i).forEach(a=>a.classList.add("fluid-bg-transition")),n.style.backgroundColor=e,Array.from(i).forEach(a=>a.style.backgroundColor=e),setTimeout(()=>{n.style.backgroundColor="",Array.from(i).forEach(a=>a.style.backgroundColor=""),n.classList.remove("fluid-bg-transition"),Array.from(i).forEach(a=>a.classList.remove("fluid-bg-transition"))},t)}initializeElements(){for(const[e,t]of Object.entries(AM))this.interface[e]=document.getElementById(t)}initializeButtonGroups(){for(const[e,t]of Object.entries(IM))this.buttonElements[e]=t.map(n=>document.getElementById(n))}initializeHydra(){this.hydra_backend=new Hydra({canvas:this.interface.hydra_canvas,detectAudio:!1,enableStreamCapture:!1}),this.hydra=this.hydra_backend.synth}setCanvas(e){if(!e)return;const t=e.getContext("2d"),n=window.devicePixelRatio||1;e.width=window.innerWidth*n,e.height=window.innerHeight*n,t&&t.scale(n,n)}}let e5=new JG;jG(e5,window,!1); diff --git a/index.html b/index.html index 1ad0ae9..2b5f5cb 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - +